/* CAPSforge Grade 10 Life Sciences — v3.4 UI/UX Improvements */
:root {
  --green: #27ae60;
  --green-dark: #145a32;
  --green-deep: #0b3d25;
  --green-light: #34d17a;
  --mint: #e9fff3;
  --mint-2: #d9f7e6;
  --text: #10251a;
  --muted: #557267;
  --card: rgba(255, 255, 255, 0.88);
  --stroke: rgba(20, 90, 50, 0.14);
  --stroke-strong: rgba(20, 90, 50, 0.28);
  --shadow: 0 18px 48px rgba(15, 88, 48, 0.12);
  --shadow-hover: 0 24px 60px rgba(15, 88, 48, 0.18);
  --radius: 24px;
  --radius-sm: 16px;
  --tap-min: 44px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(39,174,96,0.22), transparent 38rem),
    radial-gradient(circle at bottom right, rgba(20,90,50,0.18), transparent 34rem),
    linear-gradient(135deg, #f5fff9 0%, #e4f8ee 52%, #f8fffb 100%);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .12;
  background-image: linear-gradient(90deg, rgba(20,90,50,.06) 1px, transparent 1px), linear-gradient(rgba(20,90,50,.06) 1px, transparent 1px);
  background-size: 40px 40px;
}
.app-shell { width: min(1180px, calc(100% - 28px)); margin: 0 auto; padding: 20px 0 44px; position: relative; }

/* ── Glass surfaces ── */
.glass-panel, .glass-card {
  background: var(--card);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px) saturate(120%);
  -webkit-backdrop-filter: blur(20px) saturate(120%);
}

/* ── Hero / Dashboard ── */
.hero {
  border-radius: 32px;
  padding: clamp(24px, 5vw, 48px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: center;
  overflow: hidden;
  position: relative;
}
.hero::after {
  content: "";
  position: absolute;
  top: -40%;
  right: -10%;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(39,174,96,0.10), transparent 70%);
  pointer-events: none;
}
.eyebrow {
  margin: 0 0 10px;
  color: var(--green-dark);
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-size: .72rem;
}
h1, h2, h3 { margin: 0; line-height: 1.1; }
h1 { font-size: clamp(2rem, 6.5vw, 3.8rem); color: var(--green-deep); letter-spacing: -0.05em; font-weight: 900; }
h2 { font-size: clamp(1.4rem, 3.5vw, 2.2rem); letter-spacing: -0.03em; font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 800; }
p { line-height: 1.6; margin: 0; }
.hero-text, .section-heading p, .diagram-panel p { color: var(--muted); font-size: 1.05rem; line-height: 1.65; }

/* Hero actions — clearer hierarchy */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 26px;
}
.hero-actions .primary-btn {
  min-height: 52px;
  padding: 14px 26px;
  font-size: 1.05rem;
}
.hero-actions .secondary-btn {
  min-height: 52px;
  padding: 14px 22px;
  font-size: 1.02rem;
}

/* Hero badge — more prominent, better contrast */
.hero-badge {
  min-width: 150px;
  min-height: 150px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--green-light), var(--green-dark));
  color: white;
  display: grid;
  place-items: center;
  text-align: center;
  box-shadow: 0 20px 40px rgba(20,90,50,.22), inset 0 0 0 4px rgba(255,255,255,0.15);
  position: relative;
  z-index: 1;
  transition: transform .2s ease, box-shadow .2s ease;
}
.hero-badge:hover { transform: scale(1.04); box-shadow: 0 24px 48px rgba(20,90,50,.28); }
.hero-badge span { display:block; font-size: 2.6rem; font-weight: 950; line-height: 1; }
.hero-badge small { display:block; max-width: 90px; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; font-size: .68rem; opacity: .9; }

/* ── Tab bar — sticky, clearer active state ── */
.tab-bar {
  position: sticky;
  top: 12px;
  z-index: 10;
  margin: 20px 0;
  border-radius: 999px;
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.tab-btn {
  border-radius: 999px;
  padding: 14px 10px;
  background: transparent;
  color: var(--green-dark);
  border: 0;
  font: inherit;
  cursor: pointer;
  font-weight: 800;
  font-size: .92rem;
  min-height: var(--tap-min);
  transition: all .15s ease;
  white-space: nowrap;
}
.tab-btn:hover { background: rgba(39,174,96,0.08); }
.tab-btn.active {
  color: white;
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.2), 0 10px 24px rgba(39,174,96,.22);
  font-weight: 900;
}

/* ── Tab views ── */
.tab-view { animation: fade .25s ease; }
@keyframes fade { from { opacity: .25; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ── Section headings ── */
.section-heading { padding: 22px 10px 16px; }
.section-heading.compact { padding: 0 0 18px; }
.section-heading h2 { margin-bottom: 8px; }

/* ── Cards — better spacing, hover lift ── */
.topic-grid, .diagram-library, .lab-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.topic-card, .library-card {
  text-align: left;
  background: rgba(255,255,255,.9);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  padding: 20px;
  box-shadow: 0 8px 22px rgba(20,90,50,.06);
  color: var(--text);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}
.topic-card:hover, .library-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(39,174,96,.4);
}
.topic-card.active, .library-card.active {
  background: linear-gradient(135deg, #f8fffb, #dff9ea);
  border-color: var(--green);
  box-shadow: 0 14px 32px rgba(39,174,96,.14);
}
.topic-card .num, .library-card .num {
  display:inline-grid; place-items:center; width:38px; height:38px; border-radius: 50%;
  background: var(--green); color:#fff; font-weight:950; margin-bottom: 12px; font-size: .95rem;
}

/* Progress track */
.progress-track { height: 6px; background: #d9eee2; border-radius: 999px; margin-top: 16px; overflow: hidden; }
.progress-track span { display: block; height: 100%; background: linear-gradient(90deg, var(--green), var(--green-dark)); border-radius: inherit; }

/* ── Glass cards — more breathing room ── */
.glass-card {
  border-radius: var(--radius);
  padding: clamp(20px, 3.2vw, 32px);
  margin-top: 18px;
}

/* ── Topic detail ── */
.topic-detail { display: grid; gap: 20px; }
.detail-hero { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 18px; align-items: start; }
.topic-badge { border-radius: 999px; padding: 10px 16px; background: #e3f8ed; color: var(--green-dark); font-weight: 900; white-space: nowrap; font-size: .85rem; }
.study-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.study-box { background: rgba(255,255,255,.8); border: 1px solid var(--stroke); border-radius: 20px; padding: 20px; }
.study-box h4 { margin: 0 0 12px; color: var(--green-dark); font-size: 1rem; font-weight: 800; }
ul.clean-list { margin: 0; padding-left: 1.2rem; }
ul.clean-list li { margin: .55rem 0; line-height: 1.5; }
.exam-focus { border-left: 5px solid var(--green); background: #f4fff8; padding: 18px; border-radius: 16px; }

/* ── Search / inputs ── */
.search-label { display:block; font-weight:900; color: var(--green-dark); margin-bottom:10px; font-size: .95rem; }
.search-input, select, input[type="text"], textarea {
  width: 100%; border-radius: 16px; border: 1.5px solid var(--stroke);
  background: rgba(255,255,255,.9); padding: 14px 18px; font: inherit; color: var(--text); outline: none;
  min-height: var(--tap-min);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.search-input:focus, select:focus, input[type="text"]:focus, textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 5px rgba(39,174,96,.10);
}

/* Dictionary list */
.dictionary-list { display:grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; margin-top: 16px; max-height: 580px; overflow:auto; padding-right: 6px; }
.term-card { border:1px solid var(--stroke); border-radius:18px; padding:18px; background: rgba(255,255,255,.85); transition: transform .15s ease, box-shadow .15s ease; }
.term-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(20,90,50,.08); }
.term-card strong { display:block; color: var(--green-dark); font-size:1.08rem; margin-bottom: 4px; }
.term-card small { color: var(--muted); font-weight:800; font-size: .82rem; }

/* ── Diagram trainer ── */
.trainer-header { display:grid; grid-template-columns: minmax(0,1fr) auto; gap: 20px; align-items:center; margin-bottom: 20px; }
.mode-toggle { background: rgba(255,255,255,.75); border-radius:999px; padding: 7px; display:grid; grid-template-columns: repeat(3,1fr); gap: 7px; min-width: min(420px,100%); }
.mode-btn { border-radius: 999px; padding: 13px 18px; background: transparent; color: var(--green-dark); border: 0; font: inherit; cursor: pointer; font-weight: 800; min-height: var(--tap-min); transition: all .15s ease; }
.mode-btn:hover { background: rgba(39,174,96,0.08); }
.mode-btn.active { background: linear-gradient(135deg, var(--green), var(--green-dark)); color:#fff; box-shadow: 0 8px 20px rgba(39,174,96,.18); }
.trainer-layout { display:grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr); gap: 20px; align-items:start; }
.diagram-stage { min-height: 520px; background: rgba(242,255,247,.88); border-radius: 26px; border: 1px solid rgba(39,174,96,.14); padding: 14px; overflow:auto; display:grid; place-items:center; }
.diagram-stage svg { width: min(100%, 850px); min-width: 640px; height: auto; display:block; }
.svg-spot { cursor:pointer; }
.svg-spot circle { filter: drop-shadow(0 3px 6px rgba(0,0,0,.12)); transition: r .15s ease; }
.svg-spot:hover circle { r: 14; }
.svg-spot.active circle { fill:#ffb612; stroke:#0b3d25; stroke-width: 2.5; }
.diagram-panel { background: rgba(255,255,255,.85); border-radius: 22px; padding: 20px; border:1px solid var(--stroke); max-height: 640px; overflow:auto; }
.label-list { display:grid; gap: 12px; }
.label-card { border: 1px solid var(--stroke); background: rgba(255,255,255,.92); border-radius: 18px; padding: 16px; transition: border-color .15s ease, box-shadow .15s ease; }
.label-card:hover { border-color: rgba(39,174,96,.3); }
.label-card.active { border-color: var(--green); box-shadow: 0 0 0 4px rgba(39,174,96,.10); }
.label-card strong { color: var(--green-dark); font-size: 1.05rem; }
.label-card .tip { display:block; color: var(--muted); margin-top: 10px; font-size: .94rem; line-height: 1.5; }

/* ── Practice options ── */
.practice-options { display:grid; gap:12px; margin-top: 16px; }
.answer-option {
  text-align:left; border:1.5px solid var(--stroke); border-radius: 16px;
  background:#fff; padding: 14px 16px; color: var(--text);
  font: inherit; cursor: pointer; font-weight: 700;
  min-height: var(--tap-min);
  transition: all .15s ease;
}
.answer-option:hover { border-color: rgba(39,174,96,.4); background: #f8fffb; }
.answer-option.correct { border-color:#27ae60; background:#effff5; }
.answer-option.wrong { border-color:#d75b5b; background:#fff5f5; }

/* ── Test / Quiz layout ── */
.test-label-row { margin: 14px 0; padding: 14px; border:1px solid var(--stroke); border-radius: 16px; background: rgba(255,255,255,.85); }
.lab-card { margin-top: 0; }
.lab-icon { width:54px; height:54px; display:grid; place-items:center; border-radius:18px; background:linear-gradient(135deg,var(--green),var(--green-dark)); color:#fff; font-weight:950; margin-bottom: 14px; font-size: 1.2rem; }
.checklist-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(230px,1fr)); gap:14px; }
.checklist-grid div { border:1px solid var(--stroke); border-radius:18px; padding:16px; background: rgba(255,255,255,.82); }
.checklist-grid strong { display:block; color: var(--green-dark); margin-bottom: 6px; font-size: 1.05rem; }

/* ── Quiz toolbar — clearer layout ── */
.quiz-toolbar {
  display:grid;
  grid-template-columns: minmax(220px,1fr) auto auto;
  gap: 14px;
  align-items: end;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--stroke);
  margin-bottom: 8px;
}
.quiz-toolbar label { font-weight: 900; color: var(--green-dark); font-size: .95rem; }
.quiz-meta { margin: 14px 0; color: var(--muted); font-weight: 700; font-size: .95rem; }

/* ── Question cards — better spacing, clearer hierarchy ── */
.question-list { display:grid; gap: 18px; }
.question-card {
  border:1.5px solid var(--stroke);
  border-radius: 22px;
  padding: 20px;
  background: rgba(255,255,255,.88);
  transition: box-shadow .15s ease, border-color .15s ease;
}
.question-card:hover { box-shadow: 0 8px 24px rgba(20,90,50,.08); border-color: rgba(39,174,96,.2); }
.question-head { display:flex; gap:12px; justify-content:space-between; align-items:start; margin-bottom: 14px; flex-wrap: wrap; }
.mark-pill, .type-pill { border-radius:999px; padding: 7px 12px; background:#e4f7ed; color: var(--green-dark); font-size:.8rem; font-weight:900; white-space:nowrap; }

/* ── Memo / answer reveal ── */
.memo {
  margin-top: 14px;
  border-left: 4px solid var(--green);
  padding: 14px 16px;
  border-radius: 12px;
  background:#f4fff8;
  color:#274137;
  line-height: 1.6;
}

/* ── Result box ── */
.result-box {
  margin-top: 18px;
  border-radius: 20px;
  background: linear-gradient(135deg, #0f3b27, #19713e);
  color:#fff;
  padding: 22px;
  font-weight:800;
  box-shadow: 0 12px 32px rgba(15,88,48,.2);
}
.result-box p { color: rgba(255,255,255,.88); line-height: 1.6; }

/* ── Paper mode switch — clearer active state ── */
.paper-mode-switch {
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  margin: 16px 0 10px;
  padding: 10px;
  background: rgba(255,255,255,.6);
  border-radius: 18px;
  border: 1px solid var(--stroke);
}
.mode-chip {
  border:1.5px solid var(--stroke);
  border-radius:999px;
  background:rgba(255,255,255,.9);
  color:var(--green-dark);
  padding:13px 20px;
  font:inherit;
  font-weight:900;
  cursor:pointer;
  min-height: var(--tap-min);
  transition: all .15s ease;
  flex: 1 1 180px;
  text-align: center;
}
.mode-chip:hover { border-color: rgba(39,174,96,.4); background: #f8fffb; }
.mode-chip.active {
  background:linear-gradient(135deg,var(--green),var(--green-dark));
  color:#fff;
  box-shadow:0 10px 24px rgba(39,174,96,.22);
  border-color: transparent;
}

/* ── Local notes — larger, clearer, better UX ── */
.local-note {
  margin-top: 16px;
  border: 1.5px dashed rgba(20,90,50,.22);
  border-radius: 18px;
  padding: 14px 16px;
  background:rgba(244,255,248,.85);
  transition: border-color .15s ease, background .15s ease;
}
.local-note:hover { border-color: rgba(20,90,50,.35); background: rgba(244,255,248,.95); }
.local-note summary {
  cursor:pointer;
  color:var(--green-dark);
  font-weight:900;
  font-size: .95rem;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: var(--tap-min);
  list-style: none;
}
.local-note summary::-webkit-details-marker { display: none; }
.local-note summary::before {
  content: "✏️";
  font-size: 1.1rem;
}
.local-note[open] summary::before { content: "📝"; }
.local-note textarea {
  margin-top:12px;
  min-height: 90px;
  background:#fff;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 1rem;
  line-height: 1.5;
  resize: vertical;
}
.local-note small {
  display:block;
  margin-top:8px;
  color:var(--muted);
  font-weight:700;
  font-size: .78rem;
}
.local-note .note-saved {
  display: inline-block;
  margin-left: 8px;
  color: var(--green);
  font-size: .78rem;
  opacity: 0;
  transition: opacity .3s ease;
}
.local-note .note-saved.visible { opacity: 1; }

/* Source pill */
.source-pill {
  display:inline-block;
  margin-top:10px;
  border-radius:999px;
  background:#e8f6ee;
  color:var(--green-dark);
  padding:6px 11px;
  font-size:.78rem;
  font-weight:900;
}

/* ── Paper section title ── */
.paper-section-title {
  margin: 22px 0 6px;
  padding:14px 18px;
  border-radius:18px;
  background:linear-gradient(135deg,#0f3b27,#19713e);
  color:#fff;
  font-weight:950;
  letter-spacing:.08em;
  font-size: .95rem;
  box-shadow: 0 6px 16px rgba(15,88,48,.15);
}

/* ── Buttons — clearer, larger tap targets ── */
.primary-btn, .secondary-btn {
  border-radius: 999px;
  padding: 14px 22px;
  min-height: var(--tap-min);
  border: 0;
  font: inherit;
  cursor: pointer;
  font-weight: 900;
  font-size: 1rem;
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.primary-btn { background: linear-gradient(135deg, var(--green), var(--green-dark)); color: #fff; box-shadow: 0 12px 28px rgba(39,174,96,.22); }
.primary-btn:hover { transform: translateY(-1px); box-shadow: 0 16px 34px rgba(39,174,96,.28); filter: brightness(1.05); }
.primary-btn:active { transform: translateY(0); }
.secondary-btn { background: rgba(255,255,255,.8); color: var(--green-dark); border: 1.5px solid var(--stroke); }
.secondary-btn:hover { background: #fff; border-color: rgba(39,174,96,.35); box-shadow: 0 8px 20px rgba(20,90,50,.08); }

/* ── Bottom submit row — more prominent ── */
.bottom-submit-row { display:flex; justify-content:center; margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--stroke); }
.bottom-submit-row .primary-btn { min-width: min(100%, 440px); font-size: 1.05rem; padding: 16px 28px; }

/* ── Study answer reveal ── */
.study-answer { margin-top: 14px; border-left: 5px solid var(--green); border-radius: 14px; background: #f0fff5; padding: 14px 16px; color: #173628; }
.study-answer p { margin: 8px 0 0; color: #38594b; line-height: 1.6; }
.study-check-card.answered { background: rgba(255,255,255,.95); }

/* ── Daily quiz ── */
.daily-answer { margin-top: 14px; border-left: 5px solid var(--green); border-radius: 14px; background: #f0fff5; padding: 14px 16px; color: #173628; }
.daily-answer p { margin: 8px 0 0; color: #38594b; line-height: 1.6; }
.daily-card.answered { background: rgba(255,255,255,.95); }
.answer-mini-list { margin-top: 14px; padding-left: 20px; }
.answer-mini-list li { margin: 6px 0; line-height: 1.5; }

/* ── Test answer input ── */
.test-answer-input, .question-card textarea {
  width: 100%; box-sizing: border-box; border: 1.5px solid var(--stroke);
  border-radius: 14px; padding: 14px 16px; font: inherit;
  background: rgba(255,255,255,.95); color: var(--text);
  min-height: var(--tap-min);
  font-size: 1rem;
  line-height: 1.5;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.test-answer-input:focus, .question-card textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(39,174,96,.10);
  outline: none;
}
.question-card textarea { resize: vertical; min-height: 80px; }

/* ── Helper text ── */
.helper-note { display:block; margin-top: 8px; color: var(--muted); font-weight: 600; line-height: 1.5; font-size: .92rem; }

/* ── Scrollbar styling ── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(20,90,50,.18); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(20,90,50,.3); }

/* ── Selection color ── */
::selection { background: rgba(39,174,96,.18); color: var(--green-deep); }

/* ── Focus visible for accessibility ── */
:focus-visible { outline: 2.5px solid var(--green); outline-offset: 3px; border-radius: 8px; }
button:focus-visible, a:focus-visible { outline-offset: 4px; }

/* ── Mobile: 850px breakpoint ── */
@media (max-width: 850px) {
  .app-shell { width: min(100% - 16px, 760px); padding-top: 10px; }
  .hero, .detail-hero, .trainer-header, .trainer-layout { grid-template-columns: 1fr; }
  .hero-badge { min-width: 120px; min-height:120px; justify-self:start; margin-top: 8px; }
  .tab-bar { grid-template-columns: repeat(5, minmax(100px,1fr)); overflow:auto; border-radius: 22px; position: sticky; gap: 6px; padding: 8px; }
  .tab-btn { white-space:nowrap; font-size: .88rem; padding: 12px 8px; }
  .quiz-toolbar { grid-template-columns: 1fr; gap: 12px; }
  .diagram-stage { min-height: 440px; justify-content:start; }
  .diagram-stage svg { min-width: 560px; }
  .mode-toggle { min-width: 100%; }
  .trainer-layout { grid-template-columns: 1fr; }
  .paper-mode-switch { flex-direction: column; }
  .mode-chip { width: 100%; }
  .bottom-submit-row .primary-btn { width:100%; }
  h1 { font-size: clamp(1.8rem, 7vw, 2.6rem); }
  h2 { font-size: clamp(1.3rem, 5vw, 1.8rem); }
}

/* ── Small mobile: 520px breakpoint ── */
@media (max-width: 520px) {
  .hero { padding: 20px; border-radius: 24px; }
  .hero-actions { display:grid; grid-template-columns: 1fr; gap: 10px; }
  .hero-actions .primary-btn, .hero-actions .secondary-btn { width: 100%; }
  .hero-badge { min-width: 100px; min-height: 100px; }
  .hero-badge span { font-size: 2.2rem; }
  .topic-grid, .diagram-library, .lab-grid, .study-grid { grid-template-columns: 1fr; }
  .glass-card { padding: 16px; border-radius: 20px; }
  .diagram-stage { min-height: 360px; }
  .diagram-stage svg { min-width: 480px; }
  .question-card { padding: 16px; }
  .quiz-toolbar { padding-bottom: 12px; }
  .local-note { padding: 12px; }
  .local-note textarea { min-height: 80px; }
  .section-heading { padding: 16px 6px 12px; }
  .tab-bar { top: 6px; }
  .tab-btn { font-size: .82rem; padding: 10px 6px; }
}

/* ── Very small: 380px breakpoint ── */
@media (max-width: 380px) {
  .app-shell { width: calc(100% - 10px); }
  .hero { padding: 16px; }
  .tab-btn { font-size: .75rem; padding: 8px 4px; }
  .primary-btn, .secondary-btn { padding: 12px 16px; font-size: .95rem; }
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.2rem; }
}


/* CAPSforge safety additions after Kimi UI import */
.options-grid {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.note-status {
  color: var(--green-dark);
  font-weight: 800;
}
.mode-btn[aria-pressed="true"], .mode-chip[aria-pressed="true"] {
  font-weight: 950;
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
