/* =====================================================================
   Faye Leads design system. Faye noir (dark) is the base, the light twin
   swaps tokens. Source of truth: design/preview.html (approved 2026-10-25).
   Claret only on the one primary action per view. Bodoni Moda only for the
   FAYE wordmark and the large lead handle; Jost for everything else.
   ===================================================================== */
@font-face { font-family: "Jost"; src: url(../fonts/Jost-var-latin.woff2) format("woff2"); font-weight: 300 600; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Jost"; src: url(../fonts/Jost-var-latin-ext.woff2) format("woff2"); font-weight: 300 600; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Bodoni Moda"; src: url(../fonts/BodoniModa-400-latin.woff2) format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Bodoni Moda"; src: url(../fonts/BodoniModa-400-latin-ext.woff2) format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ---------- tokens: exactly the preview ---------- */
:root {
  color-scheme: dark;
  --bg: #16130F;            /* Faye ink */
  --panel: #1B1814;
  --raise: #221E19;
  --raise-2: #2A251F;
  --line: rgba(251,250,247,.075);
  --line-2: rgba(251,250,247,.13);
  --text: #FBFAF7;          /* Faye paper */
  --text-2: #BFB3A2;        /* Faye stone */
  --text-3: #8E8275;
  --claret: #8C2D46;        /* Faye claret, lifted one step for ink */
  --claret-hover: #993450;
  --on-claret: #FBFAF7;
  --ok: #8DBF9F;   --ok-bg: rgba(141,191,159,.10);
  --warn: #D6AE6B; --warn-bg: rgba(214,174,107,.10);
  --bad: #D98C8C;  --bad-bg: rgba(217,140,140,.10);
  --focus: rgba(251,250,247,.55);
  --shot-a: #2A251F; --shot-b: #332D26;
  --shadow: 0 1px 0 rgba(0,0,0,.25);
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #FBFAF7;            /* Faye paper */
  --panel: #FFFFFF;
  --raise: #F5F2ED;
  --raise-2: #EFE9E0;       /* Faye bone, hover only */
  --line: rgba(22,19,15,.08);
  --line-2: rgba(22,19,15,.14);
  --text: #16130F;
  --text-2: #6E6053;        /* Faye umber */
  --text-3: #7A6E62;        /* preview: #8E8275, only 3.6:1 on paper; 4.7:1 for 11-12px text (pending Joel's sign-off) */
  --claret: #6E2334;        /* Faye claret */
  --claret-hover: #7E2A3D;
  --on-claret: #FBFAF7;
  --ok: #2F6B4F;   --ok-bg: rgba(47,107,79,.08);
  --warn: #8A5E12; --warn-bg: rgba(138,94,18,.08);
  --bad: #A03838;  --bad-bg: rgba(160,56,56,.07);
  --focus: rgba(22,19,15,.45);
  --shot-a: #EFE9E0; --shot-b: #E6DFD4;
  --shadow: 0 1px 2px rgba(22,19,15,.04), 0 8px 24px -12px rgba(22,19,15,.10);
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 400 15px/1.5 "Jost", -apple-system, "Helvetica Neue", sans-serif;
  font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .25s ease;
}
::selection { background: var(--claret); color: var(--on-claret); }
textarea, input, button, select { font: inherit; color: inherit; }
input, textarea { caret-color: var(--claret); }
:focus-visible { outline: 1.5px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
a { color: var(--text); text-underline-offset: 3px; }
[hidden] { display: none !important; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
svg.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }
kbd {
  font: 500 11px/1 "Jost", sans-serif; letter-spacing: .02em;
  min-width: 20px; height: 20px; padding: 0 5px; display: inline-grid; place-items: center;
  border: 1px solid currentColor; border-radius: 5px; opacity: .55;
}

/* ---------- top bar (shell.js) ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 28px;
  height: 64px; padding: 0 32px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.2) blur(14px); -webkit-backdrop-filter: saturate(1.2) blur(14px);
  border-bottom: 1px solid var(--line);
}
.mark { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.top > .mark, .top > .nav, .top > .iconbtn, .top > .account { flex: none; }
.mark .faye { font-family: "Bodoni Moda", serif; font-size: 19px; letter-spacing: .3em; margin-right: -.3em; }
.mark .rule { width: 1px; height: 18px; background: var(--line-2); }
.mark .leads { font-weight: 300; font-size: 11px; letter-spacing: .42em; text-transform: uppercase; color: var(--text-2); }
.nav { display: flex; gap: 4px; }
.nav a {
  position: relative; display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 12px; border-radius: 8px;
  color: var(--text-2); text-decoration: none; font-weight: 400;
  transition: color .15s, background-color .15s;
}
.nav a:hover { color: var(--text); background: var(--raise); }
.nav a[aria-current="page"] { color: var(--text); font-weight: 500; }
.nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -14px; height: 1.5px; background: var(--text);
}
.count { font-size: 12px; color: var(--text-3); font-weight: 400; }
.top .spacer { flex: 1; }
/* Two long bot lines must never push the bar wider than a split-screen window:
   the strip shrinks and clips, and below 1180px only dot and name stay (full line in the title). */
.bots { display: flex; gap: 18px; min-width: 0; overflow: hidden; font-size: 13px; color: var(--text-2); }
.bot { display: inline-flex; align-items: center; gap: 7px; min-width: 0; white-space: nowrap; }
.bots .bot-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1180px) { .bots .bot-state { display: none; } }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); flex: none; }
.dot.paused { background: var(--text-3); box-shadow: none; }
.dot.bad { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-bg); }
.iconbtn {
  position: relative;
  width: 36px; height: 36px; display: grid; place-items: center;
  border: 0; background: transparent; color: var(--text-2); border-radius: 8px; cursor: pointer;
}
.iconbtn:hover { background: var(--raise); color: var(--text); }
.me {
  position: relative;
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--raise-2); color: var(--text); font-size: 13px; font-weight: 500;
  border: 0; padding: 0; cursor: pointer;
}
/* 44px touch targets without growing the drawn circle */
.iconbtn::after, .me::after { content: ""; position: absolute; inset: -6px; }
.account { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 12px); z-index: 40;
  display: grid; min-width: 220px; padding: 6px;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow);
  animation: rise .16s cubic-bezier(.2,.7,.2,1);
}
.menu-who { display: grid; gap: 2px; padding: 10px 12px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--line); font-size: 14px; }
.menu-who .faint { font-size: 12px; }
.menu a, .menu button {
  display: flex; align-items: center; height: 40px; padding: 0 12px; border-radius: 8px;
  border: 0; background: transparent; color: var(--text); text-decoration: none; text-align: left;
  font-size: 14px; cursor: pointer;
}
.menu a:hover, .menu button:hover { background: var(--raise); }
.menu a[aria-current="page"] { font-weight: 500; }

/* ---------- page frame ---------- */
main { max-width: 1280px; margin: 0 auto; padding: 32px 32px 120px; }
.view { display: none; }
.view.on { display: block; animation: rise .22s cubic-bezier(.2,.7,.2,1); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.grow { flex: 1; }
.title { font-size: 26px; font-weight: 500; letter-spacing: -.015em; margin: 0; }
.h { font-size: 12px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin: 0 0 10px; }
.link { color: var(--text-2); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.link:hover { color: var(--text); }

/* ---------- lead identity ---------- */
.who { display: flex; align-items: center; gap: 18px; }
/* UI.avatar: the initial under the picture; a broken picture is dropped. */
.avatar {
  position: relative; overflow: hidden;
  width: 64px; height: 64px; border-radius: 50%; flex: none;
  display: grid; place-items: center; background: var(--raise-2); color: var(--text-2);
  font-family: "Bodoni Moda", serif; font-size: 26px;
}
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.handle { font-family: "Bodoni Moda", Georgia, serif; font-weight: 400; font-size: 44px; line-height: 1.05; letter-spacing: -.01em; margin: 0; overflow-wrap: anywhere; }
.sub { margin-top: 6px; color: var(--text-2); font-size: 15px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.tag {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px;
  border-radius: 999px; font-size: 13px; color: var(--text-2); border: 1px solid var(--line-2); white-space: nowrap;
}
.tag.ok { color: var(--ok); background: var(--ok-bg); border-color: transparent; }
.tag.warn { color: var(--warn); background: var(--warn-bg); border-color: transparent; }
.tag.bad { color: var(--bad); background: var(--bad-bg); border-color: transparent; }
.tag svg.i { width: 14px; height: 14px; }

/* Any number of stats: one row on the desktop, rows of three on the phone. */
.stats {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); margin-top: 28px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.stat { padding: 16px 0 16px 18px; border-left: 1px solid var(--line); }
.stat:first-child { padding-left: 0; border-left: 0; }
.stat .v { font-size: 22px; font-weight: 400; letter-spacing: -.01em; }
.stat .k { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* Bot screenshot: a phone frame; works as a box around an <img> or as the <img>. */
.shot {
  display: block; width: 100%; aspect-ratio: 9 / 19.5; overflow: hidden; object-fit: cover; object-position: top;
  border-radius: 22px; border: 1px solid var(--line-2); background: var(--shot-a);
}
.shot-note { font-size: 12px; color: var(--text-3); margin-top: 10px; text-align: center; }
.bio { white-space: pre-line; font-size: 16px; line-height: 1.6; margin: 0 0 28px; overflow-wrap: anywhere; }
.reasons { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.reasons li { display: flex; gap: 10px; align-items: baseline; color: var(--text-2); font-size: 14px; }
.reasons li svg.i { width: 15px; height: 15px; transform: translateY(2px); color: var(--text-3); }
.reasons li.strong { color: var(--text); }

/* ---------- surfaces and controls ---------- */
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 24px; box-shadow: var(--shadow);
}
.seg { display: flex; gap: 4px; padding: 3px; border-radius: 10px; background: var(--raise); margin-bottom: 14px; }
.seg button {
  flex: 1; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--text-2);
  font-size: 13px; cursor: pointer; white-space: nowrap;
}
.seg button[aria-pressed="true"] { background: var(--panel); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field > span { font-size: 13px; color: var(--text-2); }
input:where([type="text"], [type="email"], [type="password"], [type="search"], [type="number"], [type="url"], [type="tel"], :not([type])),
select, textarea {
  width: 100%; height: 40px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--bg); color: var(--text);
  transition: border-color .15s;
}
textarea { height: auto; min-height: 96px; padding: 10px 12px; line-height: 1.6; resize: vertical; }
select {
  appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238E8275' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--text-3); }
input::placeholder, textarea::placeholder { color: var(--text-3); }
/* Checkbox in the Faye look: a hairline box, filled with the text colour when on. */
input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; flex: none; display: inline-grid; place-content: center;
  width: 18px; height: 18px; margin: 0; border: 1px solid var(--line-2); border-radius: 5px;
  background: transparent; cursor: pointer; transition: background-color .15s, border-color .15s;
}
input[type="checkbox"]::before {
  content: ""; width: 12px; height: 12px; background: var(--bg); transform: scale(0); transition: transform .12s;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat;
}
input[type="checkbox"]:hover { border-color: var(--text-3); }
input[type="checkbox"]:checked { background: var(--text); border-color: var(--text); }
input[type="checkbox"]:checked::before { transform: scale(1); }
input[type="radio"] { accent-color: var(--text); width: 16px; height: 16px; margin: 0; }
input:disabled, select:disabled, textarea:disabled { opacity: .55; cursor: not-allowed; }
.msg {
  width: 100%; min-height: 220px; resize: vertical; border-radius: 12px; padding: 14px 16px;
  border: 1px solid var(--line-2); background: var(--bg); line-height: 1.6; font-size: 15px; caret-color: var(--claret);
}
.msg:focus { outline: none; border-color: var(--text-3); }
.primary {
  width: 100%; height: 54px; border: 0; border-radius: 12px; cursor: pointer;
  background: var(--claret); color: var(--on-claret); font-size: 16px; font-weight: 500; text-decoration: none;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  transition: background-color .15s, transform .1s;
}
.primary:hover { background: var(--claret-hover); }
.primary:active { transform: scale(.99); }
.primary kbd { opacity: .7; }
.ghost {
  height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-2); background: transparent; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--text); text-decoration: none;
  transition: background-color .15s, border-color .15s;
}
.ghost:hover { background: var(--raise); }
.ghost.danger:hover { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.primary:disabled, .ghost:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.primary:disabled:hover { background: var(--claret); }
.ghost:disabled:hover { background: transparent; color: var(--text); border-color: var(--line-2); }
.notice {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px;
  background: var(--raise); font-size: 14px; line-height: 1.5; margin-bottom: 14px;
}
.notice svg.i { margin-top: 2px; color: var(--text-2); }
.notice.warn { background: var(--warn-bg); color: var(--warn); }
.notice.bad { background: var(--bad-bg); color: var(--bad); }
.notice.warn svg.i, .notice.bad svg.i { color: currentColor; }
.empty { padding: 56px 16px; text-align: center; color: var(--text-3); }
.empty .notice { max-width: 560px; margin: 0 auto; text-align: left; }
.empty .ghost { display: inline-flex; margin-top: 22px; }
.skeleton {
  display: block; min-height: 1em; border-radius: 8px; color: transparent;
  background: linear-gradient(90deg, var(--raise) 25%, var(--raise-2) 50%, var(--raise) 75%) 0 0 / 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* ---------- table ---------- */
.table, .table-wrap table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table-wrap { overflow-x: auto; }
.table th, .table-wrap th {
  text-align: left; padding: 10px 12px; font-size: 12px; font-weight: 500; color: var(--text-3);
  white-space: nowrap; border-bottom: 1px solid var(--line-2);
}
.table td, .table-wrap td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr, .table-wrap tbody tr { transition: background-color .15s; }
.table tbody tr:hover, .table-wrap tbody tr:hover { background: var(--raise); }
tr.clickable { cursor: pointer; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--text); }
.num, .table .num, .table-wrap .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- drawer ---------- */
.drawer-bg {
  position: fixed; inset: 0; z-index: 90; opacity: 0; pointer-events: none;
  background: color-mix(in srgb, var(--bg) 60%, transparent); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  transition: opacity .2s;
}
.drawer-bg.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 91; width: min(560px, 100vw);
  overflow-y: auto; padding: 28px; background: var(--panel); border-left: 1px solid var(--line); box-shadow: var(--shadow);
  transform: translateX(100%); visibility: hidden;
  transition: transform .25s cubic-bezier(.2,.7,.2,1), visibility 0s .25s;
}
.drawer.open { transform: none; visibility: visible; transition: transform .25s cubic-bezier(.2,.7,.2,1); }
@media (max-width: 560px) { .drawer { border-left: 0; } }

/* ---------- toasts ---------- */
.toast-host {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 200;
  display: flex; flex-direction: column; gap: 8px; align-items: center; width: max-content; max-width: calc(100vw - 32px);
  pointer-events: none;
}
.toast {
  background: var(--text); color: var(--bg); padding: 12px 16px; border-radius: 12px; font-size: 14px;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,.4); animation: rise .22s cubic-bezier(.2,.7,.2,1);
}
.toast.err { background: var(--bad); color: var(--bg); }

/* ---------- login and two-factor (api.js) ---------- */
.gate {
  position: fixed; inset: 0; z-index: 300; overflow-y: auto;
  display: grid; place-items: center; padding: 24px 16px; background: var(--bg);
}
.gate-box { width: min(400px, 100%); display: grid; gap: 28px; }
.gate-box > .mark { justify-content: center; }
.gate .panel { padding: 32px; }
.gate .title { margin-bottom: 8px; }
.gate .panel > p { margin: 0 0 20px; color: var(--text-2); font-size: 14px; }
.gate .primary { margin-top: 8px; }
.gate .ghost { width: 100%; margin-top: 10px; }
.gate-error { color: var(--bad); }
.gate .panel > p.gate-error { color: var(--bad); min-height: 1.5em; margin: 12px 0 0; }
.gate .panel > .title + p.gate-error { margin: 0 0 20px; }
.gate .panel > p.gate-error:empty { margin: 0; min-height: 0; }
.mfa-qr { display: block; width: 200px; max-width: 100%; margin: 0 auto 20px; padding: 12px; border-radius: 12px; background: #fff; }
.mfa-secret { overflow-wrap: anywhere; color: var(--text); }
.access-denied { text-align: center; }
.auth-pending > main,
.auth-pending > .drawer,
.auth-pending > .drawer-bg { visibility: hidden; }

/* ---------- small things ---------- */
.spinner {
  display: inline-block; width: 14px; height: 14px; border-radius: 50%; vertical-align: middle;
  border: 1.5px solid var(--line-2); border-top-color: var(--text-2); animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.hint { font-size: 13px; color: var(--text-3); }

/* ---------- status chips (UI.statusChip, UI.funnelChip, UI.nicheChips) ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px;
  font-size: 12px; color: var(--text-2); border: 1px solid var(--line-2); white-space: nowrap;
}
.chip.replied, .chip.in_talks, .chip.won { color: var(--ok); background: var(--ok-bg); border-color: transparent; }
.chip.contacted, .chip.analysis_out { color: var(--warn); background: var(--warn-bg); border-color: transparent; }
.chip.rejected, .chip.lost { color: var(--bad); background: var(--bad-bg); border-color: transparent; }
.chip.new, .chip.qualified, .chip.ready { color: var(--text); }
/* in a row of tags a chip takes the tag's size */
.chip svg.i { width: 13px; height: 13px; }
.tags .chip { gap: 6px; height: 28px; padding: 0 10px; font-size: 13px; }
.tags .chip svg.i { width: 14px; height: 14px; }

/* ---------- phone ---------- */
.tabbar { display: none; }
@media (max-width: 860px) {
  /* landscape phones: the notch side gets its inset (viewport-fit=cover) */
  .top { padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); height: 56px; gap: 12px; }
  .nav, .bots { display: none; }
  main {
    padding: 20px max(16px, env(safe-area-inset-right)) calc(176px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  }
  /* a typical 16-character handle stays on one line before overflow-wrap breaks it */
  .handle { font-size: clamp(24px, 7.5vw, 32px); }
  /* touch targets: 44px for every control a thumb hits */
  select, .seg button, .menu a, .menu button,
  input:where([type="text"], [type="email"], [type="password"], [type="search"], [type="number"], [type="url"], [type="tel"], :not([type])) {
    min-height: 44px;
  }
  .avatar { width: 52px; height: 52px; font-size: 22px; }
  .who { gap: 14px; }
  .stats { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats > .stat { padding: 12px 0 12px 12px; }
  .stats > .stat:nth-child(3n + 1) { padding-left: 0; border-left: 0; }
  .stats:has(> .stat:nth-child(4)) > .stat:nth-child(-n + 3) { border-bottom: 1px solid var(--line); }
  .stat .v { font-size: 19px; }
  .shot { border-radius: 12px; }
  .shot-note { font-size: 11px; }
  .panel { padding: 18px; border-radius: 14px; box-shadow: none; }
  .gate .panel { padding: 24px; }
  .msg { min-height: 170px; }
  .drawer { padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); }
  .toast-host { top: calc(64px + env(safe-area-inset-top)); bottom: auto; }
  .dock {
    position: fixed; left: 0; right: 0; bottom: calc(60px + env(safe-area-inset-bottom)); z-index: 25;
    padding: 12px max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left)); display: grid; gap: 8px;
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
  }
  .dock .row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .dock .primary { height: 52px; }
  .dock .ghost { height: 44px; }
  .dock kbd { display: none; }
  .tabbar {
    display: grid; grid-template-columns: repeat(3, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    height: calc(60px + env(safe-area-inset-bottom));
    padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    background: var(--panel); border-top: 1px solid var(--line);
  }
  .tabbar a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: var(--text-3); text-decoration: none; font-size: 11px;
  }
  .tabbar a[aria-current="page"] { color: var(--text); }
  .tabbar .count { font-size: inherit; }
  .tabbar svg.i { width: 22px; height: 22px; }
}
@media (min-width: 861px) { .dock { display: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
