/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Design tokens ── */
:root {
    --blue:        #2563eb;
    --blue-dark:   #1d4ed8;
    --navy:        #1e3a5f;
    --navy-dark:   #0f2340;
    --green:       #059669;
    --amber:       #d97706;
    --accent:      #f59e0b;   /* GoRevise brand amber — Rev's colour */
    --red:         #dc2626;
    --bg:          #f1f5f9;
    --surface:     #ffffff;
    --text:        #0f172a;
    --muted:       #64748b;
    --border:      #e2e8f0;
    --radius:      10px;
    --shadow:      0 1px 4px rgba(0,0,0,.08);
    --shadow-md:   0 4px 12px rgba(0,0,0,.12);
}

/* ── Base ── */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
    min-height: 100vh;
}

/* ── Header ── */
.site-header {
    background: var(--navy);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    position: sticky;
    top: 0;
    z-index: 200;
    box-shadow: 0 2px 8px rgba(0,0,0,.3);
}

.site-logo {
    color: #fff;
    text-decoration: none;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -.4px;
}
.logo-go { color: var(--accent); }

.site-nav a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    margin-left: 20px;
    transition: color .12s;
}

.site-nav a:hover    { color: #fff; }
.site-nav .nav-cta   { color: #93c5fd; }
.site-nav .nav-logout { color: #64748b; font-size: 13px; }

/* ── Main layout ── */
.site-main {
    max-width: 700px;
    margin: 0 auto;
    padding: 20px 14px 60px;
}

/* ── Flash messages ── */
.flash-wrap { max-width: 700px; margin: 12px auto 0; padding: 0 14px; }
.flash {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 14px;
}
.flash-success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.flash-error   { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.flash-info    { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }

/* ── Cards ── */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 14px;
    box-shadow: var(--shadow);
}
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.card-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    margin-bottom: 10px;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 20px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    line-height: 1.2;
    transition: background .12s, box-shadow .12s, color .12s;
    white-space: nowrap;
}
.btn-primary  { background: var(--blue);  color: #fff; }
.btn-primary:hover  { background: var(--blue-dark); }
.btn-secondary { background: #e8eef4; color: #334155; }
.btn-secondary:hover { background: #d1dce8; }
.btn-ghost  { background: transparent; color: var(--muted); border: 1.5px solid var(--border); }
.btn-ghost:hover { background: #f8fafc; color: var(--text); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-lg  { padding: 14px 28px; font-size: 16px; }
.btn-sm  { padding: 7px 13px; font-size: 13px; border-radius: 6px; }
.btn-full { width: 100%; }

/* ── Forms ── */
.form-group { margin-bottom: 16px; }
.form-group:last-child { margin-bottom: 0; }

label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 5px;
}
.label-hint { font-weight: 400; text-transform: none; font-size: 11px; }

input[type=text], input[type=email], input[type=password], textarea, select {
    width: 100%;
    padding: 11px 13px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    color: var(--text);
    background: #fafafa;
    transition: border-color .15s;
    appearance: none;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--blue);
    background: #fff;
}
textarea { min-height: 120px; resize: vertical; }
.form-select { cursor: pointer; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 160px; }
.form-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    margin-bottom: 14px;
}

/* ── Page header ── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 12px;
}
.page-header h1 { font-size: 24px; font-weight: 800; }

/* ── Section title ── */
.section-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 12px;
    margin-top: 24px;
}

/* ── Actions bar ── */
.actions {
    display: flex;
    gap: 10px;
    margin-top: 6px;
    flex-wrap: wrap;
}

/* ── Badges ── */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.badge-teacher { background: #ede9fe; color: #6d28d9; }
.badge-student { background: #dbeafe; color: #1d4ed8; }
.badge-admin   { background: #fef3c7; color: #b45309; }
.badge-short   { background: #dbeafe; color: #1d4ed8; }
.badge-extended { background: #ede9fe; color: #6d28d9; }
.badge-mcq     { background: #d1fae5; color: #065f46; }
.badge-used    { background: #f1f5f9; color: #94a3b8; }
.badge-active  { background: #d1fae5; color: #065f46; }

/* ── Score colours ── */
.score-excellent { color: var(--green); }
.score-ok        { color: var(--amber); }
.score-needs-work { color: var(--red); }

/* ── Hero (landing) ── */
.hero {
    background: linear-gradient(135deg, var(--navy) 0%, #1a56a0 100%);
    color: #fff;
    border-radius: 16px;
    padding: 48px 32px;
    margin-bottom: 24px;
    text-align: center;
}
.hero-board { font-size: 13px; color: #93c5fd; font-weight: 600; letter-spacing: .08em; margin-bottom: 12px; text-transform: uppercase; }
.hero-title { font-size: 38px; font-weight: 900; letter-spacing: -1px; margin-bottom: 14px; }
.hero-sub   { font-size: 16px; color: #bfdbfe; max-width: 440px; margin: 0 auto 28px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
.feature-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow);
}
.feature-icon { font-size: 28px; margin-bottom: 10px; }
.feature-card h3 { font-size: 15px; margin-bottom: 6px; }
.feature-card p  { font-size: 13px; color: var(--muted); }

/* ── Accent button (GoRevise amber CTA) ── */
.btn-accent {
    background: var(--accent);
    color: #000;
    border: 2px solid var(--accent);
    font-weight: 700;
}
.btn-accent:hover { background: #d97706; border-color: #d97706; }

/* ── Landing page — hero tweaks ── */
.hero-kicker { font-size: 13px; color: var(--accent); font-weight: 700; letter-spacing: .1em; margin-bottom: 12px; text-transform: uppercase; }
.hero-note   { font-size: 12px; color: #93c5fd; margin-top: 14px; }

/* ── Subjects strip ── */
.subjects-strip {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 10px;
    background: var(--surface);
    border-radius: var(--radius);
    padding: 14px 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    font-size: 14px;
}
.strip-label   { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin-right: 4px; }
.strip-subject { font-weight: 700; color: var(--text); }
.strip-dot     { color: var(--muted); }
.strip-boards  { color: var(--muted); font-size: 13px; margin-left: 4px; }

/* ── How it works ── */
.how-it-works  { margin-bottom: 24px; }
.section-title { font-size: 18px; font-weight: 800; margin-bottom: 16px; letter-spacing: -.3px; }
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}
.step {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    position: relative;
}
.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--accent);
    color: #000;
    font-size: 15px;
    font-weight: 900;
    margin-bottom: 12px;
}
.step h3 { font-size: 15px; margin-bottom: 6px; }
.step p  { font-size: 13px; color: var(--muted); }

/* ── Parent callout ── */
.parent-callout {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 24px;
}
.parent-callout h3 { font-size: 14px; font-weight: 700; color: #0369a1; margin-bottom: 8px; text-transform: uppercase; letter-spacing: .06em; }
.parent-callout p  { font-size: 14px; color: #0c4a6e; line-height: 1.6; }

/* ── Landing bottom CTA ── */
.landing-cta {
    background: var(--navy);
    color: #fff;
    border-radius: 16px;
    padding: 40px 32px;
    text-align: center;
    margin-bottom: 24px;
}
.landing-cta h2   { font-size: 24px; font-weight: 900; margin-bottom: 8px; }
.landing-cta p    { color: #bfdbfe; margin-bottom: 24px; }

/* ── Auth pages ── */
.auth-wrap { max-width: 400px; margin: 40px auto; }
.auth-card { background: var(--surface); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow-md); }
.auth-title { font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.auth-sub   { font-size: 14px; color: var(--muted); margin-bottom: 20px; }
.auth-switch { font-size: 13px; color: var(--muted); text-align: center; margin-top: 16px; }
.auth-switch a { color: var(--blue); }

/* ── Student dashboard ── */
.topic-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.topic-stat-card { background: var(--surface); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.topic-aos  { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; margin-bottom: 4px; }
.topic-name { font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.progress-bar-wrap { background: var(--bg); border-radius: 4px; height: 6px; margin-bottom: 6px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 4px; transition: width .4s; }
.progress-excellent { background: var(--green); }
.progress-ok        { background: var(--amber); }
.progress-needs-work { background: var(--red); }
.topic-meta { font-size: 12px; color: var(--muted); }

.session-list { display: flex; flex-direction: column; gap: 8px; }
.session-row  { background: var(--surface); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 12px; }
.session-info { flex: 1; }
.session-topic { font-size: 15px; font-weight: 600; }
.session-meta  { font-size: 12px; color: var(--muted); margin-top: 2px; }
.session-score { font-size: 15px; font-weight: 700; min-width: 50px; text-align: right; }

.empty-state { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty-icon  { font-size: 40px; margin-bottom: 12px; }
.empty-state h2 { font-size: 20px; color: var(--text); margin-bottom: 8px; }
.empty-state p  { font-size: 14px; margin-bottom: 20px; }

/* ── Revise page ── */
.duration-options { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.duration-option { cursor: pointer; }
.duration-option input { display: none; }
.duration-option span {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    border: 2px solid var(--border);
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
    transition: all .12s;
    cursor: pointer;
}
.duration-option input:checked + span {
    border-color: var(--blue);
    background: #eff6ff;
    color: var(--blue);
}
.aos-label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 14px 0 6px; }
.topic-desc-list { list-style: none; }
.topic-desc-list li { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.topic-desc-list li:last-child { border-bottom: none; }
.topic-desc-text { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }

/* ── Session / question ── */
.session-header { margin-bottom: 14px; }
.session-meta-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface);
    border-radius: 8px;
    padding: 10px 16px;
    box-shadow: var(--shadow);
    font-size: 14px;
}
.session-topic-label { flex: 1; font-weight: 600; }
.session-progress    { color: var(--muted); }
.session-timer       { font-weight: 700; color: var(--green); }
.session-timer.timer-low { color: var(--amber); }
.session-timer.timer-up  { color: var(--red); }

.question-card { border-left: 4px solid var(--blue); }
.question-type-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.q-type-badge { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 20px; }
.q-type-short    { background: #dbeafe; color: #1d4ed8; }
.q-type-extended { background: #ede9fe; color: #6d28d9; }
.q-type-mcq      { background: #d1fae5; color: #065f46; }
.q-marks { font-size: 13px; color: var(--muted); margin-left: auto; }
.question-text { font-size: 17px; line-height: 1.6; font-weight: 500; white-space: pre-wrap; }

.answer-label { font-size: 13px !important; font-weight: 700 !important; text-transform: uppercase; margin-bottom: 8px !important; }
.answer-textarea { font-size: 16px; line-height: 1.6; }
.answer-hint { font-size: 12px; color: var(--muted); margin-top: 6px; }

.mcq-options { display: flex; flex-direction: column; gap: 8px; }
.mcq-option { cursor: pointer; }
.mcq-option input { display: none; }
.mcq-option span {
    display: block;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    transition: all .12s;
    cursor: pointer;
}
.mcq-option input:checked + span { border-color: var(--blue); background: #eff6ff; color: var(--blue); font-weight: 600; }

/* ── Feedback ── */
.score-banner {
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    margin-bottom: 14px;
}
.score-banner.score-excellent { background: #f0fdf4; border: 2px solid #bbf7d0; }
.score-banner.score-ok        { background: #fffbeb; border: 2px solid #fde68a; }
.score-banner.score-needs-work { background: #fef2f2; border: 2px solid #fecaca; }
.score-fraction { font-size: 44px; font-weight: 900; line-height: 1; }
.score-denom    { font-size: 28px; }
.score-label    { font-size: 15px; font-weight: 600; margin-top: 6px; }

.score-banner.score-excellent .score-fraction,
.score-banner.score-excellent .score-label { color: var(--green); }
.score-banner.score-ok .score-fraction,
.score-banner.score-ok .score-label        { color: var(--amber); }
.score-banner.score-needs-work .score-fraction,
.score-banner.score-needs-work .score-label { color: var(--red); }

.student-answer { font-size: 15px; color: var(--muted); line-height: 1.6; background: var(--bg); padding: 12px; border-radius: 6px; white-space: pre-wrap; }
.feedback-card  { border-left: 4px solid var(--green); }
.feedback-text  { font-size: 15px; line-height: 1.7; white-space: pre-wrap; }

/* ── Session complete ── */
.complete-hero { text-align: center; padding: 32px 0 20px; }
.complete-circle {
    width: 100px; height: 100px;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 24px; font-weight: 900;
    margin-bottom: 14px;
    border: 5px solid;
}
.score-ring-excellent { border-color: var(--green); color: var(--green); background: #f0fdf4; }
.score-ring-ok        { border-color: var(--amber); color: var(--amber); background: #fffbeb; }
.score-ring-needs-work { border-color: var(--red);  color: var(--red);  background: #fef2f2; }
.complete-title { font-size: 26px; font-weight: 800; margin-bottom: 8px; }
.complete-sub   { font-size: 14px; color: var(--muted); }

.breakdown-row { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); align-items: flex-start; }
.breakdown-row:last-child { border-bottom: none; }
.breakdown-q  { flex: 1; }
.breakdown-text     { font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.breakdown-feedback { font-size: 12px; color: var(--muted); line-height: 1.5; }
.breakdown-score    { font-size: 15px; font-weight: 700; min-width: 48px; text-align: right; padding-top: 2px; }

/* ── Teacher ── */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 20px; }
.stat-card  { background: var(--surface); border-radius: var(--radius); padding: 16px; text-align: center; box-shadow: var(--shadow); }
.stat-num   { font-size: 28px; font-weight: 800; color: var(--navy); }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 4px; }

.title-hint { font-size: 12px; font-weight: 400; color: var(--muted); }

.q-review-list { display: flex; flex-direction: column; gap: 12px; }
.q-review-row  { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.q-review-row:last-child { border-bottom: none; }
.q-review-info { flex: 1; }
.q-review-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.q-topic { font-size: 12px; color: var(--muted); }
.q-rating { font-size: 12px; color: var(--amber); font-weight: 600; }
.q-rating.unrated { color: var(--muted); }
.q-review-text { font-size: 14px; line-height: 1.5; color: var(--text); }

.mark-scheme-text {
    font-size: 14px; line-height: 1.7; color: #334155;
    background: #f8fafc; padding: 14px; border-radius: 8px;
    white-space: pre-wrap;
}

.attempt-row { padding: 10px 0; border-bottom: 1px solid var(--border); display: flex; gap: 10px; align-items: flex-start; }
.attempt-row:last-child { border-bottom: none; }
.attempt-answer { flex: 1; font-size: 13px; color: var(--muted); line-height: 1.5; }
.attempt-mark   { font-size: 14px; font-weight: 700; min-width: 44px; text-align: right; }

.rating-existing { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.rating-row { display: flex; gap: 24px; margin-bottom: 16px; flex-wrap: wrap; }
.star-row { display: flex; gap: 4px; margin: 8px 0; }
.star {
    background: none; border: none; cursor: pointer;
    font-size: 26px; color: #d1d5db; padding: 2px;
    transition: color .1s; line-height: 1;
}
.star.active { color: #f59e0b; }
.rating-hint { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ── Invite page ── */
.invite-banner {
    background: #f0fdf4; border: 1.5px solid #bbf7d0;
    border-radius: var(--radius); padding: 16px 20px; margin-bottom: 16px;
}
.invite-url {
    font-family: monospace; font-size: 13px;
    background: #fff; padding: 10px 12px; border-radius: 6px;
    margin: 8px 0; word-break: break-all; color: var(--navy);
    border: 1px solid var(--border);
}
.invite-meta { font-size: 12px; color: var(--muted); margin-top: 6px; }

.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; padding: 8px; background: var(--bg); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.data-table td { padding: 8px; border-top: 1px solid var(--border); }

/* ── Subject / level filter pills (revise page) ── */
.filter-group { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.filter-pill {
    padding: 8px 18px;
    border-radius: 20px;
    border: 2px solid var(--border);
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
    background: var(--surface);
    cursor: pointer;
    transition: border-color .12s, background .12s, color .12s;
}
.filter-pill:hover  { border-color: #94a3b8; color: var(--text); }
.filter-pill.active { border-color: var(--blue); background: #eff6ff; color: var(--blue); }

/* ── Subject group label on dashboard ── */
.group-label {
    font-size: 12px; font-weight: 700; color: var(--muted);
    text-transform: uppercase; letter-spacing: .06em;
    margin-bottom: 8px;
}

/* ── Retire flag badges ── */
.retire-flag {
    display: inline-block;
    font-size: 11px; font-weight: 700;
    padding: 2px 8px; border-radius: 4px;
    background: #fffbeb; color: #b45309; border: 1px solid #fde68a;
}
.retire-flag-warn { background: #fef2f2; color: var(--red); border-color: #fecaca; }
.retire-flag-mine { background: #f1f5f9; color: var(--muted); border-color: var(--border); font-weight: 400; font-size: 12px; padding: 4px 10px; border-radius: 6px; }
.retire-btn { color: var(--red); border-color: #fca5a5; }
.retire-btn:hover { background: #fef2f2; border-color: var(--red); }

/* ── Retire notice below review card ── */
.retire-notice {
    font-size: 13px; color: #92400e;
    background: #fffbeb; border: 1px solid #fde68a;
    border-radius: 8px; padding: 12px 16px; margin-bottom: 14px;
}

/* ── Pending retirement card (admin) ── */
.card-pending-retirement { border-left: 4px solid var(--red); }

/* ── Attempt AI feedback line (teacher review) ── */
.attempt-body { flex: 1; }
.attempt-feedback {
    font-size: 12px; color: #475569; line-height: 1.5;
    margin-top: 6px; font-style: italic;
    background: #f8fafc; padding: 6px 10px; border-radius: 4px;
}

/* ── Difficulty rating (feedback page) ── */
.difficulty-card { border-left: 4px solid var(--border); }
.required-hint { font-size: 11px; color: var(--red); font-weight: 600; text-transform: none; letter-spacing: 0; margin-left: 4px; }
.difficulty-options { display: flex; gap: 8px; margin-top: 10px; }
.difficulty-btn {
    flex: 1; padding: 10px 8px; border-radius: 8px;
    font-size: 14px; font-weight: 700; border: 2px solid;
    cursor: pointer; transition: background .12s, color .12s;
    background: none;
}
.diff-easy     { border-color: var(--green); color: var(--green); }
.diff-easy:hover     { background: var(--green); color: #fff; }
.diff-moderate { border-color: var(--amber); color: var(--amber); }
.diff-moderate:hover { background: var(--amber); color: #fff; }
.diff-hard     { border-color: var(--red);   color: var(--red); }
.diff-hard:hover     { background: var(--red);   color: #fff; }

/* ── "I'm a teacher" dispute link ── */
.teacher-dispute-link { text-align: center; margin-top: 8px; }
.dispute-link { font-size: 12px; color: var(--muted); text-decoration: none; }
.dispute-link:hover { color: var(--text); text-decoration: underline; }

/* ── Disputed attempt card (teacher review) ── */
.card-dispute { border-left: 4px solid var(--amber); background: #fffbeb; }
.dispute-meta { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }

/* ── Retry panel (session complete + dashboard) ── */
.retry-panel { margin-top: 16px; }
.retry-label { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.retry-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.retry-btn { font-size: 14px; }

/* ── Subject preference banner (revise page) ── */
.pref-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 4px;
}
.pref-banner-label { color: var(--muted); }
.pref-banner-val   { font-weight: 700; color: var(--blue); }
.pref-change-btn {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--blue);
    cursor: pointer;
    font-size: 13px;
    padding: 2px 6px;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.pref-change-btn:hover { color: var(--blue-dark); }

/* ── Topic stats in reference card (revise page) ── */
.topic-ref-header { display: flex; align-items: baseline; gap: 10px; }
.topic-stat {
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.topic-stat-good { color: var(--green); }
.topic-stat-ok   { color: var(--amber); }
.topic-stat-poor { color: var(--red);   }
.topic-stat-new  { color: var(--muted); font-weight: 400; }

/* ── Upload notes page ── */
.board-tooltip-trigger {
    color: var(--blue); cursor: pointer; text-decoration: underline dotted;
}
.board-tooltip {
    margin-top: 8px; padding: 10px 14px;
    background: #eff6ff; border: 1px solid #bfdbfe;
    border-radius: 8px; font-size: 13px; color: #1e40af; line-height: 1.5;
}

/* ── Responsive ── */
@media (max-width: 480px) {
    .site-main { padding: 14px 10px 50px; }
    .hero { padding: 32px 20px; }
    .hero-title { font-size: 28px; }
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .rating-row { flex-direction: column; gap: 12px; }
    .question-text { font-size: 16px; }
    .score-fraction { font-size: 36px; }
    .actions { flex-direction: column; }
    .page-header h1 { font-size: 20px; }
}
