.model2-shell {
    max-width: 1100px;
}

:root {
    --bg: #2b2f33;
    --ink: #e7edf3;
    --muted: #a6b2be;
    --line: #4a5563;
    --panel: #333941;
    --accent: #6ea6d9;
    --accent-strong: #9ac7ee;
    --warn: #d6a86f;
    --bad: #e08d87;
}

body {
    background:
        radial-gradient(circle at top left, rgba(110, 166, 217, 0.16), transparent 34rem),
        radial-gradient(circle at bottom right, rgba(214, 168, 111, 0.10), transparent 28rem),
        linear-gradient(135deg, #2b2f33 0%, #30353b 54%, #282d32 100%);
    color: #e7edf3;
}

.topbar,
.controls,
.quiz-card {
    background: rgba(51, 57, 65, 0.92);
    border-color: #4a5563;
    box-shadow: 0 16px 46px rgba(12, 16, 20, 0.22);
}

.topbar h1,
.model-name {
    color: #edf3f8;
}

.eyebrow,
.side-label,
.grade-note {
    color: #a6b2be;
}

.nav-links a,
.ghost-button,
.segmented,
.segmented button {
    border-color: #556372;
    color: #c9d8e7;
}

.segmented {
    background: #343c45;
}

.segmented button {
    background: #343c45;
    color: #d7e2ee;
}

.segmented button.is-active,
.actions button:first-child {
    background: #5f8fbf;
    color: #101820;
}

.pill {
    background: #5f8fbf;
    color: #101820;
}

.region-tag {
    align-items: center;
    border: 1px solid rgba(210, 224, 238, 0.28);
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.75rem;
    font-weight: 900;
    letter-spacing: 0.02em;
    line-height: 1;
    min-height: 28px;
    padding: 0 10px;
    white-space: nowrap;
}

.region-tag[hidden] {
    display: none;
}

.region-tag[data-region="telencephalon"] {
    background: rgba(158, 194, 237, 0.18);
    border-color: rgba(158, 194, 237, 0.46);
    color: #cfe3ff;
}

.region-tag[data-region="diencephalon"] {
    background: rgba(181, 220, 174, 0.17);
    border-color: rgba(181, 220, 174, 0.44);
    color: #d7f0cf;
}

.region-tag[data-region="mesencephalon"] {
    background: rgba(245, 208, 142, 0.16);
    border-color: rgba(245, 208, 142, 0.42);
    color: #f6ddaa;
}

.region-tag[data-region="metencephalon"] {
    background: rgba(195, 181, 237, 0.17);
    border-color: rgba(195, 181, 237, 0.42);
    color: #ded5ff;
}

.region-tag[data-region="medulla-oblongata"] {
    background: rgba(232, 166, 162, 0.16);
    border-color: rgba(232, 166, 162, 0.42);
    color: #ffd0cc;
}

.subregion-tag {
    background: rgba(220, 229, 238, 0.10);
    border-color: rgba(220, 229, 238, 0.26);
    color: #c9d8e7;
    font-size: 0.7rem;
}

#topic-label {
    color: #b8c7d6;
}

.nav-links a:hover,
.ghost-button:hover,
.segmented button:hover {
    background: rgba(110, 166, 217, 0.10);
    border-color: #6ea6d9;
    color: #e8f3ff;
}

.progress-track {
    background: #444c55;
}

.model2-shell > .progress-track {
    display: none;
}

button:focus-visible,
.nav-links a:focus-visible {
    outline-color: rgba(110, 166, 217, 0.36);
}

#progress-fill {
    background: linear-gradient(90deg, #6ea6d9, #d6a86f);
}

.model2-controls {
    gap: 14px;
}

.model2-lookup {
    background: rgba(51, 57, 65, 0.96);
    border: 1px solid #4a5563;
    border-radius: 8px;
    box-shadow: 0 16px 46px rgba(12, 16, 20, 0.24);
    color: #e7edf3;
    padding: 12px;
    position: fixed;
    left: calc(50% + 570px);
    top: 146px;
    width: min(260px, calc((100vw - 1100px) / 2 - 32px));
    z-index: 4;
}

.model2-lookup label {
    color: #9ac7ee;
    display: block;
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.14em;
    margin: 0 0 7px;
    text-transform: uppercase;
}

.lookup-input-row {
    display: grid;
    gap: 6px;
    grid-template-columns: minmax(0, 1fr) 30px;
}

.lookup-input-row input {
    background: #2f353c;
    border: 1px solid #5d6c7c;
    border-radius: 8px;
    color: #e7edf3;
    font-size: 0.95rem;
    font-weight: 800;
    min-width: 0;
    padding: 8px 10px;
}

.lookup-input-row input:focus {
    border-color: #6ea6d9;
    box-shadow: 0 0 0 4px rgba(110, 166, 217, 0.16);
    outline: none;
}

.lookup-input-row button {
    background: #38414a;
    border: 1px solid #5d6c7c;
    border-radius: 8px;
    cursor: pointer;
    display: grid;
    height: 34px;
    padding: 0;
    place-items: center;
    position: relative;
    width: 30px;
}

.lookup-input-row button::before,
.lookup-input-row button::after {
    background: #d8eaff;
    border-radius: 999px;
    content: "";
    height: 2px;
    position: absolute;
    width: 13px;
}

.lookup-input-row button::before {
    transform: rotate(45deg);
}

.lookup-input-row button::after {
    transform: rotate(-45deg);
}

.lookup-result {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.lookup-result p {
    color: #c9d8e7;
    font-size: 0.8rem;
    line-height: 1.45;
    margin: 0;
}

.lookup-result:empty {
    display: none;
}

.lookup-title {
    color: #edf3f8;
    font-size: 0.95rem;
    font-weight: 900;
    line-height: 1.2;
    margin: 0;
}

.lookup-number {
    color: #9ac7ee;
    font-size: 1.1rem;
    font-weight: 900;
}

.lookup-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.lookup-note {
    background: rgba(214, 168, 111, 0.10);
    border-left: 3px solid rgba(214, 168, 111, 0.55);
    border-radius: 6px;
    padding: 7px 9px;
}

.model2-card {
    display: grid;
    gap: 22px;
}

.smart-complete-flash {
    animation: smartCompleteFlash 900ms ease-out forwards;
    background:
        radial-gradient(circle at center, rgba(155, 245, 186, 0.82), rgba(75, 184, 116, 0.45) 34%, rgba(75, 184, 116, 0.10) 68%, transparent 100%);
    inset: 0;
    pointer-events: none;
    position: fixed;
    z-index: 9999;
}

@keyframes smartCompleteFlash {
    0% {
        opacity: 0;
        transform: scale(0.98);
    }

    18% {
        opacity: 1;
        transform: scale(1);
    }

    100% {
        opacity: 0;
        transform: scale(1.05);
    }
}

.model2-card .question-meta {
    flex-wrap: wrap;
}

.card-frame {
    position: relative;
}

.inline-focus-button {
    background: #38414a;
    border: 1px solid #5d6c7c;
    border-radius: 999px;
    color: #d8eaff;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 900;
    padding: 10px 16px;
    position: absolute;
    right: 18px;
    top: 18px;
    z-index: 2;
}

.inline-focus-button:hover,
.inline-focus-button:focus-visible {
    border-color: #6ea6d9;
    box-shadow: 0 0 0 4px rgba(110, 166, 217, 0.18);
    outline: none;
}

.card-surface {
    width: 100%;
    min-height: 340px;
    border: 2px solid #4f5b68;
    border-radius: 8px;
    background: linear-gradient(180deg, #384049 0%, #30363d 100%);
    color: #e7edf3;
    cursor: pointer;
    display: grid;
    align-content: center;
    gap: 18px;
    padding: 34px;
    text-align: left;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.card-surface:hover,
.card-surface:focus-visible {
    border-color: #6ea6d9;
    box-shadow: 0 0 0 4px rgba(110, 166, 217, 0.18);
    outline: none;
}

.side-label {
    color: #5d6b66;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.card-content {
    display: block;
    width: 100%;
}

.model-number {
    color: #9ac7ee;
    display: block;
    font-size: clamp(7rem, 18vw, 13rem);
    font-weight: 900;
    justify-self: center;
    letter-spacing: 0;
    line-height: 0.9;
    text-align: center;
    width: 100%;
}

.model-name {
    font-size: clamp(2rem, 4vw, 3.6rem);
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1.05;
    margin: 0 0 22px;
}

.answer-detail {
    display: grid;
    gap: 14px;
}

.answer-detail p {
    color: #dce5ee;
    font-size: 1.2rem;
    line-height: 1.5;
    margin: 0;
}

.answer-detail strong {
    color: #9ac7ee;
}

.answer-detail .side-hint {
    color: #d6a86f;
    font-size: 1.05rem;
}

.model2-actions {
    align-items: center;
    flex-wrap: wrap;
}

.model2-actions button[data-state="known"] {
    background: #5f8fbf;
    color: #101820;
}

.model2-actions button[data-state="missed"] {
    border-color: #e08d87;
    color: #ffd5d2;
}

.grade-note {
    color: #60706b;
    font-size: 1rem;
    font-weight: 700;
    margin: -10px 0 0;
    min-height: 1.4em;
}

.progress-copy #review-label {
    color: #d6a86f;
}

.focus-dialog {
    background: #333941;
    border: 1px solid #4a5563;
    border-radius: 8px;
    box-shadow: 0 24px 80px rgba(10, 13, 17, 0.44);
    color: #e7edf3;
    max-width: min(880px, calc(100vw - 34px));
    padding: 0;
    width: 880px;
}

.focus-dialog::backdrop {
    background: rgba(12, 16, 20, 0.56);
}

.focus-head {
    align-items: flex-start;
    background: #2f353c;
    border-bottom: 1px solid #4a5563;
    display: flex;
    gap: 20px;
    justify-content: space-between;
    padding: 24px;
}

.focus-head h2 {
    color: #edf3f8;
    font-size: clamp(1.7rem, 3vw, 2.6rem);
    letter-spacing: 0;
    line-height: 1.08;
    margin: 0;
}

.focus-body {
    display: grid;
    gap: 16px;
    padding: 24px;
}

.focus-block {
    border-left: 4px solid #6ea6d9;
    padding-left: 14px;
}

.focus-memory-hook {
    background: rgba(214, 168, 111, 0.08);
    border-left-color: #d6a86f;
    border-radius: 0 8px 8px 0;
    padding-bottom: 12px;
    padding-top: 12px;
}

.focus-block h3 {
    color: #9ac7ee;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    margin: 0 0 6px;
    text-transform: uppercase;
}

.focus-memory-hook h3 {
    color: #f1c98d;
}

.focus-block p {
    color: #dce5ee;
    font-size: 1.05rem;
    line-height: 1.55;
    margin: 0;
}

@media (max-width: 1499px) {
    .model2-lookup {
        margin: 0 0 16px auto;
        position: static;
        width: min(260px, 100%);
    }
}

@media (max-width: 720px) {
    .card-surface {
        min-height: 300px;
        padding: 24px;
    }

    .model2-actions button {
        flex: 1 1 140px;
    }

    .focus-head {
        display: grid;
    }
}
