:root {
  --bg: #0a0d13;
  --surface: #131926;
  --surface-2: #182031;
  --line: #222c3e;
  --text: #edf1f7;
  --muted: #8e9bb0;
  --accent: #f9a825;
  --accent-strong: #ffc14d;
  --accent-ink: #1c1204;
  --blue: #4fb3ff;
  --violet: #a78bfa;
  --ok: #8fcf9f;
  --warn: #f2c46b;
  --danger: #f08a7a;
  --info: #9fc3ef;
  --radius: 12px;
  --tile-radius: 20px;
  --gap: 12px;
  --font: "Google Sans Flex", "Google Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Google Sans Code", ui-monospace, "SF Mono", "Cascadia Code", Menlo, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-strong); text-underline-offset: 2px; }
a:hover { color: #ffd685; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { margin: 0; line-height: 1.25; font-weight: 600; }
h2 { font-size: 1rem; letter-spacing: .01em; }
h3 { font-size: .95rem; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.num { font-variant-numeric: tabular-nums; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }

/* Header: brand, section pills, status. Sections drop to their own row when the width runs out. */
.top { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 5; }
.top-inner, main, .foot, #banner > div { max-width: 1480px; margin: 0 auto; padding-left: 22px; padding-right: 22px; }
.top-inner { display: flex; align-items: center; gap: 10px 22px; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand h1 { font-size: 1.15rem; font-weight: 650; letter-spacing: -.01em; }
/* The gold diamond from the bayar.dev mark: a rounded square turned 45 degrees. The margin makes room for its corners. */
.brand-mark { width: 14px; height: 14px; margin: 0 3px; border-radius: 4px; background: var(--accent); transform: rotate(45deg); flex: none; }
.top-right { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; margin-left: auto; font-size: .85rem; }
.source { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.tabs a { color: var(--muted); text-decoration: none; padding: 5px 12px; border-radius: 999px; white-space: nowrap; font-size: .9rem; }
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.narrow { display: none; }
@media (max-width: 1399px) {
  .tabs { order: 3; flex-basis: 100%; margin: 0 -6px; }
}
/* Phone: brand, status and the two buttons share one row; sections scroll on the next. */
@media (max-width: 640px) {
  .top-inner, main, .foot, #banner > div { padding-left: 14px; padding-right: 14px; }
  .top-inner { gap: 8px 10px; padding-top: 8px; padding-bottom: 8px; }
  .top-right { gap: 6px 8px; }
  .source { gap: 6px 8px; }
  #today, .wide { display: none; }
  .narrow { display: inline; }
  .source .btn { padding: 4px 11px; }
  .pill { padding: 3px 9px; }
}

/* Pills, badges, buttons */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: .8rem; white-space: nowrap; }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill.live { color: var(--ok); border-color: #3c5a43; }
.pill.stale, .pill.snapshot { color: var(--warn); border-color: #5f4d27; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .75rem; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.badge.full { color: var(--ok); border-color: #3c5a43; background: #18241b; }
.badge.partial { color: var(--info); border-color: #34475f; }
.badge.out-of-pocket { color: var(--text); }
.badge.free { color: var(--info); border-color: #34475f; }
.badge.warn { color: var(--warn); border-color: #5f4d27; }
.badge.danger { color: var(--danger); border-color: #6a3a33; }
.btn { font: inherit; font-size: .85rem; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 13px; cursor: pointer; }
.btn:hover { border-color: var(--accent); }
.btn[disabled] { opacity: .6; cursor: progress; }
.link-btn { font: inherit; color: var(--accent-strong); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.icon-btn { font: inherit; background: none; border: 1px solid var(--line); color: var(--text); width: 32px; height: 32px; border-radius: 8px; cursor: pointer; }

/* Banner */
#banner > div { margin-top: 14px; }
.banner { border: 1px solid #5f4d27; background: #221c11; color: #f5dca8; border-radius: var(--radius); padding: 10px 14px; font-size: .9rem; }
.banner.error { border-color: #6a3a33; background: #241512; color: #f6c3b9; }
.banner strong { color: #fff0d0; }

/* Layout */
main { padding-top: 14px; padding-bottom: 28px; }
main:focus { outline: none; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.card-head a { font-size: .85rem; }
.stack { display: grid; gap: var(--gap); }
.state { padding: 40px 0; text-align: center; color: var(--muted); }
.empty { color: var(--muted); font-size: .9rem; padding: 6px 0; }

/* Attention */
.list { list-style: none; margin: 0; padding: 0; }
.row { display: grid; grid-template-columns: 92px 1fr auto; gap: 12px; align-items: start; padding: 10px 8px; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row-btn { all: unset; display: contents; cursor: pointer; }
.row.clickable { cursor: pointer; border-radius: 8px; }
.row.clickable:hover, .row.clickable:focus-visible { background: var(--surface-2); }
.when { font-size: .8rem; line-height: 1.3; }
.when b { display: block; font-size: .9rem; color: var(--text); font-weight: 600; }
.when.soon b, .when.passed b { color: var(--accent-strong); }
.row .title { font-weight: 500; }
.row .detail { color: var(--muted); font-size: .85rem; }
.amount { text-align: right; white-space: nowrap; font-size: .9rem; }
.amount small { display: block; color: var(--muted); font-size: .72rem; }
.subhead { margin: 16px 0 6px; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
.tasks li { padding: 7px 0; border-top: 1px solid var(--line); font-size: .9rem; }
.tasks li:first-child { border-top: 0; }
.tasks .detail { color: var(--muted); font-size: .82rem; }

/* Money */
.figure { font-size: 1.6rem; font-weight: 600; letter-spacing: -.01em; }
.figure small { font-size: .85rem; color: var(--muted); font-weight: 400; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: .9rem; margin-top: 10px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.note { font-size: .8rem; color: var(--muted); margin-top: 10px; border-left: 2px solid var(--line); padding-left: 8px; }
.money-split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
.money-split > div { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.money-split .label { color: var(--muted); font-size: .8rem; }
.money-split .val { font-size: 1.25rem; font-weight: 600; }

/* Projects + links */
.proj { padding: 10px 0; border-top: 1px solid var(--line); }
.proj:first-child { border-top: 0; padding-top: 0; }
.proj-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.links { display: grid; gap: 14px; }
.links ul { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.links a { display: inline-block; padding: 4px 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); text-decoration: none; color: var(--text); font-size: .85rem; }
.links a:hover { border-color: var(--accent); }

/* Detail views */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar input, .toolbar select { font: inherit; font-size: .9rem; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; }
.toolbar input[type="search"] { flex: 1 1 220px; min-width: 0; }
.toolbar input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
.toolbar label { white-space: nowrap; }
.toolbar label { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font-size: .85rem; }
.toolbar .dir-btn { width: 30px; height: 30px; font-size: .9rem; line-height: 1; }
.th-sort { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
.th-sort:hover, .th-sort.active { color: var(--text); }
.th-sort:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.group + .group { margin-top: 18px; }
.group-head { font-size: .95rem; font-weight: 600; margin: 0 0 8px; }
.group-head .muted { font-weight: 400; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 9px 12px; border-top: 1px solid var(--line); vertical-align: top; }
thead th { border-top: 0; color: var(--muted); font-weight: 500; font-size: .8rem; background: #0f1420; position: sticky; top: 0; }
td.r, th.r { text-align: right; }
tbody tr { cursor: pointer; }
tbody tr:hover, tbody tr:focus-visible { background: var(--surface-2); }
.count { color: var(--muted); font-size: .85rem; margin: 10px 0 6px 4px; }
.unknown { color: var(--muted); font-style: italic; }

/* Drawer */
.drawer { margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(520px, 100vw); border: 0; border-left: 1px solid var(--line); padding: 0; background: var(--surface); color: var(--text); }
.drawer::backdrop { background: rgba(0, 0, 0, .55); }
.drawer-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; background: var(--surface); }
/* The z-index keeps scrolled rows that are positioned themselves (step lines, the Apply bar) under the heading. */
.drawer-head h2 { font-size: 1.05rem; }
.drawer-body { padding: 16px 18px 28px; display: grid; gap: 14px; }
.fields { display: grid; grid-template-columns: minmax(120px, 38%) 1fr; gap: 8px 14px; margin: 0; font-size: .9rem; }
.fields dt { color: var(--muted); }
.fields dd { margin: 0; overflow-wrap: anywhere; }

.foot { padding-top: 8px; padding-bottom: 28px; font-size: .8rem; }

@media (max-width: 560px) {
  .row { grid-template-columns: 74px 1fr; }
  .row .amount { grid-column: 2; text-align: left; }
  .money-split { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: no-preference) {
  .row.clickable, .links a, .btn { transition: background-color .12s, border-color .12s; }
}

/* Grouped verification tasks */
.attention-disclosure { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
.attention-disclosure > summary { cursor: pointer; color: var(--text); font-size: .9rem; }
.attention-disclosure > summary::marker { color: var(--accent-strong); }
.attention-disclosure > summary:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 4px; }
.tasks details > summary { cursor: pointer; list-style: none; display: block; padding-left: 18px; position: relative; }
.tasks details > summary::-webkit-details-marker { display: none; }
.tasks details > summary::before { content: "▸"; position: absolute; left: 0; top: 0; color: var(--accent-strong); }
.tasks details[open] > summary::before { content: "▾"; }
.tasks details > summary .title { color: var(--text); }
.subtasks { margin: 6px 0 0 18px; }
.subtasks li { padding: 6px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.chip { font: inherit; font-size: .78rem; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 1px 9px; cursor: pointer; }
.chip:hover { border-color: var(--accent); }
.chip-list > summary { cursor: pointer; color: var(--accent-strong); margin-top: 4px; width: fit-content; }

/* Coverage kinds derived from benefits */
.badge.program { color: var(--ok); border-color: #2f4a37; }
.badge.credits { color: var(--accent-strong); border-color: #5c3f22; }
.badge.pending { color: var(--warn); border-color: #5f4d27; }
.personal { margin-top: 12px; padding-top: 4px; border-top: 1px solid var(--line); }
.personal .num { font-size: 1.1rem; font-weight: 600; }

/* Live updates: changed-record highlight and toast */
@keyframes flash-row {
  from { background-color: rgba(249, 168, 37, .26); box-shadow: inset 3px 0 0 var(--accent); }
  to { background-color: transparent; box-shadow: inset 3px 0 0 transparent; }
}
.flash { animation: flash-row 2.4s ease-out; }
@media (prefers-reduced-motion: reduce) {
  .flash { animation: none; outline: 2px solid var(--accent); outline-offset: -2px; }
}
.toast { position: fixed; right: 16px; bottom: 16px; z-index: 20; max-width: min(420px, calc(100vw - 32px)); pointer-events: none; }
.toast-msg { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 10px; padding: 10px 14px; font-size: .88rem; box-shadow: 0 8px 24px rgba(0, 0, 0, .45); }
@media (prefers-reduced-motion: no-preference) {
  .toast-msg { animation: toast-in .18s ease-out; }
}
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.banner.offline { border-color: #6a3a33; background: #241512; color: #f6c3b9; }

/* Header search button + keyboard hints */
kbd { font: inherit; font-family: var(--mono); font-size: .75em; padding: 0 5px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: var(--bg); color: var(--muted); }
.search-btn { display: inline-flex; gap: 8px; align-items: center; }

/* Command palette */
.palette { margin: 12vh auto auto; width: min(640px, calc(100vw - 32px)); max-height: 70vh; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); box-shadow: 0 24px 60px rgba(0, 0, 0, .6); }
.palette::backdrop, .help::backdrop { background: rgba(0, 0, 0, .55); }
.palette-box { display: flex; flex-direction: column; max-height: 70vh; }
.palette input { font: inherit; font-size: 1rem; color: var(--text); background: transparent; border: 0; border-bottom: 1px solid var(--line); padding: 14px 16px; outline: none; }
.palette input:focus-visible { box-shadow: inset 0 -2px 0 var(--accent); }
.palette-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; flex: 1 1 auto; }
.palette-opt { display: grid; grid-template-columns: 74px 1fr; column-gap: 10px; align-items: baseline; padding: 7px 10px; border-radius: 8px; cursor: pointer; }
.palette-opt[aria-selected="true"] { background: var(--surface-2); box-shadow: inset 2px 0 0 var(--accent); }
.palette-kind { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.palette-label { font-weight: 500; overflow-wrap: anywhere; }
.palette-sub { grid-column: 2; color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
.palette-empty { padding: 14px 10px; color: var(--muted); }
.palette-hint { padding: 8px 16px; border-top: 1px solid var(--line); }

/* Shortcuts help */
.help { width: min(440px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); }
.shortcuts { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; padding: 16px 18px 20px; font-size: .9rem; }
.shortcuts dt { white-space: nowrap; }
.shortcuts dd { margin: 0; color: var(--muted); }

/* Section changes: short cross-fade of the main region only (header stays put) */
main { view-transition-name: main; }
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(main) { animation: vt-out 120ms ease-in both; }
  ::view-transition-new(main) { animation: vt-in 180ms ease-out both; }
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(4px); } }

/* Upcoming charges: work and personal totals side by side. */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.split .figure { margin-bottom: 0; }

/* Loose ends (from recall) */
.btn.tiny { font-size: .75rem; padding: 1px 8px; border-radius: 6px; flex: none; background: var(--surface-2); }
.loose-note { padding: 10px 0; border-top: 1px solid var(--line); }
.loose-title { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.loose-note .detail { color: var(--muted); font-size: .8rem; margin-top: 2px; }
.loose-items { list-style: none; margin: 6px 0 0; padding: 0; }
.loose-items li { display: flex; gap: 10px; justify-content: space-between; align-items: start; padding: 4px 0 4px 12px; font-size: .9rem; position: relative; }
.loose-items li::before { content: ""; position: absolute; left: 0; top: .85em; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.loose-items li span { min-width: 0; overflow-wrap: anywhere; }
.loose-items li.done span { color: var(--muted); text-decoration: line-through; }
.loose-items li.done::before { background: var(--line); }
.loose-title .btn.tiny { margin-left: auto; }
.loose-fold > summary { cursor: pointer; list-style-position: outside; overflow-wrap: anywhere; }
.loose-fold > summary .badge { margin-left: 6px; }
.loose-actions { display: flex; justify-content: flex-end; margin-top: 4px; }
.toast-msg .link-btn { margin-left: 10px; }
.loose-window { display: inline-flex; align-items: center; gap: 4px; }
.compact-select { font: inherit; font-size: .8rem; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; }

/* ---- Home: bento ------------------------------------------------------------------
   Short answers in tiles; the full lists open in the side panel. On a large window the grid
   fills exactly one screen and each list shows the whole rows that fit (see fitLists). */
.bento { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 1fr); }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--tile-radius); padding: 18px 20px; min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.tile-head { display: flex; align-items: baseline; gap: 10px; }
.tile-head h2, .eyebrow { font-size: .8rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.tile-more { margin-left: auto; font: inherit; font-size: .85rem; color: var(--muted); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: none; white-space: nowrap; }
.tile-more:hover { color: var(--text); }
.big { font-size: clamp(1.9rem, 2.7vw, 2.5rem); font-weight: 650; letter-spacing: -.025em; line-height: 1.08; margin-top: 8px; }
.big small { font-size: .85rem; font-weight: 400; color: var(--muted); letter-spacing: 0; white-space: nowrap; }
.duo { display: flex; flex-wrap: wrap; gap: 0 26px; }
.duo .big { font-size: clamp(1.5rem, 2.2vw, 2.1rem); }
.sub { color: var(--muted); font-size: .85rem; margin-top: 4px; }
.sub b, .key b, .tile-foot b { color: var(--text); font-weight: 600; }
.bar { display: flex; gap: 3px; height: 10px; margin-top: 12px; }
.bar i { display: block; border-radius: 999px; min-width: 8px; flex: 0 1 0; }
.gold { background: var(--accent); } .blue { background: var(--blue); } .violet { background: var(--violet); }
.key { display: flex; flex-wrap: wrap; gap: 2px 16px; font-size: .82rem; color: var(--muted); margin-top: 8px; }
.key i, .mini-name i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; }
.fit-list { list-style: none; margin: 12px 0 0; padding: 0; position: relative; }
.mini { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 7px 6px; border-top: 1px solid var(--line); font-size: .9rem; }
.mini time { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.mini time.soon { color: var(--accent); }
.mini-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-name small { color: var(--muted); }
.clickable { cursor: pointer; }
.mini.clickable:hover, .mini.clickable:focus-visible, .cred.clickable:hover, .cred.clickable:focus-visible { background: var(--surface-2); }
.month-top { margin-top: auto; padding-top: 10px; }
.month-top + .month-foot { margin-top: 2px; }
.month-foot:first-of-type { margin-top: auto; }

.hero { position: relative; border: 0; padding: 22px 24px; color: var(--accent-ink); background: linear-gradient(140deg, #fbb53c, #f9a825 45%, #ee7b33); min-height: 300px; }
.hero .eyebrow { color: rgba(28, 18, 4, .74); position: relative; }
.hero-days { position: absolute; right: 18px; top: -12px; font-size: clamp(7rem, 15vw, 13.5rem); font-weight: 700; letter-spacing: -.05em; line-height: 1; color: rgba(28, 18, 4, .12); pointer-events: none; }
.hero-title { margin-top: auto; padding-top: 16px; font-size: clamp(1.6rem, 2.5vw, 2.3rem); font-weight: 700; letter-spacing: -.025em; line-height: 1.08; position: relative; max-width: 16em; }
.hero-amount { font-size: clamp(2.8rem, 5vw, 4.6rem); font-weight: 700; letter-spacing: -.04em; line-height: 1; margin-top: 6px; position: relative; }
.hero-amount small { display: block; font-size: .85rem; font-weight: 500; letter-spacing: 0; line-height: 1.4; margin-top: 4px; color: rgba(28, 18, 4, .78); }
.hero-detail { margin-top: 10px; font-size: .95rem; max-width: 36em; color: rgba(28, 18, 4, .84); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; position: relative; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 14px; position: relative; }
.hero-go { font: inherit; font-weight: 600; font-size: .9rem; background: var(--accent-ink); color: #fbd591; border: 0; border-radius: 999px; padding: 8px 18px; cursor: pointer; }
.hero-go:hover { background: #000; }
.hero-link, .hero-link:hover { font: inherit; font-size: .9rem; background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.hero-link:hover { text-decoration-thickness: 2px; }
.hero :focus-visible { outline-color: var(--accent-ink); }
.hero.calm { background: var(--surface); border: 1px solid var(--line); color: var(--text); min-height: 0; }
.hero.calm .eyebrow, .hero.calm .hero-detail { color: var(--muted); }
.hero.calm .hero-link, .hero.calm .hero-link:hover { color: var(--accent-strong); }
.hero.calm :focus-visible { outline-color: var(--accent-strong); }

.tile-pair { display: flex; gap: var(--gap); min-width: 0; min-height: 0; }
.count-tile { flex: 1 1 0; min-width: 0; font: inherit; text-align: left; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: var(--tile-radius); padding: 14px 18px; cursor: pointer; display: flex; flex-direction: column; justify-content: center; }
.count-tile b { font-size: clamp(1.8rem, 2.6vw, 2.3rem); font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.count-tile span { font-size: .85rem; color: var(--muted); margin-top: 5px; }
.count-tile:hover { border-color: var(--muted); }
.count-tile.loose { background: linear-gradient(135deg, #2f74c4, #7a5fe0); border-color: transparent; color: #fff; }
.count-tile.loose span { color: #fff; }
.count-tile.loose:hover { filter: brightness(1.08); }
.count-tile.loose:focus-visible { outline-color: #fff; }

.cred { padding: 8px 6px 9px; border-top: 1px solid var(--line); }
.cred-top { display: flex; gap: 12px; font-size: .9rem; align-items: baseline; }
.cred-top span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cred-top span:last-child { margin-left: auto; color: var(--muted); font-size: .82rem; white-space: nowrap; }
.meter { display: block; height: 6px; border-radius: 999px; background: var(--surface-2); margin-top: 6px; overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--blue), var(--violet)); }
.cred.hot .meter i { background: var(--accent); }

.proj-mini { padding: 9px 6px; border-top: 1px solid var(--line); }
.proj-mini .link-btn { color: var(--text); font-weight: 600; text-decoration: none; }
.proj-mini .link-btn:hover { color: var(--accent-strong); }
.proj-mini .next { color: var(--muted); font-size: .85rem; margin-top: 2px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.fit-head { padding: 12px 6px 5px; border-top: 1px solid var(--line); font-size: .72rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.loose-mini { position: relative; padding: 5px 6px 5px 20px; font-size: .85rem; color: var(--text); border-radius: 6px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.loose-mini::before { content: ""; position: absolute; left: 7px; top: .85em; width: 6px; height: 6px; border-radius: 50%; background: linear-gradient(135deg, var(--blue), var(--violet)); }
.loose-mini:hover, .loose-mini:focus-visible { background: var(--surface-2); }
.tile-foot { margin-top: auto; padding: 10px 0 0; font: inherit; font-size: .85rem; color: var(--muted); background: none; border: 0; border-top: 1px solid var(--line); text-align: left; cursor: pointer; }
.tile-foot:hover { color: var(--text); }

.dock { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: minmax(60px, 1fr); gap: 8px; margin-top: 12px; flex: 1; min-height: 0; }
.dock a, .dock button { font: inherit; font-size: .72rem; line-height: 1.25; color: var(--muted); background: var(--surface-2); border: 1px solid transparent; border-radius: 12px; padding: 4px 2px; min-width: 0; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; text-decoration: none; cursor: pointer; }
.dock b { color: var(--text); font-size: .95rem; font-weight: 650; }
.dock img { width: 28px; height: 28px; border-radius: 7px; object-fit: contain; margin-bottom: 4px; box-sizing: border-box; }
.dock img.on-light { background: #e9edf4; padding: 3px; }
.dock span { max-width: 100%; text-align: center; overflow-wrap: break-word; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.dock a:hover, .dock button:hover { border-color: var(--accent); color: var(--text); }

@media (min-width: 760px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero, .t-links { grid-column: span 2; }
  .dock { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
  .bento { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .hero { grid-column: 1 / 6; grid-row: 1 / 4; }
  .t-up { grid-column: 6 / 10; grid-row: 1 / 4; }
  .t-month { grid-column: 10 / 13; grid-row: 1 / 3; }
  .tile-pair { grid-column: 10 / 13; grid-row: 3 / 4; }
  .t-cred { grid-column: 1 / 6; grid-row: 4 / 7; }
  .t-proj { grid-column: 6 / 10; grid-row: 4 / 7; }
  .t-links { grid-column: 10 / 13; grid-row: 4 / 7; }
  .dock { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1100px) and (min-height: 760px) {
  body[data-route="home"] main { padding-bottom: 10px; }
  body[data-route="home"] .foot { padding-top: 0; padding-bottom: 10px; }
  .bento { grid-template-rows: repeat(6, minmax(0, 1fr)); height: calc(100dvh - var(--chrome-h, 110px) - 24px); }
  .hero { min-height: 0; }
  .fit-list { flex: 1 1 0; min-height: 0; overflow: hidden; }
}
@media (min-width: 1100px) and (max-height: 860px) {
  .month-top { display: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .mini, .cred, .count-tile, .dock a, .dock button, .tile-more, .hero-go { transition: background-color .12s, border-color .12s, color .12s, filter .12s; }
}

/* Side panels opened from Home tiles reuse the drawer; its title replaces each list's own heading. */
.panel .card-head h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.panel-agenda .card-head h2 { position: static; width: auto; height: auto; overflow: visible; clip-path: none; }
.link-btn.back { justify-self: start; text-decoration: none; }
dialog .toast { z-index: 30; }

/* ---- Motion: tiles arrive once when Home is opened; bars and meters fill; the panel slides in. */
@media (prefers-reduced-motion: no-preference) {
  .bento.enter > * { animation: tile-in .46s cubic-bezier(.2, .7, .2, 1) both; }
  .bento.enter > .settled { animation: none; }
  .bento.enter > :nth-child(2) { animation-delay: 45ms; }
  .bento.enter > :nth-child(3) { animation-delay: 90ms; }
  .bento.enter > :nth-child(4) { animation-delay: 135ms; }
  .bento.enter > :nth-child(5) { animation-delay: 180ms; }
  .bento.enter > :nth-child(6) { animation-delay: 225ms; }
  .bento.enter > :nth-child(7) { animation-delay: 270ms; }
  .bento.enter .bar i, .bento.enter .meter i { transform-origin: left center; animation: fill-in .7s cubic-bezier(.2, .7, .2, 1) .3s both; }
  .bento.enter .hero-days { animation: days-in .9s cubic-bezier(.2, .7, .2, 1) .1s both; }
  .count-tile, .dock a, .dock button, .hero-go { transition: transform .12s, background-color .12s, border-color .12s, color .12s, filter .12s; }
  .count-tile:hover, .dock a:hover, .dock button:hover { transform: translateY(-2px); }
  .count-tile:active, .dock a:active, .dock button:active, .hero-go:active { transform: scale(.97); }
  .drawer[open] { animation: drawer-in .22s cubic-bezier(.2, .7, .2, 1); }
  .drawer[open]::backdrop { animation: fade-in .22s ease-out; }
}
@keyframes tile-in { from { opacity: 0; transform: translateY(14px) scale(.985); } }
@keyframes fill-in { from { transform: scaleX(0); } }
@keyframes days-in { from { opacity: 0; transform: translateX(28px); } }
@keyframes drawer-in { from { opacity: 0; transform: translateX(36px); } }
@keyframes fade-in { from { opacity: 0; } }

/* ---- Section pages: a title, a strip of figures in the Home style, then filters and the table. */
.view-head { margin: 4px 0 12px; }
.view-head h2 { font-size: 1.45rem; font-weight: 650; letter-spacing: -.02em; }
.stats { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); margin-bottom: 14px; }
.stat { font: inherit; text-align: left; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: var(--tile-radius); padding: 14px 18px 15px; min-width: 0; display: flex; flex-direction: column; }
button.stat { cursor: pointer; }
button.stat:hover { border-color: var(--muted); }
.stat-label { font-size: .76rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.stat-value { font-size: clamp(1.35rem, 2.2vw, 1.9rem); font-weight: 650; letter-spacing: -.025em; line-height: 1.1; margin-top: 6px; }
.stat .bar { height: 8px; margin-top: 9px; }
.stat-sub { font-size: .82rem; color: var(--muted); margin-top: 6px; }
.toolbar { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px; }
.toolbar input, .toolbar select { background: var(--surface-2); border-color: transparent; border-radius: 10px; }
.toolbar input:hover, .toolbar select:hover { border-color: var(--line); }
.table-wrap { border-radius: 16px; }
.group-head { margin-left: 4px; }
.proj-grid { display: grid; align-items: start; gap: var(--gap); grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); }
.proj-card { gap: 8px; }
.proj-card .proj { padding: 0; border: 0; display: grid; gap: 6px; }
.proj-card .link-btn { color: var(--text); text-decoration: none; font-size: 1.05rem; }
.proj-card .link-btn:hover { color: var(--accent-strong); }
@media (prefers-reduced-motion: no-preference) {
  .stats > * { animation: tile-in .4s cubic-bezier(.2, .7, .2, 1) both; }
  .stats > :nth-child(2) { animation-delay: 40ms; }
  .stats > :nth-child(3) { animation-delay: 80ms; }
  .stats > :nth-child(4) { animation-delay: 120ms; }
  .stats > :nth-child(5) { animation-delay: 160ms; }
  .stats .bar i { transform-origin: left center; animation: fill-in .7s cubic-bezier(.2, .7, .2, 1) .25s both; }
}

/* ---- Update panel: review what mail and Claude found, then apply it to Airtable. */
.count-tile .ready { font-style: normal; color: var(--accent-strong); white-space: nowrap; }
.panel-update { display: grid; gap: 14px; }
.upd-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; min-width: 0; }
.upd-card > * + * { margin-top: 8px; }
.upd-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.upd-head h3 { font-size: 1rem; min-width: 0; }
.upd-head h3.upd-count { font-size: 1.35rem; font-weight: 700; letter-spacing: -.01em; }
.upd-head .btn, .upd-head .link-btn { flex: none; }
.link-btn[disabled] { opacity: .6; cursor: progress; text-decoration: none; }
.upd-items > li { padding: 10px 0; border-top: 1px solid var(--line); font-size: .9rem; }
.upd-items > li:first-child { border-top: 0; }
.upd-items .title { font-weight: 500; overflow-wrap: anywhere; }
.upd-items .title .link-btn { text-align: left; font-weight: 500; }
.upd-items .detail { color: var(--muted); font-size: .85rem; margin-top: 2px; overflow-wrap: anywhere; }
.upd-items > li.upd-change { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: start; }
.upd-change input { width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--accent); cursor: pointer; }
.upd-change.left-out .upd-body { opacity: .5; }
.upd-change .link-btn { text-align: left; font-weight: 500; }
.upd-diff { margin-top: 2px; overflow-wrap: anywhere; }
.upd-diff .badge { white-space: normal; }
.upd-step { position: relative; padding-left: 18px; font-size: .85rem; margin-top: 4px; overflow-wrap: anywhere; }
.upd-step::before { content: "↳"; position: absolute; left: 0; top: 0; color: var(--accent); }
.upd-lines { list-style: none; margin: 6px 0 0; padding: 0; font-size: .85rem; color: var(--muted); overflow-wrap: anywhere; }
.upd-outcome.ok { border-color: #3c5a43; }
.upd-outcome.ok h3 { color: var(--ok); }
.upd-outcome.failed { border-color: #5f4d27; }
.upd-outcome.failed h3 { color: var(--warn); }
.upd-outcome h3:focus { outline: none; }
.upd-problem { color: var(--warn); }
.upd-busy { color: var(--muted); font-size: .8rem; flex: none; }
.upd-ask { color: var(--accent-strong); border-color: #7a5a1c; padding: 7px 16px; }
.upd-apply { position: sticky; bottom: 0; background: var(--surface-2); padding: 10px 0 2px; }
.upd-apply-row { display: flex; gap: 8px; margin-top: 8px; }
.upd-apply-row .btn { border-radius: 12px; padding: 10px 16px; font-size: .95rem; }
.btn.upd-go { width: 100%; background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-size: .95rem; font-weight: 600; padding: 10px 16px; border-radius: 12px; }
.btn.upd-go:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn.upd-go[disabled] { opacity: .4; cursor: not-allowed; }
.upd-apply-row .upd-go { flex: 1 1 auto; width: auto; }
@media (prefers-reduced-motion: no-preference) {
  .upd-busy { animation: upd-pulse 1.6s ease-in-out infinite; }
}
@keyframes upd-pulse { 50% { opacity: .45; } }
.upd-card.attention-disclosure { margin-top: 0; }

/* ---- Sign-in: shown in place of the page when the server asks for one, and on the server's own error page. */
.signin { max-width: 30rem; margin: 12vh auto 0; padding: 0 22px; text-align: center; display: grid; gap: 14px; justify-items: center; }
.signin h1, .signin h2 { font-size: 1.5rem; letter-spacing: -.01em; }
.signin .banner { text-align: left; }
.signin a.btn { text-decoration: none; display: inline-block; }
.btn.signin-go { width: auto; min-width: 12rem; padding: 11px 28px; }

/* Bot panel: what the ledger bot changed and what it left for Bayar. */
.bot-h { font-size: .95rem; margin-top: 14px; }
.bot-list { list-style: none; margin: 6px 0 0; padding: 0; }
.bot-row { padding: 9px 6px; border-top: 1px solid var(--line); min-width: 0; }
.bot-top { display: flex; gap: 12px; align-items: baseline; }
.bot-top strong { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.bot-top span { margin-left: auto; white-space: nowrap; }
.bot-quote { font-size: .85rem; color: var(--text); opacity: .85; margin-top: 4px; overflow-wrap: anywhere; }
