/* v2.2.0 palette — colour psychology for people in difficulty.
   Calm trust primary: deep teal (blue's credibility + green's life;
   healthcare research: teal/seafoam reads as clean without the coldness
   of pure blue or grey). Warm amber/gold ONLY for the main call to
   action, so the CTA still pops without shouting. Warm off-white
   background (pure white reads clinical and tiring over long reads).
   Red is reserved for genuine danger/overdue states only.
   Contrast (WCAG AA, computed): text on bg 13.84:1, muted on bg
   5.86:1, white on teal 5.47:1, dark text on amber CTA 7.04:1,
   ok on white 5.13:1, danger text on danger-bg 9.02:1. */
:root {
  --bg: #fbf8f3;
  --surface: #ffffff;
  --text: #1e2a32;
  --muted: #55636b;
  --border: #dce3e6;
  --accent: #0f766e;
  --accent-dark: #0a4f52;
  --accent-soft: #e6f4f3;
  --cta: #f0a500;
  --cta-dark: #d18f00;
  --cta-text: #1e2a32;
  --ok: #2e7d32;
  --ok-bg: #e6f4ea;
  --info: #0e6b7a;
  --info-bg: #e6f4f3;
  --danger: #b3261e;
  --danger-text: #7a1f18;
  --warn-bg: #fff3cd;
  --warn-text: #664d03;
  --danger-bg: #fdecea;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(30, 42, 50, 0.06), 0 1px 6px rgba(30, 42, 50, 0.05);
  --shadow: 0 2px 4px rgba(30, 42, 50, 0.07), 0 8px 20px rgba(30, 42, 50, 0.08);
  --shadow-btn: 0 1px 3px rgba(15, 118, 110, 0.35);
  --shadow-cta: 0 1px 3px rgba(209, 143, 0, 0.45);
}
* { box-sizing: border-box; }
/* v2.5.2: font-size setting — one variable drives every size. The
   root font size sets the rem base, so headings, buttons, cards and
   body text all scale together (no fixed px font-size anywhere else
   in this file). Normal is now the size the owner approved on his
   6.8" Samsung S24 Ultra (body ~14px, root 13px — the old Small);
   Small is one step smaller (body ~13px, root 12px); Large is the
   old Normal (body 17px, root 16px); the large-text accessibility
   mode is the largest (body ~20px, root 19px). */
:root { --fs-base: 13px; font-size: var(--fs-base); }
:root.font-small { --fs-base: 12px; }
:root.font-large { --fs-base: 16px; }
:root.font-xlarge { --fs-base: 19px; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 1.0625rem;
}
button, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
main { max-width: 760px; margin: 0 auto; padding: 1rem 1rem 4rem; }
h1 { font-size: 1.9rem; line-height: 1.15; margin: 0.4rem 0 0.5rem; letter-spacing: -0.01em; }
h2 { font-size: 1.3rem; line-height: 1.25; margin: 0 0 0.5rem; }
h3 { font-size: 1.05rem; margin: 0 0 0.5rem; }
a { color: var(--accent-dark); }
button { font: inherit; cursor: pointer; }
input[type="text"], input[type="date"], input[type="search"] {
  font: inherit; padding: 0.6rem 0.7rem; border: 1px solid var(--border);
  border-radius: 8px; width: 100%; background: var(--surface); color: var(--text);
}
input[type="checkbox"], input[type="radio"] { width: 1.2rem; height: 1.2rem; accent-color: var(--accent); }

.topbar {
  display: flex; flex-direction: column; gap: 0.35rem;
  background: var(--surface); border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 0.55rem 1rem 0.6rem; position: sticky; top: 0; z-index: 10;
}
.topbar-row { display: flex; align-items: center; gap: 0.6rem; }
.topbar .brand {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-weight: 800; font-size: 1.25rem; letter-spacing: -0.01em;
  background: none; border: none; color: var(--text); padding: 0.1rem 0.2rem;
}
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.9rem; height: 1.9rem; flex: none;
  background: var(--accent); color: #fff; border-radius: 9px;
  font-size: 0.85rem; font-weight: 800; letter-spacing: 0.02em;
  box-shadow: var(--shadow-btn);
}
.topbar nav {
  display: flex; flex-wrap: nowrap; gap: 0.3rem; flex: 1;
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.topbar nav::-webkit-scrollbar { display: none; }
.topbar nav button {
  background: none; border: 1px solid transparent; border-radius: 999px;
  padding: 0.45rem 0.8rem; color: var(--text); white-space: nowrap;
  min-height: 2.4rem;
}
.topbar nav button.active {
  border-color: var(--accent); background: var(--accent-soft);
  color: var(--accent-dark); font-weight: 700;
}
.lang-btn { font-weight: 700; }
.help-now {
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  padding: 0.4rem 0.8rem; color: var(--muted); font-size: 0.85rem; min-height: 2.4rem;
  margin-left: auto; white-space: nowrap;
}

.hero {
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--surface) 65%);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.2rem 1.2rem 1rem; margin: 0.4rem 0 1rem;
}
.hero-brand { display: flex; gap: 0.8rem; align-items: flex-start; }
.hero-mark { width: 3rem; height: 3rem; font-size: 1.15rem; border-radius: 12px; margin-top: 0.15rem; }
.hero h1 { margin: 0; }
.hero-sub { color: var(--muted); font-size: 1rem; margin: 0.2rem 0 0; }
.hero p { margin: 0.7rem 0 0; }
/* v2.5.1: font-size quick control on the home hero — one slim row,
   so the owner can shrink the text without hunting in Settings. */
.font-quick { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
.font-quick .muted { margin-right: 0.1rem; }
.font-quick button {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 8px; padding: 0.25rem 0.7rem; min-height: 2.4rem; font-weight: 700;
}
.font-quick button.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); }
.font-quick button[data-font-size="small"] { font-size: 0.85rem; }
.font-quick button[data-font-size="normal"] { font-size: 1rem; }
.font-quick button[data-font-size="large"] { font-size: 1.15rem; }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.1rem; margin: 0.9rem 0;
  box-shadow: var(--shadow-sm);
}
.empty { text-align: center; color: var(--muted); padding: 1.6rem 1rem; }
.cards { display: grid; gap: 0.9rem; }
.center { text-align: center; }
.muted { color: var(--muted); font-size: 0.95rem; }
.disclaimer {
  background: var(--warn-bg); color: var(--warn-text);
  border: 1px solid #e6c87a; border-radius: var(--radius);
  padding: 0.8rem 1rem; font-size: 0.95rem;
}
/* Estimator small print: short, always visible under every estimate.
   The range is shown as low–high; the top of the range is never
   presented as the expected amount. */
.estimate-disclaimer { font-size: 0.85rem; }
/* The estimator box sits right after the deadlines and must be visible
   without scrolling through the whole flow: amber left border, big range. */
#estimator-box { border-left: 4px solid var(--cta); }
.estimate-big { font-size: 1.35rem; line-height: 1.4; }
.estimate-preview { font-size: 0.95rem; margin-top: 0.4rem; }
.verified { color: var(--muted); font-size: 0.9rem; }
.verified.stale { color: var(--warn-text); font-weight: 600; }
.stale-banner {
  background: var(--warn-bg); color: var(--warn-text);
  border: 1px solid #e6c87a; border-radius: 8px; padding: 0.7rem 0.9rem;
}
.emergency-banner {
  background: var(--danger-bg); border: 1px solid #e8a19b; border-radius: 8px;
  padding: 0.8rem 1rem; font-weight: 600;
}
.insight {
  background: var(--info-bg); border: 1px solid #a8d8d5; border-radius: 8px;
  padding: 0.8rem 1rem;
}
.signpost-note {
  background: var(--warn-bg); color: var(--warn-text);
  border: 1px solid #e6c87a; border-radius: 8px; padding: 0.8rem 1rem;
}
.big-buttons { display: grid; gap: 0.7rem; margin-top: 0.8rem; }
@media (min-width: 560px) { .big-buttons { grid-template-columns: 1fr 1fr; } }
.big {
  padding: 1rem; font-size: 1.1rem; font-weight: 600;
  background: var(--surface); border: 2px solid var(--accent);
  border-radius: var(--radius); color: var(--accent-dark);
  box-shadow: var(--shadow-sm); min-height: 3.4rem;
}
.big:hover { background: var(--accent-soft); box-shadow: var(--shadow); }
.primary {
  background: var(--cta); color: var(--cta-text); border: none;
  border-radius: 10px; padding: 0.7rem 1.2rem; font-weight: 700;
  min-height: 2.9rem; box-shadow: var(--shadow-cta);
}
.primary:hover { background: var(--cta-dark); }
.primary:active { transform: translateY(1px) scale(0.98); box-shadow: none; }
.secondary {
  background: var(--surface); color: var(--accent-dark);
  border: 1.5px solid var(--accent); border-radius: 10px;
  padding: 0.65rem 1.1rem; font-weight: 700; min-height: 2.9rem;
  box-shadow: var(--shadow-sm);
}
.secondary:hover { background: var(--accent-soft); }
.big-save { display: inline-block; width: 100%; padding: 0.9rem; font-size: 1.05rem; margin-top: 0.5rem; }
.link { background: none; border: none; color: var(--accent-dark); padding: 0.3rem 0; text-decoration: underline; }
.badge {
  display: inline-block; background: #eee; border-radius: 999px;
  padding: 0.1rem 0.6rem; font-size: 0.8rem; color: var(--muted);
}
.badge.warn { background: var(--warn-bg); color: var(--warn-text); }
.problem { transition: transform 0.12s ease, box-shadow 0.12s ease; }
.problem:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.problem h2 { margin-top: 0.35rem; }
.problem .rank {
  display: flex; align-items: center; gap: 0.45rem;
  color: var(--muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em;
}
.problem.soon { opacity: 0.75; }
.cat-dot {
  display: inline-block; width: 0.65rem; height: 0.65rem; flex: none;
  border-radius: 50%; background: var(--muted);
}
.cat-housing { background: #0f766e; }
.cat-benefits { background: #2f6fbd; }
.cat-work { background: #2e7d32; }
.cat-consumer { background: #b45309; }
.cat-car { background: #0e7490; }
.cat-health { background: #7c5295; }
.chips { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0.7rem 0; }
.chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  border: 1px solid var(--border); background: var(--surface); border-radius: 999px;
  padding: 0.45rem 0.85rem; color: var(--text); text-decoration: none; min-height: 2.4rem;
  box-shadow: var(--shadow-sm);
}
.chip.active {
  border-color: var(--accent); background: var(--accent-soft);
  color: var(--accent-dark); font-weight: 700;
}
.chip.link-btn { display: inline-block; }
#search {
  margin: 0.7rem 0 0.2rem; border-radius: 999px; padding: 0.75rem 1.1rem;
  box-shadow: var(--shadow-sm);
}
.q { display: block; margin: 0.8rem 0; font-weight: 600; }
.q input { margin-top: 0.3rem; font-weight: 400; }
.q label { display: block; font-weight: 400; margin: 0.3rem 0; }
.steps li { margin-bottom: 0.9rem; }
.steps li p { margin: 0.2rem 0 0; }
.deadlines li { margin-bottom: 0.6rem; }
.checklist { list-style: none; padding: 0; }
.checklist li { margin: 0.5rem 0; }
.checklist label { display: flex; gap: 0.6rem; align-items: flex-start; }
.template { border-top: 1px solid var(--border); padding-top: 0.9rem; margin-top: 0.9rem; }
.tpl-fields { display: grid; gap: 0.5rem; margin-bottom: 0.6rem; }
@media (min-width: 560px) { .tpl-fields { grid-template-columns: 1fr 1fr; } }
.tpl-fields label { font-size: 0.9rem; font-weight: 600; color: var(--muted); }
.tpl-fields input { margin-top: 0.2rem; }
pre {
  white-space: pre-wrap; word-wrap: break-word; background: #f7f3ec;
  border: 1px solid var(--border); border-radius: 8px; padding: 0.9rem;
  font: 0.95rem/1.5 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
table.fresh { width: 100%; border-collapse: collapse; background: var(--surface); }
table.fresh th, table.fresh td { border: 1px solid var(--border); padding: 0.5rem 0.6rem; text-align: left; }
td.stale { color: var(--warn-text); font-weight: 600; }
.attention { border-color: var(--accent); }
.attention h2 { color: var(--accent-dark); }

/* Sending + overdue escalation */
.sent-badge {
  background: #e6f4ea; border: 1px solid #a3d9a5; border-radius: 8px;
  padding: 0.6rem 0.8rem; font-weight: 600; color: var(--ok);
}
.overdue-panel {
  background: var(--danger-bg); border: 1px solid #e8a19b; border-radius: var(--radius);
  padding: 0.9rem 1rem; margin: 0.9rem 0;
}
.overdue-panel h3 { color: var(--danger-text); }
.chip:disabled { opacity: 0.45; cursor: not-allowed; }
select {
  font: inherit; padding: 0.6rem 0.7rem; border: 1px solid var(--border);
  border-radius: 8px; width: 100%; background: var(--surface); color: var(--text);
}
input[type="tel"], input[type="email"], input[type="datetime-local"] {
  font: inherit; padding: 0.6rem 0.7rem; border: 1px solid var(--border);
  border-radius: 8px; width: 100%; background: var(--surface); color: var(--text);
}

/* Extras: dashboard, evidence vault, timeline, print */
textarea {
  font: inherit; padding: 0.6rem 0.7rem; border: 1px solid var(--border);
  border-radius: 8px; width: 100%; background: var(--surface); color: var(--text);
}
.overdue-row td { background: var(--danger-bg); color: var(--danger-text); font-weight: 600; }
.vault-list { list-style: none; padding: 0; }
.vault-list li { display: flex; gap: 0.7rem; align-items: flex-start; margin: 0.6rem 0; }
.vault-list img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.vault-add { display: grid; gap: 0.5rem; margin-bottom: 0.6rem; }
.vault-add label { font-size: 0.9rem; font-weight: 600; color: var(--muted); }
.vault-add input, .vault-add select { margin-top: 0.2rem; }
.timeline { list-style: none; padding: 0; }
.timeline li { margin: 0.4rem 0; }
.timeline .t-date { font-weight: 700; }
@media print {
  body * { visibility: hidden; }
  .printing, .printing * { visibility: visible; }
  .printing { position: absolute; left: 0; top: 0; width: 100%; }
  .printing button, .printing input, .printing select, .printing textarea { display: none; }
}

/* Prior contact: a step already done before PutRight, and the banner
   that says where the plan starts instead. */
.prior-banner {
  background: var(--accent-bg, #e6f4f3);
  border: 1px solid var(--accent, #0f766e);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
}
.steps li.done-step {
  opacity: 0.75;
  border-left: 3px solid var(--ok, #2e7d32);
  padding-left: 0.6rem;
}

/* v1.9.0 accessibility: large text, high contrast, simple language.
   Large text no longer sets its own font size (v2.5.1): it now means
   the largest font size (root 19px, body ~20px), applied by
   applyFontSize() — the larger of the font-size setting and the
   large-text mode always wins. The wider layout for large text
   stays. */
body.large-text main { max-width: 820px; }
body.high-contrast {
  --bg: #ffffff; --surface: #ffffff; --text: #000000; --muted: #222222;
  --border: #000000; --accent: #005f63; --accent-dark: #003d40;
  --accent-soft: #e6f4f3; --cta: #f0a500; --cta-dark: #8a6100; --cta-text: #000000;
  --warn-bg: #fff3cd; --warn-text: #3d2c00; --danger-bg: #fdecea;
}
body.high-contrast .card, body.high-contrast .topbar { border-width: 2px; }
body.high-contrast a { color: #003d40; text-decoration: underline; }
body.simple-language { line-height: 1.8; }
body.simple-language .muted { font-size: 1rem; }

/* v2.0.0: Urdu is right-to-left. Flip direction and the nav order; the
   done-step marker moves to the right edge so it still reads as a marker. */
html[dir="rtl"] body { direction: rtl; }
html[dir="rtl"] .topbar nav { flex-direction: row-reverse; }
html[dir="rtl"] table.fresh th, html[dir="rtl"] table.fresh td { text-align: right; }
html[dir="rtl"] .steps li.done-step { border-left: none; border-right: 3px solid var(--ok, #2e7d32); padding-left: 0; padding-right: 0.6rem; }

/* v2.1.0: first-launch intro ("Jak to działa") */
.intro-wrap { max-width: 560px; margin: 0 auto; padding: 1.2rem 1rem 4rem; }
.intro-card { text-align: left; padding: 1.4rem 1.3rem; }
.intro-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 3.4rem; height: 3.4rem; background: var(--accent); color: #fff;
  border-radius: 14px; font-size: 1.3rem; font-weight: 800; letter-spacing: 0.02em;
  box-shadow: var(--shadow-btn); margin-bottom: 0.4rem;
}
.intro-card h1 { margin-top: 0.3rem; }
.intro-sub { color: var(--muted); font-size: 1.05rem; margin: 0.2rem 0 0.4rem; }
.intro-steps { list-style: none; padding: 0; margin: 1.1rem 0 0.4rem; display: grid; gap: 1rem; }
.intro-steps li { display: flex; gap: 0.85rem; align-items: flex-start; }
.intro-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; flex: none; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 800; font-size: 1rem;
  margin-top: 0.1rem;
}
.intro-steps h2 { font-size: 1.1rem; margin: 0 0 0.15rem; }
.intro-steps p { margin: 0; color: var(--muted); }
.intro-limits {
  background: var(--info-bg); border: 1px solid #a8d8d5; border-radius: 8px;
  padding: 0.8rem 1rem; font-size: 0.95rem; margin: 1rem 0 0;
}
.intro-actions { display: grid; gap: 0.4rem; margin-top: 1rem; text-align: center; }
.intro-actions .link { justify-self: center; padding: 0.6rem 1rem; min-height: 2.9rem; }

/* v2.1.0: section headings inside flow views read as sections, not walls */
.card h2:first-child { margin-top: 0; }
.steps li { margin-bottom: 0.9rem; }
.steps li::marker { color: var(--accent-dark); font-weight: 700; }

/* v2.2.0: warmer palette visuals — category icons, illustrations,
   hero decoration, intro step connector. All inline SVG, no external
   images (the PWA must work offline), no emoji as decoration. */
.hero { position: relative; overflow: hidden; }
.hero::after {
  content: ""; position: absolute; right: -3.2rem; top: -3.2rem;
  width: 9rem; height: 9rem; border-radius: 50%;
  background: radial-gradient(circle, rgba(240, 165, 0, 0.22) 0%, rgba(240, 165, 0, 0.08) 55%, transparent 72%);
  pointer-events: none;
}
.hero::before {
  content: ""; position: absolute; right: 2.2rem; bottom: -4.4rem;
  width: 8rem; height: 8rem; border-radius: 50%;
  background: radial-gradient(circle, rgba(15, 118, 110, 0.16) 0%, rgba(15, 118, 110, 0.05) 55%, transparent 72%);
  pointer-events: none;
}
.cat-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.35rem; height: 1.35rem; flex: none;
}
.cat-icon svg { width: 1.2rem; height: 1.2rem; }
.cat-icon.cat-housing { color: #0f766e; }
.cat-icon.cat-benefits { color: #2f6fbd; }
.cat-icon.cat-work { color: #2e7d32; }
.cat-icon.cat-consumer { color: #b45309; }
.cat-icon.cat-car { color: #0e7490; }
.cat-icon.cat-health { color: #7c5295; }
.chip .cat-icon { width: 1.2rem; height: 1.2rem; }
.chip .cat-icon svg { width: 1.1rem; height: 1.1rem; }
.intro-illustration { display: block; margin: 0.2rem auto 0.4rem; max-width: 240px; }
.intro-illustration svg { width: 100%; height: auto; display: block; }
.empty-illustration { display: block; margin: 0 auto 0.5rem; max-width: 170px; }
.empty-illustration svg { width: 100%; height: auto; display: block; }
.empty p { margin: 0.3rem 0 0; }
.intro-steps li { position: relative; }
.intro-steps li:not(:last-child)::after {
  content: ""; position: absolute; left: 1rem; top: 2.3rem; bottom: -0.9rem;
  width: 2px; background: #bfe3df;
}
.att-icon { display: inline-flex; vertical-align: -0.2rem; margin-right: 0.45rem; color: var(--cta-dark); }
.att-icon svg { width: 1.3rem; height: 1.3rem; }

/* v2.3.0: guided walkthrough, flow progress, hide-until-chosen
   sections, plain-language "?" help, worked example, compact home
   header. Same palette as v2.2.0 (deep teal, warm amber CTA only). */
.intro-one { display: flex; gap: 0.85rem; align-items: flex-start; margin: 1.1rem 0 0.4rem; }
.intro-one h2 { font-size: 1.15rem; margin: 0 0 0.15rem; }
.intro-one p { margin: 0; color: var(--muted); }
.intro-num-big { width: 2.4rem; height: 2.4rem; font-size: 1.2rem; }
.intro-step-label { text-align: center; color: var(--muted); font-size: 0.95rem; margin: 0.6rem 0 0; }
.intro-dots { display: flex; gap: 0.5rem; justify-content: center; margin: 1.1rem 0 0.2rem; }
.intro-dot {
  width: 0.85rem; height: 0.85rem; border-radius: 50%; padding: 0;
  background: var(--surface); border: 2px solid var(--accent); min-height: 0;
}
.intro-dot.current { background: var(--accent); }
.flow-progress { margin: 0.2rem 0 0.9rem; }
.flow-progress-label { font-size: 0.95rem; font-weight: 700; color: var(--accent-dark); }
/* Wizard navigation (v2.5.0): Back / Next between the flow's steps.
   Sticky at the bottom of the screen so the user never has to scroll
   back up to move on; one step fits on a phone screen. */
.wizard-nav { display: flex; gap: 0.75rem; margin: 1rem 0 0.5rem; position: sticky; bottom: 0.5rem; z-index: 5; }
.wizard-nav .primary { flex: 1; }
.wizard-nav span { flex: 1; }
/* Missing letter fields (v2.5.0): a warm warning under the letter
   preview, listing what to fill in and jumping to the right step. */
.missing-prompt { background: var(--warn-bg); border: 1px solid var(--cta-dark); border-radius: var(--radius); padding: 0.7rem 0.8rem; color: var(--warn-text); font-weight: 600; }
.missing-prompt .chip { margin-left: 0.4rem; }
.flow-progress-track {
  height: 0.45rem; border-radius: 999px; background: #dfe9e7;
  margin-top: 0.35rem; overflow: hidden;
}
.flow-progress-bar {
  height: 100%; width: 0; border-radius: 999px;
  background: var(--accent); transition: width 0.25s ease;
}
.more-section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); margin: 0.9rem 0; box-shadow: var(--shadow-sm);
}
.more-section summary {
  display: flex; align-items: center; justify-content: space-between; gap: 0.6rem;
  padding: 0.85rem 1.1rem; min-height: 2.9rem; cursor: pointer;
  font-weight: 700; list-style: none;
}
.more-section summary::-webkit-details-marker { display: none; }
.more-section .more-title { color: var(--text); }
.more-section .more-toggle { color: var(--accent-dark); font-weight: 700; white-space: nowrap; }
.more-section .more-close-label { display: none; }
.more-section[open] .more-close-label { display: inline; }
.more-section[open] .more-open-label { display: none; }
.more-body { padding: 0 1.1rem 1rem; }
.more-body h3 { margin-top: 0.9rem; }
.more-inline { margin: 0.6rem 0; }
.more-inline summary {
  cursor: pointer; color: var(--accent-dark); font-weight: 700;
  padding: 0.5rem 0; min-height: 2.4rem; list-style: none;
}
.more-inline summary::-webkit-details-marker { display: none; }
.more-inline .more-close-label { display: none; }
.more-inline[open] .more-close-label { display: inline; }
.more-inline[open] .more-open-label { display: none; }
.term-help {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.5rem; height: 1.5rem; border-radius: 50%; padding: 0;
  background: var(--accent-soft); border: 1.5px solid var(--accent);
  color: var(--accent-dark); font-weight: 800; font-size: 0.95rem;
  vertical-align: 0.1rem; margin-left: 0.3rem; min-height: 0;
}
.term-help-text {
  display: block; font-weight: 400; font-size: 0.95rem;
  background: var(--info-bg); border: 1px solid #a8d8d5; border-radius: 8px;
  padding: 0.7rem 0.9rem; margin: 0.5rem 0 0.2rem;
}
.sample-badge { background: var(--accent-soft); color: var(--accent-dark); border: 1px solid var(--accent); font-weight: 700; }
.sample-note {
  background: var(--info-bg); border: 1px solid #a8d8d5; border-radius: 8px;
  padding: 0.8rem 1rem; font-size: 0.95rem;
}

/* v2.3.0: compact home header on a phone (390px) — the first problem
   card starts high on screen instead of below a tall hero. TradeDesk
   Jobs-tab lesson: the header must stay compact so content starts
   high. Desktop keeps the roomier hero. */
@media (max-width: 560px) {
  main { padding: 0.6rem 0.8rem 4rem; }
  .topbar { padding: 0.4rem 0.8rem 0.45rem; }
  .topbar nav button { padding: 0.35rem 0.7rem; min-height: 2.2rem; }
  .hero { padding: 0.7rem 0.9rem 0.6rem; margin: 0.3rem 0 0.7rem; }
  .hero h1 { font-size: 1.5rem; }
  .hero-sub { font-size: 0.95rem; }
  .hero p { margin-top: 0.4rem; }
  .hero-mark { width: 2.4rem; height: 2.4rem; font-size: 0.95rem; }
  #search { margin-top: 0.4rem; }
  .chips { margin: 0.5rem 0; }
}

/* v2.5.3: transitions — the screen comes alive, but stays professional.
   Quick (150–250ms), subtle: a slide + fade between wizard steps
   (forward from the right, back from the left), a gentle fade for a
   new view, a staggered slide-in for the home problem cards, an
   animated progress bar (already 0.25s, kept), soft press feedback on
   buttons, and a fade when a "Show more" section opens. Nothing
   bounces, nothing spins, nothing is playful — this is an app for
   people in difficulty, and the motion must feel calm, not clever. */
@keyframes view-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes step-fwd { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: translateX(0); } }
@keyframes step-back { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: translateX(0); } }
@keyframes card-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
/* A new view fades in once (opacity only — no transform, so the sticky
   top bar and the sticky wizard bar keep working while it plays). */
main { animation: view-in 0.2s ease both; }
/* Wizard step: the wrapper is re-created on every step change, so the
   slide runs exactly when the step changes and never on other redraws
   (ticking a box, typing) — draw() only adds the class when the step
   actually moved (state.stepDir). The Back/Next bar stays outside the
   wrapper, so it never slides with the step. */
.wizard-step-fwd { animation: step-fwd 0.22s ease both; }
.wizard-step-back { animation: step-back 0.22s ease both; }
/* Home cards: staggered slide-in, only on the first draw after
   navigating home (renderHome adds .cards-enter once; search and
   category taps re-draw the list without it, so typing never
   re-animates the cards). */
.cards-enter > .problem { animation: card-in 0.25s ease both; }
.cards-enter > .problem:nth-child(2) { animation-delay: 0.03s; }
.cards-enter > .problem:nth-child(3) { animation-delay: 0.06s; }
.cards-enter > .problem:nth-child(4) { animation-delay: 0.09s; }
.cards-enter > .problem:nth-child(5) { animation-delay: 0.12s; }
.cards-enter > .problem:nth-child(6) { animation-delay: 0.15s; }
.cards-enter > .problem:nth-child(n+7) { animation-delay: 0.18s; }
/* "Show more" sections fade their body in when opened (a <details>
   cannot animate its height in plain CSS, so the fade is the smooth
   part — the toggle itself is instant, the content arrives softly). */
.more-section[open] .more-body { animation: fade-in 0.18s ease both; }
.more-inline[open] > :not(summary) { animation: fade-in 0.18s ease both; }
/* Soft press feedback on buttons: a quick shrink + colour change, so a
   tap feels answered. .problem keeps its own hover transition. */
.primary, .secondary, .big, .chip, .topbar nav button, .font-quick button, .intro-dot {
  transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.secondary:active, .big:active, .chip:active { transform: scale(0.97); }
/* v2.5.3: the sticky Back/Next bar must never hide content. The bar
   is now an opaque floating card (text scrolling underneath can no
   longer show through it), and the flow body has roomy bottom padding
   so that, scrolled to the very bottom, the last content sits fully
   above the bar — the bar un-sticks and scrolls up with the page.
   This is the fix for the owner's screenshot, where the "Dalej →"
   button covered the "Pomagam komuś innemu" text. */
#flow-body { padding-bottom: 5rem; }
.wizard-nav {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 0.5rem; box-shadow: var(--shadow);
  bottom: 0.75rem;
}
/* v2.5.3: reduced motion — with prefers-reduced-motion on, every
   transition and animation is effectively instant (no movement at
   all), exactly like the badge-celebration rule: motion is an
   enhancement, never a requirement. This is the app-wide rule; no
   earlier version of the app had one in code (the celebration rule
   lived only in the plan). */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- v2.6.1: crisis mode — big tap targets, minimal reading ---------- */
.crisis .crisis-call { font-size: 1.4rem; padding: 1.2rem; text-align: center; text-decoration: none; }
.big-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.7rem; }
.big-links a { display: block; padding: 1rem 1.1rem; font-size: 1.15rem; font-weight: 700; color: var(--ink); background: var(--tint); border: 2px solid var(--teal); border-radius: 12px; text-decoration: none; }
.big-links a:active { transform: scale(0.98); }
