/* Lovbird V3, "Warm Editorial" (docs/21_UX_V3.md).
 * One stylesheet, in this order: tokens, base and type, shell, shared components, pages, responsive, print.
 * Every colour, radius, shadow and size comes from the tokens below; components never use raw hex.
 * Self-hosted Inter (SIL OFL 1.1, src/fonts/); titles use the platform's editorial serif (Charter, Iowan, Georgia).
 */
@font-face { font-family: "Inter"; src: url("./fonts/Inter-Variable-latin.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; 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; }

/* ================================================================ 1. tokens */
:root {
  /* Base palette (approved). Contrast on white: ink 11.6:1, secondary 5.4:1. */
  --color-background: #F7F5F1;      /* level 0: warm ivory canvas */
  --color-surface: #FFFFFF;         /* level 1: cards and panels */
  --color-surface-muted: #F3F0EB;   /* quiet fills inside a card: affixes, open rows, tracks */
  --color-surface-hover: #FAF8F5;
  --color-ink: #253746;             /* text and the primary action */
  --color-ink-hover: #1A2834;
  --color-text-secondary: #626C70;
  --color-border: #E6E2DB;          /* separators and card edges */
  --color-border-subtle: #EFEBE5;   /* rows inside a card */
  --color-border-strong: #D6D0C6;   /* secondary buttons, chips */
  --color-border-input: #9B9488;    /* form fields: about 3:1 against white */

  /* Brand colours = the logo: Deep Ink (wordmark) for text and actions, Dusty Plum (bird and final period) as the accent,
     Muted Blue (bird) for information and focus. Accent roles: where you are now (current page, sub-page, setup step,
     discussion topic, flow step), figures that need attention (funding gap) and moments. Marks use --color-accent (5.7:1);
     text, icons and filled markers use --color-accent-strong (8.0:1). Never means error; never fills a button.
     Deep Ink is for actions and for what you selected; sage for positive states. Partner marks reuse blue and plum,
     always with the gender symbol and the name. */
  --color-accent: #8E5471;
  --color-accent-strong: #74405A;
  --color-accent-soft: #F5E9EF;

  /* Semantic status: always with a word or an icon. */
  --color-success: #658573;
  --color-success-strong: #4E6B5A;  /* 5.9:1 */
  --color-success-soft: #E9F0EB;
  --color-warning: #B9852F;
  --color-warning-strong: #7A5410;  /* 6.6:1 */
  --color-warning-soft: #F8EEDB;
  --color-danger: #A4372C;          /* 6.3:1, red, clearly apart from the plum accent */
  --color-danger-soft: #F8E4E0;
  --color-info: #425F87;            /* Muted Blue from the logo */
  --color-info-soft: #E8EDF5;
  --color-neutral-soft: #EFECE6;
  --color-unknown: #626C70;         /* not filled in: secondary text with a dashed edge */

  /* Partner identity (stable ids A and B, never names, never status). Main for marks and text, soft for groups. */
  --color-partner-1: #425F87;       /* 6.5:1 */
  --color-partner-1-soft: #E8EDF5;
  --color-partner-2: #8E5471;       /* 5.7:1 */
  --color-partner-2-soft: #F5E9EF;

  --color-chart-neutral: #78828A;   /* a second, neutral series in bars (e.g. moving costs beside the wedding) */
  --color-focus: #425F87;           /* Muted Blue from the logo, 6.5:1 */
  --color-overlay: rgba(37, 55, 70, .42);

  /* Type */
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: Charter, "Iowan Old Style", "Palatino Linotype", Georgia, "Times New Roman", serif;
  --text-hero: clamp(30px, 3.6vw, 42px);
  --text-page: clamp(26px, 2.8vw, 34px);
  --text-section: 19px;
  --text-card: 16px;
  --text-amount-xl: clamp(30px, 3.2vw, 40px);
  --text-amount-lg: 28px;
  --text-amount-md: 22px;
  --text-body: 15px;
  --text-helper: 13.5px;
  --text-meta: 13px;
  --text-label: 12.5px;

  /* Space: a 4 px scale */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 20px; --space-6: 24px;
  --space-8: 32px; --space-10: 40px; --space-12: 48px; --space-16: 64px;

  /* Shape */
  --radius-xs: 6px;    /* tags */
  --radius-sm: 8px;    /* inputs, small controls */
  --radius-md: 10px;   /* buttons */
  --radius-lg: 16px;   /* cards */
  --radius-xl: 20px;   /* key summaries */

  /* Elevation (level 1 to 3); colour from the ink, never black */
  --shadow-1: 0 1px 2px rgba(37, 55, 70, .04);
  --shadow-3: 0 1px 2px rgba(37, 55, 70, .05), 0 10px 28px -14px rgba(37, 55, 70, .18);
  --shadow-2: 0 2px 6px rgba(37, 55, 70, .08), 0 24px 48px -16px rgba(37, 55, 70, .28);

  --content-max: 1180px;
  color-scheme: light;

  /* Clay birds (moments only), shaded from the partner colours like the logo (left bird blue, right bird plum); and the funding-gap hatch */
  --color-bird-blue: #425F87; --color-bird-blue-light: #8BA2C2; --color-bird-blue-dark: #2F4664; --color-bird-blue-wing: #3A5479;
  --color-bird-plum: #8E5471; --color-bird-plum-light: #C391AA; --color-bird-plum-dark: #6B3D55;
  --color-accent-hatch: #E6CDDA;
  --color-on-ink: #FFFFFF; --color-on-ink-muted: #C9D1D8;   /* text on ink surfaces (buttons, toast, featured) */
}

/* ================================================================ 2. base and type */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; background: var(--color-background); color: var(--color-ink); font: 400 var(--text-body)/1.55 var(--font-sans); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 2px; }
/* Main, page titles and section heads take focus only so screen readers start there after navigation; they are not controls,
   and Safari would otherwise draw the ring around the whole page. */
[tabindex="-1"]:focus { outline: none; }
h1, h2, h3, h4, p { margin: 0; }
h1 { font: 500 var(--text-page)/1.15 var(--font-display); letter-spacing: -.01em; }
h2 { font: 600 var(--text-section)/1.3 var(--font-sans); letter-spacing: -.005em; }
h3 { font: 600 var(--text-card)/1.35 var(--font-sans); }
h4 { font: 600 var(--text-meta)/1.4 var(--font-sans); }
a { color: var(--color-ink); text-underline-offset: 3px; }
small, .small { font-size: var(--text-meta); }
.muted { color: var(--color-text-secondary); }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.hidden { visibility: hidden; }
.eyebrow { font-size: var(--text-meta); font-weight: 600; color: var(--color-text-secondary); margin-bottom: var(--space-1); }
.ico { width: 20px; height: 20px; flex: none; stroke-width: 1.75; }
ul.plain { margin: var(--space-2) 0; padding-left: 18px; display: grid; gap: 6px; }
.amount-xl { font: 650 var(--text-amount-xl)/1.1 var(--font-sans); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.amount-md { font: 650 var(--text-amount-md)/1.2 var(--font-sans); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.amount-md.is-negative { color: var(--color-danger); }

/* ================================================================ 3. shell */
.skip { position: absolute; left: 12px; top: -48px; background: var(--color-ink); color: var(--color-on-ink); padding: 8px 14px; border-radius: var(--radius-sm); z-index: 50; }
.skip:focus { top: 12px; }
.app { display: flex; flex-direction: column; min-height: 100dvh; }
.main-col { min-width: 0; display: flex; flex-direction: column; }
main { width: 100%; max-width: var(--content-max); margin: 0 auto; padding: var(--space-8) var(--space-10) var(--space-16); outline: none; }

/* Sidebar (desktop): quieter than the content, on the canvas itself. */
.sidebar { position: sticky; top: 0; height: 100dvh; overflow-y: auto; display: flex; flex-direction: column; gap: var(--space-5); padding: var(--space-6) var(--space-4) var(--space-5); background: var(--color-background); border-right: 1px solid var(--color-border); }
.brand { display: flex; gap: 10px; align-items: center; text-decoration: none; color: var(--color-ink); }
.sidebar .brand { padding: 0 var(--space-2); }
.brand-lockup { display: grid; gap: 4px; }
.brand-logo { display: block; width: 140px; height: auto; }
.brand-lockup small { color: var(--color-text-secondary); font-size: 11.5px; padding-left: 2px; }
.sidebar .brand-lockup small { display: none; }
.brand-mark { display: block; width: 44px; height: auto; flex: none; }
.side-couple { display: flex; align-items: center; gap: 10px; margin: 0 var(--space-2); font-size: var(--text-meta); color: var(--color-text-secondary); line-height: 1.3; }
.side-nav { display: grid; gap: 2px; }
.nav { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.nav-item { display: flex; gap: 12px; align-items: center; padding: 9px 12px; border-radius: var(--radius-md); text-decoration: none; color: var(--color-text-secondary); font-size: 14.5px; font-weight: 500; }
.nav-item .ico { width: 19px; height: 19px; }
.nav-item:hover { background: var(--color-surface-muted); color: var(--color-ink); }
.nav-item[aria-current="page"] { background: var(--color-surface); color: var(--color-ink); font-weight: 600; box-shadow: var(--shadow-1), inset 0 0 0 1px var(--color-border); }
.nav-item[aria-current="page"] .ico, .nav-item.is-open .ico { color: var(--color-accent-strong); }
.nav-item.is-open { color: var(--color-ink); font-weight: 600; }
.nav.sub { margin: 2px 0 6px 21px; padding-left: 12px; border-left: 1px solid var(--color-border); gap: 0; }
.nav-item.sub { padding: 6px 10px; font-size: 14px; }
.nav-item.sub[aria-current="page"] { box-shadow: none; background: transparent; color: var(--color-ink); font-weight: 600; text-decoration: underline; text-decoration-color: var(--color-accent); text-decoration-thickness: 2px; text-underline-offset: 6px; }
.side-foot { margin-top: auto; display: grid; gap: var(--space-3); padding-top: var(--space-4); border-top: 1px solid var(--color-border); }
.side-status { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; padding: 0 var(--space-3); }
.side-status .save { font-size: 12px; }

/* Top bar (phones, and the discussion screen) */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: var(--space-3); min-height: 56px; padding: 8px var(--space-4); background: rgba(247, 245, 241, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--color-border); }
.status-line { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; min-width: 0; flex: 1; overflow: hidden; }
.status-line .tag { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.save { font-size: 12.5px; color: var(--color-text-secondary); }
.save-error, .save-blocked { color: var(--color-danger); font-weight: 600; }
/* Cloud sync status (docs/23): quiet next to "Saved"; a link to Settings, where each state explains itself. */
.sync { font-size: 12px; color: var(--color-text-secondary); text-decoration: none; }
.sync:hover { text-decoration: underline; }
.sync-synced { color: var(--color-success-strong); }
.sync-pending, .sync-offline, .sync-retry, .sync-paused { color: var(--color-warning-strong); }
.sync-signin, .sync-error, .sync-conflict { color: var(--color-danger); font-weight: 600; }
.status-line .sync { margin-left: 6px; }
.top-actions { display: flex; gap: var(--space-2); align-items: center; }
.bottom-nav { display: none; }

.banner { margin: var(--space-3) var(--space-10) 0; padding: 10px 14px; border-radius: var(--radius-md); background: var(--color-surface); border: 1px solid var(--color-border); font-size: var(--text-helper); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.banner-demo { background: var(--color-neutral-soft); border-color: transparent; }
.banner-risk { background: var(--color-danger-soft); border-color: transparent; color: var(--color-danger); }
.banner-short { display: none; }
.foot { margin-top: auto; padding: var(--space-5) var(--space-10) var(--space-8); font-size: 12.5px; color: var(--color-text-secondary); }
.foot p .ico { width: 14px; height: 14px; vertical-align: -2px; }

/* Page head */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--space-5); margin-bottom: var(--space-6); flex-wrap: wrap; }
.page-head h1, .panel-head h2 { outline: none; }
.lede { margin-top: var(--space-2); color: var(--color-text-secondary); max-width: 60ch; font-size: 15.5px; }
.page-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }

/* Area tabs (phones) and sub-tabs */
.area-tabs { margin: 0 0 var(--space-5); }
.subtabs { display: flex; gap: 4px; padding: 4px; margin: calc(-1 * var(--space-2)) 0 var(--space-5); border-radius: var(--radius-md); background: var(--color-surface-muted); width: fit-content; max-width: 100%; overflow-x: auto; }
.subtabs a { padding: 8px 16px; border-radius: var(--radius-sm); text-decoration: none; color: var(--color-text-secondary); font-weight: 600; font-size: 14px; white-space: nowrap; }
.subtabs a:hover { color: var(--color-ink); }
.subtabs a[aria-current="page"] { background: var(--color-surface); color: var(--color-ink); box-shadow: var(--shadow-1); text-decoration: underline; text-decoration-color: var(--color-accent); text-decoration-thickness: 2px; text-underline-offset: 6px; }

/* "On this page" rail (wide desktops) */

/* ================================================================ 4. shared components */
/* Buttons: primary (ink), secondary (outlined), tertiary/ghost, destructive, text action. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 16px; border-radius: var(--radius-md); border: 1px solid var(--color-border-strong); background: var(--color-surface); color: var(--color-ink); font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap; transition: background-color .15s, border-color .15s; }
.btn:hover { border-color: var(--color-border-input); background: var(--color-surface-hover); }
.btn.primary { background: var(--color-ink); border-color: var(--color-ink); color: var(--color-on-ink); }
.btn.primary:hover { background: var(--color-ink-hover); border-color: var(--color-ink-hover); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--color-surface-muted); }
.btn.small { min-height: 34px; padding: 6px 12px; font-size: 13px; }
.btn.large { min-height: 48px; padding: 12px 22px; font-size: 15px; }
.btn.danger { background: var(--color-danger); border-color: var(--color-danger); color: var(--color-on-ink); }
.btn.danger-ghost { color: var(--color-danger); border-color: var(--color-danger-soft); }
.link { background: none; border: 0; padding: 0; color: var(--color-ink); text-decoration: underline; text-underline-offset: 3px; font-weight: 600; font-size: inherit; }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: var(--radius-sm); border: 1px solid transparent; background: transparent; color: var(--color-text-secondary); flex: none; }
.icon-btn:hover { background: var(--color-danger-soft); color: var(--color-danger); }
.icon-btn .ico { width: 16px; height: 16px; }
.icon-text .ico { width: 18px; height: 18px; }
.chip-btn { border: 1px dashed var(--color-border-strong); background: transparent; border-radius: var(--radius-sm); padding: 3px 10px; font-size: 12.5px; color: var(--color-ink); margin: 2px 0; }
.chip-btn:hover { border-style: solid; }

/* Surfaces: level 1 card, level 3 key summary. */
.panel { scroll-margin-top: 72px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-6); box-shadow: var(--shadow-1); margin-bottom: var(--space-5); min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-4); margin-bottom: var(--space-4); }
.panel-head > a, .panel-head > .link { white-space: nowrap; flex: none; }
.panel-head h2, .coming h2, .ov-start h2 { display: flex; align-items: center; font-size: 17px; }
.panel-head .eyebrow { display: none; }
.panel-sub { margin-top: 4px; color: var(--color-text-secondary); font-size: var(--text-helper); }
.panel.plain { margin: 0; }
.h-ico { display: inline-grid; place-items: center; margin-right: 10px; color: var(--color-text-secondary); }
.h-ico .ico { width: 19px; height: 19px; }
.subpanel { background: var(--color-surface-muted); border-radius: var(--radius-md); padding: var(--space-4); margin-bottom: var(--space-4); }
.subpanel h4 { margin-bottom: var(--space-3); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5); align-items: start; }
.grid-2 > .panel { margin-bottom: 0; }
.grid-2 + * { margin-top: var(--space-5); }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: var(--space-2) var(--space-6); }
.split h3 { margin: 10px 0 8px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--space-3) var(--space-4); align-items: start; }
.form-grid.one { grid-template-columns: minmax(0, 1fr); }
.sub-h { margin: var(--space-6) 0 var(--space-3); }

/* Key summary ("answer"): one per page, level 3. */
.headline { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-xl); padding: var(--space-6) var(--space-8); margin: 0 0 var(--space-8); box-shadow: var(--shadow-3); }
.headline.has-side { display: flex; flex-wrap: wrap; gap: var(--space-5) var(--space-10); }
.headline-body { flex: 999 1 440px; min-width: 0; }
.headline-side { flex: 1 1 220px; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding-left: var(--space-8); border-left: 1px solid var(--color-border); }
.headline-side a { margin-top: 6px; font-weight: 600; }
.answer-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px var(--space-3); margin: 0 0 var(--space-3); }
.side-label { font-size: var(--text-meta); font-weight: 600; color: var(--color-text-secondary); }
.side-value { font: 650 34px/1.15 var(--font-sans); letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.side-value.is-second { font-size: var(--text-amount-md); white-space: normal; }
.side-value.is-text { font: 500 26px/1.25 var(--font-display); letter-spacing: 0; white-space: normal; }
.headline-side .side-value { font-size: var(--text-amount-md); }
.side-sub { color: var(--color-text-secondary); font-size: var(--text-helper); }
.answer-note { margin-top: 6px; max-width: 46em; font-size: var(--text-helper); color: var(--color-text-secondary); }
.answer-cta { margin-top: var(--space-4); }
.headline-main { font-size: 15.5px; line-height: 1.55; max-width: 44em; }
.headline-main .headline-verdict { color: inherit; }
.headline-figure { margin: 0 0 var(--space-3); display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.headline-figure b { font: 650 var(--text-amount-xl)/1.1 var(--font-sans); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.headline-figure > span { color: var(--color-text-secondary); font-weight: 600; }
.headline-figure.is-split { display: block; }
.figure-label { margin: 0 0 var(--space-2); font-size: var(--text-meta); font-weight: 600; color: var(--color-text-secondary); }
.figure-parts { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-2) var(--space-4); }
.figure-parts .part { margin: 0; display: grid; gap: 2px; min-width: 7.5em; }
.figure-parts small { display: flex; align-items: center; gap: 6px; font-size: var(--text-meta); font-weight: 600; color: var(--color-text-secondary); }
.figure-parts b { white-space: nowrap; }
.figure-parts .plus { font-size: 22px; color: var(--color-text-secondary); padding-bottom: 6px; }
.next-action-cta { margin-top: var(--space-5); display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.headline-more { flex: 1 1 100%; margin-top: var(--space-5); padding-top: var(--space-3); border-top: 1px solid var(--color-border-subtle); }
.headline-more > summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.headline-more .meter { margin-top: var(--space-3); }
.headline-linked { margin-top: var(--space-3); font-size: 14px; line-height: 1.55; }

/* Status: icon + word. */
.status-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 7px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; }
.status-chip .ico { width: 17px; height: 17px; }
.status-chip.s-good { background: var(--color-success-soft); color: var(--color-success-strong); }
.status-chip.s-warn { background: var(--color-warning-soft); color: var(--color-warning-strong); }
.status-chip.s-risk { background: var(--color-danger-soft); color: var(--color-danger); }

/* Badges (only for status) */
.tag { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: var(--radius-xs); font-size: var(--text-label); font-weight: 600; white-space: nowrap; background: var(--color-neutral-soft); color: var(--color-text-secondary); }
.tag-good { background: var(--color-success-soft); color: var(--color-success-strong); }
.tag-warn { background: var(--color-warning-soft); color: var(--color-warning-strong); }
.tag-risk { background: var(--color-danger-soft); color: var(--color-danger); }
.tag-demo { background: var(--color-neutral-soft); color: var(--color-ink); }

/* Funding bar: paid (ink), available (sage), still missing (hatched accent). Labels always beside it. */
.stack { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--color-surface-muted); margin: var(--space-3) 0; }
.seg { display: block; height: 100%; }
.seg-paid { background: var(--color-ink); }
.seg-cash { background: var(--color-success); }
.seg-gap { background: repeating-linear-gradient(45deg, var(--color-accent-soft) 0 5px, var(--color-accent-hatch) 5px 10px); }
.legend { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px var(--space-5); font-size: var(--text-meta); color: var(--color-text-secondary); }
.legend b { color: var(--color-ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.meter { margin: var(--space-3) 0 2px; max-width: 34em; }
.meter-bar { display: flex; height: 10px; border-radius: 999px; background: var(--color-surface-muted); overflow: hidden; }
.meter-bar i { display: block; height: 100%; background: var(--color-ink); }
.meter-bar i.moving { background: var(--color-chart-neutral); }
.meter.is-over .meter-bar i { background: var(--color-danger); }
.meter-legend { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px var(--space-4); margin-top: 6px; font-size: var(--text-meta); color: var(--color-text-secondary); font-variant-numeric: tabular-nums; }
.bars { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-2); }
.bars li { display: grid; grid-template-columns: minmax(110px, 1.2fr) 2fr auto 40px; gap: 10px; align-items: center; font-size: var(--text-meta); }
.bars b { font-variant-numeric: tabular-nums; text-align: right; font-weight: 600; }
.bars small { color: var(--color-text-secondary); text-align: right; }
.bar { height: 8px; border-radius: 999px; background: var(--color-surface-muted); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--color-ink); border-radius: 999px; opacity: .55; }

/* Partners: identity only. */
.pa { background: var(--color-partner-1); }
.pb { background: var(--color-partner-2); }
.couple-mark { position: relative; width: 66px; height: 40px; flex: none; }
.couple-mark i { position: absolute; top: 0; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font: 600 15px/1 var(--font-sans); font-style: normal; color: var(--color-on-ink); box-shadow: 0 0 0 3px var(--color-background); }
.couple-mark .pa { left: 0; }
.couple-mark .pb { left: 26px; }
.couple-mark.small { width: 46px; height: 28px; }
.couple-mark.small i { width: 28px; height: 28px; font-size: 12px; box-shadow: 0 0 0 2px var(--color-background); }
.couple-mark.small .pb { left: 18px; }
.headline-together { margin: var(--space-4) 0 2px; max-width: 34em; }
.headline-together > p { font-size: var(--text-meta); font-weight: 600; color: var(--color-text-secondary); margin-bottom: 6px; }
.together-bar { display: flex; gap: 2px; height: 10px; border-radius: 999px; overflow: hidden; }
.together-bar i { display: block; height: 100%; }
.together-legend { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px var(--space-4); margin-top: 6px; font-size: 14px; }
.together-legend b { font-variant-numeric: tabular-nums; }
/* Partner marks: male symbol in partner-1 blue, female symbol in partner-2 plum (owner's decision, docs/21). */
.p-ico { display: inline-grid; place-items: center; flex: none; }
.p-ico .ico { width: 15px; height: 15px; stroke-width: 2; }
.p-ico.p-a { color: var(--color-partner-1); }
.p-ico.p-b { color: var(--color-partner-2); }
.p-ico + .p-ico { margin-left: -3px; }
.together-legend span { display: inline-flex; align-items: center; gap: 6px; }
#partner-A .panel-head h2 .h-ico { color: var(--color-partner-1); }
#partner-B .panel-head h2 .h-ico { color: var(--color-partner-2); }
#partner-A .panel-head h2, #partner-B .panel-head h2 { padding: 4px 12px 4px 10px; border-radius: var(--radius-sm); }
#partner-A .panel-head h2 { background: var(--color-partner-1-soft); }
#partner-B .panel-head h2 { background: var(--color-partner-2-soft); }

/* Ledger rows */
.ledger { display: grid; margin-top: var(--space-3); }
.row { display: flex; justify-content: space-between; gap: var(--space-4); padding: 7px 0; font-size: 14px; border-bottom: 1px solid var(--color-border-subtle); }
.row:last-child { border-bottom: 0; }
.row b { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.row span { color: var(--color-text-secondary); }
.row.strong span { color: var(--color-ink); font-weight: 600; }
.row.strong b { font-weight: 700; }
.row.sub span { padding-left: 14px; font-size: var(--text-meta); }
.row.tone-warn b { color: var(--color-warning-strong); }
.row.tone-risk b { color: var(--color-danger); }
.row.tone-good b { color: var(--color-success-strong); }
.ledger.inline { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); column-gap: var(--space-6); margin: 0 0 var(--space-2); }
.basics-summary .row b { white-space: normal; }

/* Metrics (breakdowns, discussion impact) */
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--space-3); margin-bottom: var(--space-5); }
.metrics.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: var(--space-4); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.metric-label { font-size: var(--text-meta); color: var(--color-text-secondary); font-weight: 600; }
.metric-value { font-size: 20px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.01em; overflow-wrap: anywhere; }
.metric-foot { font-size: var(--text-meta); color: var(--color-text-secondary); line-height: 1.45; }
.metric .tag { white-space: normal; margin-top: 4px; }
.metric.tone-warn { background: var(--color-warning-soft); border-color: transparent; }
.metric.tone-risk { background: var(--color-danger-soft); border-color: transparent; }
.metric.tone-risk .metric-value { color: var(--color-danger); }
.metric.featured { background: var(--color-ink); border-color: var(--color-ink); color: var(--color-on-ink); }
.metric.featured .metric-label, .metric.featured .metric-foot { color: var(--color-on-ink-muted); }
.metric.featured .tag { background: rgba(255, 255, 255, .14); color: var(--color-on-ink); }

/* Notes ("needs attention"): rows, the level as a badge with its icon */
.insights { list-style: none; margin: 0; padding: 0; display: grid; }
.insight { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: var(--space-3); padding: var(--space-4) 0; border-top: 1px solid var(--color-border-subtle); }
.insights > .insight:first-child { border-top: 0; padding-top: 0; }
.insight b { display: block; margin-bottom: 2px; font-weight: 600; }
.insight p { font-size: var(--text-helper); color: var(--color-text-secondary); }
.insight .formula { font-size: 12.5px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.insight .link, .insight a { font-size: var(--text-meta); display: inline-block; margin-top: 4px; }
.lvl { justify-self: start; align-self: start; display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--radius-xs); font-size: var(--text-label); font-weight: 600; background: var(--color-neutral-soft); color: var(--color-text-secondary); }
.lvl .ico { width: 14px; height: 14px; }
.lvl-risk .lvl { background: var(--color-danger-soft); color: var(--color-danger); }
.lvl-warn .lvl { background: var(--color-warning-soft); color: var(--color-warning-strong); }
.lvl-good .lvl { background: var(--color-success-soft); color: var(--color-success-strong); }
.lvl-todo .lvl { background: transparent; border: 1px dashed var(--color-border-input); padding: 1px 7px; }
.all-clear { color: var(--color-success-strong); font-weight: 600; }

/* Disclosure */
.why { margin-top: var(--space-4); font-size: 14px; }
.why > div { padding: var(--space-2) 0 4px; color: var(--color-text-secondary); display: grid; gap: var(--space-2); max-width: 72ch; }
.checklist summary, .why summary, .sub-details summary, .ov-more > summary { cursor: pointer; font-weight: 600; color: var(--color-ink); padding: 6px 0; }
.sub-details { margin-top: var(--space-3); }
.ov-more { margin: var(--space-6) 0; }
.ov-more[open] > summary { margin-bottom: var(--space-3); }
.checklist { margin: var(--space-2) 0 var(--space-5); }
.checklist ul { list-style: none; padding: 0; display: grid; gap: 6px; margin: var(--space-2) 0; }
.checklist li span { display: inline-block; width: 74px; color: var(--color-text-secondary); font-size: var(--text-meta); }
.checklist li.done span { color: var(--color-success-strong); }
.callout { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); padding: 14px 18px; border-radius: var(--radius-md); background: var(--color-info-soft); margin-bottom: var(--space-5); flex-wrap: wrap; }
.note-inline { font-size: var(--text-meta); padding: 8px 12px; border-radius: var(--radius-sm); background: var(--color-surface-muted); margin-top: 10px; }
.empty { color: var(--color-text-secondary); font-size: 14px; padding: var(--space-3) 0; }
.echo { margin-top: var(--space-3); padding: 10px 14px; background: var(--color-success-soft); color: var(--color-success-strong); border-radius: var(--radius-md); font-size: 14px; }
.confidence { margin: calc(-1 * var(--space-2)) 0 var(--space-5); font-size: var(--text-helper); color: var(--color-text-secondary); }

/* Forms */
.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.field > label, .field .label { font-size: var(--text-meta); font-weight: 600; color: var(--color-ink); }
/* Partner symbol before a name in a label, a metric or a table header (blue partner 1, plum partner 2). */
label .p-ico, .metric-label .p-ico, th .p-ico { display: inline-flex; vertical-align: -2px; }
label .p-ico .ico, .metric-label .p-ico .ico, th .p-ico .ico { width: 15px; height: 15px; }
.backup-reminder { margin-bottom: var(--space-5); flex-wrap: wrap; }
.backup-reminder .add-row { margin: 0; }
.field.compact > label, .field.compact .label { font-size: 12.5px; color: var(--color-text-secondary); }
.control { display: flex; align-items: center; border: 1px solid var(--color-border-input); border-radius: var(--radius-sm); background: var(--color-surface); min-height: 40px; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.field.compact .control { min-height: 36px; }
.control:focus-within { border-color: var(--color-focus); box-shadow: 0 0 0 1px var(--color-focus), 0 0 0 4px rgba(66, 95, 135, .22); }
.control input, .control select, .field textarea { border: 0; background: transparent; min-width: 0; width: 100%; padding: 8px 10px; outline: none; }
.control.numeric input { font-variant-numeric: tabular-nums; text-align: right; }
.control.select select { appearance: none; padding-right: 30px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23626C70' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 10px center; }
.field textarea { border: 1px solid var(--color-border-input); border-radius: var(--radius-sm); resize: vertical; min-height: 64px; }
.field textarea:focus { border-color: var(--color-focus); box-shadow: 0 0 0 1px var(--color-focus), 0 0 0 4px rgba(66, 95, 135, .22); }
.affix { padding: 0 10px; color: var(--color-text-secondary); font-size: var(--text-meta); background: var(--color-surface-muted); align-self: stretch; display: grid; place-items: center; }
input.is-blank::placeholder { color: var(--color-unknown); font-style: italic; }
.hint { color: var(--color-text-secondary); font-size: 12.5px; line-height: 1.45; }
.error { color: var(--color-danger); font-size: 12.5px; font-weight: 600; }
.has-error .control { border-color: var(--color-danger); }
.derived { min-height: 36px; display: flex; align-items: center; gap: var(--space-2); font-variant-numeric: tabular-nums; flex-wrap: wrap; }
.check { display: inline-flex; gap: var(--space-2); align-items: center; font-size: 14px; padding: 6px 0; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--color-ink); }
.check.compact { font-size: 12.5px; color: var(--color-text-secondary); align-self: end; padding-bottom: 10px; }
.check-row { display: flex; gap: var(--space-5); flex-wrap: wrap; margin: 6px 0 var(--space-3); }

/* Editable rows */
.lines { display: grid; }
.line { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: var(--space-3) 0; border-bottom: 1px solid var(--color-border-subtle); }
.lines > .line:first-child { border-top: 1px solid var(--color-border-subtle); }
.line > .field, .line > .line-total, .line > .check { flex: 1 1 140px; }
.line > .field:first-child { flex: 2 1 180px; }
.line > .icon-btn { margin-bottom: 1px; }
.line-more { align-self: end; margin-bottom: 4px; background: none; border: 0; padding: 6px 4px; font-size: var(--text-meta); color: var(--color-text-secondary); text-align: left; flex: 1 1 160px; }
.line-more:hover { color: var(--color-ink); text-decoration: underline; }
.line-details { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding-top: var(--space-2); }
.line-details > .field, .line-details > .check { flex: 1 1 160px; }
.line-total { display: grid; font-size: var(--text-meta); font-variant-numeric: tabular-nums; align-self: end; padding-bottom: 9px; }
.line-total small { color: var(--color-text-secondary); font-size: 11.5px; font-weight: 600; }
.line-total .tag { justify-self: start; }
.compact-line.is-open { background: var(--color-surface-hover); margin: 0 calc(-1 * var(--space-3)); padding-inline: var(--space-3); border-radius: var(--radius-md); }
/* A closed row reads as text: name, what it is … amount; it opens to its fields. */
.lr-chev { color: var(--color-text-secondary); font-size: 12px; }
.add-row { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; margin-top: var(--space-4); }
.add-row .field { min-width: 220px; }
.chips { list-style: none; padding: 0; margin: 0 0 var(--space-3); display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chips li { display: grid; padding: 8px 12px; border-radius: var(--radius-md); background: var(--color-surface-muted); font-size: 12.5px; }
.chips li span { color: var(--color-text-secondary); }

/* Tables */
.table { width: 100%; border-collapse: collapse; font-size: var(--text-helper); font-variant-numeric: tabular-nums; }
.table th, .table td { text-align: left; padding: 10px; border-bottom: 1px solid var(--color-border-subtle); vertical-align: top; }
.table thead th { font-size: 12.5px; color: var(--color-text-secondary); font-weight: 600; border-bottom-color: var(--color-border); }
.table tbody th { font-weight: 600; }
.table tr.strong { font-weight: 700; }
.table td:not(:first-child) { text-align: right; }
.schedule td:nth-child(2) { text-align: left; }
.table .is-short { background: var(--color-danger-soft); }
.table .is-chosen { background: var(--color-surface-muted); }
.table.mini { margin-top: 4px; }
.scroll-x { overflow-x: auto; } /* very narrow phones (320px) scroll the table, not the page */
.table-scroll { overflow-x: auto; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); }

/* Icons inside option cards: one family, plain, on a quiet tile. */
.mode-icon { display: grid; place-items: center; width: 38px; height: 38px; margin-bottom: 6px; border-radius: var(--radius-md); background: var(--color-surface-muted); color: var(--color-ink); }
.mode-icon .ico { width: 21px; height: 21px; }
.pick .ico { width: 16px; height: 16px; color: var(--color-text-secondary); }

/* Clay birds: the logo pair, only in setup, an empty Overview and reached goals. */
.clay-birds { position: relative; display: inline-block; width: 86px; height: 50px; flex: none; }
.clay-birds i { position: absolute; bottom: 0; border-radius: 50%; }
.clay-birds .b1 { left: 10px; width: 38px; height: 38px; background: radial-gradient(circle at 35% 30%, var(--color-bird-blue-light), var(--color-bird-blue) 60%, var(--color-bird-blue-dark)); box-shadow: 3px 5px 9px rgba(47, 70, 100, .28), inset -3px -4px 6px rgba(30, 45, 70, .24); }
.clay-birds .b2 { left: 38px; width: 42px; height: 42px; background: radial-gradient(circle at 35% 30%, var(--color-bird-plum-light), var(--color-bird-plum) 62%, var(--color-bird-plum-dark)); box-shadow: 3px 5px 10px rgba(107, 61, 85, .28), inset -3px -4px 6px rgba(70, 35, 55, .26); }
.clay-birds i::before { content: ""; position: absolute; top: 12px; width: 8px; height: 4px; border-top: 2px solid var(--color-surface); border-radius: 50% 50% 0 0; }
.clay-birds .b1::before { left: 12px; }
.clay-birds .b2::before { left: 20px; }
.clay-birds i::after { content: ""; position: absolute; top: 4px; width: 13px; height: 16px; }
.clay-birds .b1::after { left: -10px; background: var(--color-bird-blue-wing); clip-path: polygon(100% 0, 100% 100%, 0 50%); transform: rotate(18deg); }
.clay-birds .b2::after { right: -10px; background: var(--color-bird-plum); clip-path: polygon(0 0, 0 100%, 100% 50%); transform: rotate(-18deg); }
.clay-birds.small { transform: scale(.72); transform-origin: left top; margin: 0 -22px -12px 0; }
.moment { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-4) var(--space-5); margin-bottom: var(--space-5); border-radius: var(--radius-lg); background: var(--color-accent-soft); }
.moment b { font: 500 19px/1.3 var(--font-display); }
.moment p { margin-top: 2px; color: var(--color-text-secondary); font-size: 14px; }

/* Toast and modal (level 2) */
.toast-region { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; width: min(560px, calc(100% - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 10px; align-items: center; padding: 12px 14px 12px 18px; border-radius: var(--radius-lg); background: var(--color-ink); color: var(--color-on-ink); box-shadow: var(--shadow-2); }
.toast p { flex: 1; font-size: 14px; }
.toast .btn { background: rgba(255, 255, 255, .12); border-color: transparent; color: var(--color-on-ink); }
.toast .btn.ghost { background: transparent; color: var(--color-on-ink-muted); }
.toast-risk { background: var(--color-danger); }
.modal { border: 0; padding: 0; border-radius: var(--radius-lg); width: min(560px, calc(100% - 32px)); box-shadow: var(--shadow-2); color: var(--color-ink); background: var(--color-surface); }
.modal::backdrop { background: var(--color-overlay); }
.modal-body { padding: var(--space-6); display: grid; gap: var(--space-3); }
.modal-body h2 { font: 500 23px/1.25 var(--font-display); }
.modal-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; justify-content: flex-end; margin-top: var(--space-2); }
.menu { position: relative; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu-list { position: absolute; right: 0; top: calc(100% + 6px); min-width: 240px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); box-shadow: var(--shadow-2); padding: 6px; display: grid; z-index: 30; }
.menu-item { text-align: left; background: none; border: 0; padding: 10px 12px; border-radius: var(--radius-sm); }
.menu-item:hover { background: var(--color-surface-muted); }
.menu-item.danger { color: var(--color-danger); }

/* ================================================================ 5. pages */
/* Overview */
.couple-head { margin-bottom: var(--space-6); }
.couple { display: flex; align-items: center; gap: var(--space-4); }
.couple h1 { font-size: var(--text-hero); }
.couple-when { color: var(--color-text-secondary); margin-top: 4px; }
.ov-budget { border-radius: var(--radius-xl); padding: var(--space-6) var(--space-8); box-shadow: var(--shadow-3); margin-bottom: var(--space-5); }
.ov-budget-total { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px var(--space-3); margin-bottom: 4px; }
.ov-budget-total .muted { font-size: 14px; }
.ov-start { display: flex; align-items: center; gap: var(--space-5); border-radius: var(--radius-xl); padding: var(--space-6) var(--space-8); }
.ov-start p { max-width: 46em; margin-top: 6px; color: var(--color-text-secondary); }
.ov-start h2 { font: 500 24px/1.25 var(--font-display); }
.ov-columns { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, 1fr); gap: var(--space-5); align-items: start; }
.ov-main, .ov-aside { display: grid; gap: var(--space-5); min-width: 0; }
.ov-main > .panel, .ov-aside > .panel { margin: 0; }
.coming-list { list-style: none; padding: 0; margin: var(--space-1) 0 var(--space-2); display: grid; }
.coming-list li { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-3) 0; border-bottom: 1px solid var(--color-border-subtle); font-variant-numeric: tabular-nums; }
.coming-list li > .ico { width: 19px; height: 19px; margin-top: 2px; color: var(--color-text-secondary); }
.coming-list .what { flex: 1; min-width: 0; display: grid; font-weight: 600; }
.coming-list small { color: var(--color-text-secondary); font-weight: 400; }
.coming-list li > b { white-space: nowrap; font-weight: 600; }
.coming-links { display: flex; flex-wrap: wrap; gap: 4px var(--space-4); margin-top: var(--space-2); }
.ov-after .amount-md { margin-bottom: 4px; }

/* Welcome */
.welcome { min-height: 100dvh; display: flex; flex-direction: column; padding: var(--space-6) clamp(16px, 5vw, 64px); }
.welcome-top { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.welcome-top .brand-logo { width: 150px; }
.welcome-main { max-width: 1200px; margin: auto 0; padding: var(--space-10) 0; display: grid; gap: var(--space-6); }
.welcome-copy { display: grid; gap: var(--space-5); align-content: start; }
.welcome-main h1 { font: 500 clamp(36px, 4.6vw, 58px)/1.08 var(--font-display); letter-spacing: -.015em; max-width: 14em; }
.welcome-title span { display: block; text-wrap: balance; } /* one sentence per line; screen readers still hear a space between */
.welcome .lede { font-size: 17px; max-width: 36ch; text-wrap: pretty; }
.welcome-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.welcome-demo-note { margin-top: -6px; }
.welcome-demo-note .link { font-size: inherit; }
.privacy-box { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-4) var(--space-5); border-radius: var(--radius-lg); background: var(--color-surface); border: 1px solid var(--color-border); font-size: 14px; color: var(--color-text-secondary); max-width: 640px; }
.privacy-box b { color: var(--color-ink); }
.welcome-preview { margin: 0; display: grid; gap: var(--space-2); }
.preview-frame { padding: var(--space-5); background: var(--color-surface-muted); border-radius: var(--radius-xl); }
.preview-couple { display: flex; align-items: center; gap: 10px; margin: 0 0 var(--space-3); font: 500 18px/1.3 var(--font-display); }
.preview-frame .headline { margin: 0; }
.preview-frame .headline-side { padding: var(--space-3) 0 0; border-left: 0; border-top: 1px solid var(--color-border); }
.preview-frame .btn.primary { background: var(--color-surface); color: var(--color-ink); border-color: var(--color-border-strong); }
.by { font-size: 12px; color: var(--color-text-secondary); margin: 0; }

/* Onboarding */
.onboarding { max-width: 760px; margin: 0 auto; display: grid; gap: var(--space-5); }
.ob-progress { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; font-size: 12.5px; color: var(--color-text-secondary); }
.ob-progress li { padding-top: 8px; box-shadow: inset 0 3px 0 var(--color-border); }
.ob-progress li.done { box-shadow: inset 0 3px 0 var(--color-border-input); }
.ob-progress li.current { box-shadow: inset 0 3px 0 var(--color-accent); color: var(--color-ink); font-weight: 600; }
.chat { display: flex; align-items: flex-start; gap: var(--space-3); }
.chat-bubbles { flex: 1; min-width: 0; display: grid; gap: var(--space-2); }
.bubble { max-width: 560px; padding: 12px 16px; border-radius: 16px 16px 16px 4px; background: var(--color-surface); border: 1px solid var(--color-border); font-size: 15px; }
.ob-body { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-6); box-shadow: var(--shadow-1); }
.cat-picks { border: 0; padding: 0; margin: var(--space-4) 0 0; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.cat-picks legend { font-weight: 600; font-size: var(--text-meta); margin-bottom: var(--space-2); }
.pick { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--radius-sm); border: 1px solid var(--color-border-strong); background: var(--color-surface); font-size: var(--text-meta); cursor: pointer; }
.pick.on { background: var(--color-surface-muted); border-color: var(--color-ink); }
.pick input { accent-color: var(--color-ink); }
.kind-pick { border: 0; padding: 0; margin: 0 0 var(--space-4); display: flex; flex-wrap: wrap; gap: 10px; }
.kind-pick legend { padding: 0; margin-bottom: var(--space-2); font-size: 14px; font-weight: 600; }
.kind-option { position: relative; display: grid; justify-items: center; gap: 4px; min-width: 104px; padding: var(--space-3) var(--space-4); border: 1px solid var(--color-border-strong); border-radius: var(--radius-md); background: var(--color-surface); cursor: pointer; font-weight: 600; }
.kind-option .ico { width: 28px; height: 28px; }
.kind-option input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.kind-option.on { border: 2px solid var(--color-ink); padding: calc(var(--space-3) - 1px) calc(var(--space-4) - 1px); }
.kind-option:has(input:focus-visible) { outline: 3px solid var(--color-focus); outline-offset: 2px; }

/* Wedding: budget */
.budget-answer .answer-top { justify-content: space-between; align-items: flex-end; gap: var(--space-3) var(--space-8); }
.answer-gap { text-align: right; }
.gap-value { font: 650 var(--text-amount-lg)/1.2 var(--font-sans); font-variant-numeric: tabular-nums; color: var(--color-accent-strong); }
.answer-req { margin-top: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--color-border-subtle); font-size: 14px; }
.answer-req b { font-variant-numeric: tabular-nums; }
.wed-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); grid-template-rows: auto auto 1fr; grid-template-areas: "main basics" "main support" "main cats"; gap: var(--space-5); align-items: start; margin-bottom: var(--space-5); }
.wed-main { grid-area: main; min-width: 0; }
.wed-main > .panel { margin-bottom: var(--space-3); }
.wed-columns > #basis { grid-area: basics; }
.wed-columns > #support { grid-area: support; }
.wed-columns > #cats { grid-area: cats; }
.wed-columns > .panel { margin: 0; min-width: 0; }
.item { border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-4); margin: var(--space-2) 0 var(--space-3); background: var(--color-surface-hover); }
.item.is-included { border-style: dashed; }
.item-quotes { padding-bottom: var(--space-2); }
.item-head { display: flex; gap: 10px; align-items: end; }
.item-head .grow { flex: 1; }
.item-head .field:not(.grow) { width: 170px; }
.item-tabs { display: flex; gap: 4px; padding: 4px; margin: var(--space-3) 0 4px; border-radius: var(--radius-md); background: var(--color-surface-muted); width: fit-content; max-width: 100%; }
.item-tab { border: 0; background: transparent; padding: 7px 14px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; color: var(--color-text-secondary); }
.item-tab.on { background: var(--color-surface); color: var(--color-ink); box-shadow: var(--shadow-1); }
.item-more { margin-top: var(--space-2); display: grid; gap: 10px; }
.item-more .payments + .payment-plan { margin-top: 14px; }
.item-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 10px; }
.item-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.item-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 520px; }
.item-foot { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); margin-top: var(--space-3); flex-wrap: wrap; }
.item-sums { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.item-sums > span { display: grid; font-variant-numeric: tabular-nums; }
.item-sums small { color: var(--color-text-secondary); font-size: 11.5px; font-weight: 600; }
.payments h4, .payment-plan h4 { margin: var(--space-2) 0; }
.payment-plan { border-radius: var(--radius-md); padding: var(--space-3) 14px; background: var(--color-surface); border: 1px solid var(--color-border-subtle); display: grid; gap: var(--space-2); }
.line.milestone > .btn { align-self: flex-end; }
.pay-list { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 4px; }
.pay-list li { display: grid; grid-template-columns: 130px 140px 1fr auto; gap: 10px; align-items: center; font-size: var(--text-helper); font-variant-numeric: tabular-nums; padding: 4px 0; border-bottom: 1px solid var(--color-border-subtle); }
.pay-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.pay-form > .field { flex: 1 1 150px; }
.pay-upcoming { list-style: none; padding: 0; margin: 0; display: grid; }
.pay-upcoming li { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto auto; gap: var(--space-3); align-items: center; padding: 10px 0; border-bottom: 1px solid var(--color-border-subtle); font-size: 14px; font-variant-numeric: tabular-nums; }
.pay-upcoming .when { color: var(--color-text-secondary); }
.impact-preview { background: var(--color-surface-muted); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); }

/* Wedding: guests, vendors, checklist */
.line.guest > .field:last-of-type { flex: 2 1 180px; }
.guest-budget { align-items: center; }
.portion-hint { display: flex; flex-wrap: wrap; gap: 6px var(--space-4); align-items: flex-end; margin: var(--space-5) 0 0; padding-top: var(--space-4); border-top: 1px solid var(--color-border-subtle); }
.portion-hint > .field { flex: 0 0 160px; }
.portion-hint > p { flex: 1 1 260px; margin: 0 0 var(--space-2); }
.guest-sides { list-style: none; padding: 0; margin: var(--space-3) 0 0; display: flex; flex-wrap: wrap; gap: var(--space-2) 18px; font-size: 14px; font-variant-numeric: tabular-nums; }
.guest-sides li { display: flex; gap: 6px; align-items: baseline; }
.guest-sides small { color: var(--color-text-secondary); }
.compare-quotes { min-width: 520px; }
.table.compare-quotes thead th, .table.compare-quotes td:not(:first-child) { text-align: left; }
.compare-quotes thead th { min-width: 150px; font-size: 14px; color: var(--color-ink); }
.compare-quotes tbody th { color: var(--color-text-secondary); font-weight: 600; width: 170px; }
.compare-quotes tr:last-child th, .compare-quotes tr:last-child td { border-bottom: 0; }
.add-quote { margin-bottom: var(--space-2); }
.add-quote[open] > .task-add { margin-top: var(--space-3); }
.quote-item { border-top: 1px solid var(--color-border-subtle); padding-top: var(--space-4); margin-top: var(--space-4); display: grid; gap: 10px; }
.quote-item:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.quote-item-head { display: flex; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; align-items: flex-start; }
.quote-current { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.lrow.quote.is-selected > .lrow-line { background: var(--color-success-soft); border-radius: var(--radius-sm); }
.lrow.quote.is-rejected .lrow-name b { color: var(--color-text-secondary); }
.quote-sums { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; font-variant-numeric: tabular-nums; }
.quote-sums small { display: block; color: var(--color-text-secondary); }
.quote .add-row { margin: 0; }
.task-add { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: var(--space-4); }
.task-add > .field { flex: 1 1 150px; }
.task-add > .field:first-child { flex: 3 1 240px; }
.filter-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: var(--space-4); }
.filter { border: 1px solid var(--color-border-strong); background: var(--color-surface); border-radius: var(--radius-sm); padding: 6px 12px; font-size: var(--text-meta); font-weight: 600; color: var(--color-text-secondary); }
.filter:hover { color: var(--color-ink); }
.filter.on { background: var(--color-ink); border-color: var(--color-ink); color: var(--color-on-ink); }
.filter-sep { width: 1px; background: var(--color-border-strong); margin: 4px 6px; }
.task-head { display: flex; gap: 10px; align-items: center; }
.task-head .grow { flex: 1; }
.task-check { width: 20px; height: 20px; accent-color: var(--color-ink); flex: none; cursor: pointer; }
.task-more { display: grid; gap: 10px; padding-top: var(--space-2); }
.task-more .add-row { margin: 0; }
.task-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.task .sub-details { margin-top: 0; }
.tab-summary { margin: calc(-1 * var(--space-2)) 0 var(--space-5); color: var(--color-text-secondary); font-size: 14px; font-variant-numeric: tabular-nums; }

/* Finances and Life After */
.mode-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.mode-card { position: relative; text-align: left; display: grid; gap: 4px; align-content: start; padding: 14px; border-radius: var(--radius-md); border: 1px solid var(--color-border-strong); background: var(--color-surface); }
.mode-card small { color: var(--color-text-secondary); font-size: var(--text-meta); line-height: 1.4; }
.mode-card:hover { border-color: var(--color-border-input); }
.mode-card.chosen { border: 2px solid var(--color-ink); padding: 13px; }
.mode-nums { display: grid; gap: 2px; margin-top: var(--space-2); font-size: var(--text-meta); color: var(--color-text-secondary); font-variant-numeric: tabular-nums; }
.mode-nums b { color: var(--color-ink); }
.mode-flag { font-size: 12px; color: var(--color-warning-strong); font-weight: 600; }
.mode-flag.chosen-flag { color: var(--color-ink); }
.cost-list { display: grid; gap: var(--space-2); align-content: start; }
.cost-details > summary { margin-top: var(--space-2); }
.cost-details[open] > .grid-2 { margin-top: var(--space-3); }
.grid-2.tight { gap: var(--space-4); }

/* Scenarios */
.preset-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.preset { text-align: left; display: grid; gap: 4px; padding: 14px; border-radius: var(--radius-md); border: 1px dashed var(--color-border-strong); background: var(--color-surface); }
.preset:hover:not(:disabled) { border-style: solid; }
.preset small { color: var(--color-text-secondary); }
.compare { margin-bottom: var(--space-5); }
.compare-grid { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: var(--space-2); }
.compare-col { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-4); box-shadow: var(--shadow-1); }
.compare-col.current { background: var(--color-surface-muted); box-shadow: none; }
.compare-col.selected { border: 2px solid var(--color-ink); padding: 15px; }
.compare-col header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px; margin-bottom: var(--space-2); }
.compare-col header .eyebrow { width: 100%; margin: 0; }
.compare-col dl { margin: 0; display: grid; }
.compare-col dl > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: var(--space-2); padding: 8px 0; border-bottom: 1px solid var(--color-border-subtle); }
.compare-col dl > div:last-child { border-bottom: 0; }
.compare-grid:has(> .compare-col:only-child) { max-width: 600px; }
.compare-col dt { font-size: 12.5px; color: var(--color-text-secondary); }
.compare-col dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; align-items: baseline; text-align: right; }
.prov-note { font-size: 12.5px; color: var(--color-warning-strong); background: var(--color-warning-soft); border-radius: var(--radius-sm); padding: 6px 8px; margin: 0 0 6px; }
.prov { font-size: 11.5px; font-weight: 600; color: var(--color-warning-strong); }
.delta { font-size: 12.5px; font-weight: 600; color: var(--color-text-secondary); }
.delta.up { color: var(--color-success-strong); }
.delta.down { color: var(--color-danger); }
.chips-row { margin: 14px 0; font-size: var(--text-helper); }
.delta-chips { list-style: none; padding: 0; margin: var(--space-2) 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.delta-chips li { padding: 4px 10px; border-radius: var(--radius-sm); background: var(--color-surface-muted); font-size: 12.5px; }
.delta-chips span { color: var(--color-text-secondary); }
.levers { display: grid; gap: 14px; }
.levers fieldset { border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 14px var(--space-4); margin: 0; min-width: 0; }
.levers legend { font-weight: 600; padding: 0 6px; }
.levers .subpanel { margin-top: var(--space-3); }

/* Decisions */
.decision-flow { list-style: none; padding: 0; margin: 0 0 var(--space-6); display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.decision-flow a { display: flex; gap: 10px; align-items: flex-start; padding: var(--space-3) 14px; border-radius: var(--radius-md); background: var(--color-surface); border: 1px solid var(--color-border); color: var(--color-ink); text-decoration: none; height: 100%; }
.decision-flow a:hover { border-color: var(--color-border-strong); }
.decision-flow [aria-current="step"] a { border-color: var(--color-border-strong); box-shadow: var(--shadow-1); }
.decision-flow [aria-current="step"] .n { background: var(--color-accent-strong); color: var(--color-on-ink); }
.decision-flow .n { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--color-surface-muted); font-size: var(--text-meta); font-weight: 700; }
.decision-flow small { display: block; color: var(--color-text-secondary); }
.decisions { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; margin-bottom: var(--space-5); align-items: start; }
.decision { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-4); display: grid; gap: 10px; align-content: start; box-shadow: var(--shadow-1); }
.decision header { display: flex; gap: var(--space-2); align-items: center; }
.decision header .icon-btn, .decision header .lock { margin-left: auto; }
.decision .choice { font-weight: 600; }
.decision .next-action { font-size: var(--text-helper); }
.lock { color: var(--color-success-strong); display: grid; }
.decision-group { margin-bottom: var(--space-6); }
.decision-group > h2 { margin-bottom: var(--space-3); }
.decision-rows { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-1); padding: 4px var(--space-5); }
.decision-rows .decision.locked { background: none; border: 0; border-top: 1px solid var(--color-border-subtle); border-radius: 0; box-shadow: none; padding: 14px 0; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--space-4); }
.decision-rows .decision.locked:first-child { border-top: 0; }
.decision-rows .decision.locked > header { grid-column: 1 / -1; }
.decision-rows .decision.locked > footer { grid-column: 2; grid-row: 2 / span 3; align-self: start; }
.decision-rows .decision.locked > :not(header):not(footer) { grid-column: 1; }
/* Kesimpulan (0.29): one page, answer first. The article is exactly what the PDF shows; the tools above it are not printed. */
.concl-tools { margin: 0 0 var(--space-5); }
.concl-tools .add-row { margin-top: 0; }
.concl-short { display: block; width: 100%; margin-top: var(--space-2); padding: var(--space-3); font-family: inherit; font-size: 16px; line-height: 1.5; color: var(--color-ink); background: var(--color-surface-muted); border: 1px solid var(--color-border); border-radius: var(--radius-md); resize: vertical; }
.conclusion { max-width: 780px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-6) var(--space-8); }
.concl-head { padding-bottom: var(--space-4); border-bottom: 2px solid var(--color-ink); }
.concl-brand { margin: 0; font-weight: 700; color: var(--color-accent); }
.concl-head h2 { margin: 2px 0 4px; font-size: 1.6rem; line-height: 1.25; }
.concl-head p { margin: 0; }
.concl-demo { display: inline-block; margin-top: var(--space-2) !important; padding: 2px 10px; border-radius: var(--radius-sm); background: var(--color-warning-soft); color: var(--color-warning-strong); font-weight: 600; font-size: 13px; }
.concl-sec { padding: var(--space-5) 0 var(--space-4); border-top: 1px solid var(--color-border-subtle); }
.concl-head + .concl-sec { border-top: 0; }
.concl-sec h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 var(--space-2); font-size: 1.12rem; break-after: avoid; }
.concl-sec h3 { margin: var(--space-3) 0 var(--space-1); font-size: .95rem; break-after: avoid; }
.concl-lead { margin: 0 0 var(--space-2); font-size: 1.02rem; line-height: 1.55; }
.concl-lead .status-chip { margin-right: 6px; vertical-align: 1px; }
.concl-list li { padding: 3px 0; }
.concl-list .ico { width: 16px; height: 16px; vertical-align: -3px; color: var(--color-text-secondary); }
.concl-sec .ledger .row, .concl-list li { break-inside: avoid; }
.concl-disclaimer { margin: var(--space-4) 0 0; }
@media (max-width: 640px) { .conclusion { padding: var(--space-4); border-radius: var(--radius-md); } .concl-head h2 { font-size: 1.3rem; } }

/* Discussion */
.discussion { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: var(--space-5); align-items: start; }
.stepper { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; position: sticky; top: 76px; }
.step { width: 100%; display: flex; gap: 10px; align-items: center; text-align: left; padding: 8px 10px; border-radius: var(--radius-md); border: 1px solid transparent; background: transparent; }
.step:hover { background: var(--color-surface-muted); }
.step.current { background: var(--color-surface); border-color: var(--color-border); box-shadow: var(--shadow-1); }
.step-n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--color-surface-muted); color: var(--color-text-secondary); flex: none; }
.step.current .step-n { background: var(--color-accent-strong); color: var(--color-on-ink); }
.step.agreed .step-n { background: var(--color-success-soft); color: var(--color-success-strong); }
.step-t { display: grid; font-size: var(--text-helper); font-weight: 600; }
.step-t small { font-size: 11.5px; color: var(--color-text-secondary); font-weight: 500; }
.discussion-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-xl); padding: var(--space-8); display: grid; gap: var(--space-5); box-shadow: var(--shadow-3); }
.discussion-card > h2 { font: 500 clamp(22px, 2.4vw, 28px)/1.25 var(--font-display); }
.impact { background: var(--color-surface-muted); border-radius: var(--radius-lg); padding: 14px; }
.impact .metrics { margin: 0; }
.impact .metric { background: var(--color-surface); border-color: transparent; }
.options { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.options legend { font-weight: 600; margin-bottom: var(--space-2); }
.option { text-align: left; display: grid; gap: 2px; padding: 14px var(--space-4); border-radius: var(--radius-md); border: 1px solid var(--color-border-strong); background: var(--color-surface); }
.option small { color: var(--color-text-secondary); }
.option:hover { border-color: var(--color-border-input); }
.option.chosen { border: 2px solid var(--color-ink); padding: 13px 15px; }
.option.chosen b::before { content: "✓ "; }
.conflicts { display: grid; gap: var(--space-4); margin: var(--space-3) 0; }
.conflict > p { font-weight: 600; margin-bottom: 6px; }
.conflict .options { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--space-2); }
.conflict .option small { color: var(--color-text-secondary); }
.callout.tone-risk { background: var(--color-danger-soft); }
.sync-line a { margin-left: var(--space-2); }
.invite { margin: var(--space-4) 0; }
.decision-box { border-top: 1px solid var(--color-border-subtle); padding-top: 14px; display: grid; gap: 10px; }
.decision-box .eyebrow { margin: 0; }
.discussion-nav { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* Settings */
.settings-link { margin-top: calc(-1 * var(--space-2)); }
.lang-switch { display: inline-flex; border: 1px solid var(--color-border-strong); border-radius: var(--radius-md); padding: 2px; background: var(--color-surface); }
.lang-btn { border: 0; background: transparent; border-radius: var(--radius-sm); padding: 5px 12px; font-size: 12.5px; font-weight: 700; letter-spacing: .04em; color: var(--color-text-secondary); min-height: 32px; }
.lang-btn.on { background: var(--color-ink); color: var(--color-on-ink); }
.section-jump { display: flex; gap: var(--space-2); flex-wrap: wrap; margin: calc(-1 * var(--space-2)) 0 var(--space-5); }
.jump { display: inline-flex; align-items: center; gap: var(--space-2); border: 1px solid var(--color-border-strong); background: var(--color-surface); border-radius: var(--radius-md); padding: 6px 14px 6px 6px; font-weight: 600; font-size: var(--text-helper); }
.jump span { width: 24px; height: 24px; border-radius: 50%; background: var(--color-surface-muted); display: grid; place-items: center; font-size: 12px; }
.pref-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-4) var(--space-6); align-items: center; padding: 14px 0; border-bottom: 1px solid var(--color-border-subtle); }
.pref-row:last-child { border-bottom: 0; }
.pref-row h3 { margin-bottom: 4px; }
.lang-choices { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.lang-choice { display: grid; gap: 2px; text-align: left; min-width: 150px; padding: 10px 14px; border-radius: var(--radius-md); border: 1px solid var(--color-border-strong); background: var(--color-surface); }
.lang-choice small { color: var(--color-text-secondary); font-weight: 600; }
.lang-choice.on { border: 2px solid var(--color-ink); padding: 9px 13px; }
.fixed-value { display: grid; text-align: right; margin: 0; }
.fixed-value small { color: var(--color-text-secondary); }
.facts { list-style: none; padding: 0; margin: 0 0 var(--space-5); display: grid; gap: 10px; }
.facts li { display: flex; gap: 10px; font-size: 14px; color: var(--color-text-secondary); }
.facts .ico { width: 18px; height: 18px; color: var(--color-ink); margin-top: 2px; }
.data-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
/* Three tools side by side, each button on the same baseline whatever the note length; Reset sits apart below as one
   full-width row with a quiet red outline, so the destructive action never reads as a peer of Export. */
.data-actions > div { border-radius: var(--radius-md); padding: var(--space-4); display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); background: var(--color-surface-muted); }
.data-actions > div > .btn { margin-top: auto; max-width: 100%; white-space: normal; text-align: center; } /* long labels ("Minta penyimpanan permanen") wrap inside the card */
.data-actions .danger-zone { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3) var(--space-5); margin-top: var(--space-2); background: transparent; border: 1px solid var(--color-danger-soft); }
.data-actions .danger-zone > div { display: grid; gap: var(--space-1); max-width: 60ch; }
.data-actions .danger-zone > .btn { margin-top: 0; }
.save-note { font-size: var(--text-meta); color: var(--color-text-secondary); margin-top: 10px; }
.save-note.tone-risk { color: var(--color-danger); font-weight: 600; }

/* One small motion: the funding bar fills once when Overview opens. */
/* Read-first rows (0.27, every page): icon tile, name, what it is, amount; the row opens to its editor. */
.lrow-list { display: grid; border-top: 1px solid var(--color-border-subtle); margin-top: var(--space-3); }
.lrow { border-bottom: 1px solid var(--color-border-subtle); }
.lrow-head { all: unset; box-sizing: border-box; width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; column-gap: var(--space-3); padding: var(--space-3) var(--space-2); border-radius: var(--radius-sm); cursor: pointer; }
.lrow-head:hover { background: var(--color-surface-hover); }
.lrow-head:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 2px; }
.lrow-ico { width: 36px; height: 36px; display: grid; place-items: center; border-radius: var(--radius-sm); background: var(--color-surface-muted); color: var(--color-ink); }
.lrow-ico .ico { width: 20px; height: 20px; }
.lrow-name { display: grid; gap: 2px; min-width: 0; }
.lrow-name b, .lrow-val b { font-weight: 600; }
.lrow-name small, .lrow-val small { color: var(--color-text-secondary); font-size: var(--text-meta); }
.lrow-val { display: grid; justify-items: end; gap: 2px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lrow.is-open { background: var(--color-surface-hover); border-radius: var(--radius-md); margin: 0 calc(-1 * var(--space-3)); padding: 0 var(--space-3) var(--space-4); }
.lrow-body { display: grid; gap: var(--space-4); padding: var(--space-2) var(--space-2) 0; }
.lrow-name small { display: block; }
.lrow-head.no-ico { grid-template-columns: minmax(0, 1fr) auto auto; }
.lrow-line { display: flex; align-items: center; gap: var(--space-2); padding-left: var(--space-2); }
.lrow-line > .lrow-head { flex: 1; min-width: 0; padding-left: var(--space-1); }
.lrow-line > .tag, .lrow-line > .btn { flex: none; }
.lrow.is-included .lrow-name b { font-weight: 500; color: var(--color-text-secondary); }
.lrow.is-done .lrow-name b { color: var(--color-text-secondary); text-decoration: line-through; }
.lrow > .item-quotes { display: inline-block; margin: 0 0 var(--space-2) calc(36px + var(--space-3) + var(--space-2)); }
/* Rows follow the width of their panel, not the screen: in a phone or in the narrow Budget side column,
   the amount goes under the name and the icon spans both lines. */
.panel { container-type: inline-size; }
@container (max-width: 480px) {
  .lrow-head { grid-template-columns: auto minmax(0, 1fr) auto; row-gap: 2px; }
  .lrow-ico { grid-row: 1 / span 2; }
  .lrow-val { grid-column: 2; grid-row: 2; justify-items: start; white-space: normal; }
  .lrow-head .lr-chev { grid-column: 3; grid-row: 1; }
  .lrow-head.no-ico { grid-template-columns: minmax(0, 1fr) auto; }
  .lrow-head.no-ico .lrow-val { grid-column: 1; }
  .lrow-head.no-ico .lr-chev { grid-column: 2; }
  .lrow-line { flex-wrap: wrap; }
}
.lrow-name small .p-ico { display: inline-flex; vertical-align: -2px; margin-right: 4px; }
.lrow-ico.p-a { background: var(--color-partner-1-soft); color: var(--color-partner-1); }
.lrow-ico.p-b { background: var(--color-partner-2-soft); color: var(--color-partner-2); }
.lines > .lrow:first-child { border-top: 1px solid var(--color-border-subtle); }
.lrow-body > .line { border: 0; padding: 0; }
.lrow-body > .line-details { padding-top: 0; }
.plan-add { margin-top: var(--space-5); }
.plan-add .add-row { margin-top: var(--space-2); }
.later { margin-top: var(--space-5); padding-top: var(--space-4); border-top: 1px solid var(--color-border-subtle); }
.later li { padding: 4px 0; }
.mode-pick { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.mode-pick legend { font-size: var(--text-meta); font-weight: 600; margin-bottom: 6px; }

@media (prefers-reduced-motion: no-preference) {
  .ov-budget .stack .seg { animation: lb-grow .7s cubic-bezier(.2, .8, .2, 1) both; transform-origin: left center; }
  @keyframes lb-grow { from { transform: scaleX(0); } }
}

/* ================================================================ 6. responsive */
@media (min-width: 901px) {
  .app { display: grid; grid-template-columns: 248px minmax(0, 1fr); align-items: start; }
  .app > .sidebar { grid-column: 1; grid-row: 1; }
  .app > .main-col { grid-column: 2; grid-row: 1; min-height: 100dvh; }
  .topbar, .area-tabs { display: none; }
  /* During a discussion the sidebar steps aside; the top bar offers a way out. */
  .app.is-meeting { grid-template-columns: minmax(0, 1fr); }
  .app.is-meeting > .sidebar { display: none; }
  .app.is-meeting > .topbar { display: flex; grid-column: 1; grid-row: 1; }
  .app.is-meeting > .main-col { grid-column: 1; grid-row: 2; min-height: 0; }
}
@media (min-width: 1000px) {
  .welcome-main { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: center; gap: var(--space-8) var(--space-12); }
  .welcome-main > .banner, .welcome-main > .by { grid-column: 1 / -1; }
}
@media (max-width: 1100px) {
  .discussion { grid-template-columns: 1fr; }
  .stepper { position: static; display: flex; overflow-x: auto; gap: 6px; padding-bottom: 4px; scrollbar-width: thin; }
  .stepper li { flex: none; }
  .step { width: auto; border-color: var(--color-border); background: var(--color-surface); }
  .step-t small { display: none; }
  .ov-columns { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .app { display: block; }
  .sidebar { display: none; }
  main { padding: var(--space-5) var(--space-4) 120px; }
  .banner { margin: 10px var(--space-4) 0; }
  .foot { padding: var(--space-4) var(--space-4) 96px; }
  .bottom-nav { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: var(--color-surface); border-top: 1px solid var(--color-border); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
  .bottom-nav ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); }
  .bottom-nav a { display: grid; justify-items: center; gap: 2px; padding: 6px 2px; font-size: 11.5px; font-weight: 600; color: var(--color-text-secondary); text-decoration: none; border-radius: var(--radius-md); }
  .bottom-nav a span { white-space: nowrap; }
  .bottom-nav a[aria-current="page"] { color: var(--color-ink); background: var(--color-surface-muted); }
  .bottom-nav a[aria-current="page"] .ico { color: var(--color-accent-strong); }
  .toast-region { bottom: 84px; }
  /* Area pages as equal tabs that wrap instead of scrolling sideways. */
  /* Tabs share the width by the length of their label ("Kesepakatan" needs more than "Tamu"), wrapping inside, never sideways. */
  .area-tabs { display: flex; flex-wrap: wrap; width: 100%; overflow: visible; gap: 4px; }
  .area-tabs a { flex: 1 1 0; min-width: min-content; display: grid; place-items: center; min-height: 44px; padding: 6px 8px; text-align: center; white-space: normal; line-height: 1.2; font-size: 13.5px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .panel { padding: var(--space-5); }
  .discussion-card { padding: var(--space-5); }
  .wed-columns { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-template-areas: "basics" "main" "support" "cats"; }
  .headline-side { padding: 14px 0 0; border-left: 0; border-top: 1px solid var(--color-border); }
}
/* Phones and touch screens (iPhone and iPad Safari included). */
@media (max-width: 900px), (pointer: coarse) {
  /* iOS Safari zooms into a field whose text is under 16 px; at 16 px the page stays put. */
  input:not([type="checkbox"]):not([type="radio"]), select, textarea { font-size: 16px; }
  /* Standalone links and disclosures get at least a 24 px tall target (WCAG 2.2); links inside sentences stay inline. */
  :where(main) a:where(:not(.btn, p a, .hint a)), :where(main) .link { display: inline-block; padding-block: 4px; }
  :root summary { padding-block: 10px; }
  .task-check { width: 24px; height: 24px; }
  .topbar .brand { min-height: 44px; }
}
@media (max-width: 640px) {
  .headline, .ov-budget, .ov-start { padding: var(--space-5); margin-bottom: var(--space-6); border-radius: var(--radius-lg); }
  .ov-budget { margin-bottom: var(--space-5); }
  .banner-demo { flex-wrap: nowrap; justify-content: space-between; padding: 6px 10px; }
  .banner-demo .banner-long { display: none; }
  .banner-demo .banner-short { display: inline; }
  .banner-demo .btn { flex: none; }
  .is-demo .topbar .tag-demo { display: none; }
  .couple-head { margin-bottom: var(--space-4); }
  .couple h1 { font-size: 26px; }
  .couple-mark { width: 50px; height: 30px; }
  .couple-mark i { width: 30px; height: 30px; font-size: 12px; }
  .couple-mark .pb { left: 20px; }
  .couple-when { font-size: var(--text-meta); }
  .figure-parts { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: var(--space-2) 10px; }
  .figure-parts .part { min-width: 0; }
  .headline-figure b { font-size: clamp(21px, 6.2vw, 28px); }
  .preview-frame { padding: 10px; }
  .preview-frame .headline { padding: 14px; }
  .ov-start { align-items: flex-start; }
  .side-value { font-size: 28px; }
}
@media (max-width: 560px) {
  .status-line .save { display: none; }
  .top-actions .label-wide { display: none; }
  .metrics { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .metrics.three { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .metric { padding: var(--space-3); }
  .metric-value { font-size: 18px; }
  .item-grid.cols-3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .item-grid.cols-2 { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
  .item-head { flex-wrap: wrap; }
  .item-head .grow { flex-basis: calc(100% - 46px); order: 1; }
  .item-head > .icon-btn { order: 2; }
  .item-head .field:not(.grow) { width: auto; flex: 1 1 100%; order: 3; }
  .pay-list li { grid-template-columns: 1fr auto auto; }
  .pay-list li .muted { grid-column: 1 / -1; grid-row: 2; }
  .bars li { grid-template-columns: 1fr auto; }
  .bars .bar { grid-column: 1 / -1; grid-row: 2; }
  .bars small { display: none; }
  .insight { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .decisions { grid-template-columns: minmax(0, 1fr); }
  .compare-col dl > div { grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: var(--space-2); padding: 5px 0; }
  .compare-col dd { justify-content: flex-end; text-align: right; font-size: 14px; }
  .schedule thead { display: none; }
  .schedule tr { display: grid; grid-template-columns: 1fr 1fr; padding: var(--space-2) 0; border-bottom: 1px solid var(--color-border-subtle); }
  .schedule th, .schedule td { border: 0; padding: 3px 6px; text-align: left !important; }
  .schedule td:nth-child(2) { grid-column: 1 / -1; }
  /* Editable rows: name and amount side by side, the rest below. */
  .line.compact-line:not(.is-read), .cost-list .line { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr) auto; gap: 4px var(--space-2); align-items: end; }
  .compact-line > .icon-btn, .cost-list .line > .icon-btn { grid-column: 3; grid-row: 1; }
  .compact-line > .line-more { grid-column: 1 / -1; grid-row: 2; margin: 0; padding: 2px 0; }
  .compact-line > .line-details { grid-column: 1 / -1; grid-row: 3; }
  .compact-line > .line-total, .cost-list .line > .line-total { grid-column: 1 / -1; padding-bottom: 0; }
  /* Open rows: the name gets the full width (it was cut to "Dana darur"), the amount sits below it. */
  .line.compact-line:not(.is-read) { grid-template-columns: minmax(0, 1fr) auto; }
  .compact-line:not(.is-read) > .field:first-child { grid-column: 1; grid-row: 1; }
  .compact-line:not(.is-read) > .icon-btn { grid-column: 2; grid-row: 1; }
  .compact-line:not(.is-read) > .line-more, .compact-line:not(.is-read) > .line-details { grid-row: auto; }
  /* Housing and vehicle choices scroll sideways instead of stacking five cards. */
  .mode-cards { display: flex; overflow-x: auto; gap: var(--space-2); padding-bottom: 6px; scroll-snap-type: x proximity; }
  .mode-card { flex: 0 0 210px; scroll-snap-align: start; }
  .answer-gap { text-align: left; }
  .gap-value { font-size: 22px; }
  .pref-row { grid-template-columns: minmax(0, 1fr); }
  .fixed-value { text-align: left; }
  .lang-choice { min-width: 0; flex: 1; }
  .task-head { flex-wrap: wrap; }
  .task-head .grow { flex: 1 1 calc(100% - 100px); min-width: 0; }
  .task-head .tag { order: 5; }
  .task-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-2); }
  .quote .task-grid > .field:first-child { grid-column: 1 / -1; }
  .quote .task-line { flex-wrap: wrap; }
  .quote .task-open { flex-basis: 100%; }
  .subtabs a { padding: 8px 10px; font-size: 13.5px; }
  .area-tabs a { padding: 6px 4px; } /* four Indonesian labels ("Kesimpulan" can't wrap) fit 360px; narrower wraps to a second row */
  .table th, .table td { padding: 8px 6px; } /* three amount columns fit 360px */
  .line.guest { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
  .line.guest > .field:first-child { grid-column: 1 / 3; }
  .line.guest > .field:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .line.guest > .field:last-of-type { grid-column: 1 / 3; }
  .line.guest > .icon-btn { grid-column: 3; grid-row: 1; align-self: end; }
  .pay-upcoming li { grid-template-columns: minmax(0, 1fr) auto; }
  .pay-upcoming .what { grid-column: 1 / -1; grid-row: 1; }
}
@media (max-width: 360px) {
  .metrics { grid-template-columns: minmax(0, 1fr); }
}

/* ================================================================ 7. print: Kesimpulan as an A4 PDF */
@media print {
  /* Kesimpulan as an A4 PDF: only the article, on white, colours of chips and tags kept. */
  @page { size: A4; margin: 16mm 15mm 18mm; }
  body:has(#conclusion) { background: var(--color-surface); }
  body:has(#conclusion) main > :not(#conclusion), body:has(#conclusion) .foot, body:has(#conclusion) .skip, body:has(#conclusion) .banner { display: none !important; }
  body:has(#conclusion) main { max-width: none; padding: 0; margin: 0; }
  .conclusion { max-width: none; border: 0; border-radius: 0; padding: 0; font-size: 10.5pt; color: var(--color-ink); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .concl-head h2 { font-size: 18pt; }
  .concl-sec { padding: 10pt 0 6pt; }
  .concl-sec h2 { font-size: 12.5pt; }
  .conclusion .ledger { margin-top: 4pt; }
  .conclusion .ledger .row { padding-top: 4pt; padding-bottom: 4pt; }
  .concl-list li { padding: 1pt 0; }
  .concl-disclaimer { break-before: avoid; }
  .sidebar, .bottom-nav, .topbar, .toast-region { display: none !important; }
}
