/* ==========================================================================
   SITE STYLES: shell, dashboard, pre-test instructions, results, static pages
   ========================================================================== */

:root {
  --brand: #0f2a44;
  --brand-2: #1b4166;
  --primary: #1d5fb4;
  --primary-hover: #174d93;
  --page-bg: #f5f7fa;
  --card-bg: #ffffff;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #5b6475;
  --border: #e2e8f0;
  --success: #15803d;
  --success-bg: #dcfce7;
  --danger: #b91c1c;
  --danger-bg: #fee2e2;
  --warn: #9a4a07;
  --warn-bg: #fff4e5;
  --info-bg: #eaf2fc;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 12px 24px -8px rgba(15, 23, 42, 0.18);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

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

body.in-exam { overflow: hidden; }

[hidden] { display: none !important; }

a { color: var(--primary); }
a:hover { color: var(--primary-hover); }

:focus-visible { outline: 3px solid #f59e0b; outline-offset: 2px; }

.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;
}

.view-container { display: none; min-height: 100vh; }
.view-container.active { display: block; }

.muted-text { color: var(--muted); }
.small-text { font-size: 0.9em; color: var(--text-2); margin-top: 8px; }
.lead-text { font-size: 1.08em; color: var(--text-2); margin-bottom: 18px; }
.empty-note { color: var(--muted); padding: 24px; text-align: center; }
.warn-text { color: var(--danger); font-size: 0.92em; margin-top: 10px; }

/* Buttons ---------------------------------------------------------------- */
.btn-primary, .btn-secondary, .btn-danger {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px; border-radius: 6px; font-weight: 600; font-size: 0.95em;
  cursor: pointer; text-decoration: none; border: 1px solid transparent; font-family: inherit;
  line-height: 1.3;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); color: #fff; }
.btn-secondary { background: #fff; color: var(--text-2); border-color: #cbd5e1; }
.btn-secondary:hover { background: #f1f5f9; color: var(--text); }
.btn-danger { background: #b91c1c; color: #fff; }
.btn-danger:hover { background: #991b1b; }
.btn-lg { padding: 11px 24px; font-size: 1em; }
.btn-sm { padding: 5px 12px; font-size: 0.85em; }
.btn-link {
  display: inline-flex; align-items: center; gap: 6px; background: none; border: none; padding: 4px 0;
  color: var(--primary); font-weight: 650; font-size: 0.9em; cursor: pointer; font-family: inherit;
}
.btn-link:hover { color: var(--primary-hover); text-decoration: underline; }

/* Site navigation ---------------------------------------------------------- */
.site-nav {
  background: var(--brand); color: #fff;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 12px 24px; flex-wrap: wrap;
}
.site-brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.site-brand:hover { color: #fff; }
.site-logo {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 9px; background: #fff; color: var(--brand);
  font-weight: 800; font-size: 1.2em;
}
.site-logo.small { width: 26px; height: 26px; font-size: 0.9em; border-radius: 6px; }
.site-name { display: block; font-weight: 800; font-size: 1.15em; letter-spacing: 0.2px; }
.site-tagline { display: block; font-size: 0.8em; opacity: 0.8; }
.site-links { display: flex; gap: 4px; flex-wrap: wrap; }
.site-links a {
  color: #dbe7f5; text-decoration: none; padding: 7px 12px; border-radius: 6px; font-weight: 600; font-size: 0.92em;
}
.site-links a:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.site-links a[aria-current="page"] { background: rgba(255, 255, 255, 0.16); color: #fff; }

.site-main { max-width: 1100px; margin: 0 auto; padding: 32px 20px 48px; outline: none; }

.site-footer {
  border-top: 1px solid var(--border); background: #fff; color: var(--muted);
  font-size: 0.85em; padding: 20px 24px; text-align: center;
}
.site-footer p { max-width: 860px; margin: 0 auto 6px; }

/* Dashboard ---------------------------------------------------------------- */
.hero { text-align: center; margin: 8px auto 28px; max-width: 760px; }
.hero h1 { font-size: 2.1em; line-height: 1.2; font-weight: 800; margin-bottom: 10px; color: var(--brand); }
.hero p { font-size: 1.08em; color: var(--text-2); }

.modules-nav { display: flex; justify-content: center; gap: 10px; margin-bottom: 32px; flex-wrap: wrap; }
.module-tab-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 22px; border-radius: 999px;
  border: 1px solid var(--border); background: #fff; font-weight: 600; font-size: 0.97em;
  cursor: pointer; box-shadow: var(--shadow); color: var(--text); font-family: inherit;
}
.module-tab-btn:hover:not(.disabled) { border-color: var(--primary); }
.module-tab-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.module-tab-btn.disabled { opacity: 0.6; cursor: not-allowed; box-shadow: none; }
@media (max-width: 520px) {
  .modules-nav { display: grid; grid-template-columns: 1fr 1fr; max-width: 360px; margin-left: auto; margin-right: auto; }
}
.module-badge { font-size: 0.72em; padding: 2px 8px; border-radius: 999px; background: #f1f5f9; color: var(--muted); font-weight: 700; }

.section-head { margin-bottom: 16px; }
.section-title { font-size: 1.3em; font-weight: 750; color: var(--text); margin-bottom: 4px; }
.section-sub { margin-bottom: 12px; }

.books-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: 20px; margin-bottom: 40px;
}
.test-card {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow); display: flex; flex-direction: column;
  justify-content: space-between; gap: 12px; transition: transform 0.15s, box-shadow 0.15s;
}
.test-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.test-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; gap: 8px; }
.test-card-book { font-size: 0.8em; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: 0.6px; }
.badge-progress { font-size: 0.75em; font-weight: 700; color: var(--warn); background: var(--warn-bg); padding: 2px 8px; border-radius: 999px; }
.test-card-title { font-size: 1.3em; font-weight: 750; margin-bottom: 12px; }
.test-passages-list { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.test-passage-item { font-size: 0.92em; color: var(--text-2); display: flex; align-items: baseline; gap: 8px; }
.p-badge { background: #eef2f7; color: #475569; font-weight: 700; font-size: 0.78em; padding: 1px 6px; border-radius: 4px; flex-shrink: 0; }
.test-card-meta {
  display: flex; gap: 16px; font-size: 0.86em; color: var(--muted);
  border-top: 1px solid #eef2f7; padding-top: 12px; margin-bottom: 14px;
}
.test-card-actions { display: flex; gap: 10px; }
.btn-start-exam {
  flex: 1; background: var(--primary); color: #fff; border: none; padding: 10px 16px; border-radius: 6px;
  font-weight: 650; font-size: 0.95em; cursor: pointer; font-family: inherit;
}
.btn-start-exam:hover { background: var(--primary-hover); }
.btn-practice-mode {
  background: #fff; color: var(--text-2); border: 1px solid #cbd5e1; padding: 10px 14px;
  border-radius: 6px; font-weight: 600; font-size: 0.92em; cursor: pointer; font-family: inherit;
}
.btn-practice-mode:hover { background: #f1f5f9; }

#history-section { margin-bottom: 40px; }
.table-scroll { overflow-x: auto; }
.history-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; font-size: 0.93em; }
.history-table th, .history-table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid #eef2f7; }
.history-table th { background: #f8fafc; font-size: 0.85em; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; }
.history-table tr:last-child td { border-bottom: none; }

.how-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 16px; }
.how-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.how-card h3 { font-size: 1.02em; margin: 6px 0 4px; }
.how-card p { color: var(--text-2); font-size: 0.93em; }
.how-num {
  display: inline-flex; width: 26px; height: 26px; border-radius: 50%; align-items: center; justify-content: center;
  background: var(--info-bg); color: var(--primary); font-weight: 800; font-size: 0.85em;
}

/* Notices ------------------------------------------------------------------ */
.notice {
  display: flex; flex-direction: column; gap: 2px; border-radius: var(--radius);
  padding: 14px 18px; margin: 0 0 24px; border: 1px solid;
}
.notice-info { background: var(--info-bg); border-color: #c7dbf4; color: #173c68; }
.notice-warn { background: var(--warn-bg); border-color: #f6d3a8; color: var(--warn); }

/* Pre-test instructions ---------------------------------------------------- */
#verification-view.active {
  background: var(--brand); display: flex; align-items: center; justify-content: center; padding: 24px 16px;
}
.verification-card {
  background: #fff; color: var(--text); max-width: 680px; width: 100%;
  border-radius: 12px; box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3); overflow: hidden;
}
.verification-header {
  background: #0b1f33; color: #fff; padding: 16px 24px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.vh-title { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.vh-mode { font-size: 0.85em; opacity: 0.85; }
.verification-body { padding: 24px; }
.verify-title { font-size: 1.35em; margin-bottom: 14px; }
.verification-instructions {
  background: #f8fafc; border-left: 4px solid var(--primary); padding: 14px 18px;
  border-radius: 0 8px 8px 0; margin-bottom: 20px; font-size: 0.95em;
}
.verification-instructions ul { margin: 8px 0 0 20px; display: flex; flex-direction: column; gap: 4px; }
.candidate-field-group { margin-bottom: 20px; }
.candidate-field-group label { display: block; font-size: 0.88em; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.candidate-field-group input {
  width: 100%; padding: 10px 14px; border: 1.5px solid #cbd5e1; border-radius: 6px; font-size: 1em; font-family: inherit;
}
.candidate-field-group input:focus { border-color: var(--primary); outline: none; }
.verification-footer {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  border-top: 1px solid var(--border); padding-top: 18px;
}
.check-row { display: flex; align-items: flex-start; gap: 10px; font-size: 0.95em; margin: 12px 0; cursor: pointer; }
.check-row input { margin-top: 4px; accent-color: var(--primary); }
.resume-row { background: var(--warn-bg); border: 1px solid #f6d3a8; padding: 10px 14px; border-radius: 8px; }
.sound-check {
  display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap;
  border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; margin-bottom: 20px; background: #fff;
}
.sound-check-text { display: flex; flex-direction: column; gap: 2px; font-size: 0.93em; flex: 1 1 260px; }
.sound-check-text span { color: var(--text-2); }
.sound-check-controls { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.sound-check-volume { display: inline-flex; align-items: center; gap: 8px; font-size: 0.88em; font-weight: 600; color: var(--text-2); }
.sound-check-volume input { width: 120px; accent-color: var(--primary); }

/* Results ------------------------------------------------------------------ */
.results-page { display: flex; flex-direction: column; }
.results-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.results-head h1 { font-size: 1.7em; line-height: 1.2; }
.eyebrow { font-size: 0.8em; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--primary); }
.results-actions { display: flex; gap: 10px; }

.score-banner-card {
  background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 26px;
  box-shadow: var(--shadow); display: flex; align-items: center; justify-content: space-around;
  flex-wrap: wrap; gap: 24px; margin-bottom: 10px;
}
.score-main-box { text-align: center; }
.band-score-circle {
  width: 118px; height: 118px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--brand));
  color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center;
  margin: 0 auto 8px; box-shadow: 0 8px 18px rgba(29, 95, 180, 0.3);
}
.band-val { font-size: 2.5em; font-weight: 800; line-height: 1; }
.band-lbl { font-size: 0.68em; text-transform: uppercase; letter-spacing: 0.5px; opacity: 0.9; margin-top: 4px; }
.band-desc { font-weight: 700; color: var(--text-2); }
.score-details-grid { display: grid; grid-template-columns: repeat(3, minmax(130px, 1fr)); gap: 14px; }
.score-stat-box { background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; text-align: center; }
.score-stat-val { font-size: 1.45em; font-weight: 800; }
.score-stat-lbl { font-size: 0.84em; color: var(--muted); }
.score-note { font-size: 0.86em; color: var(--muted); margin: 6px 0 28px; }

.passage-breakdown-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 14px; margin: 10px 0 28px; }
.passage-stat-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.passage-stat-card h3 { font-size: 0.95em; margin-bottom: 8px; }
.stat-line { display: flex; justify-content: space-between; font-size: 0.9em; }
.passage-progress-bar { height: 8px; background: #e2e8f0; border-radius: 4px; overflow: hidden; margin: 8px 0; }
.passage-progress-fill { height: 100%; background: var(--primary); border-radius: 4px; }

.type-table { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 18px; margin: 4px 0 28px; }
.type-row { display: grid; grid-template-columns: minmax(150px, 260px) 1fr 52px; align-items: center; gap: 14px; padding: 6px 0; font-size: 0.93em; }
.type-row .passage-progress-bar { margin: 0; }
.type-score { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

.review-filter-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; flex-wrap: wrap; gap: 12px; }
.review-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.review-tab-btn {
  padding: 6px 14px; border: 1px solid var(--border); background: #fff; border-radius: 999px;
  font-size: 0.86em; font-weight: 600; cursor: pointer; font-family: inherit; color: var(--text-2);
}
.review-tab-btn.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.review-list { display: flex; flex-direction: column; gap: 14px; }
.review-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.review-card.is-correct { border-left: 4px solid var(--success); }
.review-card.is-incorrect { border-left: 4px solid var(--danger); }
.review-card-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.review-meta { font-size: 0.85em; color: var(--muted); font-weight: 600; }
.review-prompt { font-weight: 500; }
.review-status-badge { padding: 3px 10px; border-radius: 999px; font-size: 0.78em; font-weight: 700; text-transform: uppercase; }
.badge-correct { background: var(--success-bg); color: var(--success); }
.badge-incorrect { background: var(--danger-bg); color: var(--danger); }
.badge-unanswered { background: #f1f5f9; color: var(--muted); }
.review-answers-box { background: #f8fafc; border-radius: 8px; padding: 12px 16px; margin: 12px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.review-ans-label { font-size: 0.78em; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.review-ans-value { font-weight: 650; word-break: break-word; }
.ans-correct { color: var(--success); }
.ans-incorrect { color: var(--danger); }
.review-explanation { font-size: 0.92em; color: var(--text-2); background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 10px 14px; }
.review-explanation strong { color: #854d0e; }
.review-actions { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 10px; }

/* Listening transcript ----------------------------------------------------- */
.transcript-section { margin-top: 36px; }
.transcript-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.transcript {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px;
  box-shadow: var(--shadow); margin-bottom: 72px;
}
.t-title { font-size: 1.05em; margin-bottom: 4px; }
.t-context { color: var(--muted); font-size: 0.92em; margin-bottom: 12px; }
.t-line { display: flex; gap: 10px; align-items: flex-start; padding: 7px 8px; border-radius: 8px; line-height: 1.6; }
.t-line + .t-line { margin-top: 2px; }
.t-line.is-narrator .t-text { color: var(--muted); font-style: italic; }
.t-line.is-playing { background: var(--info-bg); box-shadow: inset 3px 0 0 var(--primary); }
.t-play {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; border: 1px solid #cbd5e1; background: #fff;
  color: var(--primary); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; margin-top: 1px;
}
.t-play:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.t-body { min-width: 0; }
.t-speaker { display: block; font-size: 0.78em; font-weight: 750; text-transform: uppercase; letter-spacing: 0.4px; color: var(--muted); }
.t-answer { border-radius: 4px; padding: 1px 3px; color: inherit; scroll-margin: 120px; }
.t-answer.is-correct { background: var(--success-bg); box-shadow: inset 0 -2px 0 var(--success); }
.t-answer.is-incorrect { background: var(--danger-bg); box-shadow: inset 0 -2px 0 var(--danger); }
.t-answer.is-unanswered { background: #fef3c7; box-shadow: inset 0 -2px 0 #b45309; }
.t-qnum {
  display: inline-block; font-size: 0.72em; font-weight: 800; font-style: normal; color: #fff; background: var(--brand);
  border-radius: 4px; padding: 0 5px; margin-right: 4px; vertical-align: 1px;
}
.t-answer.is-correct .t-qnum { background: var(--success); }
.t-answer.is-incorrect .t-qnum { background: var(--danger); }
.t-answer.is-unanswered .t-qnum { background: #b45309; }
.t-answer.flash { outline: 3px solid var(--primary); outline-offset: 2px; }
.inline-icon { display: inline-flex; vertical-align: -2px; color: var(--primary); }
.replay-bar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 1200; display: flex; align-items: center; gap: 10px; background: var(--brand); color: #fff;
  padding: 8px 10px 8px 16px; border-radius: 999px; box-shadow: var(--shadow-lg); max-width: calc(100vw - 24px);
}
.replay-bar[hidden] { display: none; }
.replay-text { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Writing results ---------------------------------------------------------- */
.task-jump { display: flex; gap: 8px; margin: 4px 0 18px; }
.task-jump a { padding: 6px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--border); text-decoration: none; font-weight: 600; font-size: 0.9em; }
.task-result { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 22px; margin-bottom: 24px; box-shadow: var(--shadow); scroll-margin-top: 16px; }
.task-result-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.task-band { background: var(--brand); color: #fff; font-weight: 800; padding: 6px 14px; border-radius: 999px; }
.criteria-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 12px; margin: 14px 0 18px; }
.criterion-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; background: #fbfcfe; }
.criterion-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-weight: 650; font-size: 0.93em; }
.criterion-band { font-size: 1.5em; color: var(--brand); }
.criterion-card p { font-size: 0.9em; color: var(--text-2); margin-top: 8px; }
.band-meter { height: 6px; background: #e2e8f0; border-radius: 3px; margin-top: 6px; overflow: hidden; }
.band-meter span { display: block; height: 100%; background: var(--primary); border-radius: 3px; }
.feedback-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 12px; }
.feedback-block { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 14px; }
.feedback-block h4 { font-size: 0.98em; margin-bottom: 8px; }
.feedback-block ul { margin-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 0.93em; }
.feedback-block.good { border-left: 4px solid var(--success); }
.feedback-block.improve { border-left: 4px solid #d97706; }
.corrections-table { width: 100%; border-collapse: collapse; font-size: 0.9em; }
.corrections-table th, .corrections-table td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid #eef2f7; }
.corrections-table th { color: var(--muted); font-size: 0.85em; text-transform: uppercase; }
.corr-orig { color: var(--danger); text-decoration: line-through; text-decoration-thickness: 1px; }
.corr-new { color: var(--success); font-weight: 600; }
.check-list { list-style: none; margin: 0 !important; }
.check-list li { display: flex; gap: 10px; align-items: flex-start; }
.check-icon {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center;
  justify-content: center; font-weight: 800; font-size: 0.8em; margin-top: 1px;
}
.check-list li.ok .check-icon { background: var(--success-bg); color: var(--success); }
.check-list li.bad .check-icon { background: var(--warn-bg); color: var(--warn); }
.stats-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.stats-row div { background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; padding: 8px 14px; display: flex; flex-direction: column; min-width: 96px; }
.stats-row strong { font-size: 1.2em; }
.stats-row span { font-size: 0.8em; color: var(--muted); }
.fold { border: 1px solid var(--border); border-radius: var(--radius); margin-top: 10px; background: #fff; }
.fold summary { cursor: pointer; padding: 12px 16px; font-weight: 650; }
.fold > *:not(summary) { padding: 0 18px 16px; }
.essay-text p { margin-bottom: 10px; }
.model-answer { color: var(--text-2); }

/* Static pages ------------------------------------------------------------- */
.page { max-width: 860px; margin: 0 auto; }
.page.pricing-page, .page.account-page, .page.examiner-page, .page.admin-page, .page.examiners-page { max-width: 1100px; }
.page h1 { font-size: 1.9em; color: var(--brand); margin-bottom: 10px; line-height: 1.2; }
.prose h2 { font-size: 1.2em; margin: 26px 0 8px; }
.prose p, .prose li { color: var(--text-2); }
.prose ul { margin-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.resource-group { margin: 26px 0; }
.resource-list { list-style: none; margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.resource-list li {
  background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 12px 16px;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center;
}
.resource-list a { font-weight: 650; }
.resource-list a::after { content: " ↗"; font-size: 0.85em; }
.resource-org { font-size: 0.85em; color: var(--muted); }

/* Loading / toasts --------------------------------------------------------- */
.loading-card { background: #fff; padding: 28px 36px; border-radius: 12px; text-align: center; max-width: 420px; margin: 16px; color: var(--text); }
.loading-title { font-size: 1.2em; font-weight: 750; margin: 12px 0 6px; }
.loading-card p { color: var(--muted); }
.spinner {
  width: 36px; height: 36px; margin: 0 auto; border-radius: 50%;
  border: 4px solid #dbe7f5; border-top-color: var(--primary); animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } .test-card:hover { transform: none; } }

.toast {
  position: fixed; top: 64px; right: 16px; z-index: 3000; max-width: min(380px, calc(100vw - 32px));
  background: var(--brand); color: #fff; padding: 12px 18px; border-radius: 8px; font-weight: 600;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}
.toast-warn { background: #9a3412; }
/* In the exam the top of the screen holds the timer and audio controls, so toasts sit above the footer. */
body.in-exam .toast { top: auto; bottom: 84px; }

/* Summary rows used in finish dialogs */
.summary-rows { background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; padding: 6px 14px; }
.summary-rows div { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid #eef2f7; }
.summary-rows div:last-child { border-bottom: none; }
.summary-rows .is-warn { color: var(--danger); }
.help-list { margin: 6px 0 14px 20px; display: flex; flex-direction: column; gap: 4px; }
kbd { background: #f1f5f9; border: 1px solid #cbd5e1; border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; font-size: 0.85em; font-family: inherit; }


/* Accounts: header ---------------------------------------------------------- */
.account-slot { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.nav-signin {
  background: #fff; color: var(--brand); border: none; border-radius: 6px; padding: 7px 14px; font-weight: 700;
  font-size: 0.92em; cursor: pointer; font-family: inherit;
}
.nav-signin:hover { background: #e8f0fb; }
.nav-account, .nav-extra {
  display: inline-flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; padding: 5px 10px 5px 5px;
  border-radius: 999px; font-weight: 600; font-size: 0.92em;
}
.nav-extra { padding: 7px 12px; border-radius: 6px; color: #dbe7f5; }
.nav-account:hover, .nav-extra:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.nav-account[aria-current="page"], .nav-extra[aria-current="page"] { background: rgba(255, 255, 255, 0.16); }
.nav-account-name { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%;
  background: #dbeafe; color: var(--brand); font-weight: 800; font-size: 0.8em; flex-shrink: 0;
}
.avatar.big { width: 52px; height: 52px; font-size: 1.1em; }

/* Sign-in window -------------------------------------------------------------- */
.auth-box { max-width: 440px; }
.auth-lead { color: var(--text-2); margin-bottom: 16px; }
.btn-google {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 11px 16px;
  border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; font-weight: 650; font-size: 1em; cursor: pointer;
  font-family: inherit; color: var(--text);
}
.btn-google:hover { background: #f8fafc; border-color: #94a3b8; }
.auth-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 0.85em; margin: 16px 0; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-form { display: flex; flex-direction: column; gap: 8px; }
.auth-form label { font-size: 0.88em; font-weight: 650; color: var(--text-2); }
.auth-form input {
  padding: 11px 14px; border: 1.5px solid #cbd5e1; border-radius: 8px; font-size: 1em; font-family: inherit;
}
.auth-form input:focus { border-color: var(--primary); outline: 2px solid var(--info-bg); }
.auth-form .btn-primary { margin-top: 6px; }
.code-input { font-size: 1.5em !important; letter-spacing: 0.4em; text-align: center; font-variant-numeric: tabular-nums; }
.form-error { color: var(--danger); font-size: 0.9em; }
.form-error[hidden] { display: none; }
.dev-hint { background: var(--warn-bg); color: var(--warn); border-radius: 6px; padding: 8px 12px; font-size: 0.9em; margin-bottom: 10px; }
.dev-hint[hidden] { display: none; }
.auth-links { display: flex; justify-content: space-between; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.btn-primary:disabled, .btn-secondary:disabled { opacity: 0.6; cursor: wait; }

/* Badges ---------------------------------------------------------------------- */
.card-badges { display: inline-flex; gap: 6px; align-items: center; }
.badge-free, .badge-plan {
  display: inline-flex; align-items: center; gap: 4px; font-size: 0.72em; font-weight: 800; padding: 2px 8px;
  border-radius: 999px; text-transform: uppercase; letter-spacing: 0.4px;
}
.badge-free { background: var(--success-bg); color: var(--success); }
.badge-plan { background: #ede9fe; color: #5b21b6; }
.badge-plan.is-open { background: #eef2f7; color: #475569; }
.status-badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 0.8em; font-weight: 700; white-space: nowrap; }
.badge-waiting { background: var(--warn-bg); color: var(--warn); }
.badge-progress-check { background: var(--info-bg); color: var(--primary); }
.badge-done { background: var(--success-bg); color: var(--success); }
.badge-cancelled { background: #f1f5f9; color: var(--muted); }

/* Plan, paywall and payment ------------------------------------------------------ */
.plan-points { list-style: none; display: flex; flex-direction: column; gap: 8px; margin: 12px 0 18px; }
.plan-points li { padding-left: 26px; position: relative; color: var(--text-2); }
.plan-points li::before {
  content: "✓"; position: absolute; left: 0; top: 0; width: 18px; height: 18px; border-radius: 50%;
  background: var(--success-bg); color: var(--success); font-size: 0.75em; font-weight: 800;
  display: flex; align-items: center; justify-content: center; margin-top: 2px;
}
.pay-methods { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.pay-method {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 12px 16px;
  border: 1.5px solid var(--border); border-radius: 10px; background: #fff; cursor: pointer; font-family: inherit;
}
.pay-method:hover { border-color: var(--primary); background: #f8fbff; }
.pay-method-name { font-weight: 750; font-size: 1.02em; color: var(--text); }
.pay-method-note { color: var(--muted); font-size: 0.88em; }
.transfer-steps { margin-left: 20px; display: flex; flex-direction: column; gap: 12px; }
.card-number {
  display: flex; align-items: center; gap: 12px; margin: 8px 0 4px; font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 1.15em; font-weight: 700; background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 8px; padding: 8px 12px;
}

/* Pricing ------------------------------------------------------------------------ */
.price-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 20px; margin: 10px 0 18px; }
.price-card {
  position: relative; background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 26px 24px;
  box-shadow: var(--shadow); display: flex; flex-direction: column;
}
.price-card .btn-primary, .price-card .btn-secondary { margin-top: auto; }
.price-card.is-featured { border: 2px solid var(--primary); box-shadow: var(--shadow-lg); }
.price-flag {
  position: absolute; top: -13px; left: 50%; transform: translateX(-50%); background: var(--primary); color: #fff;
  font-size: 0.78em; font-weight: 800; padding: 4px 12px; border-radius: 999px; white-space: nowrap;
}
.price-kicker { font-weight: 800; color: var(--primary); text-transform: uppercase; font-size: 0.8em; letter-spacing: 0.6px; }
.price-amount { font-size: 2.2em; font-weight: 800; color: var(--brand); margin: 6px 0 4px; line-height: 1.1; }
.price-amount span { font-size: 0.42em; font-weight: 600; color: var(--muted); }
.price-lines { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 4px; }
.price-lines div { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dashed #e2e8f0; padding-bottom: 6px; }
.plan-active { color: var(--success); margin-bottom: 10px; }
.pay-note { text-align: center; color: var(--muted); font-size: 0.9em; margin-bottom: 32px; }
.faq { max-width: 760px; margin: 0 auto; }
.faq details { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; margin-bottom: 10px; }
.faq summary { font-weight: 650; cursor: pointer; }
.faq details p { margin-top: 8px; color: var(--text-2); }

/* Account --------------------------------------------------------------------------- */
.account-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.account-head h1 { font-size: 1.6em; line-height: 1.2; }
.account-head .btn-secondary { margin-left: auto; }
.account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 16px; margin-bottom: 30px; }
.account-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.account-card h2 { font-size: 1.05em; margin-bottom: 8px; }
.account-card .btn-primary, .account-card .btn-secondary { margin-top: 10px; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form input { padding: 8px 12px; border: 1.5px solid #cbd5e1; border-radius: 6px; font-size: 0.95em; font-family: inherit; min-width: 0; }
.inline-form input[type="number"] { width: 80px; }
.empty-inline { color: var(--muted); background: #fff; border: 1px dashed #cbd5e1; border-radius: 10px; padding: 14px 16px; margin-bottom: 28px; }
.account-page .table-scroll, .examiner-page .table-scroll, .admin-page .table-scroll { margin-bottom: 28px; }

/* Examiners --------------------------------------------------------------------------- */
.examiner-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 18px; }
.examiner-card {
  background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 20px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 12px;
}
.examiner-top { display: flex; gap: 14px; align-items: flex-start; }
.examiner-top h3 { font-size: 1.1em; }
.examiner-headline { color: var(--text-2); font-size: 0.92em; }
.examiner-rating { font-size: 0.92em; margin-top: 2px; }
.stars { color: #f59e0b; letter-spacing: 1px; }
.stars-off { color: #e2e8f0; }
.examiner-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 0.78em; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--info-bg); color: var(--primary); }
.tag-muted { background: #f1f5f9; color: var(--muted); }
.examiner-bio { color: var(--text-2); font-size: 0.93em; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.examiner-actions { display: flex; justify-content: space-between; align-items: center; margin-top: auto; }
.reviews-title { margin: 14px 0 6px; }
.review-items { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.review-items li { border-bottom: 1px solid #eef2f7; padding-bottom: 8px; }
.review-items p { margin-top: 4px; }
.pick-list { display: flex; flex-direction: column; gap: 8px; }
.pick-item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 14px; border: 1.5px solid var(--border);
  border-radius: 8px; background: #fff; cursor: pointer; font-family: inherit; text-align: left;
}
.pick-item:hover { border-color: var(--primary); }
.examiner-offer {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin: 6px 0 22px;
  background: linear-gradient(135deg, #eef5ff, #f5f0ff); border: 1px solid #c7dbf4; border-radius: 14px; padding: 18px 22px;
}
.examiner-offer h2 { font-size: 1.1em; margin-bottom: 4px; }
.examiner-offer p { color: var(--text-2); max-width: 640px; }

/* A check: result, marking form, review ------------------------------------------------ */
.check-layout { display: grid; gap: 22px; }
@media (min-width: 1000px) { .check-layout { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; } }
.check-task { padding: 6px 2px 4px; }
.check-task h4 { margin: 14px 0 6px; }
.mark-form {
  background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 20px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 12px;
}
@media (min-width: 1000px) { .mark-form { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; } }
.mark-form label { display: flex; flex-direction: column; gap: 4px; font-weight: 650; font-size: 0.9em; color: var(--text-2); }
.mark-form textarea, .mark-form input, .mark-form select, .examiner-form input, .examiner-form textarea {
  font-family: inherit; font-size: 0.95em; padding: 7px 10px; border: 1.5px solid #cbd5e1; border-radius: 6px; font-weight: 400; color: var(--text);
}
.mark-task { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.mark-task legend { font-weight: 800; padding: 0 6px; }
.mark-band { margin-left: 8px; color: var(--primary); }
.mark-crit { display: grid; grid-template-columns: 1fr 70px; gap: 6px; align-items: center; }
.mark-crit label { grid-column: 1; }
.mark-crit select { grid-column: 2; grid-row: 1; }
.mark-crit textarea { grid-column: 1 / -1; }
.corrections { display: flex; flex-direction: column; gap: 6px; }
.corrections-head { display: flex; justify-content: space-between; font-weight: 650; font-size: 0.9em; color: var(--text-2); }
.correction-row { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 6px; }
.correction-row input { min-width: 0; font-size: 0.9em; padding: 6px 8px; border: 1.5px solid #cbd5e1; border-radius: 6px; font-family: inherit; }
.mark-total { font-size: 1.05em; padding: 10px 12px; background: var(--info-bg); border-radius: 8px; }
.rate-box { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; margin: 4px 0 24px; box-shadow: var(--shadow); }
.rate-box h2 { font-size: 1.1em; margin-bottom: 8px; }
.rate-box textarea { width: 100%; min-height: 70px; margin: 8px 0; padding: 8px 10px; border: 1.5px solid #cbd5e1; border-radius: 6px; font-family: inherit; }
.rate-box.done p { margin-top: 6px; color: var(--text-2); }
/* Stars are in the page from 5 to 1 and shown reversed (1 to 5), so hovering or choosing a star also lights the lower ones. */
.star-input { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; }
.star-input input { position: absolute; opacity: 0; pointer-events: none; }
.star-input label span[aria-hidden] { font-size: 2em; color: #e2e8f0; cursor: pointer; line-height: 1; }
.star-input label:hover span[aria-hidden], .star-input label:hover ~ label span[aria-hidden],
.star-input input:checked + span, .star-input label:has(input:checked) ~ label span[aria-hidden] { color: #f59e0b; }
.star-input input:focus-visible + span { outline: 2px solid var(--primary); border-radius: 4px; }
.examiner-comment { background: #f5f0ff; border: 1px solid #ddd6fe; border-radius: 12px; padding: 14px 18px; margin: 0 0 22px; }
.examiner-comment h3 { font-size: 1em; margin-bottom: 4px; color: #5b21b6; }

/* Examiner dashboard and admin -------------------------------------------------------- */
.stat-row { display: flex; gap: 14px; flex-wrap: wrap; margin: 10px 0 24px; }
.stat-row div { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 12px 18px; min-width: 150px; }
.stat-row strong { display: block; font-size: 1.5em; }
.stat-row span { color: var(--muted); font-size: 0.88em; }
.examiner-form { display: flex; flex-direction: column; gap: 12px; max-width: 640px; margin-bottom: 30px; }
.examiner-form label { display: flex; flex-direction: column; gap: 4px; font-weight: 650; font-size: 0.9em; color: var(--text-2); }
.examiner-form .btn-primary { align-self: flex-start; }
.check-inline { display: flex; gap: 18px; flex-wrap: wrap; }
.check-inline label, label.check-inline { flex-direction: row !important; align-items: center; gap: 8px !important; font-weight: 600; }
.admin-tabs { margin: 8px 0 18px; }
.admin-tabs a { text-decoration: none; }
.admin-filter { margin-bottom: 12px; color: var(--muted); font-size: 0.92em; }
.admin-filter a.is-on { font-weight: 800; color: var(--text); text-decoration: none; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* Sign-in callback page ------------------------------------------------------------------ */
.callback-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--brand); padding: 16px; }
.callback-card { background: #fff; border-radius: 14px; padding: 32px 28px; max-width: 420px; width: 100%; text-align: center; box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3); }
.callback-card .site-logo { background: var(--brand); color: #fff; margin-bottom: 12px; }
.callback-card h1 { font-size: 1.3em; margin-bottom: 6px; }
.callback-card p { color: var(--text-2); margin-bottom: 16px; }
.callback-card .btn-primary[hidden] { display: none; }

/* Responsive --------------------------------------------------------------- */
@media (max-width: 720px) {
  .site-nav { padding: 12px 16px; }
  .site-main { padding: 22px 16px 40px; }
  .hero h1 { font-size: 1.6em; }
  .score-details-grid { grid-template-columns: 1fr; width: 100%; }
  .review-answers-box { grid-template-columns: 1fr; }
  .type-row { grid-template-columns: 1fr 48px; }
  .type-row .passage-progress-bar { grid-column: 1 / -1; grid-row: 2; }
  .results-actions { width: 100%; }
  .results-actions > * { flex: 1; }
  .verification-footer { flex-direction: column-reverse; align-items: stretch; }
  /* Header: logo and account on the first row, the menu as one scrollable row below. */
  .site-nav { gap: 10px; }
  .site-brand { order: 1; }
  .account-slot { order: 2; margin-left: auto; }
  .site-links { order: 3; width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -6px; }
  .site-links::-webkit-scrollbar { display: none; }
  .site-links a { white-space: nowrap; }
  .site-tagline { display: none; }
  .nav-account-name, .nav-extra { display: none; }
  .nav-account { padding: 3px; }
  .correction-row { grid-template-columns: 1fr; }
  .account-head .btn-secondary { margin-left: 0; }
}

/* Speaking: microphone check, results ---------------------------------------------- */
.mic-status { color: var(--text-2); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mic-status.is-ok { color: var(--success); font-weight: 650; }
.mic-status.is-bad { color: var(--warn); font-weight: 650; }
.mic-level { margin-top: 8px; max-width: 320px; height: 8px; border-radius: 999px; background: #eef2f7; border: 1px solid var(--border); overflow: hidden; }
.mic-level span { display: block; height: 100%; width: 0; background: #16a34a; transition: width 0.08s linear; }
.notice-success { background: var(--success-bg); border-color: #b7e4c7; color: #14532d; }
.speak-offer .offer-action { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.offer-price { font-size: 1.35em; font-weight: 800; color: var(--brand); }
.speak-fold .speak-answers { display: flex; flex-direction: column; gap: 12px; }
.speak-answer-list { margin-left: 20px; display: flex; flex-direction: column; gap: 14px; }
.speak-answer-q { font-weight: 600; margin-bottom: 6px; }
.rec-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rec-row audio { width: 100%; max-width: 420px; height: 40px; }
.rec-len { color: var(--muted); font-size: 0.88em; font-variant-numeric: tabular-nums; }
.speak-no-answer { color: var(--muted); font-style: italic; }
.cue-card.small { border: 1.5px solid var(--text-2); border-radius: 8px; padding: 12px 16px; background: #fff; }
.cue-card.small .cue-topic { font-weight: 750; margin-bottom: 4px; }
.cue-card.small ul { margin: 2px 0 6px 20px; }
.speaking-results .speak-notes-view { padding: 10px 14px; border-left: 4px solid var(--primary); background: var(--info-bg); border-radius: 4px; }
.speaking-results .speak-notes-view p { white-space: pre-wrap; margin-top: 4px; }
.speak-selfcheck { margin-top: 26px; }
.speak-selfcheck .criteria-grid { margin-top: 10px; }
.speak-tips { margin-top: 14px; }
@media (max-width: 640px) {
  .speak-offer .offer-action { align-items: stretch; width: 100%; }
}

.nav-count {
  display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px;
  margin-left: 4px; border-radius: 999px; background: #e11d48; color: #fff; font-size: 11px; font-weight: 800; line-height: 1;
}

/* Progress (account page) ------------------------------------------------------ */
.progress-section {
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100;
  --pv-ink: #0b0b0b; --pv-ink-2: #52514e; --pv-muted: #898781; --pv-grid: #e1e0d9; --pv-surface: #ffffff;
  --pv-up: #006300; --pv-down: #d03b3b;
  margin-top: 8px;
}
.progress-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 12px 0 16px; }
.progress-tile { background: var(--pv-surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.tile-label { display: flex; align-items: center; gap: 8px; font-size: 0.9em; font-weight: 650; color: var(--pv-ink-2); }
.line-key { display: inline-block; width: 14px; height: 3px; border-radius: 2px; flex-shrink: 0; }
.tile-value { font-size: 2em; font-weight: 650; color: var(--pv-ink); line-height: 1.2; margin-top: 4px; }
.tile-delta { display: block; font-size: 0.85em; font-weight: 600; }
.tile-delta.is-up { color: var(--pv-up); }
.tile-delta.is-down { color: var(--pv-down); }
.tile-delta.is-flat { color: var(--pv-muted); font-weight: 500; }
.tile-sub { font-size: 0.8em; color: var(--pv-muted); margin-top: 2px; }
.progress-viz { background: var(--pv-surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px 6px; }
.pv-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.88em; color: var(--pv-ink-2); margin-bottom: 4px; }
.pv-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.pv-plot { position: relative; }
.pv-svg { display: block; overflow: visible; }
.pv-svg:focus { outline: 2px solid var(--primary); outline-offset: 4px; border-radius: 4px; }
.pv-grid { stroke: var(--pv-grid); stroke-width: 1; }
.pv-tick { fill: var(--pv-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.pv-end { fill: var(--pv-ink-2); font-size: 12px; font-weight: 600; }
.pv-dot { stroke: var(--pv-surface); stroke-width: 2; }
.pv-cross { stroke: var(--pv-muted); stroke-width: 1; }
.pv-tip {
  position: absolute; top: 4px; min-width: 160px; background: var(--pv-surface); border: 1px solid var(--border);
  border-radius: 8px; box-shadow: var(--shadow-lg); padding: 8px 10px; font-size: 0.85em; pointer-events: none; z-index: 2;
}
.pv-tip-date { color: var(--pv-muted); margin-bottom: 4px; }
.pv-tip-row { display: flex; align-items: center; gap: 8px; color: var(--pv-ink-2); }
.pv-tip-row strong { color: var(--pv-ink); min-width: 26px; }
.pv-table { margin-top: 10px; border: none; }
.pv-table summary { padding-left: 0; font-size: 0.9em; color: var(--primary); }
@media (max-width: 720px) {
  .progress-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
