/* Keel: mist-grey ground, flat white panels, slate ink.
   One loud thing: the highlighter swipe when you tick something off. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../fonts/BricolageGrotesque.woff") format("woff");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --mist: #E9EDF1;
  --paper: #FFFFFF;
  --ink: #18212B;
  --slate: #566273;
  --rule: #D6DDE4;
  --rule-soft: #E8ECF0;
  --hover: #F3F6F8;
  --hl: #FFD84D;
  --hl-ink: #18212B;
  --hl-soft: #FFF0B3;
  --late: #B4372F;
  --good: #1F7A3A;
  --focus: #2F5BD3;

  /* charts (validated palette, see the dataviz notes in README) */
  --series-1: #257de0;
  --series-2: #f47230;
  --series-3: #00b894;
  --series-none: #A9B4BF;
  --grid: #E6EBEF;
  --axis: #C2CBD3;
  --heat-0: #E2E7EC;
  --heat-1: #9FB2C6;
  --heat-2: #2F4A66;

  --radius: 14px;
  --radius-s: 8px;
  --rail: 232px;
  --tabbar: 64px;
  --font: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --mist: #12171C;
    --paper: #1B2229;
    --ink: #E8EDF2;
    --slate: #9AA7B5;
    --rule: #2E3843;
    --rule-soft: #252D36;
    --hover: #222A32;
    --hl: #E9C33B;
    --hl-ink: #14181D;
    --hl-soft: #4A4122;
    --late: #F08A7E;
    --good: #6CCB7F;
    --focus: #8FB0FF;
    --series-1: #338ced;
    --series-2: #e76624;
    --series-3: #00a888;
    --series-none: #5C6976;
    --grid: #27313A;
    --axis: #3A4652;
    --heat-0: #29323B;
    --heat-1: #50657B;
    --heat-2: #A9C1DA;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--mist);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { margin: 0; line-height: 1.15; font-weight: 650; }
h2 { font-size: 1.125rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 0.75em; }
small, .quiet { color: var(--slate); }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- frame ---------- */
.frame { min-height: 100vh; }
.rail { display: none; }
.content {
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px 16px calc(var(--tabbar) + 32px + env(safe-area-inset-bottom));
}
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 0;
  max-width: 1080px; margin: 0 auto;
}
.wordmark { font-weight: 800; font-stretch: 75%; font-size: 1.25rem; letter-spacing: -0.01em; text-decoration: none; }
.icon-link { display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: 50%; color: var(--slate); }
.icon-link:hover { background: var(--paper); color: var(--ink); }
.icon-link svg { width: 22px; height: 22px; }

.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--rule);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  text-decoration: none; color: var(--slate); font-size: 0.75rem; font-weight: 550;
}
.tabbar svg { width: 22px; height: 22px; }
.tabbar a[aria-current="page"] { color: var(--ink); }
.tabbar a[aria-current="page"] svg { stroke-width: 2.25; }
.tabbar .badge { position: absolute; transform: translate(12px, -14px); }

@media (min-width: 900px) {
  .frame { display: grid; grid-template-columns: var(--rail) 1fr; }
  .topbar, .tabbar { display: none; }
  .rail {
    display: flex; flex-direction: column; gap: 4px;
    position: sticky; top: 0; height: 100vh;
    padding: 28px 16px;
    border-right: 1px solid var(--rule);
  }
  .rail .wordmark { font-size: 1.6rem; padding: 0 12px 20px; }
  .rail nav { display: flex; flex-direction: column; gap: 2px; }
  .rail nav a {
    display: flex; align-items: center; gap: 12px;
    padding: 9px 12px; border-radius: var(--radius-s);
    text-decoration: none; color: var(--slate); font-weight: 550;
  }
  .rail nav a svg { width: 20px; height: 20px; }
  .rail nav a:hover { background: var(--paper); color: var(--ink); }
  .rail nav a[aria-current="page"] { background: var(--paper); color: var(--ink); }
  .rail .rail-foot { margin-top: auto; }
  .content { padding: 40px 40px 64px; }
}

.badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--hl); color: var(--hl-ink); font-size: 0.75rem; font-weight: 700;
}

/* ---------- page furniture ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 24px; margin: 8px 0 24px; }
.page-head h1 { font-size: 2.25rem; font-weight: 750; font-stretch: 80%; letter-spacing: -0.015em; }
.page-head p { margin: 4px 0 0; color: var(--slate); }

.panel {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
}
.panel > h2, .panel-head { margin-bottom: 12px; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.panel-head h2 { margin: 0; }
.panel-head a, .panel-head .quiet { font-size: 0.9rem; }
.panel.flush { padding: 6px 0; }
.panel.flush > .panel-head, .panel.flush > h2 { padding: 12px 20px 0; }

.grid-2 { display: grid; gap: 16px; }
@media (min-width: 900px) {
  .grid-2 { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: start; gap: 24px; }
  .grid-even { grid-template-columns: 1fr 1fr; }
}

.flash { border-radius: var(--radius-s); padding: 10px 14px; margin-bottom: 16px; border: 1px solid var(--rule); background: var(--paper); }
.flash.error { border-color: var(--late); color: var(--late); }
.flash.ok { border-left: 4px solid var(--hl); }

/* ---------- buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--ink); background: var(--ink); color: var(--paper);
  font: inherit; font-weight: 600; font-size: 0.95rem; cursor: pointer; text-decoration: none;
}
.btn:hover { filter: brightness(1.15); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn.ghost:hover { background: var(--hover); filter: none; }
.btn.small { min-height: 32px; padding: 0 12px; font-size: 0.85rem; }
.btn.danger { background: transparent; color: var(--late); border-color: currentColor; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--slate); text-decoration: underline; text-underline-offset: 0.18em; cursor: pointer; }
.link-btn:hover { color: var(--ink); }
form.inline { display: inline; }

label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; }
.field { margin-bottom: 16px; }
.field small { display: block; margin-top: 4px; font-weight: 400; }
input[type=text], input[type=number], input[type=date], input[type=time], input[type=search], input[type=email], select, textarea {
  width: 100%; min-height: 44px; padding: 8px 12px;
  border: 1px solid var(--rule); border-radius: var(--radius-s);
  background: var(--paper); color: var(--ink); font: inherit;
}
textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: transparent; }
.choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; }
.choice span {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px;
  border: 1px solid var(--rule); border-radius: 999px; background: var(--paper); cursor: pointer; font-weight: 550;
}
.choice input:checked + span { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.choice input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.check-label { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.check-label input { width: 20px; height: 20px; accent-color: var(--ink); }

.segmented { display: inline-flex; max-width: 100%; overflow-x: auto; padding: 3px; border-radius: 999px; background: var(--paper); border: 1px solid var(--rule); }
.segmented a { white-space: nowrap; padding: 6px 11px; border-radius: 999px; text-decoration: none; color: var(--slate); font-weight: 550; font-size: 0.9rem; }
.segmented a[aria-current="true"] { background: var(--ink); color: var(--paper); }

/* ---------- Today: the day headline ---------- */
.dayhead { margin: 4px 0 24px; }
.dayhead h1 {
  font-size: clamp(3.5rem, 14vw, 6.5rem);
  font-weight: 800; font-stretch: 75%;
  letter-spacing: -0.03em; line-height: 0.88;
}
.dayhead .date { font-size: 1.35rem; font-weight: 500; font-stretch: 90%; margin: 6px 0 16px; color: var(--slate); }
.dayline { display: flex; align-items: center; gap: 14px; }
.dayline .track { flex: 1; height: 10px; border-radius: 5px; background: var(--paper); border: 1px solid var(--rule); overflow: hidden; max-width: 420px; }
.dayline .fill { display: block; height: 100%; width: 0; background: var(--hl); border-radius: 5px; transition: width 400ms ease; }
.dayline p { margin: 0; font-weight: 600; white-space: nowrap; }

/* ---------- tick rows: habits and to-dos ---------- */
.ticks { list-style: none; margin: 0; padding: 0; }
.ticks li { display: flex; align-items: stretch; border-top: 1px solid var(--rule-soft); }
.ticks li:first-child { border-top: 0; }
.group-label { padding: 14px 20px 4px; color: var(--slate); font-size: 0.9rem; font-weight: 600; }

.tick {
  position: relative; isolation: isolate;
  flex: 1; display: flex; align-items: center; gap: 14px;
  min-height: 56px; padding: 8px 20px;
  border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.tick:hover { background: var(--hover); }
/* the highlighter swipe, drawn behind the name like a real highlighter */
.tick .name { position: relative; isolation: isolate; display: inline-block; max-width: 100%; }
.tick .name::before {
  content: ""; position: absolute; z-index: -1;
  left: -6px; right: -10px; top: 0.12em; bottom: 0;
  border-radius: 3px 10px 4px 12px;
  background: var(--hl);
  transform-origin: left center;
  transform: scaleX(var(--fill, 0)) skewX(-8deg);
  transition: transform 320ms cubic-bezier(.3, .7, .2, 1);
}
.tick:not([aria-pressed="true"]) .name::before { background: var(--hl-soft); }
.tick .mark {
  flex: none; width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid var(--slate);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 160ms, border-color 160ms;
}
.tick .mark svg { width: 14px; height: 14px; opacity: 0; stroke: var(--paper); stroke-width: 3; }
.tick[aria-pressed="true"] .mark { background: var(--ink); border-color: var(--ink); }
.tick[aria-pressed="true"] .mark svg { opacity: 1; }
.tick .label { flex: 1; min-width: 0; }
.tick .name { font-weight: 600; font-size: 1.05rem; }
.tick[aria-pressed="true"] .name { color: var(--hl-ink); }
.tick .hint { display: block; font-size: 0.85rem; color: var(--slate); }
.tick[aria-pressed="true"] .hint { color: color-mix(in srgb, var(--hl-ink) 70%, transparent); }
.tick .hint.late { color: var(--late); font-weight: 600; }
.tick .hint .due + .note { margin-left: 10px; }
.pips { display: inline-flex; gap: 4px; margin-left: auto; }
.pips i { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--slate); }
.pips i.on { background: var(--ink); border-color: var(--ink); }
.undo {
  flex: none; width: 48px; border: 0; background: none; color: var(--slate); cursor: pointer; font: inherit; font-size: 1.25rem;
}
.undo:hover { color: var(--ink); background: var(--hover); }
.undo[hidden] { display: none; }
.later summary { padding: 12px 20px; cursor: pointer; color: var(--slate); font-weight: 600; font-size: 0.9rem; list-style: none; }
.later summary::-webkit-details-marker { display: none; }
.later summary::before { content: "+ "; }
.later[open] summary::before { content: "− "; }

.todo-meta { display: flex; gap: 8px; align-items: center; }
.due { font-size: 0.85rem; color: var(--slate); white-space: nowrap; }
.due.late { color: var(--late); font-weight: 600; }
.flag { color: var(--late); font-weight: 800; }
.row-link { display: flex; align-items: center; padding: 0 16px; color: var(--slate); text-decoration: none; }
.row-link:hover { color: var(--ink); background: var(--hover); }
.done-list .name { text-decoration: line-through; text-decoration-thickness: 1px; color: var(--slate); }

.quick-add { display: flex; gap: 8px; padding: 12px 20px 16px; }
.quick-add input[type=text] { flex: 1; }
.quick-add .btn { flex: none; }
.empty { padding: 18px 20px; color: var(--slate); }
.empty a { color: var(--ink); }

/* ---------- glance tiles on Today ---------- */
.glance { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.tile { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); padding: 14px 16px; text-decoration: none; display: block; }
.tile:hover { border-color: var(--slate); }
.tile .label { color: var(--slate); font-size: 0.85rem; font-weight: 550; }
.tile .value { display: block; font-size: 1.6rem; font-weight: 700; font-stretch: 85%; letter-spacing: -0.01em; margin: 2px 0; }
.tile .sub { font-size: 0.85rem; color: var(--slate); }
.tile.wide { grid-column: 1 / -1; }
.delta-up { color: var(--late); }
.delta-down { color: var(--good); }

/* ---------- stats ---------- */
.hero { margin-bottom: 18px; }
.hero .label { color: var(--slate); font-weight: 550; }
.hero .value { display: block; font-size: clamp(3rem, 9vw, 4.25rem); font-weight: 750; font-stretch: 80%; letter-spacing: -0.025em; line-height: 1; margin: 4px 0 6px; }
.hero .sub { color: var(--slate); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px 24px; }
.stat .label { color: var(--slate); font-size: 0.85rem; font-weight: 550; display: block; }
.stat .value { font-size: 1.4rem; font-weight: 700; font-stretch: 88%; }
.stat .sub { font-size: 0.85rem; color: var(--slate); display: block; }

.meter { margin: 10px 0 16px; }
.meter-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.meter-head strong { font-weight: 650; }
.meter-track { position: relative; height: 10px; margin-top: 6px; border-radius: 5px; background: var(--rule-soft); }
.meter-fill { position: absolute; inset: 0 auto 0 0; border-radius: 5px; background: var(--series-1); max-width: 100%; }
.meter-fill.s2 { background: var(--series-2); }
.meter-fill.s3 { background: var(--series-3); }
.meter-fill.s0 { background: var(--heat-2); }
.meter-target { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); border-radius: 1px; }
.meter .sub { font-size: 0.85rem; color: var(--slate); }

.split-bar { display: flex; gap: 2px; height: 28px; margin: 14px 0 10px; }
.split-bar span { border-radius: 4px; min-width: 2px; display: flex; align-items: center; padding: 0 8px; color: #fff; font-size: 0.8rem; font-weight: 650; overflow: hidden; white-space: nowrap; }
.split-bar .b-daily { background: var(--series-1); }
.split-bar .b-monthly { background: var(--series-2); }
.split-bar .b-one_off { background: var(--series-3); }
.split-bar .b-unsorted { background: var(--series-none); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; list-style: none; margin: 0; padding: 0; font-size: 0.9rem; }
.legend li { display: flex; align-items: center; gap: 8px; }
.legend .key { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.legend .key.line { height: 2px; border-radius: 1px; width: 16px; }
.legend strong { font-weight: 650; }
.key.b-daily, .key.s1 { background: var(--series-1); }
.key.b-monthly, .key.s2 { background: var(--series-2); }
.key.b-one_off, .key.s3 { background: var(--series-3); }
.key.b-unsorted { background: var(--series-none); }
.key.ink { background: var(--ink); }
.key.target { background: var(--slate); }

.hbars { list-style: none; margin: 0; padding: 0; }
.hbars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 8px 0; border-top: 1px solid var(--rule-soft); }
.hbars li:first-child { border-top: 0; }
.hbars .bar { grid-column: 1 / -1; height: 8px; border-radius: 4px; background: var(--rule-soft); overflow: hidden; }
.hbars .bar span { display: block; height: 100%; border-radius: 4px; }
.hbars a { text-decoration: none; }
.hbars a:hover { text-decoration: underline; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--rule-soft); vertical-align: top; }
th { color: var(--slate); font-weight: 600; font-size: 0.85rem; }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; }
td.nowrap { white-space: nowrap; }
@media (max-width: 599px) { .wide-only { display: none; } }
details.table-view { margin-top: 10px; }
details.table-view summary { cursor: pointer; color: var(--slate); font-size: 0.9rem; }

/* ---------- charts ---------- */
.chart { position: relative; width: 100%; min-height: 200px; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .baseline { stroke: var(--axis); stroke-width: 1; }
.chart .tick-label { fill: var(--slate); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart .col { fill: var(--series-1); }
.chart .col.muted { fill: var(--heat-0); }
.chart .col.hover { filter: brightness(1.12); }
.chart .avg-line { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .target-line { stroke: var(--slate); stroke-width: 1.5; }
.chart .target-label { fill: var(--slate); font-size: 11px; font-family: var(--font); font-weight: 600; paint-order: stroke; stroke: var(--paper); stroke-width: 4px; stroke-linejoin: round; }
.chart .crosshair { stroke: var(--slate); stroke-width: 1; }
.chart .seg-daily { fill: var(--series-1); }
.chart .seg-monthly { fill: var(--series-2); }
.chart .seg-one_off { fill: var(--series-3); }
.chart .seg-unsorted { fill: var(--series-none); }
.tooltip {
  position: absolute; z-index: 5; pointer-events: none;
  min-width: 140px; padding: 8px 10px; border-radius: var(--radius-s);
  background: var(--ink); color: var(--paper); font-size: 0.85rem; line-height: 1.35;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}
.tooltip .t-title { color: color-mix(in srgb, var(--paper) 70%, transparent); margin-bottom: 4px; }
.tooltip .t-row { display: flex; align-items: center; gap: 8px; }
.tooltip .t-row b { font-weight: 700; margin-right: auto; }
.tooltip .t-row i { display: inline-block; width: 10px; height: 2px; border-radius: 1px; }

/* ---------- habits page ---------- */
.habit-row { display: grid; gap: 10px 20px; grid-template-columns: minmax(0, 1fr) auto; padding: 16px 20px; border-top: 1px solid var(--rule-soft); }
.habit-row:first-of-type { border-top: 0; }
.habit-row .title a { font-weight: 650; font-size: 1.05rem; text-decoration: none; }
.habit-row .title a:hover { text-decoration: underline; }
.habit-row .figures { display: flex; gap: 20px; text-align: right; }
.habit-row .figures b { display: block; font-size: 1.15rem; font-stretch: 88%; }
.habit-row .figures span { font-size: 0.8rem; color: var(--slate); }
.habit-row .heat-wrap { grid-column: 1 / -1; overflow-x: auto; }
.heat { display: inline-grid; grid-auto-flow: column; grid-template-rows: repeat(7, var(--cell, 11px)); grid-auto-columns: var(--cell, 11px); gap: 3px; }
.heat i { border-radius: 2px; }
.heat .full { background: var(--heat-2); }
.heat .part { background: var(--heat-1); }
.heat .missed { background: var(--heat-0); }
.heat .off { box-shadow: inset 0 0 0 1px var(--rule-soft); }
.heat .pending { box-shadow: inset 0 0 0 2px var(--hl); }
.heat .before, .heat .future { visibility: hidden; }
.heat.big { --cell: 13px; }
.heat-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.8rem; color: var(--slate); margin-top: 8px; }
.heat-legend span { display: inline-flex; align-items: center; gap: 6px; }
.heat-legend i { width: 11px; height: 11px; border-radius: 2px; display: inline-block; }

.day-picker { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- money ---------- */
.month-switch { display: inline-flex; align-items: center; gap: 4px; }
.month-switch a, .month-switch span.disabled { display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center; border-radius: 50%; text-decoration: none; }
.month-switch a:hover { background: var(--paper); }
.month-switch span.disabled { color: var(--rule); }
.month-switch strong { min-width: 9.5em; text-align: center; font-size: 1.05rem; }
.review-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--hl-soft); border: 1px solid var(--hl); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px; color: var(--ink); }
.review-banner a { font-weight: 650; }

.tx-list { list-style: none; margin: 0; padding: 0; }
.tx { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 12px 20px; border-top: 1px solid var(--rule-soft); }
.tx:first-child { border-top: 0; }
.tx .who { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx .amt { font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; }
.tx .amt.in { color: var(--good); }
.tx .meta { font-size: 0.85rem; color: var(--slate); }
.tx .meta .cat { color: var(--ink); }
.tx .edit { grid-column: 1 / -1; display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr) auto; align-items: center; margin-top: 8px; }
.tx .edit select, .tx .edit input { min-height: 40px; }
.tx .edit .more { grid-column: 1 / -1; }
.tx .edit .more summary { cursor: pointer; color: var(--slate); font-size: 0.85rem; }
.tx .edit .more-fields { display: grid; gap: 8px; margin-top: 8px; }
@media (min-width: 700px) { .tx .edit .more-fields { grid-template-columns: 1fr 1fr; } }
.tx .edit[hidden] { display: none; }
.tx-summary {
  grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px;
  border: 0; background: none; padding: 0; font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.tx-summary:hover .who { text-decoration: underline; }
.tx.saved { animation: saved 600ms ease; }
@keyframes saved { from { background: var(--hl-soft); } to { background: transparent; } }
.tx-filters { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; margin-bottom: 16px; }
.tx-filters .search { grid-column: 1 / -1; }
@media (min-width: 900px) { .tx-filters { grid-template-columns: 2fr 1fr 1fr 1fr auto; } .tx-filters .search { grid-column: auto; } }
.chip { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--rule-soft); font-size: 0.78rem; color: var(--slate); }

/* ---------- settings ---------- */
.conn { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px 16px; padding: 14px 0; border-top: 1px solid var(--rule-soft); }
@media (min-width: 700px) { .conn { grid-template-columns: minmax(0, 1fr) auto; align-items: start; } }
.conn:first-of-type { border-top: 0; }
.conn .status { font-size: 0.85rem; }
.status-ok { color: var(--good); font-weight: 600; }
.status-warn { color: var(--late); font-weight: 600; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85rem; background: var(--rule-soft); padding: 2px 6px; border-radius: 4px; word-break: break-all; }
.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row input { flex: 1; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85rem; }
.bank-list { list-style: none; margin: 0; padding: 0; max-height: 60vh; overflow-y: auto; }
.bank-list li { border-top: 1px solid var(--rule-soft); }
.bank-list button { width: 100%; text-align: left; padding: 12px 4px; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; display: flex; align-items: center; gap: 12px; }
.bank-list button:hover { background: var(--hover); }
.bank-list img { width: 28px; height: 28px; object-fit: contain; border-radius: 6px; background: #fff; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(420px, 100%); }
.login-card h1 { font-size: clamp(4rem, 18vw, 6rem); font-weight: 800; font-stretch: 75%; letter-spacing: -0.03em; line-height: 0.9; }
.login-card p { color: var(--slate); margin: 12px 0 28px; }
.google-btn { width: 100%; min-height: 52px; font-size: 1rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
