/* GoSplit — compact, information-dense styling (no framework). Hand-written to
   keep the build self-contained; swap in the Tailwind standalone CLI later. */
:root {
  --bg: #f7f8f8; --panel: #fff; --ink: #1c1e21; --muted: #6b7280;
  --line: #e5e7eb; --accent: #8d3f4c; --accent-ink: #fff; --accent-soft: #f3e6e9;
  --pos: #047857; --neg: #b91c1c; --danger: #b91c1c; --warn: #92400e; --warn-bg: #fef3c7;
  --pos-bg: #ecfdf5; --neg-bg: #fef2f2;
  --radius: 8px; --maxw: 900px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg:#0f1211; --panel:#181b1a; --ink:#e6e7e8; --muted:#9aa1a8; --line:#2a2f2d;
          --accent:#d98d98; --accent-ink:#2e1016; --accent-soft:#382028; --pos:#34d399; --neg:#f87171;
          --pos-bg:#0d2b21; --neg-bg:#331717; --warn-bg:#3f2d0a; }
}
/* Named accent themes (see internal/web/theme.go). :root defaults to burgundy;
   data-accent selects another. Each non-default theme sets its light values here
   and its dark values inside the dark media query below, so contrast holds in
   both modes. */
:root[data-accent="teal"]   { --accent:#0f766e; --accent-ink:#fff; --accent-soft:#e4f0ee; }
:root[data-accent="indigo"] { --accent:#4f46e5; --accent-ink:#fff; --accent-soft:#e9e8fb; }
:root[data-accent="forest"] { --accent:#2d6a4f; --accent-ink:#fff; --accent-soft:#e3efe9; }
:root[data-accent="amber"]  { --accent:#b45309; --accent-ink:#fff; --accent-soft:#f7ecdf; }
:root[data-accent="slate"]  { --accent:#475569; --accent-ink:#fff; --accent-soft:#e8ecf1; }
@media (prefers-color-scheme: dark) {
  :root[data-accent="teal"]   { --accent:#2dd4bf; --accent-ink:#04211d; --accent-soft:#10332f; }
  :root[data-accent="indigo"] { --accent:#a5b4fc; --accent-ink:#1e1b4b; --accent-soft:#252a4a; }
  :root[data-accent="forest"] { --accent:#74c69d; --accent-ink:#08251a; --accent-soft:#1a3329; }
  :root[data-accent="amber"]  { --accent:#fbbf24; --accent-ink:#451a03; --accent-soft:#3a2b10; }
  :root[data-accent="slate"]  { --accent:#94a3b8; --accent-ink:#0f172a; --accent-soft:#26303d; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
       background: var(--bg); color: var(--ink); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.4rem; margin: .2rem 0 1rem; }
h2 { font-size: 1.05rem; margin: 1.2rem 0 .5rem; }
code { background: var(--line); padding: 0 .3em; border-radius: 4px; font-size: .85em; }

.topbar { display: flex; align-items: center; gap: 1rem; padding: .5rem 1rem;
          background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.brand { font-weight: 700; color: var(--ink); }
.nav { display: flex; gap: 1rem; align-items: center; }
.nav a { color: var(--ink); font-size: .92rem; display: inline-flex; align-items: center; gap: .35rem; }
.nav a.on { color: var(--accent); font-weight: 600; }
.nav a .icon { width: 15px; height: 15px; }
.nav a.a-btn { color: var(--accent-ink); }
.nav a.a-btn:hover { text-decoration: none; }
.spacer { flex: 1; }
.menu summary { cursor: pointer; list-style: none; }
.menu-panel { position: absolute; right: 1rem; background: var(--panel); border: 1px solid var(--line);
              border-radius: var(--radius); padding: .5rem; display: flex; flex-direction: column; gap: .3rem; min-width: 140px; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 1rem; padding-bottom: 5rem; }

.flash { padding: .6rem .8rem; border-radius: var(--radius); margin-bottom: 1rem; }
.flash.ok { background: #ecfdf5; color: var(--pos); }
.flash.err { background: #fef2f2; color: var(--neg); }
.flash.warn { background: var(--warn-bg); color: var(--warn); }

table.grid { width: 100%; border-collapse: collapse; background: var(--panel);
             border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.grid th, .grid td { padding: .5rem .6rem; border-bottom: 1px solid var(--line); text-align: left; font-size: .92rem; }
.grid th { background: rgba(0,0,0,.02); font-weight: 600; }
.grid .num { text-align: right; font-variant-numeric: tabular-nums; }
.grid tr.deleted td, tr.dim td { opacity: .5; }
td.date, .date { color: var(--muted); font-size: .85rem; white-space: nowrap; }

.pos { color: var(--pos); } .neg { color: var(--neg); }
.muted { color: var(--muted); } .small { font-size: .85rem; }
.tag { font-size: .7rem; background: var(--line); border-radius: 4px; padding: 0 .35em; vertical-align: middle; }
.tag.danger { background: #fee2e2; color: var(--danger); }

.summary { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.summary-item { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
                padding: .6rem .9rem; display: flex; flex-direction: column; }
.summary-item .label { font-size: .8rem; color: var(--muted); }
.summary-item .amount { font-size: 1.2rem; font-weight: 700; }

form.stack { display: flex; flex-direction: column; gap: .6rem; max-width: 360px; }
form label { display: flex; flex-direction: column; gap: .2rem; font-size: .85rem; color: var(--muted); }
input, select, textarea, button { font: inherit; }
input, select, textarea { padding: .45rem .5rem; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--ink); }
button { background: var(--accent); color: var(--accent-ink); border: none; border-radius: 6px; padding: .5rem .9rem; cursor: pointer; }
button.secondary, .btn.secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn { display: inline-block; background: var(--accent); color: var(--accent-ink); border-radius: 6px; padding: .45rem .8rem; }
.linkbtn { background: none; color: var(--accent); padding: 0; }
.linkbtn.danger { color: var(--danger); }
.inline, .inline-form { display: inline-flex; gap: .4rem; align-items: center; }
.inline-form { margin: .5rem 0 1rem; flex-wrap: wrap; }

.auth-card { max-width: 360px; margin: 3rem auto; background: var(--panel); border: 1px solid var(--line);
             border-radius: var(--radius); padding: 1.5rem; }
.auth-links { display: flex; justify-content: space-between; margin-top: 1rem; font-size: .85rem; }

.page-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }
.head-actions { display: flex; gap: .5rem; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.balances-inline { margin: .5rem 0 1rem; font-weight: 600; }

.filterbar { display: flex; gap: .5rem; margin: .8rem 0 .4rem; align-items: center; }
.search-wrap { flex: 1; display: flex; align-items: center; gap: .4rem; border: 1px solid var(--line);
  border-radius: 10px; padding: .4rem .6rem; background: var(--panel); }
.search-wrap .icon { color: var(--muted); }
.search-wrap input { flex: 1; border: none; background: none; font: inherit; color: var(--ink); outline: none; min-width: 0; }
.filter-adv { position: relative; }
.filter-adv > summary { list-style: none; cursor: pointer; display: inline-flex; position: relative; }
.filter-adv > summary::-webkit-details-marker { display: none; }
.filter-adv.has-active > summary::after { content: ""; position: absolute; top: 2px; right: 2px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--panel); }
.filter-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 280px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 28px rgba(0,0,0,.18); padding: .7rem; }
.filter-panel .prow { display: flex; gap: .4rem; }
.filter-panel .prow input { flex: 1; min-width: 0; padding: .4rem .5rem;
  border-radius: 7px; background: var(--panel); color: var(--ink); font: inherit; }
.filter-panel .a-btn { margin-top: .8rem; }
.filter-chips { margin: 0 0 .8rem; }
.filter-chips .clear-chip { background: transparent; color: var(--muted); border: 1px solid var(--line); }

.expense-form { max-width: 560px; margin: 0 auto; }
.target-bar { display: flex; align-items: center; gap: .6rem; justify-content: center;
  background: var(--accent-soft); border-radius: 10px; padding: .5rem .7rem; margin-bottom: .4rem; }
.target-lab { font-size: .72rem; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; color: var(--accent); }
.target-select { flex: 0 1 auto; max-width: 320px; padding: .4rem .5rem; border: 1px solid var(--line);
  border-radius: 8px; background: var(--panel); color: var(--ink); font: inherit; font-weight: 600; }
.desc-row { display: flex; gap: .5rem; align-items: center; justify-content: center; margin: .3rem 0 .2rem; flex-wrap: wrap; }
.desc-row .desc { flex: 1; min-width: 160px; padding: .5rem .6rem; border-radius: 8px; background: var(--panel); color: var(--ink); font: inherit; }
.cur-btn { font-size: .95rem; font-weight: 700; }
.paidby-line { text-align: center; color: var(--muted); font-size: .9rem; margin: .5rem 0 .2rem; }
.paidby-line .picker { margin-left: .3rem; }
.native-select { width: 100%; padding: .5rem; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); font: inherit; }
.form-note { width: 100%; border-radius: 8px; resize: vertical; }
.participants-list { padding: .2rem; }
.p-preview { color: var(--muted); font-variant-numeric: tabular-nums; }
.date-row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.date-row input[type=date] { padding: .45rem .5rem; border-radius: 8px; background: var(--panel); color: var(--ink); font: inherit; }
.form-actions { display: flex; gap: .5rem; margin-top: 1.2rem; }
.form-actions .a-btn { flex: 1; justify-content: center; }
.ack { display: flex; flex-direction: row; align-items: center; gap: .4rem; margin: 1rem 0; }

/* per-method hint visibility, driven by the checked radio (no JS needed) */
.expense-form .hint { display: none; text-align: center; }
.expense-form:has(input[value="EQUAL"]:checked) .hint-EQUAL,
.expense-form:has(input[value="EXACT"]:checked) .hint-EXACT,
.expense-form:has(input[value="PERCENTAGE"]:checked) .hint-PERCENTAGE,
.expense-form:has(input[value="SHARE"]:checked) .hint-SHARE,
.expense-form:has(input[value="ADJUSTMENT"]:checked) .hint-ADJUSTMENT { display: block; }
/* Validation messages render next to the field that caused them, so a rejected
   submit points at the fix instead of only banner-ing at the top. */
.expense-form .field-err { color: var(--danger, #b3261e); font-size: 13px; margin: 4px 0 0; text-align: center; }
/* value inputs are irrelevant for an equal split; previews only show for it */
.expense-form:has(input[value="EQUAL"]:checked) .p-val input { display: none; }
.expense-form:not(:has(input[value="EQUAL"]:checked)) .p-preview { display: none; }

.activity { list-style: none; padding: 0; }
.activity li { padding: .5rem 0; border-bottom: 1px solid var(--line); display: flex; gap: .8rem; }
.settlements, .members { list-style: none; padding: 0; }
.settlements li, .members li { padding: .25rem 0; }

.site-footer { text-align: center; padding: 1.2rem 1rem; font-size: .8rem; color: var(--muted); }
.site-footer a { color: var(--muted); }
.site-footer .ver { margin-left: .6rem; opacity: .7; font-variant-numeric: tabular-nums; }

/* Backup page: archive list rows and the copyable CLI block. */
.l-list { display: flex; flex-direction: column; gap: .1rem; }
.l-list .l-row { padding: .5rem 0; border-bottom: 1px solid var(--line); }
.l-list .l-row:last-child { border-bottom: 0; }
pre.cli { overflow-x: auto; padding: .7rem .8rem; border-radius: var(--radius); background: var(--line); font-size: .78rem; line-height: 1.6; }

.bottom-nav { display: none; }
@media (max-width: 640px) {
  .nav { display: none; }
  .cols { grid-template-columns: 1fr; }
  .site-footer { padding-bottom: calc(1.2rem + 56px + env(safe-area-inset-bottom)); }
  .bottom-nav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: var(--panel);
    border-top: 1px solid var(--line); justify-content: space-around; align-items: flex-end;
    padding: .35rem .2rem calc(.4rem + env(safe-area-inset-bottom)); z-index: 20; }
  .bottom-nav a { color: var(--muted); font-size: .68rem; display: flex; flex-direction: column;
    align-items: center; gap: .12rem; text-decoration: none; }
  .bottom-nav a.on { color: var(--accent); font-weight: 650; }
  .bottom-nav a .icon { width: 22px; height: 22px; }
  .bottom-nav .fab { background: var(--accent); color: var(--accent-ink); border-radius: 50%;
    width: 46px; height: 46px; display: grid; place-items: center; margin-top: -26px;
    box-shadow: 0 4px 12px rgba(0,0,0,.25); }
  .bottom-nav .fab .icon { width: 24px; height: 24px; }
}

/* ============================================================
   Component library (UI refresh) — avatars, list rows, cards,
   buttons, segmented controls, pills, chips, pickers, stat tiles.
   Soft accent surfaces use --accent-soft so they track the theme.
   ============================================================ */

.icon { width: 17px; height: 17px; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; fill: none; vertical-align: -3px; flex: none; }

/* avatars — initials circles with a stable per-id color, or an <img> */
.ava { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--c, var(--accent)); color: #fff; font-size: .72rem; font-weight: 700;
  letter-spacing: .02em; flex: none; overflow: hidden; }
.ava img { width: 100%; height: 100%; object-fit: cover; }
.ava.sm { width: 24px; height: 24px; font-size: .58rem; }
.ava.lg { width: 44px; height: 44px; font-size: .9rem; }
.ava-stack { display: inline-flex; }
.ava-stack .ava { box-shadow: 0 0 0 2px var(--panel); }
.ava-stack .ava + .ava { margin-left: -7px; }

/* card + list rows */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.l-row { display: flex; align-items: center; gap: .7rem; padding: .6rem .75rem;
  border-bottom: 1px solid var(--line); background: var(--panel); color: var(--ink); text-decoration: none; }
.l-row:last-child { border-bottom: none; }
a.l-row:hover { background: color-mix(in srgb, var(--accent) 5%, var(--panel)); text-decoration: none; }
.l-main { flex: 1; min-width: 0; }
.l-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.l-sub { font-size: .8rem; color: var(--muted); }
.l-sub.pos { color: var(--pos); } .l-sub.neg { color: var(--neg); }
.l-end { text-align: right; font-variant-numeric: tabular-nums; }
.l-end .amt { font-weight: 650; font-size: .92rem; }
.l-end .amt.pos { color: var(--pos); } .l-end .amt.neg { color: var(--neg); }
.l-end .lbl { display: block; font-size: .68rem; color: var(--muted); }
.chev { color: var(--muted); opacity: .6; }

/* category tile + date block + month heading (expense feed) */
.cat { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px;
  background: var(--accent-soft); font-size: 1.05rem; flex: none; }
.dateblk { width: 30px; text-align: center; flex: none; line-height: 1.1; }
.dateblk b { display: block; font-size: .62rem; color: var(--muted); font-weight: 600; letter-spacing: .06em; }
.dateblk span { font-size: .95rem; font-weight: 650; }
.month-h { font-size: .7rem; letter-spacing: .09em; text-transform: uppercase; color: var(--muted);
  font-weight: 700; padding: .9rem .2rem .35rem; }

/* action buttons */
.a-btn { display: inline-flex; align-items: center; gap: .4rem; font: inherit; font-size: .88rem;
  font-weight: 600; background: var(--accent); color: var(--accent-ink); border: none;
  border-radius: 8px; padding: .5rem .9rem; cursor: pointer; text-decoration: none; }
.a-btn:hover { text-decoration: none; filter: brightness(.96); }
.a-btn.sec { background: var(--accent-soft); color: var(--accent); }
.a-btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.a-btn.icon-only { padding: .5rem .55rem; }
.a-btn.sm { font-size: .78rem; padding: .32rem .62rem; border-radius: 7px; }

/* pill button (opens a picker / carries a small value) */
.pill { display: inline-flex; align-items: center; gap: .35rem; font: inherit; font-size: .86rem;
  font-weight: 600; background: var(--accent-soft); color: var(--accent); border: none;
  border-radius: 999px; padding: .3rem .75rem; cursor: pointer; }
/* same shape, nothing to open: a value the form shows but does not let you change */
.pill.static { cursor: default; }

/* segmented control (radio group) */
.seg { display: flex; background: color-mix(in srgb, var(--muted) 12%, var(--panel));
  border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 3px; }
.seg > label, .seg > button { flex: 1; text-align: center; font: inherit; font-size: .82rem;
  font-weight: 650; padding: .4rem 0; border: none; background: transparent; color: var(--muted);
  border-radius: 7px; cursor: pointer; font-variant-numeric: tabular-nums; }
.seg > label { position: relative; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg > label:has(input:checked), .seg > button[aria-pressed="true"] {
  background: var(--accent); color: var(--accent-ink); box-shadow: 0 1px 2px rgba(0,0,0,.15); }
.seg.mini > label, .seg.mini > button { font-size: .76rem; padding: .3rem 0; }

/* chips (active filters / quick choices) */
.chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: .3rem; font: inherit; font-size: .8rem;
  font-weight: 550; background: var(--accent-soft); color: var(--accent); border: none;
  border-radius: 999px; padding: .26rem .7rem; cursor: pointer; text-decoration: none; }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.chip .x { font-weight: 700; opacity: .7; }

/* stat hero + tiles (balances / group position) */
.stat-hero { border-radius: 12px; padding: .8rem 1rem; color: #fff; margin-bottom: .7rem;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 72%, #160a0d)); }
.stat-hero .lbl { font-size: .74rem; opacity: .85; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.stat-hero .big { font-size: 1.5rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-bottom: .8rem; }
.tile { border: 1px solid var(--line); border-radius: 12px; padding: .6rem .8rem; background: var(--panel); }
.tile .lbl { font-size: .7rem; color: var(--muted); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.tile .val { font-size: 1.1rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.tile .val.pos { color: var(--pos); } .tile .val.neg { color: var(--neg); }

/* head row with avatar + title + trailing action */
.m-head { display: flex; align-items: center; gap: .7rem; margin-bottom: .8rem; }
.m-head h1, .m-head h2 { margin: 0; flex: 1; }
.m-actions { display: flex; gap: .4rem; flex: none; }
.field-lab { font-size: .72rem; font-weight: 650; letter-spacing: .05em; text-transform: uppercase;
  color: var(--muted); margin: .9rem 0 .35rem; }

/* single-checkbox filter row (Activity "archived" toggle) */
.filter-check { display: flex; align-items: center; gap: .45rem; font-size: .85rem;
  color: var(--ink); margin: .5rem 0 .2rem; cursor: pointer; }

/* normally-hidden archived-groups disclosure on the groups page */
.arch-section { margin-top: 1rem; }
.arch-section > summary { list-style: none; cursor: pointer; color: var(--muted);
  font-size: .82rem; font-weight: 650; letter-spacing: .03em; text-transform: uppercase;
  padding: .35rem .25rem; }
.arch-section > summary::-webkit-details-marker { display: none; }
.arch-section > .card { margin-top: .4rem; }

/* overflow menu (native <details>) */
.omenu { position: relative; display: inline-block; }
.omenu > summary { list-style: none; cursor: pointer; display: inline-flex; }
.omenu > summary::-webkit-details-marker { display: none; }
.omenu-panel { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 28px rgba(0,0,0,.18);
  padding: .35rem; min-width: 200px; display: flex; flex-direction: column; gap: .1rem; }
.omenu-panel a, .omenu-panel button { display: flex; align-items: center; gap: .55rem; text-align: left;
  width: 100%; background: none; border: none; color: var(--ink); font: inherit; font-size: .88rem;
  padding: .45rem .5rem; border-radius: 7px; cursor: pointer; }
.omenu-panel a:hover, .omenu-panel button:hover {
  background: color-mix(in srgb, var(--accent) 8%, var(--panel)); text-decoration: none; }
.omenu-panel .danger { color: var(--danger); }
.omenu-panel form { margin: 0; }

/* generic picker (native <details>) used by the expense form */
.picker { position: relative; display: inline-block; }
.picker > summary { list-style: none; cursor: pointer; }
.picker > summary::-webkit-details-marker { display: none; }
.picker-panel { position: absolute; left: 0; top: calc(100% + 6px); z-index: 30; background: var(--panel);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 28px rgba(0,0,0,.18);
  padding: .5rem; min-width: 210px; }
.picker-panel.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .3rem; width: 260px; }
.picker-opt { display: flex; flex-direction: row; align-items: center; gap: .55rem; width: 100%; text-align: left;
  background: none; border: none; font: inherit; font-size: .86rem; padding: .44rem .5rem;
  border-radius: 8px; cursor: pointer; color: var(--ink); }
.picker-opt:hover { background: color-mix(in srgb, var(--accent) 8%, var(--panel)); }
.picker-opt input { position: absolute; opacity: 0; pointer-events: none; }
.picker-opt:has(input:checked) { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.picker-cat { flex-direction: column; gap: .15rem; font-size: .62rem; color: var(--muted); padding: .4rem .1rem; }
.picker-cat em { font-style: normal; font-size: 1.25rem; }
.picker-cat:has(input:checked) { outline: 2px solid var(--accent); color: var(--accent); }

/* amount hero + participant rows (expense form) */
.amount-hero { display: flex; align-items: center; gap: .6rem; justify-content: center; padding: .9rem 0 .4rem; }
.amount-hero input.amt { font: inherit; font-size: 2rem; font-weight: 750; font-variant-numeric: tabular-nums;
  width: 190px; border: none; border-bottom: 2px solid var(--line); background: transparent; color: var(--ink);
  text-align: center; padding: 0 0 .15rem; outline: none; }
.amount-hero input.amt:focus { border-bottom-color: var(--accent); }
.p-row { display: flex; flex-direction: row; align-items: center; gap: .6rem; padding: .5rem .6rem; border-radius: 10px; cursor: pointer; }
.p-row:hover { background: color-mix(in srgb, var(--accent) 5%, var(--panel)); }
.p-row .tick { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--line); color: transparent; flex: none; }
.p-row:has(input.inc:checked) .tick { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.p-row:not(:has(input.inc:checked)) { opacity: .55; }
.p-row input.inc { position: absolute; opacity: 0; pointer-events: none; }
.p-row .p-name { flex: 1; font-weight: 550; }
.p-row .p-val { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .84rem;
  display: inline-flex; align-items: center; gap: .25rem; }
.p-row .p-val input { font: inherit; font-size: .84rem; width: 74px; text-align: right; padding: .22rem .4rem;
  border-radius: 7px; background: var(--panel); color: var(--ink); }
.hint { font-size: .8rem; color: var(--muted); margin: .45rem 0 .2rem; }
.hint b { color: var(--ink); }

/* theme swatches (profile appearance) */
.sw-row { display: flex; gap: .7rem; flex-wrap: wrap; padding: .3rem 0; }
.sw { display: flex; flex-direction: column; align-items: center; gap: .3rem; cursor: pointer;
  font-size: .68rem; color: var(--muted); }
.sw input { position: absolute; opacity: 0; pointer-events: none; }
.sw i { display: block; width: 34px; height: 34px; border-radius: 50%; background: var(--sw);
  border: 2px solid transparent; box-shadow: inset 0 0 0 2px var(--panel); }
.sw:has(input:checked) i { border-color: var(--sw); }
.sw:has(input:checked) { color: var(--ink); font-weight: 650; }
.appearance { border: 1px solid var(--line); border-radius: 8px; padding: .4rem .7rem .6rem; margin: 0; }
.appearance legend { font-size: .8rem; color: var(--muted); padding: 0 .3rem; }

/* "Show all" link when a feed page is truncated at feedLimit */
.feed-more { text-align: center; margin: .8rem 0; }

/* designed empty state */
.empty { text-align: center; color: var(--muted); padding: 2.5rem 1rem; display: flex;
  flex-direction: column; align-items: center; gap: .6rem; }
.empty .icon { width: 34px; height: 34px; opacity: .5; }
.empty p { margin: 0; }

/* inline "reveal a form" disclosure (add friend / create group) */
.add-inline > summary { list-style: none; cursor: pointer; display: inline-flex; }
.add-inline > summary::-webkit-details-marker { display: none; }
.add-inline .inline-form { margin: .7rem 0 0; }

.l-row.dim { opacity: .5; }

/* group header + detail polish */
.member-line { display: flex; align-items: center; gap: .4rem; margin-top: .2rem; }
.group-actions { display: flex; gap: .5rem; margin: .2rem 0 1rem; }
.group-actions .a-btn { flex: 1; justify-content: center; }
.cat-lg { width: 44px; height: 44px; font-size: 1.4rem; border-radius: 12px; }
.receipt .l-row .l-sub { text-transform: uppercase; letter-spacing: .04em; font-size: .72rem; }
.group-invite { display: block; margin: 0 0 1rem; }

/* admin user directory: collapsed rows expanding to an editor */
.tag.role { background: var(--accent-soft); color: var(--accent); }
.adm-exp { border-bottom: 1px solid var(--line); }
.adm-exp:last-child { border-bottom: none; }
.adm-exp.dim > summary { opacity: .55; }
.adm-exp > summary { list-style: none; cursor: pointer; }
.adm-exp > summary::-webkit-details-marker { display: none; }
.adm-exp > summary .l-row { border-bottom: none; }
.adm-exp[open] > summary .chev-d { transform: rotate(180deg); }
.chev-d { color: var(--muted); transition: transform .15s; }
.adm-editor { padding: .2rem .8rem .9rem; background: color-mix(in srgb, var(--accent) 3%, var(--panel)); }
.add-inline .adm-editor { background: none; padding: .7rem 0 0; }
.adm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .5rem; }
.adm-grid label { display: flex; flex-direction: column; gap: .2rem; font-size: .74rem; color: var(--muted); }
.adm-grid input, .adm-grid select { padding: .4rem .5rem; border-radius: 7px;
  background: var(--panel); color: var(--ink); font: inherit; font-size: .84rem; }
.adm-actions { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .7rem; align-items: center; }
.adm-pw { display: flex; gap: .35rem; flex: 1; min-width: 210px; }
.adm-pw input { flex: 1; min-width: 0; padding: .34rem .5rem; border-radius: 7px;
  background: var(--panel); color: var(--ink); font: inherit; font-size: .8rem; }
.a-btn.danger-ghost { background: transparent; color: var(--danger); border: 1px solid var(--line); }
.magic-inline { margin-top: .55rem; font-size: .8rem; background: var(--pos-bg); color: var(--pos);
  border-radius: 8px; padding: .5rem .65rem; word-break: break-all; }
.magic-inline code { background: transparent; }

/* expense note */
.note-body { padding: .8rem; white-space: pre-wrap; word-break: break-word; }
.note-form { display: flex; flex-direction: column; gap: .5rem; align-items: flex-start; margin-top: .5rem; }
.note-form textarea { width: 100%; padding: .5rem .6rem; border-radius: 8px;
  background: var(--panel); color: var(--ink); font: inherit; resize: vertical; }

/* currency conversion: exchange-equation page */
.convert-form { max-width: 560px; margin: 0 auto; }
.cv-eq { display: grid; grid-template-columns: 1fr auto 1fr; gap: .5rem; align-items: stretch; margin: .8rem 0 .2rem; }
.cv-side { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: .6rem .7rem; }
.cv-side .lbl { font-size: .66rem; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.cv-side input.amt { width: 100%; font: inherit; font-size: 1.35rem; font-weight: 750; font-variant-numeric: tabular-nums;
  border: none; border-bottom: 2px solid var(--line); background: transparent; color: var(--ink); padding: .05rem 0 .15rem; outline: none; }
.cv-side input.amt:focus { border-bottom-color: var(--accent); }
.cv-side select.cur { margin-top: .4rem; font: inherit; font-size: .8rem; font-weight: 700; color: var(--accent);
  background: var(--accent-soft); border: none; border-radius: 999px; padding: .22rem .55rem; cursor: pointer; }
.cv-arrow { display: grid; place-items: center; color: var(--muted); }
.cv-rate { display: flex; align-items: center; gap: .5rem; justify-content: center; flex-wrap: wrap;
  background: var(--panel); border: 1px dashed var(--line); border-radius: 10px; padding: .45rem .6rem; margin: .5rem 0; }
.cv-rate .eqn { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.cv-rate input { width: 90px; font: inherit; font-size: .84rem; font-weight: 650; font-variant-numeric: tabular-nums;
  text-align: center; padding: .22rem .4rem; border-radius: 7px; background: var(--panel); color: var(--ink); }
.rate-src { font-size: .66rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; border-radius: 4px; padding: .1em .45em; }
.rate-src.fetched { background: var(--pos-bg); color: var(--pos); }
.rate-src.custom { background: var(--neg-bg); color: var(--neg); }
.cv-summary { text-align: center; font-size: .86rem; color: var(--muted); margin: .5rem 0 .2rem; font-variant-numeric: tabular-nums; }
.iconbtn { background: none; border: none; color: var(--muted); cursor: pointer; padding: .15rem; display: inline-flex; }
.iconbtn:hover { color: var(--accent); }

/* Text fields light up in the theme accent on hover and while focused. */
input:hover, select:hover, textarea:hover,
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input:focus, select:focus, textarea:focus { outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
/* Underline-style hero amounts: recolor the underline, no boxy ring. */
.amount-hero input.amt:hover, .cv-side input.amt:hover { border-bottom-color: var(--accent); }
.amount-hero input.amt:focus, .cv-side input.amt:focus, .search-wrap input:focus { box-shadow: none; }

/* htmx boost: thin top progress bar while a request is in flight */
body.htmx-request::before {
  content: ""; position: fixed; top: 0; left: 0; right: 0; height: 3px;
  background: var(--accent); z-index: 1000;
  animation: pageload 1s ease-out infinite;
}
@keyframes pageload {
  from { transform: scaleX(0); transform-origin: left; }
  to   { transform: scaleX(1); transform-origin: left; }
}

/* hx-disabled-elt marks the in-flight submit button; keep it visibly inert so a
   second tap reads as rejected rather than ignored. */
button[disabled], .a-btn[disabled] { opacity: .55; cursor: default; filter: none; }

/* A fragment refreshing itself (filters, paging) dims in place instead of
   raising the page-wide top bar -- the rest of the page never left. */
.frag.htmx-request { opacity: .55; transition: opacity .12s ease-out; }

/* The freshness poller is its own hx-indicator so a background refresh every
   10s shows nothing at all. It renders no box either way; keep it explicit. */
.poller { display: none; }

@media (prefers-reduced-motion: reduce) {
  body.htmx-request::before { animation: none; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
