/* Styles for the OMR template editor and bubble grid preview. */

.ar-omr-editor .answer-key-preview {
    display: grid;
    grid-template-columns: repeat(15, minmax(36px, 1fr));
    gap: 4px;
    padding: 8px;
    background: #f9f9fb;
    border-radius: 8px;
}

.ar-omr-editor .answer-key-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 2px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.85rem;
    transition: background 0.15s;
}

.ar-omr-editor .answer-key-cell .answer-key-num {
    font-size: 0.65rem;
    color: #999;
}

.ar-omr-editor .answer-key-cell .answer-key-letter {
    font-weight: 600;
    color: #444;
}

.ar-omr-editor .answer-key-cell.is-marked {
    background: #e3f2fd;
    border-color: #1976d2;
}

.ar-omr-editor .answer-key-cell.is-marked .answer-key-letter {
    color: #1976d2;
}

.ar-omr-editor .bubble-preview-wrapper {
    background: #fff;
    border-radius: 8px;
    padding: 8px;
    overflow-x: auto;
}

.ar-omr-editor .bubble-svg {
    display: block;
    min-width: 600px;
}

.ar-omr-editor textarea {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.ar-omr-editor .rz-tabview > .rz-tabview-panels {
    background: transparent;
}

/* BulkOmrScan right-panel editable 90-question grid (T-10 / AC-12).
   Boxless compact list: 3 columns preserved, each answer is a plain
   row [N. | A B C D | x] with number on the left, minimal gaps,
   no per-answer rectangles — status shown via soft tint only. */
.omr-answer-grid {
    display: flex;
    flex-direction: column;
    gap: 1px;
    height: calc(100vh - 360px);
    min-height: 420px;
    overflow-y: auto;
    padding: 0.25rem 0.2rem;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
}
.omr-answer-grid .omr-answer-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 0.5rem;
    row-gap: 1px;
}
.omr-answer-grid .omr-answer-cell {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: nowrap;
    white-space: nowrap;
    gap: 0.35rem;
    padding: 0 2px;
    min-width: 0;
    border: none;
    border-radius: 0;
    background: transparent !important;
    text-align: left;
}
.omr-answer-grid .omr-answer-cell.is-empty,
.omr-answer-grid .omr-answer-cell.is-ambiguous,
.omr-answer-grid .omr-answer-cell.is-locked {
    background: transparent !important;
    border: none;
}
.omr-answer-grid .omr-answer-cell.is-empty .omr-qnum {
    color: #b58900;
}
.omr-answer-grid .omr-answer-cell.is-ambiguous .omr-qnum {
    color: #c62828;
}
.omr-answer-grid .omr-qnum {
    min-width: 24px;
    text-align: right;
    font-weight: 700;
    font-size: 0.72rem;
    color: #555;
    flex: 0 0 auto;
    order: -1;
    margin: 0;
}
.omr-answer-grid .omr-qflag {
    color: #c62828;
    font-weight: 800;
    font-size: 0.75rem;
    flex-shrink: 0;
}
.omr-answer-grid .omr-bubbles {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    flex-wrap: nowrap;
    flex-shrink: 0;
    min-width: 0;
    order: 0;
}
.omr-bubble {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1.5px solid #9e9e9e;
    background: #fff;
    color: #555;
    font-size: 0.6rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: border-color 0.12s, background 0.12s, color 0.12s;
}
.omr-bubble:hover:not(:disabled) {
    border-color: #1976d2;
    color: #1976d2;
}
.omr-bubble.is-selected {
    background: #212121;
    border-color: #212121;
    color: #fff;
}
.omr-bubble:disabled {
    cursor: default;
    opacity: 0.6;
}
.omr-bubble.is-selected:disabled {
    opacity: 1;
}
.omr-answer-grid .omr-answer-cell.is-locked .omr-bubble:not(.is-selected) {
    background: #ececec;
    border-color: #bdbdbd;
    color: #9e9e9e;
}
.omr-answer-grid .omr-clear {
    border: none;
    background: transparent;
    color: #888;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1;
    padding: 0 1px;
    flex-shrink: 0;
    order: 1;
}
.omr-answer-grid .omr-clear:hover {
    color: #c62828;
}
.omr-legend {
    display: flex;
    gap: 0.7rem;
    flex-wrap: wrap;
    align-items: center;
    font-size: 0.7rem;
    color: #666;
    padding: 0.1rem 0.2rem 0.25rem;
}
.omr-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 4px;
    vertical-align: middle;
}
.omr-dot.empty {
    background: #ffe082;
    border: 1px solid #e6c200;
}
.omr-dot.ambiguous {
    background: #ffab91;
    border: 1px solid #e57373;
}
.omr-dot.detected {
    background: #e0e0e0;
    border: 1px solid #9e9e9e;
}
/* Inner grid stays 3 columns on all screens (incl. mobile) — compact instead of stacking. */
@media (max-width: 480px) {
    .omr-answer-grid {
        padding: 0.2rem 0.1rem;
        gap: 1px;
    }
    .omr-answer-grid .omr-answer-row {
        column-gap: 0.3rem;
        row-gap: 1px;
    }
    .omr-answer-grid .omr-answer-cell {
        padding: 1px 1px;
        gap: 0.2rem;
    }
    .omr-answer-grid .omr-qnum {
        min-width: 16px;
        font-size: 0.68rem;
    }
    .omr-answer-grid .omr-bubbles {
        gap: 0.15rem;
    }
    .omr-bubble {
        width: 18px;
        height: 18px;
        font-size: 0.55rem;
    }
}