/* ========================================================================
   ieltsyp app — design system
   Mobile-first. Warm, quiet, serif-headed. Teal + gold on soft off-white.
   Keep token names stable. To re-theme: edit :root variables only.
   ======================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;0,9..144,700;1,9..144,400;1,9..144,500&display=swap');

:root {
  /* ---- Color palette — IELTS red, white, black ----
     Primary is IELTS red (#c8102e-ish). Old --teal / --gold variable names
     are kept for compatibility; --teal now maps to the red primary, and
     --gold maps to black/graphite for secondary emphasis. */
  --teal:        #c8102e;  /* IELTS red — primary */
  --teal-dark:   #a40e26;
  --teal-darker: #77081b;
  --teal-tint:   #fde6ea;  /* very light pink */
  --teal-soft:   #fff4f6;

  --gold:        #111111;  /* black — secondary accent */
  --gold-dark:   #000000;
  --gold-tint:   #f4f3f0;  /* warm neutral for feedback boxes */

  --bg:          #ffffff;
  --surface:     #ffffff;
  --surface-alt: #fafaf8;

  --ink:         #0a0a0a;
  --ink-2:       #2e2e2e;
  --ink-3:       #595959;
  --ink-4:       #8e8e8e;

  --border:      #e8e6e2;
  --border-soft: #f1efea;

  --error:       #c8102e;
  --error-tint:  #fde6ea;

  /* ---- Elevation ---- */
  --shadow-sm: 0 1px 2px rgba(20, 20, 20, 0.04);
  --shadow-md: 0 2px 10px rgba(20, 20, 20, 0.05), 0 1px 3px rgba(20, 20, 20, 0.04);
  --shadow-lg: 0 12px 28px rgba(20, 20, 20, 0.08), 0 2px 6px rgba(20, 20, 20, 0.04);

  /* ---- Radii ---- */
  --r-sm:  6px;
  --r-md:  10px;
  --r-lg:  16px;
  --r-xl:  24px;
  --r-pill: 999px;

  /* ---- Type ---- */
  --font-serif: 'Fraunces', Georgia, 'Songti TC', 'PingFang TC', serif;
  --font-body:  -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang TC',
                'Microsoft JhengHei', 'Noto Sans TC', Roboto, Helvetica, Arial, sans-serif;
  --font-mono:  ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --fs-display: 40px;
  --fs-h1:      30px;
  --fs-h2:      22px;
  --fs-h3:      17px;
  --fs-body:    17px;
  --fs-sm:      14px;
  --fs-xs:      13px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'ss01', 'kern';
  text-rendering: optimizeLegibility;
}

::selection { background: var(--gold-tint); color: var(--ink); }

/* ==================== LAYOUT ==================== */
.container {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px;
}
.container-narrow { max-width: 460px; }

/* ==================== TOPBAR ==================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(247, 244, 236, 0.88);
  backdrop-filter: saturate(1.3) blur(10px);
  -webkit-backdrop-filter: saturate(1.3) blur(10px);
  border-bottom: 1px solid var(--border-soft);
}
.topbar-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.wordmark {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.02em;
  color: var(--teal-dark);
  text-decoration: none;
  border-bottom: 0;
}

.user-strip {
  display: flex; align-items: center; gap: 14px;
  font-size: var(--fs-sm); color: var(--ink-3);
}
.user-strip .name { color: var(--ink-2); font-weight: 500; }
.user-strip a,
.user-strip button {
  background: none; border: 0; padding: 0; font: inherit;
  color: var(--ink-3); cursor: pointer; text-decoration: none;
}
.user-strip a:hover,
.user-strip button:hover { color: var(--teal); }
.user-strip .divider { color: var(--ink-4); }

/* ==================== TYPOGRAPHY ==================== */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  color: var(--ink);
  letter-spacing: -0.015em;
  font-weight: 600;
  line-height: 1.25;
}
h1 { font-size: var(--fs-h1); margin: 0 0 10px; }
h2 { font-size: var(--fs-h2); margin: 36px 0 14px; font-weight: 600; }
h3 { font-size: var(--fs-h3); margin: 24px 0 8px; font-family: var(--font-body); font-weight: 600; letter-spacing: -0.01em; }

.display {
  font-family: var(--font-serif);
  font-size: var(--fs-display);
  line-height: 1.1;
  letter-spacing: -0.025em;
  font-weight: 500;
  margin: 0 0 16px;
}

p { margin: 0 0 14px; }
a { color: var(--teal); text-decoration: none; border-bottom: 1px solid rgba(200, 16, 46, 0.25); transition: border-color 0.15s ease; }
a:hover { border-bottom-color: var(--teal); }
a.plain { border-bottom: 0; }

.soft   { color: var(--ink-2); }
.muted  { color: var(--ink-4); font-size: var(--fs-sm); }
.small  { font-size: var(--fs-sm); line-height: 1.6; }
.xs     { font-size: var(--fs-xs); }
code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--surface-alt);
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  padding: 1px 6px;
}
.eyebrow {
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-4);
  font-weight: 600;
  margin: 0 0 10px;
}

hr {
  border: 0;
  border-top: 1px solid var(--border-soft);
  margin: 32px 0;
}

/* ==================== BUTTONS ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--teal);
  color: #fff;
  border: 1px solid var(--teal);
  border-radius: var(--r-md);
  font-family: inherit;
  font-size: var(--fs-body);
  font-weight: 600;
  padding: 12px 20px;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
}
.btn:hover   { background: var(--teal-dark); border-color: var(--teal-dark); box-shadow: var(--shadow-sm); border-bottom: 1px solid var(--teal-dark); }
.btn:active  { transform: translateY(1px); }
.btn:disabled{ background: #c9c9c3; border-color: #c9c9c3; cursor: not-allowed; box-shadow: none; }
.btn.btn-outline {
  background: transparent;
  color: var(--teal-dark);
  border-color: var(--teal);
}
.btn.btn-outline:hover { background: var(--teal-tint); border-color: var(--teal-dark); }
.btn.btn-ghost {
  background: transparent;
  color: var(--ink-3);
  border: 1px solid transparent;
  padding: 10px 14px;
  font-weight: 500;
}
.btn.btn-ghost:hover { background: var(--surface-alt); color: var(--ink); border-bottom-color: transparent; }
.btn.btn-block { display: flex; width: 100%; }
.btn.btn-sm    { padding: 8px 14px; font-size: var(--fs-sm); }

.btn-row { display: flex; gap: 10px; align-items: center; margin-top: 24px; flex-wrap: wrap; }

/* Icon inside button (for inline SVG) */
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ==================== FORMS ==================== */
.form-field { margin-bottom: 20px; }
.form-field label {
  display: block;
  font-size: var(--fs-sm);
  color: var(--ink-2);
  margin-bottom: 6px;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.form-field input,
.form-field select,
.form-field textarea,
textarea.writing-input {
  width: 100%;
  padding: 12px 14px;
  font-family: inherit;
  font-size: var(--fs-body);
  line-height: 1.5;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus,
textarea.writing-input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.12);
}
.form-field input[type="checkbox"] { width: auto; }
.form-field .help {
  color: var(--ink-4);
  font-size: var(--fs-xs);
  margin-top: 6px;
  line-height: 1.5;
}

.form-error {
  background: var(--error-tint);
  color: var(--error);
  padding: 12px 14px;
  border-radius: var(--r-md);
  margin-bottom: 18px;
  font-size: var(--fs-sm);
  border-left: 3px solid var(--error);
}
.form-success {
  background: var(--teal-tint);
  color: var(--teal-darker);
  padding: 12px 14px;
  border-radius: var(--r-md);
  margin-bottom: 18px;
  font-size: var(--fs-sm);
  border-left: 3px solid var(--teal);
}

/* ==================== CARDS ==================== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px 22px 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}
.card-title {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  font-family: var(--font-body);
  font-size: var(--fs-h3);
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
.card-title .accent { color: var(--gold-dark); font-weight: 500; }
.card-desc { margin: 0 0 4px; color: var(--ink-2); font-size: var(--fs-sm); line-height: 1.65; }

.card-link {
  display: block;
  text-decoration: none;
  border: 0;
  color: inherit;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.card-link.card:hover { border-color: var(--teal); box-shadow: var(--shadow-md); }
.card-link:active    { transform: translateY(1px); }

/* ==================== LANDING / HERO BLOCKS ==================== */
.hero {
  padding: 36px 0 18px;
}
.hero .display { margin-bottom: 16px; }
.hero .subhead { font-size: 19px; color: var(--ink-2); line-height: 1.55; max-width: 36ch; }

/* ==================== AUTH (login / forgot / reset) ==================== */
.auth-wrap {
  max-width: 420px;
  margin: 56px auto 40px;
  padding: 0 20px;
}
.auth-wrap .display {
  font-size: 32px;
  line-height: 1.15;
  margin-bottom: 8px;
}
.auth-wrap .lede { color: var(--ink-3); margin-bottom: 28px; font-size: var(--fs-sm); }

.meta-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: var(--fs-sm); color: var(--ink-4); margin-top: 18px;
  flex-wrap: wrap; gap: 8px;
}

/* ==================== AUTH TABS (login page) ==================== */
.auth-tabs {
  display: flex;
  margin: 4px 0 24px;
  border-bottom: 1px solid var(--border);
}
.auth-tab {
  flex: 1;
  background: none;
  border: 0;
  padding: 14px 10px;
  font-family: inherit;
  font-size: var(--fs-body);
  font-weight: 500;
  color: var(--ink-4);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s ease, border-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.auth-tab:hover   { color: var(--ink-2); }
.auth-tab.is-active {
  color: var(--teal-dark);
  font-weight: 600;
  border-bottom-color: var(--teal);
}

/* Login — "Keep me signed in" row.
   Kept out of .form-field so it doesn't inherit width:100% on the checkbox.
   Each language stays nowrap so wrapping happens between zh/en, not within. */
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 18px 0;
  cursor: pointer;
  font-size: var(--fs-sm);
  color: var(--ink-3);
  line-height: 1.4;
  user-select: none;
  -webkit-user-select: none;
}
.check-row input[type="checkbox"] {
  width: auto !important;
  margin-top: 3px;
  flex-shrink: 0;
  cursor: pointer;
}
.check-row .check-text {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0 6px;
}
.check-row .check-text span { white-space: nowrap; }

/* ==================== BADGES ==================== */
.stage-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  background: var(--teal-tint);
  color: var(--teal-darker);
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.pill {
  display: inline-flex;
  padding: 2px 10px;
  background: var(--surface-alt);
  color: var(--ink-3);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 500;
}

/* ==================== PROGRESS ==================== */
.progress { display: flex; align-items: center; gap: 10px; margin: 10px 0; }
.progress-bar {
  flex: 1; height: 6px; background: var(--border-soft);
  border-radius: var(--r-pill); overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--teal-dark));
  transition: width 0.35s ease;
}
.progress-label {
  font-size: var(--fs-xs); color: var(--ink-4); white-space: nowrap;
  letter-spacing: 0.04em; text-transform: uppercase; font-weight: 600;
}

/* ==================== EXERCISE FLOW ==================== */
.exercise-wrap { padding: 20px 0 48px; }

.progress-top { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.progress-top .progress-bar-fill { width: 20%; }

.step { display: none; animation: fadeIn 0.3s ease; }
.step.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.step h2 { margin-top: 0; color: var(--teal-dark); font-size: 24px; }
.instruction { color: var(--ink-2); margin: 10px 0 18px; font-size: 16px; line-height: 1.65; }
.hint {
  margin: -6px 0 14px;
  padding: 10px 14px;
  background: var(--gold-tint);
  border-left: 3px solid var(--gold);
  border-radius: 4px;
  color: var(--ink-2);
  font-size: var(--fs-sm);
  font-style: italic;
}
audio { width: 100%; margin: 8px 0 4px; }

.target-sentence {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px 20px;
  margin: 14px 0;
  font-size: 19px;
  line-height: 1.6;
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: -0.005em;
  box-shadow: var(--shadow-sm);
}
.target-sentence.large { font-size: 23px; line-height: 1.45; font-weight: 500; }

.tappable-sentence {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px 20px;
  margin: 14px 0 6px;
  font-size: 20px;
  line-height: 2.1;
  word-spacing: 2px;
  font-family: var(--font-serif);
  letter-spacing: -0.005em;
  box-shadow: var(--shadow-sm);
}
.word-tap {
  display: inline-block;
  padding: 5px 5px;
  margin: 2px 0;
  border-radius: 4px;
  cursor: pointer;
  border-bottom: 1px dashed rgba(200, 16, 46, 0.5);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  user-select: none; -webkit-user-select: none;
}
@media (hover: hover) { .word-tap:hover { background: var(--teal-tint); } }
.word-tap:active { background: var(--teal-tint); }
.word-tap.is-target {
  background: var(--gold-tint);
  border-bottom: 2px solid var(--gold);
  border-radius: 3px 3px 0 0;
  font-weight: 600;
  color: var(--ink);
}
.word-tap.correct {
  background: #d7ecdd;
  color: #1b5a2a;
  font-weight: 600;
  border-bottom-color: transparent;
}
.word-tap.correct::after { content: " ✓"; color: #1b5a2a; font-weight: 700; }
.word-tap.wrong-flash { animation: wrongFlash 0.45s ease; }
@keyframes wrongFlash {
  0%   { background: transparent; }
  30%  { background: var(--error-tint); color: var(--error); }
  100% { background: transparent; }
}

.explanation {
  margin: 14px 0 0;
  padding: 14px 16px;
  background: var(--teal-tint);
  border-radius: var(--r-md);
  border-left: 3px solid var(--teal);
  font-size: var(--fs-sm);
  line-height: 1.7;
  color: var(--ink);
  display: none;
}
.explanation.show { display: block; }
.explanation.incorrect { background: var(--error-tint); border-left-color: var(--error); }

.word-count { margin-top: 8px; color: var(--ink-4); font-size: var(--fs-xs); letter-spacing: 0.02em; }

.nav-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 28px; gap: 10px;
}

.sentence-quote {
  background: var(--teal-tint);
  border-left: 3px solid var(--teal);
  border-radius: var(--r-sm);
  padding: 18px 20px;
  margin: 20px 0;
  font-size: 17px;
  font-style: italic;
  line-height: 1.6;
  color: var(--ink);
  font-family: var(--font-serif);
}
.sentence-quote .quote-label {
  display: block; font-style: normal; font-size: var(--fs-xs);
  color: var(--ink-4); margin-bottom: 8px;
  letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600;
  font-family: var(--font-body);
}

.writing-checklist { list-style: none; padding: 0; margin: 10px 0 20px; }
.writing-checklist li {
  position: relative;
  padding: 6px 0 6px 30px;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
}
.writing-checklist li::before {
  content: "";
  position: absolute; left: 4px; top: 11px;
  width: 16px; height: 16px;
  background: var(--teal);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--teal-tint);
}
.writing-checklist li::after {
  content: "✓";
  position: absolute; left: 7px; top: 9px;
  color: #fff; font-size: 11px; font-weight: 700;
}

/* ==================== ANNOTATIONS (teacher-marked essays) ====================
   Teachers mark with [N:cat]wrong[/N] in the admin. The renderer converts
   those to <mark class="ann cat-XXX" data-num="N"> with a numbered superscript
   that matches the numbered feedback notes. Category → color. */

.ann {
  padding: 0 2px;
  border-radius: 3px;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: inherit;
  position: relative;
  cursor: help;
}
.ann-num {
  display: inline-block;
  margin-left: 2px;
  padding: 0 4px;
  background: var(--ann-color, #888);
  color: #fff;
  font-size: 10px;
  line-height: 1.5;
  font-weight: 700;
  border-radius: 3px;
  vertical-align: super;
  font-family: var(--font-body);
  letter-spacing: 0.02em;
  top: -2px;
}

/* Category palette — kept distinct even on an all-red UI because errors need
   to be visually separable from the IELTS red primary action color. */
.ann.cat-g   { --ann-color: #c8102e; background: rgba(200, 16, 46, 0.10); border-bottom-color: #c8102e; }
.ann.cat-sp  { --ann-color: #d97706; background: rgba(217, 119, 6, 0.10);  border-bottom-color: #d97706; }
.ann.cat-v   { --ann-color: #1d4ed8; background: rgba(29, 78, 216, 0.10);  border-bottom-color: #1d4ed8; }
.ann.cat-st  { --ann-color: #7c3aed; background: rgba(124, 58, 237, 0.10); border-bottom-color: #7c3aed; }
.ann.cat-w   { --ann-color: #0f766e; background: rgba(15, 118, 110, 0.10); border-bottom-color: #0f766e; }
.ann.cat-\\!,
.ann.cat-good { --ann-color: #16a34a; background: rgba(22, 163, 74, 0.10); border-bottom-color: #16a34a; }

.ann-legend {
  display: flex; flex-wrap: wrap; gap: 8px;
  font-size: var(--fs-xs); color: var(--ink-3);
  margin: 8px 0 14px;
}
.ann-legend .chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--surface-alt);
  border: 1px solid var(--border-soft);
  font-weight: 500;
}
.ann-legend .chip::before {
  content: "";
  width: 10px; height: 10px; border-radius: 2px;
  background: var(--legend-color, #888);
  flex-shrink: 0;
}
.ann-legend .chip.cat-g  { --legend-color: #c8102e; }
.ann-legend .chip.cat-sp { --legend-color: #d97706; }
.ann-legend .chip.cat-v  { --legend-color: #1d4ed8; }
.ann-legend .chip.cat-st { --legend-color: #7c3aed; }
.ann-legend .chip.cat-w  { --legend-color: #0f766e; }
.ann-legend .chip.cat-\\! { --legend-color: #16a34a; }

.annotated-essay {
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 2;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px 22px;
  box-shadow: var(--shadow-sm);
  white-space: pre-wrap;
  word-break: break-word;
}

.numbered-notes { list-style: none; padding: 0; margin: 8px 0 0; }
.numbered-notes li {
  display: flex; gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--border-soft);
  font-size: var(--fs-sm);
  line-height: 1.6;
  align-items: baseline;
}
.numbered-notes li:first-child { border-top: 0; }
.numbered-notes .num {
  flex-shrink: 0;
  font-weight: 700; color: var(--ink);
  font-family: var(--font-mono); font-size: 12px;
  min-width: 22px;
}

.locked-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px;
  background: var(--surface-alt);
  color: var(--ink-3);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 500;
}

/* ==================== FEEDBACK BOX (essay marking) ==================== */
.feedback-box {
  background: var(--gold-tint);
  border: 1px solid #eccf81;
  border-radius: var(--r-lg);
  padding: 20px 22px;
  margin: 16px 0;
}
.feedback-box h3 {
  margin-top: 0;
  color: #6f4e0c;
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--font-body);
  font-weight: 700;
}
.feedback-box p { font-size: 16px; line-height: 1.75; }

/* ==================== SITE FOOTER ==================== */
.site-footer {
  margin-top: 64px;
  padding: 28px 0 40px;
  border-top: 1px solid var(--border-soft);
  color: var(--ink-4);
  font-size: var(--fs-xs);
  text-align: center;
}
.site-footer .container { opacity: 0.85; }

/* ==================== UTILITY ==================== */
.mt-0  { margin-top: 0 !important; }
.mt-4  { margin-top: 16px; }
.mt-8  { margin-top: 32px; }
.mb-0  { margin-bottom: 0 !important; }
.flex  { display: flex; gap: 10px; align-items: center; }
.flex-between { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.wrap  { flex-wrap: wrap; }
.stack-sm > * + * { margin-top: 8px; }
.stack-md > * + * { margin-top: 14px; }

details summary {
  cursor: pointer;
  list-style: none;
  color: var(--ink-3);
  font-size: var(--fs-sm);
  padding: 4px 0;
}
details summary::-webkit-details-marker { display: none; }
details[open] summary { margin-bottom: 6px; color: var(--teal); }

/* Wider screens */
@media (min-width: 720px) {
  :root { --fs-h1: 34px; --fs-display: 48px; }
  .container { padding: 0 24px; }
  .topbar-inner { padding: 18px 24px; }
  .hero { padding: 56px 0 24px; }
  .card { padding: 26px; }
}

/* Focus ring accessibility */
:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
  border-radius: 4px;
}
.btn:focus-visible,
a:focus-visible { outline-offset: 3px; }
