/* .NET Academy — orange and white theme */
:root {
    --orange: #FF6900;          /* brand orange: fills, highlights, logo */
    --orange-strong: #CC4700;   /* buttons and links with white text (readable contrast) */
    --orange-dark: #A33A00;
    --orange-tint: #FFF1E6;
    --orange-tint-2: #FFE8D6;
    --ink: #1F1F1F;
    --ink-2: #333333;
    --muted: #616161;
    --line: #EEEEEE;
    --line-2: #E0E0E0;
    --input-border: #9E9E9E;
    --bg: #FFFFFF;
    --bg-soft: #FAFAFA;
    --green: #16603B;
    --green-tint: #DDF3E6;
    --red: #B42318;
    --red-tint: #FDE8E7;
    --radius: 14px;
    --radius-lg: 20px;
    --font-body: 'IBM Plex Sans', system-ui, sans-serif;
    --font-display: 'Space Grotesk', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; }

body {
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--bg);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--orange-strong); }
a:hover { color: var(--orange-dark); }

h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: 2.2rem; letter-spacing: -0.01em; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }

code, pre { font-family: var(--font-mono); }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.page { padding: 40px 0 64px; }
.page.narrow, .narrow { max-width: 640px; margin: 0 auto; padding: 64px 24px; }
.section { padding-top: 56px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.mono { font-family: var(--font-mono); }
.accent { color: var(--orange); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.row-gap { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.stack { display: flex; flex-direction: column; gap: 24px; }
.inline-form { display: inline; margin: 0; }
.eyebrow { font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--orange-strong); }
.pill { display: inline-block; font-size: .8rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--orange-dark); background: var(--orange-tint); padding: 6px 14px; border-radius: 999px; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; padding: 0 20px; border-radius: 999px; border: 1.5px solid transparent;
    font: 600 .95rem var(--font-body); text-decoration: none; cursor: pointer; white-space: nowrap;
    transition: background-color .15s, border-color .15s, color .15s;
}
.btn:focus-visible, .input:focus-visible, a:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.btn-primary { background: var(--orange-strong); color: #fff; }
.btn-primary:hover { background: var(--orange-dark); color: #fff; }
.btn-outline { background: #fff; color: var(--ink); border-color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--bg-soft); color: var(--ink); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; color: #fff; }
.btn-light { background: #fff; color: var(--orange-dark); }
.btn-light:hover { background: var(--orange-tint); color: var(--orange-dark); }
.btn-dark-ghost { background: transparent; color: #E0E0E0; border-color: #555; width: 100%; }
.btn-dark-ghost:hover { background: #333; color: #fff; }
.btn-danger-ghost { background: transparent; color: var(--red); border-color: var(--red); }
.btn-lg { min-height: 52px; padding: 0 26px; font-size: 1rem; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: .85rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: default; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: #fff; border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: 28px; min-height: 68px; }
.brand { order: 1; display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-width: 0; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; background: var(--orange); color: #fff; display: inline-flex; align-items: center; justify-content: center; font: 500 .9rem var(--font-mono); flex-shrink: 0; }
.brand-logo { background: none; padding: 0; object-fit: contain; }
.brand-name { font: 700 1.25rem var(--font-display); display: block; white-space: nowrap; }
.brand-mini { display: none; }
.brand-sub { display: block; font-size: .78rem; color: #BDBDBD; }
.nav-toggle { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.nav-burger { display: none; }
.main-nav { order: 2; display: flex; gap: 22px; flex-grow: 1; min-width: 0; }
.main-nav a { color: var(--ink); text-decoration: none; font-weight: 500; padding: 6px 0; border-bottom: 2px solid transparent; }
.main-nav a.active { border-bottom-color: var(--orange); }
.nav-login-link { display: none; }
.header-actions { order: 3; display: flex; align-items: center; gap: 10px; }
.label-short { display: none; }
.user-chip { width: 36px; height: 36px; border-radius: 50%; background: var(--orange-tint-2); color: var(--orange-dark); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }

.site-footer { margin-top: 64px; background: var(--ink); color: #BDBDBD; font-size: .9rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; padding: 28px 24px; flex-wrap: wrap; }

/* Home */
.hero { padding: 72px 0 56px; }
.hero-inner { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; }
.hero-copy { display: flex; flex-direction: column; gap: 22px; }
.hero h1 { font-size: 3.4rem; line-height: 1.04; letter-spacing: -0.02em; margin: 0; }
.hero-text { font-size: 1.15rem; color: #555; margin: 0; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.code-window { background: var(--ink); border-radius: var(--radius-lg); overflow: hidden; box-shadow: 0 30px 60px rgba(255, 105, 0, .18); }
.code-window-bar { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px; background: #2B2B2B; }
.dot { width: 11px; height: 11px; border-radius: 50%; background: #9E9E9E; }
.dot-orange { background: var(--orange); }
.code-window-title { margin-left: 10px; color: #BDBDBD; font: .8rem var(--font-mono); }
.code-window pre { margin: 0; padding: 22px 24px; color: #F5F5F5; font-size: .88rem; line-height: 1.75; overflow-x: auto; }
.code-window .k { color: #FDBA74; }
.code-window .m { color: #FF8A3D; }
.code-window .c { color: #9E9E9E; }

.feature-card { display: flex; gap: 28px; align-items: center; padding: 28px 32px; border-radius: var(--radius-lg); background: var(--orange); color: var(--ink); }
.feature-number { width: 96px; height: 96px; flex-shrink: 0; border-radius: 16px; background: #fff; display: flex; align-items: center; justify-content: center; font: 700 2.4rem var(--font-display); color: var(--orange-strong); }
.feature-body { flex-grow: 1; }
.feature-body h2 { margin: 4px 0 6px; }
.feature-body p { margin: 0; }
.feature-card .eyebrow { color: var(--ink); }
.feature-card .btn-primary { background: var(--ink); }

.section-head { margin-bottom: 24px; }
.section-head h1, .section-head h2 { margin-bottom: 6px; }
.section-head p { margin: 0; color: #555; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.align-start { align-items: start; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }

.concept-card { border-top: 4px solid var(--orange); padding-top: 18px; }
.concept-card p { color: #555; margin: 0; }

.chapter-tile { display: flex; gap: 14px; align-items: flex-start; padding: 18px 20px; border-radius: var(--radius); background: var(--bg-soft); text-decoration: none; color: var(--ink); border: 1px solid transparent; }
a.chapter-tile:hover { border-color: var(--orange); color: var(--ink); }
.chapter-tile.is-muted { color: var(--muted); }
.chapter-num { font-family: var(--font-mono); color: var(--orange-strong); font-weight: 500; padding-top: 2px; }
.chapter-info { flex-grow: 1; display: flex; flex-direction: column; gap: 2px; }
.chapter-title { font-weight: 600; }
.chapter-part { font-size: .82rem; color: var(--muted); }
.part-heading { margin: 32px 0 14px; font-size: 1.1rem; text-transform: uppercase; letter-spacing: .06em; color: var(--orange-strong); }
.course-head { margin: 48px 0 8px; padding-top: 32px; border-top: 1px solid var(--line); }
.course-head:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.course-head h2 { margin-bottom: 4px; }
.course-head p { margin: 0; }
.chapter-list-course { margin: 20px 0 8px; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.chapter-list-course:first-child { margin-top: 0; }

/* Courses catalog and admission */
.course-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.course-card {
    position: relative; display: flex; flex-direction: column; gap: 12px; min-width: 0;
    padding: 22px 22px 18px; border-radius: var(--radius-lg); border: 1px solid var(--line); background: #fff;
    box-shadow: 0 10px 30px rgba(31, 31, 31, .04);
}
.course-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; border-radius: var(--radius-lg) var(--radius-lg) 0 0; background: var(--orange); }
.course-card.is-active { border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-tint); }
.course-card h2 { margin: 0; font-size: 1.45rem; }
.course-card p { margin: 0; color: #555; }
.course-card-top, .course-card-meta, .course-card-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.course-card-top { justify-content: space-between; }
.course-card-actions { margin-top: auto; }
.catalog-course-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 14px; }
.catalog-course-head h2 { margin-bottom: 4px; }
.catalog-course-head p { margin: 0; color: #555; max-width: 62ch; }
.catalog-switch { margin-bottom: 14px; }
.catalog-bar {
    position: sticky; top: 68px; z-index: 4; display: flex; flex-direction: column; gap: 12px;
    margin-bottom: 16px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius);
    background: rgba(255, 255, 255, .94); backdrop-filter: blur(8px);
}
.catalog-search { display: flex; gap: 8px; min-width: 0; }
.catalog-search .input { flex: 1 1 auto; min-width: 0; }
.filter-row { display: flex; flex-wrap: nowrap; gap: 8px; align-items: center; overflow-x: auto; scrollbar-width: thin; padding: 2px 2px 6px; -webkit-overflow-scrolling: touch; }
.filter-row > * { flex: 0 0 auto; white-space: nowrap; }
.filter-label { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.filter-chip {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; max-width: 100%;
    min-height: 40px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line-2);
    background: #fff; color: var(--ink); text-decoration: none; font-weight: 600; font-size: .88rem; line-height: 1.2;
}
a.filter-chip:hover { border-color: var(--orange); color: var(--ink); }
a.filter-chip.is-active, a.filter-chip.is-active:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip-short { display: none; }
.chip-count { font-family: var(--font-mono); font-size: .75rem; font-weight: 500; opacity: .75; }
.catalog-count { margin-left: auto; color: var(--muted); font-size: .85rem; }
.filter-clear { font-size: .85rem; font-weight: 600; }
.catalog-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.catalog-empty { padding: 28px 20px; border-radius: var(--radius); background: var(--bg-soft); text-align: center; }
.catalog-empty p { margin: 0 0 12px; }
.chapter-title, .chapter-part { overflow-wrap: anywhere; }
.dash-course-filter { margin: -4px 0 14px; }
.admit-wrap { max-width: 800px; }
.enroll-banner { display: flex; flex-direction: column; gap: 14px; margin-bottom: 18px; }
.enroll-banner h1 { font-size: 2rem; margin-bottom: 4px; }
.enroll-banner p { margin: 0; color: #555; }
.catalog-admin-filters { flex-wrap: wrap; }
.catalog-admin-filters .input[type=search] { flex: 1 1 220px; }
.catalog-admin-filters select.input { flex: 1 1 160px; max-width: 100%; }
.path-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.path-step { min-width: 0; padding: 22px 20px; border-radius: var(--radius-lg); background: var(--bg-soft); border-top: 4px solid var(--orange); }
.path-step h3 { margin: 8px 0; }
.path-step p { margin: 0; color: #555; }
.path-num { font: 700 1.4rem var(--font-display); color: var(--orange-strong); }
.my-courses { margin-bottom: 24px; }
.streak-row { display: flex; flex-wrap: wrap; gap: 4px; }
.streak-day {
    width: 22px; height: 22px; border-radius: 7px; background: rgba(255, 255, 255, .45); color: var(--ink);
    display: inline-flex; align-items: center; justify-content: center; font-size: .68rem; font-weight: 700;
}
.streak-day.is-on { background: var(--ink); color: #fff; }
.streak-day.is-today { outline: 2px solid #fff; outline-offset: 1px; }
.reminder-form { margin-top: 12px; }
.reminder-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.day-picks { display: flex; flex-wrap: wrap; gap: 8px; }
.day-pick {
    display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 10px;
    border: 1px solid var(--line-2); border-radius: 999px; background: #fff; font-weight: 600; font-size: .85rem;
}
.day-pick input { accent-color: var(--orange-strong); }
.login-title { margin-top: 22px; }
.login-list { list-style: none; margin: 0; padding: 0; }
.login-list li { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid #f3f3f3; font-size: .92rem; }
.course-card-actions .inline-form { display: inline-flex; }
.study-status, .study-bar { flex: 1 0 100%; }
.study-status { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.enroll-body .study-bar { width: 100%; }
.wrap-row { flex-wrap: wrap; align-items: flex-start; }
.learning-title { margin: 8px 0 14px; }
.browse-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 8px; }
.browse-head .section-head { margin-bottom: 0; flex: 1 1 auto; }
.browse-head .catalog-search { flex: 1 1 280px; max-width: 420px; }
.market-card { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: #fff; box-shadow: 0 12px 32px rgba(31, 31, 31, .06); }
.market-cover { position: relative; display: flex; align-items: flex-end; min-height: 148px; padding: 16px 18px; text-decoration: none; color: #fff; background: linear-gradient(135deg, #FF6900, #A33A00); }
.market-cover[data-course="dsa"] { background: linear-gradient(145deg, #1F1F1F 0%, #7A3200 100%); }
.market-cover[data-course="az104"] { background: linear-gradient(135deg, #FF8A3D 0%, #FF6900 45%, #C24E00 100%); }
a.market-cover:hover { color: #fff; }
.market-kicker { position: absolute; top: 14px; left: 18px; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .85); }
.market-mark { font: 700 2rem var(--font-display); letter-spacing: -.03em; }
.market-flag { position: absolute; top: 14px; right: 14px; background: #fff; color: var(--orange-dark); font-size: .75rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.market-body { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px 18px; min-width: 0; }
.market-body h2 { margin: 0; font-size: 1.25rem; }
.market-body h2 a { color: var(--ink); text-decoration: none; }
.market-body h2 a:hover { color: var(--orange-dark); }
.market-body p { margin: 0; color: #555; }
.market-meta { font-size: .85rem; color: var(--muted) !important; }
.market-body .course-card-actions { margin-top: 4px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 16px; color: var(--muted); font-size: .92rem; }
.crumbs a { text-decoration: none; font-weight: 600; }
.course-landing { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.course-main { min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.learn-box { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px 20px; background: var(--bg-soft); }
.learn-box h2, .syllabus-head h2 { font-size: 1.2rem; margin: 0 0 12px; }
.outcome-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; }
.outcome-list li { position: relative; padding-left: 26px; }
.outcome-list li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--orange-strong); font-weight: 700; }
.syllabus-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.syllabus-head h2 { margin: 0; }
.syllabus-block { display: flex; flex-direction: column; gap: 12px; }
.syllabus-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.syllabus { border-bottom: 1px solid var(--line); background: #fff; }
.syllabus:last-child { border-bottom: 0; }
.syllabus summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; font-weight: 700; list-style: none; }
.syllabus summary > span:first-child { flex: 1 1 auto; min-width: 0; }
.syllabus summary > .small { flex: 0 0 auto; min-width: 6.5em; text-align: right; }
.syllabus summary::-webkit-details-marker { display: none; }
.syllabus summary::after { content: "+"; color: var(--muted); font-weight: 500; font-size: 1.2rem; }
.syllabus[open] summary::after { content: "–"; }
.syllabus-lessons { display: flex; flex-direction: column; }
.lecture-row { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid #f3f3f3; text-decoration: none; color: var(--ink); min-width: 0; }
.lecture-row .lecture-open { display: flex; align-items: center; gap: 12px; flex: 1 1 auto; min-width: 0; text-decoration: none; color: inherit; }
.lecture-row .lecture-open:hover { color: inherit; }
a.lecture-row:hover, .lecture-row:has(.lecture-open:hover) { background: var(--orange-tint); color: var(--ink); }
.lecture-row.is-muted { color: var(--muted); }
.lecture-index { font-family: var(--font-mono); color: var(--orange-strong); font-weight: 500; flex: 0 0 auto; }
.lecture-copy { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.lecture-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lecture-row .badge, .lecture-row .btn { flex: 0 0 auto; }
.lecture-meta { font-size: .78rem; color: var(--muted); white-space: nowrap; }
.lecture-row .cc-lock { margin: 0 6px; }
.enroll-panel { position: sticky; top: 84px; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: #fff; box-shadow: 0 16px 40px rgba(31, 31, 31, .08); }
.enroll-cover { min-height: 96px; border-radius: 0; }
.enroll-body { display: flex; flex-direction: column; gap: 12px; padding: 16px 18px 18px; }
.enroll-body .tick-list { margin-top: 4px; }
.enroll-price { margin: 0; font: 700 1.6rem var(--font-display); }
.enroll-body .inline-form { display: block; }
.enroll-body .btn-block { width: 100%; }

.badge { display: inline-block; font-size: .75rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: #F1F1F1; color: var(--muted); white-space: nowrap; }
.badge-orange { background: var(--orange-tint-2); color: var(--orange-dark); }
.badge-green { background: var(--green-tint); color: var(--green); }
.badge-red { background: var(--red-tint); color: var(--red); }
.badge-dark { background: var(--ink); color: #fff; }

/* Cards, alerts, forms */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px 26px; }
.card.no-pad { padding: 0; overflow: hidden; }
.pad { padding: 16px 22px; margin: 0; }
.card-title { font-size: 1.15rem; margin: 0 0 12px; }

.alert { padding: 12px 16px; border-radius: 12px; margin-bottom: 20px; font-weight: 500; }
.alert-error { background: var(--red-tint); color: var(--red); }
.alert-success { background: var(--green-tint); color: var(--green); }

.form-stack { display: flex; flex-direction: column; gap: 20px; }
fieldset { border: 0; margin: 0; padding: 0; }
legend { padding: 0 0 12px; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--orange-strong); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: .9rem; font-weight: 600; }
.input {
    width: 100%; min-height: 46px; padding: 10px 14px; border: 1px solid var(--input-border); border-radius: 10px;
    font: 400 .95rem var(--font-body); color: var(--ink); background: #fff;
}
textarea.input { min-height: auto; resize: vertical; line-height: 1.5; }
.input-auto { width: auto; }
.input-prefix { display: flex; gap: 8px; }
.input-prefix span { display: inline-flex; align-items: center; padding: 0 14px; border: 1px solid var(--input-border); border-radius: 10px; background: var(--bg-soft); }
.field-error, .validation-message { color: var(--red); font-size: .85rem; }
.hint { margin: 8px 0 0; font-size: .85rem; color: var(--muted); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--orange-strong); }
.code-input { font-family: var(--font-mono); font-size: .85rem; }

/* Auth */
.auth-page { min-height: calc(100vh - 68px - 90px); display: flex; align-items: center; justify-content: center; padding: 48px 24px; background: var(--bg-soft); }
.auth-card { width: 100%; max-width: 440px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 36px; box-shadow: 0 12px 40px rgba(0, 0, 0, .05); }
.auth-card h1 { font-size: 1.9rem; margin-bottom: 4px; }
.auth-switch { text-align: center; margin: 20px 0 0; color: var(--muted); }

.register-layout { display: grid; grid-template-columns: 1fr 340px; gap: 28px; align-items: start; }
.form-card h1 { font-size: 2rem; margin-bottom: 4px; }
.summary-card { padding: 0 0 22px; overflow: hidden; display: flex; flex-direction: column; gap: 12px; }
.summary-card > *:not(.summary-bar) { margin-left: 24px; margin-right: 24px; }
.summary-bar { height: 8px; background: var(--orange); margin-bottom: 10px; }
.summary-card h2 { font-size: 1.25rem; margin: 0; }
.tick-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.tick-list li::before { content: "✓"; color: var(--orange-strong); font-weight: 700; margin-right: 8px; }
.soft-box { background: var(--orange-tint); border-radius: var(--radius); padding: 18px 20px; }
.soft-box p { margin: 6px 0 10px; font-size: .92rem; }

/* Dashboard & admin stats */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 24px; }
.page-head h1 { margin-bottom: 4px; }
.page-head p { margin: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat { display: flex; flex-direction: column; gap: 8px; padding: 20px; border-radius: var(--radius); background: var(--bg-soft); border: 1px solid var(--line); }
.stat-orange { background: var(--orange); border-color: var(--orange); }
.stat-label { font-size: .88rem; color: var(--ink-2); }
.stat-value { font: 700 2rem var(--font-display); }
.stat-value small { font-size: 1rem; font-weight: 500; color: var(--muted); }
.stat-value-sm { font-size: 1.25rem; }
.stat-edit { display: flex; gap: 6px; margin-top: 10px; }
.stat-edit-input { width: 70px; flex: 0 0 auto; min-height: 36px; padding: 6px 10px; }
.stat-edit .btn { min-height: 36px; }
.bar { height: 8px; border-radius: 4px; background: #E8E8E8; overflow: hidden; }
.stat-orange .bar { background: rgba(255, 255, 255, .5); }
.bar-fill { display: block; height: 100%; background: var(--orange); border-radius: 4px; }
.stat-orange .bar-fill { background: var(--ink); }
.bar-sm { display: inline-block; width: 110px; height: 6px; vertical-align: middle; margin-left: 8px; }

.dash-grid { display: grid; grid-template-columns: 1fr 380px; gap: 24px; align-items: start; }
.continue-card { background: var(--orange-dark); color: #fff; border-radius: var(--radius-lg); padding: 28px 30px; }
.continue-card .eyebrow { color: var(--orange-tint-2); }
.continue-card h2 { margin: 8px 0; }
.continue-card p { margin: 0 0 16px; color: #FFE8D6; }
.details { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 8px 16px; margin: 0; }
.details dt { color: var(--muted); }
.details dd { margin: 0; overflow-wrap: anywhere; }

.profile-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.profile-badge {
    display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
    padding: 8px 16px; border-radius: 999px; background: var(--bg-soft); border: 1px solid var(--line);
    font-size: .88rem; color: var(--ink-2); overflow-wrap: anywhere;
}
.profile-badge-label { font-weight: 700; color: var(--orange-strong); font-size: .78rem; letter-spacing: .03em; text-transform: uppercase; }
.chapter-list { list-style: none; margin: 0; padding: 0; }
.chapter-list li { display: flex; align-items: center; gap: 12px; min-height: 46px; border-bottom: 1px solid #F1F1F1; }
.chapter-list-title { flex-grow: 1; font-size: .92rem; font-weight: 500; color: var(--ink); text-decoration: none; }
.chapter-list-title.is-muted { color: var(--muted); }

/* Chapter reader */
.reader-bar { border-bottom: 1px solid var(--line); background: var(--bg-soft); }
.reader-bar-inner { display: flex; align-items: center; gap: 20px; min-height: 56px; }
.back-link { font-weight: 600; text-decoration: none; color: var(--ink); display: inline-block; margin-bottom: 8px; }
.reader-bar .back-link { margin: 0; }
.reader-title { flex-grow: 1; text-align: center; font-weight: 600; }
.reader-progress { font-size: .88rem; color: var(--muted); white-space: nowrap; }
.reader-bar .reader-progress .bar { display: inline-block; }

/* Reader layout: lesson + "Course content" outline (Udemy/Coursera style). */
.reader-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; align-items: start; padding-top: 28px; padding-bottom: 32px; }
.reader-layout .lesson { min-width: 0; max-width: 860px; }
.reader-layout.cc-hidden { grid-template-columns: minmax(0, 1fr); }
.reader-layout.cc-hidden .lesson { max-width: 920px; margin: 0 auto; width: 100%; }
.reader-layout.cc-hidden .cc-panel { display: none; }

.cc-toggle {
    display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; padding: 7px 14px; border: 1px solid var(--line-2);
    border-radius: 999px; background: #fff; color: var(--ink); font: 600 .86rem var(--font-body); cursor: pointer;
}
.cc-toggle:hover { border-color: var(--orange); color: var(--orange-dark); }
.cc-toggle[aria-expanded="true"] { background: var(--orange-tint); border-color: var(--orange); color: var(--orange-dark); }
.cc-toggle-icon { width: 14px; height: 10px; border-top: 2px solid currentColor; border-bottom: 2px solid currentColor; position: relative; }
.cc-toggle-icon::after { content: ""; position: absolute; left: 0; right: 0; top: 2px; border-top: 2px solid currentColor; }

.cc-panel {
    position: sticky; top: 84px; max-height: calc(100vh - 240px); overflow-y: auto; overscroll-behavior: contain;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(31, 31, 31, .06);
    scrollbar-width: thin;
}
.cc-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px; background: #fff; border-bottom: 1px solid var(--line); }
.cc-title { margin: 0; font-size: 1.02rem; font-family: var(--font-display); }
.cc-close { width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: .95rem; cursor: pointer; }
.cc-close:hover { background: var(--bg-soft); color: var(--ink); }
.cc-chapters, .cc-sections { list-style: none; margin: 0; padding: 0; }
.cc-chapter + .cc-chapter { border-top: 1px solid var(--line); }
.cc-chapter-heading { margin: 0; font-size: inherit; }
.cc-chapter-toggle {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 16px; border: 0; background: #fff;
    color: var(--ink); text-align: left; font: inherit; cursor: pointer;
}
.cc-chapter-toggle:hover { background: var(--bg-soft); }
.cc-chapter.is-current > .cc-chapter-heading .cc-chapter-toggle { background: var(--bg-soft); }
.cc-chapter-toggle.is-disabled { cursor: default; color: var(--muted); }
.cc-chapter-toggle.is-disabled:hover { background: #fff; }
.cc-chapter-text { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.cc-chapter-name { font-weight: 700; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-chapter-meta { font-size: .76rem; color: var(--muted); white-space: nowrap; }
.cc-chevron { flex: 0 0 auto; width: 8px; height: 8px; margin-right: 2px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg) translateY(-2px); transition: transform .15s ease; }
.cc-chapter-toggle[aria-expanded="true"] .cc-chevron { transform: rotate(-135deg) translateY(-2px); }
.cc-lock {
    flex: 0 0 auto; width: 10px; height: 8px; margin-top: 4px; border-radius: 2px; background: var(--muted); position: relative; opacity: .8;
}
.cc-lock::before { content: ""; position: absolute; left: 2px; top: -6px; width: 6px; height: 6px; border: 2px solid var(--muted); border-bottom: 0; border-radius: 5px 5px 0 0; box-sizing: border-box; }
.cc-sections { padding: 2px 0 8px; }
.cc-section {
    display: flex; align-items: center; gap: 10px; padding: 8px 16px 8px 18px; border-left: 3px solid transparent;
    color: var(--ink-2); font-size: .88rem; text-decoration: none; line-height: 1.3;
}
.cc-section:hover { background: var(--bg-soft); color: var(--ink); }
.cc-section.is-active { background: var(--orange-tint); border-left-color: var(--orange); color: var(--ink); font-weight: 600; }
.cc-section-title { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-duration { flex: 0 0 auto; font-size: .74rem; color: var(--muted); font-weight: 500; }
.cc-status { flex: 0 0 auto; width: 16px; height: 16px; border-radius: 50%; border: 2px solid #C4C4C4; box-sizing: border-box; position: relative; }
.cc-section.is-current .cc-status { border-color: var(--orange); }
.cc-section.is-current .cc-status::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--orange); }
.cc-section.is-done .cc-status { border-color: var(--green); background: var(--green); }
.cc-section.is-done .cc-status::after { content: ""; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.cc-toggle:focus-visible, .cc-close:focus-visible, .cc-chapter-toggle:focus-visible, .cc-section:focus-visible {
    outline: 3px solid var(--orange); outline-offset: -3px;
}
.cc-backdrop { position: fixed; inset: 0; z-index: 75; background: rgba(0, 0, 0, .4); }
.cc-fab { display: none; }
.cc-backdrop[hidden] { display: none; }

@media (max-width: 1024px) {
    .reader-layout, .reader-layout.cc-hidden { grid-template-columns: minmax(0, 1fr); }
    .reader-layout .lesson { max-width: 920px; margin: 0 auto; width: 100%; }
    .cc-panel {
        position: fixed; top: auto; left: 0; right: 0; bottom: 0; z-index: 80; max-height: 78vh; border-radius: 18px 18px 0 0;
        border-bottom: 0; box-shadow: 0 -12px 40px rgba(0, 0, 0, .18); transform: translateY(105%); visibility: hidden;
        transition: transform .22s ease, visibility 0s linear .22s;
    }
    .reader-layout.cc-sheet-open .cc-panel { transform: translateY(0); visibility: visible; transition: transform .22s ease; }
    .cc-head::before { content: ""; position: absolute; left: 50%; top: 6px; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: var(--line-2); }
    .cc-section { padding-top: 11px; padding-bottom: 11px; }
    .cc-fab {
        display: inline-flex; align-items: center; justify-content: center; position: fixed; left: 14px; bottom: 14px; z-index: 60;
        width: 48px; height: 48px; border: 1px solid var(--line-2); border-radius: 50%; background: #fff; color: var(--orange-dark);
        box-shadow: 0 6px 18px rgba(0, 0, 0, .14); cursor: pointer;
    }
    .cc-fab:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
    /* Scroll lock that keeps the reading position: academy.js sets body.style.top = -scrollY. */
    html.cc-scroll-lock body { position: fixed; left: 0; right: 0; width: 100%; overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) { .cc-panel, .cc-chevron { transition: none !important; } }
h1:focus, h1:focus-visible { outline: none; }
.lesson h1 { font-size: 2.4rem; margin: 6px 0 18px; scroll-margin-top: 84px; }
.lesson-body { font-size: 1.05rem; line-height: 1.75; color: var(--ink-2); }
.lesson-body .lead { font-size: 1.2rem; color: var(--ink); }
.lesson-body h2 { margin-top: 1.8em; font-size: 1.5rem; color: var(--ink); }
.lesson-body h3 { margin-top: 1.4em; color: var(--ink); }
.lesson-body code { background: #F3F3F3; padding: 2px 6px; border-radius: 4px; font-size: .88em; }
.lesson-body pre { background: var(--ink); color: #F5F5F5; padding: 18px 20px; border-radius: 12px; overflow-x: auto; font-size: .88rem; line-height: 1.7; }
.lesson-body pre code { background: transparent; padding: 0; color: inherit; }
.lesson-body table.data { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: .95rem; }
.lesson-body table.data th { text-align: left; background: var(--ink); color: #fff; padding: 10px 12px; font-weight: 600; }
.lesson-body table.data td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.lesson-body .callout { margin: 24px 0; padding: 16px 20px; border-radius: 12px; background: var(--orange-tint); color: var(--ink); }
.lesson-body .callout-tip { background: #FFF7E0; }
.lesson-body ol.steps { padding-left: 1.3em; }
.lesson-body pre.mermaid { background: #fff; color: var(--ink); border: 1px solid var(--line); text-align: center; white-space: pre; }
.lesson-body pre.mermaid svg { max-width: 100%; height: auto; }
.lesson-body ul.checklist { list-style: none; padding-left: 0; }
.lesson-body ul.checklist li { padding-left: 30px; position: relative; margin-bottom: 6px; }
.lesson-body ul.checklist li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 20px; height: 20px; border-radius: 6px; background: var(--orange-tint-2); color: var(--orange-dark); font-size: .8rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.lesson-body table.data { display: block; overflow-x: auto; }
.lesson-body h4 { margin-top: 1.2em; }
.lesson-body ol.steps li { margin-bottom: 6px; }
.lesson-body .theory-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin: 24px 0; }
.lesson-body .code-notes { margin: 14px 0 0; padding-left: 1.2em; font-size: .92rem; }
.lesson-body .code-notes li { margin-bottom: 6px; }

/* Self-check quiz cards (Time Complexity chapter and reusable anywhere else) */
.lesson-body .quiz-card { margin: 20px 0; padding: 20px 22px; border-radius: var(--radius); background: var(--bg-soft); border: 1px solid var(--line); }
.lesson-body .quiz-q { font-weight: 600; margin: 0 0 14px; }
.lesson-body .quiz-q-num { display: inline-block; padding: 2px 9px; margin-right: 10px; border-radius: 6px; background: var(--ink); color: #fff; font: 700 .75rem var(--font-mono); vertical-align: middle; }
.lesson-body .quiz-options { display: flex; flex-direction: column; gap: 8px; }
.lesson-body .quiz-option { text-align: left; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line-2); background: #fff; font: 500 .92rem var(--font-body); color: var(--ink); cursor: pointer; transition: border-color .15s, background-color .15s; }
.lesson-body .quiz-option:hover:not(:disabled) { border-color: var(--orange); background: var(--orange-tint); }
.lesson-body .quiz-option:disabled { cursor: default; }
.lesson-body .quiz-option.is-correct { border-color: var(--green); background: var(--green-tint); color: var(--green); font-weight: 700; }
.lesson-body .quiz-option.is-wrong { border-color: var(--red); background: var(--red-tint); color: var(--red); font-weight: 700; }
.lesson-body .quiz-option.is-selected { border-color: var(--orange); background: var(--orange-tint); color: var(--ink); font-weight: 700; }
.quiz-layout { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.battle-layout { display: flex; flex-direction: column; gap: 16px; }
.scope-toggle { display: flex; flex-wrap: wrap; gap: 8px; }
.arena-lobby .input { width: 100%; max-width: 520px; }
.arena { display: grid; grid-template-columns: minmax(0, 1fr) minmax(160px, 240px) minmax(0, 1fr); gap: 16px; align-items: center; }
.chess-side { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; min-width: 0; }
.chess-piece { font-size: 2.4rem; line-height: 1; color: var(--orange-strong); }
.chess-side-opponent .chess-piece { color: var(--ink); }
.chess-name { font-weight: 700; overflow-wrap: anywhere; }
.chess-score { font-family: var(--font-display); font-size: 1.8rem; }
.chess-clock { font-family: var(--font-mono); font-weight: 700; min-width: 4.5rem; padding: 6px 10px; border-radius: 10px; background: var(--ink); color: #fff; }
.chess-board { position: relative; display: grid; grid-template-columns: repeat(8, 1fr); aspect-ratio: 1; width: 100%; border: 2px solid var(--ink); border-radius: 8px; overflow: hidden; }
.chess-square { background: #fff; }
.chess-square.is-dark { background: var(--orange-tint-2); }
.chess-move { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; color: var(--ink); text-shadow: 0 0 8px #fff; }
.chess-move-total { font-size: .9rem; color: var(--muted); }
.arena-scope { margin: 0; }
.medal { font-weight: 700; }
.medal-gold { color: var(--orange-dark); }
.medal-silver { color: var(--ink-2); }
.medal-bronze { color: var(--orange-strong); }
.medal-list { display: flex; flex-direction: column; gap: 10px; }
.medal-list li { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
@media (max-width: 800px) {
    .arena { grid-template-columns: 1fr 1fr; }
    .chess-board { grid-column: 1 / -1; order: -1; width: min(100%, 280px); margin: 0 auto; }
}
@media (max-width: 560px) {
    .arena { grid-template-columns: 1fr; }
    .arena-lobby .btn { width: 100%; }
    .chess-piece { font-size: 2rem; }
    .chess-score { font-size: 1.4rem; }
}
.lesson-body .quiz-feedback { margin-top: 14px; padding: 12px 16px; border-radius: 10px; font-size: .92rem; }
/* Same rule as the sort-lab popup below: scope display to :not([hidden]) or the [hidden] attribute
   set by JS can never actually hide this element once the unconditional rule wins the cascade. */
.lesson-body .quiz-feedback:not([hidden]) { display: block; }
.lesson-body .quiz-feedback.is-correct { background: var(--green-tint); color: var(--green); }
.lesson-body .quiz-feedback.is-wrong { background: var(--red-tint); color: var(--red); }

/* Growth-rate comparison table (Time Complexity chapter) — same .data table but numbers only, right-aligned */
.lesson-body table.growth td.n, .lesson-body table.growth th.n { text-align: right; font-family: var(--font-mono); }

/* Hands-on lessons: "you should see this" checkpoints, file labels above code, highlighted new lines,
   sample output, and the Copy button academy.codeCopy adds to each code block. */
.lesson-body .checkpoint { margin: 20px 0; padding: 14px 18px; border-radius: 12px; background: var(--green-tint); border-left: 4px solid var(--green); color: var(--ink); }
.lesson-body .checkpoint p { margin: 0; }
.lesson-body .checkpoint strong:first-child { color: var(--green); }
.lesson-body .checkpoint-warn { background: #FFF7E0; border-left-color: #B7791F; }
.lesson-body .checkpoint-warn strong:first-child { color: #8A5A00; }
.lesson-body :not(pre) > code { overflow-wrap: anywhere; }
.lesson-body table.data code { overflow-wrap: normal; }
.lesson-body .code-file { margin: 18px 0 6px; font: 600 .78rem var(--font-mono); color: var(--muted); overflow-wrap: anywhere; }
.lesson-body .code-file + pre, .lesson-body .code-file + .code-wrap pre { margin-top: 0; }
.lesson-body pre mark { background: rgba(255, 105, 0, .32); color: #fff; border-radius: 3px; padding: 0 2px; }
.lesson-body pre.output { background: var(--bg-soft); color: var(--ink-2); border: 1px solid var(--line); }
.lesson-body .code-wrap { position: relative; }
.lesson-body .code-wrap pre { padding-top: 40px; }
.code-copy {
    position: absolute; top: 8px; right: 8px; padding: 4px 12px; border-radius: 8px; cursor: pointer;
    border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .1); color: #F5F5F5; font: 600 .75rem var(--font-body);
}
.code-copy:hover { background: rgba(255, 255, 255, .2); }

/* "Going deeper" notes for experienced readers; beginners can skip them */
.lesson-body .callout-pro { background: #EEF4FF; border-left: 4px solid #3B6FD8; }
.lesson-body .callout-pro > p:first-child strong:first-child { color: #1F4FAE; }

/* Tool tabs: the same step shown for Command line / Visual Studio / VS Code (academy.tabs) */
.lesson-body .tool-tabs { margin: 18px 0; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; }
.lesson-body .tool-tab-bar { display: flex; gap: 2px; padding: 6px; background: var(--bg-soft); border-bottom: 1px solid var(--line); overflow-x: auto; }
.lesson-body .tool-tab { flex: 0 0 auto; border: 0; background: transparent; padding: 7px 12px; border-radius: 8px; font: 600 .82rem var(--font-body); color: var(--muted); cursor: pointer; white-space: nowrap; }
.lesson-body .tool-tab.is-active { background: var(--ink); color: #fff; }
.lesson-body .tool-panel { padding: 4px 18px 14px; }
.lesson-body .tool-panel[hidden] { display: none; }

/* Dependency-injection lifetime grid */
.lesson-body .lifetime-grid { display: grid; grid-template-columns: minmax(84px, auto) repeat(4, minmax(0, 1fr)); gap: 6px; margin: 18px 0; font-size: .85rem; }
.lesson-body .lifetime-grid > div { padding: 8px 6px; border-radius: 8px; background: var(--bg-soft); text-align: center; }
.lesson-body .lifetime-grid .lg-head { background: transparent; font-weight: 700; color: var(--muted); font-size: .75rem; }
.lesson-body .lifetime-grid .lg-name { text-align: left; font-weight: 700; background: transparent; }
.lesson-body .lifetime-grid .lg-a { background: #FFE8D6; color: #A33A00; font-weight: 700; }
.lesson-body .lifetime-grid .lg-b { background: #DDF3E6; color: #16603B; font-weight: 700; }
.lesson-body .lifetime-grid .lg-c { background: #E6EEFF; color: #1F4FAE; font-weight: 700; }
.lesson-body .lifetime-grid .lg-d { background: #F3E8FF; color: #6B21A8; font-weight: 700; }

/* Connection-strategy simulator (academy.poolLab) */
.pool-lab { --pool-label: 86px; margin: 28px 0; padding: 20px; border-radius: var(--radius-lg); background: var(--bg-soft); border: 1px solid var(--line); }
.pool-modes { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.pool-mode { border: 1px solid var(--line-2); background: #fff; padding: 8px 12px; border-radius: 999px; font: 600 .82rem var(--font-body); color: var(--ink-2); cursor: pointer; }
.pool-mode.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.pool-stage { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 12px 6px; margin-bottom: 12px; }
.pool-row { display: flex; align-items: center; height: 30px; }
.pool-row-label { flex: 0 0 var(--pool-label); font: 600 .75rem var(--font-mono); color: var(--muted); }
.pool-track { position: relative; flex: 1 1 auto; height: 20px; border-radius: 6px; background: repeating-linear-gradient(90deg, transparent 0 calc(33.333% - 1px), var(--line) calc(33.333% - 1px) 33.333%); }
.pool-seg {
    position: absolute; top: 0; bottom: 0; border-radius: 5px; display: flex; align-items: center; justify-content: center;
    font: 700 .66rem var(--font-mono); color: #fff; overflow: hidden; white-space: nowrap;
    transform-origin: left center; animation-name: pool-grow; animation-timing-function: linear; animation-fill-mode: both;
}
.pool-seg.is-wait { background: #D6D6D6; color: #555; }
.pool-seg.is-connect { background: var(--red); }
.pool-seg.is-query { background: var(--orange-strong); }
@keyframes pool-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.pool-cursor { position: absolute; top: 8px; bottom: 26px; width: 2px; background: var(--ink); opacity: .35; pointer-events: none; }
.pool-axis { display: flex; justify-content: space-between; margin-left: calc(var(--pool-label) - 12px); padding-top: 4px; font: 500 .68rem var(--font-mono); color: var(--muted); }
.pool-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: .8rem; color: var(--muted); margin-bottom: 12px; }
.pool-legend span { display: inline-flex; align-items: center; gap: 6px; }
.pool-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.pool-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; min-height: 44px; margin-bottom: 8px; }
.pool-stats .s { display: flex; flex-direction: column; gap: 2px; }
.pool-stats .k { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.pool-stats .v { font-size: 1.05rem; font-weight: 700; }
.pool-explain { min-height: 3.2em; margin: 0 0 12px; font-size: .95rem; }
@media (prefers-reduced-motion: reduce) { .pool-seg { animation: none; } .pool-cursor { transition: none !important; } }

/* Illustrated screen replicas ("screenshots") of installers and IDEs */
.lesson-body .ui-shot { margin: 22px 0; }
.lesson-body .ui-window { border: 1px solid #C8C8C8; border-radius: 10px; overflow: hidden; background: #fff; color: #1F1F1F; box-shadow: 0 10px 28px rgba(0, 0, 0, .08); font: 400 .8rem/1.4 'Segoe UI', system-ui, sans-serif; }
.lesson-body .ui-titlebar { display: flex; align-items: center; gap: 8px; padding: 7px 12px; background: #F3F3F3; border-bottom: 1px solid #DDD; font-size: .74rem; color: #444; }
.lesson-body .ui-titlebar b { font-weight: 600; }
.lesson-body .ui-titlebar .ui-controls { margin-left: auto; letter-spacing: 8px; color: #888; white-space: nowrap; }
.lesson-body .ui-body { padding: 14px; }
.lesson-body .ui-h { font-size: 1rem; font-weight: 600; margin: 0 0 10px; color: inherit; }
.lesson-body .ui-muted { color: #6B6B6B; font-size: .74rem; }
.lesson-body .ui-tabs { display: flex; gap: 14px; flex-wrap: wrap; border-bottom: 1px solid #DDD; margin-bottom: 12px; }
.lesson-body .ui-tab { padding: 6px 0; color: #555; border-bottom: 2px solid transparent; }
.lesson-body .ui-tab.is-active { color: #5C2D91; border-bottom-color: #5C2D91; font-weight: 600; }
.lesson-body .ui-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.lesson-body .ui-tile { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border: 1px solid #DDD; border-radius: 6px; background: #fff; }
.lesson-body .ui-tile strong { display: block; font-weight: 600; }
.lesson-body .ui-tile .ui-muted { display: block; }
.lesson-body .ui-item strong { display: block; font-weight: 600; }
.lesson-body .ui-check { flex: 0 0 auto; width: 15px; height: 15px; margin-top: 1px; border: 1px solid #8A8A8A; border-radius: 3px; background: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: .65rem; color: #fff; }
.lesson-body .ui-check.on { background: #5C2D91; border-color: #5C2D91; }
.lesson-body .ui-check.on::after { content: "✓"; }
.lesson-body .ui-option { display: flex; gap: 8px; align-items: flex-start; padding: 4px 0; }
.lesson-body .ui-field { margin-bottom: 10px; }
.lesson-body .ui-field > span { display: block; font-size: .74rem; margin-bottom: 3px; }
.lesson-body .ui-input { display: block; padding: 6px 8px; border: 1px solid #BDBDBD; border-radius: 4px; background: #fff; overflow-wrap: anywhere; }
.lesson-body .ui-btnrow { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.lesson-body .ui-btn { display: inline-block; padding: 6px 16px; border: 1px solid #BDBDBD; border-radius: 4px; background: #fff; }
.lesson-body .ui-btn.primary { background: #5C2D91; border-color: #5C2D91; color: #fff; }
.lesson-body .ui-list { display: flex; flex-direction: column; gap: 4px; }
.lesson-body .ui-item { padding: 8px 10px; border-radius: 4px; }
.lesson-body .ui-item.sel { background: #E5F1FB; }
.lesson-body .ui-item small { display: block; color: #6B6B6B; }
.lesson-body .ui-chip { display: inline-block; margin: 4px 4px 0 0; padding: 1px 6px; border-radius: 3px; background: #EFEFEF; font-size: .66rem; color: #555; }
.lesson-body .ui-hl { position: relative; outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 6px; }
.lesson-body .ui-num { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: var(--orange-strong); color: #fff; font: 700 .7rem var(--font-body); flex: 0 0 auto; }
.lesson-body .ui-hl > .ui-num { position: absolute; top: -12px; right: -12px; box-shadow: 0 0 0 2px #fff; }
.lesson-body .ui-window.dark { background: #1F1F1F; color: #CCC; border-color: #333; }
.lesson-body .ui-window.dark .ui-titlebar { background: #181818; border-color: #2B2B2B; color: #BBB; }
.lesson-body .ui-window.dark .ui-input { background: #313131; border-color: #3C3C3C; color: #DDD; }
.lesson-body .ui-window.dark .ui-btn.primary { background: #0078D4; border-color: #0078D4; }
.lesson-body .ui-window.dark .ui-item.sel { background: #04395E; }
.lesson-body .ui-window.dark .ui-item small, .lesson-body .ui-window.dark .ui-muted { color: #9D9D9D; }
.lesson-body .ui-window.dark .ui-check.on, .lesson-body .ui-window.blue .ui-check.on { background: #0078D4; border-color: #0078D4; }
.lesson-body .ui-window.blue .ui-btn.primary { background: #0078D4; border-color: #0078D4; }
.lesson-body .ui-code { display: grid; grid-template-columns: 38px minmax(0, 1fr); min-height: 190px; }
.lesson-body .ui-activity { background: #181818; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 12px 0; font-size: 1rem; opacity: .9; }
.lesson-body .ui-sidebar { padding: 10px 12px; }
.lesson-body .ui-palette { margin: 0 auto; max-width: 440px; border: 1px solid #454545; border-radius: 6px; background: #252526; padding: 6px; box-shadow: 0 8px 24px rgba(0, 0, 0, .4); }
.lesson-body .ui-shot figcaption { margin-top: 8px; font-size: .84rem; color: var(--muted); }
.lesson-body .ui-shot figcaption .ui-tag { display: inline-block; margin-right: 6px; padding: 1px 7px; border-radius: 999px; background: var(--bg-soft); border: 1px solid var(--line); font-size: .7rem; font-weight: 600; }

@media (max-width: 560px) {
    .lesson-body .ui-tiles { grid-template-columns: 1fr; }
    .pool-lab { --pool-label: 62px; padding: 14px; }
    .pool-row-label { font-size: .66rem; }
    .pool-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lesson-body .lifetime-grid { font-size: .74rem; gap: 4px; }
}

/* "What you'll build" phone preview (setup lesson) */
.lesson-body .phone-mock { width: 290px; max-width: 100%; margin: 20px auto 24px; padding: 12px; border-radius: 36px; background: var(--ink); box-shadow: 0 20px 50px rgba(0, 0, 0, .18); }
.lesson-body .phone-screen { background: #fff; border-radius: 26px; padding: 22px 14px 18px; font-family: system-ui, sans-serif; line-height: 1.3; }
.lesson-body .phone-screen p { margin: 0; }
.lesson-body .pm-eyebrow { color: var(--orange); font-size: .66rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.lesson-body .pm-title { font-size: 1.5rem; font-weight: 700; color: var(--ink); margin: 2px 0 !important; }
.lesson-body .pm-sub { color: #666; font-size: .8rem; margin-bottom: 12px !important; }
.lesson-body .pm-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.lesson-body .pm-pill { padding: 4px 9px; border-radius: 999px; background: var(--green-tint); color: var(--green); font-size: .68rem; }
.lesson-body .pm-card { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; margin-top: 8px; border: 1px solid var(--line); border-radius: 12px; font-size: .78rem; }
.lesson-body .pm-card strong { display: block; color: var(--ink); font-size: .84rem; }
.lesson-body .pm-card small { color: #666; font-size: .72rem; }
.lesson-body .pm-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; white-space: nowrap; font-size: .72rem; }

/* Bubble sort lab (and future sorting-algorithm labs reuse the same .bsort-* classes) */
.bsort-lab { margin: 28px 0; padding: 24px; border-radius: var(--radius-lg); background: var(--bg-soft); border: 1px solid var(--line); }
.bsort-progress { height: 4px; border-radius: 4px; background: var(--line-2); overflow: hidden; margin-bottom: 20px; }
.bsort-progress-fill { display: block; height: 100%; background: var(--orange); transition: width .2s ease; }
.bsort-stage { position: relative; height: 220px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; overflow: hidden; }
.bsort-bars { position: absolute; inset: 0 0 28px; }
.bsort-bar { position: absolute; bottom: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; transition: left .35s ease; }
.bsort-bar-value { font: 600 .78rem var(--font-mono); color: var(--ink-2); margin-bottom: 4px; }
.bsort-bar-fill { width: 70%; border-radius: 6px 6px 2px 2px; background: #BDBDBD; transition: height .3s ease, background-color .25s ease; }
.bsort-bar-fill.is-compare { background: #FDBA74; }
.bsort-bar-fill.is-swap { background: var(--orange-strong); }
.bsort-bar-fill.is-sorted { background: var(--green); }
.bsort-bar-fill.is-pivot { background: #A78BFA; }
.bsort-bar-fill.is-active { background: #60A5FA; }
.bsort-bar-index { position: absolute; bottom: -22px; font: 500 .72rem var(--font-mono); color: var(--muted); }
.bsort-range { position: absolute; top: 0; bottom: 28px; background: rgba(255, 105, 0, .07); border-left: 1px dashed var(--line-2); border-right: 1px dashed var(--line-2); transition: left .3s ease, width .3s ease; }
.bsort-divider { position: absolute; top: 0; bottom: 28px; width: 0; border-left: 2px dashed var(--orange-strong); opacity: .5; transition: left .3s ease; }

/* Counting sort's stage: three labelled rows (input / count buckets / output) instead of bars,
   since it has nothing to compare or swap — just tallies and direct placement. */
.bsort-stage:has(.bsort-count-row) { height: auto; padding: 14px 16px; overflow-x: auto; }
.bsort-count-row { display: flex; align-items: center; gap: 12px; padding: 6px 0; }
.bsort-count-row + .bsort-count-row { border-top: 1px dashed var(--line); }
.bsort-count-label { flex: 0 0 90px; font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.bsort-count-cells { display: flex; gap: 4px; }
.bsort-count-cell {
    width: 30px; height: 30px; border-radius: 8px; background: #fff; border: 1px solid var(--line-2);
    display: flex; align-items: center; justify-content: center; font: 600 .82rem var(--font-mono); color: var(--ink-2);
    transition: background-color .2s ease, border-color .2s ease; flex-shrink: 0;
}
.bsort-count-cell.is-active { background: #FDBA74; border-color: #FDBA74; color: var(--ink); }
.bsort-count-cell.is-sorted { background: var(--green-tint); border-color: var(--green); color: var(--green); }
.bsort-count-cell.is-empty { color: var(--line-2); }
.bsort-compare-badge {
    position: absolute; top: 10px; transform: translateX(-50%); padding: 5px 12px; border-radius: 999px;
    background: var(--ink); color: #fff; font: 600 .82rem var(--font-mono); white-space: nowrap; transition: left .35s ease;
    align-items: center; gap: 6px; z-index: 2;
}
/* A plain "display: flex" here would always win over the browser's default [hidden]{display:none}
   rule (author CSS beats the user-agent sheet regardless of specificity), so the badge would stay
   visible forever once shown. Scope it to the non-hidden case explicitly. */
.bsort-compare-badge:not([hidden]) { display: flex; }
.bsort-compare-badge.is-swap { background: var(--orange-strong); }
.bsort-legend { display: flex; gap: 20px; flex-wrap: wrap; font-size: .85rem; color: var(--muted); margin-bottom: 20px; }
.bsort-legend span { display: inline-flex; align-items: center; gap: 8px; }
.bsort-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; background: #BDBDBD; }
.bsort-dot[data-tone="compare"] { background: #FDBA74; }
.bsort-dot[data-tone="swap"] { background: var(--orange-strong); }
.bsort-dot[data-tone="sorted"] { background: var(--green); }
.bsort-dot[data-tone="pivot"] { background: #A78BFA; }
.bsort-dot[data-tone="active"] { background: #60A5FA; }
.bsort-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.bsort-pseudo, .bsort-narration { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.bsort-pseudo h4, .bsort-narration h4 { margin: 0 0 12px; font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.bsort-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.bsort-panel-head h4 { margin: 0; }
.bsort-step-count { color: var(--muted); }
.bsort-pseudo-line { font-family: var(--font-mono); font-size: .88rem; padding: 4px 8px; border-radius: 6px; color: var(--ink-2); display: flex; gap: 10px; }
.bsort-pseudo-line .ln { color: #BDBDBD; user-select: none; }
.bsort-pseudo-line.is-active { background: var(--orange-tint); color: var(--orange-dark); font-weight: 600; }
.bsort-narration p { margin: 0 0 14px; min-height: 3.2em; }
.bsort-stats { display: flex; gap: 20px; }
.bsort-stats .s { display: flex; flex-direction: column; gap: 2px; }
.bsort-stats .k { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.bsort-stats .v { font-size: 1.1rem; font-weight: 700; }
.bsort-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.bsort-spacer { flex-grow: 1; }
.bsort-speed { display: flex; gap: 2px; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.bsort-speed-btn { border: 0; background: transparent; padding: 6px 14px; border-radius: 999px; font: 600 .82rem var(--font-body); color: var(--muted); cursor: pointer; }
.bsort-speed-btn.is-active { background: var(--ink); color: #fff; }
.bsort-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bsort-toolbar .input { flex: 1 1 260px; }
.bsort-input-error { color: var(--red); font-size: .85rem; }
.bsort-code-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.bsort-code-tab { padding: 10px 16px; border: 0; background: transparent; font: 600 .9rem var(--font-body); color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.bsort-code-tab.is-active { color: var(--ink); border-bottom-color: var(--orange); }
.bsort-code-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.bsort-code-toolbar .lang { color: var(--muted); font-size: .85rem; }

/* "Watch as video" call-to-action, styled like a video thumbnail */
.bsort-watch-cta {
    display: flex; align-items: center; gap: 16px; width: 100%; margin-bottom: 18px; padding: 16px 20px;
    border-radius: var(--radius); border: 1px solid var(--line); background: var(--ink); color: #fff;
    cursor: pointer; text-align: left; font-family: var(--font-body); transition: background-color .15s;
}
.bsort-watch-cta:hover { background: #000; }
.bsort-watch-play {
    flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%; background: var(--orange-strong);
    display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; padding-left: 3px;
}
.bsort-watch-copy { display: flex; flex-direction: column; gap: 2px; }
.bsort-watch-copy strong { font-size: 1rem; }
.bsort-watch-copy small { color: #BDBDBD; font-size: .85rem; }

/* Narrated video popup */
body.bsort-video-open { overflow: hidden; }
.bsort-video-overlay {
    position: fixed; inset: 0; background: rgba(0, 0, 0, .72); z-index: 200;
    align-items: center; justify-content: center; padding: 24px;
}
/* Same reasoning as .bsort-compare-badge above: an unscoped "display: flex" would permanently
   override the [hidden] attribute set by JS, so the popup would show on page load and never
   actually close. This was the bug — fixed by only applying display:flex when NOT hidden. */
.bsort-video-overlay:not([hidden]) { display: flex; }
.bsort-video-live:not([hidden]) { display: inline-flex; }
.bsort-video-card {
    width: 100%; max-width: 640px; max-height: 90vh; overflow-y: auto; background: #fff;
    border-radius: var(--radius-lg); padding: 20px; box-shadow: 0 30px 80px rgba(0, 0, 0, .4);
}
.bsort-video-topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.bsort-video-live { align-items: center; gap: 8px; font-size: .82rem; font-weight: 600; color: var(--orange-strong); }
.bsort-video-live i { width: 8px; height: 8px; border-radius: 50%; background: var(--orange-strong); animation: bsort-pulse 1.2s ease-in-out infinite; }
@keyframes bsort-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.bsort-video-close {
    width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: #fff;
    color: var(--ink); font-size: 1.2rem; line-height: 1; cursor: pointer; display: inline-flex;
    align-items: center; justify-content: center; margin-left: auto;
}
.bsort-video-close:hover { background: var(--bg-soft); }
.bsort-video-stage { margin-bottom: 14px; }
.bsort-video-progress { height: 4px; border-radius: 4px; background: var(--line-2); overflow: hidden; margin-bottom: 16px; }
.bsort-video-progress-fill { display: block; height: 100%; background: var(--orange); transition: width .3s ease; }
.bsort-video-caption { min-height: 3.2em; font-size: 1.05rem; color: var(--ink); text-align: center; margin: 0 0 16px; }
.bsort-video-controls { display: flex; justify-content: center; }

@media (max-width: 760px) {
    .bsort-watch-cta { padding: 12px 16px; }
    .bsort-video-card { padding: 16px; }
}

/* Architecture request-journey player (academy.archFlow). Reuses .bsort-progress, .bsort-controls,
   .bsort-speed and .bsort-watch-cta so it looks and behaves like the sorting labs. */
.arch-lab { margin: 28px 0; padding: 24px; border-radius: var(--radius-lg); background: var(--bg-soft); border: 1px solid var(--line); scroll-margin-top: 90px; }
.arch-diagram { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 16px; margin-bottom: 16px; }
.arch-lane { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 14px; align-items: center; padding: 12px 0; }
.arch-lane + .arch-lane { border-top: 1px dashed var(--line-2); }
.arch-lane-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); line-height: 1.35; transition: color .2s ease; }
.arch-lane-label small { display: block; font-weight: 500; text-transform: none; letter-spacing: 0; font-size: .74rem; }
.arch-lane.is-active .arch-lane-label { color: var(--orange-strong); }
.arch-nodes { display: flex; flex-wrap: wrap; gap: 8px; }
.arch-node {
    flex: 1 1 120px; display: flex; flex-direction: column; gap: 2px; padding: 9px 12px; border-radius: 12px;
    border: 1px solid var(--line-2); background: var(--bg-soft); font-size: .85rem; line-height: 1.3; cursor: pointer;
    transition: opacity .25s ease, border-color .25s ease, background-color .25s ease, box-shadow .25s ease, transform .25s ease;
}
.arch-node strong { color: var(--ink); font-size: .88rem; }
.arch-node small { color: var(--muted); font-size: .74rem; }
.arch-lab.is-started .arch-node { opacity: .45; }
.arch-lab.is-started .arch-node.is-visited { opacity: .8; background: #fff; }
.arch-lab.is-started .arch-node.is-active {
    opacity: 1; border-color: var(--orange); background: var(--orange-tint);
    box-shadow: 0 0 0 3px rgba(255, 105, 0, .18); transform: translateY(-1px);
}
.arch-narration { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; }
.arch-narration-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.arch-narration h4 { margin: 0 0 6px; font-size: 1.05rem; color: var(--ink); }
.arch-narration p { margin: 0; min-height: 3.2em; }
.arch-dir { padding: 3px 10px; border-radius: 999px; font: 600 .75rem var(--font-body); background: var(--orange-tint-2); color: var(--orange-dark); }
.arch-dir[data-dir="up"] { background: var(--green-tint); color: var(--green); }
.arch-dir[hidden] { display: none; }
.arch-lab.is-narrating .bsort-watch-play { animation: bsort-pulse 1.2s ease-in-out infinite; }
.arch-transcript { margin-top: 6px; font-size: .92rem; }
.arch-transcript summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.arch-transcript ol { margin: 10px 0 0; padding-left: 1.3em; }
.arch-transcript li { margin-bottom: 6px; }
.arch-transcript li::before { content: attr(data-title) " — "; font-weight: 700; color: var(--ink); }

@media (max-width: 760px) {
    .arch-lab { padding: 16px; }
    .arch-diagram { padding: 4px 12px; }
    .arch-lane { grid-template-columns: 1fr; gap: 8px; }
    .arch-node { flex-basis: 100px; }
    .lesson-body pre { padding: 14px; font-size: .8rem; line-height: 1.6; }
    .lesson-body .code-wrap pre { padding-top: 40px; }
}
.lesson-nav { display: flex; justify-content: space-between; gap: 16px; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.lesson-nav .btn { white-space: normal; text-align: center; }
/* Floating "mark complete" widget — fixed bottom-right so the lesson column keeps the full width
   that used to be split off into a dedicated right rail. */
.lesson-fab { position: fixed; right: 24px; bottom: 24px; z-index: 60; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.lesson-fab-progress { font-size: .8rem; font-weight: 600; color: var(--muted); background: #fff; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); box-shadow: 0 2px 10px rgba(0, 0, 0, .06); }
.btn-pill { padding: 14px 26px; border-radius: 999px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); white-space: nowrap; }
.done-pill { padding: 12px 22px; border-radius: 999px; background: var(--green-tint); color: var(--green); font-weight: 600; text-align: center; box-shadow: 0 8px 24px rgba(0, 0, 0, .1); }

/* Admin */
.admin-shell { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 68px); }
.admin-sidebar { background: var(--ink); color: #E0E0E0; padding: 24px 16px; display: flex; flex-direction: column; gap: 28px; position: sticky; top: 68px; height: calc(100vh - 68px); }
.brand-dark, .brand-dark:hover { color: #fff; padding: 0 8px; }
.admin-nav { display: flex; flex-direction: column; gap: 4px; }
.admin-nav a { display: block; padding: 11px 12px; border-radius: 10px; color: #E0E0E0; text-decoration: none; }
.admin-nav a:hover { background: #2B2B2B; color: #fff; }
.admin-nav a.active { background: var(--orange-strong); color: #fff; font-weight: 600; }
.admin-kicker { margin: 0; padding: 0 12px; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #BDBDBD; }
.admin-main { background: var(--bg-soft); min-width: 0; }
.admin-page { padding: 32px 40px 56px; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 12px 16px; background: var(--bg-soft); border-bottom: 1px solid var(--line); }
.table td { padding: 12px 16px; border-bottom: 1px solid #F3F3F3; vertical-align: middle; }
.card:not(.no-pad) .table th:first-child, .card:not(.no-pad) .table td:first-child { padding-left: 0; }
.table-toolbar { display: flex; gap: 12px; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.table-toolbar .input[type=search] { flex-grow: 1; }
.person { display: flex; gap: 12px; align-items: center; }
.avatar { width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%; background: var(--orange-tint-2); color: var(--orange-dark); display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700; }
.progress-cell { display: flex; align-items: center; gap: 10px; min-width: 140px; }
.progress-cell .bar { flex-grow: 1; }
.actions { white-space: nowrap; text-align: right; }
.actions .btn + .btn { margin-left: 6px; }
.meter-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.meter-list .bar { margin-top: 6px; }
.switch input { width: 20px; height: 20px; accent-color: var(--orange-strong); cursor: pointer; }
.editor-grid { display: grid; grid-template-columns: 300px 1fr; gap: 20px; margin-top: 20px; align-items: start; }
.section-list { list-style: none; margin: 0; padding: 0 12px 12px; }
.section-item { width: 100%; text-align: left; padding: 10px 12px; border: 0; border-radius: 10px; background: transparent; font: 500 .92rem var(--font-body); color: var(--ink); cursor: pointer; }
.section-item:hover { background: var(--bg-soft); }
.section-item.is-current { background: var(--orange-tint); color: var(--orange-dark); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tab { padding: 10px 16px; border: 0; background: transparent; font: 600 .9rem var(--font-body); color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.tab.is-active { color: var(--ink); border-bottom-color: var(--orange); }
.preview-box { border: 1px solid var(--line); border-radius: 12px; padding: 20px; max-height: 560px; overflow: auto; }

/* Dashboard shell */
.dash-shell { display: flex; align-items: stretch; min-height: calc(100vh - 68px); }
.dash-nav-toggle-input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.dash-sidebar {
    flex: 0 0 260px; width: 260px; background: #fff; border-right: 1px solid var(--line);
    padding: 20px 16px; display: flex; flex-direction: column; gap: 24px; position: sticky; top: 68px;
    height: calc(100vh - 68px); overflow-y: auto; overflow-x: hidden; white-space: nowrap;
    transition: flex-basis .2s ease, width .2s ease, opacity .15s ease, padding .2s ease, transform .2s ease;
}
.dash-sidebar .brand { padding: 4px 8px; }
.dash-nav { display: flex; flex-direction: column; gap: 4px; }
.dash-nav a { display: block; padding: 11px 12px; border-radius: 10px; color: var(--ink-2); text-decoration: none; font-weight: 500; }
.dash-nav a:hover { background: var(--bg-soft); color: var(--ink); }
.dash-nav a.active { background: var(--orange-tint); color: var(--orange-dark); font-weight: 700; }
.dash-sidebar-footer { margin-top: auto; }
.dash-home-link { display: block; padding: 10px 12px; color: var(--muted); text-decoration: none; font-size: .9rem; }
.dash-home-link:hover { color: var(--ink); }
.dash-backdrop { display: none; }
.dash-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.dash-topbar { display: flex; align-items: center; gap: 16px; min-height: 64px; padding: 0 24px; border-bottom: 1px solid var(--line); position: sticky; top: 68px; background: #fff; z-index: 5; }
.dash-toggle-btn { display: flex; flex-direction: column; justify-content: center; gap: 4px; width: 22px; height: 22px; cursor: pointer; padding: 6px; margin: -6px; border-radius: 8px; flex-shrink: 0; }
.dash-toggle-btn span { display: block; height: 2px; background: var(--ink); border-radius: 2px; }
.dash-toggle-btn:hover { background: var(--bg-soft); }
.dash-topbar-title { font-weight: 700; font-family: var(--font-display); }
.dash-topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.dash-content { padding: 32px 40px 56px; flex-grow: 1; width: 100%; max-width: 1600px; margin: 0 auto; }

/* Collapse the sidebar via a sibling checkbox — plain CSS, no :has() needed. */
.dash-nav-toggle-input:checked ~ .dash-sidebar {
    flex-basis: 0; width: 0; padding-left: 0; padding-right: 0; border-right: 0; opacity: 0; pointer-events: none;
}
.details + .btn { margin-top: 14px; }

/* Profile dropdown — built on the native Popover API (auto light-dismiss on outside click/Escape,
   renders in the top layer so it's never clipped by an ancestor's overflow/stacking context).
   academy.js positions it under its trigger just before it opens. */
.profile-menu-trigger {
    display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 6px 12px 6px 6px;
    border-radius: 999px; border: 0; background: none; font-family: var(--font-body);
}
.profile-menu-trigger:hover, .profile-menu-trigger:has(+ [popover]:popover-open) { background: var(--bg-soft); }
.profile-name-txt { font-weight: 600; font-size: .92rem; }
.profile-menu-list {
    /* academy.js sets top/left/right inline, just before this opens, anchored under the trigger. */
    position: fixed; inset: auto; margin: 0;
    min-width: 200px; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 14px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .12); padding: 8px; z-index: 20;
    flex-direction: column; gap: 2px;
}
.profile-menu-list:popover-open { display: flex; }
.profile-menu-list a, .profile-menu-list .profile-menu-logout { display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: .92rem; background: none; border: 0; font-family: var(--font-body); cursor: pointer; }
.profile-menu-list a:hover, .profile-menu-list .profile-menu-logout:hover { background: var(--bg-soft); }
.profile-menu-list hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }

/* Blazor error UI */
#blazor-error-ui { background: #FFF7E0; bottom: 0; box-shadow: 0 -1px 2px rgba(0, 0, 0, .2); display: none; left: 0; padding: .6rem 1.25rem .7rem; position: fixed; width: 100%; z-index: 1000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }

/* Responsive */
@media (max-width: 1024px) {
    .lesson-fab { position: fixed; right: 14px; bottom: 14px; }
    .dash-grid, .register-layout, .editor-grid { grid-template-columns: minmax(0, 1fr); }
    .admin-shell { grid-template-columns: 1fr; }
    .admin-sidebar { position: static; height: auto; }

    .dash-sidebar {
        position: fixed; inset: 68px auto 0 0; flex-basis: 260px; width: 260px; height: auto; padding: 20px 16px;
        border-right: 1px solid var(--line); transform: translateX(-100%); opacity: 1; z-index: 40;
    }
    .dash-nav-toggle-input:checked ~ .dash-sidebar {
        flex-basis: 260px; width: 260px; padding: 20px 16px; border-right: 1px solid var(--line);
        transform: translateX(0); opacity: 1; pointer-events: auto; box-shadow: 12px 0 32px rgba(0, 0, 0, .15);
    }
    .dash-nav-toggle-input:checked ~ .dash-backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 30; }
    .dash-content { padding: 24px 20px 48px; }
}

@media (max-width: 1024px) {
    .catalog-grid, .path-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .course-landing { grid-template-columns: 1fr; }
    .enroll-panel { position: static; order: -1; }
    .outcome-list { grid-template-columns: 1fr; }
    .browse-head { flex-direction: column; align-items: stretch; }
    .browse-head .catalog-search { max-width: none; }
}

@media (max-width: 860px) {
    .header-inner { flex-wrap: wrap; gap: 8px; padding-top: 8px; padding-bottom: 8px; }
    .nav-burger {
        order: 3; display: inline-flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px;
        width: 44px; height: 44px; margin-left: 4px; border-radius: 10px; cursor: pointer;
    }
    .nav-burger span { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--ink); }
    .nav-burger:hover { background: var(--bg-soft); }
    .header-actions { margin-left: auto; }
    .header-actions .btn-ghost, .nav-login-link { display: none; }
    .main-nav {
        display: none; order: 4; flex-basis: 100%; flex-direction: column; gap: 2px;
        width: 100%; padding: 4px 0 10px; overflow: visible;
    }
    .nav-toggle:checked ~ .main-nav { display: flex; }
    .main-nav a { display: block; padding: 12px 8px; border-bottom: 0; border-left: 3px solid transparent; border-radius: 8px; }
    .main-nav a.active { border-left-color: var(--orange); background: var(--orange-tint); }
    .nav-toggle:checked ~ .main-nav .nav-login-link { display: block; }
}

@media (max-width: 760px) {
    .hero-inner, .grid-2, .grid-3, .course-grid, .path-grid, .reminder-grid { grid-template-columns: 1fr; }
    .span-2, .span-3 { grid-column: auto; }
    .hero h1 { font-size: 2.4rem; }
    .enroll-banner h1 { font-size: 1.7rem; }
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .catalog-course-head { flex-direction: column; align-items: flex-start; }
    .catalog-count { margin-left: 0; }
    .catalog-bar { top: 60px; }
    .feature-card { flex-direction: column; align-items: flex-start; }
    .reader-bar-inner { flex-wrap: wrap; }
    .reader-title { text-align: left; }
    .admin-page { padding: 24px 16px; }
    .table-toolbar { flex-wrap: wrap; }
    .card.no-pad { overflow-x: auto; }

    .dash-topbar { padding: 0 16px; }
    .dash-sidebar, .dash-nav-toggle-input:checked ~ .dash-sidebar { width: 85vw; max-width: 300px; flex-basis: 85vw; }
    .profile-name-txt { display: none; }
    .page-head { flex-direction: column; align-items: flex-start; }

    .lesson-body .theory-grid, .bsort-detail { grid-template-columns: 1fr; }
    .bsort-lab { padding: 16px; }
    .bsort-stage { height: 180px; }

    .table-stack thead { display: none; }
    .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
    .table-stack tr { padding: 14px 16px; border-bottom: 1px solid var(--line); }
    .table-stack td { border: 0; padding: 4px 0; text-align: left; white-space: normal; overflow-wrap: anywhere; }
    .table-stack td.actions { text-align: left; }
    .table-stack td.actions .btn { margin: 8px 8px 0 0; }
    .table-stack .progress-cell { min-width: 0; }
}

@media (max-width: 560px) {
    .catalog-grid { grid-template-columns: 1fr; }
    .chip-long { display: none; }
    .chip-short { display: inline; }
    .container { padding-left: 16px; padding-right: 16px; }
}

@media (max-width: 400px) {
    .brand-full { display: none; }
    .brand-mini { display: inline; }
    .label-long { display: none; }
    .label-short { display: inline; }
    .stat-grid { grid-template-columns: 1fr; }
}

/* ===== Payments: pricing, UPI checkout, billing, admin plans/payments/revenue ===== */
.alert-info { background: #EEF4FF; color: #1F4FAE; }
.alert-info a { color: inherit; font-weight: 700; }
.pricing-head { max-width: 720px; margin-bottom: 24px; }
.pricing-head h1 { margin: 4px 0 8px; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin: 24px 0 32px; }
.plan-card { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 26px 24px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; }
.plan-card h2 { margin: 0; font-size: 1.15rem; }
.plan-card .tick-list { margin: 6px 0 12px; flex: 1 1 auto; }
.plan-card.is-featured { border: 2px solid var(--orange); box-shadow: 0 12px 30px rgba(255, 105, 0, .12); }
.plan-flag { position: absolute; top: -12px; left: 20px; padding: 3px 10px; border-radius: 999px; background: var(--orange-strong); color: #fff; font-size: .72rem; font-weight: 700; }
.plan-price { margin: 0; font: 700 2.2rem var(--font-display); color: var(--ink); }
.how-to-pay { max-width: 720px; }
.pay-steps { padding-left: 1.3em; display: flex; flex-direction: column; gap: 8px; }
.paywall .row-gap { margin-top: 20px; }
.plan-chip { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--green-tint); color: var(--green); font-size: .88rem; font-weight: 600; text-align: center; }

.checkout { max-width: 980px; }
.checkout-summary { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.checkout-summary h1 { margin: 4px 0; }
.checkout-summary p { margin: 0; }
.checkout-amount { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.checkout-amount strong { font: 700 2rem var(--font-display); }
.checkout-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.checkout-grid h2, .checkout-done h2, .checkout-wait h2 { font-size: 1.15rem; margin-top: 0; }
.checkout-done, .checkout-wait { text-align: center; }
.checkout-icon { font-size: 2.4rem; margin: 0; }
.step-num { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; margin-right: 6px; border-radius: 50%; background: var(--ink); color: #fff; font-size: .85rem; }
.pay-card { text-align: center; }
.pay-qr { display: block; width: 240px; max-width: 100%; height: auto; margin: 4px auto 10px; border: 1px solid var(--line); border-radius: 14px; padding: 8px; background: #fff; image-rendering: pixelated; }
.pay-apps { margin: 0 0 14px; font-size: .92rem; }
.pay-phone-hint { margin: 6px 0 14px; }
.pay-to { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; padding: 10px; margin-bottom: 10px; border-radius: 12px; background: var(--bg-soft); }
.pay-upi { font-weight: 700; overflow-wrap: anywhere; }
.utr-help { padding-left: 1.2em; font-size: .9rem; display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; }
.checkout .field { margin-bottom: 14px; }
.checkout .input.mono { font-size: 1.1rem; letter-spacing: .06em; }

.plan-status-list { display: flex; flex-direction: column; }
.plan-status { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; }
.plan-status + .plan-status { border-top: 1px solid var(--line); }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 12px; }
.check-row { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.upi-settings { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: start; }
.upi-test { max-width: 220px; text-align: center; }
.upi-test img { border: 1px solid var(--line); border-radius: 12px; padding: 6px; image-rendering: pixelated; }
.upi-test p { margin: 8px 0 0; }
.verify-help { margin-bottom: 20px; }
.verify-help summary { cursor: pointer; }
.verify-help ol { margin: 12px 0 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 6px; }
.reason-box { display: flex; flex-direction: column; gap: 8px; min-width: 220px; }
a.stat-link { text-decoration: none; color: inherit; }
a.stat-link:hover { border-color: var(--orange-strong); }

.revenue .stat-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.stat-orange .muted { color: var(--ink); opacity: .8; }
.revenue > .card { margin-bottom: 24px; }
.revenue .grid-2 { margin-bottom: 24px; }
.revenue-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.revenue-hero > div { display: flex; flex-direction: column; gap: 6px; }
.hero-figure { font: 700 3.2rem/1 var(--font-body); color: var(--ink); font-variant-numeric: proportional-nums; }
.delta { font-size: .9rem; font-weight: 600; color: var(--muted); }
.delta.is-up { color: var(--green); }
.delta.is-down { color: var(--red); }
.hero-pending { padding: 12px 16px; border-radius: 12px; background: var(--orange-tint); color: var(--orange-dark); text-decoration: none; font-weight: 600; }

/* Monthly revenue: a single-series column chart in plain HTML, so its labels stay readable on phones. */
.rev-chart { --rev-axis: 52px; margin-top: 12px; }
.rev-plot { position: relative; height: 220px; margin-left: var(--rev-axis); margin-top: 22px; }
.rev-grid { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--line); }
.rev-grid span { position: absolute; right: calc(100% + 8px); top: -.6em; font: 500 .72rem var(--font-mono); color: var(--muted); white-space: nowrap; }
.rev-cols { position: absolute; inset: 0; display: flex; }
.rev-col { position: relative; flex: 1 1 0; display: flex; justify-content: center; align-items: flex-end; outline: none; }
.rev-bar { display: block; width: min(24px, 60%); border-radius: 4px 4px 0 0; background: var(--orange-strong); }
.rev-col.is-current .rev-bar { background: var(--orange-dark); }
.rev-val { position: absolute; left: 50%; transform: translateX(-50%); font: 600 .72rem var(--font-mono); color: var(--ink); white-space: nowrap; }
.rev-col::after {
    content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
    width: max-content; max-width: 200px; padding: 6px 10px; border-radius: 8px; background: var(--ink); color: #fff;
    font-size: .78rem; line-height: 1.35; text-align: center; pointer-events: none; z-index: 2;
    display: none; /* a hidden tooltip must not take part in layout, or it widens the page on phones */
}
.rev-col:first-child::after, .rev-col:nth-child(2)::after { left: 0; transform: none; text-align: left; }
.rev-col:last-child::after, .rev-col:nth-last-child(2)::after { left: auto; right: 0; transform: none; text-align: right; }
.rev-col:hover::after, .rev-col:focus-visible::after { display: block; }
.rev-col:hover .rev-bar, .rev-col:focus-visible .rev-bar { filter: brightness(1.12); }
.rev-x { display: flex; margin-left: var(--rev-axis); padding-top: 6px; }
.rev-x span { flex: 1 1 0; text-align: center; font: 500 .72rem var(--font-body); color: var(--muted); white-space: nowrap; }
.rev-table { margin-top: 14px; }
.rev-table summary { cursor: pointer; color: var(--muted); font-weight: 600; font-size: .9rem; }
.course-split { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 16px; }
.course-split .bar { margin: 6px 0 4px; }

@media (max-width: 760px) {
    .checkout-grid, .upi-settings { grid-template-columns: 1fr; }
    .checkout-amount { align-items: flex-start; }
    .hero-figure { font-size: 2.4rem; }
    .rev-chart { --rev-axis: 40px; }
    .rev-x span { font-size: .66rem; }
    /* Every second month on phones, always keeping the current (last) one. */
    .rev-x span:nth-last-child(even) { visibility: hidden; }
    .rev-val { font-size: .62rem; }
}

/* ---------- Quiz navigation, palette and answer review ---------- */
.quiz-palette { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 6px; }
.palette-dot { min-width: 38px; height: 38px; padding: 0 8px; border-radius: 10px; border: 2px solid var(--line); background: #fff; color: var(--ink); font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.palette-legend .palette-dot { min-width: 14px; width: 14px; height: 14px; padding: 0; border-radius: 4px; vertical-align: middle; cursor: default; }
.palette-dot.is-answered { background: var(--orange-tint-2); border-color: var(--orange); color: var(--orange-dark); }
.palette-dot.is-current { border-color: var(--orange-strong); box-shadow: 0 0 0 3px var(--orange-tint-2); outline: none; }
.palette-dot.is-correct { background: var(--green-tint); border-color: var(--green); color: var(--green); }
.palette-dot.is-wrong { background: var(--red-tint); border-color: var(--red); color: var(--red); }
.palette-dot.is-skipped { background: #F1F1F1; border-style: dashed; color: var(--muted); }
.palette-dot:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.quiz-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 16px 0; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(20, 20, 20, .45); z-index: 90; }
.modal { position: fixed; z-index: 91; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(520px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.review-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 4px; }
.review-tally { list-style: none; padding: 0; margin: 12px 0; display: flex; flex-wrap: wrap; gap: 18px; font-weight: 600; }
.review-mark { display: inline-flex; width: 22px; height: 22px; border-radius: 50%; align-items: center; justify-content: center; font-weight: 800; flex-shrink: 0; }
.review-mark.is-correct { background: var(--green); color: #fff; }
.review-mark.is-wrong { background: var(--red); color: #fff; }
.review-mark.is-skipped { background: #DDD; color: var(--ink); }
.review-item { border-left: 6px solid var(--line); }
.review-item.is-correct { border-left-color: var(--green); }
.review-item.is-wrong { border-left-color: var(--red); }
.review-item.is-skipped { border-left-color: #BBB; }
.review-options { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 8px; }
.review-option { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; }
.review-option.is-correct { border-color: var(--green); background: var(--green-tint); }
.review-option.is-wrong { border-color: var(--red); background: var(--red-tint); }
.review-option .review-mark:empty { background: transparent; border: 2px solid var(--line); }
.review-answers { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0 0 12px; }
.review-answers dt { font-weight: 700; color: var(--muted); }
.review-answers dd { margin: 0; }
@media (max-width: 640px) {
    .quiz-nav { flex-wrap: wrap; }
    .quiz-nav .btn { flex: 1 1 40%; }
    .review-answers { grid-template-columns: 1fr; }
    .history-table th:nth-child(4), .history-table td:nth-child(4) { display: none; }
}

/* ---------- Admin: dashboard, users, promotions ---------- */
.badge-gray { background: #EEEEEE; color: #424242; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #8F1C13; color: #fff; }
.btn-danger-ghost:hover { background: var(--red-tint); color: var(--red); }
.stat-sub { font-size: .8rem; color: var(--muted); }
.stat-orange .stat-sub { color: var(--ink); opacity: .8; }
.stat-link { text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s; }
.stat-link:hover { color: inherit; border-color: var(--orange); box-shadow: 0 4px 16px rgba(255, 105, 0, .12); }
.stat-attention { border-color: var(--orange-strong); background: var(--orange-tint); }
.quick-links { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 24px; }
.quick-link { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border: 1px solid var(--line); border-left: 4px solid var(--orange); border-radius: 12px; background: #fff; color: var(--ink); text-decoration: none; }
.quick-link span { font-size: .85rem; color: var(--muted); }
.quick-link:hover { color: var(--ink); background: var(--orange-tint); }

.confirm-dialog .card-title { margin-bottom: 8px; }
.confirm-body p { margin: 0 0 10px; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

.free-access { display: flex; flex-direction: column; gap: 4px; }
.free-access-check { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
.free-access-check input { width: 20px; height: 20px; accent-color: var(--orange-strong); cursor: pointer; margin: 0; }
.free-access-check.is-locked, .free-access-check.is-locked input { cursor: not-allowed; }
.free-access-check.is-locked span { color: var(--muted); }
.free-access-note { font-size: .78rem; color: var(--muted); max-width: 260px; }
.free-access-compact .free-access-check { font-weight: 500; font-size: .9rem; }
.users-table td { vertical-align: top; }
.person-link { color: var(--ink); text-decoration: none; }
.person-link:hover { color: var(--orange-strong); text-decoration: underline; }
.person-lg .avatar { width: 52px; height: 52px; font-size: 1rem; }
.person-lg h1 { margin: 0; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 20px; }
.pager-buttons { display: flex; align-items: center; gap: 10px; }
.pad-title { padding: 18px 22px 0; }
.detail-list { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; }
.detail-list dt { color: var(--muted); font-size: .88rem; }
.detail-list dd { margin: 0; }
.audit-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.admin-page > .card { margin-top: 20px; }

.promo-code { font: 700 .95rem var(--font-mono); letter-spacing: .04em; color: var(--ink); text-decoration: none; }
.promo-code:hover { color: var(--orange-strong); }
.empty-state { text-align: center; padding: 40px 22px; }
.promo-form .grid-2 { margin-bottom: 20px; }
.promo-form fieldset { border: 0; padding: 0; margin: 0; }
.promo-form legend { font-size: .9rem; font-weight: 600; margin-bottom: 6px; text-transform: none; letter-spacing: 0; color: var(--ink); padding: 0; }
.promo-code-input { text-transform: uppercase; letter-spacing: .05em; }
.input[aria-invalid=true] { border-color: var(--red); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.segmented { display: inline-flex; border: 1px solid var(--input-border); border-radius: 10px; overflow: hidden; }
.segmented label { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; cursor: pointer; font-weight: 500; }
.segmented label + label { border-left: 1px solid var(--input-border); }
.segmented label.on { background: var(--orange-tint); color: var(--orange-dark); font-weight: 700; }
.segmented input, .course-picks input { accent-color: var(--orange-strong); }
.course-picks { display: flex; flex-wrap: wrap; gap: 10px; }
.pick { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1px solid var(--line-2); border-radius: 10px; cursor: pointer; }
.pick.on { border-color: var(--orange); background: var(--orange-tint); }
.pick-course { border-style: dashed; }
.promo-preview { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.preview-chip { padding: 6px 10px; border-radius: 999px; background: var(--bg-soft); border: 1px solid var(--line); font-size: .85rem; }
.preview-chip s { color: var(--muted); margin: 0 2px; }
.preview-chip strong { color: var(--orange-dark); }
input[type=date].input { min-width: 0; }

/* ---------- Checkout: promo code ---------- */
.price-old { color: var(--muted); text-decoration: line-through; }
.checkout-amount .price-old { font-size: 1rem; }
.promo-card { margin-bottom: 20px; }
.price-lines { margin: 0 0 16px; display: flex; flex-direction: column; gap: 8px; }
.price-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.price-line dt { font-weight: 500; }
.price-line dd { margin: 0; font-weight: 600; white-space: nowrap; }
.price-discount dd, .price-discount dt { color: var(--green); }
.price-total { padding-top: 10px; border-top: 1px dashed var(--line-2); }
.price-total dt { font-weight: 700; }
.price-total dd { font: 700 1.4rem var(--font-display); color: var(--ink); }
.promo-chip { display: inline-block; padding: 1px 8px; border-radius: 6px; background: var(--green-tint); font: 700 .8rem var(--font-mono); letter-spacing: .04em; }
.promo-form-inline label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.promo-input-row { display: flex; gap: 10px; }
.promo-input-row .input { flex: 1 1 auto; text-transform: uppercase; letter-spacing: .05em; }
.promo-input-row .btn { flex: 0 0 auto; }
.promo-applied { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-radius: 12px; background: var(--green-tint); color: var(--green); }
.promo-msg { margin: 10px 0 0; padding: 10px 14px; border-radius: 12px; font-weight: 500; font-size: .92rem; }
.promo-ok { background: var(--green-tint); color: var(--green); }
.promo-bad { background: var(--red-tint); color: var(--red); }
.checkout-free { text-align: center; border-color: var(--orange); background: var(--orange-tint); }
.checkout-free h2 { margin-top: 0; font-size: 1.2rem; }

@media (max-width: 1024px) {
    .quick-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .form-row { grid-template-columns: 1fr; }
    .quick-links { grid-template-columns: 1fr; }
    .free-access-note { max-width: none; }
    .pager { justify-content: center; }
    .segmented { display: flex; }
    .segmented label { flex: 1; justify-content: center; }
}

/* Keep the sidebar column dark all the way down on long admin pages. */
@media (min-width: 1025px) {
    .admin-shell { background: linear-gradient(to right, var(--ink) 240px, var(--bg-soft) 240px); }
}
.promo-table td[data-label=Valid] { white-space: nowrap; }
.free-access:not(.free-access-compact) .free-access-note { max-width: none; }
.recent-table td:first-child { white-space: nowrap; }
.promo-table td[data-label=Uses] .mono, .promo-table td[data-label=Courses] { white-space: nowrap; }

/* ---------- Email verification ---------- */
.verify-banner { background: var(--orange-tint); border-bottom: 1px solid var(--orange-tint-2); color: var(--ink); }
.verify-banner-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; font-size: .92rem; }
.verify-banner-inner form { margin: 0; }
.confirm-card { text-align: center; }
.confirm-card p { color: var(--muted); margin: 0 0 24px; }
.confirm-icon { width: 72px; height: 72px; margin: 0 auto 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font: 800 2rem var(--font-display); background: var(--green-tint); color: var(--green); }
.confirm-icon-warn { background: var(--orange-tint-2); color: var(--orange-dark); }
.confirm-icon-bad { background: var(--red-tint); color: var(--red); }
.verified-badge { margin-left: 8px; vertical-align: middle; }

/* ---------- Admin: email templates and outbox ---------- */
.event-key { font-family: var(--font-mono); font-size: .8rem; background: var(--orange-tint); color: var(--orange-dark); padding: 2px 8px; border-radius: 6px; white-space: nowrap; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.nowrap { white-space: nowrap; }
.break { overflow-wrap: anywhere; }
.outbox-table td[data-label="To"] { min-width: 150px; max-width: 200px; }
.outbox-table td[data-label="Subject"] { min-width: 180px; }
.pad-x { padding: 0 20px 16px; margin: 0; }
.field-hint { margin: -6px 0 0; }
.template-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.template-editor .form-row { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.template-code { font-family: var(--font-mono); font-size: .8rem; line-height: 1.5; resize: vertical; white-space: pre; overflow-wrap: normal; overflow-x: auto; }
.template-side { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 88px; }
.preview-card { overflow: hidden; }
.preview-head { padding: 12px 20px 0; border-bottom: 1px solid var(--line); }
.preview-subject { margin: 12px 0; font-size: .95rem; }
.email-frame { display: block; width: 100%; height: 620px; border: 0; background: var(--bg-soft); }
.preview-text { margin: 0; padding: 20px; min-height: 300px; white-space: pre-wrap; font: .85rem/1.6 var(--font-mono); background: var(--bg-soft); }
.placeholder-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.placeholder-list li { display: flex; flex-direction: column; gap: 2px; }
.placeholder-list code { font-family: var(--font-mono); font-size: .82rem; color: var(--orange-dark); }
.outbox-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.outbox-stat { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); cursor: pointer; font-family: var(--font-body); text-align: left; }
.outbox-stat:hover { border-color: var(--orange); }
.outbox-stat.is-active { border-color: var(--orange-strong); box-shadow: 0 0 0 3px var(--orange-tint-2); }
.outbox-stat-count { font: 700 1.4rem var(--font-display); color: var(--ink); }
.outbox-stat-label { font-size: .82rem; color: var(--muted); }
.stat-deadletter .outbox-stat-count { color: var(--red); }
.stat-failed .outbox-stat-count { color: var(--orange-dark); }
.stat-sent .outbox-stat-count { color: var(--green); }
.email-modal { width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 40px); overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.email-modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.email-modal-head p { margin: 4px 0 0; }
.email-modal .email-frame { height: 520px; border: 1px solid var(--line); border-radius: var(--radius); }
.email-meta { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0; }
.email-meta dt { color: var(--muted); font-size: .78rem; }
.email-meta dd { margin: 0; font-weight: 600; }
@media (max-width: 1100px) {
    .template-editor { grid-template-columns: 1fr; }
    .template-side { position: static; }
    .outbox-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.outbox-table td, .outbox-table th { padding-left: 12px; padding-right: 12px; }
.outbox-table .date-cell { min-width: 92px; max-width: 116px; }

/* Admin · integrations */
.integration-status { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-bottom: 18px; }
.integration-status .card { margin: 0; }
.integration-status-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.integration-status-head .card-title { margin: 0; }
.payload-view { margin: 0; max-height: 460px; overflow: auto; padding: 14px; background: #1f1f1f; color: #ffe8d6; border-radius: var(--radius); font-size: 12.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }

/* ---- Teaching blocks for chapters 11+ (LessonHtml): learning path, real-world use case, hands-on practice ---- */
.lesson-body .learn-path { margin: 0 0 28px; padding: 18px 20px; border-radius: var(--radius-lg); background: var(--orange-tint); border: 1px solid var(--orange-tint-2); }
.lesson-body .learn-path-title { margin: 0 0 12px; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--orange-dark); }
.lesson-body .learn-path-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.lesson-body .learn-path-card { background: #fff; border-radius: var(--radius); padding: 14px 16px; border: 1px solid var(--line); }
.lesson-body .learn-path-card p { margin: 6px 0 0; font-size: .92rem; color: var(--ink-2); }
.lesson-body .learn-path-tag { font-weight: 700; font-size: .85rem; color: var(--ink); }
.lesson-body .use-case { margin: 24px 0; padding: 18px 20px; border-radius: var(--radius); background: #EEF7F1; border-left: 4px solid var(--green); }
.lesson-body .use-case h3 { margin: 2px 0 8px; }
.lesson-body .use-case-tag, .lesson-body .practice-tag { margin: 0; font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--green); }
.lesson-body .practice { margin: 24px 0; padding: 18px 20px; border-radius: var(--radius); background: var(--bg-soft); border: 1px dashed var(--orange); }
.lesson-body .practice-tag { color: var(--orange-strong); }
.lesson-body .practice h3 { margin: 2px 0 8px; }
.lesson-body .practice-done { margin: 10px 0 0; }
@media (max-width: 800px) { .lesson-body .learn-path-grid { grid-template-columns: 1fr; } }
.lesson-body .assignment { margin: 28px 0; padding: 18px 20px; border-radius: var(--radius); background: var(--bg-soft); border: 1px solid var(--green); border-left-width: 4px; }
.lesson-body .assignment-tag { margin: 0; font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--green); }
.lesson-body .assignment h3 { margin: 2px 0 8px; }
.lesson-body .assignment-cmd code { display: inline-block; padding: 6px 10px; overflow-wrap: anywhere; }

/* ---- Interactive labs (wwwroot/js/labs.js) ---- */
.lab-shell { margin: 28px 0; padding: 20px; border-radius: var(--radius-lg); background: var(--bg-soft); border: 1px solid var(--line); }
.lab-title { margin: 0 0 14px; font: 700 1.02rem var(--font-display); color: var(--ink); }
.lab-label { margin: 14px 0 6px; font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.lab-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.lab-out { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; font-size: .92rem; min-height: 3em; overflow-wrap: anywhere; }
.lab-out[hidden] { display: none; }
.lab-shell .lab-pre { margin: 6px 0 0; background: #1F1F1F; color: #F5F5F5; border-radius: 10px; padding: 12px 14px; font: 500 .8rem/1.5 var(--font-mono); white-space: pre-wrap; overflow-wrap: anywhere; min-height: 3em; }
.lab-out .lab-pre { background: var(--bg-soft); color: var(--ink); }
.lab-presets, .lab-modes { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.lab-chip { border: 1px solid var(--line-2); background: #fff; padding: 6px 10px; border-radius: 999px; font: 500 .78rem var(--font-mono); color: var(--ink-2); cursor: pointer; }
.lab-chip:hover { border-color: var(--orange); background: var(--orange-tint); }
.lab-chip b { color: var(--orange-strong); }
.lab-request { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.lab-request .lab-method { width: auto; }
.lab-request .lab-path, .lab-request input { flex: 1 1 220px; min-width: 0; }
.lab-shell .lab-json { width: 100%; font-size: .82rem; margin-bottom: 4px; }
.lab-form { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: flex-end; margin-bottom: 12px; }
.lab-form label { display: flex; flex-direction: column; gap: 4px; font-size: .82rem; font-weight: 600; color: var(--ink-2); min-width: 150px; }
.lab-form label.lab-check { flex-direction: row; align-items: center; min-width: 0; }
.lab-slider { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; margin-bottom: 14px; }
.lab-status { display: inline-block; padding: 2px 10px; border-radius: 999px; font: 700 .78rem var(--font-mono); margin-right: 6px; }
.lab-status.is-ok { background: var(--green-tint); color: var(--green); }
.lab-status.is-warn { background: var(--orange-tint-2); color: var(--orange-dark); }
.lab-status.is-bad { background: var(--red-tint); color: var(--red); }
.lab-table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.lab-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.lab-table th { text-align: left; padding: 8px 10px; background: var(--bg-soft); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.lab-table td { padding: 7px 10px; border-top: 1px solid var(--line); }
.lab-table tr.is-hit td { background: var(--green-tint); }
.lab-table tr.is-tie td { background: #FFF7E0; }
.lab-table tr.is-bad td { background: var(--red-tint); }
.lab-flag { color: var(--red); font-weight: 700; font-size: .75rem; }
.lab-steps { margin: 0; padding-left: 1.3em; font-size: .88rem; }
.lab-steps li { margin-bottom: 4px; }
.lab-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 6px 0 10px; }
.lab-stats .s { display: flex; flex-direction: column; gap: 2px; }
.lab-stats .k { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.lab-stats .v { font-size: 1rem; font-weight: 700; }
.lab-console { font: 500 .8rem/1.6 var(--font-mono); }
.lab-pass { color: var(--green); }
.lab-fail { color: var(--red); }
.lab-summary { margin-top: 8px; font-weight: 700; }
.lab-models { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.lab-model { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.lab-model h4 { margin: 0 0 10px; }
.lab-metric { display: grid; grid-template-columns: 1fr; gap: 2px; font-size: .78rem; color: var(--muted); margin-bottom: 8px; }
.lab-metric b { color: var(--ink); font-size: .85rem; }
.lab-bar { display: block; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.lab-bar i { display: block; height: 100%; border-radius: 3px; transition: width .3s ease; }
.lab-bar i.is-ok { background: var(--green); }
.lab-bar i.is-warn { background: var(--orange); }
.lab-bar i.is-bad { background: var(--red); }
.lab-layers { list-style: none; margin: 12px 0; padding: 0; display: flex; flex-direction: column; gap: 6px; counter-reset: layer; }
.lab-layers li { counter-increment: layer; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: 10px; padding: 8px 12px; font-size: .86rem; }
.lab-layers li::before { content: counter(layer); font: 700 .75rem var(--font-mono); color: var(--muted); }
.lab-layers li strong { min-width: 130px; }
.lab-layers li.is-warn { border-left-color: var(--orange); }
.lab-layers li.is-bad { border-left-color: var(--red); background: var(--red-tint); }
.lab-states { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-bottom: 12px; }
.lab-state { padding: 4px 10px; border-radius: 999px; background: #fff; border: 1px solid var(--line-2); font: 600 .78rem var(--font-mono); color: var(--muted); }
.lab-state.is-current { background: var(--orange-strong); border-color: var(--orange-strong); color: #fff; }
.lab-arrow { color: var(--muted); }
.brand-app { font-family: var(--brand-font), system-ui, sans-serif; border: 1px solid var(--line); border-radius: var(--brand-radius); overflow: hidden; background: #fff; }
.brand-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--brand-primary); color: #fff; }
.brand-logo { font-size: 1.3rem; }
.brand-body { padding: 14px; }
.brand-body h4 { margin: 0 0 4px; color: var(--brand-primary); }
.brand-body p { margin: 0 0 10px; font-size: .88rem; color: var(--ink-2); }
.brand-body label { display: flex; flex-direction: column; gap: 4px; font-size: .8rem; margin-bottom: 10px; }
.brand-input { border: 1px solid var(--line-2); border-radius: var(--brand-radius); padding: 8px 10px; font: inherit; }
.brand-btn { background: var(--brand-primary); color: #fff; border: 0; border-radius: var(--brand-radius); padding: 9px 16px; font: 600 .9rem var(--brand-font), system-ui, sans-serif; cursor: default; }
.lab-line { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 5px 0; border-bottom: 1px dashed var(--line); font-size: .9rem; }
.lab-line:last-child { border-bottom: 0; }
.lab-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.lab-col { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; min-height: 120px; }
.lab-col h4 { margin: 0 0 8px; font-size: .82rem; }
.lab-ticket { border: 1px solid var(--line-2); border-left: 4px solid var(--orange); border-radius: 10px; padding: 8px; margin-bottom: 8px; font-size: .85rem; display: flex; flex-direction: column; gap: 6px; }
.lab-ticket.is-late { border-left-color: var(--red); background: var(--red-tint); }
.lab-map { width: 100%; height: auto; background: #F3F1EC; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; }
.lab-map-roads line { stroke: #fff; stroke-width: 10; }
.lab-map-trail { fill: none; stroke: var(--orange-strong); stroke-width: 3; stroke-dasharray: 6 4; }
.lab-map-pin circle { fill: #fff; stroke: var(--ink); stroke-width: 1.5; }
.lab-map-pin text { font-size: 12px; text-anchor: middle; }
.lab-map-pin.is-assigned circle { stroke: var(--orange-strong); stroke-width: 3; }
.lab-map-label { font: 600 10px var(--font-body); fill: var(--ink); }
.lab-map-fence { fill: rgba(22, 96, 59, .08); stroke: var(--green); stroke-dasharray: 4 3; }
@media (max-width: 800px) { .lab-board { grid-template-columns: 1fr 1fr; } }
@media (max-width: 800px) {
    .lab-grid, .lab-models { grid-template-columns: 1fr; }
    .lab-stats { grid-template-columns: 1fr 1fr; }
    .lab-shell { padding: 14px; }
}

/* ---- Concept panels (ConceptAnnotator) and line-by-line walkthroughs (LessonHtml.Explain) ---- */
.lesson-body .concepts { margin: -6px 0 22px; border: 1px solid var(--line); border-radius: var(--radius); background: #FBFAFF; }
.lesson-body .concepts > summary { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; }
.lesson-body .concepts > summary::-webkit-details-marker { display: none; }
.lesson-body .concepts > summary::after { content: "▾"; margin-left: auto; color: var(--muted); }
.lesson-body .concepts[open] > summary::after { content: "▴"; }
.lesson-body .concepts-title { font-weight: 700; font-size: .88rem; color: #3B2E8F; }
.lesson-body .concepts-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.lesson-body .concept-chip { font: 600 .72rem var(--font-body); padding: 3px 9px; border-radius: 999px; background: #fff; border: 1px solid var(--line-2); color: var(--ink-2); }
.lesson-body .concept-chip.is-new { background: #EEEAFE; border-color: #CFC6FA; color: #3B2E8F; }
.lesson-body .concepts-body { padding: 4px 16px 14px; border-top: 1px solid var(--line); }
.lesson-body .concept-full { padding: 12px 0; border-bottom: 1px dashed var(--line-2); scroll-margin-top: 90px; }
.lesson-body .concept-full:last-child { border-bottom: 0; }
.lesson-body .concept-full h4 { margin: 0 0 4px; font-size: 1rem; }
.lesson-body .concept-full p { margin: 6px 0; font-size: .93rem; }
.lesson-body .concept-short { color: var(--muted); font-style: italic; }
.lesson-body .concept-example-label { font-size: .72rem !important; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-top: 10px !important; }
.lesson-body .concept-ref { font-size: .9rem; margin: 8px 0; }
.lesson-body .code-walk { margin: 18px 0 10px; }
.lesson-body .code-walk-hint { margin: 0 0 6px; font-size: .82rem; font-weight: 600; color: var(--orange-dark); }
.lesson-body pre.cw code { counter-reset: cw; }
.lesson-body .cw-line { display: block; min-height: 1.5em; position: relative; padding-left: 3.2em; margin: 0 -1em; padding-right: 1em; cursor: default; border-left: 3px solid transparent; }
.lesson-body .cw-line::before { counter-increment: cw; content: counter(cw); position: absolute; left: .6em; width: 2em; text-align: right; opacity: .45; }
.lesson-body .cw-line.has-note { cursor: pointer; border-left-color: rgba(255, 105, 0, .45); }
.lesson-body .cw-line.has-note:hover, .lesson-body .cw-line.is-selected { background: rgba(255, 105, 0, .16); border-left-color: var(--orange); }
.lesson-body .cw-notes { margin: 8px 0 0; padding-left: 2.6em; font-size: .92rem; }
.lesson-body .cw-notes li { padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.lesson-body .cw-notes li.is-selected { background: var(--orange-tint); }
.lesson-body .cw-notes li::marker { font: 600 .8rem var(--font-mono); color: var(--orange-strong); }
.lesson-body .cw-ref { display: block; font-size: .78rem; color: var(--muted); background: none; padding: 0; margin-bottom: 2px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---- Written lectures (Data/Content/Lectures) ---- */
.lesson-body .lecture { margin: 22px 0 28px; padding: 6px 22px 14px; border-radius: var(--radius-lg); background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--orange); }
.lesson-body .lecture-tag { margin: 12px 0 0; font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--orange-strong); }
.lesson-body .lecture h3 { margin: 18px 0 6px; font-size: 1.05rem; }
.lesson-body .lecture ol li, .lesson-body .lecture ul li { margin-bottom: 8px; }
@media (max-width: 800px) { .lesson-body .lecture { padding: 4px 14px 10px; } }

/* Page-loading bar: only becomes visible when a navigation takes longer than ~200 ms (see academy.pageLoading). */
.page-loading { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 2000; pointer-events: none; opacity: 0;
  background: linear-gradient(90deg, transparent 0%, #6B3FE6 30%, var(--orange) 60%, transparent 100%); background-size: 200% 100%;
  transition: opacity .15s ease; }
.page-loading.is-active { opacity: 1; animation: page-loading-slide 1.1s linear infinite; }
@keyframes page-loading-slide { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .page-loading.is-active { animation: none; background: #6B3FE6; } }
