/* Kitti Gutierrez — CRM & inventory
   Typographic and airy: text-labelled controls, hairline rules, no decorative icons.
   Type is Montserrat, as on lifewave.com. Colour comes from the light photographs
   (light/*.webp): sky blue for actions, with their white-to-gold glow for highlights. */
:root {
  --bg: #F4F9FD;
  --surface: #FFFFFF;
  --tint: #EAF3FA;
  --rule: #DCE7F0;
  --rule-strong: #C2D3E1;
  --ink: #26323A;
  --ink-2: #4A5A66;
  --muted: #74838F;
  --faint: #A3B1BC;
  --brand: #1478BE;
  --brand-hover: #0F639E;
  --brand-tint: #E6F3FC;
  --glow: linear-gradient(100deg, #1C8FDC 0%, #74BDF0 34%, #F6D58E 70%, #EDA545 100%);
  --hot: #E5603F;
  --warm: #E9A23B;
  --cold: #2C98DC;
  --dnc: #6F7C86;
  --c-received: #1F8AD6;
  --c-given: #D9608F;
  --c-removed: #E3953A;
  --c-adjusted: #74838F;
  --ok: #2B8A62;
  --err: #C2362A;
  --sans: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  /* Figures use Montserrat's tabular numerals rather than a separate monospace face. */
  --mono: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); font-size: 14px; line-height: 1.5; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.label { font-size: 11.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }

/* ---------------- Frame: top bar with text navigation ---------------- */
.bar { position: sticky; top: 0; z-index: 30; background: var(--surface); border-bottom: 1px solid var(--rule); }
.bar-in { max-width: 1320px; margin: 0 auto; height: 56px; padding: 0 16px; display: flex; align-items: center; gap: 28px; }
@media (min-width: 1024px) { .bar-in { padding: 0 32px; } }
.mark { flex: none; text-decoration: none; font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.mark span { font-weight: 400; color: var(--muted); letter-spacing: .08em; margin-left: 8px; }
.nav { display: none; align-self: stretch; gap: 24px; }
.nav a { position: relative; display: flex; align-items: center; font-size: 14px; color: var(--ink-2); text-decoration: none; }
.nav a:hover { color: var(--ink); }
.nav a.on { color: var(--ink); font-weight: 500; }
.nav a.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--brand); }
.nav .n { margin-left: 6px; font-family: var(--mono); font-size: 11.5px; color: var(--brand); }
.bar .grow { flex: 1; }
.find { display: none; width: 240px; }
.bar-actions { display: none; gap: 8px; }
.mob-only { display: inline-flex; }
@media (min-width: 1024px) { .nav, .find, .bar-actions { display: flex; } .mob-only { display: none; } }
.mob-links { display: flex; gap: 14px; margin-left: auto; }
.mob-links a, .mob-links button { border: 0; background: none; padding: 0; font-size: 14px; color: var(--ink-2); text-decoration: none; cursor: pointer; }
@media (min-width: 1024px) { .mob-links { display: none; } }

.main { max-width: 1320px; margin: 0 auto; padding: 24px 16px 96px; }
@media (min-width: 1024px) { .main { padding: 32px 32px 64px; } }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(6, 1fr); background: var(--surface); border-top: 1px solid var(--rule); padding-bottom: env(safe-area-inset-bottom); }
@media (min-width: 1024px) { .tabbar { display: none; } }
.tabbar a { position: relative; display: grid; place-items: center; height: 52px; font-size: 13px; color: var(--muted); text-decoration: none; }
.tabbar a.on { color: var(--ink); font-weight: 500; }
.tabbar a.on::before { content: ""; position: absolute; top: -1px; left: 22%; right: 22%; height: 2px; background: var(--brand); }

/* ---------------- Controls ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; height: 34px; padding: 0 14px; border-radius: 3px;
  border: 1px solid var(--rule-strong); background: var(--surface); color: var(--ink); font-size: 13.5px; font-weight: 500;
  text-decoration: none; white-space: nowrap; cursor: pointer; transition: background .1s, border-color .1s, color .1s;
}
.btn:hover { background: var(--tint); border-color: #A9BFD0; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.dark:hover { background: #3A4852; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.is-busy { opacity: .6; pointer-events: none; }
.link { border: 0; background: none; padding: 0; font-size: inherit; color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--rule-strong); text-underline-offset: 3px; cursor: pointer; }
.link:hover { color: var(--ink); text-decoration-color: var(--ink); }
.link.danger { color: var(--err); text-decoration-color: rgba(194, 54, 42, .35); }
.link.quiet { text-decoration: none; color: var(--muted); }
.link.quiet:hover { color: var(--ink); text-decoration: underline; }
@media (max-width: 1023px) { .btn { height: 40px; } .btn.sm { height: 34px; } }

.input, select.input, textarea.input {
  width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--rule-strong); border-radius: 3px; background: #fff;
  font-size: 16px; color: var(--ink); transition: border-color .1s, box-shadow .1s;
}
@media (min-width: 1024px) { .input, select.input, textarea.input { height: 34px; font-size: 14px; } }
textarea.input { height: auto; min-height: 76px; padding: 8px 10px; line-height: 1.5; resize: vertical; }
.input::placeholder { color: var(--faint); }
.input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.input.invalid { border-color: var(--err); box-shadow: 0 0 0 1px var(--err); }
.field { display: grid; gap: 6px; min-width: 0; }
.field > span { font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.field small { font-size: 12px; color: var(--muted); }
.row2 { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.row3 { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 520px) { .row3 { grid-template-columns: 1fr 1fr; } }

/* Segmented text control */
.seg { display: inline-flex; border: 1px solid var(--rule-strong); border-radius: 3px; overflow: hidden; }
.seg button { height: 30px; padding: 0 12px; border: 0; border-left: 1px solid var(--rule-strong); background: #fff; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.seg button:first-child { border-left: 0; }
.seg button:hover { background: var(--tint); }
.seg button.on { background: var(--ink); color: #fff; }
.seg button[disabled] { opacity: .45; cursor: not-allowed; }
@media (max-width: 1023px) { .seg button { height: 36px; } }

/* Checkbox */
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; user-select: none; }
.check input { appearance: none; -webkit-appearance: none; width: 16px; height: 16px; margin: 0; border: 1px solid var(--rule-strong); border-radius: 2px; background: #fff; display: grid; place-items: center; cursor: pointer; }
.check input:checked { background: var(--ink); border-color: var(--ink); }
.check input:checked::after { content: ""; width: 8px; height: 4px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: translateY(-1px) rotate(-45deg); }

/* Tags (health concerns, filters) */
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border: 1px solid var(--rule-strong); border-radius: 3px; background: #fff; font-size: 13px; color: var(--ink-2); text-decoration: none; cursor: pointer; }
.tag:hover { border-color: var(--ink-2); color: var(--ink); }
.tag.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.tag .n { margin-left: 6px; font-family: var(--mono); font-size: 11.5px; color: var(--faint); }
.tag.on .n { color: #C9D8E4; }
.tag-add { width: 110px; height: 28px; padding: 0 8px; border: 1px dashed var(--rule-strong); border-radius: 3px; font-size: 13px; background: transparent; }
.tag-add:focus { outline: none; border-style: solid; border-color: var(--ink); }

/* Status markers: a small square + text, never colour alone */
.st { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; white-space: nowrap; }
.st::before { content: ""; width: 8px; height: 8px; background: var(--c, var(--faint)); }
.st.hot { --c: var(--hot); } .st.warm { --c: var(--warm); } .st.cold { --c: var(--cold); } .st.none { --c: transparent; box-shadow: none; }
.st.none::before { border: 1px solid var(--rule-strong); }
.st.dnc { --c: var(--dnc); color: var(--dnc); }
.st.ok { --c: var(--ok); } .st.low { --c: var(--c-removed); } .st.out { --c: var(--err); color: var(--err); }
button.st { border: 0; background: none; padding: 2px 4px; margin: -2px -4px; border-radius: 2px; cursor: pointer; }
button.st:hover { background: var(--tint); }
.pkg { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; white-space: nowrap; }
.pkg::before { content: ""; width: 3px; height: 14px; background: var(--pkg, var(--brand)); }

/* ---------------- Page structure ---------------- */
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-bottom: 20px; margin-bottom: 24px; border-bottom: 1px solid var(--rule); }
.head h1 { font-size: 26px; font-weight: 500; letter-spacing: -.015em; line-height: 1.2; }
.head .sub { margin-top: 6px; color: var(--muted); }
.head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumb { display: inline-block; margin-bottom: 8px; font-size: 13px; color: var(--muted); text-decoration: none; }
.crumb:hover { color: var(--ink); text-decoration: underline; }
.subnav { display: flex; gap: 22px; margin: -8px 0 24px; border-bottom: 1px solid var(--rule); overflow-x: auto; scrollbar-width: none; }
.subnav a { position: relative; padding: 10px 0 12px; font-size: 14px; color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.subnav a.on { color: var(--ink); font-weight: 500; }
.subnav a.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--ink); }

.sec { margin-top: 36px; }
.sec:first-child { margin-top: 0; }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 10px; margin-bottom: 0; border-bottom: 1px solid var(--ink); }
.sec-h h2 { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.sec-h .aside { font-size: 13px; color: var(--muted); }
.sec-h a { font-size: 13px; color: var(--ink-2); }
.sec-b { padding-top: 14px; }
.cols { display: grid; gap: 36px 40px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) { .cols.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cols.c21 { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); } .cols.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cols > .sec { margin-top: 0; }
.cols + .sec, .sec + .cols, .cols + .cols { margin-top: 36px; }
.empty { padding: 28px 0; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-weight: 500; }

/* Figures strip */
.figs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule); }
@media (min-width: 760px) { .figs { grid-template-columns: repeat(var(--n, 6), minmax(0, 1fr)); } }
.fig { display: block; padding: 14px 16px 16px 0; text-decoration: none; color: var(--ink); min-width: 0; }
.fig + .fig { padding-left: 16px; border-left: 1px solid var(--rule); }
@media (max-width: 759px) { .fig { padding: 12px 12px 14px 0; border-left: 0 !important; } .fig:nth-child(even) { padding-left: 14px; border-left: 1px solid var(--rule) !important; } .fig:nth-child(n+3) { border-top: 1px solid var(--rule); } }
a.fig:hover .fig-v { color: var(--brand); }
.fig-l { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fig-l i { width: 8px; height: 8px; flex: none; background: var(--c); }
.fig-v { margin-top: 6px; font-family: var(--mono); font-size: 28px; font-weight: 500; letter-spacing: -.03em; line-height: 1.1; }
.fig-v small { margin-left: 6px; font-family: var(--sans); font-size: 13px; font-weight: 400; letter-spacing: 0; color: var(--muted); }
.fig-f { margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.fig-f .up { color: var(--ok); } .fig-f .down { color: var(--err); }

/* Statement (inventory) */
.statement { display: grid; grid-template-columns: minmax(0, 1fr); border-top: 3px solid var(--ink); background: var(--surface); border-bottom: 1px solid var(--rule); }
@media (min-width: 900px) { .statement { grid-template-columns: minmax(240px, .8fr) minmax(0, 2fr); } }
.st-total { padding: 20px 20px 22px 0; }
.st-total .fig-v { font-size: 56px; letter-spacing: -.05em; margin-top: 10px; }
.st-total p { margin-top: 8px; color: var(--muted); }
.st-total .flags { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 14px; font-size: 13px; }
.ledger { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.lg { position: relative; padding: 20px 14px 18px; border-left: 1px solid var(--rule); text-decoration: none; color: var(--ink); min-width: 0; }
a.lg:hover .fig-v { color: var(--brand); }
.lg .op { position: absolute; left: -8px; top: 22px; width: 15px; height: 18px; display: grid; place-items: center; background: var(--surface); font-family: var(--mono); font-size: 13px; color: var(--muted); }
.lg .fig-v { font-size: 26px; margin-top: 8px; }
.lg.total { background: var(--tint); }
@media (max-width: 899px) {
  .st-total { padding: 18px 0; border-bottom: 1px solid var(--rule); }
  .ledger { grid-template-columns: 1fr; }
  .lg { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: baseline; gap: 4px 8px; padding: 10px 0; border-left: 0; border-top: 1px dotted var(--rule-strong); }
  .lg:first-child { border-top: 0; }
  .lg .op { position: static; width: auto; height: auto; background: none; }
  .lg .fig-v { margin: 0; font-size: 18px; grid-column: 3; grid-row: 1; }
  .lg .fig-f { grid-column: 2 / 4; margin: 0; }
  .lg.total { background: none; border-top: 1px solid var(--ink); }
}

/* Tables */
.tbl { width: 100%; }
.tr { display: grid; grid-template-columns: var(--cols); gap: 16px; align-items: center; min-height: 48px; padding: 8px 0; border-bottom: 1px solid var(--rule); text-decoration: none; color: var(--ink); }
.thead .tr { min-height: 34px; padding: 0; font-size: 12px; color: var(--muted); }
.tbody .tr.go { cursor: pointer; }
.tbody .tr.go:hover { background: linear-gradient(90deg, transparent, var(--tint) 2%, var(--tint) 98%, transparent); }
.td { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td.r { text-align: right; justify-self: end; }
.td.n { font-family: var(--mono); letter-spacing: -.01em; }
.td.b { font-weight: 500; }
.td .sub { display: block; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.td a { text-decoration: none; } .td a:hover { text-decoration: underline; }
.tr.dim .td.b { color: var(--muted); }
.row-act { display: flex; justify-content: flex-end; gap: 14px; opacity: 0; transition: opacity .1s; font-size: 13px; }
.tr:hover .row-act, .tr:focus-within .row-act { opacity: 1; }
@media (hover: none) { .row-act { opacity: 1; } }
.bar-cell { display: flex; align-items: center; gap: 10px; }
.bar-cell .track { flex: 1; height: 6px; background: var(--tint); min-width: 40px; position: relative; }
.bar-cell .track span { position: absolute; left: 0; top: 0; bottom: 0; background: var(--c, var(--ink-2)); }
.bar-cell .track em { position: absolute; top: -3px; bottom: -3px; width: 1px; background: var(--ink); }
.bar-cell b { min-width: 30px; text-align: right; font-family: var(--mono); font-weight: 500; }
@media (max-width: 759px) {
  .thead { display: none; }
  .tbody .tr { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 14px; padding: 12px 0; }
  .tbody .td { grid-column: 1; }
  .tbody .td.m { grid-column: 2; grid-row: 1 / span 3; align-self: center; text-align: right; }
  .hs { display: none !important; }
}

/* Toolbar */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.toolbar .search { width: 280px; max-width: 100%; }
@media (max-width: 759px) { .toolbar .search { width: 100%; } }

/* Charts */
.legend { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 13px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 9px; height: 9px; background: var(--c); }
.legend b { font-family: var(--mono); font-weight: 500; color: var(--ink); }
.chart { display: grid; grid-template-columns: 30px minmax(0, 1fr); column-gap: 10px; margin-top: 16px; }
.ch-y { position: relative; font-family: var(--mono); font-size: 11px; color: var(--faint); text-align: right; }
.ch-y span { position: absolute; right: 0; transform: translateY(-50%); }
.ch-plot { position: relative; height: 200px; }
.ch-gl { position: absolute; left: 0; right: 0; border-top: 1px solid #E6EEF5; }
.ch-gl.base { border-top-color: var(--ink-2); }
.ch-cols { position: absolute; inset: 0; display: flex; gap: 3px; }
.ch-col { position: relative; flex: 1; }
.ch-col:hover { background: rgba(30, 50, 70, .03); }
.ch-seg { position: absolute; left: 18%; right: 18%; background: var(--c, var(--ink-2)); min-height: 2px; outline: none; }
.ch-seg:hover, .ch-seg:focus { filter: brightness(.85); }
.ch-x { grid-column: 2; display: flex; justify-content: space-between; margin-top: 6px; font-family: var(--mono); font-size: 11px; color: var(--faint); }
.ch-side { position: absolute; left: 4px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.comp { display: flex; height: 14px; gap: 2px; margin: 14px 0 12px; }
.comp a { display: block; background: var(--c); min-width: 2px; }
.comp a:hover { filter: brightness(.88); }

/* Follow-up list */
.todo { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--rule); text-decoration: none; color: var(--ink); }
.todo b { font-family: var(--mono); font-size: 18px; font-weight: 500; }
.todo span:last-child { font-size: 13px; color: var(--muted); }
.todo:hover span:last-child { color: var(--ink); text-decoration: underline; }

/* Entries grouped by day (activity, movements) */
.day { display: flex; justify-content: space-between; padding: 18px 0 6px; font-size: 12px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--rule-strong); }
.entry { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto auto; gap: 16px; align-items: baseline; padding: 11px 0; border-bottom: 1px solid var(--rule); }
.entry .kind { font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 7px; }
.entry .kind::before { content: ""; width: 8px; height: 8px; background: var(--c, var(--faint)); flex: none; transform: translateY(-1px); }
.entry.received { --c: var(--c-received); } .entry.given { --c: var(--c-given); } .entry.removed { --c: var(--c-removed); } .entry.adjusted { --c: var(--c-adjusted); }
.entry .what { min-width: 0; }
.entry .what b { font-weight: 500; }
.entry .what a { text-decoration: none; } .entry .what a:hover { text-decoration: underline; }
.entry .what small { display: block; color: var(--muted); font-size: 13px; }
.entry .kind-col { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.entry .kind-col small { color: var(--muted); font-size: 12.5px; padding-left: 15px; overflow-wrap: anywhere; }
.entry .amt { text-align: right; font-family: var(--mono); white-space: nowrap; }
.entry .amt.pos { color: var(--c-received); }
.entry .amt small { display: block; font-size: 11.5px; color: var(--faint); }
.entry .x { font-size: 13px; opacity: 0; transition: opacity .1s; }
.entry:hover .x, .entry:focus-within .x { opacity: 1; }
.entry .x.acts { display: inline-flex; gap: 12px; white-space: nowrap; }
.entry.rec { cursor: pointer; }
.entry.rec:hover { background: linear-gradient(90deg, transparent, var(--tint) 12%, var(--tint) 88%, transparent); }
@media (hover: none) { .entry .x { opacity: 1; } }
.rec-del { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 12px; padding-top: 16px; border-top: 1px solid var(--rule); }
.rec-del small { color: var(--muted); font-size: 12.5px; }
@media (hover: none) { .entry .x { opacity: 1; } }
@media (max-width: 640px) {
  .entry { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; }
  .entry .kind { grid-column: 1; }
  .entry .what { grid-column: 1; }
  .entry .amt { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .entry .x { grid-column: 2; justify-self: end; }
  .entry .kind-col { grid-column: 1; flex-direction: row; flex-wrap: wrap; gap: 0 10px; }
  .entry .kind-col small { padding-left: 0; }
}

/* ---------------- Contact page ---------------- */
.c-head { display: grid; gap: 16px; padding-bottom: 20px; margin-bottom: 28px; border-bottom: 1px solid var(--rule); }
@media (min-width: 1024px) { .c-head { grid-template-columns: minmax(0, 1fr) auto; align-items: end; } }
.c-head h1 { font-size: 30px; font-weight: 500; letter-spacing: -.02em; line-height: 1.15; }
.c-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: 13.5px; color: var(--ink-2); }
.c-reach { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 1024px) { .c-reach { display: flex; } }
.c-ctrl { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding: 12px 0; border-top: 1px solid var(--rule); }
.c-ctrl .grow { flex: 1; }
.c-ctrl .links { display: flex; gap: 18px; font-size: 13.5px; }
.notice { padding: 10px 12px; border-left: 3px solid var(--ink-2); background: var(--tint); font-size: 13.5px; color: var(--ink-2); }
.notice.signed { border-left-color: var(--pkg, var(--brand)); }
.notice.dnc { border-left-color: var(--dnc); }
.c-grid { display: grid; gap: 36px 48px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) { .c-grid { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); } }
.c-grid > div { display: grid; gap: 36px; align-content: start; min-width: 0; }
/* The communication box on a contact page: a button until it's opened. */
.log-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 12px 14px; border: 1px solid var(--rule-strong); background: var(--surface); color: var(--ink); font: inherit; font-weight: 500; cursor: pointer; text-align: left; }
.log-toggle:hover { background: var(--tint); }
.log-toggle::after { content: "+"; font-family: var(--mono); font-size: 18px; line-height: 1; color: var(--muted); }
.log-toggle[aria-expanded="true"]::after { content: "−"; }
.kv { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 0 16px; }
.kv > div { display: contents; }
.kv dt, .kv dd { padding: 9px 0; border-bottom: 1px solid var(--rule); margin: 0; }
.kv dt { font-size: 13px; color: var(--muted); }
.kv dd { overflow-wrap: anywhere; }
.kv dd .lb { color: var(--muted); font-size: 12.5px; margin-right: 8px; }
.kv dd a { text-decoration: none; } .kv dd a:hover { text-decoration: underline; }

/* ---------------- Drawer (forms) ---------------- */
.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(30, 50, 70, .3); animation: fade .12s ease; }
.drawer { position: fixed; z-index: 51; left: 0; right: 0; bottom: 0; max-height: 94vh; display: flex; flex-direction: column; background: var(--surface); border-top: 3px solid var(--ink); animation: rise .18s ease; }
@media (min-width: 760px) { .drawer { left: auto; top: 0; width: 540px; max-height: none; border-top: 0; border-left: 1px solid var(--rule-strong); box-shadow: -20px 0 50px rgba(30, 50, 70, .1); animation: slide .2s ease; } }
.dr-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 24px 16px; border-bottom: 1px solid var(--rule); }
.dr-h h2 { font-size: 19px; font-weight: 500; letter-spacing: -.01em; }
.dr-h p { margin-top: 4px; font-size: 13.5px; color: var(--muted); }
.dr-b { flex: 1; overflow: auto; padding: 20px 24px 28px; display: grid; gap: 20px; align-content: start; }
.dr-f { display: flex; align-items: center; gap: 10px; padding: 14px 24px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--rule); background: var(--surface); }
.dr-f .sum { flex: 1; min-width: 0; font-size: 13px; color: var(--muted); }
.dr-f .sum b { display: block; font-family: var(--mono); font-size: 16px; font-weight: 500; color: var(--ink); }
.fs { display: grid; gap: 12px; border: 0; padding: 0; margin: 0; min-width: 0; }
.fs legend { padding: 0 0 8px; margin-bottom: 4px; width: 100%; border-bottom: 1px solid var(--rule); font-size: 11.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.multi { display: grid; gap: 8px; }
.multi-row { display: grid; grid-template-columns: 116px minmax(0, 1fr) auto; gap: 8px; align-items: start; }
.addr { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }
.addr .street { grid-column: 1 / -1; }
@media (max-width: 460px) { .multi-row { grid-template-columns: 96px minmax(0, 1fr) auto; } }
.multi-row .link { height: 36px; font-size: 13px; }
details.more summary { cursor: pointer; list-style: none; font-size: 13.5px; color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--rule-strong); text-underline-offset: 3px; }
details.more summary::-webkit-details-marker { display: none; }
details.more > div { display: grid; gap: 20px; margin-top: 18px; }

/* Line items */
.lines { border-top: 1px solid var(--rule); }
.line { display: grid; grid-template-columns: minmax(0, 1fr) 76px 108px auto; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.line .hint { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--muted); }
.line .hint b { font-family: var(--mono); font-weight: 500; color: var(--ink-2); }
.line .hint.warn, .line .hint.warn b { color: var(--err); }
@media (max-width: 520px) { .line { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; } .line [data-l=product] { grid-column: 1 / 3; } .line [data-l=qty] { grid-column: 1; } .line [data-l=unit] { grid-column: 2; } .line .rm { grid-column: 3; grid-row: 1; } }
.line .rm { font-size: 13px; }

/* Contact picker */
.picker { position: relative; }
.pick-list { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 4px); max-height: 260px; overflow: auto; background: #fff; border: 1px solid var(--rule-strong); box-shadow: 0 12px 30px rgba(30, 50, 70, .12); }
.pick-list button { display: flex; justify-content: space-between; gap: 12px; width: 100%; padding: 9px 12px; border: 0; border-bottom: 1px solid var(--rule); background: #fff; font-size: 14px; text-align: left; cursor: pointer; }
.pick-list button:last-child { border-bottom: 0; }
.pick-list button:hover, .pick-list button.hl { background: var(--tint); }
.pick-list button small { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.pick-list .add { color: var(--brand); font-weight: 500; }
.picked { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--rule-strong); background: var(--tint); }
.picked b { font-weight: 500; }
.picked small { display: block; color: var(--muted); font-size: 12.5px; }
.newbox { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--rule-strong); border-left: 3px solid var(--brand); }
.newbox p { font-size: 13.5px; color: var(--ink-2); }

/* ---------------- Menus, tooltip, toasts ---------------- */
.menu { position: fixed; z-index: 60; min-width: 200px; padding: 4px 0; background: #fff; border: 1px solid var(--rule-strong); box-shadow: 0 12px 30px rgba(30, 50, 70, .12); }
.menu button { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; padding: 8px 14px; border: 0; background: none; font-size: 14px; text-align: left; cursor: pointer; }
.menu button:hover, .menu button:focus-visible { background: var(--tint); outline: none; }
.menu hr { border: 0; border-top: 1px solid var(--rule); margin: 4px 0; }
.menu .chk { font-size: 12.5px; color: var(--muted); }
.tip { position: fixed; z-index: 90; padding: 6px 9px; background: var(--ink); color: #fff; font-size: 12.5px; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .08s; }
.tip.on { opacity: 1; }
.toasts { position: fixed; z-index: 80; left: 50%; transform: translateX(-50%); bottom: calc(66px + env(safe-area-inset-bottom)); display: grid; gap: 6px; width: min(92vw, 420px); pointer-events: none; }
@media (min-width: 1024px) { .toasts { bottom: 28px; } }
.toast { padding: 11px 14px; background: var(--ink); color: #fff; font-size: 13.5px; pointer-events: auto; animation: rise .15s ease; }
.toast.error { background: #fff; color: var(--err); border: 1px solid var(--err); border-left-width: 3px; }
.toast.info { background: var(--ink-2); }
.toast.leaving { opacity: 0; transition: opacity .2s; }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-box { width: min(100%, 360px); }
.login-box .mark { display: block; margin-bottom: 28px; }
.login-box h1 { font-size: 24px; font-weight: 500; letter-spacing: -.01em; }
.login-box form { display: grid; gap: 12px; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--rule); }
.login-box .btn { height: 40px; }
.login-box .err { min-height: 18px; color: var(--err); font-size: 13px; }

/* Settings */
.set { display: grid; gap: 14px; padding: 28px 0; border-bottom: 1px solid var(--rule); }
.set:first-of-type { padding-top: 0; }
@media (min-width: 1024px) { .set { grid-template-columns: 300px minmax(0, 1fr); gap: 48px; } }
.set h2 { font-size: 15px; font-weight: 500; }
.set p { margin-top: 6px; font-size: 13.5px; color: var(--muted); line-height: 1.55; }
.erow { display: grid; grid-template-columns: var(--cols); gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.erow.head { padding: 0 0 8px; font-size: 12px; color: var(--muted); border-bottom-color: var(--rule-strong); }
.erow .acts { display: flex; gap: 14px; justify-content: flex-end; font-size: 13px; }
.erow input[type=color] { width: 34px; height: 34px; padding: 2px; border: 1px solid var(--rule-strong); border-radius: 3px; background: #fff; cursor: pointer; }
@media (max-width: 640px) { .erow.head { display: none; } .erow { grid-template-columns: 1fr 1fr !important; } .erow > :first-child, .erow > .acts { grid-column: 1 / -1; } .erow .acts { justify-content: flex-start; } }
.help { font-size: 13.5px; color: var(--ink-2); line-height: 1.6; }
.help ol { margin: 6px 0 0; padding-left: 18px; }
code { font: 12.5px var(--mono); padding: 1px 5px; background: var(--tint); }

.loading { padding: 60px 0; color: var(--muted); font-size: 13.5px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes slide { from { opacity: 0; transform: translateX(20px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Item rows in the give / receive / remove forms */
.line { grid-template-columns: minmax(0, 1fr) 128px 112px auto; }
.lines .line:only-child .rm { visibility: hidden; }
.stepper { display: grid; grid-template-columns: 34px minmax(0, 1fr) 34px; border: 1px solid var(--rule-strong); border-radius: 3px; background: #fff; overflow: hidden; }
.stepper:focus-within { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.stepper button { border: 0; background: var(--tint); font-size: 18px; line-height: 1; color: var(--ink-2); cursor: pointer; touch-action: manipulation; }
.stepper button:hover { background: #E1ECF5; color: var(--ink); }
.stepper button:active { background: #D6E5F1; }
.stepper .input { height: 34px; border: 0; border-radius: 0; box-shadow: none; text-align: center; font-family: var(--mono); padding: 0 4px; -moz-appearance: textfield; }
.stepper .input::-webkit-outer-spin-button, .stepper .input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper .input:focus { box-shadow: none; }
.add-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; margin-top: 10px; padding: 0 12px; border: 1px dashed var(--rule-strong); border-radius: 3px; background: transparent; font-size: 14px; color: var(--ink-2); text-align: left; cursor: pointer; touch-action: manipulation; }
.add-row:hover { border-style: solid; border-color: var(--ink-2); color: var(--ink); background: var(--surface); }
.add-row .plus { position: relative; flex: none; width: 24px; height: 24px; border: 1px solid currentColor; border-radius: 3px; }
.add-row .plus::before, .add-row .plus::after { content: ""; position: absolute; left: 50%; top: 50%; background: currentColor; transform: translate(-50%, -50%); }
.add-row .plus::before { width: 10px; height: 1.5px; }
.add-row .plus::after { width: 1.5px; height: 10px; }
@media (max-width: 1023px) {
  .stepper { grid-template-columns: 44px minmax(0, 1fr) 44px; }
  .stepper .input { height: 40px; font-size: 16px; }
  .add-row { min-height: 48px; }
  .line .rm { min-height: 40px; padding: 0 4px; }
}
@media (max-width: 520px) {
  .line { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; row-gap: 10px; }
  .line [data-l=product] { grid-column: 1 / 3; }
  .line .stepper { grid-column: 1; grid-row: 2; }
  .line [data-l=unit] { grid-column: 2; grid-row: 2; }
  .line .rm { grid-column: 3; grid-row: 1; }
}
.line .stepper [data-l=qty] { grid-column: 2; grid-row: 1; }
@media (max-width: 1023px) { .line > .input, .line select.input { height: 42px; } }
@media (min-width: 1024px) { .line > .input, .line select.input { height: 36px; } .stepper .input { height: 34px; } }
@media (max-width: 520px) { .line .hint { flex-direction: column; gap: 2px; } }

/* =================================================================
   Light: the LifeWave light image, feathered into white
   ================================================================= */
.photo-light { position: absolute; pointer-events: none; background: url("/light/signin.webp") var(--pos, 50% 60%) / cover no-repeat; }

/* Sign-in: the light fills the screen; the form sits in front of it */
.login { position: relative; overflow: hidden; isolation: isolate; background: #fff; }
.login > .photo-light { z-index: -1; inset: 0; --pos: 50% 62%; }
@media (max-width: 700px) { .login > .photo-light { --pos: 34% 60%; } }
.login > .photo-light::after { content: ""; position: absolute; inset: 0; background: radial-gradient(70% 60% at 50% 45%, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 70%); }
.login-box { position: relative; z-index: 1; padding: 32px 30px; background: rgba(255, 255, 255, .96); border: 1px solid rgba(255, 255, 255, .9); box-shadow: 0 30px 80px rgba(20, 40, 70, .22); }

/* =================================================================
   Inventory: patches, counted in sleeves
   ================================================================= */
.inv-hero { position: relative; isolation: isolate; overflow: hidden; margin: -32px -32px 0; padding: 40px 32px 36px; border-bottom: 1px solid var(--rule); background: #fff; }
@media (max-width: 1023px) { .inv-hero { margin: -24px -16px 0; padding: 220px 16px 26px; } }
.inv-light { position: absolute; z-index: -1; top: 0; right: 0; bottom: 0; width: 62%; background: url("/light/inventory.webp") 78% 50% / cover no-repeat;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, .5) 28%, #000 60%); mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, .5) 28%, #000 60%); }
@media (max-width: 1023px) { .inv-light { left: 0; width: 100%; bottom: auto; height: 260px; -webkit-mask-image: linear-gradient(180deg, #000 40%, transparent 100%); mask-image: linear-gradient(180deg, #000 40%, transparent 100%); } }
.inv-hero-in { max-width: 560px; }
.inv-figure { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; margin: 14px 0 0; font-weight: 400; }
.inv-figure .num { font-family: var(--mono); font-size: 76px; font-weight: 500; letter-spacing: -.05em; line-height: .95; color: var(--ink); }
.inv-figure .unit { font-size: 15px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
@media (max-width: 520px) { .inv-figure .num { font-size: 60px; } }
.inv-sub { margin-top: 12px; color: var(--ink-2); }
.inv-sub a { color: var(--err); }
.inv-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.inv-hero + .subnav { margin-top: 0; }

/* 30-day flow, read left to right */
.flow-row { display: grid; grid-template-columns: 120px repeat(4, minmax(0, 1fr)); align-items: stretch; border-bottom: 1px solid var(--rule); margin-bottom: 8px; }
.flow-row > .label { align-self: center; }
.flow-step { position: relative; display: grid; gap: 2px; padding: 14px 14px 14px 22px; border-left: 1px solid var(--rule); text-decoration: none; color: var(--ink); }
a.flow-step:hover b { color: var(--brand); }
.flow-step .op { position: absolute; left: -8px; top: 50%; width: 15px; margin-top: -10px; text-align: center; background: var(--bg); font-family: var(--mono); color: var(--muted); }
.fs-l { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); }
.fs-l i { width: 8px; height: 8px; background: var(--c); }
.flow-step b { font-family: var(--mono); font-size: 24px; font-weight: 500; letter-spacing: -.03em; }
.flow-step small { font-size: 12px; color: var(--faint); }
.flow-step:last-child { background: var(--tint); }
@media (max-width: 899px) {
  .flow-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .flow-row > .label { grid-column: 1 / -1; padding: 12px 0 0; }
  .flow-step { padding: 10px 6px 12px 12px; }
  .flow-step:first-of-type { border-left: 0; padding-left: 0; }
  .flow-step b { font-size: 18px; }
  .flow-step small { display: none; }
}

/* Patch cards */
.patch-grid { display: grid; gap: 0; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); }
.patch { display: grid; gap: 14px; align-content: start; padding: 20px 20px 16px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); background: var(--surface); }
.patch header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.patch-name { font-size: 15px; font-weight: 600; letter-spacing: .02em; text-decoration: none; }
.patch-name:hover { text-decoration: underline; }
.patch-figure { display: flex; align-items: baseline; gap: 8px; }
.patch-figure .num { font-family: var(--mono); font-size: 44px; font-weight: 500; letter-spacing: -.05em; line-height: 1; }
.patch-figure span:last-child { font-size: 12.5px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.patch.out .patch-figure .num { color: var(--err); }
.meter { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; height: 14px; }
.meter i { position: relative; overflow: hidden; background: var(--tint); box-shadow: inset 0 0 0 1px var(--rule); }
.meter i b { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ink-2); }
.meter.low i b { background: var(--c-removed); }
.meter.out i { box-shadow: inset 0 0 0 1px rgba(194, 54, 42, .35); }
.meter em { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); }
.patch-facts { display: grid; gap: 0; margin: 0; font-size: 13px; }
.patch-facts > div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; padding: 6px 0; border-top: 1px solid var(--rule); }
.patch-facts dt { color: var(--muted); }
.patch-facts dd { margin: 0; color: var(--ink-2); }
.patch footer { display: flex; gap: 18px; padding-top: 4px; font-size: 13.5px; }
@media (max-width: 520px) { .patch-grid { grid-template-columns: 1fr; } }
/* Phones: the 30-day flow reads as a receipt, one line per step */
@media (max-width: 640px) {
  .flow-row { grid-template-columns: 1fr; }
  .flow-row > .label { padding: 14px 0 6px; }
  .flow-step, .flow-step:first-of-type { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; align-items: baseline; gap: 0 8px; padding: 9px 0; border-left: 0; border-top: 1px dotted var(--rule-strong); }
  .flow-step .op { position: static; width: auto; margin: 0; background: none; grid-column: 1; }
  .flow-step .fs-l { grid-column: 2; font-size: 14px; color: var(--ink-2); }
  .flow-step b { grid-column: 3; font-size: 18px; text-align: right; }
  .flow-step small { display: block; grid-column: 2 / 4; text-align: right; margin-top: -2px; }
  .flow-step:last-child { background: none; border-top: 1px solid var(--ink); }
  .flow-step:last-child .fs-l { font-weight: 600; color: var(--ink); }
}

/* =================================================================
   LifeWave look: Montserrat type, sky-blue actions, the light's glow
   ================================================================= */
body { font-variant-numeric: tabular-nums; background:
  radial-gradient(1200px 520px at 100% -10%, rgba(240, 141, 181, .10), transparent 60%),
  radial-gradient(900px 520px at -10% 0%, rgba(28, 155, 230, .10), transparent 60%), var(--bg); background-attachment: fixed; }
.num, .fig-v, .td.n, .todo b, .flow-step b, .patch-figure .num, .inv-figure .num { letter-spacing: -.02em; }
/* Headings follow lifewave.com: uppercase, widely tracked, medium weight */
.head h1, .c-head h1, .login-box h1, .hero h1 { font-weight: 500; text-transform: uppercase; letter-spacing: .14em; color: var(--ink); }
.head h1 { font-size: 24px; } .c-head h1 { font-size: 26px; } .login-box h1 { font-size: 20px; }
.sec-h { border-bottom: 0; background: linear-gradient(90deg, var(--ink-2), var(--rule-strong)) bottom / 100% 1px no-repeat; }
.sec-h h2, .label, .day { letter-spacing: .14em; }
.mark { letter-spacing: .24em; font-weight: 600; }
.figs { border-top: 0; background: var(--glow) top / 100% 2px no-repeat; padding-top: 2px; }
.fig-v { font-weight: 500; }

/* Top bar: white, with a hairline of the light along its bottom edge */
.bar { background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 0; }
.bar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--glow); opacity: .9; }
.nav a.on::after, .tabbar a.on::before { background: var(--glow); height: 3px; }
.nav .n, .tabbar .n { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-left: 6px; padding: 0 5px; border-radius: 9px; background: var(--hot); color: #fff; font-family: var(--sans); font-size: 11px; font-weight: 600; }
.nav .n[hidden], .tabbar .n[hidden] { display: none; }
.tabbar { border-top: 0; box-shadow: 0 -1px 0 var(--rule), 0 -10px 30px rgba(30, 50, 70, .06); }
.tabbar a { font-size: 11.5px; }
.tabbar .n { position: absolute; top: 5px; right: 4px; margin: 0; min-width: 16px; height: 16px; font-size: 10px; }

/* Controls: rounded like lifewave.com, with the blue as the one action colour */
.btn { border-radius: 999px; padding: 0 18px; letter-spacing: .01em; }
.btn.sm { padding: 0 12px; }
.btn.primary { background: linear-gradient(100deg, var(--brand), #1C9BE6); border-color: transparent; box-shadow: 0 6px 16px rgba(20, 120, 190, .22); }
.btn.primary:hover { background: linear-gradient(100deg, var(--brand-hover), var(--brand)); border-color: transparent; }
.input, select.input, textarea.input { border-radius: 8px; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(20, 120, 190, .15); }
:focus-visible { outline-color: var(--brand); }
.seg { border-radius: 999px; }
.seg button.on, .tag.on, .check input:checked { background: var(--brand); border-color: var(--brand); }
.tag, .tag-add { border-radius: 999px; padding: 0 12px; }
.tag.on .n { color: #CFE6F7; }
.drawer { border-top-color: transparent; }
.drawer::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--glow); }
@media (min-width: 760px) { .drawer::before { right: auto; bottom: 0; width: 3px; height: auto; } }
.notice { border-radius: 0 8px 8px 0; }
.menu, .pick-list, .toast { border-radius: 10px; }
.login-box { border-radius: 18px; }

/* Page hero: the light image feathered into the page (Overview, Renewals) */
.hero { position: relative; isolation: isolate; overflow: hidden; margin: -32px -32px 28px; padding: 44px 32px 34px; }
@media (max-width: 1023px) { .hero { margin: -24px -16px 22px; padding: 150px 16px 22px; } }
.hero-light { position: absolute; z-index: -1; top: 0; right: 0; bottom: 0; width: 64%; background: url("/light/overview.webp") 72% 52% / cover no-repeat;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, .55) 30%, #000 65%); mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, .55) 30%, #000 65%); }
@media (max-width: 1023px) { .hero-light { left: 0; width: 100%; bottom: auto; height: 190px; -webkit-mask-image: linear-gradient(180deg, #000 35%, transparent 100%); mask-image: linear-gradient(180deg, #000 35%, transparent 100%); } }
.hero-light.is-renewals { background-image: url("/light/renewals.webp"); background-position: 62% 56%; }
.hero-in { max-width: 560px; }
.hero h1 { margin-top: 8px; font-size: 30px; line-height: 1.15; }
.hero-sub { margin-top: 10px; color: var(--ink-2); font-weight: 300; font-size: 15px; }
.hero-sub a { color: var(--hot); font-weight: 600; }
.inv-hero { background: transparent; }

/* Start-up screen */
.boot { min-height: 70vh; display: grid; place-content: center; text-align: center; gap: 6px; padding: 24px; }
.boot .empty { max-width: 380px; }

/* =================================================================
   Renewals: 30-day (blue), 14-day (amber) and 5-day (coral) alerts
   ================================================================= */
.rn { display: inline-flex; align-items: center; gap: 7px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; background: var(--brand-tint); color: var(--brand); }
.rn::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.rn.s14 { background: #FDF3E3; color: #A9670B; }
.rn.s5 { background: #FDEAE5; color: #BC3B25; }
.rn.done { background: #E5F4EC; color: var(--ok); }
.rn-aside { color: var(--hot); font-weight: 600; }
.tr.alert { box-shadow: -10px 0 0 -7px var(--cold); }
.tr.alert.s14 { box-shadow: -10px 0 0 -7px var(--warm); }
.tr.alert.s5 { box-shadow: -10px 0 0 -7px var(--hot); }
.td.acts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; overflow: visible; }
@media (max-width: 759px) { .td.acts { justify-content: flex-start; margin-top: 8px; } }
.renew-now { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; padding: 14px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--rule); }
.renew-now b { display: block; margin-top: 2px; font-size: 20px; font-weight: 500; }
.renew-now small { display: block; color: var(--muted); font-size: 13px; }
.renew-now.alert { border: 2px solid transparent; background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--glow) border-box; }
.renew-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.renew-form { display: grid; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--rule); }
.renew-save { display: flex; align-items: center; gap: 16px; }
.notice.renew { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; border-left-color: var(--cold); background: var(--brand-tint); color: var(--ink); }
.notice.renew.s14 { border-left-color: var(--warm); background: #FDF5E8; }
.notice.renew.s5 { border-left-color: var(--hot); background: #FDEEEA; }
.notice.renew .renew-acts { margin: 0; }

/* Top bar on narrower desktops: the search box goes first, then the New contact button
   (both stay available on the Contacts page). */
@media (min-width: 1024px) and (max-width: 1365px) { .find { display: none; } .bar-in { gap: 22px; } .nav { gap: 18px; } }
@media (min-width: 1024px) and (max-width: 1179px) { .bar-actions [data-new-contact] { display: none; } .nav { gap: 14px; } .nav a { font-size: 13.5px; } }
@media (max-width: 1023px) { .bar-in { gap: 12px; } .mark { font-size: 12px; letter-spacing: .14em; } .mob-links { gap: 12px; } .mob-links a, .mob-links button { font-size: 13.5px; } }

/* =================================================================
   People first: follow-up prompt, hot & warm, follow-ups, loans
   ================================================================= */
.hero-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.hero-sub a[data-jump] { cursor: pointer; }
.ask-sec { padding: 16px 18px 6px; border: 1px solid var(--rule-strong); border-left: 3px solid var(--brand); border-radius: 0 10px 10px 0; background: var(--surface); }
.ask-sec .sec-h { background: none; padding-bottom: 4px; }
.ask-sec .sec-h h2 { text-transform: none; letter-spacing: 0; font-size: 15px; font-weight: 600; }
.ask-sec .sec-b { padding-top: 4px; }
.ask { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px 18px; align-items: center; padding: 12px 0; border-top: 1px solid var(--rule); transition: opacity .2s, transform .2s; }
.ask.leaving { opacity: 0; transform: translateX(14px); }
.ask-who a { text-decoration: none; } .ask-who a:hover { text-decoration: underline; }
.ask-who small { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 2px; color: var(--muted); font-size: 12.5px; }
.ask-date { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.ask-date .input { height: 34px; width: auto; }
.ask-acts { display: flex; gap: 6px; }
.ask-acts .btn { min-width: 56px; }
@media (max-width: 640px) {
  .ask { grid-template-columns: minmax(0, 1fr) auto; }
  .ask-date { grid-column: 1; grid-row: 2; }
  .ask-acts { grid-column: 2; grid-row: 1 / span 2; flex-direction: column; }
}

.tbl .tr.flag { box-shadow: inset 3px 0 0 var(--hot); padding-left: 12px; }
.nx { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.nx.due { color: var(--err); font-weight: 600; }
.nx.ok { color: var(--ok); }

.fu { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.fu a { text-decoration: none; } .fu a:hover { text-decoration: underline; }
.fu b { font-weight: 500; }
.fu small { display: block; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; }
.fu .when { font-size: 12.5px; color: var(--muted); }
.fu .when.late { color: var(--err); font-weight: 600; }
.fu .when.today { color: var(--ink); font-weight: 600; }
.fu-acts { display: inline-flex; align-items: center; gap: 12px; font-size: 13px; }
.fu.rec { cursor: pointer; }
.fu.rec:hover { background: linear-gradient(90deg, transparent, var(--tint) 12%, var(--tint) 88%, transparent); }
.fu.rn-row.s5 .when, .fu.rn-row.s14 .when { color: var(--hot); font-weight: 600; }
@media (max-width: 520px) { .fu { grid-template-columns: 70px minmax(0, 1fr) auto; gap: 10px; } }

.big-pct { margin-bottom: 12px; color: var(--ink-2); font-size: 13.5px; }
.big-pct b { font-family: var(--mono); font-size: 28px; font-weight: 500; color: var(--ink); margin-right: 6px; letter-spacing: -.02em; }

.section-label { margin: 52px 0 18px; padding-top: 18px; border-top: 1px solid var(--rule-strong); font-size: 11.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

.mini-figs { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin-bottom: 12px; background: var(--rule); border: 1px solid var(--rule); }
.mini-figs a { display: grid; gap: 2px; padding: 10px 12px; background: var(--surface); text-decoration: none; color: var(--ink); }
.mini-figs a:hover { background: var(--tint); }
.mini-figs b { font-family: var(--mono); font-size: 20px; font-weight: 500; }
.mini-figs span { font-size: 12px; color: var(--muted); }

/* Chips: party guests, a contact's health concerns */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 4px 0 11px; border: 1px solid var(--rule-strong); border-radius: 999px; background: var(--tint); font-size: 13px; }
.chip em { font-style: normal; font-size: 11px; font-weight: 600; color: var(--brand); margin-left: 2px; }
.chip button { height: 24px; padding: 0 8px; border: 0; border-radius: 999px; background: none; color: var(--muted); font-size: 11.5px; cursor: pointer; }
.chip button:hover { background: #fff; color: var(--err); }
.h-add { display: flex; gap: 8px; }
.h-add .input { flex: 1; min-width: 0; }
.h-note { white-space: pre-wrap; margin-bottom: 6px; color: var(--ink-2); }
.input.sm { height: 28px; width: auto; padding: 0 8px; font-size: 13px; }

.c-adds { display: flex; flex-wrap: wrap; gap: 8px; margin: -16px 0 28px; }
.loan-back { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 12px 14px; border: 1px solid var(--rule-strong); border-left: 3px solid var(--c-removed); background: var(--tint); }
.loan-back small { display: block; color: var(--muted); font-size: 12.5px; }
.loan-back .input { height: 32px; width: auto; }
@media (max-width: 520px) { .loan-back { grid-template-columns: 1fr auto; } .loan-back > div { grid-column: 1 / -1; } }
.btn.danger-quiet { color: var(--err); }

.entry.loan { --c: var(--c-removed); } .entry.returned { --c: var(--c-received); }
.entry.party { --c: var(--warm); } .entry.enc { --c: var(--cold); } .entry.deal { --c: var(--brand); }

/* Team sign-in */
/* Your name: opens the account menu (settings, team, sign out) */
.me { display: inline-flex; align-items: center; gap: 7px; border: 0; background: none; font: inherit; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.me::after { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); opacity: .7; }
.me:hover, .me.on, .me[aria-expanded="true"] { color: var(--ink); }
.me.on { font-weight: 600; }
.bar-actions .me { height: 34px; padding: 0 4px 0 14px; margin-left: 4px; border-left: 1px solid var(--rule); }
.menu-h { padding: 10px 14px 8px; }
.menu-h b { display: block; font-weight: 600; font-size: 14px; }
.menu-h small { display: block; color: var(--muted); font-size: 12.5px; }
.login-box .field small { display: block; margin-top: 4px; font-size: 12px; }
.login-box form { gap: 14px; }
.set-form { display: grid; gap: 12px; }
.set-acts { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.set .tbl .acts { display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: flex-end; }
.toolbar-r { display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar-r select.input { width: auto; }
.chg { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 12px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--rule); font-size: 13.5px; }
.chg .when { font-size: 12px; color: var(--muted); font-family: var(--mono); }
.chg b { font-weight: 600; }
.chg span { color: var(--ink-2); }
.chg .link { font-size: 12.5px; margin-left: 4px; }

/* Patch cards, livelier: a colour per product (--pc), one stock bar, coloured status */
.patch-grid { gap: 14px; border: 0; }
.patch { position: relative; overflow: hidden; gap: 12px; padding: 20px 18px 16px; border: 1px solid var(--rule); border-radius: 14px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--pc) 9%, #fff) 0%, #fff 55%); box-shadow: 0 1px 2px rgba(20, 40, 70, .05); transition: box-shadow .15s, transform .15s; }
.patch::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--pc); }
.patch:hover { box-shadow: 0 10px 26px rgba(20, 40, 70, .1); transform: translateY(-1px); }
.patch-name { display: inline-flex; align-items: center; gap: 8px; font-size: 15.5px; }
.patch-name::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--pc); flex: none; }
.patch-figure .num { color: var(--pc); font-size: 48px; }
.patch.low .patch-figure .num { color: #C27A14; } .patch.out .patch-figure .num { color: var(--err); }
.patch header .st { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.patch header .st::before { display: none; }
.patch header .st.ok { background: #E3F5EC; color: #1E7A4E; }
.patch header .st.low { background: #FDEFD9; color: #9A5B0A; }
.patch header .st.out { background: #FBE3E0; color: #B42D20; }
.stock-bar { height: 12px; border-radius: 999px; background: color-mix(in srgb, var(--pc) 14%, #fff); overflow: hidden; }
.stock-bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, color-mix(in srgb, var(--pc) 70%, #fff), var(--pc)); }
.stock-bar.low span { background: linear-gradient(90deg, #F7C26B, #E9962B); }
.stock-bar.out { background: #FBE3E0; }
.patch-facts > div { border-top-color: color-mix(in srgb, var(--pc) 16%, var(--rule)); }
.patch footer { align-items: center; gap: 10px; }
.patch footer .pbtn { background: var(--pc); border-color: var(--pc); color: #fff; }
.patch footer .pbtn:hover { filter: brightness(.94); }
.patch footer .link.quiet { margin-left: auto; }
/* The 30-day strip: each step in its colour */
.flow-step[style*="--fc"] { background: color-mix(in srgb, var(--fc) 8%, transparent); }
.flow-step[style*="--fc"] b { color: var(--fc); }
.flow-step:last-child { background: color-mix(in srgb, var(--brand) 10%, transparent); }
.flow-step:last-child b { color: var(--brand); }

/* =================================================================
   Map, groups, text blasts
   ================================================================= */
.map-find { display: flex; gap: 8px; }
.map-find .input { width: min(320px, 60vw); }
.toolbar select.input { width: auto; }
.map-note { margin: 0 0 12px; padding: 9px 12px; border-left: 3px solid var(--cold); background: var(--tint); font-size: 13.5px; color: var(--ink-2); }
.map-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 0; border: 1px solid var(--rule-strong); border-radius: 14px; overflow: hidden; background: #fff; box-shadow: 0 1px 2px rgba(20, 40, 70, .05); }
.map { height: min(70vh, 640px); min-height: 380px; background: #EAF3FA; z-index: 0; }
.map-side { display: flex; flex-direction: column; min-height: 0; max-height: min(70vh, 640px); border-left: 1px solid var(--rule); }
.map-side-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--rule); }
.map-list { flex: 1; overflow: auto; }
.map-row { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 14px; border-bottom: 1px solid var(--rule); cursor: pointer; }
.map-row:hover { background: var(--tint); }
.map-row b { display: block; font-weight: 500; font-size: 14px; }
.map-row small { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 12px; color: var(--muted); }
.map-row input { width: 16px; height: 16px; accent-color: var(--brand); }
.map-acts { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--rule); background: var(--tint); font-size: 13px; }
@media (max-width: 860px) {
  .map-wrap { grid-template-columns: 1fr; }
  .map { height: 52vh; min-height: 300px; }
  .map-side { border-left: 0; border-top: 1px solid var(--rule); max-height: none; }
  .map-list { max-height: 46vh; }
  .map-acts { position: sticky; bottom: 56px; }
}
/* Pins: a dot in the rating colour; selected ones get a ring */
.mk { border-radius: 50%; background: var(--rule-strong); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(20, 40, 70, .35); }
.mk.hot { background: var(--hot); } .mk.warm { background: var(--warm); } .mk.cold { background: var(--cold); } .mk.none { background: #8C9AA6; }
.mk.sel { box-shadow: 0 0 0 3px var(--brand), 0 1px 4px rgba(20, 40, 70, .35); }
.mk-cluster { display: grid; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--brand) 85%, #fff); color: #fff; font: 600 13px var(--sans); border: 3px solid rgba(255, 255, 255, .85); box-shadow: 0 2px 8px rgba(20, 60, 110, .35); }
.mk-pop { display: grid; gap: 6px; min-width: 180px; font-family: var(--sans); }
.mk-pop a { text-decoration: none; color: var(--ink); font-size: 14.5px; }
.mk-pop small { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; color: var(--muted); font-size: 12px; }
.mk-pop-acts { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 2px; }
.leaflet-container { font-family: var(--sans); }
.leaflet-popup-content-wrapper { border-radius: 12px; }
/* Groups on a contact's page */
.c-meta .grp { padding: 2px 9px; border-radius: 999px; background: var(--brand-tint); color: var(--brand); font-size: 12.5px; text-decoration: none; }
.c-meta .grp:hover { text-decoration: underline; }
.radio-list { display: grid; gap: 8px; }
.radio-list .check input { border-radius: 50%; }
/* Text blast */
.blast-preview { padding: 12px 14px; border-radius: 14px 14px 14px 4px; background: #E9F2FC; color: var(--ink); white-space: pre-wrap; font-size: 14px; }
.blast-list { display: grid; border-top: 1px solid var(--rule); max-height: 42vh; overflow: auto; }
.blast-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--rule); }
.blast-row b { display: block; font-weight: 500; }
.blast-row small { color: var(--muted); font-size: 12.5px; }
.blast-row.sent b::after { content: " · sent"; color: var(--ok); font-weight: 600; font-size: 12.5px; }

/* "Show" dropdowns that filter lists (Contacts, Map) */
.sel-l { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.sel-l .input { width: auto; min-width: 180px; color: var(--ink); }

/* Sign-ups & placement planner — the app's panels, type and colours */
/* Left and right sides of the two-sided tree, used across the planner and the family tree */
:root { --left: var(--c-received); --right: #E07A3F; }
.pl-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 20px; align-items: start; }
@media (max-width: 960px) { .pl-grid { grid-template-columns: minmax(0, 1fr); } }
.pl-panel { display: grid; gap: 16px; padding: 20px; border: 1px solid var(--rule); border-radius: 14px; background: var(--surface); box-shadow: 0 1px 2px rgba(20, 40, 70, .05); min-width: 0; }
.pl-panel h2 { font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.pl-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.pl-presets .btn.on { border-color: var(--brand); color: var(--brand); background: var(--brand-tint); }
.pl-legs { display: grid; border-top: 1px solid var(--rule); }
.pl-leg { display: grid; grid-template-columns: minmax(0, 1fr) 70px 84px 118px; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--rule); }
.pl-leg a { text-decoration: none; } .pl-leg a:hover { text-decoration: underline; }
.pl-leg b { font-weight: 500; } .pl-leg .num { font-family: var(--mono); font-size: 15px; }
.pl-leg small { display: block; color: var(--muted); font-size: 12px; }
.pl-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 480px) { .pl-stats { grid-template-columns: 1fr 1fr; } }
.pl-stat { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 10px; background: var(--bg); min-width: 0; }
.pl-stat b { font-size: 17px; font-weight: 600; } .pl-stat b.num { font-family: var(--mono); font-weight: 500; }
.pl-stat span { font-size: 12px; color: var(--muted); }
.side-L { color: var(--left); } .side-R { color: var(--right); }
.pl-gaps { font-size: 13.5px; color: var(--ink-2); }
.pl-gaps ul, .pl-ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); font-size: 13px; display: grid; gap: 2px; }
.pl-kind { width: 100%; } .pl-kind button { flex: 1; }
.pl-opts { display: grid; gap: 10px; }
.pl-opt { display: grid; gap: 10px; padding: 14px 16px; border: 1px solid var(--rule); border-radius: 12px; background: var(--surface); }
.pl-opt.best { border: 2px solid var(--brand); background: linear-gradient(var(--brand-tint), var(--brand-tint)) top / 100% 4px no-repeat, var(--surface); }
.pl-opt-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.pl-opt-h b { font-weight: 600; font-size: 14.5px; }
.pl-badge { padding: 3px 8px; border-radius: 6px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.pl-facts { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); }
.pl-facts b { color: var(--ink); font-weight: 600; } .pl-facts .side-L b, .pl-facts .side-L { color: var(--left); } .pl-facts .side-R b, .pl-facts .side-R { color: var(--right); }
.pl-pill { display: inline-flex; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--rule-strong); background: var(--bg); color: var(--ink-2); font-size: 12px; font-weight: 600; }
.pl-pill.up { border-color: transparent; background: #E3F5EC; color: #1E7A4E; }
.pl-bal { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--rule); }
.pl-bal i { display: block; height: 100%; }
.notice.warn { border-left-color: var(--warm); background: #FDF5E6; color: var(--ink-2); }
.kind-pill { display: inline-flex; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--brand-tint); color: var(--brand); white-space: nowrap; }
.kind-pill.customer { background: #E3F5EC; color: #1E7A4E; }
.tbl .tr.flag-warn { box-shadow: inset 3px 0 0 var(--warm); padding-left: 12px; }
.warn-t { color: #9A5B0A !important; }
.c-meta .grp.su { background: #E3F5EC; color: #1E7A4E; }

.pl-leg-h { padding: 6px 0; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.pl-leg .num { text-align: right; }
@media (max-width: 520px) { .pl-leg { grid-template-columns: minmax(0, 1fr) 64px; } .pl-leg select { grid-column: span 1; } .pl-leg-h span:nth-child(n+3) { display: none; } }
.pl-stat span small { color: var(--faint); }
.pl-trees { display: grid; gap: 8px; padding: 12px 14px; border-radius: 10px; background: var(--tint); font-size: 13px; color: var(--ink-2); }
.pl-pay { margin: 0; padding-left: 18px; display: grid; gap: 3px; font-size: 13px; color: var(--ink-2); }
.pl-pay b, .pl-bin b { color: var(--ink); font-weight: 600; }
.pl-bin { font-size: 13px; color: var(--ink-2); }

/* Family tree: You → left / right sides → leaders → who they introduced; dashed + spots are the options */
.pl-rank { display: grid; gap: 6px; }
.pl-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; width: 100%; padding: 9px 12px; border: 1px solid var(--rule); border-radius: 10px; background: var(--surface); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; transition: border-color .15s, background .15s; }
.pl-row:hover { border-color: var(--brand); }
.pl-row.on { border-color: var(--brand); background: var(--brand-tint); }
.pl-row-n { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--tint); font-size: 12px; font-weight: 600; color: var(--ink-2); }
.pl-row.on .pl-row-n { background: var(--brand); color: #fff; }
.ft-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
@media (max-width: 960px) { .ft-wrap { grid-template-columns: minmax(0, 1fr); } }
.ft-detail { position: sticky; top: 76px; }
.ft { --ln: var(--rule-strong); padding: 18px; border: 1px solid var(--rule); border-radius: 14px; background: linear-gradient(180deg, var(--tint), var(--surface) 140px); min-width: 0; }
.ft-root { display: grid; justify-items: center; gap: 12px; position: relative; padding-bottom: 22px; }
.ft-root::after { content: ""; position: absolute; left: 50%; bottom: 0; height: 22px; border-left: 2px solid var(--ln); }
.ft-node { display: grid; gap: 1px; min-width: 0; padding: 8px 12px; border: 1px solid var(--rule-strong); border-radius: 10px; background: var(--surface); box-shadow: 0 1px 2px rgba(20, 40, 70, .06); }
.ft-node a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ft-node a:hover { text-decoration: underline; }
.ft-node small { color: var(--muted); font-size: 11.5px; }
.ft-node.you { padding: 10px 18px; border: 2px solid var(--brand); text-align: center; background: var(--brand-tint); }
.ft-node.you b { font-size: 15px; }
.ft-node.leader { border-left: 4px solid var(--brand); }
.ft-node.customer { border-style: solid; border-color: #BFE3CF; background: #F2FAF5; }
.ft-node.sm { padding: 5px 10px; }
.ft-spilled { color: var(--c-received) !important; }
.ft-cust { display: grid; justify-items: center; gap: 6px; }
.ft-cust-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.ft-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; position: relative; padding-top: 18px; }
.ft-sides::before { content: ""; position: absolute; top: 0; left: 25%; right: 25%; border-top: 2px solid var(--ln); }
.ft-side { position: relative; min-width: 0; }
.ft-side::before { content: ""; position: absolute; top: -18px; left: 50%; height: 18px; border-left: 2px solid var(--ln); }
.ft-side-h { margin: 0 auto 12px; width: max-content; max-width: 100%; padding: 4px 12px; border-radius: 999px; background: var(--surface); border: 1px solid currentColor; font-size: 12.5px; font-weight: 600; }
.ft-side-h b { margin-left: 4px; }
.ft-trunk { display: grid; gap: 12px; padding-left: 14px; border-left: 2px solid var(--ln); margin-left: 8px; }
.ft-leg, .ft-trunk > .ft-slot { position: relative; }
.ft-leg::before, .ft-trunk > .ft-slot::before { content: ""; position: absolute; left: -16px; top: 20px; width: 14px; border-top: 2px solid var(--ln); }
.ft-kids { margin: 8px 0 0 12px; padding: 0 0 0 14px; list-style: none; display: grid; gap: 8px; border-left: 2px dotted var(--ln); }
.ft-kids > li { position: relative; }
.ft-kids > li::before { content: ""; position: absolute; left: -16px; top: 18px; width: 14px; border-top: 2px dotted var(--ln); }
.ft-slot { display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; padding: 8px 12px; border: 2px dashed color-mix(in srgb, var(--brand) 45%, var(--rule-strong)); border-radius: 10px; background: rgba(255, 255, 255, .7); font: inherit; text-align: left; color: var(--ink); cursor: pointer; transition: border-color .15s, background .15s, transform .15s, box-shadow .15s; }
.ft-slot:hover { border-color: var(--brand); background: var(--brand-tint); transform: translateY(-1px); }
.ft-slot b { display: block; font-size: 13px; font-weight: 600; }
.ft-slot small { display: block; font-size: 11.5px; color: var(--muted); }
.ft-plus { display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--brand-tint); color: var(--brand); font-weight: 700; font-size: 16px; line-height: 1; }
.ft-slot.best { border-color: #2B8A62; }
.ft-slot.best .ft-plus { background: #E3F5EC; color: #1E7A4E; }
.ft-slot.on { border-style: solid; border-color: var(--brand); background: var(--brand-tint); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.ft-slot.on .ft-plus { background: var(--brand); color: #fff; }
.ft-root .ft-slot { width: auto; }
@media (max-width: 560px) {
  .ft { padding: 12px; }
  .ft-sides { grid-template-columns: 1fr; gap: 22px; }
  .ft-sides::before, .ft-side::before { display: none; }
  .ft-side-h { margin-left: 0; }
}

.pl-checks { display: grid; gap: 8px; }
.pl-checks small { font-weight: 400; }
.pl-promo { border-left-color: #E0529C; background: #FCEEF5; color: var(--ink); }
.promo-t { color: #C23A7E !important; font-weight: 600; }

.pl-to-tree { display: grid; gap: 2px; padding: 12px 14px; border: 2px dashed color-mix(in srgb, var(--brand) 45%, var(--rule-strong)); border-radius: 12px; background: var(--brand-tint); color: var(--ink); text-decoration: none; }
.pl-to-tree:hover { border-color: var(--brand); }
.pl-to-tree b::after { content: " ↓"; color: var(--brand); }
.pl-to-tree span { font-size: 13px; color: var(--ink-2); }

/* The tree is the one view: people are tappable, and a spot's details open under it */
.ft-who { padding: 0; border: 0; background: none; font: inherit; font-weight: 600; font-size: 13.5px; color: var(--ink); text-align: left; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ft-who:hover { color: var(--brand); text-decoration: underline; }
.ft-node small a { color: var(--muted); }
.ft-node small .link { font-size: 11.5px; }
.ft-card { margin-top: 8px; }
.ft-card .pl-opt { box-shadow: 0 10px 26px rgba(20, 40, 70, .1); }
.ft-root .ft-card { width: min(100%, 460px); text-align: left; }

/* ================= sign-ups workspace: the tree takes the page, the planner sits beside it ================= */
.ws-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.ws-legend { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; }
.ws-legend .lg { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--rule); color: var(--ink-2); }
.ws-legend .lg::before { content: ""; width: 10px; height: 10px; border-radius: 3px; }
.ws-legend .L::before { background: var(--left); }
.ws-legend .R::before { background: var(--right); }
.ws-legend .cust::before { background: var(--c-given); }
.ws-legend .plan::before { background: repeating-linear-gradient(45deg, #7B5BD6 0 3px, #C9B9F5 3px 6px); }
.ws-legend .slot::before { border: 2px dashed var(--brand); background: none; width: 8px; height: 8px; }
.ws { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; margin-top: 14px; }
.ws-main { min-width: 0; }
.ws-side { position: sticky; top: 12px; display: grid; gap: 12px; max-height: calc(100vh - 24px); overflow-y: auto; padding-right: 2px; }
.ws-box { background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; padding: 14px; display: grid; gap: 10px; }
.ws-box h2 { margin: 0; font-size: 15px; font-weight: 700; }
.ws-box-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ws-box .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ws-rank { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.ws-rank b { font-size: 20px; color: var(--brand); }
.ws-rank span { font-size: 12.5px; color: var(--muted); }
.ws-side .pl-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ws-scen { border: 2px solid #7B5BD6; background: linear-gradient(180deg, #F5F1FF, var(--surface) 60%); }
.ws-scen h2 { color: #4E36A8; }
.ws-scen .ws-rank b { color: #4E36A8; }
.ws-scen-acts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.scen-lines li { font-size: 13px; }
.ws-more summary { cursor: pointer; font-weight: 600; }
.ws-more p { margin: 0; font-size: 13px; color: var(--ink-2); }
.pl-status { margin: 0; padding: 8px 10px; border-radius: 10px; background: #E3F5EC; color: #1E5E40; font-size: 13px; }
.warn-t { color: var(--err); }
.promo-t { display: inline-block; padding: 0 6px; border-radius: 999px; background: #FFF1D6; color: #8A5A0B; font-size: 11px; font-weight: 700; }

/* unsaved moves bar */
.ws-whatif { position: sticky; top: 8px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; padding: 10px 14px; border-radius: 12px; background: #FFF6E5; border: 1px solid #F0C878; box-shadow: 0 6px 18px rgba(20, 40, 70, .08); }
.ws-whatif-acts { display: flex; gap: 8px; }

/* the board */
.ws-board { display: grid; gap: 14px; }
.ws-you { display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); gap: 14px; padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--rule); }
.ws-custs { display: grid; gap: 6px; align-content: start; }
.ws-cust-list { display: flex; flex-wrap: wrap; gap: 8px; }
.ws-cust-list .wc, .ws-cust-list .ft-slot { width: 210px; }
.ws-lanes { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.lane { min-width: 0; padding: 12px; border-radius: 16px; border: 2px solid transparent; transition: border-color .15s, background .15s; }
.lane-L { background: color-mix(in srgb, var(--left) 8%, var(--surface)); }
.lane-R { background: color-mix(in srgb, var(--right) 9%, var(--surface)); }
.lane-h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.lane-L .lane-h b { color: var(--left); }
.lane-R .lane-h b { color: var(--right); }
.lane-h .num { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.lane-cols { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; align-items: flex-start; }
.lane-empty { margin: 0; padding: 18px 10px; border: 2px dashed var(--rule-strong); border-radius: 12px; color: var(--muted); font-size: 13px; text-align: center; flex: 1; }
.wcol { flex: 0 0 220px; display: grid; gap: 8px; align-content: start; }
.wt-kids { display: grid; gap: 8px; margin-left: 12px; padding-left: 10px; border-left: 2px solid var(--rule-strong); }
.wt { display: grid; gap: 8px; }

/* cards */
.wc { position: relative; padding: 10px 12px 10px 26px; border-radius: 12px; background: var(--surface); border: 1px solid var(--rule); border-left: 5px solid var(--rule-strong); box-shadow: 0 2px 6px rgba(20, 40, 70, .06); cursor: grab; user-select: none; transition: box-shadow .15s, transform .15s, border-color .15s; }
.wc:hover, .wc:focus-visible { box-shadow: 0 8px 20px rgba(20, 40, 70, .12); transform: translateY(-1px); outline: none; }
.wc.lane-L { border-left-color: var(--left); }
.wc.lane-R { border-left-color: var(--right); }
.wc.customer, .wc.lane-c { border-left-color: var(--c-given); }
.wc.you { cursor: default; padding-left: 14px; border-left-color: var(--brand); background: var(--brand-tint); }
.wc.you .wc-top b { font-size: 17px; }
.wc.moved { border-style: dashed; border-left-style: solid; background: #FFFBF0; }
.wc.plan { border: 2px dashed #7B5BD6; border-left: 5px solid #7B5BD6; background: #F5F1FF; }
.wc.plan.act { box-shadow: 0 0 0 3px rgba(123, 91, 214, .25); }
.wc.plan .tier { background: #7B5BD6; color: #fff; }
.wc-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.wc-top b { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tier { flex: none; padding: 1px 8px; border-radius: 999px; background: var(--tint); color: var(--ink-2); font-size: 11px; font-weight: 700; }
.wc-meta { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
.wc-warn { font-size: 12px; color: var(--err); margin-top: 4px; }
.wc-moved { font-size: 11.5px; font-weight: 700; color: #8A5A0B; margin-top: 4px; }
.dh { position: absolute; left: 6px; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: 16px; line-height: 1; cursor: grab; touch-action: none; padding: 8px 2px; }
.wc.you .dh { display: none; }

/* dragging */
.ws-ghost { position: fixed; left: 0; top: 0; z-index: 1000; pointer-events: none; opacity: .92; box-shadow: 0 18px 40px rgba(20, 40, 70, .25); transform-origin: 0 0; }
body.ws-dragging, body.ws-dragging * { cursor: grabbing !important; }
body.ws-dragging { user-select: none; }
.drop-ok { outline: 3px solid var(--ok) !important; outline-offset: 2px; background-color: color-mix(in srgb, var(--ok) 8%, var(--surface)) !important; }
.drop-no { outline: 3px solid var(--err) !important; outline-offset: 2px; }

/* prospects tray */
.pr-tray { display: grid; gap: 8px; padding: 8px; border-radius: 12px; border: 2px dashed var(--rule); min-height: 60px; }
.pr { position: relative; display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 26px; border-radius: 10px; background: #F5F1FF; border: 1px solid #D9CCF8; cursor: grab; user-select: none; }
.pr.on { border: 2px solid #7B5BD6; }
.pr.placed { background: var(--surface); }
.pr-t { flex: 1; min-width: 0; display: grid; }
.pr-t b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-t small { font-size: 12px; color: var(--muted); }
.pr-at { color: #4E36A8; font-weight: 600; }
.pr-hint { margin: 0; }
.link.quiet { color: var(--muted); font-size: 12px; }

@media (max-width: 1100px) {
  .ws { grid-template-columns: 1fr; }
  .ws-side { position: static; max-height: none; overflow: visible; }
}
@media (max-width: 720px) {
  .ws-you, .ws-lanes { grid-template-columns: 1fr; }
  .ws-cust-list .wc, .ws-cust-list .ft-slot { width: 100%; }
  .wcol { flex-basis: 78%; }
  .ws-box .row2 { grid-template-columns: 1fr; }
}

/* The workspace board as a family tree: You on top, lines down to each side, leaders, and the people under them */
.ws-board.ft { display: block; padding: 20px; }
.ft-root > .wc.you { min-width: 280px; max-width: 360px; }
.ft-cust-list .wc, .ft-cust-list .ft-slot { width: 220px; }
.ft-side { border-radius: 14px; padding: 6px; transition: background .15s; }
.ft-side-h small { font-weight: 500; color: var(--muted); }
.ft-trunk .wc { margin: 0; }
.ft-leg > .wc { position: relative; }
.ft-kids > li > .wc, .ft-kids > li > .ft-slot { width: 100%; }
.ft-empty { margin: 0; padding: 12px; border: 2px dashed var(--rule-strong); border-radius: 10px; text-align: center; }
.ft-spilled { color: var(--c-received); }
.ft-root.drop-ok, .ft-side.drop-ok { outline-offset: 4px; border-radius: 14px; }
/* Sign-up form: optional parts open with an Add link */
.su-grp { display: grid; gap: 10px; }
.su-add { justify-self: start; font-size: 13px; }
/* Contact page: builder or buyer */
.c-meta .su-style { vertical-align: middle; }
.c-meta .su-style button { padding: 2px 10px; font-size: 12px; }
@media (max-width: 720px) {
  .ft-sides { grid-template-columns: 1fr; }
  .ft-sides::before, .ft-side::before { display: none; }
  .ft-root > .wc.you { min-width: 0; width: 100%; }
}

/* Prospects: added in a form; the side panel scrolls with the page */
.ws-side { position: static; max-height: none; overflow: visible; padding-right: 0; }
.pr-acts { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 12.5px; }
.pr-t small { line-height: 1.35; }

/* Buyers: Brand Partners who signed up to buy, not to build a team */
.wc.buyer { border-left-color: #0E9C8A !important; background: #EAF8F5; }
.wc.buyer .tier { background: #0E9C8A; color: #fff; }
.wc.plan.buyer { border-color: #0E9C8A; background: #EAF8F5; }
.ws-legend .buy::before { background: #0E9C8A; }

/* Prospect mode: what a planned prospect adds */
.delta { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 999px; background: #F1ECFF; color: #5B3FC4; font-size: 11.5px; font-weight: 700; vertical-align: middle; }
.pl-stat .delta { font-size: 11px; }

/* Prospects coloured by what they'd be: builder (purple), buyer (teal), customer (pink); dashed = planned */
.wc.plan.p-builder, .pr.p-builder { border-color: #7B5BD6; background: #F5F1FF; }
.wc.plan.p-buyer, .pr.p-buyer { border-color: #0E9C8A; background: #EAF8F5; }
.wc.plan.p-buyer .tier { background: #0E9C8A; }
.wc.plan.p-cust, .pr.p-cust { border-color: #D9608F; background: #FDF0F5; }
.wc.plan.p-cust .tier { background: #D9608F; }
.pr { border-style: dashed; border-left-width: 5px; border-left-style: solid; }
.pr.on.p-buyer { border-color: #0E9C8A; } .pr.on.p-cust { border-color: #D9608F; }
.pr.p-buyer .pr-at { color: #0B7468; } .pr.p-cust .pr-at { color: #A93A68; }
.ws-legend .pcust::before { background: repeating-linear-gradient(45deg, #D9608F 0 3px, #F6C7D9 3px 6px); }

/* What you need for the next rank, above the tree */
.ws-next { display: grid; gap: 8px; margin-bottom: 14px; padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--rule); border-left: 5px solid var(--brand); }
.ws-next-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; }
.ws-next-h b { font-size: 18px; color: var(--brand); }
.ws-next-pct { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.ws-next-bar { height: 8px; border-radius: 999px; background: var(--tint); overflow: hidden; }
.ws-next-bar i { display: block; height: 100%; border-radius: 999px; background: var(--glow); }
.ws-next-list { margin: 0; padding-left: 18px; display: grid; gap: 3px; font-size: 13.5px; color: var(--ink); }
.ws-side .ws-next { margin-bottom: 0; border-left-width: 1px; border-top: 4px solid var(--brand); }
.ws-side .ws-next-h b { font-size: 16px; }

/* A spot's details: what it does for you first */
.pl-foryou { display: grid; gap: 4px; padding: 10px 12px; border-radius: 10px; background: var(--brand-tint); }
.pl-foryou ul { margin: 0; padding-left: 18px; display: grid; gap: 2px; font-size: 13px; }

/* A prospect's suggested best spot: faded until you plan them there */
.wc.suggest { opacity: .55; cursor: pointer; border-style: dashed; padding-left: 14px; transition: opacity .15s, box-shadow .15s; }
.wc.suggest:hover, .wc.suggest:focus-visible { opacity: .95; }
.wc.suggest .tier { background: var(--ink-2); color: #fff; }
.ws-legend .sug::before { background: #A3B1BC; opacity: .6; }

/* Health concerns: tap several to add */
.tag.add { border-style: dashed; background: transparent; color: var(--ink-2); }
.tag.add:hover { border-style: solid; border-color: var(--brand); color: var(--brand); background: var(--brand-tint); }
.h-pick { display: grid; gap: 6px; margin-bottom: 10px; }

/* Back to the list, and the contact you just looked at */
.crumb.back { font-weight: 600; color: var(--brand); }
.tbody .tr.was { background: var(--brand-tint); box-shadow: inset 3px 0 0 var(--brand); }
.tag-add.wide { width: 240px; max-width: 100%; }

/* Phones: contacts list and a contact's page */
@media (max-width: 759px) {
  .head { gap: 10px; padding-bottom: 14px; margin-bottom: 14px; }
  .head h1 { font-size: 19px; letter-spacing: .1em; }
  .head .sub { margin-top: 2px; font-size: 13px; }
  .head .actions { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .head .actions .btn { height: 36px; padding: 0 6px; font-size: 12.5px; justify-content: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .toolbar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .toolbar .sel-l { display: block; min-width: 0; }
  .toolbar .sel-l span { display: none; }
  .toolbar .sel-l .input, .toolbar-r .input { width: 100%; min-width: 0; height: 40px; font-size: 15px; }
  .toolbar-r { display: contents; }
  .toolbar .search { grid-column: 1 / -1; }
  .tbody .tr { padding: 11px 0; align-items: center; }
  .tbody .tr .td.b { font-size: 15.5px; }
  .tbody .td.m { grid-row: 1 / span 2; }
  .tbody .td.m .st { font-size: 12.5px; }
  .crumb { margin-bottom: 4px; }
  .c-head { gap: 10px; padding-bottom: 14px; margin-bottom: 18px; }
  .c-head h1 { font-size: 20px; letter-spacing: .1em; }
}

/* An entry with several products: each product's amount */
.entry .what .ln-q { font-weight: 400; color: var(--ink-2); font-size: 12.5px; }

/* Top search: a steady width that doesn't get squeezed, with matches below it */
.find { position: relative; flex: 0 0 230px; }
.find .input { width: 100%; min-width: 0; }
.find .pick-list { left: 0; right: auto; width: 320px; z-index: 50; }
.nav a { white-space: nowrap; }

/* Completed follow-ups, folded away */
.fu-acc { margin-top: 14px; border-top: 1px solid var(--rule); }
.fu-acc summary { cursor: pointer; padding: 10px 0; font-size: 13.5px; font-weight: 600; color: var(--ink-2); list-style: none; }
.fu-acc summary::-webkit-details-marker { display: none; }
.fu-acc summary::before { content: "▸"; display: inline-block; width: 16px; color: var(--muted); transition: transform .15s; }
.fu-acc[open] summary::before { transform: rotate(90deg); }
.fu.done .when { color: var(--ok); }
.fu.done b { font-weight: 500; }

/* Overview: plain "something's waiting" / "all clear" markers */
.status { display: flex; align-items: center; gap: 14px; margin: 14px 0 4px; padding: 14px 18px; border-radius: 14px; max-width: 720px; }
.status b { display: block; font-size: 17px; font-weight: 600; }
.status span { font-size: 14px; }
.status a { color: inherit; font-weight: 600; }
.status-ic { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; font-size: 20px; font-weight: 700; color: #fff; }
.status.ok { background: #E3F5EC; color: #1E5E40; border: 1px solid #BFE3CF; }
.status.ok .status-ic { background: var(--ok); }
.status.due { background: #FFF1E3; color: #7A3E0C; border: 1px solid #F3C99B; }
.status.due .status-ic { background: #E07A3F; }
.st-badge { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.st-badge.ok { background: #E3F5EC; color: #1E7A4E; }
.st-badge.due { background: #FDE4D2; color: #9A4510; }
.sec-h .aside { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.empty.ok { display: flex; align-items: center; gap: 12px; padding: 18px 16px; margin-top: 8px; border-radius: 12px; background: #EEF8F2; color: #2E6B4C; }
.empty.ok b { color: #1E5E40; font-weight: 600; }
.ok-mark { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--ok); color: #fff; font-weight: 700; }

/* Health concerns pie */
.pie { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 20px; align-items: center; padding-top: 10px; }
.donut { width: 170px; height: 170px; transform: none; }
.donut circle { transition: stroke-width .15s; }
.donut circle:hover { stroke-width: 8.5; }
.donut-n { font-size: 7px; font-weight: 700; fill: var(--ink); }
.donut-l { font-size: 3px; fill: var(--muted); }
.pie-leg { display: grid; gap: 2px; }
.pie-row { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; column-gap: 8px; align-items: center; padding: 4px 0; text-decoration: none; color: var(--ink); font-size: 13.5px; }
.pie-row i { width: 12px; height: 12px; border-radius: 3px; background: var(--c); }
.pie-row b { font-weight: 600; font-size: 13px; }
.pie-row small { grid-column: 2 / -1; margin-top: -2px; color: var(--muted); font-size: 11.5px; }
a.pie-row:hover span { text-decoration: underline; }
@media (max-width: 520px) { .pie { grid-template-columns: 1fr; justify-items: center; } .pie-leg { width: 100%; } }
/* the pie: solid slices */
.pie-svg path, .pie-svg circle { transition: opacity .15s, transform .15s; transform-origin: 21px 21px; }
.pie-svg:hover path, .pie-svg:hover circle { opacity: .55; }
.pie-svg path:hover, .pie-svg circle:hover { opacity: 1; transform: scale(1.04); }

/* A team member's own contact card */
.me-card { background: #EEF2F6 !important; color: var(--ink-2) !important; }
.me-tag { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 999px; background: #EEF2F6; color: var(--ink-2); font-size: 11px; font-weight: 700; vertical-align: middle; }
.tr .td .sub.mob-place { display: none; }
@media (max-width: 759px) { .tr .td .sub.mob-place { display: block; } }

/* Follow-ups: how many days until (or since) each one, under its date. */
.fu .when em { display: block; font-style: normal; font-weight: 400; font-size: 11.5px; color: var(--muted); }
.fu .when.late em { color: var(--err); }

/* Patches running low or out: a red glow around the card, and its colour dimmed. */
.patch.low, .patch.out { border-color: rgba(194, 54, 42, .55); box-shadow: 0 0 0 1px rgba(194, 54, 42, .35), 0 0 18px rgba(194, 54, 42, .28); }
.patch.low:hover, .patch.out:hover { box-shadow: 0 0 0 1px rgba(194, 54, 42, .45), 0 0 24px rgba(194, 54, 42, .38); }
.patch.low::before, .patch.out::before, .patch.low .patch-name::before, .patch.out .patch-name::before { opacity: .45; }
.patch.low .patch-figure .num, .patch.out .patch-figure .num { opacity: .75; }

/* Parties: marking who came, and the invite-next-time list. */
.att-list { display: grid; border-top: 1px solid var(--rule); }
.check.att { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.check.att small { margin-left: auto; color: var(--muted); font-size: 12px; }
a.chip { text-decoration: none; color: var(--ink); }
a.chip small { margin-left: 6px; color: var(--muted); font-size: 11.5px; }
.sub.due-word { color: var(--err); font-weight: 600; }
a.chip { padding-right: 11px; }

/* The top bar stays inside the screen: the page never scrolls sideways, the bar respects the
   phone's safe areas, and its pieces shrink (name and menu links trim) instead of pushing the
   right-hand buttons off the edge. */
html { overflow-x: clip; }
.bar-in { min-width: 0; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
@media (min-width: 1024px) { .bar-in { padding-left: max(32px, env(safe-area-inset-left)); padding-right: max(32px, env(safe-area-inset-right)); } }
.mark { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav { flex: 0 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.bar-actions, .mob-links { flex: none; }
.me-n { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mob-links .me-n { max-width: 80px; }
@media (max-width: 380px) { .mark { font-size: 11px; letter-spacing: .1em; } .mob-links { gap: 10px; } }
.nav a.on::after { bottom: 0; }
@media (min-width: 1024px) and (max-width: 1179px) { .bar-in { gap: 16px; } .nav { gap: 13px; } .mark { letter-spacing: .16em; } }

/* ================= Left-hand menu =================
   The top bar keeps the name, search, New contact, Give patches and your account. The pages are
   in a menu down the left, under the bar, which collapses to its icons (remembered on the device).
   Phones and tablets: the Menu button in the bar slides the same menu in from the left. */
:root { --bar-h: 56px; --side-w: 216px; --side-w-c: 64px; }
/* ☰ at the far left of the top bar shows or hides the page menu. */
.bar-menu { flex: none; display: inline-grid; place-items: center; width: 38px; height: 38px; margin-left: -8px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--ink-2); cursor: pointer; }
.bar-menu:hover { background: var(--tint); color: var(--ink); }
.bar-menu .ic { width: 22px; height: 22px; }
@media (min-width: 1024px) { .bar-in { max-width: none; } }
.side { position: fixed; z-index: 29; top: var(--bar-h); bottom: 0; left: 0; width: var(--side-w); display: flex; flex-direction: column; gap: 10px;
  padding: 14px 10px calc(12px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); background: rgba(255, 255, 255, .96);
  border-right: 1px solid var(--rule); overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; transition: width .18s ease, transform .22s ease; }
.side-toggle { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border: 1px solid var(--rule); border-radius: 9px; background: var(--surface); color: var(--muted); font: inherit; font-size: 13px; white-space: nowrap; cursor: pointer; }
.side-toggle:hover { color: var(--ink); border-color: var(--rule-strong); }
.side-toggle .ic { transition: transform .18s ease; }
.ic { flex: none; width: 20px; height: 20px; }
.side .nav { display: flex !important; flex-direction: column; flex: 1 0 auto; gap: 2px; overflow: visible; align-self: stretch; }
.side .nav a, .side-foot a { position: relative; display: flex; align-items: center; gap: 12px; height: 38px; padding: 0 10px; border-radius: 9px; color: var(--ink-2); font-size: 14px; text-decoration: none; white-space: nowrap; }
.side .nav a:hover, .side-foot a:hover { background: var(--tint); color: var(--ink); }
.side .nav a.on, .side-foot a.on { background: var(--brand-tint); color: var(--brand); font-weight: 600; }
.side .nav a.on::after { display: none; }
.side .nav .n { margin-left: auto; }
.side-foot { display: grid; gap: 2px; padding-top: 10px; border-top: 1px solid var(--rule); }
.side-scrim { display: none; }

@media (min-width: 1024px) {
  .main { padding-left: calc(var(--side-w) + 32px); max-width: calc(1320px + var(--side-w)); transition: padding-left .18s ease; }
  body.side-collapsed .main { padding-left: calc(var(--side-w-c) + 32px); max-width: calc(1320px + var(--side-w-c)); }
  body.side-collapsed .side { width: var(--side-w-c); }
  body.side-collapsed .nav-l, body.side-collapsed .side-toggle-l { display: none; }
  body.side-collapsed .side-toggle { justify-content: center; padding: 0; }
  body.side-collapsed .side-toggle .ic { transform: rotate(180deg); }
  body.side-collapsed .side .nav a, body.side-collapsed .side-foot a { justify-content: center; padding: 0; }
  body.side-collapsed .side .nav .n { position: absolute; top: 3px; right: 3px; margin: 0; min-width: 16px; height: 16px; font-size: 10px; }
}
@media (max-width: 1023px) {
  .side { z-index: 41; top: 0; width: min(280px, 84vw); padding-top: calc(14px + env(safe-area-inset-top)); transform: translateX(-105%); box-shadow: 0 0 40px rgba(20, 40, 70, .18); }
  body.side-open .side { transform: none; }
  .side-toggle { display: none; }
  .side-scrim { position: fixed; inset: 0; z-index: 40; background: rgba(30, 50, 70, .32); }
  body.side-open .side-scrim { display: block; }
}

/* Low patches you've marked as seen: no red glow (the Low / Out label still shows). */
.patch.low.seen, .patch.out.seen { border-color: var(--rule); box-shadow: none; }
.patch.low.seen::before, .patch.out.seen::before, .patch.low.seen .patch-name::before, .patch.out.seen .patch-name::before, .patch.low.seen .patch-figure .num, .patch.out.seen .patch-figure .num { opacity: 1; }
.inv-sub [data-inv-seen] { margin-left: 6px; vertical-align: 1px; }
.inv-alert-row { margin-top: 14px; font-size: 13px; }

/* Who came: each person on one row — came, rating, phone, email (stacked on phones). */
.att-row { display: grid; grid-template-columns: minmax(0, 1.2fr) auto minmax(0, 1fr) minmax(0, 1.2fr); gap: 8px 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.att-row .check.att { padding: 0; border: 0; }
.att-row .input { height: 34px; font-size: 13.5px; }
.att-temp button { height: 30px; padding: 0 9px; font-size: 12.5px; }
@media (max-width: 720px) { .att-row { grid-template-columns: 1fr 1fr; } .att-row .check.att { grid-column: 1 / -1; } .att-temp { grid-column: 1 / -1; justify-self: start; } }
.drawer:has(.att-row) { max-width: 860px; }

/* The connection map. */
.cg-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 12px; }
.cg-tools .search { width: min(320px, 100%); }
.cg-wrap { position: relative; border: 1px solid var(--rule); border-radius: 14px; background: radial-gradient(circle at 50% 40%, #fff, var(--bg)); overflow: hidden; }
.cg { display: block; width: 100%; height: min(72vh, 760px); touch-action: none; cursor: grab; user-select: none; }
.cg:active { cursor: grabbing; }
.cg-e line { stroke: var(--rule-strong); stroke-width: 1.4; }
.cg-e text { fill: var(--muted); font-size: 10.5px; text-anchor: middle; paint-order: stroke; stroke: #fff; stroke-width: 3px; }
.cg-e.on line { stroke: var(--brand); stroke-width: 2.2; }
.cg-e.on text { fill: var(--brand); font-weight: 600; }
.cg-e.dim { opacity: .18; }
.cg-n { cursor: pointer; }
.cg-n circle { fill: var(--c); stroke: #fff; stroke-width: 2.5; filter: drop-shadow(0 2px 4px rgba(20, 40, 70, .18)); }
.cg-n text { fill: var(--ink); font-size: 11.5px; font-weight: 500; text-anchor: middle; paint-order: stroke; stroke: #fff; stroke-width: 3.5px; }
.cg-n.on circle { stroke: var(--brand); stroke-width: 3.5; }
.cg-n.on text { font-weight: 700; }
.cg-n.dim { opacity: .25; }
.cg-card { position: absolute; top: 12px; right: 12px; width: min(280px, calc(100% - 24px)); max-height: calc(100% - 24px); overflow-y: auto; padding: 14px; border: 1px solid var(--rule); border-radius: 12px; background: rgba(255, 255, 255, .97); box-shadow: 0 12px 30px rgba(20, 40, 70, .14); }
.cg-card-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.cg-li { display: flex; justify-content: space-between; gap: 10px; width: 100%; padding: 8px 0; border: 0; border-bottom: 1px solid var(--rule); background: none; font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; }
.cg-li:hover span { text-decoration: underline; }
.cg-li small { color: var(--muted); }
.cg-legend { position: absolute; left: 12px; bottom: 10px; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--ink-2); }
.cg-legend i { display: inline-block; width: 10px; height: 10px; margin-right: 5px; border-radius: 50%; background: var(--c); vertical-align: -1px; }
.link-row .when { font-weight: 600; color: var(--ink-2); }

/* Party guests: name, rating, phone, email, Edit. */
.guest-row .td a { text-decoration: none; }
.guest-row .td a:hover { text-decoration: underline; }
.guest-row .td.b a { color: var(--ink); }
.guest-row .sub.mob-only { display: none; }
@media (max-width: 760px) { .guest-row .sub.mob-only { display: block; } }
.cg-n circle.team { stroke: var(--rule-strong); stroke-width: 4; }
.cg-e.acq line { stroke-dasharray: 3 4; opacity: .7; }

/* Patches given in a conversation. */
.entry .what small.gave, .gave-now { color: var(--c-given); font-weight: 500; }
.gave-now { margin: 0; font-size: 13.5px; }
.lg-sample { display: grid; gap: 14px; padding: 14px; border: 1px solid var(--rule); border-radius: 10px; background: var(--bg); }

/* A centred window (Log a communication), on computers and phones alike. */
.drawer.modal { top: 50%; bottom: auto; left: 12px; right: 12px; width: auto; max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); transform: translateY(-50%); border: 1px solid var(--rule-strong); border-radius: 14px; box-shadow: 0 24px 70px rgba(20, 40, 70, .28); overflow: hidden; animation: fade .14s ease; }
.drawer.modal::before { right: 0; bottom: auto; width: auto; height: 3px; }
@media (min-width: 760px) { .drawer.modal { left: 50%; right: auto; width: min(620px, calc(100vw - 48px)); max-height: 88vh; transform: translate(-50%, -50%); } }

/* Phones: every field gets its own line and room. Date and time fields keep a wide built-in minimum
   (on iPhones especially), so they're told they may shrink, and two-column rows stack. */
.input { min-width: 0; max-width: 100%; }
.dr-b { grid-template-columns: minmax(0, 1fr); }
.dr-b > * { min-width: 0; }
@media (max-width: 640px) {
  .row2, .row3 { grid-template-columns: minmax(0, 1fr); }
  .input, select.input { height: 44px; }
  textarea.input { height: auto; }
  .stepper .input { height: 40px; }
  input.input[type=date], input.input[type=time], input.input[type=datetime-local] { display: block; width: 100%; -webkit-appearance: none; appearance: none; line-height: 42px; text-align: left; }
  input.input::-webkit-date-and-time-value { min-height: 1.4em; text-align: left; }
  .dr-h { padding: 16px; }
  .dr-b { gap: 18px; padding: 16px 16px 24px; }
  .dr-f { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .dr-f .sum:empty { display: none; }
  .dr-f .btn { flex: 1; justify-content: center; }
  .tags { gap: 6px; }
  .ask-date { flex-wrap: wrap; white-space: normal; }
  .ask-date .input { flex: 1 1 150px; width: auto; }
  .toolbar .input, .toolbar-r .input { width: 100%; }
}
@media (max-width: 520px) {
  .att-row { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 12px 0; }
  .att-row .check.att, .att-temp { grid-column: auto; }
}

/* Phones and tablets zoom in on any field with text under 16px, so none are. */
@media (max-width: 1023px), (pointer: coarse) {
  input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=color]), select, textarea { font-size: 16px !important; }
  .tag-add { height: 36px; }
}

/* A signed-up person's status, where a rating would be. */
.st.signed { --c: var(--ok); color: var(--ok); font-weight: 600; }
.mk.signed { background: var(--ok); }

/* Connections: the kind of connection has room on computers, and its own line on phones. */
.link-row { grid-template-columns: minmax(0, 1fr) auto; }
.link-row .when { overflow-wrap: anywhere; }
@media (max-width: 520px) {
  .link-row { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; }
  .link-row .when { grid-column: 1 / -1; }
}

/* Phones: page buttons wrap to fit their labels instead of squeezing them together. */
@media (max-width: 640px) {
  .head .actions { display: flex; flex-wrap: wrap; gap: 8px; }
  .head .actions .btn { flex: 1 1 auto; width: auto; min-width: 0; white-space: nowrap; justify-content: center; }
}

/* The family file on a contact page. */
.fam-panel { margin-bottom: 20px; padding: 14px 16px 6px; border: 1px solid var(--rule-strong); border-radius: 12px; background: var(--surface); }
.fam-h { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px 16px; margin-bottom: 8px; }
.fam-h h2 { margin-top: 2px; font-size: 17px; font-weight: 600; }
.fam-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.fam-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .9fr) minmax(0, 1.2fr) auto; gap: 4px 14px; align-items: center; padding: 10px 0; border-top: 1px solid var(--rule); font-size: 13.5px; }
.fam-row.here .fam-who b { color: var(--brand); }
.fam-row a { text-decoration: none; } .fam-row a:hover { text-decoration: underline; }
.fam-who small { display: block; color: var(--muted); font-size: 12.5px; }
.fam-c { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 720px) {
  .fam-row { grid-template-columns: minmax(0, 1fr) auto; }
  .fam-who { grid-column: 1; grid-row: 1; }
  .fam-row .fu-acts { grid-column: 2; grid-row: 1; }
  .fam-c { grid-column: 1 / -1; }
}

/* The tree on a profile. */
.ego { margin-bottom: 14px; border: 1px solid var(--rule); border-radius: 12px; background: var(--bg); }
.ego-scroll { overflow-x: auto; padding: 10px; }
.ego svg { display: block; margin: 0 auto; }
.ego p { margin: 0; padding: 0 12px 10px; }
.cg-e.fam line { stroke: var(--ink-2); stroke-width: 2.6; }

/* Connections: the tree. */
.nt, .nt ul { list-style: none; margin: 0; padding: 0; }
.nt ul { margin-left: 14px; padding-left: 14px; border-left: 1px solid var(--rule); }
.nt-sec { margin-bottom: 26px; }
.nt-row { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 5px 6px; border-radius: 8px; }
.nt-row:hover { background: var(--tint); }
.nt-row.sel { background: var(--brand-tint); box-shadow: inset 0 0 0 1px var(--brand); }
.nt-tog { flex: none; display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; background: none; color: var(--muted); font-size: 13px; cursor: pointer; }
span.nt-tog { cursor: default; }
.nt-dot { flex: none; width: 11px; height: 11px; border-radius: 50%; background: var(--c); }
.nt-main { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.nt-main a { text-decoration: none; color: var(--ink); overflow-wrap: anywhere; } .nt-main a:hover { text-decoration: underline; }
.nt-main b { font-weight: 600; }
.nt-main small { font-size: 12.5px; color: var(--muted); }
.nt-n { flex: none; min-width: 26px; padding: 1px 8px; border-radius: 999px; background: var(--tint); color: var(--ink-2); font-size: 12px; text-align: center; }
.nt-bname { border: 0; padding: 0; background: none; color: var(--ink-2); font: inherit; font-size: 13.5px; cursor: pointer; text-align: left; }
.nt-bname:hover { text-decoration: underline; }
.nt-acq .nt-row { min-height: 38px; }
.cg-tools .sel-l { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.cg-tools .sel-l .input { width: auto; max-width: 220px; }
#cgRootBox:empty { display: none; }
/* The map's acquaintance bubble and counts. */
.cg-bub { cursor: pointer; }
.cg-bub circle { fill: var(--tint); stroke: var(--rule-strong); stroke-width: 1.5; }
.cg-bub text.in { font-size: 14px; font-weight: 700; }
.cg-n text.more { fill: var(--brand); font-size: 11px; font-weight: 700; text-anchor: start; }
.cg-n circle.fam { stroke: var(--ink-2); stroke-width: 2.5; }
a.cg-li[hidden] { display: none; }
a.cg-li { text-decoration: none; color: var(--ink); }
/* How you know them. */
.how { display: grid; gap: 4px; margin: -12px 0 20px; }
.how-line { margin: 0; font-size: 13.5px; color: var(--ink-2); overflow-wrap: anywhere; }
.how-line .label { margin-right: 6px; }
.how-line small { color: var(--muted); font-size: 12px; }
.how-line a { text-decoration: none; font-weight: 500; } .how-line a:hover { text-decoration: underline; }
.how-to { color: var(--muted); }

/* While a popup waits for the page behind it. */
.dr-f .btn.is-busy { opacity: .75; }
.cg-n text.role { fill: var(--muted); font-size: 10.5px; font-weight: 400; }

/* Family trees: circles, tiers and ties. */
.ft-dot circle { stroke: #fff; stroke-width: 2; }
.ft-in { font-weight: 700; text-anchor: middle; letter-spacing: .02em; pointer-events: none; }
.ft-label { fill: var(--ink); font-size: 11.5px; font-weight: 500; text-anchor: middle; paint-order: stroke; stroke: var(--bg); stroke-width: 3px; }
.ft-dot.me circle, .ft-dot.lit circle { stroke: var(--brand); stroke-width: 3.5; }
.ft-dot.me .ft-label, .ft-dot.lit .ft-label { font-weight: 700; }
.ft-bub { cursor: pointer; }
.ft-bub circle { fill: var(--tint); stroke: var(--rule-strong); stroke-width: 1.5; stroke-dasharray: 3 3; }
.ft-count { fill: var(--ink-2); font-size: 12.5px; font-weight: 700; text-anchor: middle; }
.ft-tie { fill: none; stroke: var(--ink-2); stroke-width: 2; }
.ft-line { fill: none; stroke: var(--rule-strong); stroke-width: 1.5; }
.ft-line.acq { stroke-dasharray: 3 4; }
.ft-line.on { stroke: var(--brand); stroke-width: 2.5; }
.ft-chip { cursor: pointer; }
.ft-chip rect { fill: var(--surface); stroke: var(--rule-strong); }
.ft-chip text { fill: var(--brand); font-size: 11px; font-weight: 700; text-anchor: middle; }
.ego a:hover circle { stroke: var(--brand); }
.cg .ft-dot, .cg [data-node] { cursor: pointer; }

/* The profile tree scrolls inside its box, rather than widening the page. */
.c-grid > div { grid-template-columns: minmax(0, 1fr); }
.c-grid .sec, .c-grid .sec-b { min-width: 0; }
/* On a phone the tree shrinks to fit, down to a readable size, then scrolls. */
.ego-scroll svg { max-width: 100%; height: auto; }
/* Phones: the tree scrolls with the page, and the details sit above the tab bar. */
@media (max-width: 639px) {
  .cg { height: auto; touch-action: pan-y; cursor: default; }
  .cg-wrap { overflow: visible; }
  .cg-legend { position: static; padding: 6px 12px 10px; }
  .cg-card { position: fixed; z-index: 35; top: auto; left: 12px; right: 12px; bottom: calc(62px + env(safe-area-inset-bottom)); width: auto; max-height: 45vh; }
}

/* Profile tree: tap a line or a connection to light up both. */
.ft-hit { fill: none; stroke: transparent; stroke-width: 20; cursor: pointer; pointer-events: stroke; }
.ft-rel:hover .ft-line { stroke: var(--ink-2); }
.ft-rel.on .ft-line, .ft-rel.on:hover .ft-line { stroke: var(--brand); stroke-width: 3; }
.ego .ego-cap { padding: 0 12px 12px; text-align: center; }
.ego .ego-cap.on { color: var(--ink); font-weight: 600; }
.link-row[data-rel] { cursor: pointer; padding-inline: 10px; margin-inline: -10px; border-radius: 8px; transition: background .15s; }
.link-row.on { background: var(--brand-tint); box-shadow: inset 3px 0 0 var(--brand); }

/* Overview: the Today list. */
.today-h { margin: 14px 0 2px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.today-h:first-child { margin-top: 0; }
.today-row { padding-left: 10px; box-shadow: inset 3px 0 0 var(--k, var(--rule-strong)); }
.k-renewal { --k: var(--hot); } .k-follow { --k: var(--brand); } .k-loan { --k: var(--warm); } .k-party { --k: var(--c-given); } .k-signup { --k: var(--ok); }
.kind-tag { font-weight: 600; color: var(--ink-2); }
.today-row .fu-acts { flex-wrap: wrap; justify-content: flex-end; }

/* Overview: nothing due, and the This week banner. */
.all-done { display: flex; align-items: center; gap: 14px; margin-top: 4px; padding: 16px 18px; border-radius: 12px; background: #E3F5EC; color: #1E7A4E; }
.all-done-ic { font-size: 28px; line-height: 1; }
.all-done b { display: block; font-size: 16px; font-weight: 700; }
.all-done span:not(.all-done-ic) { font-size: 13.5px; }
.week-banner { margin-top: 16px; border: 1px solid var(--rule-strong); border-radius: 12px; background: var(--brand-tint); }
.week-banner summary { display: flex; align-items: center; gap: 14px; padding: 16px 18px; cursor: pointer; list-style: none; }
.week-banner summary::-webkit-details-marker { display: none; }
.week-n { display: inline-flex; flex: none; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 8px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 17px; font-weight: 700; }
.week-t { min-width: 0; flex: 1; }
.week-t b { display: block; font-size: 17px; font-weight: 700; color: var(--ink); }
.week-t small { display: block; font-size: 13px; color: var(--ink-2); }
.week-banner summary i { flex: none; width: 9px; height: 9px; margin-right: 4px; border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2); transform: rotate(45deg); transition: transform .15s; }
.week-banner[open] summary i { transform: rotate(-135deg); }
.week-b { padding: 0 14px 8px; background: var(--surface); border-top: 1px solid var(--rule); border-radius: 0 0 12px 12px; }
.week-b .today-row:last-child { border-bottom: 0; }

/* The top alert's Got it. */
.status-t { flex: 1; min-width: 0; }
.status.due .btn { flex: none; }
/* Phones: a Today row's buttons get their own line, so the name has room. */
@media (max-width: 640px) {
  .today-row { grid-template-columns: 70px minmax(0, 1fr); }
  .today-row .fu-acts { grid-column: 1 / -1; justify-content: flex-end; }
}

/* Contact page: tools by the name, How you know them, the rating dropdown. */
.c-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.c-tools { display: inline-flex; gap: 8px; }
.tool-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--rule-strong); border-radius: 999px; background: var(--surface); color: var(--ink-2); font: inherit; font-size: 13px; cursor: pointer; }
.tool-btn:hover { border-color: var(--brand); color: var(--brand); }
.tool-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.how { display: grid; gap: 8px; }
.how-row { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 4px 12px; align-items: baseline; font-size: 14px; }
.how-l { font-size: 12.5px; color: var(--muted); }
.how-v { min-width: 0; overflow-wrap: anywhere; }
.how-v a { text-decoration: none; } .how-v a:hover { text-decoration: underline; }
.how-v small { margin-left: 4px; color: var(--muted); font-size: 12.5px; }
.how-path { margin-top: 4px; font-size: 13px; color: var(--ink-2); }
.how-path summary { display: inline; cursor: pointer; color: var(--brand); font-size: 12.5px; list-style: none; }
.how-path summary::-webkit-details-marker { display: none; }
.how-path p { margin: 6px 0 0; }
@media (max-width: 640px) { .how-row { grid-template-columns: minmax(0, 1fr); gap: 0; } }
.rate { position: relative; display: inline-flex; }
.rate select { appearance: none; -webkit-appearance: none; height: 34px; padding: 0 34px 0 14px; border: 1px solid transparent; border-radius: 999px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.rate::after { content: ""; position: absolute; right: 14px; top: 50%; width: 7px; height: 7px; margin-top: -6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); pointer-events: none; }
/* The same colours as the ratings everywhere else; dark text on warm so it stays readable. */
.rate-hot { color: #fff; } .rate-hot select { background: var(--hot); color: #fff; }
.rate-warm { color: #4A2C04; } .rate-warm select { background: var(--warm); color: #4A2C04; }
.rate-cold { color: #fff; } .rate-cold select { background: var(--cold); color: #fff; }
.rate-none { color: var(--ink-2); } .rate-none select { background: var(--surface); color: var(--ink-2); border-color: var(--rule-strong); }
.rate select option { color: var(--ink); background: #fff; }
.menu button.danger { color: var(--err); }

/* Call, Text, Email: one look, with a soft blue glow. */
.btn.reach { background: var(--surface); color: var(--ink); border-color: #BFDDF5; box-shadow: 0 0 0 3px rgba(31, 138, 214, .10), 0 6px 18px rgba(31, 138, 214, .22); }
.btn.reach:hover:not([disabled]) { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31, 138, 214, .18), 0 8px 22px rgba(31, 138, 214, .30); }
.btn.reach[disabled] { box-shadow: none; }
/* Do not contact, by the name. */
.dnc-tog input { position: absolute; opacity: 0; pointer-events: none; }
.dnc-tog::before { content: ""; width: 12px; height: 12px; border: 1.5px solid currentColor; border-radius: 3px; }
.dnc-tog.on { background: var(--dnc); border-color: var(--dnc); color: #fff; }
.dnc-tog.on::before { background: #fff; box-shadow: inset 0 0 0 2px var(--dnc); }
/* Health concerns, read at a glance. */
.h-chips { display: inline-flex; flex-wrap: wrap; gap: 6px; vertical-align: middle; }
.h-chip { padding: 2px 10px; border-radius: 999px; background: #FBE7F0; color: #8A2453; font-size: 12.5px; font-weight: 600; }
/* Add to a party. */
.pp-new { width: 100%; margin-bottom: 14px; padding: 12px 14px; border: 1px dashed var(--brand); border-radius: 10px; background: var(--brand-tint); color: var(--brand); font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.pp-h { margin: 14px 0 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.pp-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 10px; margin-bottom: 6px; cursor: pointer; }
.pp-row:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); }
.pp-row.done { opacity: .55; cursor: default; }
.pp-row b { display: block; font-weight: 600; }
.pp-row small { color: var(--muted); font-size: 12.5px; }
.pp-came { margin-top: 12px; }
/* The tools by the name keep their words on one line and wrap as buttons instead. */
.c-tools { flex-wrap: wrap; }
.tool-btn { white-space: nowrap; }

/* Contact page: the rating under the name, and buttons with icons. */
.c-head .rate { margin-top: 10px; }
.btn.reach, .c-adds .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.ic { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.c-adds .ic { color: var(--brand); }
/* Phones: smaller, squarer buttons. */
@media (max-width: 640px) {
  .tool-btn, .c-adds .btn, .btn.reach { height: 30px; padding: 0 10px; border-radius: 8px; font-size: 12.5px; gap: 5px; }
  .btn.reach { height: 36px; }
  .tool-btn svg, .ic { width: 14px; height: 14px; }
  .c-adds { gap: 6px; }
  .c-head .rate select { height: 30px; font-size: 13px; border-radius: 8px; }
}
/* With the rating moved under the name, the actions need their own space. */
.c-adds { margin: 18px 0 28px; }

/* Section headers: + Add on the right; empty sections say so. */
.sec-h .aside { display: inline-flex; align-items: baseline; gap: 14px; }
.sec-add { padding: 0; border: 0; background: none; color: var(--brand); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.sec-add:hover { text-decoration: underline; }
.empty-line { margin: 14px 0 4px; color: var(--muted); font-size: 13.5px; }
.sec-foot { margin: 12px 0 0; font-size: 13px; }
.reveal-form { display: grid; gap: 10px; margin-top: 14px; }
.reveal-form[hidden], #hEdit[hidden] { display: none; }
#hEdit { margin-top: 10px; }
/* History: one panel, quieter day labels. */
.hist { margin-top: 12px; padding: 4px 16px 6px; border: 1px solid var(--rule); border-radius: 12px; background: var(--surface); }
.hist .day { margin: 0; padding: 14px 0 6px; border: 0; font-size: 11px; color: var(--muted); }
.hist .day span { letter-spacing: .08em; }
.hist .entry:last-child { border-bottom: 0; }
.hist .what > b.folded { display: block; max-height: 4.6em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent); }
.hist .what > b.folded.open { max-height: none; -webkit-mask-image: none; mask-image: none; }
.more-btn { display: block; margin: 2px 0 4px; font-size: 12.5px; }
.e-tags { display: flex; margin: 6px 0 2px; }
/* Phones: an entry's buttons get their own line, so the text has the width. */
@media (max-width: 640px) {
  .entry .x { grid-column: 1 / -1; justify-self: end; }
  .hist { padding: 2px 12px 4px; }
}

/* Edit and Change links are blue; in the rows under the name they sit on their own line. */
.link.edit-link { color: var(--brand); }
.link.edit-link:hover { color: var(--brand-hover); text-decoration: underline; }
.how-v .edit-link { display: block; width: fit-content; margin-top: 3px; font-size: 13px; }

/* Contact header: Back and Edit on one line; a small row of controls under the details. */
.c-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.c-top .crumb { margin-bottom: 0; }
.c-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 12px; }
.c-ctl .rate select { height: 30px; padding: 0 30px 0 12px; font-size: 13px; border-radius: 8px; }
.c-ctl .rate::after { right: 12px; width: 6px; height: 6px; margin-top: -5px; }
.c-head .c-ctl .rate { margin-top: 0; }
.c-ctl .tool-btn, .c-top .tool-btn { height: 28px; padding: 0 10px; border-radius: 8px; font-size: 12.5px; }
.c-ctl .tool-btn svg, .c-top .tool-btn svg { width: 14px; height: 14px; }
.c-dnc { font-size: 13px; }

/* Party names read as links. */
.party-link, .entry .what a.party-link { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
/* Previews of a contact, party or group. */
.drawer.peek .dr-b { padding-top: 6px; }
.pk-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 14px; }
.pk-row { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-top: 1px solid var(--rule); font-size: 14px; }
.pk-row > span { color: var(--muted); font-size: 12.5px; padding-top: 1px; }
.pk-row small { display: block; color: var(--muted); margin-top: 2px; }
.pk-row a { color: var(--brand); }
.pk-row .h-chips { margin: 0; }
.pk-row small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Change / Edit / Full chain on the same line as what they change. */
.how-v .edit-link { display: inline; width: auto; margin: 0 0 0 8px; font-size: 13px; }
.how-path { display: inline; margin: 0 0 0 10px; }
.how-path[open] { display: block; margin: 4px 0 0; }
/* History: one ⋯ button for an entry's Edit / Delete. */
.entry .x.acts { gap: 0; }
.acts-dots { display: inline-grid; place-items: center; width: 32px; height: 28px; padding: 0; border: 1px solid transparent; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
.acts-dots:hover, .acts-dots[aria-expanded="true"] { border-color: var(--rule-strong); color: var(--ink); }
.acts-dots svg { width: 18px; height: 18px; fill: currentColor; }
.how-says { color: var(--ink-2); }

/* Already connected: Edit relation instead of a second connection. */
.pick-list .pick-existing .pick-edit { color: var(--brand); font-weight: 500; }
.how-me { color: var(--ink); }

/* Contact page: Log communication, Add follow-up and More on one line. */
.c-adds { flex-wrap: nowrap; }
.c-adds .btn { flex: 1 1 auto; min-width: 0; white-space: nowrap; }
.c-adds #moreHere { flex: 0 0 auto; }
@media (max-width: 400px) { .c-adds .btn { padding: 0 8px; font-size: 12px; gap: 4px; } }

.chg-more { margin-top: 10px; }
/* Details under the name. */
.c-info { margin-top: 12px; max-width: 640px; }
.c-info .kv { grid-template-columns: 96px minmax(0, 1fr); font-size: 14px; }
.c-info .kv dt, .c-info .kv dd { padding: 6px 0; }
.c-info .kv > div:last-child dt, .c-info .kv > div:last-child dd { border-bottom: 0; }
.c-info .kv dd > span[style] { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Health concerns editor, under the tags at the top. */
.h-inline { margin: 4px 0 14px; padding: 14px 16px; border: 1px solid var(--rule-strong); border-radius: 12px; background: var(--surface); }
.h-inline .chips { margin-bottom: 10px; }
.h-note-top { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; white-space: pre-wrap; }
/* Map: Leaflet's own CSS loads later and makes marker icons display:block, which pushed the count to the corner. */
.leaflet-marker-icon.mk-cluster { display: grid; place-items: center; }
.leaflet-marker-icon.mk-cluster span { display: block; line-height: 1; font-size: 14px; font-weight: 700; color: #fff; text-shadow: 0 1px 2px rgba(10, 40, 80, .45); }
/* Hot and warm on phones: the first 3, then Show more. */
.hw-more { display: none; margin-top: 10px; }
@media (max-width: 640px) {
  .hw-fold:not(.open) .mob-more { display: none; }
  .hw-more { display: block; }
}
@media (max-width: 640px) {
  /* Compact rows: name and rating, last contact on the right; what's next underneath. */
  .hw-fold a.tr { grid-template-columns: minmax(0, 1fr) auto; gap: 3px 10px; padding-top: 9px; padding-bottom: 9px; align-items: baseline; }
  .hw-fold a.tr .td.b { grid-column: 1; grid-row: 1; min-width: 0; }
  .hw-fold a.tr .td.b .sub { display: inline; margin-left: 6px; }
  .hw-fold a.tr .td.muted { grid-column: 2; grid-row: 1; font-size: 12.5px; text-align: right; white-space: nowrap; }
  .hw-fold a.tr .td:last-child { grid-column: 1 / -1; grid-row: 2; font-size: 13px; }
}

/* List previews. */
.pk-count { margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.pk-h { margin: 14px 0 4px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.pk-h:first-child { margin-top: 0; }
.pk-list { display: grid; }
.pk-li { padding: 9px 0; border-top: 1px solid var(--rule); min-width: 0; }
.pk-li:first-child { border-top: 0; }
.pk-li a { color: var(--brand); font-weight: 500; text-decoration: none; }
.pk-li small { display: block; margin-top: 2px; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-more { margin-top: 8px; }

/* Overview buttons: one row. */
.ov-acts { flex-wrap: nowrap; }
.ov-acts .btn { flex: 1 1 auto; min-width: 0; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.ov-acts .ov-more { flex: 0 0 auto; }
@media (max-width: 640px) {
  .ov-acts { gap: 6px; }
  .ov-acts .btn { height: 34px; padding: 0 9px; font-size: 12.5px; border-radius: 8px; }
  .ov-acts .ov-more span { display: none; }
  /* Phone order. */
  .ov-flow { display: flex; flex-direction: column; }
  .ov-flow > .cols { display: contents; }
  .ov-o1 { order: 1; } .ov-o2 { order: 2; } .ov-o3 { order: 3; } .ov-o4 { order: 4; } .ov-o5 { order: 5; }
  .ov-o6 { order: 6; } .ov-o7 { order: 7; } .ov-o8 { order: 8; } .ov-o9 { order: 9; } .ov-o10 { order: 10; }
  .ov-flow > .sec, .ov-flow > .cols > .sec { margin-top: 28px; }
}
@media (max-width: 640px) {
  .ov-acts .btn { flex: 0 1 auto; padding: 0 8px; font-size: 12px; }
  .ov-acts .btn:not(.ov-more) { flex-grow: 1; }
  .ov-acts .ov-more { width: 34px; padding: 0; }
}

/* Every text link is blue (red for delete). */
.link, .link.quiet { color: var(--brand); }
.link:hover, .link.quiet:hover { color: var(--brand-hover); }
.link { text-decoration-color: color-mix(in srgb, var(--brand) 35%, transparent); }
.link.danger { color: var(--err); }
/* What Show again brought back. */
@keyframes flashIn { 0%, 30% { background: color-mix(in srgb, var(--brand) 16%, transparent); box-shadow: inset 3px 0 0 var(--brand); } 100% { background: transparent; box-shadow: inset 3px 0 0 transparent; } }
.flash { animation: flashIn 2.6s ease-out; border-radius: 8px; }

/* Inventory: Last 30 days as three tiles. */
.flow-row { grid-template-columns: 120px repeat(3, minmax(0, 1fr)); }
.flow-row .flow-step:last-child { background: color-mix(in srgb, var(--fc) 8%, transparent); }
.flow-row .flow-step:last-child b { color: var(--fc); }
@media (max-width: 640px) {
  .flow-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; border-bottom: 0; }
  .flow-row > .label { grid-column: 1 / -1; padding: 12px 0 0; }
  .flow-step, .flow-step:first-of-type, .flow-row .flow-step:last-child { display: grid; grid-template-columns: 1fr; gap: 2px; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--fc) 25%, var(--rule)); border-radius: 12px; background: color-mix(in srgb, var(--fc) 8%, var(--surface)); }
  .flow-step .fs-l { grid-column: 1; font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
  .flow-step b { grid-column: 1; text-align: left; font-size: 22px; }
  .flow-step small { display: block; grid-column: 1; text-align: left; margin: 0; font-size: 11.5px; }
  .flow-row .flow-step:last-child .fs-l { font-weight: 500; color: var(--ink-2); }
  /* Patches: long narrow rows instead of cards. */
  .patch-grid { gap: 8px; }
  .patch { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; padding: 12px 14px 12px 18px; border-radius: 12px; }
  .patch::before { top: 0; bottom: 0; left: 0; right: auto; width: 4px; height: auto; }
  .patch:hover { transform: none; }
  .patch header { grid-column: 1; grid-row: 1; justify-content: flex-start; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
  .patch header .st { padding: 2px 8px; font-size: 11px; }
  .patch-figure { grid-column: 2; grid-row: 1; gap: 5px; }
  .patch-figure .num { font-size: 26px; }
  .patch-figure span:last-child { font-size: 10.5px; }
  .patch .stock-bar { grid-column: 1 / -1; grid-row: 2; }
  .patch-facts { display: none; }
  .patch footer { grid-column: 1 / -1; grid-row: 3; padding-top: 2px; gap: 8px; }
  .patch footer .btn { height: 28px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; }
}

/* Squarer buttons everywhere. */
.btn { border-radius: 10px; }
.btn.sm { border-radius: 8px; }
.seg { border-radius: 10px; }
.seg button { border-radius: 8px; }
/* Completed follow-ups: a bigger chevron. */
.fu-acc summary::before { font-size: 18px; width: 20px; line-height: 1; vertical-align: -2px; }
/* Go to ↗ */
.peek [data-save] { display: inline-flex; align-items: center; gap: 8px; }
.go-ic { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* Overview period switch. */
.ov-period-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ov-period-h > h2.section-label { margin: 0; padding: 0; border: 0; }
.ov-period { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--rule-strong); background: var(--surface); }
.ov-period button { height: 28px; padding: 0 12px; border: 0; background: none; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.ov-period button.on { background: var(--brand); color: #fff; }
@media (max-width: 640px) {
  /* New phone order: Hot and warm, then Pipeline, then Recent activity at the end. */
  .ov-o3 { order: 9; } .ov-o10 { order: 10; } .ov-o9 { order: 11; }
  /* More room. */
  .ov-flow > .sec, .ov-flow > .cols > .sec { margin-top: 40px; }
  .ov-flow > .section-label, .ov-flow > .ov-period-h { margin-top: 44px; }
  .ov-flow .sec-b { padding: 18px 16px; }
  .ov-flow .figs { gap: 12px; }
  #ovToday .sec-b { padding: 18px 16px; }
}
/* Inventory tabs: fixed, never a sideways scroll. */
.subnav[aria-label="Inventory"] { flex-wrap: wrap; overflow: visible; row-gap: 0; column-gap: 20px; }
.subnav[aria-label="Inventory"] a { white-space: normal; }
/* More space between patches. */
.patch-grid { gap: 18px; }
@media (max-width: 640px) { .patch-grid { gap: 12px; } }
/* Low stock: no glow. A quiet amber note; red only at 1 sleeve or less. */
.patch.low, .patch.out, .patch.low:hover, .patch.out:hover { border-color: var(--rule); box-shadow: none; }
.patch.low::before, .patch.out::before, .patch.low .patch-name::before, .patch.out .patch-name::before, .patch.low .patch-figure .num, .patch.out .patch-figure .num { opacity: 1; }
.patch.low .patch-figure .num { color: #C27A14; }
.patch.crit, .patch.crit:hover { border-color: rgba(194, 54, 42, .55); background: color-mix(in srgb, var(--err) 5%, var(--surface)); }
.patch.crit .patch-figure .num { color: var(--err); }
/* Delivery receipt. */
.rcpt { display: grid; gap: 0; font-size: 14.5px; }
.rcpt-top { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 10px; margin-bottom: 4px; border-bottom: 1px dashed var(--rule-strong); color: var(--muted); font-size: 13px; }
.rcpt-line { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dotted var(--rule); }
.rcpt-line b { font-weight: 600; white-space: nowrap; }
.rcpt-total { border-bottom: 0; border-top: 1px solid var(--ink-2); margin-top: 4px; font-weight: 600; }
.rcpt-note { margin: 10px 0 0; padding: 10px 12px; background: var(--tint); border-radius: 8px; color: var(--ink-2); white-space: pre-wrap; }
.rcpt-by { margin: 12px 0 0; color: var(--muted); font-size: 12.5px; }
/* A search list inside a popup: room for it below the box, so it isn't cut off by the buttons. */
.drawer .pc-open { padding-bottom: 270px; }
/* The alert at the top: on phones the button goes under the words instead of squeezing them. */
@media (max-width: 640px) {
  .status { flex-wrap: wrap; align-items: flex-start; }
  .status-t { flex: 1 1 calc(100% - 52px); }
  .status.due .btn { margin-left: 52px; }
}
/* Most received: sleeves with their unit, with room on the right. */
.most-rec .tr { padding-right: 12px; }
.most-rec .td.n { white-space: nowrap; font-weight: 600; color: var(--ink-2); }
@media (max-width: 640px) {
  .most-rec .tr { grid-template-columns: minmax(0, 1fr) auto !important; align-items: center; padding: 14px 14px 14px 12px; }
  .most-rec .td.n { font-size: 14px; padding-left: 12px; }
}

/* Name line: who added them, and Do not contact. */
.c-title h1 { margin: 0; }
.c-by { font-size: 12.5px; color: var(--muted); }
.c-title .c-dnc { font-size: 13px; }
/* One colour per patch. */
.p-dot { display: inline-block; width: 9px; height: 9px; margin-right: 8px; border-radius: 50%; background: var(--pc); vertical-align: 1px; }
.tr.p-tint { background: color-mix(in srgb, var(--pc) 7%, transparent); }
.tr.p-tint + .tr.p-tint { border-top-color: color-mix(in srgb, var(--pc) 18%, var(--rule)); }
/* See in Connections, right under the graph. */
.ego-foot { margin: 6px 0 14px; text-align: right; }
/* Mark who came: white with a blue glow. */
.btn.glow { background: var(--surface); color: var(--ink); border-color: #BFDDF5; box-shadow: 0 0 0 3px rgba(31, 138, 214, .10), 0 4px 14px rgba(31, 138, 214, .22); }
.btn.glow:hover { border-color: var(--brand); }
.today-row .btn.sm { height: 30px; padding: 0 12px; font-size: 12.5px; }
/* Switching 7 / 30 days. */
.ov-switching .ov-flow { opacity: .55; transition: opacity .15s; }
/* Close with an ✕. */
.dr-x { display: inline-flex; align-items: center; gap: 5px; }
.dr-x svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.drawer.no-foot .dr-f { display: none; }
@media (max-width: 640px) {
  /* Overview sections read as separate cards. Today stays compact inside. */
  .ov-flow > .sec, .ov-flow > .cols > .sec, #ovToday > .sec { background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; padding: 14px 14px 6px; box-shadow: 0 2px 10px rgba(20, 40, 70, .05); }
  .ov-flow .sec-b { padding: 6px 0 12px; }
  #ovToday .sec-b { padding: 4px 0 8px; }
  .ov-flow .sec-h, #ovToday .sec-h { padding-bottom: 10px; }
  .ov-flow .figs { margin-top: 4px; }
}

/* Intro tour. */
.drawer.intro { max-width: 460px; }
@media (min-width: 760px) { .drawer.intro.modal { width: min(460px, calc(100vw - 48px)); } }
.drawer.intro .dr-h { border-bottom: 0; padding-bottom: 0; }
.drawer.intro .dr-b { padding-top: 8px; text-align: left; }
.intro-ic { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: var(--brand-tint); color: var(--brand); margin-bottom: 4px; }
.intro-ic svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.intro-b { margin: 0; font-size: 15px; line-height: 1.55; color: var(--ink-2); }
.intro-dots { display: flex; gap: 6px; margin-top: 8px; }
.intro-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--rule-strong); }
.intro-dots i.on { width: 20px; border-radius: 4px; background: var(--brand); }
.intro-back { margin-right: auto; }
