/* vinted-bot components and layout. Built only from tokens.css. */

/* ───────────────────────── Base ───────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--c-page);
  color: var(--c-text-2);
  font: var(--fw-regular) var(--fs-body)/1.5 var(--font-ui);
  font-feature-settings: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Nothing may push the page sideways on a phone; scrollers scroll inside themselves. */
  overflow-x: clip;
}
/* Short pages keep the footer at the bottom instead of leaving a white band under it. */
body:not(.is-task) { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
body:not(.is-task) > .main { flex: 1 0 auto; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--c-primary); text-underline-offset: 2px; }
a:hover { color: var(--c-primary-hover); }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { color: var(--c-ink); text-wrap: balance; }
:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--c-primary-light); color: var(--c-ink); }
.num, time, .tnum { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: var(--r-pill); background: var(--c-ink); color: var(--c-page); }
.skip:focus { top: 12px; }

.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.i-sm { width: 16px; height: 16px; }
.i-xs { width: 14px; height: 14px; }
.i-lg { width: 24px; height: 24px; }

/* ───────────────────────── Type ───────────────────────── */
.t-display { font: var(--fw-display) var(--fs-display)/var(--lh-display) var(--font-display); letter-spacing: -0.025em; color: var(--c-ink); }
.t-h1 { font: var(--fw-display) var(--fs-h1)/1.1 var(--font-display); letter-spacing: -0.02em; color: var(--c-ink); }
.t-h2 { font: 700 var(--fs-h2)/1.2 var(--font-display); letter-spacing: -0.01em; color: var(--c-ink); }
.t-h3 { font: var(--fw-semibold) var(--fs-h3)/1.35 var(--font-ui); color: var(--c-ink); }
.t-lead { font-size: var(--fs-lead); line-height: 1.5; color: var(--c-text-2); max-width: 58ch; }
.t-sm { font-size: var(--fs-sm); line-height: 1.45; }
.t-xs { font-size: var(--fs-xs); line-height: 1.35; }
.t-ink { color: var(--c-ink); }
.t-muted { color: var(--c-text-2); }
.t-strong { font-weight: var(--fw-semibold); color: var(--c-ink); }
.prose { max-width: 62ch; }
.prose p + p { margin-top: 10px; }

/* ───────────────────────── App shell ───────────────────────── */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 40; background: var(--c-surface); }

.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; background: var(--c-surface); border-bottom: 1px solid var(--c-border-faint); }
.topbar__row { display: flex; align-items: center; gap: 20px; height: var(--topbar-h); }
.topbar__search { flex: 1; max-width: 560px; }
.topbar__end { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.navrow { border-top: 1px solid var(--c-border-faint); }
.navrow__list { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; overflow-x: auto; scrollbar-width: none; }
.navrow__link {
  position: relative; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px;
  color: var(--c-text-2); text-decoration: none; font-size: 14px; white-space: nowrap;
}
.navrow__link:hover { color: var(--c-ink); }
.navrow__link[aria-current="page"] { color: var(--c-ink); font-weight: var(--fw-medium); }
.navrow__link[aria-current="page"]::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--c-primary); }
.navrow__link .count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-pill); background: var(--c-primary); color: var(--c-on-primary); font-size: 11px; font-weight: 600; display: inline-grid; place-items: center; }

/* Brand lockup. The ring around Mags counts down to the next check. */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--c-ink); text-decoration: none; flex: none; }
.brand:hover { color: var(--c-ink); }
.brand__mark { position: relative; width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--c-primary) calc(var(--tick, .62) * 1turn), var(--c-primary-light) 0); }
.brand__mark img { width: 32px; height: 32px; border-radius: 50%; background: var(--c-primary); object-fit: cover; object-position: 50% 18%; box-shadow: 0 0 0 2px var(--c-surface); }
.brand__name { font: var(--fw-display) 21px/1 var(--font-display); letter-spacing: -0.02em; }
.brand__name span { color: var(--c-text-2); }

.live { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px 0 10px; border-radius: var(--r-pill); color: var(--c-text-2); font-size: 13px; text-decoration: none; white-space: nowrap; }
.live:hover { background: var(--c-fill); color: var(--c-ink); }
.live b { color: var(--c-ink); font-weight: var(--fw-medium); }
.pulse { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--st-watching); flex: none; }
.pulse::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--st-watching); opacity: 0; animation: pulse 2.4s var(--ease-out) infinite; }
@keyframes pulse { 0% { transform: scale(.5); opacity: .7; } 70%, 100% { transform: scale(1.4); opacity: 0; } }

.main { padding-block: 28px 64px; }
.footer { border-top: 1px solid var(--c-border-faint); padding-block: 20px 28px; font-size: 13px; color: var(--c-text-2); }
.footer__row { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; justify-content: space-between; }
.footer a { color: var(--c-text-2); }

.tabbar { display: none; }

@media (max-width: 760px) {
  :root { --gutter: 16px; --topbar-h: 56px; }
  .topbar .topbar__search, .navrow, .topbar .live__long, .topbar .hide-sm { display: none; }
  .brand__name { font-size: 19px; }
  .main { padding-block: 18px calc(var(--tabbar-h) + 40px + env(safe-area-inset-bottom, 0px)); }
  .footer { padding-bottom: calc(var(--tabbar-h) + 24px + env(safe-area-inset-bottom, 0px)); }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; z-index: 30; left: 0; right: 0; bottom: 0;
    padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
    background: var(--c-surface); border-top: 1px solid var(--c-border);
  }
  .tabbar a, .tabbar button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: var(--tabbar-h);
    color: var(--c-text-2); text-decoration: none; font-size: 11px; font-weight: var(--fw-medium); background: none; border: 0; }
  .tabbar [aria-current="page"] { color: var(--c-primary); }
  .tabbar [aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--c-primary); }
  .tabbar .dot { position: absolute; top: 9px; left: calc(50% + 6px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--c-primary); color: var(--c-on-primary); font-size: 10px; line-height: 16px; text-align: center; box-shadow: 0 0 0 2px var(--c-surface); }
}

/* Page head */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 20px; }
.page-head__text { display: grid; gap: 6px; min-width: 0; }
.page-head__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.crumbs { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--c-text-2); }
.crumbs a { color: var(--c-text-2); }
.section { display: grid; gap: 14px; }
.section + .section { margin-top: 36px; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ───────────────────────── Buttons ───────────────────────── */
.btn {
  --lip: transparent;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border: 0; border-radius: var(--r-pill);
  font: 600 15px/1 var(--font-ui); text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: transform var(--dur-press), box-shadow var(--dur-press), background-color 120ms;
  -webkit-tap-highlight-color: transparent;
}
.btn:focus-visible { outline: none; box-shadow: 0 3px 0 var(--lip), var(--focus); border-radius: var(--r-pill); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .48; pointer-events: none; }
.btn--primary { --lip: var(--c-primary-lip); background: var(--c-primary); color: var(--c-on-primary); box-shadow: 0 3px 0 var(--lip); }
.btn--primary:hover { background: var(--c-primary-hover); color: var(--c-on-primary); }
.btn--primary:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--lip); }
.btn--secondary { background: var(--c-surface); color: var(--c-ink); box-shadow: inset 0 0 0 1.5px var(--c-control); }
.btn--secondary:hover { background: var(--c-fill); color: var(--c-ink); box-shadow: inset 0 0 0 1.5px var(--c-control-strong); }
.btn--secondary:active { background: var(--c-line); }
.btn--secondary:focus-visible { box-shadow: inset 0 0 0 1.5px var(--c-control), var(--focus); }
.btn--ghost { background: transparent; color: var(--c-text-2); padding: 0 12px; }
.btn--ghost:hover { background: var(--c-fill); color: var(--c-ink); }
.btn--ghost:focus-visible { box-shadow: var(--focus); }
.btn--link { background: none; color: var(--c-primary); padding: 0 4px; height: auto; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.btn--danger { --lip: #7a1f2a; background: var(--c-danger); color: #fff; box-shadow: 0 3px 0 var(--lip); }
.btn--danger:hover { color: #fff; filter: brightness(.95); }
.btn--danger:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--lip); }
.btn--danger-soft { background: var(--c-danger-tint); color: var(--c-danger-ink); box-shadow: inset 0 0 0 1.5px var(--c-danger-light); }
.btn--danger-soft:hover { color: var(--c-danger-ink); background: var(--c-danger-light); }
.btn--sm { height: 34px; padding: 0 14px; font-size: 13.5px; gap: 6px; }
.btn--sm.btn--primary { box-shadow: 0 2px 0 var(--lip); }
.btn--lg { height: 52px; padding: 0 28px; font-size: 16px; }
.btn--block { width: 100%; }
.btn--icon { width: 40px; height: 40px; padding: 0; color: var(--c-text-2); background: transparent; }
.btn--icon:hover { background: var(--c-fill); color: var(--c-ink); }
.btn--icon.btn--sm { width: 34px; height: 34px; }
.btn--icon[aria-pressed="true"] { color: var(--c-primary); background: var(--c-primary-tint); }
.btn .i { width: 18px; height: 18px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ───────────────────────── Form controls ───────────────────────── */
.field { display: grid; gap: 6px; min-width: 0; }
.label { font-size: 14px; font-weight: var(--fw-medium); color: var(--c-ink); }
.label small { font-weight: var(--fw-regular); color: var(--c-text-2); font-size: 13px; margin-left: 4px; }
.help { font-size: 13px; line-height: 1.45; color: var(--c-text-2); }
.help--ok { color: var(--c-success-ink); display: flex; gap: 6px; align-items: center; }
.help--error { color: var(--c-danger-ink); display: flex; gap: 6px; align-items: flex-start; }
.help--error .i, .help--ok .i { width: 16px; height: 16px; margin-top: 1px; }

.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: 0 14px; border-radius: var(--r-control);
  border: 1px solid var(--c-control-input); background: var(--c-surface); color: var(--c-ink);
  font-size: 16px; line-height: 1.35; transition: border-color 120ms;
}
.textarea { padding: 12px 14px; min-height: 88px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--c-text-2); opacity: .8; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--c-control-strong); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--c-primary); box-shadow: inset 0 0 0 1px var(--c-primary); }
.input[aria-invalid="true"] { border-color: var(--c-danger); box-shadow: inset 0 0 0 1px var(--c-danger); }
.select { appearance: none; padding-right: 40px; background-image: linear-gradient(45deg, transparent 50%, var(--c-text-2) 50%), linear-gradient(135deg, var(--c-text-2) 50%, transparent 50%); background-position: right 19px top 21px, right 14px top 21px; background-size: 5px 5px; background-repeat: no-repeat; }
.affix { position: relative; display: flex; align-items: center; }
.affix .input { padding-left: 34px; }
.affix__pre { position: absolute; left: 14px; color: var(--c-text-2); pointer-events: none; font-size: 16px; }
.affix__post { position: absolute; right: 14px; color: var(--c-text-2); pointer-events: none; font-size: 14px; }
.affix--post .input { padding-left: 14px; padding-right: 64px; }
.affix--icon .input { padding-left: 42px; }
.affix--icon .affix__pre { left: 14px; }
.searchbar { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: var(--r-pill); background: var(--c-fill); color: var(--c-text-2); }
.searchbar:focus-within { outline: 2px solid var(--c-primary); outline-offset: 2px; }
.searchbar input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 15px; color: var(--c-ink); }
.searchbar input:focus { outline: none; }
.searchbar input::placeholder { color: var(--c-text-2); }
.searchbar kbd { font: 500 11px/1 var(--font-ui); padding: 4px 6px; border-radius: 6px; background: var(--c-surface); color: var(--c-text-2); box-shadow: var(--ring); }
.grid-2 { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); } }

/* Checkbox */
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; color: var(--c-ink); font-size: 15px; }
.check input { appearance: none; width: 20px; height: 20px; margin: 0; flex: none; border-radius: 6px; box-shadow: inset 0 0 0 2px var(--c-control-strong); background: var(--c-surface); display: grid; place-items: center; cursor: pointer; }
.check input:checked { background: var(--c-primary); box-shadow: none; }
.check input:checked::after { content: ""; width: 10px; height: 6px; border: 2px solid var(--c-on-primary); border-top: 0; border-right: 0; transform: translate(0, -1px) rotate(-45deg); }
.check input:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 2px; }

/* Switch: teal when on (testers read red as "off/bad") */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { appearance: none; position: relative; width: 44px; height: 26px; margin: 0; flex: none; border-radius: var(--r-pill); background: var(--c-control-strong); cursor: pointer; transition: background-color var(--dur); }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-thumb); transition: transform var(--dur) var(--ease-out); }
.switch input:checked { background: var(--c-primary); }
.switch input:checked::after { transform: translateX(18px); }
.switch input:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 2px; }

/* Setting row: label + why on the left, control on the right */
.set { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 24px; align-items: center; padding: 16px 0; }
.set + .set { border-top: 1px solid var(--c-border-faint); }
.set__text { display: grid; gap: 2px; min-width: 0; }
.set__text .t-h3 { font-size: 15px; font-weight: var(--fw-medium); }
.set--stack { grid-template-columns: minmax(0, 1fr); }
.set--wide { grid-template-columns: minmax(200px, 300px) minmax(0, 1fr); align-items: start; }
@media (max-width: 640px) { .set--wide { grid-template-columns: minmax(0, 1fr); } }

/* Segmented control */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--r-pill); background: var(--c-fill); }
.seg button, .seg label { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--c-text-2); font-size: 14px; font-weight: var(--fw-medium); cursor: pointer; white-space: nowrap; }
.seg [aria-pressed="true"], .seg label:has(input:checked) { background: var(--c-surface); color: var(--c-ink); box-shadow: var(--shadow-thumb); }
.seg label input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:focus-visible) { outline: 2px solid var(--c-primary); outline-offset: 1px; }
.seg--icons button { width: 38px; padding: 0; justify-content: center; }

/* Choice rows and cards (real radios / checkboxes drive the look) */
.choices { display: grid; gap: 10px; }
.choices--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choices--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 640px) { .choices--2, .choices--3 { grid-template-columns: minmax(0, 1fr); } }
.choice {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px;
  min-height: 64px; padding: 12px 16px; border-radius: var(--r-choice); background: var(--c-surface);
  box-shadow: inset 0 0 0 1.5px var(--c-line); cursor: pointer; color: var(--c-ink);
  transition: box-shadow 120ms, background-color 120ms;
}
.choice:hover { box-shadow: inset 0 0 0 1.5px var(--c-control); }
.choice > input, .choice__row > input { position: absolute; opacity: 0; pointer-events: none; }
.choice:has(input:checked) { background: var(--c-primary-tint); box-shadow: inset 0 0 0 2px var(--c-primary); }
.choice:has(input:focus-visible) { outline: 2px solid var(--c-primary); outline-offset: 3px; }
.choice__icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--c-fill); color: var(--c-ink); flex: none; }
.choice__icon--code { font: 700 13px/1 var(--font-ui); letter-spacing: .02em; color: var(--c-ink); }
.choice__text { display: grid; gap: 2px; min-width: 0; }
.choice__title { font-weight: var(--fw-semibold); font-size: 15px; color: var(--c-ink); }
.choice__desc { font-size: 13px; line-height: 1.4; color: var(--c-text-2); }
.choice__tick { width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--c-control-strong); display: grid; place-items: center; color: var(--c-on-primary); }
.choice__tick .i { width: 14px; height: 14px; stroke-width: 3; opacity: 0; }
.choice:has(input:checked) .choice__tick { background: var(--c-primary); box-shadow: none; }
.choice:has(input:checked) .choice__tick .i { opacity: 1; }
.choice--compact { min-height: 52px; padding: 10px 14px; gap: 12px; }
.choice--card { grid-template-columns: minmax(0, 1fr) auto; align-items: start; padding: 16px; min-height: 0; }
.choice-more { display: none; grid-column: 1 / -1; padding-top: 6px; }
.choice:has(input:checked) .choice-more { display: block; }
/* A choice that opens a panel: the label row stays a real label, the panel is its sibling. */
.choice--group { display: block; padding: 0; cursor: default; }
.choice__row { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; min-height: 64px; padding: 12px 16px; cursor: pointer; border-radius: inherit; }
.choice--group .choice-more { padding: 2px 18px 18px; cursor: auto; }
.choice--group:has(.choice__row > input:focus-visible) { outline: 2px solid var(--c-primary); outline-offset: 3px; }

/* Chips (Vinted's filter chips: outlined pills, teal when set) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chips--scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; margin-inline: -2px; padding-inline: 2px; }
.chips--scroll::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: var(--r-pill);
  border: 1px solid var(--c-control); background: var(--c-surface); color: var(--c-ink); font-size: 14px; line-height: 1.2;
  white-space: nowrap; cursor: pointer; text-decoration: none; transition: background-color 120ms, border-color 120ms;
}
.chip:hover { border-color: var(--c-primary); background: var(--c-fill); color: var(--c-ink); }
.chip[aria-pressed="true"], .chip.is-on, .chip:has(input:checked) { background: var(--c-primary-tint); border-color: var(--c-primary); color: var(--c-ink); }
.chip:has(input:focus-visible) { outline: 2px solid var(--c-primary); outline-offset: 2px; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip .i { width: 16px; height: 16px; color: var(--c-text-2); }
.chip[aria-pressed="true"] .i, .chip:has(input:checked) .i { color: var(--c-primary); }
.chip--sm { min-height: 30px; padding: 0 11px; font-size: 13px; }
.chip--filled { background: var(--c-fill); border-color: transparent; }
.chip__x { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: -6px; border: 0; border-radius: 50%; background: transparent; color: var(--c-text-2); padding: 0; }
.chip__x:hover { background: var(--c-line); color: var(--c-ink); }
.chip__count { color: var(--c-text-2); font-size: 12px; }
.chip-label { font-size: 13px; color: var(--c-text-2); margin-right: 2px; }

/* Token input: chips typed into a field */
.tokens { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 46px; padding: 6px 8px; border-radius: var(--r-control); border: 1px solid var(--c-control-input); background: var(--c-surface); cursor: text; }
.tokens:focus-within { border-color: var(--c-primary); box-shadow: inset 0 0 0 1px var(--c-primary); }
.tokens input { flex: 1; min-width: 120px; height: 32px; border: 0; background: transparent; font-size: 16px; color: var(--c-ink); padding: 0 6px; }
.tokens input:focus { outline: none; }
.token { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 4px 0 11px; border-radius: var(--r-pill); background: var(--c-fill); color: var(--c-ink); font-size: 14px; }
.token--no { background: var(--c-danger-tint); color: var(--c-danger-ink); }
.token button { display: grid; place-items: center; width: 22px; height: 22px; border: 0; border-radius: 50%; background: transparent; color: inherit; padding: 0; opacity: .7; }
.token button:hover { opacity: 1; background: rgba(var(--c-ink-rgb), .08); }
.token .i { width: 14px; height: 14px; }
.combo { position: relative; }
.combo__list { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none; border-radius: var(--r-card); background: var(--c-surface); box-shadow: var(--shadow-float), var(--ring); max-height: 260px; overflow: auto; }
.combo__list li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 10px; border-radius: 8px; color: var(--c-ink); font-size: 14px; cursor: pointer; }
.combo__list li[aria-selected="true"], .combo__list li:hover { background: var(--c-primary-tint); }
.combo__list li small { color: var(--c-text-2); }
.combo__list mark { background: none; color: inherit; font-weight: 650; }

/* ───────────────────────── Surfaces ───────────────────────── */
.card { background: var(--c-surface); border-radius: var(--r-card); box-shadow: var(--ring); }
.card--pad { padding: 20px; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--c-border-faint); }
.card__body { padding: 20px; }
.card__foot { padding: 14px 20px; border-top: 1px solid var(--c-border-faint); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.rows > * + * { border-top: 1px solid var(--c-border-faint); }
.well { background: var(--c-surface-2); border-radius: var(--r-card); padding: 16px; }

/* Colour fields: the stage for Mags and live previews */
.field-panel { position: relative; border-radius: var(--r-field); color: var(--field-ink); overflow: hidden; }
.field-panel--teal { background: var(--field-teal); }
.field-panel--sun { background: var(--field-sun); }
.field-panel--lilac { background: var(--field-lilac); }
.field-panel--mint { background: var(--field-mint); }
.field-panel--rose { background: var(--field-rose); }
.field-panel h2, .field-panel h3, .field-panel p { color: var(--field-ink); }
.mags { display: block; height: auto; user-select: none; pointer-events: none; }

/* Notices and banners */
.notice { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; padding: 14px 16px; border-radius: var(--r-choice); background: var(--c-fill); color: var(--c-ink); font-size: 14px; line-height: 1.5; }
.notice > .i { color: var(--c-primary); margin-top: 1px; }
.notice strong { font-weight: var(--fw-semibold); }
.notice--sun { background: var(--c-amber-tint); }
.notice--sun > .i { color: var(--c-amber-ink); }
.notice--danger { background: var(--c-danger-tint); }
.notice--danger > .i { color: var(--c-danger-ink); }
.notice--ok { background: var(--c-success-tint); }
.notice--ok > .i { color: var(--c-success-ink); }
.notice--teal { background: var(--c-primary-tint); }
.notice p + p { margin-top: 4px; }
.notice .btn-row { margin-top: 10px; }

.banner { border-bottom: 1px solid var(--c-border-faint); color: var(--c-ink); font-size: 14px; }
.banner__row { display: flex; align-items: center; gap: 12px; padding-block: 10px; flex-wrap: wrap; }
.banner__row > .i { flex: none; }
.banner__text { flex: 1 1 320px; min-width: 0; }
.banner--danger { background: var(--c-danger-tint); }
.banner--danger .banner__row > .i { color: var(--c-danger-ink); }
.banner--sun { background: var(--c-amber-tint); }
.banner--sun .banner__row > .i { color: var(--c-amber-ink); }
.banner--teal { background: var(--c-primary-tint); }
.banner--teal .banner__row > .i { color: var(--c-primary); }
.banner--ink { background: var(--c-ink); color: var(--c-page); }
.banner--ink .btn--secondary { background: transparent; color: var(--c-page); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.4); }

/* Badges and status */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border-radius: var(--r-pill); font-size: 12px; font-weight: var(--fw-medium); white-space: nowrap; background: var(--c-fill); color: var(--c-text-2); }
.badge .i { width: 13px; height: 13px; }
.badge--new { background: var(--c-primary); color: var(--c-on-primary); }
.badge--deal { background: var(--c-amber); color: #15191a; }
.badge--ok { background: var(--c-success-tint); color: var(--c-success-ink); }
.badge--warn { background: var(--c-amber-tint); color: var(--c-amber-ink); }
.badge--bad { background: var(--c-danger-tint); color: var(--c-danger-ink); }
.badge--teal { background: var(--c-primary-tint); color: var(--c-primary); }
.badge--outline { background: transparent; box-shadow: var(--ring); }

.status { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: var(--fw-medium); color: var(--c-ink); white-space: nowrap; }
.status::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--st-c, var(--st-quiet)); flex: none; }
.status--watching { --st-c: var(--st-watching); }
.status--quiet { --st-c: var(--st-quiet); }
.status--stuck, .status--stale { --st-c: var(--st-stuck); }
.status--blocked { --st-c: var(--st-blocked); }
.status--paused::before { background: transparent; box-shadow: inset 0 0 0 2px var(--st-paused); }
.status--stuck::before, .status--stale::before { border-radius: 2px; transform: rotate(45deg) scale(.85); }       /* shape differs, not only colour */
.status--blocked::before { border-radius: 2px; }

.sdot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--sc, var(--c-text-3)); display: inline-block; }
.schip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-width: 0; font-size: 12px; color: var(--c-text-2); }
.schip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.schip .sdot { width: 8px; height: 8px; }

/* ───────────────────────── Item card (the hero component) ───────────────────────── */
.feed { display: grid; gap: 24px 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .feed { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 960px) { .feed { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .feed { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (max-width: 639px) { .feed { gap: 18px 10px; } }
.feed--3 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 10px; }

.item { position: relative; display: flex; flex-direction: column; gap: 8px; min-width: 0; color: var(--c-text-2); }
.item__media { position: relative; aspect-ratio: var(--photo-ratio); border-radius: var(--r-photo); overflow: hidden; background: var(--dominant, var(--c-fill)); }
.item__media img { width: 100%; height: 100%; object-fit: cover; }
.item__open { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.item__open:focus-visible { outline: 3px solid var(--c-primary); outline-offset: 2px; }
.item__flags { position: absolute; z-index: 2; top: 8px; left: 8px; right: 48px; display: flex; flex-wrap: wrap; gap: 4px; pointer-events: none; }
.item__save, .item__more {
  position: absolute; z-index: 2; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 0;
  background: var(--c-on-photo); color: var(--c-on-photo-ink-2); box-shadow: var(--shadow-thumb); padding: 0;
}
.item__save { right: 8px; bottom: 8px; }
.item__more { right: 8px; top: 8px; opacity: 0; transition: opacity var(--dur); }
.item:hover .item__more, .item__more:focus-visible, .item__more[aria-expanded="true"] { opacity: 1; }
@media (hover: none) { .item__more { opacity: 1; } }
.item__save .i, .item__more .i { width: 18px; height: 18px; }
.item__save:hover, .item__more:hover, .item__more[aria-expanded="true"] { color: var(--c-on-photo-ink); }
.item__save[aria-pressed="true"] { color: var(--c-danger); }
.item__save[aria-pressed="true"] .i { fill: currentColor; }
.item__body { display: flex; flex-direction: column; gap: 1px; flex: 1; padding: 0 2px; min-width: 0; font-size: 12.5px; line-height: 1.4; }
.item__title { color: var(--c-ink); font-size: 14px; font-weight: var(--fw-medium); line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item__meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item__prices { display: grid; gap: 0; margin-top: 4px; }
.item__base { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; }
.item__base s { color: var(--c-text-2); }
.item__total { display: inline-flex; align-items: center; gap: 4px; color: var(--c-primary); font-size: 15px; font-weight: var(--fw-semibold); }
.item__total small { font-size: 12px; font-weight: var(--fw-regular); }
.item__total .i { width: 13px; height: 13px; }
.item__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 6px; min-width: 0; }
.item__foot time { flex: none; font-size: 12px; color: var(--c-text-2); }
.item__seller { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; }
.item__seller .i { width: 12px; height: 12px; fill: var(--c-amber); stroke: var(--c-amber); }
.item.is-hidden { opacity: .4; }
.item.is-fresh .item__media { animation: fresh 2.4s var(--ease-out); }
@keyframes fresh { 0% { box-shadow: 0 0 0 0 rgba(var(--c-primary-rgb), .0); } 10% { box-shadow: 0 0 0 4px rgba(var(--c-primary-rgb), .9); } 100% { box-shadow: 0 0 0 4px rgba(var(--c-primary-rgb), 0); } }
.item.is-arriving { animation: arrive var(--dur-arrive) var(--ease-out); }
@keyframes arrive { from { opacity: 0; transform: translateY(-10px) scale(.97); } to { opacity: 1; transform: none; } }

/* Menu popover */
.menu { position: absolute; z-index: 40; min-width: 220px; margin: 0; padding: 6px; list-style: none; border-radius: var(--r-card); background: var(--c-surface); box-shadow: var(--shadow-float), var(--ring); }
.menu button, .menu a { display: flex; width: 100%; align-items: center; gap: 10px; padding: 10px 12px; border: 0; border-radius: 8px; background: none; color: var(--c-ink); font-size: 14px; text-align: left; text-decoration: none; }
.menu button:hover, .menu a:hover, .menu button:focus-visible { background: var(--c-fill); outline: none; color: var(--c-ink); }
.menu .i { width: 18px; height: 18px; color: var(--c-text-2); }
.menu .is-danger { color: var(--c-danger-ink); }
.menu .is-danger .i { color: var(--c-danger-ink); }
.menu hr { border: 0; border-top: 1px solid var(--c-border-faint); margin: 6px 4px; }

/* List view of finds */
.feed.is-list { grid-template-columns: minmax(0, 1fr) !important; gap: 0; }
.feed.is-list .item { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--c-border-faint); }
.feed.is-list .item__media { aspect-ratio: 3 / 4; border-radius: 6px; }
.feed.is-list .item__flags, .feed.is-list .item__save, .feed.is-list .item__more { display: none; }
.feed.is-list .item__body { grid-template-columns: minmax(0, 1fr) auto; column-gap: 16px; }
.feed.is-list .item__prices { grid-column: 2; grid-row: 1 / span 3; text-align: right; margin: 0; align-self: center; }
.feed.is-list .item__foot { grid-column: 1; }
.feed.is-list .item__list-actions { display: flex; }
.item__list-actions { display: none; gap: 2px; }

/* Placeholder tile when a listing has no photo */
.ph { width: 100%; height: 100%; display: grid; place-items: center; color: rgba(var(--c-ink-rgb), .35); }
.ph .i { width: 36px; height: 36px; stroke-width: 1.5; }

/* ───────────────────────── Home: watch band + toolbar ───────────────────────── */
.watchband { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: stretch; gap: 0 20px; padding: 0 20px 0 12px; margin-bottom: 24px; }
.watchband__mags { align-self: end; width: 104px; margin-bottom: -10px; }
.watchband__body { display: grid; gap: 14px; padding-block: 18px; min-width: 0; }
.watchband__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px; align-items: baseline; }
.watchband__head .t-h2 { font-size: 20px; }
.watchband__head p { font-size: 14px; }
.healthlist { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.healthlist::-webkit-scrollbar { display: none; }
.health { display: flex; align-items: center; gap: 10px; flex: none; height: 44px; padding: 0 14px 0 12px; border-radius: var(--r-pill); background: var(--c-surface); color: var(--c-ink); text-decoration: none; font-size: 13.5px; box-shadow: var(--ring); }
.health:hover { color: var(--c-ink); box-shadow: inset 0 0 0 1.5px var(--c-primary); }
.health .sdot { width: 10px; height: 10px; }
.health__name { font-weight: var(--fw-medium); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.health__n { color: var(--c-text-2); white-space: nowrap; }
.health .status { font-size: 12px; font-weight: var(--fw-regular); color: var(--c-text-2); }
.health--warn { box-shadow: inset 0 0 0 1.5px var(--st-stuck); }
.health--bad { box-shadow: inset 0 0 0 1.5px var(--st-blocked); }
@media (max-width: 640px) {
  .watchband { grid-template-columns: minmax(0, 1fr); padding: 0 14px; }
  .watchband__mags { display: none; }
  .watchband__head p { display: none; }
  .healthlist { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -14px; padding-inline: 14px; }
}

.toolbar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; padding-bottom: 14px; margin-bottom: 18px; border-bottom: 1px solid var(--c-border-faint); }
.toolbar__end { display: flex; align-items: center; gap: 8px; }
.resultline { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; font-size: 14px; flex-wrap: wrap; }

.newpill { position: sticky; top: calc(var(--topbar-h) + 56px); z-index: 20; display: flex; justify-content: center; height: 0; overflow: visible; }
.newpill button { transform: translateY(4px); box-shadow: 0 3px 0 var(--c-primary-lip), var(--shadow-float); }
@media (max-width: 760px) { .newpill { top: calc(var(--topbar-h) + 10px); } }

/* Empty state */
.empty { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 340px); align-items: center; gap: 24px; padding: 32px; }
.empty__text { display: grid; gap: 12px; max-width: 46ch; }
.empty__art { justify-self: center; align-self: end; margin-bottom: -32px; width: 100%; max-width: 300px; }
@media (max-width: 640px) { .empty { grid-template-columns: minmax(0, 1fr); padding: 24px 20px 0; } .empty__art { max-width: 200px; margin-bottom: -6px; } }

/* ───────────────────────── Searches list ───────────────────────── */
.slist { margin: 0; padding: 0; list-style: none; }
.srow {
  position: relative; display: grid; grid-template-columns: 24px 6px minmax(0, 1fr) 220px 104px var(--srow-actions); align-items: center; gap: 16px;
  padding: 16px 16px 16px 14px; border-bottom: 1px solid var(--c-border-faint);
}
.srow:hover { background: var(--c-surface-2); }
.srow.is-selected { background: var(--c-primary-tint); }
.srow__bar { align-self: stretch; width: 6px; border-radius: 3px; background: var(--sc); }
.srow__main { display: grid; gap: 4px; min-width: 0; }
.srow__name { font-size: 16px; font-weight: var(--fw-semibold); color: var(--c-ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srow__name:hover { color: var(--c-primary); }
.srow__sum { font-size: 13px; color: var(--c-text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srow__why { font-size: 13px; color: var(--c-text-2); line-height: 1.4; }
.srow__state { display: grid; gap: 3px; }
.srow__state small { font-size: 12px; color: var(--c-text-2); }
.srow__n { display: grid; gap: 0; text-align: right; }
.srow__n b { font: 700 20px/1.1 var(--font-display); color: var(--c-ink); }
.srow__n small { font-size: 12px; color: var(--c-text-2); }
.srow__actions { display: flex; gap: 2px; align-items: center; justify-content: flex-end; }
.srow__dest { display: inline-flex; gap: 10px; align-items: center; font-size: 12px; color: var(--c-text-2); flex-wrap: wrap; }
.srow__dest span { display: inline-flex; gap: 4px; align-items: center; }
.srow__dest .i { width: 14px; height: 14px; }
.srow--paused .srow__name { color: var(--c-text-2); }
/* The actions column has one fixed width in the head and every row, so the headings sit
   over their columns whatever buttons a row has. */
.slist { --srow-actions: 196px; }
.slist-head { --srow-actions: 196px; display: grid; grid-template-columns: 24px 6px minmax(0, 1fr) 220px 104px var(--srow-actions); gap: 16px; padding: 10px 16px 10px 14px; font-size: 12.5px; color: var(--c-text-2); border-bottom: 1px solid var(--c-border); }
.slist-head > :nth-child(5) { text-align: right; }
@media (max-width: 860px) {
  .slist-head { display: none; }
  .srow { grid-template-columns: 24px 6px minmax(0, 1fr) auto; grid-template-areas: "c b m a" "c b s n"; row-gap: 10px; padding: 14px 8px 14px 6px; gap: 10px 12px; }
  .srow > .check { grid-area: c; align-self: start; margin-top: 2px; }
  .srow__bar { grid-area: b; }
  .srow__main { grid-area: m; }
  .srow__state { grid-area: s; }
  .srow__n { grid-area: n; align-self: end; }
  .srow__actions { grid-area: a; align-self: start; }
  .srow__actions .hide-sm { display: none; }
}
.bulkbar { position: sticky; top: calc(var(--topbar-h) + 52px); z-index: 15; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 8px 8px 16px; margin-bottom: 8px; border-radius: var(--r-pill); background: var(--c-ink); color: var(--c-page); font-size: 14px; }
.bulkbar .btn--ghost { color: var(--c-page); }
.bulkbar .btn--ghost:hover { background: rgba(255,255,255,.12); color: var(--c-page); }
@media (max-width: 760px) { .bulkbar { top: calc(var(--topbar-h) + 8px); border-radius: var(--r-card); } }

/* ───────────────────────── Editor ───────────────────────── */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 32px; align-items: start; }
.editor__form { display: grid; gap: 20px; min-width: 0; }
.editor__aside { position: sticky; top: calc(var(--topbar-h) + 64px); display: grid; gap: 14px; }
.toc { display: flex; gap: 6px; flex-wrap: wrap; }
.esec { scroll-margin-top: calc(var(--topbar-h) + 64px); }
.esec__head { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 4px 14px; align-items: center; padding: 18px 20px 4px; }
.esec__icon { grid-row: span 2; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--c-primary-tint); color: var(--c-primary); }
.esec__head p { font-size: 13.5px; color: var(--c-text-2); }
.esec__body { display: grid; gap: 18px; padding: 16px 20px 22px; }
details.adv { border-top: 1px dashed var(--c-line); padding-top: 14px; }
details.adv summary { cursor: pointer; font-size: 14px; font-weight: var(--fw-medium); color: var(--c-ink); list-style: none; display: inline-flex; gap: 6px; align-items: center; }
details.adv summary::-webkit-details-marker { display: none; }
details.adv summary .i { transition: transform var(--dur); width: 16px; height: 16px; }
details.adv[open] summary .i { transform: rotate(90deg); }
details.adv > div { display: grid; gap: 16px; padding-top: 14px; }
.savebar { position: sticky; bottom: 0; z-index: 10; display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 14px 0 calc(14px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(transparent, var(--c-page) 30%); }
@media (max-width: 1080px) { .editor { grid-template-columns: minmax(0, 1fr); } .editor__aside { position: static; } }
@media (max-width: 760px) { .savebar { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); } }

.preview { padding: 20px; display: grid; gap: 14px; }
.preview__count { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.preview__count b { font: var(--fw-display) 44px/1 var(--font-display); letter-spacing: -0.03em; color: var(--field-ink); }
.preview__count span { font-size: 15px; color: var(--field-ink); }
.preview__thumbs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.preview__thumbs .t { position: relative; aspect-ratio: var(--photo-ratio); border-radius: 8px; overflow: hidden; background: var(--c-fill); }
.preview__thumbs .t img { width: 100%; height: 100%; object-fit: cover; }
.preview__thumbs .t span { position: absolute; left: 6px; bottom: 6px; padding: 3px 7px; border-radius: var(--r-pill); background: var(--c-on-photo); color: var(--c-on-photo-ink); font-size: 11.5px; font-weight: 600; }
.receipt { display: grid; gap: 0; font-size: 13.5px; }
.receipt__row { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 0; color: var(--field-ink); }
.receipt__row + .receipt__row { border-top: 1px solid rgba(var(--c-ink-rgb), .08); }
.receipt__row .i { width: 16px; height: 16px; }
.receipt__row b { font-weight: 600; font-variant-numeric: tabular-nums; }
.receipt__row--total { border-top: 2px solid rgba(var(--c-ink-rgb), .14) !important; font-weight: 600; }

/* Category tree */
.cattree { display: grid; gap: 10px; }
.crumbtrail { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 14px; }
.crumbtrail button { border: 0; background: none; padding: 2px 4px; border-radius: 6px; color: var(--c-primary); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.crumbtrail [aria-current] { color: var(--c-ink); text-decoration: none; font-weight: 600; }
.crumbtrail .i { width: 14px; height: 14px; color: var(--c-text-3); }

/* ───────────────────────── Tabs ───────────────────────── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--c-border); overflow-x: auto; scrollbar-width: none; }
.tab { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 16px; border: 0; background: none; color: var(--c-text-2); font-size: 14.5px; font-weight: var(--fw-medium); white-space: nowrap; cursor: pointer; }
.tab:hover { color: var(--c-ink); }
.tab[aria-selected="true"] { color: var(--c-ink); }
.tab[aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--c-primary); }
.tab .badge { height: 20px; padding: 0 7px; font-size: 11.5px; }
.tabpanel { padding-top: 20px; }

/* ───────────────────────── Stats ───────────────────────── */
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi { display: grid; gap: 4px; padding: 16px 18px; border-radius: var(--r-card); box-shadow: var(--ring); background: var(--c-surface); min-width: 0; }
.kpi__label { font-size: 13px; color: var(--c-text-2); }
.kpi__value { font: 600 28px/1.15 var(--font-ui); letter-spacing: -0.02em; color: var(--c-ink); }
.kpi__value small { font: 600 15px/1 var(--font-ui); color: var(--c-text-2); margin-left: 2px; letter-spacing: 0; }
.kpi__note { font-size: 12.5px; line-height: 1.4; color: var(--c-text-2); }
.kpi__note .up { color: var(--c-success-ink); }
.kpi__spark { height: 32px; margin-top: 4px; }
.chart { position: relative; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart text { fill: var(--c-text-2); font: 11.5px var(--font-ui); font-variant-numeric: tabular-nums; }
.chart .grid line { stroke: var(--c-border-faint); }
.chart .axis line { stroke: var(--c-border); }
.chart .bar { fill: var(--c-primary); }
.chart .bar:hover, .chart .bar.is-hot { fill: var(--c-primary-hover); }
.chart .hit { fill: transparent; }
.chart-wrap { overflow-x: auto; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--c-text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--sc); }
.tip { position: absolute; z-index: 30; pointer-events: none; padding: 8px 10px; border-radius: 10px; background: var(--c-ink); color: var(--c-page); font-size: 12.5px; line-height: 1.4; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); box-shadow: var(--shadow-float); }
.tip b { font-weight: 600; }
.heat { display: grid; grid-template-columns: 30px repeat(24, minmax(0, 1fr)); gap: 2px; font-size: 11px; color: var(--c-text-2); align-items: center; }
.heat .c { aspect-ratio: 1; border-radius: 3px; background: color-mix(in srgb, var(--c-primary) var(--a), var(--c-fill)); }
.heat .c:hover { outline: 2px solid var(--c-ink); outline-offset: 0; }
.heat .h { text-align: left; white-space: nowrap; }
.heat__day { font-size: 11px; }
.heat__legend { display: flex; align-items: center; gap: 3px; margin-top: 10px; font-size: 11.5px; color: var(--c-text-2); }
.heat__legend span:first-child { margin-right: 4px; } .heat__legend span:last-child { margin-left: 4px; }
.heat__legend i { width: 16px; height: 10px; border-radius: 2px; background: color-mix(in srgb, var(--c-primary) var(--a), var(--c-fill)); }

/* HTML column chart: one baseline, bars <= 24px, 4px rounded tops, hairline grid */
.cols { padding-left: 30px; }
.cols__plot { position: relative; height: 200px; }
.cols__tick { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--c-border-faint); }
.cols__tick:first-child { border-top-color: var(--c-border); }
.cols__tick span { position: absolute; left: -30px; width: 24px; text-align: right; transform: translateY(-50%); font-size: 11px; color: var(--c-text-2); font-variant-numeric: tabular-nums; }
.cols__bars { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 2px; }
.cols__col { position: relative; flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.cols__bar { position: relative; display: block; width: 100%; max-width: 24px; min-height: 2px; border-radius: 4px 4px 0 0; background: var(--c-primary); transition: background-color 120ms; }
.cols__bar.is-hot { background: var(--c-primary-hover); }
.cols__col .hit { position: absolute; inset: 0; border-radius: 4px; }
.cols__col .hit:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 1px; }
.cols__end { position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); font-size: 12px; font-weight: 600; color: var(--c-ink); }
.cols__x { display: flex; gap: 2px; margin-top: 6px; font-size: 11px; color: var(--c-text-2); }
.cols__x span { flex: 1; text-align: center; white-space: nowrap; overflow: visible; min-width: 0; }
.meter { display: block; height: 10px; border-radius: 5px; background: var(--c-primary-light); overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: 5px; background: var(--c-success); }
.meter--warn { background: var(--c-amber-light); } .meter--warn span { background: var(--c-amber); }
.meter--bad { background: var(--c-danger-light); } .meter--bad span { background: var(--c-danger); }
.hbar__val .i { display: inline-block; vertical-align: -2px; color: var(--c-danger-ink); }
.hbar__name .i { width: 16px; height: 16px; color: var(--c-text-2); }
@media (max-width: 640px) { .hbar { grid-template-columns: minmax(0, 1fr) 70px !important; } .hbar__track, .meter { grid-column: 1 / -1; grid-row: 2; } }
.hbars { display: grid; gap: 10px; }
.hbar { display: grid; grid-template-columns: minmax(110px, 200px) minmax(0, 1fr) 64px; gap: 12px; align-items: center; font-size: 13.5px; }
.hbar__name { display: flex; gap: 8px; align-items: center; color: var(--c-ink); min-width: 0; }
.hbar__name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar__track { height: 14px; border-radius: 0 4px 4px 0; background: var(--c-fill); position: relative; }
.hbar__fill { position: absolute; inset: 0 auto 0 0; border-radius: 0 4px 4px 0; background: var(--c-primary); }
.hbar__val { text-align: right; color: var(--c-ink); font-variant-numeric: tabular-nums; font-weight: 500; }
.chart-card { padding: 20px; display: grid; gap: 14px; min-width: 0; }
.chart-card__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.chart-card__head p { font-size: 13px; }
.stat-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 900px) { .stat-grid { grid-template-columns: minmax(0, 1fr); } }
.span-2 { grid-column: 1 / -1; }
.tableview summary { font-size: 13px; color: var(--c-primary); cursor: pointer; }
.dtable { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.dtable th, .dtable td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--c-border-faint); }
.dtable th { font-weight: 500; color: var(--c-text-2); font-size: 12.5px; }
.dtable td { color: var(--c-ink); }
.dtable .r { text-align: right; }

/* Timeline */
.timeline { margin: 0; padding: 0; list-style: none; display: grid; gap: 0; }
.tl { display: grid; grid-template-columns: 70px 20px minmax(0, 1fr); gap: 12px; padding: 0 0 18px; position: relative; }
.tl time { font-size: 12.5px; color: var(--c-text-2); text-align: right; padding-top: 1px; }
.tl__dot { width: 12px; height: 12px; margin: 4px auto 0; border-radius: 50%; background: var(--sc, var(--st-watching)); box-shadow: 0 0 0 4px var(--c-surface); position: relative; z-index: 1; }
.tl::before { content: ""; position: absolute; left: 91px; top: 10px; bottom: -4px; width: 2px; background: var(--c-line); }
.tl:last-child::before { display: none; }
.tl__text { font-size: 14px; color: var(--c-ink); }
.tl__text small { display: block; color: var(--c-text-2); font-size: 13px; }

/* Rejections ("Why wasn't this sent?") */
.rej { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 0; }
.rej + .rej { border-top: 1px solid var(--c-border-faint); }
.rej__img { aspect-ratio: 3 / 4; border-radius: 6px; overflow: hidden; background: var(--c-fill); }
.rej__img img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.6); }
.rej__title { font-size: 14px; color: var(--c-ink); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rej__why { font-size: 13.5px; color: var(--c-text-2); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.rej__why .i { width: 15px; height: 15px; color: var(--c-amber-ink); }
.rej__price { text-align: right; font-size: 14px; color: var(--c-ink); white-space: nowrap; }
.rej__price small { display: block; color: var(--c-text-2); font-size: 12px; }

/* ───────────────────────── Destinations ───────────────────────── */
.dests { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
@media (max-width: 900px) { .dests { grid-template-columns: minmax(0, 1fr); } }
.dest { display: grid; grid-template-rows: auto 1fr auto; }
.dest__head { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 18px 20px 14px; }
.dest__logo { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: #fff; }
.dest__logo .i { width: 22px; height: 22px; }
.dest__logo--discord { background: #5865f2; }
.dest__logo--telegram { background: #229ed9; }
.dest__logo--ntfy { background: #317f6f; }
.dest__logo--browser { background: var(--c-ink); color: var(--c-page); }
.dest__logo--apprise { background: #6b5b45; }
.dest__logo--webhook { background: #3b4a54; }
.dest__name { display: grid; gap: 2px; min-width: 0; }
.dest__name b { font-size: 16px; color: var(--c-ink); font-weight: var(--fw-semibold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dest__name small { font-size: 13px; color: var(--c-text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dest__body { padding: 0 20px 6px; }
.dest__body .set { padding: 12px 0; }
.dest__foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 14px 20px; border-top: 1px solid var(--c-border-faint); }
.dest__foot .grow { flex: 1; }
.dest--failing { box-shadow: inset 0 0 0 1.5px var(--c-danger); }

/* Fake chat surfaces for previews (never hold Mags) */
.chatmock { border-radius: 14px; background: #313338; color: #dbdee1; padding: 14px; font-size: 13px; line-height: 1.4; box-shadow: var(--shadow-float); }
.chatmock__who { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.chatmock__who img { width: 30px; height: 30px; border-radius: 50%; background: #007782; object-fit: cover; object-position: 50% 18%; }
.chatmock__who b { color: #f2f3f5; font-weight: 600; }
.chatmock__who small { color: #949ba4; font-size: 11px; }
.chatmock__embed { display: grid; grid-template-columns: minmax(0, 1fr) 76px; gap: 10px; padding: 10px 12px; border-radius: 6px; background: #2b2d31; border-left: 4px solid var(--sc, #2a78d6); }
.chatmock__embed b { color: #00a8fc; font-weight: 600; display: block; margin-bottom: 4px; }
.chatmock__embed .pr { color: #f2f3f5; font-weight: 600; }
.chatmock__embed .deal { display: inline-block; margin-top: 6px; padding: 2px 8px; border-radius: 999px; background: #f9bb42; color: #15191a; font-size: 11px; font-weight: 600; }
.chatmock__embed img { width: 76px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 4px; }
.chatmock__btns { display: flex; gap: 6px; margin-top: 8px; }
.chatmock__btns span { padding: 5px 10px; border-radius: 4px; background: #4e5058; color: #fff; font-size: 12px; }
.chatmock--tg { background: #0e1621; color: #e9eef3; }
.phone { width: 230px; border-radius: 30px; padding: 10px; background: #15191a; box-shadow: var(--shadow-float); }
.phone__screen { border-radius: 22px; background: #f2f4f4; overflow: hidden; padding: 30px 10px 14px; display: grid; gap: 8px; }
.notif { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 8px; padding: 10px; border-radius: 14px; background: rgba(255,255,255,.9); color: #15191a; font-size: 11.5px; line-height: 1.35; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.notif img { width: 28px; height: 28px; border-radius: 7px; background: #007782; object-fit: cover; object-position: 50% 18%; }
.notif b { font-weight: 600; display: block; }

/* Steps (a real sequence, so numbers carry information) */
.steps-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; counter-reset: s; }
.steps-list > li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; font-size: 14.5px; color: var(--c-ink); line-height: 1.5; counter-increment: s; }
.steps-list > li::before { content: counter(s); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--c-primary-tint); color: var(--c-primary); font-weight: 700; font-size: 13px; }
.steps-list kbd, .code { font: 500 13px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 2px 6px; border-radius: 6px; background: var(--c-fill); color: var(--c-ink); }
.pair-code { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 16px; border-radius: var(--r-choice); background: var(--c-surface-2); box-shadow: var(--ring); }
.pair-code b { font: var(--fw-display) 30px/1 var(--font-display); letter-spacing: .12em; color: var(--c-ink); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--c-primary-light); border-top-color: var(--c-primary); animation: spin .9s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ───────────────────────── Dialog, sheet, toast ───────────────────────── */
dialog.modal { width: min(520px, calc(100vw - 32px)); max-height: min(86vh, 760px); padding: 0; border: 0; border-radius: 20px; background: var(--c-surface); color: var(--c-text-2); box-shadow: var(--shadow-float); overflow: auto; }
dialog.modal--wide { width: min(880px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: var(--c-scrim); }
dialog.modal[open] { animation: pop var(--dur) var(--ease-out); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 22px 22px 6px; }
.modal__body { padding: 10px 22px 8px; display: grid; gap: 16px; }
.modal__foot { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; padding: 16px 22px 22px; }
@media (max-width: 640px) {
  dialog.modal { width: 100vw; max-width: 100vw; max-height: 92vh; margin: auto 0 0; border-radius: 22px 22px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
  dialog.modal[open] { animation: sheet var(--dur-arrive) var(--ease-out); }
  .modal__foot .btn { flex: 1; }
}
@keyframes sheet { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.quick { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0; }
.quick__media { background: var(--c-fill); aspect-ratio: var(--photo-ratio); max-height: 70vh; width: 100%; }
.quick__media img { width: 100%; height: 100%; object-fit: cover; }
.quick__info { padding: 24px; display: grid; gap: 14px; align-content: start; }
.dl { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 8px 12px; font-size: 14px; margin: 0; }
.dl dt { color: var(--c-text-2); }
.dl dd { margin: 0; color: var(--c-ink); }
@media (max-width: 640px) { .quick { grid-template-columns: minmax(0, 1fr); } .quick__media { max-height: 46vh; aspect-ratio: auto; height: 46vh; } }

.toasts { position: fixed; z-index: 60; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); display: grid; gap: 8px; justify-items: center; width: max-content; max-width: calc(100vw - 32px); pointer-events: none; }
@media (max-width: 760px) { .toasts { bottom: calc(var(--tabbar-h) + 14px + env(safe-area-inset-bottom, 0px)); } }
.toast { pointer-events: auto; display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 10px 8px 14px; border-radius: var(--r-pill); background: var(--c-ink); color: var(--c-page); font-size: 14px; font-weight: 500; box-shadow: var(--shadow-float); animation: toast-in var(--dur) var(--ease-out); max-width: 100%; }
.toast .i { color: var(--c-primary-medium); width: 18px; height: 18px; }
.toast--ok .i { color: #8ad0a8; }
.toast img { width: 32px; height: 40px; border-radius: 6px; object-fit: cover; }
.toast a, .toast button { color: var(--c-primary-medium); background: none; border: 0; font-weight: 600; padding: 4px 8px; border-radius: var(--r-pill); text-decoration: none; }
.toast a:hover, .toast button:hover { background: rgba(255,255,255,.1); color: var(--c-primary-medium); }
:root[data-theme="dark"] .toast .i, :root[data-theme="dark"] .toast a { color: var(--c-primary-lip); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

/* ───────────────────────── Onboarding ───────────────────────── */
.ob { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) clamp(380px, 42vw, 720px); gap: 24px; padding: 24px; padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); background: var(--c-page); }
.ob__main { display: grid; grid-template-rows: auto 1fr auto; gap: 24px; padding: 4px 24px 0 16px; min-width: 0; }
.ob__top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.ob__top-end { display: flex; align-items: center; gap: 16px; }
.ob__q { align-self: center; display: grid; gap: 22px; max-width: 600px; width: 100%; padding-block: 16px; }
.ob__q > h1:focus { outline: none; }
.ob__nav { display: flex; align-items: center; gap: 12px; padding-bottom: 8px; flex-wrap: wrap; }
.ob__nav .hint { font-size: 13px; color: var(--c-text-2); margin-left: 6px; }
.ob__field { position: sticky; top: 24px; height: calc(100vh - 48px); height: calc(100dvh - 48px); min-height: 560px; display: grid; grid-template-rows: auto 1fr auto; padding: 32px; }
.ob__field-say { display: grid; gap: 6px; max-width: 34ch; }
.ob__field-say b { font: var(--fw-display) 30px/1.06 var(--font-display); letter-spacing: -0.02em; color: var(--field-ink); }
.ob__field-say span { font: 700 19px/1.25 var(--font-display); color: var(--field-ink); opacity: .82; }
.ob__field-stage { display: grid; place-items: center; min-height: 0; }
.ob__mags { justify-self: center; align-self: end; max-height: max(200px, calc(100vh - 460px)); width: auto; margin-bottom: -38px; }
.ob__mags--corner { position: absolute; right: 22px; bottom: -8px; width: clamp(110px, 12vw, 170px); max-height: none; margin: 0; }
.steps { display: inline-flex; align-items: center; gap: 6px; }
.steps i { width: 8px; height: 8px; border-radius: 50%; background: var(--c-primary-light); }
.steps i.is-done { background: var(--c-primary); }
.steps i.is-now { width: 26px; height: 10px; border-radius: 5px; background: var(--c-primary); }
.promises { display: grid; gap: 0; padding: 4px 18px; }
.promise { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 14px; align-items: center; padding: 14px 0; }
.promise + .promise { border-top: 1px solid var(--c-border-faint); }
.promise__icon { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--c-success-tint); color: var(--c-success-ink); }
.promise__icon .i { width: 18px; height: 18px; }
.promise b { display: block; color: var(--c-ink); font-weight: var(--fw-semibold); font-size: 15px; }
.promise span { font-size: 13.5px; color: var(--c-text-2); }
details.faq { border-radius: var(--r-choice); }
details.faq summary { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; color: var(--c-primary); font-weight: 500; font-size: 14.5px; list-style: none; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq[open] summary { margin-bottom: 10px; }
details.faq .prose { font-size: 14px; color: var(--c-text-2); padding: 14px 16px; border-radius: var(--r-choice); background: var(--c-surface-2); }
.summary-card { display: grid; gap: 0; }
.summary-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px 18px; }
.summary-row + .summary-row { border-top: 1px solid var(--c-border-faint); }
.summary-row .choice__icon { width: 36px; height: 36px; border-radius: 10px; }
.summary-row small { display: block; color: var(--c-text-2); font-size: 13px; }
.summary-row b { color: var(--c-ink); font-weight: var(--fw-semibold); font-size: 15px; }
.minifeed { width: min(100%, 380px); display: grid; gap: 10px; }
.minifeed__row { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px; border-radius: 14px; background: var(--c-surface); box-shadow: var(--ring); color: var(--c-ink); font-size: 13.5px; }
.minifeed__row img { width: 54px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 6px; }
.minifeed__row b { display: block; font-weight: 600; font-size: 14px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.minifeed__row small { color: var(--c-text-2); }
.minifeed__row .p { color: var(--c-primary); font-weight: 600; }
.minifeed__row--new { animation: loop-in 7s var(--ease-out) infinite; box-shadow: inset 0 0 0 2px var(--c-primary); }
@keyframes loop-in { 0%, 8% { opacity: 0; transform: translateY(-14px); } 16%, 88% { opacity: 1; transform: none; } 96%, 100% { opacity: 0; } }
.loop-notif { animation: loop-notif 7s var(--ease-out) infinite; }
@keyframes loop-notif { 0%, 22% { opacity: 0; transform: translateY(-10px) scale(.96); } 30%, 88% { opacity: 1; transform: none; } 96%, 100% { opacity: 0; } }
.mini-card { width: 220px; display: grid; gap: 8px; padding: 12px; border-radius: 18px; background: var(--c-surface); box-shadow: var(--shadow-float); }
.mini-card .item__media { aspect-ratio: 4 / 5; }
.country-more { display: flex; justify-content: flex-start; }
@media (max-width: 960px) {
  .ob { grid-template-columns: minmax(0, 1fr); padding: 0; gap: 0; }
  .ob__main { padding: 16px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); gap: 16px; }
  .ob__q { align-self: start; padding-block: 8px; gap: 18px; }
  .ob__field { position: relative; top: 0; height: auto; min-height: 0; margin: 0 16px 16px; padding: 22px; border-radius: 24px; gap: 14px; }
  .ob__field-say b { font-size: 24px; }
  .ob__field-say span { font-size: 16px; }
  .ob__mags { max-height: 200px; margin-bottom: -22px; }
  .ob__mags--corner { width: 96px; right: 12px; }
  .ob__nav { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--c-page) 22%); padding: 18px 0 calc(10px + env(safe-area-inset-bottom, 0px)); margin-inline: -4px; padding-inline: 4px; z-index: 5; }
  .ob__nav .hint { display: none; }
  .ob--field-first .ob__field { order: -1; margin-top: 0; }
  .ob__top .skip-setup-long { display: none; }
}

/* ───────────────────────── Settings ───────────────────────── */
.settings { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 40px; align-items: start; }
.snav { position: sticky; top: calc(var(--topbar-h) + 64px); display: grid; gap: 2px; }
.snav a { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border-radius: 10px; color: var(--c-text-2); text-decoration: none; font-size: 14.5px; }
.snav a .i { width: 18px; height: 18px; }
.snav a:hover { background: var(--c-fill); color: var(--c-ink); }
.snav a[aria-current="true"] { background: var(--c-primary-tint); color: var(--c-ink); font-weight: 500; }
.snav a[aria-current="true"] .i { color: var(--c-primary); }
.snav__aside { margin-top: 18px; padding: 14px; border-radius: var(--r-card); background: var(--c-amber-tint); font-size: 13px; color: var(--c-ink); display: grid; gap: 8px; }
.ssec { scroll-margin-top: calc(var(--topbar-h) + 64px); }
.ssec + .ssec { margin-top: 28px; }
.ssec > .t-h2 { margin-bottom: 4px; }
.ssec > p { margin-bottom: 12px; font-size: 14px; }
.ssec .card { padding: 4px 20px; }
.ssec .card--pad { padding: 20px; }
@media (max-width: 900px) { .settings { grid-template-columns: minmax(0, 1fr); gap: 16px; } .snav { position: static; display: flex; overflow-x: auto; gap: 6px; scrollbar-width: none; } .snav a { flex: none; height: 36px; border-radius: var(--r-pill); box-shadow: var(--ring); } .snav__aside { display: none; } }
.diag { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 0 20px; align-items: center; padding: 20px 20px 20px 24px; }
.diag__rows { display: grid; gap: 0; }
.diag__mags { width: 140px; align-self: end; margin-bottom: -20px; }
@media (max-width: 640px) { .diag { grid-template-columns: minmax(0, 1fr); padding: 18px; } .diag__mags { display: none; } }

/* Watchlist */
.wrow { display: grid; grid-template-columns: 64px minmax(0, 1fr) 150px 140px auto; gap: 16px; align-items: center; padding: 14px 16px; }
.wrow + .wrow { border-top: 1px solid var(--c-border-faint); }
.wrow__img { aspect-ratio: 3 / 4; border-radius: 8px; overflow: hidden; background: var(--c-fill); }
.wrow__img img { width: 100%; height: 100%; object-fit: cover; }
.wrow__main { display: grid; gap: 4px; min-width: 0; }
.wrow__title { color: var(--c-ink); font-weight: var(--fw-medium); font-size: 15px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.wrow__sub { font-size: 13px; color: var(--c-text-2); }
.wrow__price { text-align: right; }
.wrow__price b { display: block; color: var(--c-ink); font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.wrow__price s { font-size: 12.5px; color: var(--c-text-2); }
.wrow__spark { height: 34px; }
.wrow__spark svg { width: 100%; height: 34px; }
.avatar { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font: 700 18px/1 var(--font-display); color: #fff; background: var(--sc, var(--c-text-2)); }
@media (max-width: 760px) {
  .wrow { grid-template-columns: 56px minmax(0, 1fr) auto; grid-template-areas: "i m p" "i s a"; gap: 6px 12px; padding: 12px 6px; }
  .wrow__img, .wrow > .avatar { grid-area: i; align-self: start; }
  .wrow__main { grid-area: m; }
  .wrow__price { grid-area: p; }
  .wrow__spark { grid-area: s; width: 100%; max-width: 160px; }
  .wrow__act { grid-area: a; justify-self: end; }
}

/* Skeleton */
.skeleton { border-radius: var(--r-photo); background: linear-gradient(90deg, var(--c-fill) 0%, var(--c-line) 50%, var(--c-fill) 100%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Utilities */
.stack { display: grid; gap: 12px; }
.stack-lg { display: grid; gap: 20px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.mt-0 { margin-top: 0 !important; }
.hide { display: none !important; }
@media (max-width: 760px) { .hide-sm { display: none !important; } }
@media (min-width: 761px) { .show-sm { display: none !important; } }
hr.sep { border: 0; border-top: 1px solid var(--c-border-faint); margin: 0; }

/* Proto-only: page index for reviewers (not part of the real app) */
.proto-index { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.proto-index a { display: block; padding: 14px 16px; border-radius: var(--r-card); box-shadow: var(--ring); color: var(--c-ink); text-decoration: none; }
.proto-index a:hover { box-shadow: inset 0 0 0 1.5px var(--c-primary); }
.proto-index small { display: block; color: var(--c-text-2); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
  .minifeed__row--new, .loop-notif { animation: none; opacity: 1; transform: none; }
  .pulse::after { display: none; }
}

/* Toolbar chip rows scroll inside their own box instead of widening the page */
.toolbar > .row { min-width: 0; flex: 1 1 auto; }
.chips--scroll { max-width: 100%; min-width: 0; }
@media (max-width: 760px) {
  .toolbar { gap: 10px; }
  .toolbar > .row { flex-direction: column; align-items: stretch; width: 100%; }
  .toolbar > .row > h1 { display: none; }
  .toolbar__end { width: 100%; justify-content: space-between; }
}

/* A sample alert in Mags' speech bubble on the hello screen */
.bubble { position: relative; display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px; align-items: center; width: min(100%, 360px); padding: 12px 16px 12px 12px; border-radius: 20px; background: var(--c-surface); color: var(--c-ink); box-shadow: var(--shadow-float); margin-top: 8px; }
.bubble::after { content: ""; position: absolute; left: 50%; bottom: -10px; width: 20px; height: 20px; background: var(--c-surface); transform: translateX(-50%) rotate(45deg); border-radius: 0 0 4px 0; }
.bubble img { width: 64px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 8px; }
.bubble div { display: grid; gap: 2px; min-width: 0; font-size: 13px; color: var(--c-text-2); }
.bubble b { color: var(--c-ink); font-size: 15px; font-weight: 600; }
.bubble .p { color: var(--c-primary); font-weight: 600; font-size: 14px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bubble em { font-style: normal; }
@media (max-width: 960px) { .bubble { width: 100%; } }
.livecount { display: none; }
@media (max-width: 960px) {
  .livecount { display: block; padding: 12px 16px; border-radius: var(--r-choice); background: var(--field-sun); color: var(--field-ink); font-size: 14.5px; }
  .livecount b { font: var(--fw-display) 20px/1 var(--font-display); margin-right: 2px; }
  .ob__mags--corner { position: static; justify-self: end; width: 92px; margin: -8px -4px -22px 0; }
}
.ob__mags--left { right: auto; left: 18px; width: clamp(150px, 15vw, 210px); }
@media (max-width: 960px) { .ob__mags--left { justify-self: start; width: 130px; margin-left: -6px; } }

/* Icons sitting inside a sentence */
p > .i, .help > .i:only-child, li > span > .i { display: inline-block; vertical-align: -3px; margin-right: 2px; }
.well.stack { align-content: start; }
/* Show a dependent field only while its switch is on */
.esec__body:has(#deal-on:not(:checked)) [data-dep="deal-on"],
.esec__body:has(#quiet-on:not(:checked)) [data-dep="quiet-on"] { display: none; }

/* Sign in */
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px)); }
.login__card { position: relative; width: min(100%, 460px); padding: 132px 14px 14px; }
.login__mags { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); width: 132px; }
.login__form { position: relative; display: grid; gap: 14px; padding: 24px; }

@media (max-width: 640px) {
  .set { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .set:has(> .switch), .set:has(> .btn:only-of-type) { grid-template-columns: minmax(0, 1fr) auto; }
  .set > .select, .set > .input { width: 100% !important; }
  .set > .seg { justify-self: start; }
  .kpi { padding: 14px; }
  .kpi__value { font-size: 24px; }
}

/* ───────────────────────── Review round 1 (UX/UI + personas) ───────────────────────── */
/* Checkboxes and radios get the input ring that passes 3:1. */
.check input { box-shadow: inset 0 0 0 2px var(--c-control-input); }
/* The lip only on big primary and danger buttons; small ones are flat so they never read as chips. */
.btn--sm.btn--primary, .btn--sm.btn--danger { box-shadow: none; }
.btn--sm.btn--primary:active, .btn--sm.btn--danger:active { transform: none; }
.btn--secondary { box-shadow: inset 0 0 0 1.5px var(--c-control-input); font-weight: 600; }
/* Read-only labels (where a search sends, which searches use a place): no ring, so not a control. */
.tag { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 0 10px; border-radius: var(--r-pill); background: var(--c-fill); color: var(--c-ink); font-size: 12.5px; text-decoration: none; }
a.tag:hover { background: var(--c-line); color: var(--c-ink); }
/* Photo buttons stay white in dark mode, like Vinted's. */
.item__save, .item__more { color: #15191a; }
/* List view: a real two-column body, with the deal badge kept inline. */
.feed.is-list .item__body { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto 1fr; column-gap: 16px; }
.feed.is-list .item__prices { grid-column: 2; grid-row: 1 / 3; text-align: right; }
.feed.is-list .item__foot { grid-column: 1 / -1; }
.feed.is-list .item__flags { position: static; display: flex; padding: 0; grid-column: 1; }
.feed.is-list .item__flags .badge--new { display: none; }
.feed.is-list .item__media .item__flags { display: none; }
.item__inline-deal { display: none; }
.feed.is-list .item__inline-deal { display: inline-flex; margin-top: 2px; width: max-content; }
/* Task pages (editor, setup) hide the tab bar; sticky bars get a solid surface. */
body.is-task .tabbar { display: none; }
body.is-task .savebar { bottom: 0; }
.savebar { background: var(--c-page); box-shadow: 0 -1px 0 var(--c-line); padding-inline: 12px; margin-inline: -12px; border-radius: 0; }
@media (max-width: 760px) {
  .savebar .btn--primary { flex: 1; }
  .ob__nav { position: sticky; bottom: 0; z-index: 10; background: var(--c-surface); box-shadow: 0 -1px 0 var(--c-line); padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); margin-inline: -16px; }
  .ob__nav .btn--primary { flex: 1; }
  .watchband .healthlist { display: none; }
  .watchband.is-open .healthlist { display: flex; }
}
.watchband__summary { display: none; }
@media (max-width: 760px) { .watchband__summary { display: flex; } }
/* Text on colour fields uses the -ink variants so it passes 4.5:1. */
.field-panel .ok-ink { color: var(--c-success-ink); }
.field-panel .bad-ink { color: var(--c-danger-ink); }
.set .bad-ink { color: var(--c-danger-ink); }
/* What uv or pipx printed while updating, for when it goes wrong. */
.update-log { margin: 0; max-height: 220px; overflow: auto; white-space: pre-wrap; word-break: break-word; padding: 10px 12px; font-size: 12px; }
.field-panel p a { color: var(--field-ink, var(--c-ink)); text-decoration: underline; }
.status--stuck::before { background: #b07600; }
/* Collapsed editor sections show what they hold in one line. */
details.esec-fold { padding: 0; }
details.esec-fold > summary { list-style: none; cursor: pointer; padding: 20px 22px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; }
details.esec-fold > summary::-webkit-details-marker { display: none; }
details.esec-fold > summary .esec__sum { color: var(--c-text-2); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
details.esec-fold[open] > summary .esec__sum { display: none; }
details.esec-fold > summary > .i:last-child { transition: transform var(--dur); color: var(--c-text-2); }
details.esec-fold[open] > summary > .i:last-child { transform: rotate(90deg); }
details.esec-fold > .esec__body { padding: 0 22px 22px; }
/* "or" groups inside token inputs. */
.token__or { font-size: 12px; color: var(--c-text-2); padding: 0 2px; }
.token .token__add-or { width: auto; padding: 0 6px; border-radius: var(--r-pill); font-size: 12px; opacity: .8; }
/* Phone access QR. */
.qr { display: grid; place-items: center; width: 168px; height: 168px; padding: 10px; background: #fff; border-radius: 14px; box-shadow: var(--ring); }
.qr svg, .qr img { width: 100%; height: 100%; }
.qr { flex: none; }
/* A password or token shown to be copied: monospace, so 1 and l can't be confused. */
.code-input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .02em; }
@media (max-width: 520px) { .phone-addr { flex-direction: column; align-items: flex-start !important; } }
/* Field error under an input. */
.input[aria-invalid="true"], .select[aria-invalid="true"], .tokens[aria-invalid="true"] { border-color: var(--c-danger); }
/* Keyboard shortcuts help. */
.kbd-list { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; }
.kbd-list kbd { font: 600 12px/1 var(--font-ui); padding: 5px 8px; border-radius: 6px; background: var(--c-fill); box-shadow: var(--ring); }
.item.is-cursor { outline: 3px solid var(--c-primary); outline-offset: 4px; border-radius: 10px; }
.item:focus-within { outline: 2px solid var(--c-primary); outline-offset: 4px; border-radius: 10px; }
.item:has(.item__open:focus-visible) .item__open { outline: none; }
@media (min-width: 1600px) { .feed:not(.is-list) { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.tab:focus-visible { outline-offset: -4px; border-radius: 8px; }
.ob__field-say span { font: 400 17px/26px var(--font-ui); max-width: 34ch; }
.sound-label { font-size: 13px; font-weight: 500; }
/* Native selects and popovers that sit among the filter chips. */
select.chip, .chip--select { appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--c-text-2) 50%), linear-gradient(135deg, var(--c-text-2) 50%, transparent 50%); background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%; background-size: 5px 5px; background-repeat: no-repeat; font: inherit; font-size: 14px; }
.chip-pop { position: relative; }
.chip-pop > summary { list-style: none; }
.chip-pop > summary::-webkit-details-marker { display: none; }
.chip-pop__panel { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; width: 260px; padding: 14px; display: grid; gap: 10px; box-shadow: var(--shadow-float), var(--ring); }
.chip-pop__title { display: none; }
.chip.is-invalid { border-color: var(--c-danger); }
/* On a phone the price filter is a sheet from the bottom, not a box that hangs off the
   side of a scrolling chip row and drags the page with it. */
@media (max-width: 760px) {
  .chip-pop__panel { position: fixed; z-index: 45; top: auto; left: 0; right: 0; bottom: 0; width: auto; border-radius: 20px 20px 0 0; padding: 18px var(--gutter) calc(18px + env(safe-area-inset-bottom, 0px)); white-space: normal; box-shadow: 0 -8px 32px rgba(var(--c-ink-rgb), .18), var(--ring); }
  .chip-pop__title { display: block; }
  /* The sheet is fixed to the screen, so the chip row can keep scrolling inside itself. */
  .toolbar .chips--scroll:has(.chip-pop[open]) { overflow-x: auto; }
  .chip-pop__fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; align-items: start; }
  .chip-pop__panel .btn { min-height: 46px; }
}
.chips--scroll:has(.chip-pop[open]) { overflow: visible; }
/* Row menus on the Searches list. */
.rowmenu { position: relative; }
.rowmenu > summary { list-style: none; }
.rowmenu > summary::-webkit-details-marker { display: none; }
.rowmenu__list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 180px; display: grid; }
.rowmenu__list a, .rowmenu__list button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; background: none; font: inherit; font-size: 14px; color: var(--c-ink); text-decoration: none; border-radius: 8px; cursor: pointer; text-align: left; }
.rowmenu__list a:hover, .rowmenu__list button:hover { background: var(--c-fill); }
.rowmenu__list .is-danger { color: var(--c-danger-ink); }
.rowmenu__list form { margin: 0; }
.srow__actions { display: flex; gap: 2px; align-items: center; }
.srow__actions form { margin: 0; }
.meta > * + *::before { content: "·"; margin-right: 6px; color: var(--c-text-3); }
@media (max-width: 720px) {
  /* No checkbox column on a phone: the colour bar starts the row. */
  .srow > .check { display: none; }
  .srow { grid-template-columns: 6px minmax(0, 1fr) auto; grid-template-areas: "b m a" "b s n"; padding-inline: 12px 6px; }
  .srow__sum { white-space: nowrap; }
  /* Each place on its own words, with gaps instead of dots that end up starting a line. */
  .srow__dest { gap: 4px 12px; }
  .srow__dest > * + *::before { content: none; }
}
.seg a { display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border-radius: var(--r-pill); color: var(--c-text-2); font-size: 14px; font-weight: var(--fw-medium); text-decoration: none; white-space: nowrap; }
.seg a[aria-pressed="true"] { background: var(--c-surface); color: var(--c-ink); box-shadow: var(--shadow-thumb); }
.seg--wrap { flex-wrap: wrap; border-radius: 18px; }
@media (max-width: 480px) { .seg--wrap label { padding: 0 10px; } }
.savebar__count { flex: 1; min-width: 0; }

select.chip { width: auto; max-width: 220px; }
.ob__nav [aria-label="Back"] { order: -1; }

/* ───────────────────────── Round-three fixes ───────────────────────── */
/* Two lines of title on a phone: one line of a Vinted title is mostly the brand. */
@media (max-width: 720px) {
  .item__title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
}

/* Failures look different from successes, not only in words. */
.toast--bad { background: var(--c-danger-ink); color: #fff; }
.toast--bad .i, :root[data-theme="dark"] .toast--bad .i { color: #ffd6db; }

/* Quick view: close sits on the photo, the buy button stays in reach on a phone. */
.quick__media { position: relative; }
.quick__close { position: absolute; z-index: 2; top: 12px; right: 12px; background: var(--c-on-photo); color: var(--c-on-photo-ink); box-shadow: var(--shadow-thumb); }
.quick__close:hover { background: var(--c-on-photo); color: var(--c-on-photo-ink); }
.quick__acts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
@media (max-width: 640px) {
  .quick__media { height: 45vh; max-height: 45vh; }
  .quick__buy { position: sticky; bottom: 0; z-index: 2; margin-inline: -24px; padding: 10px 24px calc(10px + env(safe-area-inset-bottom, 0px)); background: var(--c-surface); border-top: 1px solid var(--c-border-faint); }
}

/* Dialog buttons stay visible when the body scrolls. */
.modal__foot { position: sticky; bottom: 0; z-index: 3; background: var(--c-surface); border-top: 1px solid var(--c-border-faint); }

/* A place's options fold away under one line. */
.dest__opts > summary { display: flex; align-items: center; gap: 8px; padding: 10px 0; list-style: none; cursor: pointer; color: var(--c-ink); font-weight: var(--fw-semibold); font-size: 14px; }
.dest__opts > summary::-webkit-details-marker { display: none; }
.dest__opts > summary small { font-weight: var(--fw-regular); }
.dest__opts > summary .i { transition: transform var(--dur); }
.dest__opts[open] > summary .i { transform: rotate(90deg); }

/* Checkbox chips show a tick when on, so on and off read without comparing borders. */
.chip--check .chip__tick { display: none; }
.chip--check:has(input:checked) .chip__tick { display: block; }
.chip--check:not(:has(input:checked)) { color: var(--c-text-2); }

/* A route to a place that was switched off. */
.srow__dest .is-off { color: var(--c-danger-ink); }

/* Stats: today's column is still filling up; delivery numbers never wrap. */
.cols__bar--partial { background: repeating-linear-gradient(135deg, var(--c-primary) 0 4px, var(--c-primary-medium) 4px 8px); }
.hbar__val { white-space: nowrap; }
.hbar--delivery { grid-template-columns: minmax(110px, 220px) minmax(0, 1fr) 110px; }

/* ntfy: a code to scan on a computer, the name big enough to type on an iPhone. */
.code--lg { font-size: 15px; padding: 3px 8px; white-space: nowrap; }
.ntfy-qr { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 16px; align-items: center; margin-top: 4px; padding: 12px; border-radius: var(--r-card); background: var(--c-surface-2); }
.ntfy-qr .qr { width: 112px; height: 112px; padding: 8px; border-radius: 8px; background: #fff; }
.ntfy-open { margin-top: 8px; }

/* Settings: the lines to paste, and site rows that wrap instead of overlapping. */
.envlines { margin: 0; padding: 8px 10px; white-space: pre; overflow: auto; }
@media (max-width: 480px) {
  .receipt__row.diag__site { grid-template-columns: 20px minmax(0, 1fr); }
  .receipt__row.diag__site b { grid-column: 2; font-weight: 500; }
}

/* Setup: the action bar stays in view on a computer too. */
@media (min-width: 961px) {
  .ob__nav { position: sticky; bottom: 0; z-index: 5; padding-top: 14px; background: linear-gradient(transparent, var(--c-page) 18%); }
}

/* Sign in: one frame, the app's name on it, and a show-password button. */
.login__card { padding: 150px 0 0; overflow: hidden; box-shadow: var(--ring); }
.login__brand { position: absolute; top: 18px; left: 22px; }
.login__mags { top: 30px; }
.login__form { border-radius: 0; box-shadow: none; }
.affix--end .input { padding-left: 14px; padding-right: 92px; }
.affix__btn { position: absolute; right: 6px; }
.login .help--error, .login .help--error span { color: var(--c-danger-ink); }

/* Asking for support (partials/support.html). Ko-fi's blue and cup, which people know,
   in this app's lipped pill. Not teal: teal is the one action colour of the app itself. */
.btn--kofi { --lip: #4a7fd0; padding: 0 20px 0 14px; background: #72a4f2; color: #14171f; font-weight: 700; box-shadow: 0 3px 0 var(--lip); }
.btn--kofi:hover { background: #6598ea; color: #14171f; }
.btn--kofi:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--lip); }
.btn--kofi .kofi-cup { flex: none; }

.support-card { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 16px; align-items: start; margin: 0 0 24px; padding: 22px 28px; border-radius: 24px; background: var(--c-surface); box-shadow: var(--ring); }
.support-card__logo { width: 40px; height: 40px; margin-top: 2px; border-radius: 9px; }
.support-card__body { display: grid; min-width: 0; }
.support-card__title { font: 700 17px/1.3 var(--font-display); }
.support-card p { margin-top: 6px; max-width: 640px; font-size: 14px; color: var(--c-text-2); text-wrap: pretty; }
.support-card__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.support-card__quiet { display: flex; flex-wrap: wrap; gap: 0 20px; margin-top: 6px; font-size: 13px; }
.support-card__quiet a, .support-card__quiet button { display: inline-flex; align-items: center; min-height: 32px; padding: 0; border: 0; background: none; font: inherit; color: var(--c-text-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.support-card__quiet a:hover, .support-card__quiet button:hover { color: var(--c-ink); }
.support-card__quiet form { display: contents; }
.support-card--sun, .support-card--lilac { box-shadow: none; }
.support-card--sun { background: var(--field-sun); }
.support-card--lilac { background: var(--field-lilac); }
.support-card--sun h2, .support-card--lilac h2, .support-card--sun p, .support-card--lilac p,
.support-card--sun .support-card__quiet a, .support-card--lilac .support-card__quiet a,
.support-card--sun .support-card__quiet button, .support-card--lilac .support-card__quiet button { color: var(--field-ink); }
/* On a phone the card stays small, so the first screen is still mostly finds: the
   heading, the two buttons side by side, and the quiet links. */
@media (max-width: 640px) {
  .support-card { grid-template-columns: minmax(0, 1fr); padding: 14px 16px; margin-bottom: 16px; border-radius: 18px; }
  .support-card__logo, .support-card [data-support-pitch] { display: none; }
  .support-card__actions { margin-top: 10px; gap: 8px; }
  .support-card__actions > * { flex: 1 1 0; min-height: 40px; padding-inline: 10px; font-size: 14px; }
  .support-card__quiet { margin-top: 2px; }
}

.support { display: grid; gap: 20px; padding: 28px 32px; border-radius: var(--r-field); background: var(--field-sun); color: var(--field-ink); }
.support__story { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 24px; align-items: center; }
.support__mags { width: auto; height: 112px; }
.support__title { margin-bottom: 6px; font: 700 24px/1.2 var(--font-display); color: var(--field-ink); }
.support__story p { max-width: 600px; font-size: 16px; line-height: 1.5; color: var(--field-ink); text-wrap: pretty; }
.tiers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.tiers a { display: grid; gap: 2px; padding: 0 0 14px; overflow: hidden; border-radius: var(--r-card); background: var(--c-surface); color: var(--c-ink); text-decoration: none; box-shadow: inset 0 0 0 1.5px transparent; transition: box-shadow .12s, transform .12s; }
.tiers a:hover { box-shadow: inset 0 0 0 1.5px var(--c-amber-ink); transform: translateY(-2px); }
.tiers a:focus-visible { outline: 3px solid var(--c-ink); outline-offset: 2px; }
.tier__art { position: relative; display: block; aspect-ratio: 2 / 1; margin-bottom: 10px; overflow: hidden; }
.tier__art--sun { background: color-mix(in srgb, var(--c-amber) 50%, var(--field-sun)); }
.tier__art--lilac { background: var(--field-lilac); }
.tier__art--mint { background: var(--field-mint); }
.tier__art::before { content: ""; position: absolute; left: 50%; top: 50%; width: 48%; aspect-ratio: 1; border-radius: 50%; background: rgba(255, 255, 255, .5); transform: translate(-50%, -50%); }
.tier__mags { position: absolute; left: 50%; bottom: -6%; height: 92%; width: auto; transform: translateX(-62%); }
.tier__art .kofi-cup { position: absolute; right: 16%; top: 38%; width: 18%; height: auto; transform: rotate(8deg); }
.tier__heart { position: absolute; width: 7%; fill: #e5484d; }
.tier__heart--a { left: 22%; top: 18%; transform: rotate(-14deg); }
.tier__heart--b { right: 30%; top: 12%; width: 5%; fill: #f08aa0; transform: rotate(12deg); }
.tier__name { padding: 0 16px; font: 700 17px/1.25 var(--font-display); }
.tier__amount { padding: 0 16px; font-size: 14px; font-weight: 600; color: var(--c-text-2); }
.support__small { margin-top: -8px; font-size: 14px; color: var(--field-ink); }
.support__other { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding-top: 18px; border-top: 1.5px solid color-mix(in srgb, var(--field-ink) 14%, transparent); font-size: 14px; }
.support__links { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 640px) {
  .support { padding: 24px 20px; }
  .support__story { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .tiers { grid-template-columns: minmax(0, 1fr); }
  /* A row each on a phone: the picture square on the left, the words beside it. */
  .tiers a { grid-template-columns: 96px minmax(0, 1fr); grid-template-rows: auto auto; align-content: center; column-gap: 14px; padding: 0; }
  .tier__art { grid-row: 1 / 3; aspect-ratio: 1; margin: 0; }
  .tier__art::before { width: 80%; }
  .tier__name { align-self: end; padding: 0; }
  .tier__amount { align-self: start; padding: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .tiers a { transition: none; }
  .tiers a:hover { transform: none; }
}

/* Settings, Advanced: the environment's settings, read-only. */
.envlist summary { cursor: pointer; list-style: none; }
.envlist summary::-webkit-details-marker { display: none; }
.envlist summary .t-h3 { display: flex; align-items: center; gap: 6px; }
.envlist summary .i { transition: transform .15s; }
.envlist[open] summary .i { transform: rotate(90deg); }
.envlist__rows { margin: 8px 0 0; display: grid; gap: 0; }
.envlist__row { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 4px 16px; padding: 10px 0; border-top: 1px solid var(--c-line); }
.envlist__row dt { min-width: 0; overflow-wrap: anywhere; }
.envlist__row dt .code { font-size: 12px; }
.envlist__row dd { margin: 0; display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.envlist__row dd b { font-weight: 580; }
@media (max-width: 640px) { .envlist__row { grid-template-columns: 1fr; } }

/* A pasted token and its button: side by side, the button below on a narrow phone. */
.token-row { align-items: flex-start; flex-wrap: nowrap; }
.token-row .input { min-width: 0; }
@media (max-width: 420px) { .token-row { flex-wrap: wrap; } .token-row .btn { width: 100%; } }

/* "Where alerts go": the less common places, folded under the two main ones. */
.more-choices { margin-top: 2px; }
.more-choices > summary { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 4px; cursor: pointer; list-style: none; font-weight: 580; color: var(--c-ink); }
.more-choices > summary::-webkit-details-marker { display: none; }
.more-choices > summary small { font-weight: 400; color: var(--c-text-2); }
.more-choices > summary .i { transition: transform .15s; }
.more-choices[open] > summary .i { transform: rotate(90deg); }
.pair-qr { display: flex; gap: 14px; align-items: center; }
.pair-qr .qr { width: 132px; height: 132px; padding: 8px; }

/* Alerts, "What it looks like": a sample alert in the colours of the app it lands in. */
.sample { margin-top: 8px; border-radius: 12px; padding: 12px; font-size: 13.5px; line-height: 1.45; overflow: hidden; }
.sample p { margin: 0 0 4px; overflow-wrap: anywhere; }
.sample__who { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.sample__who img { width: 28px; height: 28px; border-radius: 50%; background: #007782; object-fit: cover; object-position: 50% 18%; }
.sample__who small { font-size: 11px; opacity: .7; }
.sample__photos { display: flex; gap: 6px; margin: 6px 0; }
.sample__photos img { width: 96px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 6px; background: rgba(255, 255, 255, .08); }
.sample__btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.sample__btns span { padding: 5px 10px; border-radius: 6px; font-size: 12.5px; }
.sample--discord { background: #313338; color: #dbdee1; }
.sample--discord .sample__msg { border-left: 4px solid var(--accent, #2a78d6); background: #2b2d31; border-radius: 6px; padding: 10px 12px; }
.sample--discord b { color: #f2f3f5; }
.sample--discord .sample__small { font-size: 12px; color: #949ba4; }
.sample--discord .sample__btns span { background: #4e5058; color: #fff; }
.sample--telegram { background: #e6ebee; color: #0f1419; }
.sample--telegram .sample__msg { background: #fff; border-radius: 12px; padding: 8px 10px; }
.sample--telegram .sample__msg table { border-collapse: collapse; }
.sample--telegram .sample__msg td { padding: 0 8px 0 0; }
.sample--telegram .sample__msg blockquote { margin: 4px 0; padding-left: 8px; border-left: 3px solid #3390ec; }
.sample--telegram .sample__btns { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
.sample--telegram .sample__btns span { background: rgba(0, 0, 0, .28); color: #fff; text-align: center; }
@media (max-width: 760px) { .ob--search .ob__field { display: none; } }
.facet__group { flex-basis: 100%; margin-top: 4px; font-weight: 580; }
.rej__detail { font-size: 12.5px; color: var(--c-text-2); overflow-wrap: anywhere; }

/* Watchlist rows: photo, what it is, price, actions. On a phone the price gets its own
   line under the title, so a long label never runs into the status badge. */
.wrow--watch { grid-template-columns: 56px minmax(0, 1fr) auto auto; }
.wrow--seller { grid-template-columns: 48px minmax(0, 1fr) auto auto; }
.wrow__price s { display: block; }
.wrow__routes summary { cursor: pointer; list-style: none; }
.wrow__routes summary::-webkit-details-marker { display: none; }
.wrow__routes .t-link { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 760px) {
  .wrow--watch { grid-template-columns: 56px minmax(0, 1fr) auto; grid-template-areas: "i m m" "i p a"; }
  .wrow--watch .wrow__price { text-align: left; }
  .wrow--seller { grid-template-columns: 48px minmax(0, 1fr) auto auto; grid-template-areas: none; }
  .wrow--seller > * { grid-area: auto; }
}
.rej__why { flex-wrap: nowrap; align-items: flex-start; }
.rej__why .i { flex: none; margin-top: 2px; }
