/* Bellringer · shape: App / Inset-grouped native · ds: My People (system UI, emerald tint)
   · critique: P5 H5 E4 S5 R4 V5
   Deliberately NOT the house onyx+gold+serif (gate 58). System type, grouped lists,
   materials, signal-bar "reach", a phone tab bar and a Mac-style sidebar. */

:root {
  --bg: #f2f2f7; --surface: #ffffff; --surface-2: #f7f7fa; --elev: #ffffff;
  --fill: rgba(118,118,128,.12); --fill-2: rgba(118,118,128,.08);
  --sep: rgba(60,60,67,.14); --sep-strong: rgba(60,60,67,.24);
  --label: #111114; --label-2: rgba(60,60,67,.74); --label-3: rgba(60,60,67,.46);
  --tint: #0a7c5f; --tint-press: #08684f; --tint-soft: rgba(10,124,95,.11); --on-tint: #fff;
  --red: #e5372b; --red-soft: rgba(229,55,43,.1);
  --orange: #c75f00; --orange-soft: rgba(255,149,0,.14);
  --blue: #0a64d8; --blue-soft: rgba(10,100,216,.1);
  --indigo: #4c47c9; --indigo-soft: rgba(88,86,214,.12);
  --rose: #d81b4f; --rose-soft: rgba(255,45,85,.1);
  --material: rgba(249,249,251,.78);
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 1px 1px rgba(0,0,0,.02);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.14), 0 2px 6px rgba(0,0,0,.06);
  --r: 14px; --r-sm: 10px;
  --sidebar: 252px; --tabbar: 58px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, "Segoe UI", sans-serif;
  --font-round: ui-rounded, "SF Pro Rounded", -apple-system, "Inter", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --surface: #1c1c1e; --surface-2: #232326; --elev: #2c2c2e;
    --fill: rgba(118,118,128,.24); --fill-2: rgba(118,118,128,.16);
    --sep: rgba(84,84,88,.48); --sep-strong: rgba(84,84,88,.7);
    --label: #ffffff; --label-2: rgba(235,235,245,.7); --label-3: rgba(235,235,245,.42);
    --tint: #34d3a2; --tint-press: #2bbd90; --tint-soft: rgba(52,211,162,.15); --on-tint: #002a1f;
    --red: #ff6961; --red-soft: rgba(255,105,97,.16); --orange: #ffb340; --orange-soft: rgba(255,179,64,.16);
    --blue: #5ea8ff; --blue-soft: rgba(94,168,255,.16); --indigo: #8e8cff; --indigo-soft: rgba(142,140,255,.18);
    --rose: #ff6b8e; --rose-soft: rgba(255,107,142,.16);
    --material: rgba(28,28,30,.76);
    --shadow: none; --shadow-lg: 0 12px 40px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --surface: #1c1c1e; --surface-2: #232326; --elev: #2c2c2e;
  --fill: rgba(118,118,128,.24); --fill-2: rgba(118,118,128,.16);
  --sep: rgba(84,84,88,.48); --sep-strong: rgba(84,84,88,.7);
  --label: #ffffff; --label-2: rgba(235,235,245,.7); --label-3: rgba(235,235,245,.42);
  --tint: #34d3a2; --tint-press: #2bbd90; --tint-soft: rgba(52,211,162,.15); --on-tint: #002a1f;
  --red: #ff6961; --red-soft: rgba(255,105,97,.16); --orange: #ffb340; --orange-soft: rgba(255,179,64,.16);
  --blue: #5ea8ff; --blue-soft: rgba(94,168,255,.16); --indigo: #8e8cff; --indigo-soft: rgba(142,140,255,.18);
  --rose: #ff6b8e; --rose-soft: rgba(255,107,142,.16);
  --material: rgba(28,28,30,.76);
  --shadow: none; --shadow-lg: 0 12px 40px rgba(0,0,0,.6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; background: var(--bg); color: var(--label); }
body { font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; letter-spacing: -.005em; }
a { color: var(--tint); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.02em; overflow-wrap: anywhere; min-width: 0; }
h1 { font-size: 34px; line-height: 1.08; }
h2 { font-size: 20px; line-height: 1.2; letter-spacing: -.015em; }
h3 { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0; }
.muted { color: var(--label-2); } .faint { color: var(--label-3); }
.small { font-size: 13px; } .tiny { font-size: 12px; }
.num { font-family: var(--font-round); font-variant-numeric: tabular-nums; }
.overdue { color: var(--red) !important; font-weight: 600; }
.soon { color: var(--orange) !important; font-weight: 600; }
[hidden] { display: none !important; }
svg.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 16px; height: 16px; } svg.i.lg { width: 24px; height: 24px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--tint) 55%, transparent); outline-offset: 2px; border-radius: 6px; }

/* ---------- shell: sidebar (Mac) / tab bar (phone) ---------- */
.shell { min-height: 100vh; }
.side { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px;
  background: var(--material); backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px);
  border-right: 1px solid var(--sep); z-index: 30; }
.side .app { display: flex; align-items: center; gap: 10px; padding: 4px 10px 16px; color: var(--label); }
.side .app:hover { text-decoration: none; }
.app-icon { width: 34px; height: 34px; border-radius: 9px; flex: none; display: grid; place-items: center; color: #fff;
  background: linear-gradient(145deg, #13a37c, #075e48); box-shadow: inset 0 0 0 .5px rgba(255,255,255,.25), 0 1px 3px rgba(0,0,0,.2); }
.app-icon svg { width: 20px; height: 20px; stroke: #fff; stroke-width: 2; fill: none; }
.side .app b { font-size: 16px; letter-spacing: -.01em; display: block; }
.side .app span { font-size: 12px; color: var(--label-2); }
.side form.search { margin: 0 0 10px; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 9px; color: var(--label); font-weight: 500; font-size: 14.5px; }
.side nav a:hover { background: var(--fill-2); text-decoration: none; }
.side nav a.on { background: var(--tint-soft); color: var(--tint); }
.side nav a .count { margin-left: auto; font-size: 12.5px; color: var(--label-3); font-family: var(--font-round); }
.side nav a.on .count { color: var(--tint); }
.side .sec { font-size: 11.5px; font-weight: 600; color: var(--label-3); padding: 16px 10px 6px; letter-spacing: .02em; }
.side .foot { margin-top: auto; display: flex; gap: 6px; align-items: center; padding: 10px 6px 0; border-top: 1px solid var(--sep); font-size: 13px; }
.side .foot a { color: var(--label-2); }
.main { margin-left: var(--sidebar); padding: 34px 40px 80px; }
.wrap { max-width: 1120px; margin: 0 auto; }

.tabbar { display: none; }
.mobile-top { display: none; }
@media (max-width: 899px) {
  .side { display: none; }
  .main { margin-left: 0; padding: 14px 16px calc(var(--tabbar) + 34px + env(safe-area-inset-bottom)); }
  .mobile-top { display: flex; align-items: center; gap: 10px; padding-top: env(safe-area-inset-top); margin-bottom: 4px; }
  .mobile-top form { max-width: none !important; }
  .quick .spacer { display: none; }
  .mobile-top .iconbtn { color: var(--tint); }
  .tabbar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; inset: auto 0 0 0; z-index: 40;
    height: calc(var(--tabbar) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: var(--material); backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px);
    border-top: .5px solid var(--sep-strong); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--label-3); font-size: 10.5px; font-weight: 600; }
  .tabbar a:hover { text-decoration: none; }
  .tabbar a.on { color: var(--tint); }
  .tabbar svg.i { width: 25px; height: 25px; }
  .tabbar .add span.plus { width: 40px; height: 30px; border-radius: 10px; background: var(--tint); color: var(--on-tint); display: grid; place-items: center; }
  .tabbar .add span.plus svg { width: 20px; height: 20px; stroke-width: 2.4; }
  h1 { font-size: 30px; }
}

/* ---------- page head (title stacked above meta: no side-by-side eyebrow) ---------- */
.page-head { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 22px; }
.page-head .sub { color: var(--label-2); font-size: 15.5px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.back { display: inline-flex; align-items: center; gap: 2px; font-size: 15px; margin-bottom: 4px; }
.back svg { width: 18px; height: 18px; stroke-width: 2.2; }

/* ---------- layout ---------- */
.cols { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.cols-even { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
@media (max-width: 1080px) { .cols, .cols-even { grid-template-columns: minmax(0, 1fr); } }
.stack > * + * { margin-top: 22px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > .grow { flex: 1 1 220px; min-width: 0; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- grouped sections ---------- */
.section { min-width: 0; }
.section > .sh { display: flex; flex-direction: column; gap: 2px; padding: 0 4px 8px; }
.section > .sh h2 { font-size: 20px; }
.section > .sh .hint { font-size: 13px; color: var(--label-2); }
.section > .sh .link { font-size: 14px; }
.sh-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; }
.group { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.group.pad { padding: 16px 18px; }
.group + .note, .note { font-size: 12.5px; color: var(--label-3); padding: 8px 6px 0; }
.empty { padding: 26px 18px; text-align: center; color: var(--label-2); font-size: 14.5px; }
.empty b { display: block; color: var(--label); font-size: 16px; margin-bottom: 2px; }

/* list cells */
.cells { list-style: none; margin: 0; padding: 0; }
.cell { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 2px 13px; align-items: center;
  padding: 11px 16px; color: var(--label); min-height: 62px; }
a.cell:hover { background: var(--fill-2); text-decoration: none; }
a.cell:active { background: var(--fill); }
.cells > li + li > .cell::before, .cells > li + li.cell::before, .cells > .cell + .cell::before {
  content: ""; position: absolute; top: 0; right: 0; left: 72px; border-top: .5px solid var(--sep); }
.cells.plain > li + li > .cell::before, .cells.plain > li + li.cell::before { left: 16px; }
.cell .t { font-weight: 600; font-size: 15.5px; display: flex; gap: 7px; align-items: center; flex-wrap: wrap; min-width: 0; letter-spacing: -.01em; }
.cell .s { font-size: 13.5px; color: var(--label-2); display: flex; gap: 4px 10px; flex-wrap: wrap; min-width: 0; }
.cell .s > span { min-width: 0; overflow-wrap: anywhere; }
.cell .tr { text-align: right; font-size: 13px; color: var(--label-2); display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.cell .chev { color: var(--label-3); width: 14px; height: 14px; stroke-width: 2.4; }
.cell .nx { grid-column: 2 / -1; font-size: 13.5px; color: var(--label); margin-top: 3px; }
.cell .nx b { color: var(--tint); font-weight: 600; }
.cell .nx .quiet { color: var(--blue); font-weight: 600; }
.cell-actions { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 16px 12px 72px; margin-top: -4px; }
@media (max-width: 560px) { .cell .tr .when { display: none; } .cell-actions { padding-left: 16px; } }

/* ---------- avatars ---------- */
.av { --h: 212; width: 44px; height: 44px; border-radius: 50%; flex: none; display: grid; place-items: center; overflow: hidden;
  color: #fff; font: 600 16px/1 var(--font-round); letter-spacing: .01em;
  background: linear-gradient(160deg, hsl(var(--h) 62% 62%), hsl(var(--h) 55% 44%)); }
.av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.av.sm { width: 30px; height: 30px; font-size: 12px; }
.av.md { width: 56px; height: 56px; font-size: 20px; }
.av.xl { width: 112px; height: 112px; font-size: 40px; box-shadow: 0 0 0 4px var(--bg), 0 6px 22px rgba(0,0,0,.12); }
.av-stack { display: flex; }
.av-stack .av { box-shadow: 0 0 0 2px var(--surface); }
.av-stack .av + .av { margin-left: -9px; }

/* ---------- reach: signal bars ---------- */
.bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; vertical-align: -1px; }
.bars i { width: 4px; border-radius: 1.5px; background: var(--fill); display: block; }
.bars i:nth-child(1) { height: 35%; } .bars i:nth-child(2) { height: 55%; } .bars i:nth-child(3) { height: 78%; } .bars i:nth-child(4) { height: 100%; }
.bars[data-l="1"] i:nth-child(-n+1), .bars[data-l="2"] i:nth-child(-n+2),
.bars[data-l="3"] i:nth-child(-n+3), .bars[data-l="4"] i:nth-child(-n+4) { background: var(--tint); }
.reach-big { display: flex; align-items: center; gap: 12px; }
.reach-big .bars { height: 28px; gap: 3px; } .reach-big .bars i { width: 7px; border-radius: 2px; }

/* ---------- pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--fill-2); color: var(--label-2); white-space: nowrap; letter-spacing: 0; }
.pill.tint { background: var(--tint-soft); color: var(--tint); }
.pill.gift { background: var(--rose-soft); color: var(--rose); }
.pill.menu { background: var(--tint-soft); color: var(--tint); }
.pill.ask { background: var(--indigo-soft); color: var(--indigo); }
.pill.late { background: var(--red-soft); color: var(--red); }
.pill.due { background: var(--orange-soft); color: var(--orange); }
.pill.info { background: var(--blue-soft); color: var(--blue); }
.pill.c-inner { background: var(--rose-soft); color: var(--rose); }
.pill.c-close { background: var(--orange-soft); color: var(--orange); }
.pill.c-warm { background: var(--tint-soft); color: var(--tint); }
.pill.c-light { background: var(--fill-2); color: var(--label-2); }
.circle-pill { --h: 212; background: hsl(var(--h) 70% 50% / .12); color: hsl(var(--h) 60% 38%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .circle-pill { color: hsl(var(--h) 80% 72%); background: hsl(var(--h) 70% 50% / .2); } }
:root[data-theme="dark"] .circle-pill { color: hsl(var(--h) 80% 72%); background: hsl(var(--h) 70% 50% / .2); }
.tag { color: var(--label-3); font-size: 12.5px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px; border-radius: 10px; border: 0;
  background: var(--tint-soft); color: var(--tint); font: 600 14.5px var(--font); cursor: pointer; white-space: nowrap; letter-spacing: -.005em;
  transition: transform .08s ease, background .15s ease; }
.btn:hover { text-decoration: none; filter: brightness(.98); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--tint); color: var(--on-tint); }
.btn.primary:hover { background: var(--tint-press); }
.btn.gray { background: var(--fill); color: var(--label); }
.btn.plain { background: transparent; color: var(--tint); padding: 0 8px; }
.btn.danger { background: var(--red-soft); color: var(--red); }
.btn.lg { height: 48px; padding: 0 22px; font-size: 16px; border-radius: 12px; }
.btn.sm { height: 30px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.iconbtn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--fill-2); color: var(--label-2); cursor: pointer; }
.iconbtn:hover { color: var(--label); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--tint); font: inherit; font-size: 13px; cursor: pointer; }
.linkbtn.red { color: var(--red); }
.linkbtn:hover { text-decoration: underline; }

/* quick actions (Contacts-style) */
.qa { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.qa a, .qa button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; height: 62px; border-radius: 12px;
  background: var(--surface); color: var(--tint); font: 600 12px var(--font); border: 0; cursor: pointer; box-shadow: var(--shadow); }
.qa a:hover, .qa button:hover { text-decoration: none; background: var(--surface-2); }
.qa .off { color: var(--label-3); pointer-events: none; }
.qa svg.i { width: 22px; height: 22px; }

/* ---------- forms ---------- */
label, .lab { display: block; font-size: 13px; font-weight: 600; color: var(--label-2); margin: 0 0 6px; }
.field { margin-bottom: 14px; min-width: 0; }
.field:last-child { margin-bottom: 0; }
.row > .field, .row > .field:last-child { margin-bottom: 14px; }
.quick .row > .field { margin-bottom: 12px; }
.hint { font-size: 12.5px; color: var(--label-3); margin-top: 6px; }
input:not([type]), input[type=text], input[type=email], input[type=tel], input[type=password], input[type=date],
input[type=number], input[type=search], input[type=url], select, textarea {
  width: 100%; min-width: 0; height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid transparent; background: var(--fill-2);
  color: var(--label); font: 15.5px var(--font); -webkit-appearance: none; appearance: none; transition: background .15s, border-color .15s; }
textarea { height: auto; min-height: 92px; padding: 10px 12px; line-height: 1.45; resize: vertical; }
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
input:focus, select:focus, textarea:focus { outline: none; background: var(--surface); border-color: var(--tint); box-shadow: 0 0 0 4px var(--tint-soft); }
input::placeholder, textarea::placeholder { color: var(--label-3); }
input[type=search] { padding-left: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 11px center; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--tint); margin: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }
.span2 { grid-column: 1 / -1; }

/* chips + segmented controls */
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chips > span { position: relative; }
.chips input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.chips label { margin: 0; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 13px; border-radius: 999px; background: var(--fill-2);
  color: var(--label); font-weight: 500; font-size: 14px; cursor: pointer; user-select: none; transition: background .12s, color .12s; }
.chips label:hover { background: var(--fill); }
.chips input:checked + label { background: var(--tint); color: var(--on-tint); }
.chips input:focus-visible + label { outline: 3px solid color-mix(in srgb, var(--tint) 55%, transparent); outline-offset: 2px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); background: var(--fill); border-radius: 10px; padding: 2px; gap: 2px; }
.seg > span { position: relative; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg label { margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; min-height: 34px; padding: 5px 8px;
  border-radius: 8px; font-size: 13.5px; font-weight: 600; color: var(--label); cursor: pointer; }
.seg label small { font-weight: 500; font-size: 11px; color: var(--label-3); line-height: 1.25; }
.seg input:checked + label { background: var(--elev); box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 0 0 .5px rgba(0,0,0,.04); }
.seg input:focus-visible + label { outline: 3px solid color-mix(in srgb, var(--tint) 55%, transparent); }
.seg.k input#k-gift:checked + label, .seg.k input[value=gift]:checked + label { color: var(--rose); }
.seg.k input[value=menu]:checked + label { color: var(--tint); }
.seg.k input[value=ask]:checked + label { color: var(--indigo); }
form:has(.seg.k input[value=gift]:checked) .if-priced { display: none; }
form:has(.seg.k input[value=gift]:checked) .if-gift { display: block; }
.if-gift { display: none; }

/* ---------- stat tiles ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 26px; }
.stat { background: var(--surface); border-radius: var(--r); padding: 14px 16px 13px; box-shadow: var(--shadow); color: var(--label); display: flex; flex-direction: column; gap: 6px; }
a.stat:hover { text-decoration: none; background: var(--surface-2); }
.stat .ic { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.stat .ic svg { width: 17px; height: 17px; stroke-width: 2.2; }
.stat .v { font: 700 28px/1 var(--font-round); letter-spacing: -.01em; }
.stat .l { font-size: 13px; color: var(--label-2); font-weight: 500; }
.stat.red .ic { background: var(--red); } .stat.orange .ic { background: #ff9500; } .stat.tint .ic { background: var(--tint); }
.stat.indigo .ic { background: #5856d6; } .stat.rose .ic { background: #ff2d55; } .stat.blue .ic { background: #0a84ff; }
@media (max-width: 899px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 22px; }
  .stat { padding: 12px 13px; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
  .stat .ic { width: 26px; height: 26px; } .stat .ic svg { width: 15px; height: 15px; }
  .stat .v { font-size: 24px; }
  .stat .l { flex-basis: 100%; font-size: 12.5px; line-height: 1.25; }
}

/* ---------- quick add card ---------- */
.quick { background: var(--surface); border-radius: var(--r); padding: 16px 18px 18px; box-shadow: var(--shadow); margin-bottom: 26px; }
.quick .head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }

/* ---------- person hero ---------- */
.hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 8px 0 20px; }
.hero h1 { font-size: 32px; }
.hero .meta { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.hero .role { color: var(--label-2); font-size: 15px; }
.av-edit { position: relative; cursor: pointer; display: block; margin: 0; }
.av-edit .badge { position: absolute; right: 2px; bottom: 2px; width: 32px; height: 32px; border-radius: 50%; background: var(--tint); color: var(--on-tint);
  display: grid; place-items: center; box-shadow: 0 0 0 3px var(--bg); }
.av-edit .badge svg { width: 16px; height: 16px; stroke-width: 2.2; }
.next-card { background: var(--surface); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; }
.next-card .when { font: 700 24px/1.1 var(--font-round); letter-spacing: -.015em; }
.kv { display: grid; grid-template-columns: 116px minmax(0, 1fr); margin: 0; }
.kv > dt, .kv > dd { padding: 11px 0; border-top: .5px solid var(--sep); margin: 0; font-size: 14.5px; }
.kv > dt { color: var(--label-2); padding-right: 10px; }
.kv > dd { overflow-wrap: anywhere; }
.kv > dt:first-of-type, .kv > dt:first-of-type + dd { border-top: 0; }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.55; }
.prose.clamp { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.chain { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 14px; }
.chain a { display: inline-flex; align-items: center; gap: 6px; color: var(--label); font-weight: 500; }
.chain svg { width: 14px; height: 14px; color: var(--label-3); }
.chain .me { font-weight: 700; }

/* offers list on a person */
.offer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; padding: 13px 16px; position: relative; }
.offer + .offer::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: .5px solid var(--sep); }
.offer .w { font-weight: 600; font-size: 15px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.offer .stages { grid-column: 1 / -1; }
.stepper { display: flex; gap: 4px; flex-wrap: wrap; }
.stepper button { height: 28px; padding: 0 10px; border-radius: 999px; border: 0; background: var(--fill-2); color: var(--label-2); font: 600 12px var(--font); cursor: pointer; }
.stepper button:hover { background: var(--fill); color: var(--label); }
.stepper button.on { background: var(--tint); color: var(--on-tint); }
.stepper button.on.not_now { background: var(--label-3); color: var(--surface); }

/* offers board */
.board { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 14px; align-items: start; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; }
.lane { background: var(--fill-2); border-radius: var(--r); padding: 10px; min-height: 120px; scroll-snap-align: start; }
.lane .lh { display: flex; justify-content: space-between; align-items: baseline; padding: 2px 4px 10px; }
.lane .lh b { font-size: 14px; } .lane .lh span { font-size: 12.5px; color: var(--label-2); }
.ocard { background: var(--surface); border-radius: 12px; padding: 11px 12px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; }
.ocard + .ocard { margin-top: 8px; }
.ocard .who { display: flex; align-items: center; gap: 9px; color: var(--label); font-weight: 600; font-size: 14px; min-width: 0; }
.ocard .who span { min-width: 0; overflow-wrap: anywhere; }
.ocard .what { font-size: 13.5px; color: var(--label); }
.ocard .meta { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.ocard select { height: 30px; font-size: 12.5px; padding: 0 26px 0 9px; width: auto; background-position: right 8px center; }
@media (max-width: 899px) { .board { grid-template-columns: repeat(5, 78%); margin: 0 -16px; padding: 0 16px 8px; } }

/* circles grid */
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 14px; }
.ccard { --h: 212; position: relative; background: var(--surface); border-radius: 18px; padding: 16px; box-shadow: var(--shadow); color: var(--label); display: flex; flex-direction: column; gap: 12px; overflow: hidden; min-height: 150px; }
.ccard::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: hsl(var(--h) 65% 50%); }
a.ccard:hover { text-decoration: none; background: var(--surface-2); }
.ccard .cn { font-size: 18px; font-weight: 700; letter-spacing: -.015em; }
.ccard .cm { font-size: 13px; color: var(--label-2); }
.ccard .foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; }
.cstats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 24px; }
@media (max-width: 760px) { .cstats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* promises */
.promise { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; padding: 12px 16px; align-items: start; position: relative; }
.promise + .promise::before { content: ""; position: absolute; top: 0; left: 54px; right: 0; border-top: .5px solid var(--sep); }
.promise form { margin: 0; }
.promise .ptxt { font-size: 15px; }
.promise .pm { font-size: 13px; color: var(--label-2); margin-top: 2px; }
.promise.done .ptxt { text-decoration: line-through; color: var(--label-3); }
.tick { width: 24px; height: 24px; border-radius: 50%; border: 1.8px solid var(--label-3); background: transparent; color: transparent; cursor: pointer; display: grid; place-items: center; padding: 0; margin-top: 1px; }
.tick svg { width: 14px; height: 14px; stroke-width: 3; }
.tick:hover { border-color: var(--tint); color: var(--tint); }
.tick.on { background: var(--tint); border-color: var(--tint); color: var(--on-tint); }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 13px 16px; position: relative; }
.timeline li + li::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: .5px solid var(--sep); }
.timeline .th { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--label-2); }
.timeline .th b { color: var(--label); font-size: 14.5px; }
.timeline p { margin-top: 5px; white-space: pre-wrap; font-size: 14.5px; overflow-wrap: anywhere; }

/* disclosure */
details > summary { cursor: pointer; list-style: none; color: var(--tint); font-weight: 600; font-size: 14.5px; display: inline-flex; align-items: center; gap: 6px; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s; margin-right: 2px; }
details[open] > summary::before { transform: rotate(45deg); }
.disclose { padding: 13px 16px; border-top: .5px solid var(--sep); }

/* filters bar */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters input[type=search] { flex: 2 1 240px; }
.filters select { flex: 0 1 auto; width: auto; max-width: 100%; height: 36px; font-size: 14px; }
.scope { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 14px; }
.scope a { height: 30px; padding: 0 12px; border-radius: 999px; display: inline-flex; align-items: center; gap: 5px; background: var(--fill-2); color: var(--label); font-size: 13.5px; font-weight: 500; }
.scope a:hover { text-decoration: none; background: var(--fill); }
.scope a.on { background: var(--label); color: var(--bg); }
.scope a span { opacity: .55; font-family: var(--font-round); }

/* ---------- media (photos + voice) — class names used by media.js ---------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.gallery figure { margin: 0; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; display: block; outline: 2.5px solid transparent; outline-offset: -2.5px; }
.gallery figure.main img { outline-color: var(--tint); }
.gallery figcaption { display: flex; gap: 10px; justify-content: center; margin-top: 5px; font-size: 12px; }
.gallery figcaption form { margin: 0; }
.preview { display: flex; gap: 6px; flex-wrap: wrap; }
.preview img { width: 48px; height: 48px; object-fit: cover; border-radius: 10px; }
.filebtn { position: relative; overflow: hidden; }
.filebtn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upstatus { font-size: 13px; color: var(--label-2); min-height: 1.2em; }
.recorder { display: flex; flex-direction: column; gap: 12px; }
.recbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.recbtn { height: 46px; padding: 0 20px 0 16px; border-radius: 999px; border: 0; background: var(--red); color: #fff; font: 600 15px var(--font); cursor: pointer; display: inline-flex; gap: 9px; align-items: center; }
.recbtn .dot { width: 12px; height: 12px; border-radius: 50%; background: #fff; }
.recbtn.stop { background: var(--label); color: var(--bg); }
.recorder.recording .timer::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--red); margin-right: 8px; animation: blink 1s steps(2) infinite; vertical-align: 1px; }
@keyframes blink { 50% { opacity: .2; } }
.timer { font: 600 22px/1 var(--font-round); font-variant-numeric: tabular-nums; color: var(--label); }
.recorder audio, .voices audio { width: 100%; height: 40px; }
.voices { list-style: none; margin: 0; padding: 0; }
.voices li { padding: 12px 16px; position: relative; }
.voices li + li::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: .5px solid var(--sep); }
.voices .vh { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 13px; color: var(--label-2); margin-bottom: 7px; }
.voices .vh b { color: var(--label); font-size: 14.5px; }
.voices .vh form { margin: 0; }

/* ---------- toasts ---------- */
.flashes { position: fixed; left: 50%; transform: translateX(-50%); bottom: 24px; z-index: 60; display: flex; flex-direction: column; gap: 8px; width: min(560px, calc(100% - 32px)); }
@media (max-width: 899px) { .flashes { bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 12px); } }
.flash { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px 12px 16px; border-radius: 14px; font-size: 14.5px; font-weight: 500;
  background: var(--material); backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px); box-shadow: var(--shadow-lg);
  border: .5px solid var(--sep); animation: rise .28s cubic-bezier(.2,.9,.3,1.2); }
.flash > div { flex: 1; }
.flash::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--tint); flex: none; margin-top: 6px; }
.flash.bad::before { background: var(--red); } .flash.info::before { background: var(--blue); }
.flash button { border: 0; background: none; color: var(--label-3); font-size: 20px; line-height: 1; cursor: pointer; padding: 0 2px; }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- sign in ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login .card { width: min(380px, 100%); text-align: center; }
.login .app-icon { width: 76px; height: 76px; border-radius: 18px; margin: 0 auto 16px; }
.login .app-icon svg { width: 40px; height: 40px; }
.login h1 { font-size: 30px; margin-bottom: 4px; }
.login form { margin-top: 26px; text-align: left; }
.next-card .rhythm { text-align: right; }
@media (max-width: 560px) { .next-card .rhythm { text-align: left; flex-basis: 100%; } }

/* ---------- QR card + public swap page ---------- */
.qrbox svg { width: min(280px, 100%); height: auto; display: block; margin: 0 auto; border-radius: 12px; }
.qrfull { position: fixed; inset: 0; z-index: 100; background: #fff; color: #111; display: grid; place-items: center; padding: 24px; overflow: auto; }
.qrfull-in { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; max-width: 520px; }
.qrfull .muted { color: #555; }
.qrbig svg { width: min(78vw, 62vh, 460px); height: auto; display: block; }
body.swap { background: var(--bg); }
.swapwrap { max-width: 480px; margin: 0 auto; padding: calc(24px + env(safe-area-inset-top)) 16px 48px; display: flex; flex-direction: column; gap: 18px; }
.swapcard { background: var(--surface); border-radius: 22px; padding: 28px 22px 22px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; box-shadow: var(--shadow); }
.swapcard h1 { font-size: 28px; margin-top: 10px; }
.swapform { background: var(--surface); border-radius: 22px; padding: 22px; box-shadow: var(--shadow); position: relative; }
.swapform h2 { margin-bottom: 4px; }
.donecheck { width: 64px; height: 64px; border-radius: 50%; background: var(--tint); color: var(--on-tint); display: grid; place-items: center; margin-bottom: 6px; }

/* ---------- 5 · 50 · 100 ---------- */
.rings { position: relative; width: min(420px, 100%); aspect-ratio: 1; margin: 0 auto; }
.rings .ring { position: absolute; border-radius: 50%; display: grid; place-items: start center; }
.rings .r100 { inset: 0; background: hsl(160 60% 45% / .08); border: 1px solid hsl(160 50% 40% / .18); }
.rings .r50 { inset: 17%; background: hsl(160 60% 45% / .12); border: 1px solid hsl(160 50% 40% / .25); }
.rings .r5 { inset: 36%; background: var(--tint); color: var(--on-tint); place-items: center; border: 0; box-shadow: 0 6px 24px hsl(160 60% 35% / .35); }
.rings .lbl { margin-top: 7%; text-align: center; font-size: 12.5px; color: var(--label-2); font-weight: 600; }
.rings .r50 .lbl { margin-top: 9%; }
.rings .lbl b { display: block; font: 700 22px/1.1 var(--font-round); color: var(--label); }
.rings .r5 .lbl { margin: 0; color: var(--on-tint); } .rings .r5 .lbl b { color: var(--on-tint); font-size: 30px; }
.tierpill { font-family: var(--font-round); }
.pill.t5 { background: var(--tint); color: var(--on-tint); } .pill.t50 { background: var(--tint-soft); color: var(--tint); } .pill.t100 { background: var(--fill); color: var(--label-2); }
.pill.legend { background: linear-gradient(135deg, #ffcc4d, #ff9f1a); color: #3a2400; }
.health { height: 8px; border-radius: 99px; background: var(--fill); overflow: hidden; }
.health i { display: block; height: 100%; background: var(--tint); border-radius: 99px; }
.eventbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--indigo-soft); color: var(--label); border-radius: var(--r); padding: 12px 16px; margin-bottom: 22px; }
.eventbar .dots { display: flex; gap: 5px; } .eventbar .dots i { width: 12px; height: 12px; border-radius: 50%; background: var(--fill); }
.eventbar .dots i.on { background: var(--indigo); }
