/* Segmo — v15 design refresh (direction "D": refined monochrome fintech).
   Single hand-rolled stylesheet. Self-hosted Geist + Geist Mono; existing
   monochrome token palette refined; money green/red only on real P/L.

   Section order:
     @font-face · tokens · reset · base/typography · buttons · NAV · demo
     banner · FOOTER · tables/money · forms · warn/notice · details · old
     app chrome (sticky-bulk, onboarding) · OLD marketing surface (kept for
     templates not yet ported — deleted in Phase 4) · NEW marketing
     components (body.marketing) · auth · NEW app components (body.app) ·
     motion · misc.

   Light-mode only; dark deferred. The palette is centralised in :root so a
   future `@media (prefers-color-scheme: dark)` flips ~12 token values. The
   prototype token names (--ink/--muted/--faint/--line/--surface-2) are kept
   as aliases of the canonical names so the ported D rules read verbatim.

   Budget: this file is intentionally ~950 lines (the v15 redesign grew it from
   the old ~525). It now carries the whole design system; a further split
   (tokens.css + components.css) is the next step only if it passes ~1200. */


/* === @font-face ======================================================== */
/* Geist (text, incl. wordmark) + Geist Mono (money/numbers). latin +
   latin-ext (German ä/ö/ü/ß). Self-hosted under /static/fonts — never from
   gstatic (CSP font-src 'self' would block external). */

@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/geist-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/geist-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/static/fonts/geist-500-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/static/fonts/geist-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/static/fonts/geist-600-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/static/fonts/geist-600-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/static/fonts/geist-700-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/static/fonts/geist-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/geist-mono-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/geist-mono-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/static/fonts/geist-mono-500-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/static/fonts/geist-mono-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}


/* === tokens ============================================================ */

:root {
  /* canonical palette — refined to the approved "D" values. Dark mode flips
     these (names are stable; the rest of the file reads through them). */
  --bg:             #fafafa;
  --surface:        #ffffff;
  --surface-alt:    #f4f4f5;
  --border:         #e7e7ea;
  --border-strong:  #d9d9de;
  --text:           #0a0a0a;
  --ink-2:          #3f3f46;   /* secondary ink — body copy on cards */
  --text-muted:     #6b6b70;
  --text-faint:     #a3a3a3;
  --gain:           #0f9d6b;   /* deepened #10b981 for AA on white */
  --loss:           #e03131;   /* deepened #ef4444 for AA on white */
  --warn:           #d97706;
  --warn-wash:      #fff7ed;
  --accent:         #0a0a0a;
  --accent-fg:      #ffffff;

  /* prototype aliases → canonical (so the ported D rules read verbatim;
     flipping the canonical tokens above flips these too) */
  --ink:        var(--text);
  --muted:      var(--text-muted);
  --faint:      var(--text-faint);
  --line:       var(--border);
  --line-2:     var(--border-strong);
  --surface-2:  var(--surface-alt);

  /* type families */
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* layout + shape */
  --maxw:     1280px;   /* marketing/funnel container */
  --maxw-app: 1400px;   /* app surface (nav + content + footer line up) */
  --pad:  clamp(1.1rem, 4vw, 2rem);
  --r-sm: 8px;
  --r:    12px;
  --r-lg: 16px;
  --r-pill: 999px;
  --shadow-sm: 0 1px 0 rgba(10,10,10,.02);
  --shadow:    0 18px 40px -26px rgba(10,10,10,.28);
  --shadow-lg: 0 30px 60px -32px rgba(10,10,10,.28);

  /* Root stays 16px so every rem-based size/space matches the prototype, which
     left the root at the browser default and only dropped the *text* to 15px on
     app pages (body.app below). Putting 15px here shrank every rem ~6%. */
  font-size: 16px;
  color-scheme: light;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}


/* === reset ============================================================= */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }


/* === base / typography ================================================= */

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.55;
  letter-spacing: -0.011em;
  /* Sticky footer: header/main/footer are direct flex children of <body>
     (no content wrapper). main grows to fill, pinning .foot to the bottom on
     short pages (waitlist/empty inbox). main's own margin-inline:auto still
     centres it in the cross axis (auto cross-margins beat align-items:stretch). */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
/* App surface runs one notch denser (15px text); marketing/funnel/auth/legal
   stay at the 16px body default. rem is 16px everywhere (root above). */
body.app { font-size: 15px; }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

main { display: block; }
/* Transitional + app default content frame: a centred column aligned with the
   nav/footer wrap. Marketing overrides to full-bleed (its sections wrap
   themselves); app widens to --maxw-app. */
main {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 1.6rem var(--pad) 4rem;
  /* Sticky footer: grow to fill, with a DEFINITE width. width:100% is
     load-bearing — as a flex item, margin-inline:auto disables align stretch,
     so without an explicit width main shrinks to fit-content (indefinite), and
     `repeat(auto-fill, minmax(.., 1fr))` grids + width:100% tables then collapse
     to one narrow column. width:100% (border-box) + max-width keeps it capped
     and centred while staying definite. */
  flex: 1 0 auto;
  width: 100%;
}
/* Opt-in vertical centring for short funnel/auth pages (waitlist, login,
   signup, demo interstitial, …) so their content sits mid-viewport instead of
   floating at the top above a pinned footer. `safe` falls back to top-alignment
   if the content is taller than the viewport (no cut-off). */
main.centered { display: flex; flex-direction: column; justify-content: safe center; }
body.app main    { max-width: var(--maxw-app); }
body.marketing main { max-width: none; margin: 0; padding: 0; }

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.02em; line-height: 1.18; text-wrap: balance; }
h1 { font-size: 1.6rem;   margin: 1.4rem 0 1rem; }
h2 { font-size: 1.2rem;   margin: 1.8rem 0 0.8rem; }
h3 { font-size: 1.02rem;  margin: 1.25rem 0 0.5rem; }
h1:first-child, h2:first-child, h3:first-child { margin-top: 0; }

p { margin: 0.55rem 0; text-wrap: pretty; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.4rem 0; }

a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--text-muted);
  text-underline-offset: 2px;
}
a:hover { text-decoration-color: var(--text); }

/* keyboard focus ring (only on keyboard nav, not mouse clicks). Inputs keep
   their own box-shadow ring from the :focus rules below. */
a:focus-visible, button:focus-visible, .btn:focus-visible, summary:focus-visible,
[tabindex]:focus-visible, [data-reveal-upgrade]:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px;
}

strong { font-weight: 600; }
em { font-style: italic; color: var(--text); }
code, pre { font-family: var(--mono); font-size: 0.85em; }
code { background: var(--surface-alt); border: 1px solid var(--border); border-radius: 5px; padding: 0.05rem 0.3rem; }
pre { background: var(--surface-alt); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 0.8rem 1rem; overflow-x: auto; }
pre code { background: none; border: 0; padding: 0; }

/* shared centred container — used by the nav, marketing sections, footer */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad); }
body.app .wrap { max-width: var(--maxw-app); }
.section { padding-block: clamp(3.5rem, 8vw, 6.5rem); }
.eyebrow {
  font-size: 0.74rem; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 1rem;
}


/* === buttons =========================================================== */
/* One .btn system (anchors as CTAs + real <button> POSTs). Replaces the old
   a.btn rules. .btn-ghost kept as a compat alias for templates not yet
   ported (landing.html uses it pre-Phase-2). */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font: inherit; font-weight: 500; font-size: 0.95rem;
  padding: 0.72rem 1.25rem; border-radius: 10px;
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  white-space: nowrap;
  transition: transform .12s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-primary:hover { box-shadow: 0 6px 22px -10px rgba(10,10,10,.55); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn-secondary:hover { border-color: var(--ink); }
/* Destructive actions (delete import, etc.) — red affordance off the --loss token. */
.btn-danger, .btn-sm.btn-danger { background: var(--surface); color: var(--loss); border-color: var(--loss); }
.btn-danger:hover, .btn-sm.btn-danger:hover { background: var(--loss); color: #fff; border-color: var(--loss); }
/* Waitlist fake-door capture form on /pricing: email field + button inline. */
.waitlist-form { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.5rem; }
.waitlist-form input[type=email] { flex: 1 1 12rem; padding: 0.5rem 0.7rem; border: 1px solid var(--line-2); border-radius: 9px; font: inherit; }
.btn-text  { padding: 0.72rem 0.4rem; color: var(--muted); background: transparent; }
.btn-text:hover { color: var(--ink); }
.btn-ghost { background: transparent; color: var(--muted); border-color: transparent; }  /* compat */
.btn-ghost:hover { color: var(--ink); }
.btn-lg { padding: 0.85rem 1.5rem; font-size: 1rem; border-radius: 11px; }
.arrow { transition: transform .15s ease; display: inline-block; }
.btn:hover .arrow { transform: translateX(2px); }

/* bare <button> (POST controls in the app: assign, save, logout-as-form…).
   App pages restyle these smaller via body.app below. */
button {
  font: inherit;
  font-weight: 500;
  background: var(--accent);
  color: var(--accent-fg);
  border: 1px solid var(--accent);
  border-radius: var(--r-sm);
  padding: 0.4rem 0.85rem;
  cursor: pointer;
  margin: 0.15rem 0;
  line-height: 1.25;
  white-space: nowrap;
  min-width: 7rem;
  transition: opacity .12s ease, transform .08s ease;
}
button:hover { opacity: 0.9; }
button:active { transform: translateY(1px); }
button strong { font-weight: 600; }


/* === NAV (shared shell, every page) ==================================== */

.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { position: relative; display: flex; align-items: center; gap: 1rem; height: 60px; }
.brand {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-weight: 600; font-size: 1.1rem; letter-spacing: -0.02em;
  margin-right: auto; text-decoration: none; color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand img, .brand .brand-mark { width: 26px; height: 26px; display: block; border-radius: 7px; }

.nav-links { display: flex; align-items: center; gap: 0.4rem; }
/* Style only plain nav links — never .btn (whose white-on-black would lose to
   this grey, since .nav-links > a out-ranks .btn-primary). */
.nav-links > a:not(.btn) {
  padding: 0.45rem 0.7rem; border-radius: var(--r-sm);
  font-size: 0.92rem; color: var(--ink-2); font-weight: 500; text-decoration: none;
}
.nav-links > a:not(.btn):hover { color: var(--ink); background: var(--surface-2); text-decoration: none; }
.nav-links > a.active { color: var(--ink); font-weight: 600; }

/* logged-in extras: email + logout-as-form (a <button>, styled to read as a
   nav link so the global filled-button rule never reaches it) */
.nav-links .nav-user { color: var(--faint); font-size: 0.85rem; white-space: nowrap; }
.nav-links form { margin: 0; display: inline-flex; }
.nav-links form button {
  font: inherit; font-weight: 500; font-size: 0.92rem; color: var(--ink-2);
  background: none; border: 0; min-width: 0; margin: 0;
  padding: 0.45rem 0.7rem; cursor: pointer; border-radius: var(--r-sm);
}
.nav-links form button:hover { color: var(--ink); background: var(--surface-2); opacity: 1; }

/* language toggle (DE · EN) — lives inside .nav-links so it works collapsed too */
.lang {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.82rem; color: var(--faint);
  margin-left: 0.35rem; padding-left: 0.7rem; border-left: 1px solid var(--line);
}
.lang a { color: var(--faint); text-decoration: none; }
.lang a:hover { color: var(--ink-2); }
.lang a.on { color: var(--ink); font-weight: 600; }

/* CSS-only mobile menu: <summary> (a segment-bar "hamburger") toggles the
   .nav-links sibling. No JS → CSP script-src 'self' stays clean. */
.menu { display: none; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }

@media (max-width: 820px) {
  .menu { display: inline-flex; }
  .menu > summary {
    display: inline-flex; flex-direction: column; gap: 4px; justify-content: center;
    width: 42px; height: 38px; padding: 9px 8px;
    border: 1px solid var(--line-2); border-radius: 9px; background: var(--surface);
  }
  .menu > summary span { height: 2px; border-radius: 2px; background: var(--ink); display: block; }
  .menu > summary span:nth-child(1) { width: 60%; }
  .menu > summary span:nth-child(2) { width: 100%; }
  .menu > summary span:nth-child(3) { width: 42%; }
  .nav-links {
    display: none;
    position: absolute; right: 0; top: calc(100% + 10px);
    flex-direction: column; align-items: stretch; gap: 0.15rem;
    background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
    padding: 0.5rem; min-width: 220px; box-shadow: var(--shadow-lg); z-index: 60;
  }
  .menu[open] ~ .nav-links { display: flex; }
  .nav-links > a:not(.btn) { padding: 0.6rem 0.75rem; }
  .nav-links .nav-user { padding: 0.4rem 0.75rem; }
  .nav-links form { display: block; }
  .nav-links form button { width: 100%; text-align: left; padding: 0.6rem 0.75rem; }
  .nav-links .btn { margin-top: 0.25rem; }
  .lang { border-left: 0; padding-left: 0.75rem; margin-left: 0; margin-top: 0.3rem; }
}


/* === demo banner ======================================================= */

.demo-banner {
  display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center;
  background: var(--warn-wash); border: 1px solid var(--warn);
  border-radius: var(--r-sm); padding: 0.7rem 1rem; margin: 1rem 0 0;
  font-size: 0.9rem;
}
.demo-banner a { font-weight: 600; }


/* === FOOTER (shared shell) ============================================= */

.foot { border-top: 1px solid var(--line); margin-top: 3rem; }
body.marketing .foot { margin-top: 0; }
.foot-inner {
  display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center;
  padding-block: 2rem; font-size: 0.88rem;
}
.foot .foot-brand { font-size: 1rem; }
.foot .foot-brand img, .foot .foot-brand .brand-mark { width: 22px; height: 22px; }
.foot-nav { display: flex; flex-wrap: wrap; gap: 1rem 1.4rem; }
.foot-nav a { color: var(--muted); text-decoration: none; }
.foot-nav a:hover { color: var(--ink); text-decoration: none; }
.foot .copy { color: var(--faint); margin-left: auto; }
/* Narrow screens: drop the © line onto its own row (the wrap + margin-left:auto
   otherwise crams it beside the nav links). */
@media (max-width: 640px) {
  .foot .copy { flex-basis: 100%; margin-left: 0; }
}
/* Served accuracy/liability disclaimer line under the footer row (plan-v16 §B3).
   No max-width: it sits on one line on desktop (matching the footer row width) and
   wraps naturally on narrow screens. */
.foot-note { color: var(--faint); font-size: 0.78rem; margin: 0; padding-bottom: 2rem; }


/* === tables / money / split / table-scroll ============================= */

table { border-collapse: collapse; border-spacing: 0; margin: 0.5rem 0 1rem; }
table th, table td {
  padding: 0.55rem 0.75rem; border: 0; vertical-align: top; text-align: left;
}
thead tr { border-bottom: 1px solid var(--border-strong); }
thead th {
  font-weight: 600; font-size: 0.68rem; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--text-muted);
  white-space: nowrap; padding-block: 0.55rem;
}
tbody tr { border-bottom: 1px solid var(--border); }
tbody tr:hover { background: var(--surface-alt); }
/* key-value tables (home totals) — left <th> in <tbody> stays normal-cased */
tbody th { font-weight: 500; color: var(--text); font-size: 0.92rem; }

.money {
  text-align: right; font-family: var(--mono);
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum";
  white-space: nowrap;
}
small.split, .split-tag {
  color: var(--text-muted); font-style: italic; font-size: 0.75rem; margin-left: 0.25rem;
}
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0.5rem 0 1rem; }
.table-scroll > table { margin: 0; }


/* === forms ============================================================= */

input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  padding: 0.42rem 0.6rem;
}
select { width: 7rem; padding: 0.4rem 0.7rem; line-height: 1.2; margin: 0.15rem 0; }
input[type="checkbox"] {
  padding: 0; width: 1rem; height: 1rem; vertical-align: middle; accent-color: var(--accent);
}
input[type="file"] { padding: 0.25rem; background: transparent; border: 0; }
input[type="date"] { padding: 0.4rem 0.55rem; }
textarea { font-family: inherit; line-height: 1.5; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(10,10,10,.08);
}
label { font-size: 0.92rem; color: var(--text); }


/* === warn / notice ===================================================== */

section.warn {
  background: var(--warn-wash); border-left: 4px solid var(--warn);
  border-radius: var(--r-sm); padding: 1rem 1.25rem; margin: 1rem 0;
}
section.warn h1, section.warn h2 { margin-top: 0; }

p.warn {
  color: var(--warn); background: var(--warn-wash);
  border-left: 4px solid var(--warn); border-radius: var(--r-sm);
  padding: 0.65rem 0.95rem; margin: 1rem 0;
}
p.notice, .notice {
  background: var(--surface); border-left: 4px solid var(--border-strong);
  border-radius: var(--r-sm); padding: 0.65rem 0.95rem; margin: 1rem 0;
}


/* === details / summary (per-row note edit) ============================= */

details { display: inline-block; margin-left: 0.25rem; }
/* Inline IN-PLACE edit: clicking "edit"/"rename" hides the display name/note and
   shows the input on the same line where the text was — no popover, no float,
   nothing repositioned. On a heading / notes line (horizontal room) nothing
   reflows; a narrow table cell grows downward to fit the field. The display text
   yields its place via :has (progressive — without it the label just stays
   beside the field). Excludes the nav hamburger (.menu) and .newpot. */
details:not(.menu):not(.newpot) > summary { display: inline; }
details[open]:not(.menu):not(.newpot) { display: inline-flex; gap: 0.4rem; align-items: baseline; margin-top: 0; }
details[open]:not(.menu):not(.newpot) > form { display: inline-flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
details[open]:not(.menu):not(.newpot) > form input[type=text] { width: 13rem; max-width: 100%; }
:has(> .ie[open]) > .ie-name { display: none; }
summary {
  cursor: pointer; color: var(--text-muted); font-size: 0.78rem; font-weight: 400;
  list-style: none; text-decoration: underline; text-decoration-color: var(--border-strong);
}
summary::-webkit-details-marker { display: none; }
summary:hover { color: var(--text); text-decoration-color: var(--text); }


/* === old app chrome (sticky-bulk, onboarding) ========================== */
/* Kept for inbox.html / home.html until they're ported in Phase 3. */

.sticky-bulk {
  position: sticky; top: 0; background: var(--bg);
  padding-block: 0.5rem; margin-bottom: 0.5rem; border-bottom: 1px solid var(--border);
  z-index: 10; display: flex; flex-wrap: wrap; justify-content: space-between;
  align-items: center; gap: 1rem;
}
.sticky-bulk form p { margin: 0; }

.getting-started { max-width: 42rem; }
ol.onboarding { padding-left: 1.4rem; margin: 1rem 0; }
ol.onboarding > li { margin: 1.25rem 0; }
ol.onboarding > li > strong { display: block; margin-bottom: 0.35rem; font-size: 1rem; }
ol.csv-steps { padding-left: 1.2rem; margin: 0.4rem 0; }
ol.csv-steps > li { margin: 0.3rem 0; }
.hint { color: var(--text-muted); font-size: 0.85rem; }
details.csv-help { display: block; margin: 0.5rem 0 1rem; }
details.csv-help[open] { margin-top: 0.5rem; }
details.csv-help > summary { font-size: 0.9rem; }


/* === shared marketing leftovers ======================================== */
/* The pre-v15 marketing block was removed in Phase 4 once landing/pricing were
   ported to the body.marketing components below. Two rules survive: a sane
   default `.lede` (always shadowed by a body.marketing-scoped rule where it
   matters) and `.plan-current` (the pricing page's "You're on Premium" line —
   its only rule). */
.lede { font-size: 1.1rem; color: var(--text-muted); }
.plan-current { color: var(--gain); }


/* ======================================================================
   NEW MARKETING COMPONENTS (body.marketing) — direction "D"
   Activated as templates are rebuilt in Phase 2. body.marketing-scoped so
   they never collide with the OLD marketing block above (Phase-1 pages carry
   no body class).
   ====================================================================== */

body.marketing h1, body.marketing h2, body.marketing h3 { line-height: 1.06; }
body.marketing h1 { font-size: clamp(2.3rem, 5.6vw, 4rem); letter-spacing: -0.03em; margin: 0; }
body.marketing h2 { font-size: clamp(1.65rem, 3.4vw, 2.4rem); letter-spacing: -0.025em; margin: 0; }
body.marketing h3 { font-size: 1.02rem; letter-spacing: -0.015em; margin: 0; }
body.marketing p  { margin: 0; }
/* …but the eyebrow keeps its gap to the heading below (the bare `p` reset above
   out-specifies the global `.eyebrow` rule, which the prototype's `p{margin:0}`
   did not). Restore the prototype's 1rem eyebrow→heading gap on every section. */
body.marketing .eyebrow { margin-bottom: 1rem; }

/* HERO */
body.marketing .hero { padding-top: clamp(2.5rem, 6vw, 4.5rem); max-width: none; margin: 0; }
body.marketing .hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
body.marketing .hero h1 { max-width: 13ch; font-size: clamp(2.3rem, 5.6vw, 4rem); }
body.marketing .hero .lede { margin-top: 1.25rem; font-size: clamp(1.05rem, 1.5vw, 1.22rem); color: var(--muted); max-width: 38ch; background: none; border: 0; padding: 0; }
body.marketing .hero .ctas { margin-top: 1.9rem; display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
body.marketing .hero .micro { margin-top: 1.5rem; font-size: 0.85rem; color: var(--faint); display: flex; align-items: center; gap: 0.5rem; }
body.marketing .hero .micro .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--gain); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gain) 18%, transparent); }

/* product mock card */
body.marketing .mock { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 1.4rem 1.4rem 1.1rem; box-shadow: var(--shadow-sm), 0 30px 60px -32px rgba(10,10,10,.28); }
body.marketing .mock-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; }
body.marketing .mock-label { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
body.marketing .mock-total { font-size: 1.9rem; font-weight: 500; letter-spacing: -0.02em; margin-top: 0.25rem; font-family: var(--mono); }
body.marketing .mock-chip { font-size: 0.72rem; color: var(--muted); border: 1px solid var(--line-2); border-radius: 999px; padding: 0.2rem 0.6rem; }
body.marketing .segbar { display: flex; gap: 3px; height: 12px; margin: 1.15rem 0 1.25rem; }
body.marketing .segbar span { border-radius: 4px; display: block; height: 100%; }
body.marketing .segbar .s1 { width: 40%; background: #0a0a0a; }
body.marketing .segbar .s2 { width: 18%; background: #5b5b61; }
body.marketing .segbar .s3 { width: 8%;  background: #9a9aa1; }
body.marketing .segbar .s4 { width: 34%; background: #cfcfd5; }
body.marketing .mock .pot { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0.7rem; padding: 0.62rem 0; border-top: 1px solid var(--line); }
body.marketing .mock .pot:first-of-type { border-top: 0; }
body.marketing .mock .pot .sw { width: 9px; height: 9px; border-radius: 3px; }
body.marketing .mock .pot .nm { font-size: 0.92rem; font-weight: 500; }
body.marketing .mock .pot .meta { color: var(--faint); font-size: 0.78rem; font-weight: 400; }
body.marketing .mock .pot .val { font-size: 0.92rem; text-align: right; font-family: var(--mono); }
body.marketing .mock .pot .pl { font-size: 0.74rem; text-align: right; color: var(--gain); font-family: var(--mono); margin-right: 0.4rem; }
body.marketing .mock .pot .pl.neg { color: var(--loss); }
body.marketing .mock-foot { margin-top: 0.9rem; padding-top: 0.8rem; border-top: 1px dashed var(--line-2); font-size: 0.72rem; color: var(--faint); display: flex; justify-content: space-between; }

@media (max-width: 880px) {
  body.marketing .hero-grid { grid-template-columns: 1fr; gap: 2.4rem; }
  body.marketing .hero h1 { max-width: 18ch; }
  body.marketing .hero .lede { max-width: 46ch; }
  body.marketing .mock { max-width: 460px; }
}

/* HOW IT WORKS */
body.marketing .band-surface { background: var(--surface); border-block: 1px solid var(--line); }
body.marketing .steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.5rem, 4vw, 3rem); margin-top: 2.6rem; padding: 0; list-style: none; }
body.marketing .step .num { font-family: var(--mono); font-size: 0.95rem; color: var(--faint); display: inline-flex; align-items: center; gap: 0.6rem; }
body.marketing .step .num::after { content: ""; flex: 1; height: 1px; background: var(--line); min-width: 1.5rem; }
body.marketing .step h3 { margin: 1rem 0 0.5rem; }
body.marketing .step p { color: var(--muted); font-size: 0.95rem; }
body.marketing .step p code { font-family: var(--mono); font-size: 0.82em; background: var(--surface-2); padding: 0.05rem 0.3rem; border-radius: 4px; color: var(--ink-2); border: 0; }
@media (max-width: 720px) { body.marketing .steps { grid-template-columns: 1fr; gap: 1.8rem; } }

/* FEATURES */
body.marketing .sec-head .lede { margin-top: 0.7rem; color: var(--muted); font-size: 1.05rem; max-width: 46rem; background: none; border: 0; padding: 0; }
body.marketing .features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-top: 2.4rem; }
body.marketing .feat { border: 1px solid var(--line); border-radius: 14px; padding: 1.4rem; background: var(--surface); transition: border-color .15s ease, transform .15s ease; }
body.marketing .feat:hover { border-color: var(--line-2); transform: translateY(-2px); }
body.marketing .feat .ico { display: flex; flex-direction: column; gap: 2.5px; width: 26px; margin-bottom: 0.9rem; }
body.marketing .feat .ico i { height: 3px; border-radius: 2px; background: var(--ink); display: block; }
body.marketing .feat .ico i:nth-child(1) { width: 60%; }
body.marketing .feat .ico i:nth-child(2) { width: 100%; }
body.marketing .feat .ico i:nth-child(3) { width: 42%; }
body.marketing .feat h3 { margin-bottom: 0.4rem; }
body.marketing .feat p { color: var(--muted); font-size: 0.92rem; }
body.marketing .feat .badge { font-size: 0.66rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line-2); border-radius: 999px; padding: 0.12rem 0.5rem; margin-left: 0.4rem; vertical-align: middle; }
@media (max-width: 900px) { body.marketing .features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { body.marketing .features { grid-template-columns: 1fr; } }

/* TRUST / PRIVACY STRIP */
body.marketing .trust { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; background: none; border: 0; padding: 0; margin: 0; font-size: inherit; }
body.marketing .trust .card { border: 1px solid var(--line); border-radius: 14px; padding: 1.5rem 1.6rem; background: var(--surface); }
body.marketing .trust .card .k { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
body.marketing .trust .card p { margin-top: 0.55rem; color: var(--ink-2); font-size: 0.98rem; }
@media (max-width: 640px) { body.marketing .trust { grid-template-columns: 1fr; } }

/* PRICING TEASER (landing) + plan cards */
body.marketing .plans { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.1rem; margin-top: 2.4rem; max-width: 760px; }
/* The teaser div is `.wrap pricing-teaser`; keep the .wrap 1280 cap (don't widen
   past the other sections) but lay the inner two columns out as a grid. The
   explicit max-width re-asserts --maxw over the dead OLD `.pricing-teaser`
   (46rem) rule below until Phase 4 removes it. */
body.marketing .pricing-teaser { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; max-width: var(--maxw); margin-inline: auto; }
body.marketing .pricing-teaser .sec-head .lede { margin-top: 0.7rem; color: var(--muted); font-size: 1.05rem; }
body.marketing .pricing-teaser .plans { margin-top: 0; max-width: none; }
@media (max-width: 880px) {
  body.marketing .pricing-teaser { grid-template-columns: 1fr; gap: 1.8rem; }
  body.marketing .pricing-teaser .plans { margin-top: 0; }
}
body.marketing .plan { border: 1px solid var(--line); border-radius: 16px; padding: 1.6rem 1.7rem; background: var(--surface); display: flex; flex-direction: column; }
body.marketing .plan.feat { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); position: relative; transform: none; }
body.marketing .plan.feat:hover { transform: none; }
body.marketing .plan .tag { position: absolute; top: -0.7rem; right: 1.3rem; background: var(--ink); color: #fff; font-size: 0.66rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; padding: 0.22rem 0.6rem; border-radius: 999px; }
body.marketing .plan .pname { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
/* Plan prices use Geist sans (matches the approved prototype) — Geist Mono is
   reserved for the mock total, KPIs and table figures, not the marquee price. */
body.marketing .plan .price { margin: 0.6rem 0 0.1rem; font-size: 2.2rem; font-weight: 500; letter-spacing: -0.03em; }
body.marketing .plan .price small { font-size: 0.95rem; color: var(--muted); font-weight: 400; letter-spacing: 0; }
body.marketing .plan .note { font-size: 0.8rem; color: var(--faint); min-height: 1.1rem; }
body.marketing .plan ul { list-style: none; margin: 1.2rem 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }
body.marketing .plan li { font-size: 0.92rem; color: var(--ink-2); display: flex; gap: 0.6rem; align-items: flex-start; padding: 0; border: 0; }
body.marketing .plan .btn { margin-top: auto; }
body.marketing .tick { width: 17px; height: 17px; flex: none; margin-top: 1px; }
@media (max-width: 640px) { body.marketing .plans { grid-template-columns: 1fr; } }

/* FINAL CTA — dark full-bleed closer */
body.marketing .cta-dark { background: var(--ink); color: #fff; text-align: center; position: relative; overflow: hidden; }
body.marketing .cta-dark::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(120% 80% at 50% -20%, rgba(255,255,255,.10), transparent 60%),
    repeating-linear-gradient(90deg, rgba(255,255,255,.04) 0 1px, transparent 1px 64px);
  pointer-events: none;
}
body.marketing .cta-dark .wrap { position: relative; }
body.marketing .cta-dark .seg { display: inline-flex; flex-direction: column; gap: 5px; align-items: center; margin-bottom: 1.6rem; }
body.marketing .cta-dark .seg i { height: 5px; border-radius: 3px; background: #fff; display: block; opacity: .9; }
body.marketing .cta-dark .seg i:nth-child(1) { width: 34px; }
body.marketing .cta-dark .seg i:nth-child(2) { width: 58px; }
body.marketing .cta-dark .seg i:nth-child(3) { width: 24px; }
body.marketing .cta-dark h2 { color: #fff; font-size: clamp(1.9rem, 4vw, 3rem); }
body.marketing .cta-dark p { color: rgba(255,255,255,.62); margin-top: 0.9rem; font-size: 1.05rem; }
body.marketing .cta-dark .ctas { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 0.7rem; justify-content: center; }
body.marketing .cta-dark .btn-secondary { background: transparent; color: #fff; border-color: rgba(255,255,255,.28); }
body.marketing .cta-dark .btn-secondary:hover { border-color: #fff; background: rgba(255,255,255,.06); }
body.marketing .cta-dark .btn-primary { background: #fff; color: var(--ink); border-color: #fff; }
body.marketing .cta-dark .btn-primary:hover { box-shadow: 0 8px 30px -10px rgba(255,255,255,.4); }

/* FULL PRICING PAGE */
body.marketing .pricing-body { display: flex; flex-direction: column; align-items: center; }
body.marketing .pricing-head { text-align: center; max-width: 46rem; }
body.marketing .pricing-head h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); }
body.marketing .pricing-head .lede { color: var(--muted); font-size: 1.1rem; margin-top: 0.85rem; background: none; border: 0; padding: 0; }
/* waitlist "you're on the list" confirmation — clear gap from the lede above
   (body.marketing p zeroes paragraph margins, so set it explicitly). */
body.marketing .pricing-head .notice { margin-top: 1.75rem; }
/* waitlist page: center the join form (a flex row inside the centered
   .pricing-head — text-align doesn't reach flex items, so a lone logged-in
   "Join" button would sit left) + give the back-to-pricing button a clear gap on
   the thank-you state (body.marketing p zeroes paragraph margins). */
body.marketing .pricing-head .waitlist-form { justify-content: center; margin-top: 1.25rem; }
/* keep the CTA's presence even with the short "Join" / "Eintragen" label. */
body.marketing .pricing-head .waitlist-form .btn { min-width: 12rem; }
body.marketing .pricing-head .wl-cta { margin-top: 1.5rem; }
body.marketing .pricing-head .wl-consent { margin: 0.9rem auto 0; max-width: 30rem; color: var(--faint); font-size: 0.8rem; }
/* server-side ?plan= segmented toggle (links, NOT radios — the chosen cadence
   must POST to /billing/checkout) */
body.marketing .cad-toggle { display: inline-flex; gap: 4px; padding: 4px; width: fit-content; margin: 1.7rem auto 0; border: 1px solid var(--line-2); border-radius: 13px; background: var(--surface); }
body.marketing .cad-toggle a { display: inline-flex; align-items: baseline; gap: 0.4rem; padding: 0.55rem 1.1rem; border-radius: 10px; font-size: 0.92rem; font-weight: 500; color: var(--muted); text-decoration: none; transition: background .15s ease, color .15s ease; }
body.marketing .cad-toggle a small { font-size: 0.72rem; color: var(--gain); font-weight: 600; }
body.marketing .cad-toggle a.on { background: var(--ink); color: #fff; }
body.marketing .cad-toggle a.on small { color: rgba(255,255,255,.72); }
body.marketing .pricing-body .plans { margin-top: 2.2rem; width: 100%; max-width: 760px; }
body.marketing .pnote { display: block; font-size: 0.8rem; color: var(--faint); font-weight: 400; letter-spacing: 0; margin-top: 0.2rem; }
body.marketing .plan-cta-note { font-size: 0.78rem; color: var(--faint); text-align: center; margin-top: 0.7rem; }
body.marketing .includes { margin-top: 1.6rem; color: var(--muted); font-size: 0.9rem; text-align: center; }

/* FAQ accordion */
body.marketing .faq { width: 100%; max-width: 46rem; margin: 1rem auto 0; }
body.marketing .faq h2 { text-align: center; margin-bottom: 1.2rem; }
body.marketing .faq details { border-top: 1px solid var(--line); display: block; margin: 0; }
body.marketing .faq details:last-of-type { border-bottom: 1px solid var(--line); }
body.marketing .faq summary { cursor: pointer; list-style: none; padding: 1.05rem 0; font-weight: 500; font-size: 1.01rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; color: var(--text); text-decoration: none; }
body.marketing .faq summary::-webkit-details-marker { display: none; }
body.marketing .faq summary::after { content: "+"; color: var(--muted); font-size: 1.35rem; line-height: 1; transition: transform .15s ease; }
body.marketing .faq details[open] summary::after { content: "\2013"; }
body.marketing .faq details p { color: var(--muted); padding: 0 0 1.15rem; margin: 0; font-size: 0.96rem; max-width: 56ch; }


/* === AUTH PAGES (centred card) ========================================= */
/* Unique class names (no collision) → global. Auth pages get body.marketing
   for the 16px funnel scale. */

.auth { min-height: calc(100vh - 61px); display: grid; place-items: start center; padding: clamp(2rem, 7vw, 5rem) var(--pad) 4rem; }
.auth-inner { width: 100%; max-width: 27rem; }
.auth-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: clamp(1.6rem, 4vw, 2.5rem); box-shadow: var(--shadow-sm), 0 36px 70px -40px rgba(10,10,10,.28); }
.auth-card .mark { width: 36px; height: 36px; border-radius: 9px; display: block; margin-bottom: 1.2rem; }
.auth-card h1 { font-size: 1.55rem; letter-spacing: -0.025em; margin: 0; }
.auth-card .sub { color: var(--muted); font-size: 0.95rem; margin-top: 0.45rem; }
.field { margin-top: 1.15rem; }
.field label { display: block; font-size: 0.82rem; font-weight: 500; color: var(--ink-2); margin-bottom: 0.4rem; }
.field input { width: 100%; font: inherit; font-size: 1rem; padding: 0.72rem 0.85rem; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); color: var(--ink); transition: border-color .15s ease, box-shadow .15s ease; }
.field input::placeholder { color: var(--faint); }
.field input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(10,10,10,.09); }
.field .help { font-size: 0.78rem; color: var(--faint); margin-top: 0.4rem; }
.auth-card .btn { width: 100%; margin-top: 1.5rem; }
.auth-meta { margin-top: 1.35rem; display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; justify-content: space-between; font-size: 0.9rem; color: var(--muted); }
.auth-meta a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line-2); padding-bottom: 1px; }
.auth-meta a:hover { border-color: var(--ink); }
.auth-foot { margin-top: 1.5rem; text-align: center; font-size: 0.88rem; color: var(--muted); }
.auth-foot a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line-2); padding-bottom: 1px; }
.auth-trust { margin: 1.3rem auto 0; display: flex; align-items: center; justify-content: center; gap: 0.45rem; color: var(--faint); font-size: 0.8rem; }
.auth-trust .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--gain); }
/* inline form banners */
.banner { border-radius: 10px; padding: 0.7rem 0.9rem; font-size: 0.9rem; margin-top: 1.1rem; }
.banner.notice { background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); }
.banner.warn { background: #fff7ed; border: 1px solid #f1d2a9; color: #9a5b16; }


/* ======================================================================
   NEW APP COMPONENTS (body.app) — 15px "breathing-room" density
   Activated as templates are ported in Phase 3.
   ====================================================================== */

body.app main { padding-bottom: 4rem; }

/* page header */
body.app .page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 0 0 1.4rem; }
body.app .page-head h1 { font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -0.025em; margin: 0; }
body.app .page-head .sub { color: var(--muted); margin-top: 0.3rem; font-size: 0.95rem; }
body.app .page-head .actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
body.app .crumb { font-size: 0.82rem; color: var(--muted); margin-bottom: 0.5rem; }
body.app .crumb a { color: var(--muted); text-decoration: none; }
body.app .crumb a:hover { color: var(--ink); }

/* small uppercase section labels ("Totals", "Per pot") */
body.app .section-label { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.9rem; }
/* pot-detail cash line — kept as one text run ("Cash balance: …") for the test */
body.app .cash-line { font-size: 1.35rem; font-weight: 500; letter-spacing: -0.01em; margin: 0.5rem 0 0; }
body.app .pot-notes { margin: 0.5rem 0 1.4rem; color: var(--muted); font-size: 0.9rem; }
/* centred reading column for confirm / preview interstitials */
body.app .narrow { max-width: 56rem; margin-inline: auto; }
body.app .narrow .btn { margin-right: 0.5rem; }
/* table totals row (auto-split previews) */
body.app tfoot th, body.app tfoot td { border-top: 1px solid var(--line-2); font-weight: 600; padding: 0.55rem 0.7rem; }
body.app tfoot th.money, body.app tfoot td.money { text-align: right; font-family: var(--mono); }
/* inbox quick-create-pot disclosure spacing */
body.app .newpot { display: block; margin: 0 0 0.9rem; }
body.app .newpot > summary { font-size: 0.85rem; }

/* app forms (pots/new, transfers, imports, account-delete) — stacked fields */
body.app .form { max-width: 32rem; }
body.app .form .field { margin-top: 1.05rem; }
body.app .form .field > label { display: block; font-size: 0.85rem; font-weight: 500; color: var(--ink-2); margin-bottom: 0.35rem; }
body.app .form .field input, body.app .form .field select, body.app .form .field textarea { width: 100%; font: inherit; font-size: 0.95rem; padding: 0.55rem 0.7rem; border: 1px solid var(--line-2); border-radius: 9px; background: var(--surface); color: var(--ink); }
body.app .form .field textarea { line-height: 1.5; }
body.app .form .field input:focus, body.app .form .field select:focus, body.app .form .field textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(10,10,10,.07); }
body.app .form .actions { margin-top: 1.3rem; display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }

/* settings preference toggles */
body.app .setting { margin: 0 0 1.5rem; }
body.app .setting > label { display: inline-flex; align-items: center; gap: 0.55rem; font-size: 1rem; font-weight: 500; }
body.app .setting small { display: block; color: var(--muted); font-size: 0.85rem; margin-top: 0.4rem; max-width: 62ch; line-height: 1.5; }
body.app .narrow h2 { margin-top: 2rem; }

/* legal pages — readable prose column (public; no body.app/marketing class) */
.legal { max-width: 46rem; margin-inline: auto; }
.legal h1 { margin-bottom: 1.2rem; }
.legal h2 { font-size: 1.1rem; margin-top: 2rem; }
.legal h3 { font-size: 1rem; margin-top: 1.4rem; }
.legal p, .legal li { color: var(--ink-2); }
.legal ul, .legal ol { padding-left: 1.4rem; margin: 0.6rem 0; }
.legal li { margin: 0.35rem 0; }

/* KPI summary row */
body.app .kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(11.5rem, 1fr)); gap: 0.9rem; margin: 0 0 1.9rem; }
body.app .kpi { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 1.1rem 1.2rem; }
body.app .kpi .k { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
body.app .kpi .v { font-size: 1.65rem; font-weight: 500; letter-spacing: -0.02em; margin-top: 0.4rem; font-family: var(--mono); }
body.app .kpi .vsub { font-size: 0.8rem; color: var(--faint); margin-top: 0.25rem; }

/* pot cards */
body.app .pot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(17.5rem, 1fr)); gap: 1rem; }
body.app .pot-card { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); padding: 1.25rem 1.3rem; display: flex; flex-direction: column; gap: 0.6rem; text-decoration: none; color: inherit; transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease; }
body.app .pot-card:hover { border-color: var(--line-2); transform: translateY(-2px); box-shadow: 0 18px 40px -26px rgba(10,10,10,.28); text-decoration: none; }
body.app .pot-card .nm { font-weight: 600; font-size: 1.05rem; letter-spacing: -0.01em; display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
body.app .pot-card .bal { font-size: 1.55rem; font-weight: 500; letter-spacing: -0.02em; font-family: var(--mono); }
body.app .pot-card .meta { color: var(--muted); font-size: 0.82rem; display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }
body.app .pot-card .bar { height: 8px; border-radius: 5px; background: var(--surface-2); overflow: hidden; display: flex; }
body.app .pot-card .bar > span { display: block; height: 100%; }

/* section panels */
body.app .panel { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); padding: 1.3rem 1.4rem; margin: 1.1rem 0; }
body.app .panel > h2 { font-size: 1.05rem; letter-spacing: -0.01em; margin: 0 0 0.15rem; display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
body.app .panel > h2 .amt { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 500; }
body.app .panel .psub { color: var(--muted); font-size: 0.85rem; margin-bottom: 0.7rem; }
body.app .cash-hero { display: flex; align-items: baseline; gap: 0.6rem; flex-wrap: wrap; margin: 0.2rem 0 0.1rem; }
body.app .cash-hero .big { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 2.1rem; font-weight: 500; letter-spacing: -0.02em; }

/* app tables */
body.app table, body.app .panel table { width: 100%; border-collapse: collapse; font-size: 0.9rem; margin: 0.4rem 0 0; }
/* No explicit text-align here: the global `table th` left-aligns by default, so
   `th.num` (below) can right-align numeric headers to line up with their cells. */
body.app thead th, body.app .panel thead th { font-size: 0.67rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 0.5rem 0.7rem; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
body.app tbody td, body.app .panel tbody td { padding: 0.62rem 0.7rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
body.app tbody tr { border-bottom: 0; }
body.app tbody tr:last-child td, body.app .panel tbody tr:last-child td { border-bottom: 0; }
body.app tbody tr:hover, body.app .panel tbody tr:hover { background: var(--surface-2); }
body.app td.num, body.app th.num { text-align: right; white-space: nowrap; }
body.app td.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
body.app .isin { font-family: var(--mono); font-size: 0.85em; color: var(--ink-2); }
body.app .muted { color: var(--muted); }
body.app .faint { color: var(--faint); }
body.app .pos { color: var(--gain); }
body.app .neg { color: var(--loss); }
body.app .t-name { font-weight: 500; }

/* pills / badges / kind tags */
body.app .pill { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.7rem; font-weight: 500; padding: 0.15rem 0.55rem; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap; }
body.app .pill.green { color: var(--gain); border-color: color-mix(in srgb, var(--gain) 35%, var(--line-2)); }
body.app .pill.archived { color: var(--faint); }
body.app .kind { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.03em; text-transform: uppercase; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 0.1rem 0.4rem; }

/* app controls — smaller, outlined; .primary = filled. Scoped to `main` +
   :not(.btn) so it never clobbers the marketing .btn CTAs (used for form submit
   buttons) nor the nav's text-link logout <button> (which lives outside main). */
body.app main button:not(.btn), .btn-sm { font: inherit; font-weight: 500; font-size: 0.85rem; padding: 0.46rem 0.85rem; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); cursor: pointer; min-width: 0; white-space: nowrap; transition: border-color .12s ease, background .12s ease; }
body.app main button:not(.btn).primary, .btn-sm.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
body.app main button:not(.btn):hover, .btn-sm:hover { border-color: var(--ink); opacity: 1; }
body.app main button:not(.btn).primary:hover, .btn-sm.primary:hover { opacity: 0.9; }
body.app select, body.app input[type=text], body.app input[type=number], body.app input[type=date] { font: inherit; font-size: 0.88rem; padding: 0.42rem 0.6rem; border: 1px solid var(--line-2); border-radius: 9px; background: var(--surface); color: var(--ink); width: auto; }
body.app select:focus, body.app input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(10,10,10,.07); }

/* sticky bulk-assign bar (inbox) */
body.app .bulkbar { position: sticky; top: 61px; z-index: 9; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(140%) blur(8px); -webkit-backdrop-filter: saturate(140%) blur(8px); border: 1px solid var(--line); border-radius: 12px; padding: 0.7rem 0.95rem; margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: 0.6rem 1.2rem; align-items: center; justify-content: space-between; }
body.app .bulkbar .grp { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-size: 0.9rem; }
body.app .alloc { display: inline-flex; gap: 0.35rem; align-items: center; }
/* The Manual/Assign + Auto-split <form>s wrap the select+button; display:contents
   lets .alloc flex-lay-out the select and buttons directly (so they align and
   wrap as one group, not per-form islands). */
body.app .alloc > form { display: contents; }
/* A touch more breathing room after the pot <select> before the action button. */
body.app .alloc select { margin-right: 0.15rem; }
/* Equal-width action buttons on the DESKTOP inbox table so Assign / Manual /
   Auto-split line up (was ragged: text-width + filled-vs-outline). Scoped to the
   desk-table — on mobile cards the buttons size naturally so the row stays tidy.
   The selector out-specifies `body.app main button:not(.btn){min-width:0}`. */
body.app .desk-table .alloc button:not(.btn) { min-width: 6rem; text-align: center; justify-content: center; }

/* empty states */
body.app .empty { color: var(--muted); font-size: 0.9rem; padding: 0.9rem 0; }
body.app .empty-card { border: 1px dashed var(--line-2); border-radius: 14px; padding: 1.6rem; text-align: center; color: var(--muted); background: var(--surface); }

/* description / note column affordances */
body.app details > summary { list-style: none; }
body.app details > summary::-webkit-details-marker { display: none; }
body.app .note-edit { color: var(--faint); font-size: 0.78rem; cursor: pointer; white-space: nowrap; text-decoration: none; }
body.app .note-edit:hover { color: var(--ink); }
body.app .usernote { font-style: italic; color: var(--ink-2); }
body.app td:has(.note-edit), body.app .panel td:has(.note-edit) { max-width: 16rem; }

/* inbox: stacked cards on phone + tablet (the wide table only fits desktop) */
body.app .tx-cards { display: none; }
@media (max-width: 1024px) {
  body.app .desk-table { display: none; }
  body.app .tx-cards { display: grid; gap: 0.7rem; }
  body.app .tx-card { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 0.9rem 1rem; }
  body.app .tx-card .row1 { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
  body.app .tx-card .amt { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 500; }
  body.app .tx-card .meta { color: var(--muted); font-size: 0.82rem; margin-top: 0.25rem; }
  /* Mobile alloc: pot select on its own full-width row, action button(s) sharing
     the row below (equal halves for interest's Manual + Auto-split). */
  body.app .tx-card .alloc { margin-top: 0.7rem; width: 100%; flex-wrap: wrap; gap: 0.5rem; }
  body.app .tx-card .alloc select { flex: 1 1 100%; margin-right: 0; }
  body.app .tx-card .alloc button:not(.btn) { flex: 1 1 0; }
  body.app .tx-card .note-edit { white-space: nowrap; }
}

/* app footer spacing + table overflow containment */
body.app .foot { margin-top: 2.5rem; }
body.app .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
body.app .table-scroll > table { width: 100%; }

/* responsive tables → stacked label/value cards below 760px */
body.app .wrap-wide { max-width: var(--maxw-app); }
@media (max-width: 760px) {
  body.app table.responsive thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  body.app table.responsive, body.app table.responsive tbody, body.app table.responsive tr, body.app table.responsive td { display: block; width: 100%; }
  body.app table.responsive tr { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 0.35rem 0.2rem; margin-bottom: 0.75rem; }
  body.app table.responsive tr:hover { background: var(--surface); }
  body.app table.responsive td { display: flex; align-items: baseline; justify-content: space-between; gap: 1.2rem; border: 0 !important; padding: 0.4rem 0.9rem; text-align: right; min-height: 0; }
  body.app table.responsive td::before { content: attr(data-label); color: var(--muted); font-weight: 500; font-size: 0.8rem; letter-spacing: 0; text-transform: none; text-align: left; white-space: nowrap; }
  body.app table.responsive td.card-title { justify-content: flex-start; text-align: left; font-weight: 600; font-size: 1.04rem; padding-bottom: 0.1rem; }
  body.app table.responsive td.card-title::before { content: none; }
  body.app table.responsive td.num { font-family: var(--mono); }
  body.app table.responsive td.card-actions { justify-content: flex-start; gap: 0.5rem; padding-top: 0.6rem; }
  body.app table.responsive td.card-actions::before { content: none; }
  body.app table.responsive td.card-actions select { flex: 1; }
}

/* desktop inbox: tighten padding + control widths so the full row (incl. the
   Allocate select + button) fits inside the wide container with no scroll */
body.app .desk-table thead th, body.app .desk-table tbody td { padding-left: 0.4rem; padding-right: 0.4rem; }
body.app .desk-table thead th:nth-child(2), body.app .desk-table tbody td:nth-child(2) { white-space: nowrap; }
body.app td[data-label="When"] { white-space: nowrap; }
body.app .desk-table tbody td:nth-last-child(2) { white-space: nowrap; }
body.app .desk-table .alloc { gap: 0.3rem; }
body.app .desk-table .alloc select { width: 5.6rem; }
body.app .desk-table .alloc button { padding: 0.46rem 0.55rem; }


/* === motion (marketing load reveal) — reduced-motion safe ============== */

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.reveal { animation: rise .7s cubic-bezier(.2,.7,.2,1) both; }
.d1 { animation-delay: .04s; } .d2 { animation-delay: .12s; } .d3 { animation-delay: .2s; }
.d4 { animation-delay: .28s; } .d5 { animation-delay: .36s; }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
body.marketing .segbar span { transform-origin: left; animation: grow .7s cubic-bezier(.2,.7,.2,1) both; }
body.marketing .segbar .s1 { animation-delay: .35s; } body.marketing .segbar .s2 { animation-delay: .45s; }
body.marketing .segbar .s3 { animation-delay: .53s; } body.marketing .segbar .s4 { animation-delay: .6s; }
@media (prefers-reduced-motion: reduce) {
  .reveal, body.marketing .segbar span { animation: none; }
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}


/* === responsive (small screens, global chrome) ======================== */

@media (max-width: 640px) {
  main { padding: 1.2rem var(--pad) 2.5rem; }
  h1 { font-size: 1.4rem; }
  .hero h1 { font-size: 1.6rem; }
  .lede { font-size: 1rem; }
}
