/* Helper site V2. Base: gemini-4-argon draft (design_round2), reworked by WS-5. Surface palette is this site's own; shared tokens are in tokens.css. */
:root {
  color-scheme: light dark;
  --bg-main: #eef2f0;
  --bg-surface: #f8faf9;
  --bg-elevated: #ffffff;
  --ink-primary: #10211b;
  --ink-secondary: #3b5249;
  --ink-muted: #566d63;
  --border-line: #cbd6d0;
  --border-strong: #10211b;
  --stamp-red: var(--accent);
  --stamp-red-bg: #fbeae7;
  --status-done-green: #1b6344;
  --status-done-bg: #e1f2ea;
  --warning-bg: #fff6e5;
  --warning-border: #d9822b;
  --warning-ink: #6e3b06;
  --focus-ring: #1b5fd1;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-main: #0d1512;
    --bg-surface: #15201c;
    --bg-elevated: #1c2a25;
    --ink-primary: #e6f0ec;
    --ink-secondary: #a5bdb3;
    --ink-muted: #8ba499;
    --border-line: #283a33;
    --border-strong: #627d72;
    --stamp-red-bg: #381915;
    --status-done-green: #4cd49c;
    --status-done-bg: #123023;
    --warning-bg: #2b2112;
    --warning-border: #d98e32;
    --warning-ink: #f7d5a8;
    --focus-ring: #7fb0ff;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 17px; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
body { margin: 0; font-family: var(--font-sans); background: var(--bg-main); color: var(--ink-primary); line-height: 1.65; -webkit-font-smoothing: antialiased; }
.mono-num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; unicode-bidi: isolate; }
.counter-badge .mono-num { direction: ltr; }

.skip-link { position: absolute; top: -100px; right: 1rem; background: var(--ink-primary); color: var(--bg-elevated); padding: 0.6rem 1.1rem; font-weight: 700; text-decoration: none; z-index: 999; border: 2px solid var(--focus-ring); }
.skip-link:focus { top: 1rem; }
:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }

.container { width: 100%; max-width: 960px; margin: 0 auto; padding-left: max(1.15rem, env(safe-area-inset-left, 0px)); padding-right: max(1.15rem, env(safe-area-inset-right, 0px)); }

/* header */
.site-header { border-bottom: var(--rule-mid) solid var(--border-strong); background: var(--bg-surface); padding: var(--space-3) 0; }
.header-inner { display: flex; flex-direction: column; gap: var(--space-2); }
.brand { display: flex; align-items: center; gap: var(--space-2); font-weight: 800; font-size: var(--step-1); text-decoration: none; color: inherit; }
.brand-mark { width: 1.7rem; height: 1.7rem; border: var(--rule-strong) solid var(--accent); border-radius: 50%; display: block; position: relative; flex: none; }
.brand-mark::after { content: ""; position: absolute; inset: 0.28rem; border: var(--rule-mid) solid var(--accent); border-radius: 50%; }
.site-nav { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.site-nav a { color: var(--ink-primary); text-decoration: none; font-weight: 600; font-size: var(--step--1); padding: 0.2rem 0; border-bottom: var(--rule-mid) solid transparent; }
.site-nav a:hover { border-bottom-color: var(--accent); }

/* hero: open, no box */
.hero { padding: var(--space-5) 0 var(--space-4); display: grid; gap: var(--space-3); }
.hero h1 { margin: 0; font-size: var(--step-4); font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; text-wrap: balance; }
.hero h1 span { display: block; color: var(--status-done-green); }
.hero-lead { margin: 0; font-size: var(--step-1); color: var(--ink-secondary); max-width: 40rem; }
.hero-cta { justify-self: start; text-decoration: none; display: inline-block; }

/* sections */
.ledger-section { background: var(--bg-surface); border: var(--rule-hair) solid var(--border-line); border-top: var(--rule-strong) solid var(--border-strong); margin-top: var(--space-4); padding: var(--space-4) 1.15rem; }
.section-header { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-3); flex-wrap: wrap; border-bottom: var(--rule-hair) solid var(--border-line); padding-bottom: var(--space-2); margin-bottom: var(--space-2); }
.section-header .num-label { color: var(--ink-muted); margin-bottom: 0.15rem; }
.section-header h2 { margin: 0; font-size: var(--step-3); font-weight: 800; line-height: 1.25; text-wrap: balance; }
.section-desc { margin: 0 0 var(--space-4); color: var(--ink-secondary); max-width: 42rem; }

/* checklist */
.counter-badge { background: var(--bg-elevated); border: var(--rule-hair) solid var(--border-strong); padding: 0.35rem 0.75rem; font-size: var(--step--1); display: inline-flex; align-items: center; gap: 0.45rem; }
.ledger-table { border: var(--rule-hair) solid var(--border-strong); background: var(--bg-elevated); }
.ledger-row + .ledger-row { border-top: var(--rule-hair) solid var(--border-line); }
.row-toggle { width: 100%; background: transparent; border: none; color: inherit; font: inherit; text-align: start; padding: var(--space-3) 0.9rem; display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 0.85rem; cursor: pointer; transition: background-color 0.15s ease; }
.row-toggle:hover { background: var(--bg-surface); }
.row-num { font-size: var(--step--1); color: var(--ink-muted); }
.row-box { width: 1.45rem; height: 1.45rem; border: var(--rule-mid) solid var(--border-strong); background: var(--bg-elevated); display: inline-flex; align-items: center; justify-content: center; color: transparent; }
.row-box svg { width: 1rem; height: 1rem; }
.row-text { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.row-title { font-weight: 700; }
.row-sub { font-size: var(--step--1); color: var(--ink-secondary); }
.stamp-box { min-width: 4.2rem; text-align: center; }
.stamp-mark { display: inline-block; font-family: var(--font-mono); font-weight: 800; font-size: var(--step--1); padding: 0.1rem 0.55rem; border: var(--rule-mid) solid var(--stamp-red); color: var(--stamp-red); background: var(--stamp-red-bg); transform: rotate(-4deg); opacity: 0; }
.ledger-row.is-completed { background: var(--status-done-bg); }
.ledger-row.is-completed .row-box { background: var(--status-done-green); border-color: var(--status-done-green); color: var(--bg-elevated); }
.ledger-row.is-completed .row-title { text-decoration: line-through; color: var(--ink-secondary); }
.ledger-row.is-completed .stamp-mark { opacity: 1; }
.ledger-actions { margin-top: var(--space-3); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--space-2); }
.all-done-stamp { font-family: var(--font-mono); font-weight: 800; color: var(--stamp-red); background: var(--stamp-red-bg); border: var(--rule-mid) solid var(--stamp-red); padding: 0.25rem 0.75rem; transform: rotate(-2deg); }

/* guides: three over two, no orphan card */
.status-pill-prep, .status-pill-demo { font-family: var(--font-mono); font-size: var(--step--1); background: var(--bg-elevated); border: var(--rule-hair) solid var(--border-strong); padding: 0.25rem 0.65rem; }
.guides-grid { display: grid; gap: var(--space-3); grid-template-columns: minmax(0, 1fr); }
.guide-card { background: var(--bg-elevated); border: var(--rule-hair) solid var(--border-strong); padding: 1.1rem; display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; }
.guide-card-top { display: flex; justify-content: space-between; align-items: center; }
.guide-idx { font-size: var(--step--1); color: var(--ink-muted); }
.stamp-prep { font-family: var(--font-mono); font-size: var(--step--1); font-weight: 700; color: var(--warning-ink); background: var(--warning-bg); border: var(--rule-hair) solid var(--warning-border); padding: 0.1rem 0.5rem; }
.guide-card h3 { margin: 0; font-size: var(--step-1); font-weight: 800; line-height: 1.3; }
.guide-card p { margin: 0; font-size: var(--step--1); color: var(--ink-secondary); }

/* VAT calculator */
.stamp-unverified { font-family: var(--font-mono); font-size: var(--step--1); font-weight: 700; color: var(--stamp-red); background: var(--stamp-red-bg); border: 1.5px solid var(--stamp-red); padding: 0.25rem 0.65rem; }
.calc-grid { display: grid; gap: var(--space-3); }
.calc-rate-box { background: var(--bg-elevated); border: var(--rule-hair) solid var(--border-strong); padding: var(--space-3); }
.rate-label-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.5rem; }
.rate-label-row label { font-weight: 700; }
.badge-warning { font-family: var(--font-mono); font-size: var(--step--1); font-weight: 700; background: var(--warning-bg); color: var(--warning-ink); border: var(--rule-hair) solid var(--warning-border); padding: 0.15rem 0.5rem; }
.mono-input { width: 100%; font-family: var(--font-mono); font-size: var(--step-1); font-weight: 700; padding: 0.6rem 0.75rem; border: var(--rule-mid) solid var(--border-strong); background: var(--bg-surface); color: var(--ink-primary); direction: ltr; text-align: right; }
.rate-input { max-width: 220px; }
.field-hint { margin: 0.4rem 0 0; font-size: var(--step--1); color: var(--ink-muted); display: block; }
.calc-inputs-box { display: grid; gap: 0.85rem; align-items: center; background: var(--bg-elevated); border: var(--rule-hair) solid var(--border-line); padding: var(--space-3); }
.input-group label { display: block; font-weight: 700; margin-bottom: 0.4rem; }
.calc-direction-indicator { text-align: center; font-size: var(--step-2); color: var(--ink-muted); }
.calc-summary { background: var(--bg-elevated); border: var(--rule-mid) solid var(--border-strong); padding: var(--space-3); }
.summary-row { display: flex; justify-content: space-between; gap: var(--space-3); padding: 0.4rem 0; border-bottom: 1px dashed var(--border-line); }
.summary-row.total-row { border-bottom: none; border-top: var(--rule-mid) solid var(--border-strong); margin-top: 0.35rem; padding-top: 0.65rem; font-size: var(--step-1); }
.calc-note { margin: 0.75rem 0 0; font-size: var(--step--1); color: var(--ink-secondary); }

/* requests demo */
.warning-banner { background: var(--warning-bg); border: 1.5px solid var(--warning-border); color: var(--warning-ink); padding: 0.85rem 1rem; margin-bottom: var(--space-3); font-size: var(--step--1); }
.request-form { background: var(--bg-elevated); border: var(--rule-hair) solid var(--border-strong); padding: 1.15rem; display: grid; gap: var(--space-3); }
.form-field label { display: block; font-weight: 700; margin-bottom: 0.4rem; }
.form-field input, .form-field textarea { width: 100%; font: inherit; padding: 0.6rem 0.75rem; border: 1.5px solid var(--border-strong); background: var(--bg-surface); color: var(--ink-primary); }
.btn-primary, .btn-secondary { font: inherit; font-weight: 700; cursor: pointer; padding: 0.65rem 1.2rem; border: var(--rule-mid) solid var(--border-strong); }
.btn-primary { background: var(--ink-primary); color: var(--bg-elevated); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-secondary { background: var(--bg-elevated); color: var(--ink-primary); }
.btn-secondary:hover { background: var(--bg-main); }
.form-feedback { padding: 0.85rem 1rem; font-weight: 700; border: var(--rule-mid) solid var(--border-strong); }
.form-feedback.is-success { background: var(--status-done-bg); border-color: var(--status-done-green); }
.form-feedback.is-error { background: var(--stamp-red-bg); border-color: var(--stamp-red); }

/* footer */
.site-footer { margin-top: var(--space-6); background: var(--bg-surface); border-top: var(--rule-strong) solid var(--border-strong); padding: var(--space-5) 0; }
.legal-box { border: var(--rule-hair) solid var(--border-line); background: var(--bg-elevated); padding: var(--space-3) 1.15rem; }
.legal-stamp { display: inline-block; font-family: var(--font-mono); font-size: var(--step--1); font-weight: 800; color: var(--stamp-red); border: 1.5px solid var(--stamp-red); padding: 0.1rem 0.5rem; margin-bottom: 0.5rem; }
.legal-text { margin: 0; font-size: var(--step--1); color: var(--ink-secondary); max-width: 46rem; }

@media (min-width: 700px) {
  .header-inner { flex-direction: row; justify-content: space-between; align-items: center; }
  .ledger-section { padding: 1.85rem 2rem; }
  .calc-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .calc-rate-box { grid-column: 1; grid-row: 1; }
  .calc-inputs-box { grid-column: 1; grid-row: 2; }
  .calc-direction-indicator { display: none; }
  .calc-summary { grid-column: 2; grid-row: 1 / span 2; align-self: stretch; }
  .guides-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .guides-grid .guide-card:last-child { grid-column: 1 / -1; }
}
@media (min-width: 900px) {
  .guides-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .guides-grid .guide-card { grid-column: span 2; }
  .guides-grid .guide-card:nth-child(4), .guides-grid .guide-card:nth-child(5) { grid-column: span 3; }
}
