.omni-mega-quiz,
.omni-mega-teacher,
.omni-mega-admin-note {
    max-width: 980px;
    margin: 0 auto 20px;
}

.omni-mega-quiz {
    background: #fff;
    border: 1px solid #d9e2ec;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .08);
}

.omni-mega-progress {
    height: 8px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
    margin: 12px 0 18px;
}

.omni-mega-progress span {
    display: block;
    height: 100%;
    background: #2270b8;
    transition: width .2s ease;
}

.omni-mega-card h2 {
    font-size: calc(clamp(1.35rem, 2vw, 2rem) + var(--omni-readable-font-adjust, 0px));
    line-height: 1.25;
    margin: 0 0 10px;
    text-align: center;
}

.omni-mega-question-image {
    display: block;
    width: auto;
    max-width: min(100%, 520px);
    max-height: 260px;
    object-fit: contain;
    margin: 0 auto 16px;
    border-radius: 8px;
    box-shadow: 0 5px 16px rgba(15, 23, 42, .1);
}

.omni-mega-instructions,
.omni-mega-activity-hint {
    color: #475569;
    font-size: calc(16px + var(--omni-readable-font-adjust, 0px));
    text-align: center;
}

.omni-mega-activity-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 38px;
    margin: 0 auto 16px;
    padding: 10px 14px 14px;
    border: 1px solid #d9e3f0;
    border-radius: 8px;
    background: #f7fbff;
    color: #26324a;
    font-size: calc(15px + var(--omni-readable-font-adjust, 0px));
    font-weight: 600;
    line-height: 1.35;
    box-sizing: border-box;
}

.omni-mega-options {
    display: grid;
    gap: 10px;
    margin: 18px 0;
}

.omni-mega-options label {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: center;
    border: 1px solid #dbe4ee;
    border-radius: 10px;
    padding: 12px;
    background: #f8fafc;
    cursor: pointer;
}

.omni-mega-options span {
    font-size: calc(16px + var(--omni-readable-font-adjust, 0px));
    font-weight: 600;
}

.omni-mega-option-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.omni-mega-option-image {
    flex: 0 0 auto;
    width: 90px;
    height: 70px;
    object-fit: cover;
    border: 1px solid #dbe4ee;
    border-radius: 8px;
    background: #fff;
}

.omni-mega-text-input,
.omni-mega-save input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 12px;
    font-size: calc(16px + var(--omni-readable-font-adjust, 0px));
}

.omni-mega-text-input {
    display: block;
    width: 100% !important;
    max-width: 560px;
    min-height: 58px;
    margin: 24px auto 0 !important;
    padding: 14px 18px;
    border: 2px solid #d9e3f0;
    border-radius: 12px;
    background: #f8fbff;
    color: #0f172a;
    font-weight: 600;
    text-align: center;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, .04), 0 8px 20px rgba(15, 23, 42, .06);
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.omni-mega-text-input:focus {
    border-color: #2270b8;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(34, 112, 184, .14), 0 8px 20px rgba(15, 23, 42, .08);
    outline: none;
}

.omni-mega-text-input::placeholder {
    color: #7890aa;
    font-weight: 500;
}

.omni-mega-matching,
.omni-mega-sorting {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 16px;
}

.omni-mega-connect-board {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(34px, 6vw, 86px);
    max-width: 900px;
    margin: 18px auto 0;
    align-items: start;
}

.omni-mega-connect-lines {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
}

.omni-mega-connect-lines path {
    fill: none;
    stroke: var(--mq-match-color, #2e7d32);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 2px 3px rgba(15, 23, 42, .18));
}

.omni-mega-connect-column {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.omni-mega-connect-row {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 70px;
}

.omni-mega-connect-row--left {
    justify-content: flex-end;
}

.omni-mega-connect-row--right {
    justify-content: flex-start;
}

.omni-mega-connect-content {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 58px;
    width: min(100%, 320px);
    padding: 13px 16px;
    border: 2px solid #d7dee8;
    border-radius: 10px;
    background: #fff;
    color: #0a1242;
    font-size: calc(17px + var(--omni-readable-font-adjust, 0px));
    font-weight: 700;
    line-height: 1.25;
    box-shadow: 0 5px 16px rgba(15, 23, 42, .08);
    box-sizing: border-box;
}

.omni-mega-connect-content--left {
    justify-content: flex-end;
    text-align: right;
}

.omni-mega-connect-content--left .omni-mega-connect-image {
    order: 2;
}

.omni-mega-connect-image {
    flex: 0 0 auto;
    width: 68px;
    height: 52px;
    object-fit: cover;
    border: 1px solid #d7dee8;
    border-radius: 6px;
    background: #fff;
}

.omni-mega-connect-content--right {
    justify-content: flex-start;
    text-align: left;
}

.omni-mega-connect-dot {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 4px solid #1f2a44;
    border-radius: 999px;
    background: #fff;
    cursor: pointer;
    transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.omni-mega-connect-dot:hover,
.omni-mega-connect-row.is-pending .omni-mega-connect-dot {
    border-color: #2f80ed;
    box-shadow: 0 0 0 5px rgba(47, 128, 237, .14);
    transform: scale(1.04);
}

.omni-mega-connect-row.is-connected .omni-mega-connect-dot {
    border-color: var(--mq-match-color, #2e7d32);
    background: var(--mq-match-color, #2e7d32);
    box-shadow: inset 0 0 0 6px #fff;
}

.omni-mega-connect-row.is-connected .omni-mega-connect-content {
    border-color: color-mix(in srgb, var(--mq-match-color, #2e7d32) 55%, #ffffff);
    background: var(--mq-match-bg, #f3fbf4);
    box-shadow: 0 5px 16px color-mix(in srgb, var(--mq-match-color, #2e7d32) 18%, transparent);
}

.omni-mega-token-pool {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    min-height: 54px;
    max-width: 900px;
    margin: 18px auto 6px;
}

.omni-mega-sort-token {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 9px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    color: #111827;
    font-size: calc(18px + var(--omni-readable-font-adjust, 0px));
    line-height: 1.2;
    box-shadow: 0 2px 6px rgba(15, 23, 42, .06);
    cursor: grab;
    touch-action: none;
    user-select: none;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease;
}

.omni-mega-sort-token--image {
    min-width: 92px;
    min-height: 82px;
    padding: 6px;
}

.omni-mega-sort-image {
    width: 82px;
    height: 68px;
    object-fit: cover;
    border-radius: 5px;
    display: block;
}

.omni-mega-sort-token:active {
    cursor: grabbing;
}

.omni-mega-sort-token:hover,
.omni-mega-sort-token.is-selected {
    transform: translateY(-2px);
    border-color: #2f80ed;
    box-shadow: 0 7px 14px rgba(15, 23, 42, .12);
}

.omni-mega-sort-token.is-selected {
    background: #eef6ff;
    box-shadow: 0 0 0 4px rgba(47, 128, 237, .12);
}

.omni-mega-sort-token.is-dragging {
    opacity: .55;
    transform: scale(.96);
}

.omni-mega-baskets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 18px;
    width: min(100%, 980px);
    margin: 14px auto 0;
    align-items: stretch;
}

.omni-mega-basket {
    min-height: 145px;
    padding: 14px;
    border: 2px dashed #8aa7bd;
    border-radius: 16px;
    background: #e7f7fb;
    box-sizing: border-box;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.omni-mega-basket:hover {
    border-color: #2f80ed;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .1);
    transform: translateY(-1px);
}

.omni-mega-token-pool.is-drag-over,
.omni-mega-basket.is-drag-over {
    border-color: #2f80ed;
    box-shadow: 0 0 0 5px rgba(47, 128, 237, .13);
}

.omni-mega-token-pool.is-drag-over {
    border-radius: 12px;
    outline: 2px dashed #2f80ed;
    outline-offset: 6px;
}

.omni-mega-basket:nth-child(5n + 2) {
    background: #ffdc55;
}

.omni-mega-basket:nth-child(5n + 3) {
    background: #ff9800;
}

.omni-mega-basket:nth-child(5n + 4) {
    background: #c8e6b8;
}

.omni-mega-basket:nth-child(5n + 5) {
    background: #b5e1f4;
}

.omni-mega-basket h3 {
    margin: 0 0 12px;
    color: #374151;
    font-size: calc(20px + var(--omni-readable-font-adjust, 0px));
    font-weight: 500;
    line-height: 1.2;
    text-align: center;
}

.omni-mega-basket-items {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    min-height: 54px;
}

@media (min-width: 760px) {
    .omni-mega-baskets {
        grid-template-columns: repeat(var(--mq-basket-count, 3), minmax(190px, 1fr));
    }
}

.omni-mega-fill-gaps {
    display: grid;
    gap: 22px;
    max-width: 900px;
    margin: 22px auto 0;
}

.omni-mega-gap-options {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.omni-mega-gap-option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 100px;
    min-height: 48px;
    padding: 10px 16px;
    border: 1px solid #d8e1ec;
    border-radius: 10px;
    background: #fff;
    color: #111827;
    box-shadow: 0 3px 8px rgba(15, 23, 42, .06);
    cursor: grab;
    font-size: calc(17px + var(--omni-readable-font-adjust, 0px));
    line-height: 1.2;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}

.omni-mega-gap-option:hover,
.omni-mega-gap-option:focus,
.omni-mega-gap-option.is-selected {
    border-color: #4a8eff;
    background: #eef6ff;
    box-shadow: 0 7px 16px rgba(15, 23, 42, .1);
    transform: translateY(-2px);
}

.omni-mega-gap-option.is-dragging {
    opacity: .55;
    transform: scale(.97);
}

.omni-mega-gap-card {
    padding: 25px;
    border-radius: 15px;
    background: #f8f9fd;
    box-shadow: 0 3px 10px rgba(0, 0, 0, .05);
}

.omni-mega-gap-text {
    display: grid;
    gap: 12px;
    color: #111827;
    font-size: calc(20px + var(--omni-readable-font-adjust, 0px));
    line-height: 1.55;
}

.omni-mega-gap-line {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 4px 0;
    margin: 0;
    text-align: center;
}

.omni-mega-gap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 130px;
    min-height: 50px;
    margin: 0 8px;
    padding: 0 15px;
    border: 2px dashed #6c90e0;
    border-radius: 14px;
    background: rgba(108, 144, 224, .05);
    color: #4a6bbd;
    font-weight: 800;
    vertical-align: middle;
    position: relative;
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

.omni-mega-gap.is-filled {
    border-style: solid;
    background: #f0f5ff;
}

.omni-mega-gap.is-drag-over,
.omni-mega-gap:hover,
.omni-mega-gap:focus {
    border-color: #4a8eff;
    background: rgba(74, 142, 255, .1);
    outline: none;
}

.omni-mega-gap-content {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 1.4em;
}

.omni-mega-gap-remove {
    position: absolute;
    top: -9px;
    right: -9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: 0;
    border-radius: 999px;
    background: #d63638;
    color: #fff;
    font-size: 14px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: opacity .18s ease;
}

.omni-mega-gap:hover .omni-mega-gap-remove,
.omni-mega-gap:focus-within .omni-mega-gap-remove {
    opacity: 1;
}

.omni-mega-ordering {
    display: grid;
    gap: 10px;
    max-width: 820px;
    margin: 24px auto 0;
}

.omni-mega-order-item {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    min-height: 62px;
    padding: 12px 14px;
    border: 2px solid #dbe4ee;
    border-radius: 12px;
    background: #f8fafc;
    box-shadow: 0 4px 12px rgba(15, 23, 42, .06);
    cursor: grab;
    user-select: none;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease, background .16s ease;
}

.omni-mega-order-item:hover,
.omni-mega-order-item.is-drag-over {
    border-color: #2270b8;
    background: #f3f8ff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .1);
}

.omni-mega-order-item.is-dragging {
    opacity: .55;
    transform: scale(.98);
}

.omni-mega-order-handle {
    color: #64748b;
    font-size: calc(20px + var(--omni-readable-font-adjust, 0px));
    line-height: 1;
}

.omni-mega-order-position {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: #2270b8;
    color: #fff;
    font-size: calc(16px + var(--omni-readable-font-adjust, 0px));
    font-weight: 800;
}

.omni-mega-order-text {
    color: #0f172a;
    font-size: calc(18px + var(--omni-readable-font-adjust, 0px));
    font-weight: 700;
    line-height: 1.25;
}

.omni-mega-order-actions {
    display: inline-flex;
    gap: 6px;
}

.omni-mega-order-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid #bfd0e4;
    border-radius: 8px;
    background: #fff;
    color: #1d4f82;
    font-size: calc(18px + var(--omni-readable-font-adjust, 0px));
    font-weight: 800;
    cursor: pointer;
}

.omni-mega-order-actions button:hover:not(:disabled),
.omni-mega-order-actions button:focus:not(:disabled) {
    border-color: #2270b8;
    background: #eef6ff;
}

.omni-mega-order-actions button:disabled {
    opacity: .35;
    cursor: not-allowed;
}

.omni-mega-nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 12px;
    align-items: center;
    margin-top: 20px;
}

.omni-mega-nav [data-mega-prev] {
    grid-column: 1;
    justify-self: start;
}

.omni-mega-nav [data-mega-restart] {
    grid-column: 2;
    justify-self: center;
}

.omni-mega-nav [data-mega-next],
.omni-mega-nav [data-mega-finish] {
    grid-column: 3;
    justify-self: end;
}

.omni-mega-btn {
    border: 1px solid #2270b8;
    background: #fff;
    color: #1d4f82;
    border-radius: 6px;
    padding: 10px 16px;
    font-size: calc(16px + var(--omni-readable-font-adjust, 0px));
    font-weight: 700;
    cursor: pointer;
}

.omni-mega-btn--primary {
    background: #2270b8;
    color: #fff;
}

.omni-mega-btn--restart {
    background: #f4fbf4;
    border-color: #4a8a3d;
    color: #245f1f;
}

.omni-mega-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.omni-mega-summary {
    border-top: 1px solid #e2e8f0;
    margin-top: 20px;
    padding-top: 20px;
}

.omni-mega-score {
    font-size: 3rem;
    font-weight: 800;
    color: #2270b8;
    margin: 0;
}

.omni-mega-result-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid #e2e8f0;
    padding: 8px 0;
}

.omni-mega-answer-review {
    display: grid;
    gap: 14px;
    margin-top: 24px;
}

.omni-mega-answer-review > h3 {
    margin: 0;
    font-size: calc(1.25rem + var(--omni-readable-font-adjust, 0px));
    color: #1f2937;
}

.omni-mega-answer-review-block {
    border: 1px solid #dbe5f1;
    border-radius: 8px;
    background: #fbfdff;
    padding: 14px;
}

.omni-mega-answer-review-block h3 {
    margin: 0 0 10px;
    font-size: calc(1rem + var(--omni-readable-font-adjust, 0px));
    color: #0f2d52;
}

.omni-mega-answer-review-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    border: 1px solid #d9e2ec;
    border-radius: 8px;
    background: #fff;
    padding: 10px 12px;
}

.omni-mega-answer-review-item + .omni-mega-answer-review-item {
    margin-top: 8px;
}

.omni-mega-answer-review-item.is-correct {
    border-color: #8bc486;
    background: #f4fbf4;
}

.omni-mega-answer-review-item.is-wrong {
    border-color: #f0a7a7;
    background: #fff7f7;
}

.omni-mega-answer-review-status {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-weight: 800;
    line-height: 1;
}

.omni-mega-answer-review-item.is-correct .omni-mega-answer-review-status {
    background: #2e7d32;
    color: #fff;
}

.omni-mega-answer-review-item.is-wrong .omni-mega-answer-review-status {
    background: #c62828;
    color: #fff;
}

.omni-mega-answer-review-body {
    display: grid;
    gap: 4px;
}

.omni-mega-answer-review-body p {
    margin: 0;
}

.omni-mega-answer-review-body span,
.omni-mega-answer-review-question {
    font-weight: 700;
    color: #1f2937;
}

.omni-mega-single-choice-list {
    display: grid;
    gap: 18px;
}

.omni-mega-subquestion {
    display: grid;
    gap: 12px;
}

.omni-mega-subquestion + .omni-mega-subquestion {
    padding-top: 18px;
    border-top: 1px solid #e2e8f0;
}

.omni-mega-subquestion-number {
    margin: 0;
    color: #60758f;
    font-size: calc(14px + var(--omni-readable-font-adjust, 0px));
    font-weight: 800;
    text-align: center;
}

.omni-mega-subquestion-title {
    margin: 0;
    color: #333;
    font-size: calc(clamp(22px, 2vw, 30px) + var(--omni-readable-font-adjust, 0px));
    line-height: 1.28;
    text-align: center;
}

.omni-mega-reading {
    display: grid;
    gap: 24px;
    margin-top: 16px;
}

.omni-mega-reading-text {
    display: grid;
    gap: 12px;
    padding: 22px 24px;
    border: 1px solid #d9e3f0;
    border-radius: 12px;
    background: #f8fbff;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .06);
}

.omni-mega-reading-text p {
    margin: 0;
    color: #1f2937;
    font-size: calc(18px + var(--omni-readable-font-adjust, 0px));
    line-height: 1.65;
}

.omni-mega-reading-questions {
    display: grid;
    gap: 20px;
}

.omni-mega-reading-question {
    display: grid;
    gap: 12px;
    padding-top: 18px;
    border-top: 1px solid #e2e8f0;
}

.omni-mega-options--inline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.omni-mega-save {
    margin-top: 18px;
    padding: 14px;
    border: 1px solid #dbe4ee;
    border-radius: 8px;
    background: #f8fafc;
}

.omni-mega-save label {
    display: block;
    font-weight: 700;
    margin-bottom: 10px;
}

@media (max-width: 760px) {
    .omni-mega-quiz {
        padding: 12px;
    }

    .omni-mega-connect-board {
        grid-template-columns: 1fr;
    }

    .omni-mega-connect-board {
        gap: 18px;
    }

    .omni-mega-connect-row,
    .omni-mega-connect-row--left,
    .omni-mega-connect-row--right {
        justify-content: center;
    }

    .omni-mega-connect-content,
    .omni-mega-connect-content--left,
    .omni-mega-connect-content--right {
        width: min(100%, 360px);
        justify-content: center;
        text-align: center;
    }

    .omni-mega-gap-card {
        padding: 16px;
    }

    .omni-mega-reading-text {
        padding: 16px;
    }

    .omni-mega-options--inline {
        grid-template-columns: 1fr;
    }

    .omni-mega-order-item {
        grid-template-columns: auto auto minmax(0, 1fr);
    }

    .omni-mega-order-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }

    .omni-mega-nav {
        grid-template-columns: 1fr;
    }

    .omni-mega-nav [data-mega-prev],
    .omni-mega-nav [data-mega-restart],
    .omni-mega-nav [data-mega-next],
    .omni-mega-nav [data-mega-finish] {
        grid-column: 1;
        justify-self: stretch;
    }

    .omni-mega-btn {
        width: 100%;
    }
}
