/* SUMMA 03 — Paper & Ink
   Identity and composition. layout.css owns established component behaviour.
   System serif + locally bundled Figtree: works offline, no remote font requests. */
:root {
  color-scheme: light;
  --canvas: #f5f3ec; --paper: #fffef9; --surface-soft: #eeece3; --hover: #ede9de;
  --ink: #292b25; --muted: #6b6d60; --line: #dedfd2;
  --accent: #b5472c; --accent-hover: #91351f; --accent-soft: #f7e9e0;
  --blue: var(--accent); --blue-dark: var(--accent-hover); --blue-strong: var(--accent); --blue-soft: var(--accent-soft);
  --navy: var(--accent); --navy-soft: var(--accent-hover); --focus: #b5472c;
  --brand-navy: var(--canvas); --brand-navy-soft: var(--paper); --brand-nav-muted: var(--muted);
  /* Signaalkleuren (27 sep 2026, ontwerp F): fel en in elk palet gelijk. Rood = te laat, oranje = nakijken,
     groen = goed nieuws. De vorm staat in signal.css: te laat gevuld, nakijken omlijnd. */
  --green: #237a2f; --green-soft: #e2f3e3; --green-line: #a8d5ad;
  --amber: #a94e00; --amber-soft: #fff1dc; --amber-line: #e9b877;
  --danger: #c8281b; --danger-soft: #fde5e2; --danger-line: #f4b9b1; --on-danger: #ffffff;
  --studio-hero: var(--accent); --studio-hero-end: var(--accent); --studio-on-hero: #fffef9;
  --modern-ink: var(--ink); --modern-accent: var(--accent); --modern-success: var(--green);
  --modern-icon-blue-bg: var(--accent-soft); --modern-icon-green-bg: var(--green-soft); --modern-icon-orange-bg: var(--amber-soft);
  --radius: 12px; --radius-sm: 8px; --radius-md: 12px; --radius-lg: 18px;
  --shadow: 0 3px 10px #292b2505; --studio-page: 44px; --studio-space: 24px;
  --hero-paper: #ecebcf; --hero-ink: #343a28; --chart-bar: #c4c5ae; --sidebar-width: 220px;
  --font-display: Georgia, 'Times New Roman', serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #20221e; --paper: #282b25; --surface-soft: #30342c; --hover: #383d32;
  --ink: #f1efdf; --muted: #b7baaa; --line: #444a3c;
  --accent: #f19b7b; --accent-hover: #ffc1a5; --accent-soft: #46362b;
  --navy: #b5472c; --navy-soft: #91351f; --focus: #f19b7b;
  --studio-hero: #b5472c; --hero-paper: #383f2d; --hero-ink: #f1efdf; --chart-bar: #697258;
  --green: #5fd36f; --green-soft: #12351a; --green-line: #26652f;
  --amber: #ffb224; --amber-soft: #3a2a0c; --amber-line: #7a5516;
  --danger: #ff5d4f; --danger-soft: #44191a; --danger-line: #7a2b27; --on-danger: #1a0605;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --canvas: #20221e; --paper: #282b25; --surface-soft: #30342c; --hover: #383d32;
    --ink: #f1efdf; --muted: #b7baaa; --line: #444a3c;
    --accent: #f19b7b; --accent-hover: #ffc1a5; --accent-soft: #46362b;
    --navy: #b5472c; --navy-soft: #91351f; --focus: #f19b7b;
    --studio-hero: #b5472c; --hero-paper: #383f2d; --hero-ink: #f1efdf; --chart-bar: #697258;
    --green: #5fd36f; --green-soft: #12351a; --green-line: #26652f;
    --amber: #ffb224; --amber-soft: #3a2a0c; --amber-line: #7a5516;
    --danger: #ff5d4f; --danger-soft: #44191a; --danger-line: #7a2b27; --on-danger: #1a0605;
  }
}
body { background: var(--canvas); color: var(--ink); font-family: Figtree, -apple-system, sans-serif; letter-spacing: -.014em; }
button, input, select, textarea { font-family: inherit; }
button, .button { box-shadow: none; }
button.primary:hover, .button.primary:hover { background: var(--navy-soft); border-color: var(--navy-soft); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
::selection { background: var(--accent-soft); color: var(--ink); }
.main, .main:has(#todayView:not([hidden])) { max-width: 1480px; padding: 38px var(--studio-page) 70px; }
.app { grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
.brand-period, .modern-welcome em { color: var(--accent); font-style: normal; }
.brand strong, .modern-brand strong, .first-run-brand strong, .first-run-mobile-brand strong { font-size: 29px; font-weight: 700; letter-spacing: -.075em; color: var(--ink); }
.brand-logo { width: 34px; height: 34px; border-radius: 10px; }
.studio-nav-label, .studio-eyebrow { display: block; font-size: 12px; line-height: 1.4; font-weight: 650; letter-spacing: .16em; color: var(--muted); }
.studio-nav-label { margin: 14px 16px 12px; }
.sidebar { padding: 36px 14px 22px; gap: 6px; }
.sidebar .brand { padding: 0 14px 32px; gap: 10px; }
.sidebar .privacy-note { padding: 18px 12px; }
.sidebar .privacy-note strong { font-size: 12px; }
.sidebar .privacy-note small { font-size: 12px; line-height: 1.6; }
.sidebar .sidebar-foot { border-top: 1px solid var(--line); }
.sidebar .nav-button { min-height: 46px; padding: 12px 15px; font-size: 13px; border-radius: 8px; color: var(--muted); }
.sidebar .nav-button .nav-icon { width: 19px; height: 19px; color: currentColor; }
.sidebar .nav-button.is-active { background: var(--paper); color: var(--ink); box-shadow: 0 2px 4px #292b2506; }
.sidebar .nav-button.is-active::before { display: none; }
.sidebar .nav-button.is-active .nav-icon { color: var(--accent); }
.sidebar .nav-button:hover { background: var(--hover); color: var(--ink); }
.sidebar .nav-count { background: var(--accent-soft); color: var(--accent); border-radius: 5px; }
.page-head h1, .main .page-head h1 { font: 400 clamp(32px, 3vw, 45px)/1.12 var(--font-display); letter-spacing: -.055em; }
.page-head p { margin-top: 9px; font-size: 13px; }
.main > :is(#invoicesView, #expensesView, #moneyView, #checksView, #workView, #settingsView) > .page-head { min-height: 94px; margin-bottom: 26px; }
.main h2 { color: var(--ink); }
.page-header-action { min-height: 43px; font-size: 12px; }
.main :is(.panel, .invoice-browser, .expense-browser) { border-color: var(--line); border-radius: 12px; box-shadow: none; }
.invoice-avatar, .expense-avatar { border-radius: 8px; font-size: 12px; background: var(--surface-soft) !important; color: var(--muted) !important; }
.invoice-status { border-radius: 5px; font-size: 12px; letter-spacing: .015em; }
.invoice-table-head, .expense-table-head { background: var(--surface-soft); color: var(--muted); font-size: 12px; letter-spacing: .055em; text-transform: uppercase; }
.invoice-toolbar, .expense-toolbar { padding-block: 18px; }
.invoice-row-open .amount { font-size: 16px; font-variant-numeric: tabular-nums; }
.invoice-list-row:hover, .expense-list-row:hover { background: var(--surface-soft); }
/* Selected KPI cards share an even two-pixel edge on all four sides. */
.main :is(#invoicesView, #expensesView, #moneyView, #workView) > .invoice-metrics { gap: 12px; margin-bottom: 28px; }
.main :is(#invoicesView, #expensesView, #moneyView, #workView) > .invoice-metrics :is(.invoice-hero-card, .invoice-kpi-card) {
  background: var(--paper); color: var(--ink); border: 1px solid var(--line); box-shadow: none;
  border-radius: 10px; padding: 22px; min-height: 150px; position: relative;
}
.main :is(#invoicesView, #expensesView, #moneyView) > .invoice-metrics :is(.invoice-hero-card, .invoice-kpi-card).is-active,
.main #moneyView > .invoice-metrics .insights-kpi-card[aria-selected="true"],
.main :is(#invoicesView, #expensesView, #moneyView) > .invoice-metrics :is(.invoice-hero-card, .invoice-kpi-card).is-active:hover {
  background: var(--accent-soft); color: var(--ink); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent);
}
.main :is(#invoicesView, #expensesView, #moneyView) > .invoice-metrics :is(.invoice-hero-card, .invoice-kpi-card).is-active > :is(span, strong, small) { color: var(--ink); }
.main :is(#invoicesView, #expensesView, #moneyView, #workView) > .invoice-metrics :is(.invoice-hero-card, .invoice-kpi-card) > strong { font: 400 32px/1.15 var(--font-display); letter-spacing: -.055em; font-variant-numeric: lining-nums tabular-nums; margin: 14px 0 8px; }
.main :is(#invoicesView, #expensesView, #moneyView, #workView) > .invoice-metrics :is(.invoice-hero-card, .invoice-kpi-card) > span { font-size: 12px; }
.main :is(#invoicesView, #expensesView, #moneyView) > .invoice-metrics :is(.invoice-hero-card, .invoice-kpi-card):not(.is-active) { box-shadow: none; }
.main #moneyView > .invoice-metrics .insights-kpi-card[aria-selected="true"] .insights-kpi-warning { color: var(--danger); }
/* Today: an open spread — revenue, six-month rhythm, next actions, work totals. */
#todayView .today-mobile-dashboard { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 26px; min-height: 0; }
#todayView .modern-topbar { display: flex; grid-column: 1 / -1; margin: 0; padding: 0 0 17px; border-bottom: 1px solid var(--line); }
#todayView .modern-topbar .modern-brand { display: flex; }
#todayView .modern-topbar .modern-brand img, #todayView .modern-topbar .modern-brand strong, #todayView .modern-topbar .modern-brand .summa-wordmark { display: none; }
#todayView .modern-topbar .modern-brand::before { content: 'OVERZICHT'; color: var(--muted); font-size: 12px; letter-spacing: .17em; font-weight: 600; }
.modern-avatar { background: var(--paper); border: 1px solid var(--line); color: var(--ink); width: 34px; height: 34px; min-height: 34px; box-shadow: none; }
.modern-avatar-initials { font-size: 12px; }
#todayView .modern-welcome { grid-column: 1 / -1; margin: 9px 0 6px; padding: 0; min-height: 0; }
.modern-welcome .studio-eyebrow { color: var(--accent); margin-bottom: 14px; }
#todayView .modern-welcome h1 { font: 400 clamp(38px, 4.5vw, 64px)/1.1 var(--font-display); letter-spacing: -.065em; margin: 0; }
#todayView .modern-welcome p { margin-top: 14px; font-size: 12px; text-transform: capitalize; color: var(--muted); }
#todayView .today-desktop-head, #todayList { display: none; }
.main #todayView .modern-overview-card,
.main #todayView .modern-overview-card:hover, .main #todayView .modern-overview-card:active {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; text-align: left;
  position: relative; grid-column: 1; grid-row: auto; min-height: 280px; height: auto; width: 100%; padding: 30px 32px;
  background: var(--hero-paper); color: var(--hero-ink); border: 1px solid transparent; border-radius: 13px; box-shadow: none;
}
#todayView .modern-overview-card .modern-overview-label { color: var(--hero-ink); font-size: 12px; font-weight: 500; }
#todayView .modern-overview-card > strong { color: var(--hero-ink); font: 400 clamp(38px, 4vw, 60px)/1.1 var(--font-display); letter-spacing: -.065em; margin: 22px 0 18px; padding: 0; overflow-wrap: anywhere; }
#todayView .modern-overview-card .today-mobile-trend { margin: 0 0 22px; color: var(--hero-ink); font-size: 12px; background: transparent; padding: 0; }
#todayView .modern-overview-card .today-mobile-trend strong, #todayView .modern-overview-card .today-mobile-trend span { color: inherit; }
#todayView .modern-trend-icon { background: transparent; color: var(--hero-ink); }
.studio-revenue-foot { display: flex; width: 100%; justify-content: space-between; align-items: center; font-size: 12px; margin-top: auto; padding-top: 14px; border-top: 1px solid color-mix(in srgb, var(--hero-ink) 18%, transparent); color: var(--hero-ink); }
.studio-revenue-foot > span { font-size: 23px; line-height: 1; }
.studio-rhythm { grid-column: 2; min-width: 0; padding: 24px 28px 16px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); }
.studio-rhythm h2 { font: 400 26px/1.15 var(--font-display); letter-spacing: -.035em; margin: 7px 0; }
.studio-rhythm header p { margin: 0; color: var(--muted); font-size: 12px; }
.studio-chart { display: flex; align-items: flex-end; gap: 12px; height: 140px; margin-top: 10px; }
.studio-chart-column { display: flex; flex: 1; min-width: 0; height: 100%; flex-direction: column; align-items: center; gap: 6px; }
.studio-chart-value { width: 100%; text-align: center; font-size: 8px; white-space: nowrap; color: var(--muted); }
.studio-chart-track { display: flex; align-items: flex-end; width: 100%; flex: 1; border-bottom: 1px solid var(--line); }
.studio-chart-track i { display: block; width: 100%; background: var(--chart-bar); border-radius: 4px 4px 0 0; }
.studio-chart-column.is-current i { background: var(--accent); }
.studio-chart-column i.is-negative { background: var(--danger); background-image: repeating-linear-gradient(45deg, transparent 0 4px, #ffffff55 4px 6px); }
.studio-chart-column small { font-size: 12px; color: var(--muted); }
.studio-chart-column.is-current small { color: var(--accent); font-weight: 650; }
.studio-chart-note { display: block; font-size: 12px; color: var(--muted); margin-top: 12px; }
#todayView .modern-daily-briefing { grid-column: 1 / -1; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; padding: 27px 0 0; margin: 4px 0 0; min-height: 0; }
.modern-focus-head { margin-bottom: 18px; align-items: center; }
.modern-focus-head strong { font: 400 29px/1.2 var(--font-display); letter-spacing: -.04em; }
.modern-focus-head small { font-size: 12px; margin-top: 6px; }
#todayFocusCount { border-radius: 6px; font-size: 12px; padding: 7px 10px; background: var(--accent-soft); color: var(--accent); }
.modern-focus-head-actions { display: flex; align-items: center; gap: 8px; }
.modern-focus-dismiss { min-height: 32px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); color: var(--ink); font-size: 12px; font-weight: 650; }
.modern-focus-collapsed[hidden] { display: none !important; }
.modern-daily-briefing.is-collapsed { padding: 0; border: 0; }
.modern-daily-briefing.is-collapsed > :not(.modern-focus-collapsed) { display: none; }
.modern-daily-briefing.is-collapsed .modern-focus-collapsed { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 52px; padding: 0 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); text-align: left; }
.modern-focus-collapsed span { color: var(--muted); }
.modern-focus-collapsed strong { font-size: 13px; }
.modern-daily-briefing .modern-attention h2 { display: none; }
.modern-daily-briefing .modern-attention-card, .modern-daily-briefing .modern-open-invoices {
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px; min-height: 82px;
}
.modern-daily-briefing #todayModernAttention .modern-attention-card { background: var(--accent-soft); border-color: transparent; }
.modern-daily-briefing .modern-focus-context { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.modern-daily-briefing :is(.modern-focus-action, .modern-row-chevron) { background: transparent; color: var(--accent); border: 0; box-shadow: none; font-size: 12px; }
.modern-daily-briefing :is(.modern-attention-card, .modern-open-invoices) strong { color: var(--ink); font-size: 13px; font-weight: 600; }
.modern-daily-briefing :is(.modern-attention-card, .modern-open-invoices) small { color: var(--muted); font-size: 12px; }
.modern-attention-icon, .modern-notification-icon { background: transparent; color: var(--accent); }
#todayView .modern-month-panel { grid-column: 1 / -1; padding: 24px 0 0; border-top: 1px solid var(--line); margin: 0; background: transparent; border-radius: 0; }
#todayFinancialTitle { font: 400 25px/1.2 var(--font-display); letter-spacing: -.04em; }
.modern-financial-summary > div { gap: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--paper); }
.modern-month-metric { border: 0; border-right: 1px solid var(--line); background: transparent; padding: 20px; border-radius: 0; }
.modern-month-metric:last-child { border-right: 0; }
.main .modern-month-icon { display: none; }
.modern-month-copy strong { font: 400 28px/1.2 var(--font-display); letter-spacing: -.04em; margin-top: 10px; }
.modern-month-copy small { font-size: 12px; }
.modern-quick-actions { margin-top: 20px; }
.modern-quick-actions > h2 { display: none; }
.modern-quick-actions > div { gap: 10px; }
.modern-quick-actions button { border-radius: 8px; background: var(--paper); color: var(--ink); border: 1px solid var(--line); min-height: 46px; }
.modern-quick-actions button.is-primary, #todayMobileAdd { background: var(--navy); color: #fffef9; border-color: var(--navy); }
/* Onboarding: oversized type and a drawn aperture, entirely local. */
.first-run { background: var(--canvas); }
.first-run-shell { max-width: 1120px; border: 1px solid var(--line); border-radius: 20px; background: var(--paper); box-shadow: 0 30px 100px #292b2510; overflow: hidden; }
.first-run-story { position: relative; background: var(--hero-paper); color: var(--hero-ink); padding: 46px; overflow: hidden; }
.first-run-story::before, .first-run-story::after { display: none; }
.first-run-brand { position: relative; z-index: 1; }
.first-run-brand strong { color: var(--hero-ink); }
.first-run-brand img, .first-run-mobile-brand img { width: 34px; height: 34px; }
.first-run-promise { position: relative; z-index: 1; margin-top: 72px; }
.first-run-story .first-run-kicker { color: var(--hero-ink); font-size: 12px; letter-spacing: .15em; }
.first-run-story h1 { color: var(--hero-ink); font: 400 clamp(42px, 4vw, 60px)/1.06 var(--font-display); letter-spacing: -.06em; margin: 18px 0 24px; }
.first-run-story p { color: var(--hero-ink); max-width: 36ch; font-size: 13px; line-height: 1.8; }
.first-run-benefits { position: relative; margin-top: 30px; }
.first-run-benefits li { background: transparent; border: 0; padding: 12px 0; }
.first-run-benefits strong { color: var(--hero-ink); font-size: 12px; }
.first-run-benefits small { color: var(--hero-ink); opacity: .8; font-size: 12px; }
.first-run-benefits .summa-icon { color: var(--hero-ink); background: transparent; }
.first-run-local-note { border-top: 1px solid #343a2830; padding-top: 20px; }
.first-run-card { padding: 52px; background: var(--paper); }
.first-run-step-copy h2 { color: var(--ink); font: 400 36px/1.15 var(--font-display); letter-spacing: -.05em; }
.first-run-kicker { color: var(--accent); }
.first-run-primary, .first-run-form .first-run-primary { background: var(--navy); border-color: var(--navy); color: #fffef9; border-radius: 8px; box-shadow: none; }
.first-run-primary:hover { background: var(--navy-soft); }
.first-run-form input { background: var(--canvas); border: 1px solid var(--line); border-radius: 8px; }
.first-run-form label > span { color: var(--ink); }
.first-run-terms, .first-run-step-copy p { color: var(--muted); }
.first-run-terms a { color: var(--accent); }
.studio-orbit { position: absolute; width: 260px; height: 260px; right: -100px; top: -110px; opacity: .5; }
.studio-orbit i { position: absolute; border: 1px solid var(--accent); border-radius: 50%; inset: 0; }
.studio-orbit i:nth-child(2) { inset: 24px; }.studio-orbit i:nth-child(3) { inset: 48px; }
.studio-orbit span { display: none; }
/* Shared surfaces and forms. */
.settings-panel-hero, .settings-panel-hero.is-green, .settings-panel-hero.is-orange { background: var(--surface-soft); }
.settings-panel-hero h2, .money-buddy-head h2, .checks-page-head h1 { font-family: var(--font-display); font-weight: 400; }
.main :is(.money-pot-card, .money-buddy-goals, .money-safe-card, .checks-status-card) { border-color: var(--line); box-shadow: none; }
.money-pot-gauge { --pot-color: var(--accent); }
.bar { background: var(--chart-bar); }.bar.revenue { background: var(--accent); }
.upload-zone, .drop-zone { background: var(--paper); border-color: var(--line); }
dialog { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; }
dialog::backdrop { background: #20221e88; backdrop-filter: blur(5px); }
@media (min-width: 721px) {
  .sidebar { background: var(--canvas); border-right: 1px solid var(--line); color: var(--ink); }
  .sidebar .brand strong, .sidebar .privacy-note strong { color: var(--ink); }
  .sidebar .privacy-note small { color: var(--muted); }
  .sidebar .nav-button.is-active { color: var(--ink); background: var(--paper); }
}
@media (min-width: 721px) and (max-width: 1100px) {
  :root { --sidebar-width: 84px; --studio-page: 28px; }
  .sidebar { padding-inline: 12px; }
  .sidebar .brand { padding: 0 0 28px; justify-content: center; }
  .sidebar .brand strong, .studio-nav-label, .sidebar .nav-button > span:not(.nav-count), .sidebar .privacy-note { display: none; }
  .sidebar .nav-button { justify-content: center; padding: 12px; }
  #todayView .today-mobile-dashboard { gap: 20px; }
  .studio-rhythm { padding: 22px 18px 16px; }
  .studio-chart { gap: 8px; }
  .main #todayView .modern-overview-card { padding: 28px 24px; }
  .modern-daily-briefing .modern-focus-context { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  :root { --studio-page: 20px; }
  .main, .main:has(#todayView:not([hidden])) { padding: 20px 20px calc(170px + env(safe-area-inset-bottom)); }
  .studio-nav-label { display: none; }
  .sidebar { padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); background: var(--paper); border-top: 1px solid var(--line); box-shadow: none; }
  .sidebar .nav-button { min-height: 50px; padding: 7px 2px; font-size: 12px; gap: 5px; }
  .sidebar .nav-button.is-active { background: var(--accent-soft); color: var(--accent); box-shadow: none; }
  .sidebar .nav-button .nav-icon { width: 21px; height: 21px; }
  #todayView .today-mobile-dashboard { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  #todayView .modern-topbar { padding-bottom: 16px; }
  #todayView .modern-topbar .modern-brand img, #todayView .modern-topbar .modern-brand strong, #todayView .modern-topbar .modern-brand .summa-wordmark { display: block; }
  #todayView .modern-topbar .modern-brand img { width: 28px; height: 28px; }
  #todayView .modern-topbar .modern-brand strong { font-size: 26px; }
  #todayView .modern-topbar .modern-brand::before { display: none; }
  #todayView .modern-welcome { margin: 8px 0 4px; }
  .modern-welcome .studio-eyebrow { font-size: 12px; margin-bottom: 12px; }
  #todayView .modern-welcome h1 { font-size: clamp(35px, 9vw, 48px); }
  #todayView .modern-welcome p { font-size: 12px; margin-top: 10px; }
  .main #todayView .modern-overview-card { grid-column: 1; padding: 25px; min-height: 218px; }
  #todayView .modern-overview-card > strong { font-size: 48px; margin: 18px 0 16px; }
  #todayView .modern-overview-card .today-mobile-trend { font-size: 12px; }
  .studio-rhythm { grid-column: 1; padding: 22px; }
  .studio-chart { height: 128px; gap: 12px; }
  .studio-chart-value { font-size: 8px; }
  #todayView .modern-daily-briefing { padding-top: 22px; }
  .modern-focus-head strong { font-size: 26px; }
  .modern-focus-head small { font-size: 12px; }
  .modern-daily-briefing .modern-focus-context { grid-template-columns: 1fr; gap: 10px; }
  .modern-daily-briefing #todayModernAttention .modern-attention-card,
  .modern-daily-briefing .modern-open-invoices,
  .modern-daily-briefing .modern-upcoming .modern-attention-card { min-height: 80px; padding: 14px 12px; }
  #todayView .modern-month-panel { padding-top: 22px; }
  .modern-financial-summary > div { display: grid; grid-template-columns: 1fr 1fr; }
  .modern-month-metric { padding: 18px; border-bottom: 1px solid var(--line); }
  .modern-month-metric:nth-child(2n) { border-right: 0; }
  .modern-month-metric:nth-child(n+3) { border-bottom: 0; }
  .modern-month-copy strong { font-size: 27px; }
  .main .modern-quick-actions { margin: 0; padding: 8px; border-radius: 12px; background: var(--paper); border: 1px solid var(--line); box-shadow: 0 5px 20px #20221e15; }
  .main .modern-quick-actions button { font-size: 12px; min-height: 42px; }
  .main > :is(#invoicesView, #expensesView, #moneyView, #checksView, #workView, #settingsView) > .page-head { min-height: 92px; margin-bottom: 14px; }
  .page-head h1, .main .page-head h1 { font-size: 37px; }
  .main :is(#invoicesView, #expensesView, #moneyView, #workView) > .invoice-metrics { grid-auto-columns: 78%; gap: 10px; margin-bottom: 18px; }
  .main :is(#invoicesView, #expensesView, #moneyView, #workView) > .invoice-metrics :is(.invoice-hero-card, .invoice-kpi-card) { min-height: 126px; padding: 18px; }
  .main :is(#invoicesView, #expensesView, #moneyView, #workView) > .invoice-metrics :is(.invoice-hero-card, .invoice-kpi-card) > strong { font-size: 31px; margin: 10px 0 7px; }
  .kpi-pagination button { width: 22px; height: 22px; min-height: 22px; border: 8px solid var(--canvas); border-radius: 50%; }
  .kpi-pagination button.is-active { width: 30px; border-radius: 12px; background: var(--accent); }
  .first-run { padding: 16px; }
  .first-run-shell { border: 0; background: transparent; box-shadow: none; }
  .first-run-card { padding: 24px 10px; background: transparent; }
  .first-run-step-copy h2 { font-size: 38px; }
  .first-run-mobile-brand { margin-bottom: 40px; }
  .first-run-mobile-trust { background: var(--hero-paper); border-color: transparent; color: var(--hero-ink); border-radius: 12px; }
  .first-run-mobile-trust strong, .first-run-mobile-trust small, .first-run-mobile-trust .summa-icon { color: var(--hero-ink); }
}
/* A transformed page becomes the containing block for its fixed action buttons.
   Keep mobile pages untransformed so the launcher stays anchored to the viewport. */
@media (min-width: 721px) and (prefers-reduced-motion: no-preference) {
  .main > section:not([hidden]) { animation: page-arrive .22s ease-out; }
  @keyframes page-arrive { from { opacity: .65; transform: translateY(4px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
[hidden] { display: none !important; }
/* Explicit placement prevents historical grid rows from reordering the spread. */
#todayView .modern-topbar { grid-row: 1; justify-content: space-between; }
#todayView .modern-welcome { grid-row: 2; }
.main #todayView .modern-overview-card { grid-row: 3; }
#todayView .studio-rhythm { grid-row: 3; }
#todayView .modern-daily-briefing { grid-row: 4; }
#todayView .modern-month-panel { grid-row: 5; }
.modern-demo-badge { background: var(--accent-soft); border-color: var(--line); color: var(--accent); }
#todayView .modern-financial-summary { padding: 0; border: 0; border-radius: 0; background: transparent; }
#todayView .modern-financial-summary .modern-month-metric { display: block; width: 100%; min-width: 0; text-align: left; padding: 20px; }
#todayView .modern-financial-summary .modern-month-copy { display: block; width: 100%; }
#todayView .modern-financial-summary .modern-month-copy strong { white-space: normal; overflow: visible; font: 400 28px/1.2 var(--font-display); }
#todayView .modern-financial-summary .modern-month-copy small { white-space: normal; font-size: 12px; }
#todayView .modern-month-panel .modern-quick-actions { display: block; }
#todayView .modern-daily-briefing .modern-focus-context { border: 0; }
#todayView .modern-daily-briefing .modern-upcoming .modern-attention-card { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
#todayView .modern-daily-briefing .modern-focus-action::after { display: none; }
.first-run { --first-run-blue: var(--accent); --first-run-blue-deep: var(--accent-hover); --first-run-navy: var(--ink); --first-run-soft: var(--accent-soft); }
@media (max-width: 720px) {
  #todayView .studio-rhythm { grid-row: 4; }
  #todayView .modern-daily-briefing { grid-row: 5; }
  #todayView .modern-month-panel { grid-row: 6; }
}
/* Semantic aliases also override explicit/system dark tokens from the legacy layer. */
:root, :root[data-theme], :root:not([data-theme]) {
  --blue: var(--accent); --blue-dark: var(--accent-hover); --blue-strong: var(--accent); --blue-soft: var(--accent-soft);
  --modern-accent: var(--accent); --modern-ink: var(--ink); --modern-success: var(--green); --modern-kpi-orange: var(--amber);
  --modern-icon-blue-bg: var(--accent-soft); --modern-icon-green-bg: var(--green-soft); --modern-icon-orange-bg: var(--amber-soft);
  --chart-revenue: var(--accent); --chart-costs: var(--chart-bar); --brand-watermark-opacity: 0;
}
#todayView .modern-focus-action { color: var(--accent); }
#todayView .modern-upcoming .modern-focus-action { font-size: 0; }
#todayView .modern-upcoming .modern-focus-action::before { font-size: 12px; }
.studio-add { margin-left: auto; background: var(--paper); border: 1px solid var(--line); color: var(--ink); min-height: 36px; font-size: 12px; padding: 8px 14px; }
.modern-topbar { gap: 12px; }
@media (max-width: 720px) { .studio-add { display: none; } }
#todayView .modern-month-panel { display: block; }
#todayView #todayFinancialSummary { display: block; }
#todayView .modern-financial-summary .modern-month-copy > small,
#todayView .modern-financial-summary .modern-month-copy > strong { display: block; width: 100%; }
@media (max-width: 720px) {
  #todayView .modern-financial-summary .modern-month-metric { min-height: 116px; border-bottom: 1px solid var(--line); }
  #todayView .modern-financial-summary .modern-month-metric:nth-child(2n) { border-right: 0; }
  #todayView .modern-financial-summary .modern-month-metric:nth-child(n+3) { border-bottom: 0; }
}

/* One title scale for every app page, independent of its header markup.
   The main id outranks legacy per-view selectors without !important. */
#mainContent {
  --page-title-size: clamp(32px, 3vw, 45px);
  --page-title-leading: 1.12;
}
#mainContent.main > section :is(.page-head, .modern-welcome, .upload-review-head) h1 {
  font: 400 var(--page-title-size)/var(--page-title-leading) var(--font-display);
  letter-spacing: -.055em;
  margin-bottom: 0;
  overflow-wrap: anywhere;
}
@media (max-width: 720px) {
  #mainContent {
    --page-title-size: 32px;
    --page-title-leading: 1.12;
  }
  #mainContent.main > section :is(.page-head, .modern-welcome, .upload-review-head) p {
    margin-top: 7px;
    font-size: 13px;
    line-height: 1.45;
  }
}


/* The exact SUMMA vector is the complete visible wordmark. */
.brand, .modern-brand, .first-run-brand, .first-run-mobile-brand { gap: 0; }
@media (max-width: 720px) {
  #todayView .modern-topbar .modern-brand strong { font-size: 30px; line-height: 1; }
}


/* SUMMA wordmark (zonder lijnen) ----------------------------------------- */
.summa-wordmark {
  display: block;
  width: 148px;
  height: 53px;
  flex: none;
  background: url('assets/brand/sigmi-logo.svg?v=2026-09-28-sigmi') left center / contain no-repeat;
}
.first-run-brand .summa-wordmark { width: 176px; height: 62px; }
.first-run-mobile-brand .summa-wordmark { width: 154px; height: 54px; }
#todayView .modern-topbar .modern-brand .summa-wordmark { width: 151px; height: 53px; }
@media (max-width: 720px) {
  #todayView .modern-topbar .modern-brand .summa-wordmark { width: 156px; height: 55px; }
}
:root[data-theme="dark"] .summa-wordmark {
  background-image: url('assets/brand/sigmi-logo-dark-bg.svg?v=2026-09-28-sigmi');
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .summa-wordmark {
    background-image: url('assets/brand/sigmi-logo-dark-bg.svg?v=2026-09-28-sigmi');
  }
}
:root[data-theme="dark"] .summa-wordmark {
  background-image: url('assets/brand/sigmi-logo-dark-bg.svg?v=2026-09-28-sigmi');
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .summa-wordmark {
    background-image: url('assets/brand/sigmi-logo-dark-bg.svg?v=2026-09-28-sigmi');
  }
}


/* Logo (25 september 2026, op gebruikersverzoek): Σ-tegel + "summa", verhouding 295:88.
   Licht thema: donkere tegel; donker thema: lichte tegel (summa-logo-dark-bg.svg). */
.summa-wordmark,
.first-run-brand .summa-wordmark,
.first-run-mobile-brand .summa-wordmark,
#todayView .modern-topbar .modern-brand .summa-wordmark {
  width: 148px;
  height: 44px;
  background-position: left center;
  background-size: contain;
}
@media (max-width: 720px) {
  #todayView .modern-topbar {
    min-height: 44px;
    padding-bottom: 4px;
    align-items: center;
  }
  #todayView .modern-topbar .modern-brand {
    min-height: 40px;
    align-items: center;
  }
  #todayView .modern-topbar .modern-brand .summa-wordmark {
    width: 148px;
    height: 44px;
  }
  #todayView .modern-welcome {
    margin-top: 0;
  }
  #todayView .modern-welcome h1 {
    font-size: clamp(32px, 8vw, 42px);
    line-height: 1.08;
  }
}
