:root {
    --ink: #102136;
    --ink-soft: #2f4255;
    --paper: #f3efe5;
    --surface: #fffdf8;
    --teal: #176f70;
    --teal-dark: #0e5557;
    --copper: #b5653f;
    --line: #d7d0c2;
    --muted: #6c746f;
    --good: #246b4b;
    --bad: #9d3f35;
    --shadow: 0 18px 50px rgba(16, 33, 54, .08);
    --max: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background:
        linear-gradient(rgba(16, 33, 54, .025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(16, 33, 54, .025) 1px, transparent 1px),
        var(--paper);
    background-size: 36px 36px;
    font: 16px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { color: inherit; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.site-header {
    min-height: 68px;
    padding: 0 max(20px, calc((100vw - var(--max)) / 2));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    background: var(--ink);
    color: #fff;
    border-bottom: 3px solid var(--copper);
}
.wordmark {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: #fff;
    font-weight: 750;
    text-decoration: none;
    letter-spacing: -.02em;
}
.wordmark b { color: #d8a17d; }
.wordmark-mark {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,.4);
    color: #fff;
    font-family: Georgia, serif;
    font-size: 21px;
    transform: rotate(-5deg);
}
.site-nav { display: flex; align-items: center; gap: 22px; }
.site-nav a { color: rgba(255,255,255,.78); text-decoration: none; font-size: .92rem; font-weight: 650; }
.site-nav a:hover, .site-nav a:focus { color: #fff; }
.site-nav .nav-signin { padding: 7px 12px; border: 1px solid rgba(255,255,255,.45); color: #fff; }

main { min-height: calc(100vh - 126px); }
.site-footer {
    max-width: var(--max);
    margin: 50px auto 0;
    padding: 24px 20px 34px;
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    border-top: 1px solid var(--line);
    font-size: .88rem;
}
.site-footer a { text-decoration: none; }

.entry-shell,
.course-picker,
.return-note,
.dashboard-head,
.daily-panel,
.continue-line,
.dashboard-grid,
.revisit-section,
.quick-sessions,
.course-page-head,
.topic-search-wrap,
.module-list,
.quiz-shell,
.result-page,
.narrow-page {
    width: min(var(--max), calc(100% - 40px));
    margin-inline: auto;
}

.entry-shell {
    padding: 78px 0 56px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    align-items: end;
}
.eyebrow {
    margin: 0 0 8px;
    color: var(--copper);
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}
h1, h2, h3, p { text-wrap: pretty; }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; letter-spacing: -.025em; }
h1 { margin: 0; font-size: clamp(2.2rem, 5vw, 4.65rem); line-height: .98; font-weight: 600; max-width: 780px; }
h2 { margin: 0; font-size: clamp(1.45rem, 2.4vw, 2.15rem); line-height: 1.1; font-weight: 600; }
.lead { max-width: 660px; margin: 24px 0 0; color: var(--ink-soft); font-size: 1.12rem; }
.entry-actions { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 12px; }
.button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border: 1px solid transparent;
    text-decoration: none;
    font-weight: 760;
    cursor: pointer;
    border-radius: 5px;
}
.button-primary { background: var(--teal); color: #fff; box-shadow: 0 7px 0 var(--teal-dark); }
.button-primary:hover { transform: translateY(1px); box-shadow: 0 6px 0 var(--teal-dark); }
.button-quiet { border-color: var(--ink); color: var(--ink); background: transparent; }
.button-large { min-width: 180px; min-height: 52px; }
.today-strip { border-top: 4px solid var(--ink); border-bottom: 1px solid var(--line); }
.today-strip > div { padding: 16px 0; display: grid; grid-template-columns: 66px 1fr; gap: 12px; align-items: baseline; border-bottom: 1px solid var(--line); }
.today-strip > div:last-child { border-bottom: 0; }
.today-strip span { font-family: Georgia, serif; font-size: 1.9rem; color: var(--teal); }
.today-strip small { color: var(--muted); }

.course-picker { padding: 40px 0 24px; }
.section-heading { margin-bottom: 22px; }
.section-heading.compact { margin-bottom: 16px; }
.course-lines { border-top: 2px solid var(--ink); }
.course-line {
    min-height: 74px;
    display: grid;
    grid-template-columns: 92px 1fr auto 28px;
    gap: 18px;
    align-items: center;
    padding: 10px 4px;
    border-bottom: 1px solid var(--line);
    text-decoration: none;
}
.course-line:hover { background: rgba(255,253,248,.55); }
.course-code { color: var(--copper); font-size: .76rem; font-weight: 850; letter-spacing: .08em; }
.course-line strong { font-family: Georgia, serif; font-size: 1.25rem; }
.course-line > span:nth-child(3) { color: var(--muted); font-size: .9rem; }
.course-line > b { color: var(--teal); font-size: 1.3rem; }
.course-line.is-muted { opacity: .58; pointer-events: none; }
.return-note { margin-top: 30px; padding: 22px 0; display: flex; gap: 16px; justify-content: space-between; border-top: 1px solid var(--line); }
.return-note p { margin: 0; color: var(--muted); }
.return-note a { color: var(--teal-dark); font-weight: 750; text-decoration: none; }

.dashboard-head, .course-page-head {
    padding: 48px 0 26px;
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
}
.dashboard-head h1, .course-page-head h1 { font-size: clamp(2.3rem, 5vw, 4rem); }
.course-switch { color: var(--muted); font-size: .88rem; text-decoration: none; border-bottom: 1px solid currentColor; }
.daily-panel {
    min-height: 190px;
    padding: 34px 38px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
    color: #fff;
    background:
        linear-gradient(115deg, rgba(255,255,255,.05), transparent 55%),
        var(--ink);
    border-left: 6px solid var(--copper);
    box-shadow: var(--shadow);
}
.daily-panel .eyebrow { color: #d8a17d; }
.daily-panel p:last-child { margin: 11px 0 0; color: rgba(255,255,255,.72); }
.continue-line {
    margin-top: 18px;
    padding: 17px 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--line);
}
.continue-line .eyebrow { margin-bottom: 2px; }
.continue-line a { color: var(--teal-dark); font-weight: 760; text-decoration: none; }
.dashboard-grid { margin-top: 44px; display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.dashboard-section { padding-top: 18px; border-top: 3px solid var(--ink); }
.week-track { max-width: 320px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.week-track span { height: 13px; background: #d8d2c7; }
.week-track span.filled { background: var(--teal); }
.small-copy { margin: 12px 0 0; color: var(--muted); font-size: .9rem; }
.streak-copy { margin: 4px 0 0; color: var(--copper); font-weight: 760; }
.coverage-track { height: 13px; background: #d8d2c7; overflow: hidden; }
.coverage-track span { display: block; height: 100%; background: var(--teal); }
.text-link { color: var(--teal-dark); font-weight: 750; text-decoration: none; }
.dashboard-section .text-link { display: inline-block; margin-top: 13px; }
.revisit-section { margin-top: 54px; }
.row-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.revisit-list { border-top: 2px solid var(--ink); }
.revisit-list a {
    min-height: 80px;
    padding: 12px 3px;
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(90px, 220px) 120px;
    gap: 20px;
    align-items: center;
    border-bottom: 1px solid var(--line);
    text-decoration: none;
}
.revisit-list a:hover { background: rgba(255,253,248,.5); }
.revisit-list span { display: flex; flex-direction: column; }
.revisit-list small { color: var(--muted); margin-top: 3px; }
.revisit-list i { height: 8px; background: linear-gradient(90deg, var(--teal) var(--progress), #d8d2c7 var(--progress)); }
.revisit-list a > strong { text-align: right; color: var(--teal-dark); font-size: .9rem; }
.empty-state { margin: 0; padding: 22px 0; color: var(--muted); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.quick-sessions { margin-top: 54px; padding: 26px 0; display: flex; justify-content: space-between; align-items: center; border-top: 3px solid var(--ink); border-bottom: 1px solid var(--line); }
.session-buttons { display: flex; gap: 9px; }
.session-buttons a { padding: 10px 13px; color: var(--ink); border: 1px solid var(--ink); text-decoration: none; font-weight: 740; }
.session-buttons a:hover { background: var(--ink); color: #fff; }

.topic-search-wrap { margin-top: 8px; padding: 16px 0; display: grid; grid-template-columns: 140px 1fr; gap: 16px; align-items: center; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.topic-search-wrap label { font-weight: 760; }
.topic-search-wrap input { width: 100%; padding: 12px 0; border: 0; border-bottom: 2px solid var(--ink); background: transparent; color: var(--ink); outline: none; }
.module-list { margin-top: 28px; }
.module-block { border-top: 3px solid var(--ink); }
.module-block summary { padding: 18px 2px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; list-style: none; }
.module-block summary::-webkit-details-marker { display: none; }
.module-block summary span { font: 600 1.35rem/1.2 Georgia, serif; }
.module-block summary small { color: var(--muted); }
.topic-line { min-height: 76px; display: grid; grid-template-columns: 90px minmax(220px, 1fr) minmax(80px, 180px) 108px; gap: 18px; align-items: center; border-top: 1px solid var(--line); }
.topic-ref { color: var(--copper); font-weight: 800; font-size: .82rem; }
.topic-name { display: flex; flex-direction: column; }
.topic-name small { color: var(--muted); margin-top: 2px; }
.topic-meter { height: 7px; background: #d8d2c7; }
.topic-meter span { display: block; height: 100%; background: var(--teal); }
.topic-line > a { color: var(--teal-dark); font-size: .88rem; font-weight: 760; text-decoration: none; text-align: right; }

.quiz-shell { max-width: 880px; padding: 34px 0 60px; }
.quiz-topline { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: center; color: var(--muted); font-size: .85rem; }
.quiz-topline a { text-decoration: none; }
.quiz-topline b { text-align: right; color: var(--ink); }
.quiz-progress { height: 6px; margin: 15px 0 28px; background: #d7d0c2; }
.quiz-progress span { display: block; height: 100%; background: var(--copper); }
.question-panel { padding: clamp(24px, 5vw, 54px); background: var(--surface); border-top: 5px solid var(--ink); box-shadow: var(--shadow); }
.question-meta { display: flex; gap: 8px; margin-bottom: 18px; }
.question-meta span { padding: 3px 7px; border: 1px solid var(--line); color: var(--muted); font-size: .74rem; font-weight: 780; letter-spacing: .05em; }
.question-panel h1 { font-size: clamp(1.55rem, 3.3vw, 2.65rem); line-height: 1.17; }
.clue-toggle { margin: 20px 0 0; padding: 0; border: 0; border-bottom: 1px solid currentColor; background: none; color: var(--teal-dark); cursor: pointer; font-weight: 730; }
.clue-box { margin-top: 12px; padding: 13px 15px; color: var(--ink-soft); background: #f1ece1; border-left: 4px solid var(--copper); }
.answer-list { margin-top: 32px; display: grid; gap: 10px; }
.answer-list button { width: 100%; min-height: 58px; padding: 12px 15px; display: grid; grid-template-columns: 35px 1fr; gap: 10px; align-items: center; text-align: left; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; }
.answer-list button:hover { border-color: var(--teal); transform: translateX(2px); }
.answer-list button:disabled { cursor: default; opacity: .62; transform: none; }
.answer-list button span { width: 29px; height: 29px; display: grid; place-items: center; border: 1px solid var(--line); color: var(--copper); font-weight: 800; }
.answer-list button b { font-weight: 650; }
.answer-feedback { margin-top: 28px; padding-top: 24px; border-top: 2px solid var(--ink); }
.feedback-status { margin: 0; font-family: Georgia, serif; font-size: 1.8rem; font-weight: 600; }
.feedback-status.is-correct { color: var(--good); }
.feedback-status.is-wrong { color: var(--bad); }
.feedback-answer { font-weight: 730; }
.feedback-explanation { color: var(--ink-soft); margin-bottom: 20px; }

.result-page { max-width: 720px; padding: 86px 0 50px; text-align: center; }
.result-score { margin: 20px 0 12px; display: flex; justify-content: center; align-items: baseline; gap: 8px; }
.result-score strong { font: 600 clamp(5rem, 14vw, 9rem)/.8 Georgia, serif; color: var(--teal); }
.result-score span { font-size: 1.4rem; color: var(--muted); }
.result-actions { margin-top: 30px; display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.guest-note { max-width: 500px; margin: 26px auto 0; color: var(--muted); font-size: .92rem; }

.narrow-page { max-width: 700px; padding: 72px 0; }
.narrow-page h1 { font-size: clamp(2.2rem, 6vw, 4rem); margin-bottom: 22px; }
.narrow-page > p { color: var(--ink-soft); }
.route-form { margin-top: 32px; border-top: 2px solid var(--ink); }
.route-choice { min-height: 62px; display: flex; align-items: center; gap: 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.route-choice input { width: 18px; height: 18px; accent-color: var(--teal); }
.route-form .button { margin-top: 24px; }
.form-error { padding: 10px 12px; border-left: 4px solid var(--bad); background: #f8e9e5; color: var(--bad) !important; }

.admin-table { width: 100%; border-collapse: collapse; margin-top: 20px; }
.admin-table th, .admin-table td { padding: 10px; border-bottom: 1px solid var(--line); text-align: left; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.notice { padding: 13px 15px; border-left: 4px solid var(--teal); background: var(--surface); }

@media (max-width: 800px) {
    .site-header { padding-inline: 18px; }
    .site-nav { gap: 12px; }
    .site-nav a:not(.nav-signin):nth-child(n+3) { display: none; }
    .entry-shell { grid-template-columns: 1fr; gap: 38px; padding-top: 54px; }
    .course-line { grid-template-columns: 68px 1fr 24px; }
    .course-line > span:nth-child(3) { display: none; }
    .dashboard-grid { grid-template-columns: 1fr; gap: 32px; }
    .topic-line { grid-template-columns: 74px 1fr 96px; padding: 10px 0; }
    .topic-meter { display: none; }
    .revisit-list a { grid-template-columns: 1fr 110px; }
    .revisit-list i { display: none; }
}

@media (max-width: 580px) {
    .site-header { min-height: 62px; }
    .wordmark > span:last-child { font-size: .9rem; }
    .wordmark-mark { width: 29px; height: 29px; font-size: 18px; }
    .site-nav a { font-size: .82rem; }
    .site-nav a:not(.nav-signin):not(:last-child) { display: none; }
    .entry-shell,
    .course-picker,
    .return-note,
    .dashboard-head,
    .daily-panel,
    .continue-line,
    .dashboard-grid,
    .revisit-section,
    .quick-sessions,
    .course-page-head,
    .topic-search-wrap,
    .module-list,
    .quiz-shell,
    .result-page,
    .narrow-page { width: min(100% - 26px, var(--max)); }
    .entry-shell { padding-top: 40px; }
    h1 { font-size: 2.55rem; }
    .return-note, .dashboard-head, .course-page-head, .quick-sessions { align-items: flex-start; flex-direction: column; }
    .daily-panel { padding: 28px 22px 32px; align-items: flex-start; flex-direction: column; }
    .daily-panel .button { width: 100%; }
    .quick-sessions { gap: 20px; }
    .session-buttons { width: 100%; display: grid; grid-template-columns: 1fr 1fr 1fr; }
    .session-buttons a { padding-inline: 6px; text-align: center; font-size: .82rem; }
    .topic-search-wrap { grid-template-columns: 1fr; gap: 2px; }
    .module-block summary span { font-size: 1.08rem; }
    .topic-line { grid-template-columns: 58px 1fr; gap: 8px 12px; }
    .topic-line > a { grid-column: 2; text-align: left; }
    .quiz-topline { grid-template-columns: auto 1fr auto; }
    .quiz-topline span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
    .question-panel { padding: 24px 18px; }
    .answer-list button { grid-template-columns: 31px 1fr; padding-inline: 10px; }
    .site-footer { flex-direction: column; gap: 8px; }
}

.molecule-frame {
    width: min(100%, 440px);
    min-height: 180px;
    margin: 24px auto 4px;
    display: grid;
    place-items: center;
    background: #fff;
    border: 1px solid var(--line);
}
.molecule-frame svg { width: 100%; max-height: 280px; }

/* v0.2 beta and administration */
select, textarea { font: inherit; color: inherit; }
textarea { resize: vertical; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.beta-mark { margin-left: 8px; color: #d8a17d; font: 750 .65rem/1 ui-sans-serif, system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; }
.flash-message { width: min(var(--max), calc(100% - 40px)); margin: 14px auto 0; padding: 11px 14px; background: #e6f0eb; border-left: 4px solid var(--good); }
.flash-error { background: #f8e9e5; border-color: var(--bad); }
.beta-note,
.dashboard-tools,
.tool-list,
.admin-nav,
.admin-page-head,
.admin-summary-grid,
.admin-link-list,
.admin-quiet-links,
.admin-filter-bar,
.admin-bulk-bar,
.admin-table-wrap,
.label-editor,
.admin-two-column,
.admin-section,
.feedback-list,
.tab-nav,
.status-filter,
.admin-add-panel,
.tool-admin-list,
.question-edit-form { width: min(var(--max), calc(100% - 40px)); margin-inline: auto; }
.beta-note { margin-top: 34px; padding: 20px 0; display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); }
.beta-note p { margin: 0; color: var(--muted); }
.beta-note a { color: var(--teal-dark); font-weight: 750; text-decoration: none; }

.dashboard-tools { margin-top: 54px; }
.dashboard-tool-lines { border-top: 2px solid var(--ink); }
.dashboard-tool-lines a { min-height: 72px; padding: 12px 4px; display: flex; justify-content: space-between; align-items: center; gap: 20px; border-bottom: 1px solid var(--line); text-decoration: none; }
.dashboard-tool-lines span { display: flex; flex-direction: column; }
.dashboard-tool-lines small { color: var(--muted); margin-top: 2px; }
.dashboard-tool-lines b { color: var(--teal-dark); white-space: nowrap; }
.tool-list { border-top: 3px solid var(--ink); }
.tool-line { min-height: 92px; padding: 17px 3px; display: flex; justify-content: space-between; align-items: center; gap: 30px; border-bottom: 1px solid var(--line); }
.tool-line h2 { font-size: 1.35rem; }
.tool-line p { margin: 5px 0 0; color: var(--muted); }
.tool-line > a { color: var(--teal-dark); text-decoration: none; font-weight: 760; white-space: nowrap; }

.topic-line-rated { grid-template-columns: 82px minmax(230px, 1fr) 150px minmax(70px, 130px) 100px; }
.topic-rating { display: flex; flex-direction: column; gap: 2px; }
.topic-rating select { width: 100%; padding: 7px 8px; border: 1px solid var(--line); background: var(--surface); }
.topic-rating small { min-height: 15px; color: var(--good); font-size: .72rem; }
.topic-rating.is-error small { color: var(--bad); }
.question-report-link { display: inline-block; margin-top: 26px; color: var(--muted); font-size: .82rem; text-decoration: none; border-bottom: 1px solid currentColor; }

.plain-form { margin-top: 28px; display: grid; gap: 10px; }
.plain-form label { margin-top: 8px; font-weight: 740; }
.plain-form select, .plain-form textarea, .plain-form input { width: 100%; padding: 11px 12px; border: 1px solid var(--line); background: var(--surface); }
.plain-form .button { justify-self: start; margin-top: 10px; }
.legal-page p { color: var(--ink-soft); }

.admin-nav { margin-top: 24px; display: flex; gap: 7px 18px; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.admin-nav a { color: var(--ink-soft); font-size: .88rem; font-weight: 730; text-decoration: none; }
.admin-nav a:hover { color: var(--teal-dark); }
.admin-page-head { padding: 38px 0 22px; display: flex; justify-content: space-between; align-items: end; gap: 22px; }
.admin-page-head h1 { font-size: clamp(2.25rem, 5vw, 3.8rem); }
.admin-page-head p { margin: 4px 0 0; color: var(--muted); }
.admin-result-count { color: var(--muted); }
.admin-summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 3px solid var(--ink); border-bottom: 1px solid var(--line); }
.admin-summary-grid > a, .admin-summary-grid > div { min-height: 108px; padding: 18px 16px; display: flex; flex-direction: column; justify-content: center; border-right: 1px solid var(--line); text-decoration: none; }
.admin-summary-grid > :last-child { border-right: 0; }
.admin-summary-grid strong { font: 600 2.3rem/1 Georgia, serif; color: var(--teal); }
.admin-summary-grid span { margin-top: 7px; color: var(--muted); font-size: .85rem; }
.admin-link-list { margin-top: 34px; border-top: 2px solid var(--ink); }
.admin-link-list > a { min-height: 76px; padding: 14px 3px; display: flex; justify-content: space-between; align-items: center; gap: 20px; border-bottom: 1px solid var(--line); text-decoration: none; }
.admin-link-list span { display: flex; flex-direction: column; }
.admin-link-list strong { font: 600 1.25rem/1.2 Georgia, serif; }
.admin-link-list small { margin-top: 3px; color: var(--muted); }
.admin-link-list b { color: var(--teal); }
.admin-quiet-links { margin-top: 30px; display: flex; gap: 20px; }
.admin-quiet-links a { color: var(--muted); font-size: .88rem; }

.admin-filter-bar { padding: 15px 0; display: grid; grid-template-columns: minmax(190px, 1.5fr) repeat(3, minmax(110px, .7fr)) auto; gap: 12px; align-items: end; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); }
.admin-filter-bar label { display: flex; flex-direction: column; gap: 4px; }
.admin-filter-bar label > span { color: var(--muted); font-size: .75rem; font-weight: 760; text-transform: uppercase; letter-spacing: .05em; }
.admin-filter-bar input, .admin-filter-bar select { width: 100%; min-height: 40px; padding: 8px 9px; border: 1px solid var(--line); background: var(--surface); }
.admin-filter-bar .filter-check { min-height: 40px; flex-direction: row; align-items: center; gap: 7px; }
.admin-filter-bar .filter-check input { width: auto; min-height: auto; }
.question-filters { grid-template-columns: minmax(170px, 1.3fr) repeat(4, minmax(100px, .65fr)) auto auto; }
.admin-bulk-bar { margin-top: 14px; display: flex; gap: 8px; align-items: center; }
.admin-bulk-bar select, .admin-bulk-bar button { min-height: 38px; padding: 7px 10px; border: 1px solid var(--line); background: var(--surface); }
.admin-bulk-bar button { cursor: pointer; font-weight: 720; }
.admin-table-wrap { overflow-x: auto; }
.admin-table { min-width: 780px; background: rgba(255,253,248,.45); }
.admin-table th { color: var(--muted); font-size: .73rem; text-transform: uppercase; letter-spacing: .05em; }
.admin-table td { vertical-align: middle; }
.admin-table td small { display: block; color: var(--muted); }
.admin-user-link, .question-snippet { display: flex; flex-direction: column; text-decoration: none; min-width: 180px; }
.admin-user-link small, .question-snippet small { color: var(--muted); }
.label-row { display: flex; flex-wrap: wrap; gap: 4px; min-width: 130px; }
.user-label, .user-label-button { padding: 4px 7px; border: 1px solid var(--line); background: transparent; color: var(--ink-soft); font-size: .72rem; font-weight: 740; white-space: nowrap; }
.user-label-button { cursor: pointer; opacity: .62; }
.user-label-button.is-active { opacity: 1; background: var(--surface); border-color: var(--teal); }
.label-current_tutee { border-color: var(--teal); color: var(--teal-dark); }
.label-former_tutee { color: var(--muted); }
.label-beta_tester { border-color: var(--copper); color: #884829; }
.label-priority { border-color: var(--bad); color: var(--bad); }
.label-staff_test { border-style: dashed; }
.table-action { padding: 6px 8px; border: 1px solid var(--line); background: transparent; color: var(--ink-soft); font-size: .78rem; font-weight: 720; cursor: pointer; white-space: nowrap; }
.table-action.is-active { color: var(--teal-dark); border-color: var(--teal); }
.report-count { color: var(--bad); font-weight: 750; }

.admin-student-head { align-items: center; }
.student-course-block { display: flex; flex-direction: column; text-align: right; }
.student-course-block small { color: var(--muted); }
.label-editor { display: flex; flex-wrap: wrap; gap: 7px; padding-bottom: 22px; }
.student-summary-grid { grid-template-columns: repeat(4, 1fr); }
.admin-two-column { margin-top: 42px; display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.admin-topic-list { border-top: 2px solid var(--ink); }
.admin-topic-list > div, .rank-list > div { min-height: 62px; padding: 10px 2px; display: flex; justify-content: space-between; align-items: center; gap: 20px; border-bottom: 1px solid var(--line); }
.admin-topic-list span, .rank-list span { display: flex; flex-direction: column; }
.admin-topic-list small, .rank-list small { color: var(--muted); }
.topic-comparison { text-align: right; }
.note-form { display: grid; gap: 8px; }
.note-form textarea { width: 100%; padding: 10px; border: 1px solid var(--line); background: var(--surface); }
.note-form button { justify-self: start; padding: 7px 10px; border: 1px solid var(--ink); background: transparent; cursor: pointer; font-weight: 730; }
.note-list { margin-top: 18px; border-top: 1px solid var(--line); }
.note-list article { padding: 13px 2px; border-bottom: 1px solid var(--line); }
.note-list p { margin: 0 0 5px; }
.note-list small { color: var(--muted); }
.admin-section { margin-top: 44px; }

.cohort-select { display: flex; align-items: center; gap: 8px; }
.cohort-select select, .status-filter select { padding: 8px 10px; border: 1px solid var(--line); background: var(--surface); }
.analytics-summary { grid-template-columns: repeat(5, 1fr); }
.analytics-columns { align-items: start; }
.funnel-list > div { margin-bottom: 15px; }
.funnel-list span { display: flex; justify-content: space-between; gap: 15px; }
.funnel-list small { color: var(--muted); }
.funnel-list i, .daily-bars i { display: block; height: 9px; margin-top: 5px; background: #d8d2c7; }
.funnel-list i b, .daily-bars i b { display: block; height: 100%; background: var(--teal); }
.daily-bars > div { display: grid; grid-template-columns: 54px 1fr 45px; gap: 9px; align-items: center; margin-bottom: 8px; }
.daily-bars span, .daily-bars small { color: var(--muted); font-size: .8rem; }
.daily-bars small { text-align: right; }
.rank-list { border-top: 2px solid var(--ink); }

.tab-nav { display: flex; gap: 20px; border-bottom: 1px solid var(--line); }
.tab-nav a { padding: 11px 0; text-decoration: none; color: var(--muted); font-weight: 730; }
.tab-nav a.is-active { color: var(--ink); border-bottom: 3px solid var(--teal); }
.status-filter { padding: 15px 0; }
.feedback-list { border-top: 2px solid var(--ink); }
.feedback-item { padding: 17px 3px; display: flex; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.feedback-item.is-resolved { opacity: .6; }
.feedback-item-main { min-width: 0; }
.feedback-item h2 { font-size: 1.2rem; }
.feedback-item p { margin: 8px 0; }
.feedback-item small { display: block; color: var(--muted); }
.feedback-meta { display: flex; gap: 10px; align-items: center; }
.feedback-meta span { color: var(--copper); font-size: .73rem; text-transform: uppercase; font-weight: 800; letter-spacing: .05em; }
.feedback-question { color: var(--ink-soft); font-weight: 700; }

.admin-add-panel { margin-top: 10px; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); }
.admin-add-panel summary { padding: 15px 2px; cursor: pointer; font-weight: 750; }
.tool-admin-list { margin-top: 30px; }
.tool-admin-row { border-top: 1px solid var(--line); }
.tool-admin-row summary { padding: 15px 2px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
.tool-admin-row summary span { display: flex; flex-direction: column; }
.tool-admin-row summary small { color: var(--muted); }
.tool-admin-row summary b { color: var(--muted); font-size: .8rem; }
.tool-edit-form, .question-edit-form { padding: 20px 0 26px; display: grid; gap: 10px; }
.tool-edit-form label, .question-edit-form label { display: grid; gap: 5px; font-weight: 720; }
.tool-edit-form input, .tool-edit-form select, .question-edit-form input, .question-edit-form select, .question-edit-form textarea { width: 100%; padding: 9px 10px; border: 1px solid var(--line); background: var(--surface); }
.tool-edit-form label small, .question-edit-form label small { color: var(--muted); font-weight: 400; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.check-label { display: flex !important; grid-template-columns: none !important; flex-direction: row !important; align-items: center; }
.check-label input { width: auto !important; }
.question-edit-form { max-width: 900px; }
.question-table .question-snippet { max-width: 520px; }

@media (max-width: 900px) {
    .topic-line-rated { grid-template-columns: 70px 1fr 135px 92px; }
    .topic-line-rated .topic-meter { display: none; }
    .admin-summary-grid, .analytics-summary { grid-template-columns: repeat(2, 1fr); }
    .admin-summary-grid > :nth-child(2n) { border-right: 0; }
    .admin-filter-bar, .question-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-filter-bar .button { align-self: end; }
    .admin-two-column { grid-template-columns: 1fr; gap: 34px; }
}

@media (max-width: 580px) {
    .beta-note, .tool-line, .admin-page-head { flex-direction: column; align-items: flex-start; }
    .dashboard-tools,
    .tool-list,
    .admin-nav,
    .admin-page-head,
    .admin-summary-grid,
    .admin-link-list,
    .admin-quiet-links,
    .admin-filter-bar,
    .admin-bulk-bar,
    .admin-table-wrap,
    .label-editor,
    .admin-two-column,
    .admin-section,
    .feedback-list,
    .tab-nav,
    .status-filter,
    .admin-add-panel,
    .tool-admin-list,
    .question-edit-form,
    .flash-message,
    .beta-note { width: min(100% - 26px, var(--max)); }
    .topic-line-rated { grid-template-columns: 52px 1fr; }
    .topic-line-rated .topic-rating, .topic-line-rated > a { grid-column: 2; }
    .topic-rating { max-width: 180px; }
    .admin-filter-bar, .question-filters { grid-template-columns: 1fr; }
    .admin-bulk-bar { align-items: stretch; flex-direction: column; }
    .admin-summary-grid, .student-summary-grid, .analytics-summary { grid-template-columns: 1fr 1fr; }
    .admin-summary-grid > a, .admin-summary-grid > div { min-height: 92px; padding: 14px 12px; }
    .admin-summary-grid strong { font-size: 1.8rem; }
    .student-course-block { text-align: left; }
    .form-row-3 { grid-template-columns: 1fr; }
    .feedback-item { flex-direction: column; }
    .tool-line > a { align-self: flex-start; }
}
