/* Components. Load after tokens.css and base.css. Every component reads
   the sheet variables (--fg, --fg-muted, --rule, --field-bg, --chip-bg), so
   it looks right on white, black and every coloured sheet.
   The gallery (system/index.html) shows each one in light and dark. */

/* ================================================================ icons */
.i { width: 20px; height: 20px; flex: none; }
.i--sm { width: 16px; height: 16px; }
.i--lg { width: 24px; height: 24px; }

/* ================================================================ buttons
   One pill. Ink is the default primary; green for Shop, burgundy for
   Member, yellow for the one spark action on a page. */
.btn {
  --b-bg: var(--fg);
  --b-fg: var(--on-fg);
  --b-bd: transparent;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--tap); padding: 0 22px;
  border-radius: var(--r-pill); border: 1px solid var(--b-bd);
  background: var(--b-bg); color: var(--b-fg);
  font-family: var(--font-ui); font-size: 15px; font-weight: var(--w-semi); letter-spacing: -0.01em; line-height: 1;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: transform var(--t-fast) var(--ease-out), background var(--t-base), color var(--t-base), border-color var(--t-base), opacity var(--t-base);
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: scale(0.97); }
.btn .i { width: 18px; height: 18px; }
.btn .go { transition: transform var(--t-base) var(--ease-out); }
.btn:hover .go { transform: translateX(3px); }
.btn--ink { --b-bg: var(--ink); --b-fg: var(--bg); }
.btn--shop { --b-bg: var(--btn-shop-bg); --b-fg: var(--btn-shop-fg); }
.btn--member { --b-bg: var(--burgundy); --b-fg: var(--on-member); }
.btn--spark { --b-bg: var(--yellow); --b-fg: #111411; }
.btn--lime { --b-bg: var(--lime); --b-fg: #111411; }
/* fixed brand fills for dark sheets (the footer doors): same in both themes */
.btn--leaf { --b-bg: #2e7d32; --b-fg: #ffffff; }
.btn--wine { --b-bg: #722f37; --b-fg: #ffffff; }
.btn--light { --b-bg: #f4f6f1; --b-fg: #0f2a12; }
.btn--line { --b-bg: transparent; --b-fg: var(--fg); --b-bd: var(--line-strong); }
.sheet--deep .btn--line, .sheet--burgundy .btn--line, .sheet--green .btn--line, .sheet--ink .btn--line { --b-bd: var(--rule); }
.btn--line:hover { --b-bg: var(--chip-bg); filter: none; }
.btn--ghost { --b-bg: var(--chip-bg); --b-fg: var(--fg); }
.btn--ghost:hover { filter: none; --b-bg: var(--rule); }
.btn--danger { --b-bg: var(--danger); --b-fg: var(--on-danger); }
.btn--sm { min-height: 40px; padding: 0 16px; font-size: 13.5px; }
.btn--sm::after { content: ""; position: absolute; inset: -2px 0; }   /* 44px hit area */
.btn--lg { min-height: 56px; padding: 0 30px; font-size: 16px; }
.btn--block { display: flex; width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.38; cursor: not-allowed; transform: none; filter: none; }
.btn.is-loading { color: transparent; pointer-events: none; }
.btn.is-loading::before { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--b-fg); border-right-color: transparent; animation: spin 700ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* round icon button */
.btn-round {
  display: inline-grid; place-items: center; flex: none;
  width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid var(--rule); background: var(--field-bg); color: var(--fg);
  cursor: pointer; transition: background var(--t-base), transform var(--t-fast);
}
.btn-round:hover { background: var(--chip-bg); }
.btn-round:active { transform: scale(0.95); }
.btn-round--ink { background: var(--ink); color: var(--bg); border-color: transparent; }
.btn-round--sm { width: 40px; height: 40px; }
.btn-round .i { width: 18px; height: 18px; }

/* quiet text link with an arrow */
.link { display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); color: var(--fg); font-weight: var(--w-semi); text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 0.25em; transition: text-decoration-color var(--t-base); }
.link:hover { text-decoration-color: currentColor; }
.link--accent { color: var(--accent); }
.link .i { width: 16px; height: 16px; transition: transform var(--t-base) var(--ease-out); }
.link:hover .i { transform: translateX(2px); }

/* ================================================================ pills, chips, tags, status */
.pills { display: inline-flex; gap: 2px; padding: 4px; border-radius: var(--r-pill); background: var(--glass); }
.pills > a, .pills > button { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--fg); font-size: 13.5px; font-weight: var(--w-semi); text-decoration: none; transition: background var(--t-base), color var(--t-base); }
.pills > a:hover, .pills > button:hover { background: var(--chip-bg); }
.pills > [aria-current], .pills > [aria-pressed="true"] { background: var(--fg); color: var(--on-fg); }

.chip {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: var(--tap); padding: 0 18px; border: 1px solid transparent; border-radius: var(--r-pill);
  background: var(--chip-bg); color: var(--fg);
  font-size: 13.5px; font-weight: var(--w-semi); white-space: nowrap; cursor: pointer; text-decoration: none;
  transition: background var(--t-base), color var(--t-base), border-color var(--t-base);
}
.chip:hover { border-color: var(--rule); }
.chip[aria-pressed="true"], .chip[aria-current], .chip.is-on { background: var(--fg); color: var(--on-fg); }
.sheet--mint .chip[aria-pressed="true"] { background: var(--accent-deep); color: #fff; }
.chip .count { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.04em; color: var(--fg-muted); }
.chip[aria-pressed="true"] .count, .chip[aria-current] .count, .chip.is-on .count { color: inherit; }
.chip .x { width: 16px; height: 16px; opacity: 0.6; }
.chip--sm { min-height: 32px; padding: 0 12px; font-size: 12.5px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-row--scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); scroll-padding-inline: var(--gutter); }
.chip-row--scroll::-webkit-scrollbar { display: none; }

/* mono tag that floats on imagery: "N° 01 · CAPSULES" */
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: var(--r-pill); background: var(--glass); color: var(--ink); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); font-family: var(--font-mono); font-size: var(--fs-mono); font-weight: 500; letter-spacing: var(--tracking-mono); text-transform: uppercase; line-height: 1.2; }
.tag--spark { background: var(--yellow); color: #111411; }

/* status: paid, pending, failed, reversed, held, active, suspended... */
.status { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px 5px 9px; border-radius: var(--r-pill); background: var(--chip-bg); color: var(--fg); font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; line-height: 1.2; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.status--paid, .status--success, .status--active, .status--verified, .status--delivered { background: var(--success-tint); color: var(--success); }
.status--pending, .status--processing, .status--review { background: var(--yellow-tint); color: var(--warning-ink); }
.status--pending::before { background: var(--yellow); box-shadow: 0 0 0 0 rgba(242, 194, 48, 0.6); animation: pulse 1.8s var(--ease-out) infinite; }
.status--failed, .status--error, .status--suspended, .status--cancelled { background: var(--danger-tint); color: var(--danger); }
.status--reversed, .status--refunded, .status--member { background: var(--burgundy-tint); color: var(--member-ink); }
.status--held { background: var(--yellow-tint); color: var(--held); }
.status--held::before { border-radius: 2px; }
.status--neutral, .status--draft, .status--shipped { background: var(--chip-bg); color: var(--fg-muted); }
@keyframes pulse { 70% { box-shadow: 0 0 0 6px rgba(242, 194, 48, 0); } 100% { box-shadow: 0 0 0 0 rgba(242, 194, 48, 0); } }

/* count badge (bag, notifications) */
.badge { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--yellow); color: #111411; font-family: var(--font-mono); font-size: 11px; font-weight: 500; line-height: 20px; text-align: center; box-shadow: 0 0 0 2px var(--bg); }
.badge.is-bump { animation: bump 420ms var(--ease-out); }
@keyframes bump { 30% { transform: scale(1.35); } }

/* rank chip: the yellow spark */
.rank-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 10px 0 8px; border-radius: var(--r-pill); background: var(--yellow); color: #111411; font-size: 12.5px; font-weight: var(--w-semi); }
.rank-chip .i { width: 14px; height: 14px; }
.pkg-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 10px; border-radius: var(--r-pill); background: var(--burgundy-tint); color: var(--member-ink); font-size: 12.5px; font-weight: var(--w-semi); }

/* ================================================================ price and PV */
.price { font-weight: var(--w-semi); letter-spacing: -0.01em; white-space: nowrap; }
.price--lg { font-size: clamp(26px, 2.6vw, 34px); letter-spacing: -0.035em; font-weight: var(--w-bold); }
.price--was { color: var(--fg-muted); text-decoration: line-through; font-weight: var(--w-regular); }
.pv { display: inline-flex; align-items: center; min-height: 24px; padding: 0 9px; border-radius: var(--r-pill); background: var(--green-tint); color: var(--pv-ink); font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.04em; white-space: nowrap; }
.sheet--mint .pv { background: var(--bg); }
.pv--member { background: var(--burgundy-tint); color: var(--member-ink); }
.pv--on-dark { background: rgba(255, 255, 255, 0.12); color: inherit; }
.price-pv { display: inline-flex; align-items: center; gap: 10px; }
.amount { font-weight: var(--w-semi); white-space: nowrap; }
.amount--in { color: var(--earn); }
.amount--out { color: var(--member-ink); }
.amount--held { color: var(--held); }

/* ================================================================ forms */
.field { display: grid; gap: 8px; align-content: start; }
.field__label { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 14px; font-weight: var(--w-semi); color: var(--fg); }
.field__label .mono { color: var(--fg-muted); font-weight: 500; }
.field__control { position: relative; display: flex; align-items: center; }
.input, .select, .textarea {
  width: 100%; min-height: var(--control); padding: 0 16px;
  border: 1px solid var(--line-strong); border-radius: var(--r-field);
  background: var(--field-bg); color: var(--fg);
  font-size: 16px; font-weight: var(--w-regular); letter-spacing: -0.005em;
  transition: border-color var(--t-base), box-shadow var(--t-base), background var(--t-base);
  -webkit-appearance: none; appearance: none;
}
.sheet--deep .input, .sheet--burgundy .input, .sheet--green .input, .sheet--ink .input,
.sheet--deep .select, .sheet--burgundy .select, .sheet--green .select, .sheet--ink .select { border-color: var(--rule); }
.textarea { min-height: 120px; padding: 14px 16px; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: color-mix(in srgb, currentColor 62%, transparent); }   /* follows the field's own ink, so a white field on a dark sheet still reads */
:is(.sheet--green, .sheet--burgundy) :is(.input, .textarea)::placeholder { color: color-mix(in srgb, currentColor 85%, transparent); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--fg-muted); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--shadow-focus); }
.input:disabled, .select:disabled { opacity: 0.5; cursor: not-allowed; }
.input[readonly] { background: var(--chip-bg); border-style: dashed; }
.select { padding-right: 46px; cursor: pointer; background-image: none; }
.field__control .chev { position: absolute; right: 16px; width: 18px; height: 18px; pointer-events: none; color: var(--fg-muted); }
.field__control .prefix { position: absolute; left: 16px; color: var(--fg-muted); font-size: 16px; pointer-events: none; }
.field__control.has-prefix .input { padding-left: calc(16px + var(--prefix-w, 14px) + 6px); }
.field__control .action { position: absolute; right: 6px; }
.field__control.has-action .input { padding-right: 54px; }
.field__hint { font-size: 13px; line-height: 1.45; color: var(--fg-muted); }
.field__msg { display: none; align-items: flex-start; gap: 8px; font-size: 13.5px; line-height: 1.4; font-weight: var(--w-medium); }
.field__msg .i { width: 16px; height: 16px; margin-top: 1px; }
.field.is-error .input, .field.is-error .select, .field.is-error .textarea { border-color: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 16%, transparent); }
.field.is-error .field__msg--error { display: flex; color: var(--danger); }
.field.is-success .input, .field.is-success .select { border-color: var(--success); }
.field.is-success .field__msg--success { display: flex; color: var(--success); }
.field.is-error .field__label { color: var(--danger); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-5) var(--s-4); }
.form-grid > .span-2 { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }
.fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: var(--s-5); }
.fieldset > legend { padding: 0; margin-bottom: var(--s-4); }

/* checkbox and radio */
.check { position: relative; display: block; min-height: var(--tap); padding: 10px 0 10px 34px; cursor: pointer; font-size: 15px; line-height: 1.45; }
.check input { position: absolute; left: 0; top: 10px; -webkit-appearance: none; appearance: none; width: 22px; height: 22px; margin: 0; border: 1.5px solid var(--line-strong); border-radius: 7px; background: var(--field-bg); display: grid; place-items: center; cursor: pointer; transition: background var(--t-base), border-color var(--t-base); }
.check input[type="radio"] { border-radius: 50%; }
.check input::after { content: ""; width: 10px; height: 6px; border: 2px solid var(--bg); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px) scale(0); transition: transform var(--t-fast) var(--ease-out); }
.check input[type="radio"]::after { width: 8px; height: 8px; border: 0; border-radius: 50%; background: var(--bg); transform: scale(0); }
.check input:checked { background: var(--fg); border-color: var(--fg); }
.check input:checked::after { transform: rotate(-45deg) translate(1px, -1px) scale(1); }
.check input[type="radio"]:checked::after { transform: scale(1); }
.check input:focus-visible { box-shadow: var(--shadow-focus); outline: none; }
.field.is-error .check input { border-color: var(--danger); }
.check a { color: var(--fg); }

/* switch */
.switch { display: inline-flex; align-items: center; gap: 12px; min-height: var(--tap); cursor: pointer; font-size: 15px; }
.switch input { -webkit-appearance: none; appearance: none; position: relative; width: 46px; height: 28px; margin: 0; border-radius: 14px; background: var(--line-strong); cursor: pointer; transition: background var(--t-base); flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform var(--t-base) var(--ease-out); }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(18px); }

/* search: a pill */
.search { position: relative; display: flex; align-items: center; }
.search .i { position: absolute; left: 16px; width: 18px; height: 18px; color: var(--fg-muted); pointer-events: none; }
.search .input { border-radius: var(--r-pill); padding-left: 46px; min-height: 48px; background: var(--chip-bg); border-color: transparent; }
.search .input:focus { background: var(--field-bg); }
.search kbd { position: absolute; right: 12px; font-family: var(--font-mono); font-size: 11px; color: var(--fg-muted); padding: 2px 7px; border: 1px solid var(--rule); border-radius: 6px; }

/* one-time code (MFA, OTP) */
.otp { display: flex; gap: 8px; }
.otp input { width: 48px; height: 58px; padding: 0; text-align: center; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--field-bg); font-family: var(--font-mono); font-size: 22px; font-weight: 500; }
.otp input:focus { outline: none; border-color: var(--accent); box-shadow: var(--shadow-focus); }
@media (max-width: 380px) { .otp input { width: 42px; height: 52px; } }

/* ---------------------------------------------------------------- sponsor live check
   data-state: idle | checking | found | missing | empty (submitted blank) */
.sponsor .field__control { --prefix-w: 13px; }
.sponsor__state { position: absolute; right: 16px; display: grid; place-items: center; width: 22px; height: 22px; pointer-events: none; }
.sponsor__state .spinner { width: 18px; height: 18px; }
.sponsor__state .i { width: 20px; height: 20px; }
.sponsor__state > * { display: none; }
.sponsor[data-state="checking"] .sponsor__state .spinner,
.sponsor[data-state="found"] .sponsor__state .ok,
.sponsor[data-state="missing"] .sponsor__state .no,
.sponsor[data-state="empty"] .sponsor__state .no { display: block; }
.sponsor .ok { color: var(--success); }
.sponsor .no { color: var(--danger); }
.sponsor .input { padding-right: 48px; }
.sponsor__who { display: none; align-items: center; gap: 12px; padding: 10px 14px 10px 10px; border-radius: 14px; background: var(--success-tint); color: var(--success); animation: rise var(--t-slow) var(--ease-out); }
.sponsor__who .avatar { width: 34px; height: 34px; font-size: 12px; }
.sponsor__who b { display: block; color: var(--fg); font-weight: var(--w-semi); font-size: 15px; letter-spacing: -0.01em; }
.sponsor__who .mono { color: var(--success); }
.sponsor[data-state="found"] .input { border-color: var(--success); }
.sponsor[data-state="found"] .sponsor__who { display: flex; }
.sponsor[data-state="missing"] .input, .sponsor[data-state="empty"] .input { border-color: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 16%, transparent); }
.sponsor[data-state="missing"] .field__label, .sponsor[data-state="empty"] .field__label { color: var(--danger); }
.sponsor__msg { display: none; gap: 8px; align-items: flex-start; font-size: 13.5px; line-height: 1.4; font-weight: var(--w-medium); color: var(--danger); }
.sponsor__msg .i { width: 16px; height: 16px; margin-top: 1px; }
.sponsor[data-state="missing"] .sponsor__msg--missing, .sponsor[data-state="empty"] .sponsor__msg--empty { display: flex; animation: rise var(--t-slow) var(--ease-out); }
.sponsor[data-state="empty"] .input { animation: nudge 360ms var(--ease-out); }
@keyframes nudge { 20% { transform: translateX(-5px); } 45% { transform: translateX(4px); } 70% { transform: translateX(-2px); } }
@keyframes rise { from { opacity: 0; transform: translateY(-4px); } }

/* ---------------------------------------------------------------- placement
   Shows only "Right". Left lives inside the native dropdown, so it never
   draws the eye (meeting 49:17 to 50:58). A fixed slot (from the genealogy
   "+") renders as a locked value instead. */
.placement .select { font-weight: var(--w-semi); }
.placement__fixed { display: flex; align-items: center; gap: 12px; min-height: var(--control); padding: 0 16px; border: 1px dashed var(--line-strong); border-radius: var(--r-field); background: var(--chip-bg); font-weight: var(--w-semi); }
.placement__fixed .i { color: var(--fg-muted); width: 16px; height: 16px; }
.placement__fixed .mono { margin-left: auto; color: var(--fg-muted); }

/* ================================================================ swatches (The Bloom's picker) */
.swatches { display: inline-flex; align-items: center; gap: 6px; padding: 6px 18px 6px 6px; border-radius: var(--r-pill); background: var(--glass); box-shadow: var(--shadow-float); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.swatch { position: relative; width: 44px; height: 44px; border-radius: 50%; border: 0; padding: 0; background: transparent; cursor: pointer; display: grid; place-items: center; }
.swatch::before { content: ""; width: 30px; height: 30px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--c) 55%, #fff), var(--c) 60%, color-mix(in srgb, var(--c) 70%, #000)); box-shadow: inset 0 -2px 4px rgba(0,0,0,.18); transition: transform var(--t-base) var(--ease-out); }
.swatch::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; border: 1.5px solid var(--fg); opacity: 0; transform: scale(0.8); transition: opacity var(--t-base), transform var(--t-base) var(--ease-out); }
.swatch[aria-pressed="true"]::after { opacity: 1; transform: none; }
.swatch:hover::before { transform: scale(1.08); }
.swatches__label { display: grid; margin-left: 8px; line-height: 1.2; }
.swatches__label b { font-size: 14px; font-weight: var(--w-semi); }
.swatches__label .mono { color: var(--fg-muted); font-size: 10px; }

/* ================================================================ tabs */
.tabs { display: inline-flex; gap: 2px; padding: 4px; border-radius: var(--r-pill); background: var(--chip-bg); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs [role="tab"] { flex: none; min-height: 40px; padding: 0 16px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--fg-muted); font-size: 13.5px; font-weight: var(--w-semi); white-space: nowrap; transition: background var(--t-base), color var(--t-base); }
.tabs [role="tab"]:hover { color: var(--fg); }
.tabs [role="tab"][aria-selected="true"] { background: var(--field-bg); color: var(--fg); box-shadow: 0 1px 2px rgba(17,20,17,.08), 0 0 0 1px var(--rule); }
.tabs [role="tab"] .count { font-family: var(--font-mono); font-size: 10px; margin-left: 6px; color: var(--fg-muted); }
.tabs--block { display: flex; }
.tabs--block [role="tab"] { flex: 1; }
/* underline tabs, for page sections */
.tabs--line { display: flex; gap: var(--s-6); padding: 0; border-radius: 0; background: none; border-bottom: 1px solid var(--rule); }
.tabs--line [role="tab"] { position: relative; padding: 0; min-height: 48px; border-radius: 0; }
.tabs--line [role="tab"][aria-selected="true"] { background: none; box-shadow: none; }
.tabs--line [role="tab"][aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--fg); border-radius: 2px; }
[role="tabpanel"]:focus-visible { outline-offset: 6px; }

/* ================================================================ avatar */
.avatar { --av: var(--avatar-bg); display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--av); color: #fff; font-size: 14px; font-weight: var(--w-bold); letter-spacing: -0.02em; text-transform: uppercase; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--sm { width: 30px; height: 30px; font-size: 11px; }
.avatar--lg { width: 64px; height: 64px; font-size: 22px; }
.avatar[data-tone="green"] { --av: var(--green-deep); }
.avatar[data-tone="gold"] { --av: #956f10; }
.avatar[data-tone="ink"] { --av: #2b322c; }
.avatar[data-tone="admin"] { --av: #111411; }

/* ================================================================ product card
   A studio tile: the packshot stands in soft leaf light; hovering turns
   the bottle to its three-quarter view. */
.pcard { --studio: var(--pc-studio); --fg: var(--ink); --fg-muted: var(--ink-muted); --fg-faint: var(--ink-faint); --rule: var(--line); --chip-bg: var(--surface); --field-bg: var(--raised); --on-fg: var(--bg); --accent: var(--green); color: var(--fg); position: relative; display: grid; grid-template-rows: auto 1fr; border-radius: var(--r-card); background: var(--studio); overflow: hidden; isolation: isolate; container-type: inline-size; }
.pcard[data-tint="red"] { --studio: var(--pc-studio-red); }
.pcard[data-tint="gold"] { --studio: var(--pc-studio-gold); }
.pcard[data-tint="green"] { --studio: var(--pc-studio-green); }
.pcard__media { position: relative; display: block; aspect-ratio: 4 / 5; overflow: hidden; background: radial-gradient(90% 70% at 50% 38%, color-mix(in srgb, var(--studio) var(--pc-glow-mix), var(--pc-glow)) 0%, var(--studio) 70%); }
.pcard__media::before { content: ""; position: absolute; inset: -10%; z-index: 0; background: var(--leaf, url("../assets/light/moringa.webp")) center / cover; mix-blend-mode: var(--leaf-blend); opacity: var(--leaf-opacity); transform: rotate(var(--leaf-turn, -8deg)); transition: transform 1600ms var(--ease-out); }
.pcard:hover .pcard__media::before { transform: rotate(var(--leaf-turn, -8deg)) translateX(2%); }
.pcard__media::after { content: ""; position: absolute; left: 22%; right: 22%; bottom: 7%; height: 6%; border-radius: 50%; background: radial-gradient(closest-side, var(--contact-shadow), transparent); z-index: 0; }
.pcard__media img { position: absolute; z-index: 1; left: 50%; bottom: 4%; height: 88%; width: auto; max-width: none; transform: translateX(-50%); transition: opacity 600ms var(--ease-out), transform 900ms var(--ease-out); }
.pcard__media img.alt { opacity: 0; }
.pcard:hover .pcard__media img:not(.alt), .pcard:focus-within .pcard__media img:not(.alt) { opacity: 0; transform: translateX(-50%) scale(1.02); }
.pcard:hover .pcard__media img.alt, .pcard:focus-within .pcard__media img.alt { opacity: 1; transform: translateX(-50%) scale(1.02); }
.pcard .tag { position: absolute; z-index: 2; left: 14px; top: 14px; }
.pcard .tag + .tag { left: auto; right: 14px; }
.pcard__body { display: grid; gap: 6px; align-content: start; padding: 4px 16px 16px; }
.pcard__name { margin: 0; font-size: 21px; font-weight: var(--w-bold); letter-spacing: -0.035em; line-height: 1.1; }
.pcard__name a { color: inherit; text-decoration: none; }
.pcard__name a::after { content: ""; position: absolute; inset: 0 0 72px; z-index: 3; }   /* the whole tile clicks through; the bag button stays its own */
.pcard__line { font-size: 13.5px; line-height: 1.45; color: var(--ink-muted); min-height: 2.9em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pricebar { position: relative; z-index: 4; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; padding: 4px 4px 4px 16px; border-radius: var(--r-pill); background: var(--glass); }
.pricebar .price-pv { gap: 8px; min-width: 0; }
.pricebar .btn { min-height: var(--tap); padding: 0 16px; font-size: 13.5px; }
.pricebar .btn.is-added { --b-bg: var(--ink); --b-fg: var(--bg); }
.pcard.is-out .pcard__media img { filter: grayscale(0.7) opacity(0.6); }
.pcard--wide { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr); grid-template-rows: none; align-items: center; }
.pcard--wide .pcard__body { padding: 24px; }
.pcard--wide .pcard__name { font-size: var(--fs-h2); }
@container (max-width: 230px) {
  .pcard__body { padding: 2px 12px 12px; }
  .pcard__name { font-size: 18px; }
  .pcard__line { display: none; }
  .pricebar { padding-left: 12px; }
  .pricebar .pv { display: none; }
}
.product-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
@media (max-width: 560px) { .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }

/* product image alone (gallery, line items): studio disc */
.pshot { --studio: var(--pc-studio); position: relative; display: block; aspect-ratio: 4 / 5; border-radius: var(--r-panel); background: radial-gradient(90% 70% at 50% 38%, color-mix(in srgb, var(--studio) var(--pc-glow-mix), var(--pc-glow)), var(--studio) 72%); overflow: hidden; }
.pshot img { position: absolute; left: 50%; bottom: 4%; height: 88%; width: auto; max-width: none; transform: translateX(-50%); }

/* ================================================================ quantity stepper */
.stepper { display: inline-flex; align-items: center; border-radius: var(--r-pill); background: var(--chip-bg); padding: 2px; }
.stepper button { width: var(--tap); height: var(--tap); border: 0; border-radius: 50%; background: transparent; color: var(--fg); display: grid; place-items: center; transition: background var(--t-base); }
.stepper button:hover:not(:disabled) { background: var(--field-bg); }
.stepper button:disabled { opacity: 0.3; cursor: not-allowed; }
.stepper button .i { width: 16px; height: 16px; }
.stepper output, .stepper input { min-width: 30px; width: 34px; padding: 0; border: 0; background: none; text-align: center; font-weight: var(--w-semi); font-variant-numeric: tabular-nums; font-size: 15px; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.stepper--sm button { width: 36px; height: 36px; }

/* ================================================================ line item (bag, checkout, orders) */
.line-item { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding-block: 14px; }
.line-item + .line-item { border-top: 1px solid var(--rule); }
.line-item .pshot { width: 76px; border-radius: 14px; }
.line-item__name { font-weight: var(--w-semi); letter-spacing: -0.02em; line-height: 1.25; text-decoration: none; color: inherit; }
.line-item__meta { color: var(--fg-muted); margin-top: 3px; }
.line-item__end { display: grid; justify-items: end; gap: 6px; }
.line-item__actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.line-item__remove { border: 0; background: none; color: var(--fg-muted); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; min-height: 36px; padding: 0 4px; }
.line-item__remove:hover { color: var(--danger); }

/* totals */
.totals { display: grid; gap: 10px; }
.totals > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; font-size: 15px; color: var(--fg-muted); }
.totals > div > :last-child { color: var(--fg); font-weight: var(--w-semi); font-variant-numeric: tabular-nums; }
.totals .grand { padding-top: 12px; border-top: 1px solid var(--rule); color: var(--fg); font-size: 17px; font-weight: var(--w-semi); }
.totals .grand > :last-child { font-size: 22px; font-weight: var(--w-bold); letter-spacing: -0.03em; }

/* ================================================================ overlays: scrim, drawer, sheet, modal */
.scrim { position: fixed; inset: 0; z-index: 60; background: var(--scrim); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); opacity: 0; transition: opacity var(--t-slow) var(--ease-out); }
.scrim.is-open { opacity: 1; }

.drawer {
  position: fixed; z-index: 61; top: var(--inset); right: var(--inset); bottom: var(--inset);
  width: min(460px, calc(100vw - 2 * var(--inset)));
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  border-radius: var(--r-sheet); background: var(--bg); color: var(--ink); box-shadow: var(--shadow-pop);
  transform: translateX(calc(100% + 24px)); transition: transform var(--t-sheet) var(--ease-drawer);
}
.drawer.is-open { transform: none; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 22px 22px 12px 26px; }
.drawer__head h2 { font-size: 34px; letter-spacing: -0.055em; line-height: 0.95; }
.drawer__body { overflow-y: auto; overscroll-behavior: contain; padding: 4px 26px 12px; }
.drawer__foot { display: grid; gap: 14px; padding: 18px 26px 24px; border-top: 1px solid var(--line); }
@media (max-width: 640px) {
  .drawer { top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: 92svh; border-radius: var(--r-sheet) var(--r-sheet) 0 0; transform: translateY(102%); padding-bottom: env(safe-area-inset-bottom, 0px); }
  .drawer::before { content: ""; position: absolute; top: 8px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: var(--line-strong); }
  .drawer__head { padding: 22px 16px 8px 20px; }
  .drawer__body { padding: 4px 20px 8px; }
  .drawer__foot { padding: 16px 20px 20px; }
}

/* <dialog class="modal">: centred on desktop, a bottom sheet on phones */
.modal {
  width: min(540px, calc(100vw - 32px)); max-height: min(86svh, 820px);
  padding: 0; border: 0; border-radius: var(--r-card);
  background: var(--bg); color: var(--ink); box-shadow: var(--shadow-pop);
  overflow: hidden;
}
.modal[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; animation: modal-in var(--t-slow) var(--ease-out); }
.modal::backdrop { background: var(--scrim); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fade-in var(--t-slow) var(--ease-out); }
.modal--wide { width: min(820px, calc(100vw - 32px)); }
.modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 24px 24px 8px 28px; }
.modal__head h2 { font-size: var(--fs-h3); letter-spacing: -0.04em; }
.modal__head .mono { color: var(--ink-muted); margin-bottom: 8px; }
.modal__body { overflow-y: auto; padding: 8px 28px 20px; display: grid; gap: var(--s-5); align-content: start; color: var(--ink-muted); }
.modal__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px 24px; border-top: 1px solid var(--line); flex-wrap: wrap; }
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(0.98); } }
@keyframes sheet-in { from { transform: translateY(100%); } }
@keyframes fade-in { from { opacity: 0; } }
@media (max-width: 640px) {
  .modal { width: 100%; max-width: 100%; max-height: 92svh; margin: auto 0 0; border-radius: var(--r-sheet) var(--r-sheet) 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .modal[open] { animation: sheet-in var(--t-sheet) var(--ease-drawer); }
  .modal::before { content: ""; position: absolute; top: 8px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: var(--line-strong); }
  .modal__head { padding: 26px 16px 6px 20px; }
  .modal__body { padding: 6px 20px 16px; }
  .modal__foot { padding: 14px 20px 20px; flex-direction: column-reverse; }
  .modal__foot .btn { width: 100%; }
}

/* confirm for sensitive actions: payout approval, compensation settings,
   refunds, bank changes. States what changes, asks for the password or a
   code, and says it is written to the audit log. */
.confirm .modal__head { padding-top: 28px; }
.confirm__flag { display: inline-flex; align-items: center; gap: 8px; color: var(--member-ink); }
.confirm__flag::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--burgundy); transform: rotate(45deg); }
.confirm--danger .confirm__flag { color: var(--danger); }
.confirm--danger .confirm__flag::before { background: var(--danger); }
.confirm__summary { display: grid; border: 1px solid var(--line); border-radius: var(--r-panel); overflow: hidden; }
.confirm__summary > div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 16px; font-size: 14.5px; }
.confirm__summary > div + div { border-top: 1px solid var(--line); }
.confirm__summary dt { color: var(--ink-muted); }
.confirm__summary dd { margin: 0; color: var(--ink); font-weight: var(--w-semi); text-align: right; font-variant-numeric: tabular-nums; }
.confirm__change { display: flex; align-items: center; gap: 8px; }
.confirm__change s { color: var(--ink-muted); font-weight: var(--w-regular); }
.confirm__audit { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--surface); font-size: 13px; line-height: 1.45; color: var(--ink-muted); }
.confirm__audit .i { width: 16px; height: 16px; margin-top: 2px; flex: none; }

/* ================================================================ toasts */
.toasts { position: fixed; z-index: 80; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); display: grid; gap: 8px; justify-items: center; width: min(460px, calc(100vw - 24px)); pointer-events: none; }
.has-tabbar .toasts { bottom: calc(var(--tabbar) + 26px + env(safe-area-inset-bottom, 0px)); }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 8px 8px 18px; border-radius: var(--r-pill); background: var(--toast-bg); color: var(--toast-fg); box-shadow: 0 18px 40px -16px rgba(0,0,0,.5); font-size: 14.5px; font-weight: var(--w-medium); animation: toast-in var(--t-slow) var(--ease-out); max-width: 100%; }
.toast .i { width: 18px; height: 18px; flex: none; }
.toast--success .i { color: var(--toast-ok); }
.toast--error .i { color: var(--toast-err); }
.toast__msg { flex: 1; min-width: 0; padding-right: 6px; }
.toast .btn { min-height: 38px; padding: 0 14px; font-size: 13px; --b-bg: var(--toast-btn); --b-fg: inherit; }
.toast.is-leaving { animation: toast-out 260ms var(--ease-in-out) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(0.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px) scale(0.97); } }

/* ================================================================ tables that work on phones
   Under 720px a .table--stack turns each row into a card; every td needs
   data-label. Numbers align right on desktop. */
.table-wrap { border-radius: var(--r-panel); background: var(--field-bg); box-shadow: var(--shadow-card); overflow: hidden; }
.table-scroll { overflow-x: auto; }
.table { width: 100%; font-size: 14.5px; }
.table th { position: sticky; top: 0; padding: 12px 16px; text-align: left; white-space: nowrap; background: var(--field-bg); color: var(--fg-muted); border-bottom: 1px solid var(--rule); font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--t-fast); }
.table tbody tr:hover { background: color-mix(in srgb, var(--chip-bg) 70%, transparent); }
.table .num, .table th.num { text-align: right; white-space: nowrap; }
.table .ref { font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.02em; }
.table a.ref { color: var(--fg); text-decoration-color: var(--rule); }
.table .sub { display: block; color: var(--fg-muted); font-size: 13px; margin-top: 2px; }
.table .who { display: flex; align-items: center; gap: 10px; }
.table tr.is-selected { background: var(--green-tint); }
.table tr.is-reversal td { color: var(--fg-muted); }
.table tr.is-reversal td:first-child { box-shadow: inset 3px 0 0 var(--burgundy); }
.table-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--rule); color: var(--fg-muted); font-size: 13.5px; flex-wrap: wrap; }
.table-tools { display: flex; align-items: center; gap: 10px; padding: 12px; border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.table-tools .search { flex: 1 1 220px; }
@media (max-width: 720px) {
  .table--stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .table--stack, .table--stack tbody, .table--stack tr, .table--stack td { display: block; width: 100%; }
  .table--stack tr { padding: 14px 16px; border-bottom: 1px solid var(--rule); }
  .table--stack tr:last-child { border-bottom: 0; }
  .table--stack td { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 5px 0; border: 0; text-align: right; }
  .table--stack td::before { content: attr(data-label); flex: none; color: var(--fg-muted); font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; text-align: left; }
  .table--stack td[data-primary] { display: block; padding-bottom: 8px; text-align: left; font-size: 16px; }
  .table--stack td[data-primary]::before { content: none; }
  .table--stack td.num { text-align: right; }
  .table--stack tr.is-reversal { box-shadow: inset 3px 0 0 var(--burgundy); }
  .table--stack tr.is-reversal td:first-child { box-shadow: none; }
}

/* pagination */
.pager { display: flex; align-items: center; gap: 4px; }
.pager a, .pager button, .pager span { display: grid; place-items: center; min-width: 40px; height: 40px; padding: 0 10px; border: 0; border-radius: var(--r-pill); background: none; color: var(--fg); font-size: 14px; font-weight: var(--w-semi); text-decoration: none; font-variant-numeric: tabular-nums; }
.pager [aria-current] { background: var(--fg); color: var(--on-fg); }
.pager a:hover, .pager button:hover { background: var(--chip-bg); }

/* ================================================================ empty, loading, error, success */
.state { display: grid; justify-items: center; text-align: center; gap: 12px; padding: clamp(40px, 8vw, 88px) 24px; max-width: 460px; margin-inline: auto; }
.state__mark { position: relative; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--chip-bg); color: var(--fg); margin-bottom: 8px; }
.state__mark .i { width: 26px; height: 26px; }
.state__mark img { position: absolute; bottom: 0; height: 120%; width: auto; max-width: none; }
.state h2, .state h3 { font-size: var(--fs-h2); letter-spacing: -0.05em; line-height: 0.98; }
.state p { color: var(--fg-muted); max-width: 36ch; }
.state .row { justify-content: center; margin-top: 8px; }
.state--error .state__mark { background: var(--danger-tint); color: var(--danger); }
.state--success .state__mark { background: var(--success-tint); color: var(--success); }
.state--member .state__mark { background: var(--burgundy-tint); color: var(--member-ink); }
.state--compact { padding: 32px 16px; }
.state--compact h3 { font-size: var(--fs-h3); }

.spinner { display: inline-block; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--rule); border-top-color: var(--fg); animation: spin 760ms linear infinite; }
.skel { display: block; border-radius: 10px; background: linear-gradient(90deg, var(--chip-bg) 0%, color-mix(in srgb, var(--chip-bg) 40%, var(--field-bg)) 45%, var(--chip-bg) 90%) 0 0 / 300% 100%; animation: shimmer 1.4s linear infinite; }
.skel--text { height: 12px; border-radius: 6px; }
.skel--title { height: 28px; width: 60%; border-radius: 8px; }
.skel--card { aspect-ratio: 4 / 5; border-radius: var(--r-card); }
.skel--circle { border-radius: 50%; }
@keyframes shimmer { to { background-position: -150% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }

/* inline notices: info, disclaimer, warning, error */
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-panel); background: var(--chip-bg); color: var(--fg); font-size: 14.5px; line-height: 1.5; }
.notice > .i { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.notice b { font-weight: var(--w-semi); }
.notice--member { background: var(--burgundy-tint); color: var(--member-ink); }
.notice--member b { color: var(--fg); }
.notice--warn { background: var(--yellow-tint); color: var(--warning-ink); }
.notice--warn b { color: var(--fg); }
.notice--error { background: var(--danger-tint); color: var(--danger); }
.notice--success { background: var(--success-tint); color: var(--success); }
.notice--line { background: none; border: 1px solid var(--rule); }

/* the disclaimer: under every button that starts registration or payment
   with a package, and on the dashboard */
.disclaimer { font-size: 13px; line-height: 1.5; color: var(--fg-muted); max-width: 64ch; }
.honest { padding-left: 18px; border-left: 3px solid var(--yellow); font-size: clamp(22px, 2.2vw, 30px); font-weight: var(--w-bold); letter-spacing: -0.035em; line-height: 1.12; }

/* ================================================================ figures, meters, ledgers (dashboard) */
.figure { display: grid; gap: 6px; align-content: start; container-type: inline-size; min-width: 0; }
.figure__label { color: var(--fg-muted); }
.figure__value { font-family: var(--font-display); font-size: min(var(--fs-figure), 21cqi); font-weight: var(--w-bold); letter-spacing: -0.055em; line-height: 0.92; font-variation-settings: "wdth" var(--wdth-tight); white-space: nowrap; }
.figure__value .unit { font-size: 0.5em; letter-spacing: -0.02em; margin-left: 0.1em; vertical-align: 0.1em; color: var(--fg-muted); }
.figure__value .cur { font-size: 0.62em; vertical-align: 0.28em; margin-right: 0.02em; letter-spacing: 0; }
.figure__meta { font-size: 13.5px; color: var(--fg-muted); }
.figure--earn .figure__value { color: var(--earn); }
.sheet--burgundy .figure--earn .figure__value, .sheet--deep .figure--earn .figure__value { color: var(--lime); }
.figure--sm .figure__value { font-size: min(clamp(28px, 2.8vw, 40px), 21cqi); }

/* a meter: one bar, a threshold tick, words under it */
.meter { --v: 0; --max: 100; --tick: 0; display: grid; gap: 8px; }
.meter__bar { position: relative; height: 10px; border-radius: 5px; background: var(--chip-bg); overflow: hidden; }
.meter__bar::before { content: ""; position: absolute; inset: 0 auto 0 0; width: calc(min(var(--v), var(--max)) / var(--max) * 100%); border-radius: inherit; background: var(--meter, var(--accent)); transition: width var(--t-slow) var(--ease-out); }
.meter__bar::after { content: ""; position: absolute; top: -3px; bottom: -3px; width: 2px; left: calc(var(--tick) / var(--max) * 100%); background: var(--fg); border-radius: 1px; display: none; }
.meter--tick .meter__bar { overflow: visible; }
.meter--tick .meter__bar::after { display: block; }
.meter__legend { display: flex; justify-content: space-between; gap: 12px; color: var(--fg-muted); }
.meter.is-full { --meter: var(--lime); }
.meter--member { --meter: var(--burgundy); }
.meter--spark { --meter: var(--yellow); }
.meter--lg .meter__bar { height: 16px; border-radius: 8px; }

/* left / right legs, side by side: the one comparison that matters */
.legs { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 16px; }
.legs__side { display: grid; gap: 4px; }
.legs__side:last-child { text-align: right; }
.legs__side b { font-size: clamp(30px, 3.4vw, 48px); font-weight: var(--w-bold); letter-spacing: -0.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.legs__side .mono { color: var(--fg-muted); }
.legs__mid { align-self: center; color: var(--fg-muted); }
.legs__bar { grid-column: 1 / -1; display: flex; height: 8px; gap: 3px; }
.legs__bar i { border-radius: 4px; background: var(--fg); opacity: 0.85; }
.legs__bar i + i { background: var(--burgundy); opacity: 1; }
.legs.is-lesser-left .legs__side:first-child b::after, .legs.is-lesser-right .legs__side:last-child b::after { content: "lesser leg"; display: block; margin-top: 6px; font-family: var(--font-mono); font-size: 10px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-muted); }

/* ledger: earnings rows, each linked to the order or event behind it */
.ledger { list-style: none; margin: 0; padding: 0; }
.ledger li { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.ledger li:first-child { border-top: 1px solid var(--rule); }
.ledger time { color: var(--fg-muted); }
.ledger .what b { display: block; font-weight: var(--w-semi); letter-spacing: -0.015em; }
.ledger .what .sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 3px; color: var(--fg-muted); font-size: 13.5px; }
.ledger .what a { color: var(--fg); font-family: var(--font-mono); font-size: 12px; text-decoration-color: var(--rule); }
.ledger .amount { text-align: right; font-size: 16px; }
.ledger li.is-reversal { box-shadow: inset 3px 0 0 var(--burgundy); padding-left: 14px; }
.ledger li.is-reversal .amount { color: var(--member-ink); }
.ledger li.is-held .amount { color: var(--held); }
.type-dot { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-muted); }
.type-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--dot, var(--fg-muted)); }
.type-dot[data-type="referral"] { --dot: var(--green); }
.type-dot[data-type="pairing"] { --dot: var(--lime); }
.type-dot[data-type="repurchase"] { --dot: var(--yellow); }
.type-dot[data-type="rank"] { --dot: var(--burgundy); }
.type-dot[data-type="reversal"] { --dot: var(--danger); }
.type-dot[data-type="held"] { --dot: #a37a12; }
@media (max-width: 560px) {
  .ledger li { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; }
  .ledger time { grid-column: 1 / -1; }
}

/* key-value rows */
.kv { display: grid; margin: 0; }
.kv > div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--rule); font-size: 15px; }
.kv dt { color: var(--fg-muted); }
.kv dd { margin: 0; text-align: right; font-weight: var(--w-medium); font-variant-numeric: tabular-nums; }

/* a calm panel for the dashboard and admin (never a grey card farm: use
   panels for grouping, sheets for the moment that matters) */
.panel { border-radius: var(--r-panel); background: var(--field-bg); box-shadow: var(--shadow-card); padding: clamp(18px, 2vw, 24px); }
.panel--tint { background: var(--chip-bg); box-shadow: none; }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel__head h2, .panel__head h3 { font-size: var(--fs-h4); letter-spacing: -0.025em; }

/* copy field: referral link with copy and WhatsApp */
.copy-field { display: flex; align-items: center; gap: 6px; min-height: 56px; padding: 6px 6px 6px 18px; border-radius: var(--r-pill); background: var(--field-bg); border: 1px solid var(--rule); }
.copy-field__value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-mono); font-size: 14px; letter-spacing: 0; }
.copy-field__value b { font-weight: 500; color: var(--member-ink); }
.copy-field .btn { min-height: var(--tap); }
.copy-field.is-copied .btn--copy { --b-bg: var(--success); --b-fg: #fff; }
@media (max-width: 480px) {
  .copy-field { flex-wrap: wrap; border-radius: var(--r-panel); padding: 14px; gap: 10px; }
  .copy-field__value { flex-basis: 100%; white-space: normal; word-break: break-all; }
  .copy-field .btn { flex: 1; }
}

/* steps: the joining path */
.steps { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; }
.steps li { flex: 1; display: grid; gap: 8px; min-width: 0; }
.steps li::before { content: ""; height: 3px; border-radius: 2px; background: var(--rule); transition: background var(--t-slow); }
.steps li[data-state="done"]::before, .steps li[aria-current]::before { background: var(--fg); }
.steps li[aria-current]::before { background: var(--accent); }
.steps .mono { color: var(--fg-muted); }
.steps li[aria-current] .mono, .steps li[data-state="done"] .mono { color: var(--fg); }
.steps b { font-size: 14px; font-weight: var(--w-semi); letter-spacing: -0.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 560px) { .steps b { display: none; } .steps li[aria-current] b { display: block; } }

/* accordion (FAQs) */
.accordion { border-top: 1px solid var(--rule); }
.accordion details { border-bottom: 1px solid var(--rule); }
.accordion summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; padding: 14px 0; cursor: pointer; list-style: none; font-size: clamp(17px, 1.5vw, 20px); font-weight: var(--w-semi); letter-spacing: -0.025em; }
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after { content: ""; flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--chip-bg) var(--plus-icon) center / 16px no-repeat; transition: transform var(--t-base) var(--ease-out); }
.sheet--deep .accordion summary::after, .sheet--burgundy .accordion summary::after, .sheet--green .accordion summary::after, .sheet--ink .accordion summary::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M12 6v12M6 12h12'/%3E%3C/svg%3E"); }
.accordion details[open] summary::after { transform: rotate(45deg); }
.accordion .answer { padding: 0 48px 22px 0; color: var(--fg-muted); font-size: 16px; line-height: 1.6; max-width: 70ch; }

/* breadcrumbs */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--fg-muted); }
.crumbs a { color: inherit; text-decoration: none; min-height: 32px; display: inline-flex; align-items: center; }
.crumbs a:hover { color: var(--fg); }
.crumbs span[aria-hidden] { color: var(--fg-muted); }

/* menu (row actions, account) */
.menu { position: absolute; z-index: 30; min-width: 200px; padding: 6px; border-radius: 16px; background: var(--bg); box-shadow: var(--shadow-pop); display: grid; animation: modal-in var(--t-base) var(--ease-out); }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; min-height: var(--tap); padding: 0 12px; border: 0; border-radius: 10px; background: none; color: var(--ink); font-size: 14.5px; text-decoration: none; text-align: left; }
.menu a:hover, .menu button:hover { background: var(--surface); }
.menu .danger { color: var(--danger); }
.menu hr { margin: 6px 4px; border-color: var(--line); }

/* option cards (package picker, delivery choice) */
.option { position: relative; display: grid; gap: 6px; padding: 18px; border: 1.5px solid var(--rule); border-radius: var(--r-panel); background: var(--field-bg); cursor: pointer; transition: border-color var(--t-base), box-shadow var(--t-base), transform var(--t-fast); }
.option:hover { border-color: var(--fg-muted); }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option:has(input:checked) { border-color: var(--fg); box-shadow: 0 0 0 1px var(--fg); }
.option:has(input:focus-visible) { box-shadow: var(--shadow-focus); }
.option__mark { position: absolute; top: 16px; right: 16px; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; }
.option:has(input:checked) .option__mark { background: var(--fg); border-color: var(--fg); }
.option:has(input:checked) .option__mark::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--on-fg); }
.option--member:has(input:checked) { border-color: var(--burgundy); box-shadow: 0 0 0 1px var(--burgundy); }
.option--member:has(input:checked) .option__mark { background: var(--burgundy); border-color: var(--burgundy); }

/* ================================================================ public header: the floating pill nav */
.site-nav {
  position: fixed; z-index: 50; top: calc(env(safe-area-inset-top, 0px) + 14px); left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px;
  width: max-content; max-width: calc(100vw - 2 * var(--inset));
  padding: 6px 6px 6px 18px; border-radius: var(--r-pill);
  background: var(--glass); color: var(--ink); box-shadow: var(--shadow-float);
  backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3);
  transition: transform var(--t-slow) var(--ease-out), opacity var(--t-base);
}
.site-nav.is-hidden { transform: translate(-50%, -140%); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-size: 15px; font-weight: var(--w-bold); letter-spacing: -0.025em; white-space: nowrap; min-height: var(--tap); }
.brand__dots { display: inline-grid; grid-template-columns: repeat(3, 6px); gap: 2px; }
.brand__dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.brand__dots i:nth-child(2) { background: var(--burgundy); }
.brand__dots i:nth-child(3) { background: var(--yellow); }
.site-nav .brand { margin-right: 8px; }
.site-nav .pills { background: transparent; padding: 0; }
.site-nav__end { display: flex; align-items: center; gap: 6px; }
.site-nav__login { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: var(--r-pill); color: var(--ink); text-decoration: none; font-size: 13.5px; font-weight: var(--w-semi); }
.site-nav__login:hover { background: var(--chip-bg); }
.bag-btn { position: relative; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--ink); color: var(--bg); display: grid; place-items: center; cursor: pointer; transition: transform var(--t-fast); }
.bag-btn:active { transform: scale(0.94); }
.bag-btn .i { width: 19px; height: 19px; }
.bag-btn .badge { box-shadow: 0 0 0 2px var(--bg); }
.acct-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; color: var(--ink); display: none; place-items: center; text-decoration: none; }
.acct-btn .i { width: 20px; height: 20px; }
@media (max-width: 720px) {
  .site-nav { left: var(--inset); right: var(--inset); transform: none; width: auto; justify-content: space-between; padding-left: 14px; }
  .site-nav.is-hidden { transform: translateY(-140%); }
  .site-nav .brand__name { display: none; }
  .site-nav .brand { margin-right: 0; }
  .site-nav .pills > a { padding: 0 12px; font-size: 13.5px; }
  .site-nav__login { display: none; }
  .acct-btn { display: grid; }
}
@media (max-width: 359px) { .site-nav .pills > a { padding: 0 9px; } }

/* ================================================================ public footer */
.site-footer { margin: var(--inset); margin-top: 0; }
.site-footer .wrap { padding-block: clamp(56px, 8vw, 96px) 28px; }
.footer-doors { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; flex-wrap: wrap; padding-bottom: clamp(40px, 6vw, 72px); border-bottom: 1px solid var(--rule); }
.footer-doors h2 { font-size: clamp(40px, 5.4vw, 84px); line-height: 0.92; letter-spacing: -0.06em; max-width: 12ch; }
.footer-doors .row { gap: 10px; }
.footer-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; padding-block: 40px; }
.footer-cols nav { display: grid; gap: 2px; align-content: start; }
.footer-cols h3 { margin-bottom: 10px; color: var(--fg-muted); font-family: var(--font-mono); font-size: var(--fs-mono); font-weight: 500; letter-spacing: var(--tracking-mono); text-transform: uppercase; }
.footer-cols a, .footer-cols span { display: inline-flex; align-items: center; min-height: 40px; color: var(--fg); text-decoration: none; font-size: 16px; }
.footer-cols a:hover { text-decoration: underline; text-underline-offset: 4px; }
.footer-legal { display: grid; gap: 8px; max-width: 76ch; font-size: 13.5px; line-height: 1.55; color: var(--fg-muted); }
.footer-word { margin: clamp(32px, 5vw, 56px) 0 0; font-size: clamp(54px, 12.2vw, 196px); line-height: 0.78; letter-spacing: -0.075em; font-weight: var(--w-bold); font-variation-settings: "wdth" var(--wdth-tight); white-space: nowrap; color: var(--fg); user-select: none; }
.footer-word span { color: var(--yellow); }
.footer-base { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 18px; margin-top: 18px; border-top: 1px solid var(--rule); color: var(--fg-muted); font-size: 13.5px; }
.theme-toggle { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: var(--r-pill); background: var(--chip-bg); }
.theme-toggle button { display: inline-grid; place-items: center; width: 40px; height: 36px; border: 0; border-radius: var(--r-pill); background: none; color: var(--fg-muted); }
.theme-toggle button[aria-pressed="true"] { background: var(--field-bg); color: var(--fg); box-shadow: 0 0 0 1px var(--rule); }
.theme-toggle .i { width: 16px; height: 16px; }
@media (max-width: 760px) {
  .footer-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 16px; }
  .footer-doors .row { width: 100%; }
  .footer-doors .btn { flex: 1; }
}

/* ================================================================ dashboard shell (member)
   Desktop: a quiet sidebar with the member card; the active item is a
   burgundy pill (burgundy means Member). Phone: a floating tab bar. */
.shell { min-height: 100svh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); background: var(--bg); }
.shell__side { position: sticky; top: 0; height: 100svh; display: flex; flex-direction: column; gap: 18px; padding: 18px 14px 16px; background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; }
.shell__brand { padding: 0 8px; }
.shell__me { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; align-items: center; padding: 14px; border-radius: var(--r-panel); background: var(--paint-burgundy); color: #fff; }
.shell__me .avatar { grid-row: span 2; background: rgba(255,255,255,.16); }
.shell__me b { font-size: 15px; font-weight: var(--w-semi); letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shell__me .mono { color: rgba(255,255,255,.7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shell__me .chips { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.shell__me .pkg-chip { background: rgba(255,255,255,.14); color: #fff; }
.side-nav { display: grid; align-content: start; gap: 2px; }
.side-nav h3 { margin: 14px 10px 6px; color: var(--ink-faint); font-family: var(--font-mono); font-size: 10px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; }
.side-nav a { position: relative; display: flex; align-items: center; gap: 12px; min-height: var(--tap); padding: 0 12px; border-radius: 14px; color: var(--ink-muted); text-decoration: none; font-size: 14.5px; font-weight: var(--w-medium); letter-spacing: -0.01em; transition: background var(--t-base), color var(--t-base); }
.side-nav a .i { width: 19px; height: 19px; }
.side-nav a:hover { background: var(--bg); color: var(--ink); }
.side-nav a[aria-current] { background: var(--burgundy); color: var(--on-member); }
.side-nav a .count { margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--yellow); color: #111411; font-family: var(--font-mono); font-size: 10.5px; line-height: 20px; text-align: center; }
.shell__foot { display: grid; gap: 10px; margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--line); }
.shell__side > * { flex: none; }
.shell__side .side-nav a { min-height: 40px; }
.shell__foot .row { justify-content: space-between; }
.shell__main { min-width: 0; display: grid; grid-template-rows: auto 1fr; }
.shell__top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; padding: 12px clamp(16px, 3vw, 40px); background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid transparent; transition: border-color var(--t-base); }
.shell__top.is-stuck { border-bottom-color: var(--line); }
.shell__top .crumbs { font-size: 14px; }
.shell__top-end { display: flex; align-items: center; gap: 8px; }
.shell__page { padding: clamp(8px, 2vw, 16px) clamp(16px, 3vw, 40px) clamp(40px, 6vw, 72px); display: grid; gap: clamp(16px, 2vw, 24px); align-content: start; max-width: 1440px; width: 100%; }
.page-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; padding: clamp(8px, 2vw, 24px) 0 clamp(8px, 1.5vw, 16px); }
.page-title h1 { font-size: var(--fs-display); line-height: 0.88; letter-spacing: -0.065em; font-variation-settings: "wdth" var(--wdth-tight); }
.page-title p { color: var(--fg-muted); max-width: 44ch; }
.tabbar { display: none; }
.shell__mobile-top { display: none; }
@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .shell__side { display: none; }
  .shell__top { min-height: 60px; padding: 8px 16px; }
  .shell__top .crumbs { display: none; }
  .shell__mobile-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
  .shell__mobile-top .avatar { width: 36px; height: 36px; font-size: 12px; }
  .shell__mobile-top b { display: block; font-size: 14.5px; font-weight: var(--w-semi); letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .shell__mobile-top .mono { display: block; color: var(--fg-muted); font-size: 9.5px; }
  .shell__page { padding: 4px 16px calc(var(--tabbar) + 40px + env(safe-area-inset-bottom, 0px)); }
  .tabbar {
    position: fixed; z-index: 40; left: var(--inset); right: var(--inset); bottom: calc(var(--inset) + env(safe-area-inset-bottom, 0px));
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); height: var(--tabbar); padding: 6px;
    border-radius: 24px; background: var(--glass); box-shadow: var(--shadow-float);
    backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3);
  }
  .tabbar a, .tabbar button { display: grid; place-items: center; align-content: center; gap: 3px; min-width: 0; border: 0; border-radius: 18px; background: none; color: var(--ink-muted); text-decoration: none; font-size: 10.5px; font-weight: var(--w-semi); letter-spacing: 0; }
  .tabbar .i { width: 21px; height: 21px; }
  .tabbar [aria-current] { background: var(--burgundy); color: var(--on-member); }
}

/* ================================================================ admin shell
   Denser and darker: a deep green-black side, grouped navigation with
   mono group labels, the signed-in admin and role at the foot. */
.shell--admin { --sidebar: 252px; }
.shell--admin .shell__side { background: var(--paint-deep); color: #eef2ea; border-right: 0; --line: rgba(238, 242, 234, 0.12); }
.shell--admin .side-nav a { color: rgba(238, 242, 234, 0.7); min-height: 40px; font-size: 14px; }
.shell--admin .side-nav a:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.shell--admin .side-nav a[aria-current] { background: var(--lime); color: #0f2a12; }
.shell--admin .side-nav h3 { color: rgba(238, 242, 234, 0.56); }
.shell--admin .brand { color: #fff; }
.shell--admin .shell__foot { border-top-color: rgba(238, 242, 234, 0.12); }
.admin-env { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 6px; background: rgba(255,255,255,.08); color: rgba(238,242,234,.75); font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; }
.admin-me { display: flex; align-items: center; gap: 10px; min-width: 0; }
.admin-me b { display: block; font-size: 14px; font-weight: var(--w-semi); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-me .mono { color: rgba(238,242,234,.6); }
.shell--admin .shell__top .search { width: min(420px, 100%); }
.shell--admin .page-title h1 { font-size: var(--fs-h1); letter-spacing: -0.055em; }
.mfa-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 10px; border-radius: var(--r-pill); background: var(--success-tint); color: var(--success); font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; }
.mfa-chip .i { width: 14px; height: 14px; }
.admin-menu-btn { display: none; }
@media (max-width: 960px) {
  .shell--admin .shell__page { padding-bottom: 48px; }
  .admin-menu-btn { display: inline-grid; }
  .shell--admin .shell__top .search { display: none; }
}
/* the admin nav as a sheet on phones */
.nav-sheet { position: fixed; z-index: 70; inset: 0 auto 0 0; width: min(320px, 86vw); padding: 18px 14px; background: var(--paint-deep); color: #eef2ea; overflow-y: auto; transform: translateX(-102%); transition: transform var(--t-sheet) var(--ease-drawer); border-radius: 0 var(--r-sheet) var(--r-sheet) 0; }
.nav-sheet.is-open { transform: none; }
.nav-sheet .side-nav a { color: rgba(238, 242, 234, 0.75); }
.nav-sheet .side-nav a[aria-current] { background: var(--lime); color: #0f2a12; }
.nav-sheet .side-nav h3 { color: rgba(238, 242, 234, 0.56); }
.nav-sheet--member { background: var(--surface); color: var(--ink); }
.nav-sheet--member .side-nav a { color: var(--ink-muted); }
.nav-sheet--member .side-nav a[aria-current] { background: var(--burgundy); color: var(--on-member); }
.nav-sheet--member .side-nav h3 { color: var(--ink-faint); }
.nav-sheet--member .brand { color: var(--ink); }

/* stat strip for admin overview: ruled, never boxed */
.stat-strip { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.stat-strip > * { padding: 18px 20px 18px 0; display: grid; gap: 6px; align-content: start; min-width: 0; container-type: inline-size; }
.stat-strip > * + * { border-left: 1px solid var(--rule); padding-left: 20px; }
.stat-strip .mono { color: var(--fg-muted); }
.stat-strip b { white-space: nowrap; font-size: min(clamp(26px, 2.6vw, 36px), 17cqi); font-weight: var(--w-bold); letter-spacing: -0.045em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-strip .delta { font-size: 13px; color: var(--fg-muted); }
.stat-strip .delta.up { color: var(--success); }
@media (max-width: 760px) {
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-strip > :nth-child(2n + 1) { border-left: 0; padding-left: 0; }
  .stat-strip > :nth-child(n + 3) { border-top: 1px solid var(--rule); }
}

/* ================================================================ genealogy
   You, your 2, their 4. Every node shows its left and right PV; every
   empty slot offers "+ Add member". Nodes go compact by container width. */
.gtree { --g-gap: 26px; --g-line: var(--line-strong); display: grid; justify-items: center; }
.gtree__level { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; margin-top: var(--g-gap); padding-top: var(--g-gap); }
.gtree__level::before { content: ""; position: absolute; top: 0; left: 25%; right: 25%; height: 1px; background: var(--g-line); }
.gtree__level::after { content: ""; position: absolute; top: calc(-1 * var(--g-gap)); left: 50%; width: 1px; height: var(--g-gap); background: var(--g-line); }
.gtree__branch { position: relative; display: grid; justify-items: center; align-content: start; min-width: 0; padding-inline: 6px; container-type: inline-size; }
.gtree__branch::before { content: ""; position: absolute; top: calc(-1 * var(--g-gap)); left: 50%; width: 1px; height: var(--g-gap); background: var(--g-line); }
.gtree__level.is-empty::before, .gtree__level.is-empty::after { display: none; }

.gnode { position: relative; width: min(100%, 220px); display: grid; gap: 10px; padding: 14px; border-radius: 20px; background: var(--field-bg); box-shadow: var(--shadow-card); color: var(--fg); text-align: left; border: 0; font: inherit; cursor: pointer; transition: transform var(--t-base) var(--ease-out), box-shadow var(--t-base); }
.gnode:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px var(--rule), 0 14px 30px -18px rgba(17,20,17,.35); }
.gnode__who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.gnode__who .avatar { width: 36px; height: 36px; font-size: 12px; }
.gnode__name { min-width: 0; }
.gnode__name b { display: block; font-size: 14.5px; font-weight: var(--w-semi); letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gnode__name .mono { display: block; color: var(--fg-muted); font-size: 10px; text-transform: none; letter-spacing: 0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gnode__pv { display: grid; grid-template-columns: 1fr 1fr; border-radius: 12px; background: var(--chip-bg); overflow: hidden; }
.gnode__pv > span { display: grid; gap: 1px; padding: 7px 10px; }
.gnode__pv > span + span { border-left: 1px solid var(--rule); text-align: right; }
.gnode__pv .mono { color: var(--fg-muted); font-size: 9px; white-space: nowrap; }
.gnode__pv b { font-size: 15px; font-weight: var(--w-bold); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.gnode__meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.gnode__rel { position: absolute; top: -10px; left: 12px; max-width: calc(100% - 20px); overflow: hidden; text-overflow: ellipsis; padding: 3px 8px; border-radius: var(--r-pill); background: var(--fg); color: var(--on-fg); font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap; }
.gnode--you { box-shadow: 0 0 0 2px var(--burgundy), var(--shadow-card); }
.gnode--you .gnode__rel { background: var(--avatar-bg); color: #fff; }
.gnode--root { box-shadow: 0 0 0 2px var(--fg), var(--shadow-card); }
.gnode--pending { box-shadow: none; outline: 1.5px dashed var(--line-strong); outline-offset: -1.5px; }
.gnode--pending .gnode__pv { background: repeating-linear-gradient(-45deg, var(--chip-bg) 0 6px, transparent 6px 12px); }
.gnode--empty { place-items: center; align-content: center; min-height: 128px; background: transparent; box-shadow: none; border: 1.5px dashed var(--line-strong); color: var(--fg-muted); text-align: center; gap: 6px; }
.gnode--empty:hover { border-color: var(--burgundy); color: var(--member-ink); background: var(--burgundy-tint); box-shadow: none; }
.gnode--empty .plus { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--burgundy); color: #fff; }
.gnode--empty b { font-size: 14px; font-weight: var(--w-semi); color: var(--fg); }
.gnode--empty .mono { font-size: 9.5px; }
.gnode--void { visibility: hidden; min-height: 128px; }
@container (max-width: 150px) {
  .gnode { padding: 10px 8px; gap: 8px; border-radius: 16px; justify-items: center; text-align: center; }
  .gnode__who { flex-direction: column; gap: 6px; }
  .gnode__who .avatar { width: 30px; height: 30px; font-size: 10.5px; }
  .gnode__name { max-width: 100%; }
  .gnode__name b { font-size: 12px; }
  .gnode__name .mono { display: none; }
  .gnode__pv { width: 100%; grid-template-columns: 1fr; }
  .gnode__pv > span { padding: 5px 4px; justify-items: center; text-align: center; }
  .gnode__pv > span + span { border-left: 0; border-top: 1px solid var(--rule); text-align: center; }
  .gnode__pv .mono { font-size: 8px; letter-spacing: 0.06em; }
  .gnode__pv b { font-size: 13px; }
  .gnode__meta { display: none; }
  .gnode__rel { display: none; }
  .gnode--empty { min-height: 104px; padding: 8px 4px; }
  .gnode--empty .plus { width: 30px; height: 30px; }
  .gnode--empty b { font-size: 12px; }
  .gnode--empty .mono { display: none; }
}
@container (max-width: 100px) {
  .gnode { padding: 9px 4px; gap: 6px; border-radius: 14px; }
  .gnode__name b { font-size: 11px; letter-spacing: -0.02em; }
  .gnode__pv .mono { display: none; }
  .gnode__pv > span { padding: 4px 2px; }
  .gnode__pv b { font-size: 12px; }
  .gnode__pv b::before { content: attr(data-k); margin-right: 4px; font-family: var(--font-mono); font-size: 8.5px; font-weight: 500; color: var(--fg-muted); }
  .gnode--empty { min-height: 96px; gap: 4px; }
  .gnode--empty b { font-size: 11px; }
}
.gtree__branch .gtree__level .gtree__branch { padding-inline: 3px; }
@container (max-width: 210px) {
  .gnode { padding: 12px 10px; }
  .gnode__pv > span { padding: 6px 8px; }
  .gnode__rel { left: 8px; font-size: 8px; letter-spacing: 0.06em; }
}
/* "how they relate to you": the path above the tree */
.gpath { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 10px 14px; border-radius: var(--r-pill); background: var(--burgundy-tint); color: var(--member-ink); font-size: 14px; }
.gpath b { color: var(--fg); font-weight: var(--w-semi); }
.gpath .step { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--avatar-bg); color: #fff; font-family: var(--font-mono); font-size: 10px; }
