/* Message-board look, shared with clarke.online and alex.clarke.online.
   Fonts are served from assets/fonts so the Content-Security-Policy can stay 'self' only. */
@font-face { font-family: "Atkinson Hyperlegible"; src: url("fonts/atkinson-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("fonts/atkinson-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("fonts/atkinson-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Bricolage Grotesque"; src: url("fonts/bricolage-grotesque.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; }

:root {
  --bg: #e3e7f0;
  --card: #ffffff;
  --ink: #14182a;
  --muted: #4a5370;
  --line: #d3d9e8;
  --rule: #b6bfd6;
  --field: #f4f6fb;
  --accent: #1f3f8f;
  --accent-ink: #ffffff;
  --accent-soft: #e3e9f7;
  --neg: #b42318;
  --ok: #067647;
  --bar: #2e4277;
  --head: #1d2a4d;
  --head-bar: #2e4277;
  --head-deep: #14203d;
  --on-head: #ffffff;
  --on-head-2: #b9c4e4;
  --flag: #d9600f;
  --radius: 4px;
  --display: "Bricolage Grotesque", "Arial Narrow", Arial, sans-serif;
  --body: "Atkinson Hyperlegible", Verdana, Geneva, sans-serif;
  --nums: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1424;
    --card: #182036;
    --ink: #e6e9f4;
    --muted: #a3abc6;
    --line: #2a3452;
    --rule: #34406a;
    --field: #1f2944;
    --accent: #8fb0ff;
    --accent-ink: #0d1530;
    --accent-soft: #23305a;
    --neg: #f97066;
    --ok: #47cd89;
    --bar: #7d9cf0;
    --head: #141c33;
    --head-bar: #2a3b6e;
    --head-deep: #0b1022;
    --on-head: #ffffff;
    --on-head-2: #b9c4e4;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--body);
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}
a { color: var(--accent); }
h1 { font-family: var(--display); font-weight: 800; font-size: 1.6rem; letter-spacing: -0.01em; margin: 0; }
h2 { font-family: var(--display); font-weight: 500; font-size: 1.05rem; margin: 0 0 8px; }
h3 { font-size: 0.95rem; margin: 16px 0 6px; display: flex; justify-content: space-between; }
p { margin: 0 0 10px; }

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.strong { font-weight: 600; }
.error { color: var(--neg); }
.ok { color: var(--ok); }

/* Header and tabs: one bar on bigger screens; on phones the tabs sit along the bottom */
.top {
  position: sticky; top: 0; z-index: 10;
  background: var(--head); color: var(--on-head);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25), 0 2px 10px rgba(0, 0, 0, 0.12);
}
.top-inner {
  max-width: 1100px; margin: 0 auto; display: flex; align-items: center; gap: 14px;
  padding: calc(8px + env(safe-area-inset-top)) 16px 8px;
}
.brand { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 800; font-size: 1.15rem; }
.top .brand { color: inherit; text-decoration: none; gap: 10px; min-width: 0; }
.top .brand img { flex: 0 0 auto; border-radius: 8px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-app { font-family: var(--body); font-weight: 400; font-size: 0.72rem; letter-spacing: 0.03em; color: var(--on-head-2); }
.brand-household { font-size: 1.08rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.save-status { margin-left: auto; font-size: 0.8rem; color: var(--on-head-2); white-space: nowrap; }
.top .save-status.error { color: #ffb4ab; }
.save-status.error { color: var(--neg); }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: space-around;
  background: var(--head-deep);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4px 4px env(safe-area-inset-bottom);
}
.tabs a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 0 6px; font-size: 0.7rem; color: var(--on-head-2); text-decoration: none;
}
.tabs .ico { display: flex; align-items: center; justify-content: center; width: 52px; height: 30px; border-radius: 999px; transition: background 0.15s ease; }
.tabs a.active { color: var(--on-head); font-weight: 700; }
.tabs a.active .ico { background: rgba(255, 255, 255, 0.16); }
.tabs a.active .ico svg { color: #ffb37a; } /* the flag orange, lifted for the dark bar */
.tabs a:focus-visible { outline: 2px solid var(--flag); outline-offset: -2px; border-radius: 10px; }

@media (min-width: 760px) {
  body { padding-bottom: 32px; }
  .tabs {
    position: static; border: 0; padding: 0; background: none;
    justify-content: flex-start; gap: 2px; margin-left: 8px;
  }
  .tabs a { flex: 0 0 auto; flex-direction: row; gap: 7px; padding: 7px 12px; font-size: 0.92rem; border-radius: 999px; }
  .tabs a:hover { color: var(--on-head); background: rgba(255, 255, 255, 0.08); }
  .tabs .ico { width: auto; height: auto; background: none !important; }
  .tabs .ico svg { width: 18px; height: 18px; }
  .tabs a.active { background: rgba(255, 255, 255, 0.16); }
}
@media (min-width: 760px) and (max-width: 900px) {
  .tabs .tab-label { display: none; } /* icons only when it's tight */
  .tabs a { padding: 8px 10px; }
}

/* The page: one column, as wide as the header on bigger screens. */
.view { max-width: 1100px; margin: 0 auto; padding: 14px 16px; }
@media (min-width: 1000px) { .view { padding-top: 18px; } }
body.wizard .view { max-width: 760px; }

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 0;
  padding: 14px;
  margin: 0 0 14px;
}
.card > h2:first-child {
  margin: -14px -14px 12px;
  padding: 10px 14px;
  background: var(--head-bar);
  color: var(--on-head);
  font-size: 1rem;
  line-height: 1.3;
}
.page-head { display: flex; align-items: center; gap: 10px; margin: 4px 0 12px; }
.page-head .back { text-decoration: none; white-space: nowrap; }
.month-nav { justify-content: center; }
.month-select { font-weight: 700; font-size: 1.05rem; flex: 0 1 220px; text-align: center; }
.title-input { font-weight: 700; font-size: 1.15rem; flex: 1; }

.summary { display: flex; flex-direction: column; gap: 10px; }
.summary-split { display: flex; gap: 10px; flex-wrap: wrap; }
.summary-split .stat { flex: 1 1 120px; }
.stat-label { font-size: 0.8rem; color: var(--muted); }
.stat-sub { font-size: 0.8rem; color: var(--muted); }
.money { font-family: var(--nums); font-variant-numeric: tabular-nums; white-space: nowrap; }
.money.big { font-family: var(--display); font-variant-numeric: tabular-nums; font-size: 1.9rem; font-weight: 800; line-height: 1.15; }
.stat .money { font-weight: 600; }
.money.neg { color: var(--neg); }

/* Form bits */
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea {
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 7px 9px;
  min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
input.invalid { outline: 2px solid var(--neg); }
textarea { width: 100%; resize: vertical; }
input[type="checkbox"] { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }

.line { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; }
.line .name { flex: 1 1 auto; }
.line span.name { padding: 7px 0; }
.line .owner {
  flex: 0 0 60px; width: 60px; padding: 5px 2px; font-size: 0.75rem; text-align: center; text-align-last: center;
  -webkit-appearance: none; appearance: none; border-radius: 999px; color: var(--muted);
}
.line .owner.set { background: var(--accent-soft); color: var(--accent); border-color: transparent; font-weight: 600; }
.amount-wrap { flex: 0 0 92px; display: flex; flex-direction: column; }
.amount { width: 92px; text-align: right; font-family: var(--nums); font-variant-numeric: tabular-nums; }
.line > .amount { flex: 0 0 92px; }
.line-hint { font-size: 0.75rem; color: var(--muted); text-align: right; }
.line-hint:empty { display: none; }
.chip { flex: 0 0 60px; display: flex; align-items: center; gap: 5px; font-size: 0.8rem; color: var(--muted); }
.split .money { flex: 0 0 90px; text-align: right; }
.share { flex: 0 0 auto; display: flex; align-items: center; gap: 4px; }
.share .amount { width: 62px; }
.sub-list { margin: 8px 0 0; }

.group { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; }
.group:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.group-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.group-name { font-weight: 600; font-size: 0.9rem; background: transparent; border-color: transparent; padding-left: 0; flex: 1; }
.group-name:hover { border-color: var(--line); }

.total-row {
  display: flex; justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 8px; margin-top: 8px; font-weight: 600;
}
.by-owner .total-row { font-weight: 400; margin-top: 0; padding: 6px 0; }
.by-owner .total-row:first-child { border-top: 0; }

.icon-btn {
  flex: 0 0 28px; height: 28px; border: 0; background: transparent; color: var(--muted);
  font-size: 1.2rem; line-height: 1; border-radius: 6px; cursor: pointer;
}
.icon-btn:hover { background: var(--field); color: var(--neg); }
.link-btn { border: 0; background: none; color: var(--accent); padding: 6px 0; cursor: pointer; font-size: 0.9rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: var(--radius); padding: 9px 14px; cursor: pointer; text-decoration: none; font-size: 0.95rem;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.btn:focus-visible, .chip-btn:focus-visible, .link-btn:focus-visible { outline: 2px solid var(--flag); outline-offset: 2px; }
.btn.danger { color: var(--neg); }
.btn.small { padding: 5px 10px; font-size: 0.85rem; }
.btn.disabled { opacity: 0.35; pointer-events: none; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 16px 0; }
.actions.left { justify-content: flex-start; margin: 0; }
.file-btn input { display: none; }

.fields { display: flex; flex-wrap: wrap; gap: 8px; }
.mini { display: flex; flex-direction: column; font-size: 0.75rem; color: var(--muted); gap: 2px; }
.mini .amount { width: 100px; color: var(--ink); }
.mini .money { color: var(--ink); padding: 7px 0; font-size: 1rem; }
.mini .year, .year { width: 70px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; color: var(--muted); margin-bottom: 10px; }
.field input { color: var(--ink); }
.field .short { width: 80px; }
.stack { display: flex; flex-direction: column; gap: 8px; max-width: 320px; }

.account { border-top: 1px solid var(--line); padding: 10px 0; }
.account:first-of-type { border-top: 0; padding-top: 0; }
.account-info { margin-top: 6px; }
.project-line { flex-wrap: wrap; }
.project-line .name { flex: 1 1 100%; }
.project-line .mini .amount { width: 90px; }

.list { list-style: none; padding: 0; margin: 0 0 10px; }
.list li { padding: 8px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.big-links { padding: 4px 14px; }
.big-links a { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); padding: 6px 0; }

.banner {
  background: var(--accent-soft); border: 1px solid var(--accent); border-radius: var(--radius);
  padding: 10px 14px; margin-bottom: 12px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.copy-box { margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.copy-box input { flex: 1 1 200px; font-size: 0.85rem; }
.copy-box p { flex-basis: 100%; margin: 0; }
.admin-user { padding: 8px 0; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; align-items: center; }
.admin-user > div:last-child { flex-basis: 100%; }

/* Tables */
.table-scroll { overflow-x: auto; margin: 0 -14px; padding: 0 14px; }
table { border-collapse: collapse; width: 100%; font-family: var(--nums); font-variant-numeric: tabular-nums; }
.grid th, .grid td { padding: 5px 6px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; font-size: 0.9rem; }
.grid th { font-size: 0.75rem; color: var(--muted); font-weight: 600; }
.grid .amount { width: 110px; }
.num { text-align: right !important; }
.plain td { padding: 4px 0; border-bottom: 1px solid var(--line); }

/* Chart */
.chart-wrap { position: relative; }
.chart { width: 100%; height: auto; display: block; }
.chart .bar { fill: var(--bar); opacity: 0.85; }
.chart .bar.on { opacity: 1; }
.chart .hit { fill: transparent; cursor: default; }
.chart .axis { fill: var(--muted); font-size: 12px; }
.chart-tip {
  position: absolute; top: -4px; right: 0;
  background: var(--ink); color: var(--card); font-size: 0.8rem; padding: 3px 8px; border-radius: 6px;
}
details summary { cursor: pointer; color: var(--muted); margin-top: 8px; }

/* Sign-in pages */
body.auth { padding: 0; }
.auth-box { max-width: 380px; margin: 0 auto; padding: 48px 16px; }
.auth-box h1 { margin: 20px 0 16px; font-size: 2.2rem; }
.auth-box .brand { font-size: 1.3rem; }
.auth-box form { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.auth-box label { display: flex; flex-direction: column; gap: 4px; font-size: 0.9rem; color: var(--muted); }
.auth-box input { color: var(--ink); padding: 10px; }
.auth-box .btn { padding: 11px; }

@media (max-width: 380px) {
  .amount-wrap, .line > .amount { flex-basis: 84px; }
  .amount { width: 84px; }
  .split .money { flex-basis: 76px; }
}
@media (min-width: 760px) {
  .line .owner, .chip { flex-basis: 84px; width: 84px; }
  .amount-wrap, .line > .amount { flex-basis: 110px; }
  .amount { width: 110px; }
}

/* Add / edit form: a sheet from the bottom on phones, a centred box on bigger screens */
.btn.wide { width: 100%; margin: 0 0 12px; padding: 12px; }
.edit-btn { font-size: 1.1rem; letter-spacing: 1px; }
.edit-btn:hover { color: var(--accent); }
dialog.sheet {
  border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 560px; max-height: 92vh;
  border-radius: 0; background: var(--card); color: var(--ink); border-top: 4px solid var(--head-bar);
}
dialog.sheet::backdrop { background: rgba(0, 0, 0, 0.45); }
@media (min-width: 760px) {
  dialog.sheet { margin: auto; border-radius: 0; border: 1px solid var(--rule); border-top: 4px solid var(--head-bar); }
}
.sheet-body { padding: 18px 16px calc(16px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 4px; }
.sheet-body h2 { font-size: 1.15rem; margin-bottom: 10px; }
.sheet-body .field select, .sheet-body .field input { width: 100%; color: var(--ink); padding: 9px 10px; }
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; }
.sheet-body .big-amount { width: 100%; font-size: 1.1rem; text-align: left; }
.monthly-out { margin: 0 0 8px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; margin-bottom: 8px; }
.sheet-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn {
  border: 1px solid var(--line); background: var(--field); color: var(--ink);
  border-radius: 999px; padding: 7px 12px; font-size: 0.9rem; cursor: pointer;
}
.chip-btn.small { padding: 5px 10px; font-size: 0.82rem; }
.chip-btn.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
select:disabled { opacity: 0.5; }

.link-box { background: var(--field); border-radius: 10px; padding: 10px 12px 2px; margin-bottom: 10px; }
.link-box .field input, .link-box .field select { background: var(--card); }

/* Overview and records */
.hero .money.big { font-size: 2.3rem; }
a.link-card { display: flex; color: var(--ink); text-decoration: none; }
a.link-card:hover, a.link-row:hover { border-color: var(--accent); }
.link-row { color: var(--ink); text-decoration: none; }
.total-row.light { font-weight: 400; margin-top: 0; padding: 8px 0; }
.card h2 + .total-row.light, .card h2 + a.total-row.light { border-top: 0; }
.link-row.soon span:first-child::before { content: "● "; color: var(--neg); }
.mini.text input { width: 150px; }
.mini.month input, .month-input { width: 150px; padding: 6px 8px; color: var(--ink); }
.mini select { padding: 7px 6px; color: var(--ink); max-width: 170px; }
.mini.pct .amount, .mini.int .amount { width: 80px; }
.interest-log { margin-top: 8px; }
.interest-log .line { margin-top: 8px; }
.interest-log .amount { width: 90px; }
.interest-log .total-row .icon-btn { height: 20px; }
.link-row > span:last-child { white-space: nowrap; padding-left: 10px; }
.credit-row { border-top: 1px dashed var(--line); margin-top: 6px; }

/* Setup wizard */
body.wizard .tabs { display: none; }
body.wizard { padding-bottom: 24px; }
.wizard-progress { display: flex; gap: 4px; margin: 8px 0 10px; }
.wizard-progress span { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.wizard-progress span.on { background: var(--accent); }
.wizard-title { margin: 2px 0 8px; }
.wizard-body { display: flex; flex-direction: column; gap: 6px; }
.wizard-body .field input, .wizard-body .field select { width: 100%; color: var(--ink); padding: 9px 10px; }
.wizard-body h3 { margin: 12px 0 4px; }
.wizard-body .chips { margin-bottom: 8px; }
.wizard-nav { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 16px 0; }
.wizard-item { border-top: 1px solid var(--line); padding: 10px 0; }
.wizard-item:first-child { border-top: 0; padding-top: 0; }
.wizard-item-head { display: flex; gap: 6px; margin-bottom: 6px; }
.wizard-item-head .name { flex: 1; }
.wizard-item .fields { align-items: flex-end; }
.wizard-item .check { margin: 0 0 8px; }
.tick-group h3 { font-size: 0.85rem; color: var(--muted); }
.tick-row { display: flex; align-items: center; gap: 6px; padding: 4px 0; }
.tick-name { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; }
.tick-row .amount { width: 90px; }
.tick-row select { width: 112px; font-size: 0.85rem; padding: 7px 4px; }
.tick-row:not(.on) .amount, .tick-row:not(.on) select { opacity: 0.55; }
.wizard-preview .indent span:first-child { padding-left: 12px; }
.center { text-align: center; }
.privacy-note { background: var(--accent-soft); border-radius: var(--radius); padding: 12px 14px; font-size: 0.85rem; margin: 4px 0 18px; }
.privacy-note p { margin: 6px 0 0; color: var(--ink); }

/* Spending log */
.spent-row { display: grid; grid-template-columns: 140px 1fr 1fr 150px 92px auto; gap: 6px; align-items: center; margin: 0 0 6px; }
.spent-row .amount { width: 100%; }
.spent-figures { display: inline-flex; gap: 4px; align-items: baseline; flex-wrap: wrap; justify-content: flex-end; text-align: right; }
.spent-summary .total-row.over .money { color: var(--neg); }
.spent-summary:empty { display: none; }
.spent-list { margin-top: 10px; }
@media (max-width: 640px) {
  .spent-row { grid-template-columns: 1.5fr 1fr 84px auto; grid-template-areas: "where what amount x" "date date cat cat"; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
  .spent-row .spent-where { grid-area: where; }
  .spent-row .spent-what { grid-area: what; }
  .spent-row .amount { grid-area: amount; }
  .spent-row .icon-btn { grid-area: x; }
  .spent-row .spent-date { grid-area: date; }
  .spent-row .spent-cat { grid-area: cat; }
}

/* A button on the right of a page heading, e.g. "Update balances" */
.page-head .head-btn { margin-left: auto; text-decoration: none; white-space: nowrap; }

/* A savings share linked to a pot: the pot menu sits on its own line underneath */
.split-with-pot { margin-bottom: 8px; }
.split-with-pot .line.split { margin-bottom: 3px; }
.split-with-pot .pot-link { width: 100%; font-size: 0.8rem; padding: 4px 6px; color: var(--muted); }

/* Safety net: payoff dates can wrap on a phone instead of running off the card */
.safety-card .link-row > span:last-child { white-space: normal; text-align: right; }
.safety-card .total-row > span:last-child { white-space: nowrap; padding-left: 10px; }

/* Delete sits apart from the everyday buttons */
.actions.danger-zone { margin-top: 28px; padding-top: 12px; border-top: 1px dashed var(--line); }

/* The app's own pop-ups (instead of the browser's prompt/confirm/alert) */
dialog.popup { max-width: 420px; }
.popup .popup-input { width: 100%; padding: 9px 10px; margin: 4px 0 8px; color: var(--ink); }
.btn.danger-solid { background: var(--neg); border-color: var(--neg); color: #fff; font-weight: 700; }

/* Catching up on months */
.banner.catch-up span { flex: 1 1 220px; }

/* Update balances */
.intro { margin: 0 0 12px; }
.balance-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.card h2 + .balance-row { border-top: 0; }
.balance-name { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }
.balance-row .amount { flex: 0 0 120px; }
.balance-row .stale { color: var(--neg); }
.link-row.todo span:first-child::before { content: "○ "; color: var(--accent); }

/* Tax set aside automatically from income: shown under Debt & set-asides, changed on the income line */
.line.auto { padding: 4px 0; }
.line.auto .name { color: var(--ink); }
.line.auto .money { flex: 0 0 92px; text-align: right; padding-right: 34px; }
.line.auto .auto-chip { flex: 0 0 auto; align-self: center; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 0.72rem; font-weight: 600; }

/* Settings: AI assistants */
.steps { margin: 6px 0 6px 18px; padding: 0; }
.steps li { margin: 2px 0; }
.ai-row { gap: 10px; align-items: center; }
.ai-row > span:first-child { white-space: normal; }

/* "Allow access" page for an AI assistant (oauth.php) */
.consent-list { margin: 8px 0 16px 18px; padding: 0; line-height: 1.5; }

/* Reordering: drag the ⠿ handle (or focus it and use the arrow keys) */
.drag-handle {
  flex: 0 0 auto; width: 22px; height: 34px; padding: 0; border: 0; background: none; cursor: grab;
  color: var(--muted); font-size: 1rem; line-height: 1; touch-action: none; user-select: none; -webkit-user-select: none;
}
.drag-handle:hover, .drag-handle:focus-visible { color: var(--accent); }
.drag-handle:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 4px; }
.dragging { position: relative; z-index: 5; background: var(--card); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18); border-radius: 6px; }
.dragging .drag-handle { cursor: grabbing; color: var(--accent); }
.line, .group, .account, .split-with-pot { transition: transform 0.12s ease; }
.dragging { transition: none; }
.group-head .drag-handle { height: 28px; }

/* "I'd cut this if money got tight" in the line form */
.cut-hint { margin: -6px 0 8px 26px; }

/* Split what's left: percentages and their total */
.split-total { margin: 2px 0 8px; text-align: right; }
.split-total.ok { color: var(--ok); }
.split-total.warn { color: var(--neg); }

/* 12-month projection */
.proj-table th { font-size: 0.75rem; color: var(--muted); font-weight: 600; text-align: left; padding: 4px 6px 4px 0; }
.proj-table th:not(:first-child) { text-align: right; }
.proj-table td { padding: 5px 6px 5px 0; white-space: nowrap; font-size: 0.85rem; }
.proj-table .note-row td { color: var(--ok); font-size: 0.8rem; border-bottom: 1px solid var(--line); padding-top: 0; }
.proj-teaser .muted { margin: 6px 0 0; }

/* The brand as a link (sign-in pages and the landing page) */
a.brand { color: inherit; text-decoration: none; }

/* Landing page (app/landing.php): what The Spreadsheet is, for people who aren't signed in */
body.landing { padding: 0; }
.landing-top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 760px; margin: 0 auto; padding: 14px 16px;
}
.landing-top .brand { font-size: 1.2rem; }
.landing-signin { text-decoration: none; }
.landing main { max-width: 760px; margin: 0 auto; padding: 0 16px; }
.landing-hero { text-align: center; padding: 36px 0 28px; border-bottom: 1px solid var(--rule); }
.landing-mark { display: block; margin: 0 auto 18px; }
.landing-hero h1 { font-size: clamp(2rem, 7vw, 3.1rem); line-height: 1.05; margin: 0 auto 16px; max-width: 14em; }
.landing-lede { font-size: 1.08rem; line-height: 1.55; max-width: 34em; margin: 0 auto 22px; }
.landing-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 10px; }
.landing-actions .btn { min-width: 170px; padding: 12px 18px; text-decoration: none; }
.landing-section { padding: 28px 0 8px; }
.landing-section h2 { font-size: 1.5rem; margin: 0 0 14px; }
.landing-steps { margin: 0; padding-left: 22px; line-height: 1.55; }
.landing-steps li { margin: 0 0 12px; padding-left: 4px; }
.landing-steps li::marker { color: var(--flag); font-family: var(--display); font-weight: 800; }
.landing-features { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 10px; }
.landing-features li {
  background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--head-bar); border-radius: var(--radius);
  padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; line-height: 1.45;
}
.landing-features li span { color: var(--muted); font-size: 0.92rem; }
@media (min-width: 640px) { .landing-features { grid-template-columns: 1fr 1fr; } }
.landing-foot { max-width: 760px; margin: 28px auto 0; padding: 18px 16px 40px; border-top: 1px solid var(--rule); text-align: center; }
.landing-foot p { margin: 6px 0; }
.landing-foot .brand { justify-content: center; font-size: 1rem; }
