/* ==========================================================================
   Leads status board
   A dispatch-board aesthetic: one blue for action, a three-stop urgency ramp
   (calm -> amber -> red) that encodes how long a follow-up has been ignored,
   one green for won. Mono = system/meta labels & data columns; Sans = people.
   ========================================================================== */

:root {
  --paper:      #F5F6F8;
  --surface:    #FFFFFF;
  --raised:     #FBFBFC;
  --ink:        #14181F;
  --muted:      #616B7A;
  --faint:      #9AA3B0;
  --line:       #E5E7EB;
  --line-strong:#D4D8DF;

  --accent:     #2B4ACB;
  --accent-ink: #FFFFFF;
  --accent-weak:#EEF1FD;

  --warn:       #8A5A00;
  --warn-bg:    #FBF1DA;
  --alarm:      #B42318;
  --alarm-bg:   #FBE7E4;
  --won:        #12683F;
  --won-bg:     #E4F2EA;

  --shadow:     0 1px 2px rgba(20,24,31,.06), 0 8px 24px -12px rgba(20,24,31,.14);
  --shadow-lg:  0 24px 60px -20px rgba(20,24,31,.28);

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;

  --sans: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --rail: 232px;
}

:root[data-theme="dark"] {
  --paper:      #0D1014;
  --surface:    #14181E;
  --raised:     #191E25;
  --ink:        #E7EAF0;
  --muted:      #949DAB;
  --faint:      #6A7382;
  --line:       #242B34;
  --line-strong:#323B46;

  --accent:     #7C93FF;
  --accent-ink: #0D1014;
  --accent-weak:#1B2233;

  --warn:       #E2B24C;
  --warn-bg:    #2B2413;
  --alarm:      #F0776B;
  --alarm-bg:   #2E1A17;
  --won:        #57C08A;
  --won-bg:     #12281E;

  --shadow:     0 1px 2px rgba(0,0,0,.4), 0 12px 32px -14px rgba(0,0,0,.6);
  --shadow-lg:  0 30px 70px -20px rgba(0,0,0,.7);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:#0D1014; --surface:#14181E; --raised:#191E25; --ink:#E7EAF0;
    --muted:#949DAB; --faint:#6A7382; --line:#242B34; --line-strong:#323B46;
    --accent:#7C93FF; --accent-ink:#0D1014; --accent-weak:#1B2233;
    --warn:#E2B24C; --warn-bg:#2B2413; --alarm:#F0776B; --alarm-bg:#2E1A17;
    --won:#57C08A; --won-bg:#12281E;
    --shadow:0 1px 2px rgba(0,0,0,.4), 0 12px 32px -14px rgba(0,0,0,.6);
    --shadow-lg:0 30px 70px -20px rgba(0,0,0,.7);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

::selection { background: var(--accent); color: var(--accent-ink); }

/* --- shared atoms ------------------------------------------------------- */

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--faint);
}

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.btn {
  --bh: 34px;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: var(--bh); padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  font-weight: 500; font-size: 13px;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease, transform .06s ease;
  white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; flex: none; }
.btn:hover { background: var(--raised); border-color: var(--faint); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn--primary {
  background: var(--accent); border-color: var(--accent); color: var(--accent-ink);
}
.btn--primary:hover { background: var(--accent); filter: brightness(1.06); border-color: var(--accent); }
.btn--ghost { border-color: transparent; background: transparent; }
.btn--ghost:hover { background: var(--accent-weak); }
.btn--sm { --bh: 28px; padding: 0 10px; font-size: 12px; }
.btn--danger { color: var(--alarm); }
.btn--danger:hover { background: var(--alarm-bg); border-color: var(--alarm); }

.field {
  height: 34px; padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  width: 100%;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); outline: none; }
textarea.field { height: auto; padding: 8px 10px; resize: vertical; min-height: 64px; line-height: 1.45; }
select.field { cursor: pointer; }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 9px;
  border-radius: 999px;
  font-size: 12px; font-weight: 500;
  border: 1px solid transparent;
  white-space: nowrap;
}
.pill--neutral { background: var(--raised); border-color: var(--line); color: var(--muted); }
.pill--qual    { background: var(--accent-weak); color: var(--accent); }
.pill--pending { background: var(--warn-bg); color: var(--warn); }
.pill--won     { background: var(--won-bg); color: var(--won); }
.pill--dead    { background: var(--alarm-bg); color: var(--alarm); }
.pill-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* --- boot / login ---------------------------------------------------- */

.boot, .login {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.boot { color: var(--faint); font-family: var(--mono); font-size: 13px; }

.login__card {
  width: 100%; max-width: 360px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 30px 28px;
  box-shadow: var(--shadow);
}
.login__mark {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--accent); display: grid; place-items: center;
  margin-bottom: 18px;
}
.login__mark svg { width: 22px; height: 22px; }
.login h1 { font-size: 19px; font-weight: 600; letter-spacing: -.01em; }
.login p { color: var(--muted); margin: 6px 0 20px; font-size: 13px; }
.login form { display: grid; gap: 10px; }
.login__err { color: var(--alarm); font-size: 12.5px; min-height: 16px; }

/* --- app shell ----------------------------------------------------- */

.shell {
  display: grid;
  grid-template-columns: var(--rail) 1fr;
  min-height: 100dvh;
}

.rail {
  border-right: 1px solid var(--line);
  background: var(--surface);
  padding: 16px 12px;
  display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100dvh;
}
.rail__brand {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px 16px;
}
.rail__brand-mark { width: 28px; height: 28px; border-radius: 7px; background: var(--accent); display: grid; place-items: center; flex: none; }
.rail__brand-mark svg { width: 16px; height: 16px; }
.rail__brand-text { font-weight: 600; letter-spacing: -.01em; font-size: 14.5px; }
.rail__brand-text small { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: .1em; color: var(--faint); text-transform: uppercase; font-weight: 500; }

.nav-link {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  color: var(--muted);
  font-weight: 500; font-size: 13px;
  cursor: pointer;
  border: none; background: none; width: 100%; text-align: left;
}
.nav-link svg { width: 17px; height: 17px; flex: none; }
.nav-link:hover { background: var(--raised); color: var(--ink); text-decoration: none; }
.nav-link[aria-current="page"] { background: var(--accent-weak); color: var(--accent); }
.nav-link__badge {
  margin-left: auto;
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  min-width: 20px; height: 18px; padding: 0 5px;
  border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--alarm-bg); color: var(--alarm);
}
.nav-link__badge[data-zero="1"] { background: var(--raised); color: var(--faint); }

.rail__foot { margin-top: auto; display: grid; gap: 4px; }

.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 22px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar__title { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.topbar__search { margin-left: auto; position: relative; width: min(340px, 40vw); }
.topbar__search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--faint); }
.topbar__search .field { padding-left: 32px; }
.icon-btn {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface); cursor: pointer;
}
.icon-btn:hover { background: var(--raised); }
.icon-btn svg { width: 16px; height: 16px; }

.view { padding: 22px; max-width: 1360px; width: 100%; }
.view__head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.view__head h2 { font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.view__head p { color: var(--muted); font-size: 13px; }
.view__head .spacer { flex: 1; }

/* --- stat strip -------------------------------------------------- */

.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--r-md);
  overflow: hidden; margin-bottom: 22px;
}
.stat { background: var(--surface); padding: 13px 15px; }
.stat__n { font-family: var(--mono); font-size: 22px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat__l { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.stat--alarm .stat__n { color: var(--alarm); }
.stat--accent .stat__n { color: var(--accent); }
.stat--won .stat__n { color: var(--won); }

/* --- today board ---------------------------------------------- */

.board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
.column__head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px;
}
.column__head h3 { font-size: 13px; font-weight: 600; }
.column__count { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.column__rule { height: 2px; border-radius: 2px; background: var(--line-strong); flex: 1; }
.column--chase .column__rule { background: var(--alarm); }
.column--today .column__rule { background: var(--accent); }
.column--soon .column__rule { background: var(--line-strong); }

.stack { display: grid; gap: 10px; }

.lead-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 13px;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.lead-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.lead-card__top { display: flex; align-items: baseline; gap: 8px; }
.lead-card__name {
  font-weight: 600; font-size: 13.5px; letter-spacing: -.01em;
  border: none; background: none; padding: 0; cursor: pointer;
  color: var(--ink); text-align: left; font-family: inherit;
}
.lead-card__name:hover { color: var(--accent); text-decoration: underline; }
.lead-card__city { font-family: var(--mono); font-size: 11px; color: var(--faint); margin-left: auto; }
.lead-card__meta { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.lead-card__fb { color: var(--muted); font-size: 12.5px; margin-top: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lead-card__fb:empty { display: none; }
.lead-card__actions { display: flex; gap: 6px; margin-top: 10px; }

.empty {
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-md);
  padding: 22px 16px;
  text-align: center;
  color: var(--faint);
  font-size: 12.5px;
}

/* --- THE SIGNATURE: follow-up chip with auto-roll tally -------- */

.fu {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  padding: 2px 8px; border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--raised); color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.fu--today { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); background: var(--accent-weak); color: var(--accent); }
.fu--none  { color: var(--faint); }
.fu__tally {
  display: inline-flex; align-items: center; gap: 3px;
  padding-left: 6px; margin-left: 2px;
  border-left: 1px solid currentColor;
  font-weight: 600;
}
.fu__tally svg { width: 11px; height: 11px; }
/* escalation: the longer a lead is auto-advanced with no update, the louder */
.fu[data-roll="warn"]  { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); background: var(--warn-bg); color: var(--warn); }
.fu[data-roll="alarm"] { border-color: color-mix(in srgb, var(--alarm) 55%, var(--line)); background: var(--alarm-bg); color: var(--alarm); font-weight: 600; }

/* --- data table ------------------------------------------------ */

.toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.toolbar .field { width: auto; min-width: 130px; }
.toolbar__chip {
  height: 28px; padding: 0 11px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  background: var(--surface); font-size: 12px; font-weight: 500; color: var(--muted);
  cursor: pointer;
}
.toolbar__chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.toolbar .spacer { flex: 1; }

.table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: auto;
  background: var(--surface);
}
table.grid { border-collapse: collapse; width: 100%; font-size: 13px; }
.grid th {
  position: sticky; top: 0; z-index: 2;
  background: var(--raised);
  text-align: left;
  font-family: var(--mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase; color: var(--faint);
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.grid th[data-sortable] { cursor: pointer; }
.grid th[data-sortable]:hover { color: var(--muted); }
.grid th[aria-sort] { color: var(--accent); }
.grid td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  max-width: 280px;
}
.grid tr:last-child td { border-bottom: none; }
.grid tbody tr:hover td { background: var(--raised); }

.grid td[data-col="ro-mono"] { font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--muted); }
.grid td[data-col="ro"] { white-space: nowrap; color: var(--muted); }
.grid td[data-col="ro-clamp"] { max-width: 200px; }
.grid td[data-col="name"] { white-space: nowrap; font-weight: 600; }
.grid td[data-col="followup"] { white-space: nowrap; }
.grid td[data-col="note"] { min-width: 160px; max-width: 240px; }

.clamp {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; color: var(--muted); font-size: 12.5px;
}
.cell-name { font-weight: 600; }
.cell-select { height: 30px; min-width: 132px; padding: 0 8px; font-size: 12.5px; }
.cell-date { height: 30px; width: 148px; font-size: 12px; }
.fu--btn { cursor: pointer; }
.fu--btn:hover { border-color: var(--accent); }
.fu-cell { display: inline-flex; }

.cell-edit {
  cursor: text; border-radius: 4px; padding: 3px 5px; margin: -3px -5px;
  display: block; min-height: 22px; font-size: 12.5px;
}
.cell-edit:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); box-shadow: inset 0 0 0 1px var(--line-strong); }
.cell-edit:empty::before { content: attr(data-placeholder); color: var(--faint); }
.cell-saved { animation: saved .9s ease; }
@keyframes saved {
  0% { background: color-mix(in srgb, var(--won) 30%, transparent); }
  100% { background: transparent; }
}
.row-actions { display: flex; gap: 4px; }

.pager { display: flex; align-items: center; gap: 12px; justify-content: flex-end; margin-top: 12px; color: var(--muted); font-size: 12.5px; }
.pager .mono { color: var(--ink); }

/* --- detail drawer ------------------------------------------- */

.scrim {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(10,12,16,.42);
  backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none;
  transition: opacity .16s ease;
}
.scrim[data-open] { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; z-index: 61;
  width: min(460px, 94vw); height: 100dvh;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform .2s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column;
}
.drawer[data-open] { transform: none; }
.drawer__head { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.drawer__head h3 { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.drawer__body { padding: 16px 18px; overflow: auto; display: grid; gap: 14px; }
.drawer__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.drawer__grid label { display: grid; gap: 4px; }
.drawer__grid label.full { grid-column: 1 / -1; }
.drawer__grid .eyebrow { font-size: 10px; }
.raw {
  font-family: var(--mono); font-size: 11.5px; white-space: pre-wrap; word-break: break-word;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px; max-height: 220px; overflow: auto; color: var(--muted);
}

/* --- chat --------------------------------------------------- */

.chat { display: grid; grid-template-columns: 240px 1fr; gap: 16px; height: calc(100dvh - 120px); }
.chat__sessions { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); display: flex; flex-direction: column; overflow: hidden; }
.chat__sessions-head { padding: 10px; border-bottom: 1px solid var(--line); }
.chat__session-list { overflow: auto; flex: 1; padding: 6px; display: grid; gap: 2px; align-content: start; }
.session-item { padding: 8px 9px; border-radius: var(--r-sm); cursor: pointer; font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.session-item:hover { background: var(--raised); color: var(--ink); }
.session-item[aria-current="true"] { background: var(--accent-weak); color: var(--accent); }
.session-item__title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.session-item__del { opacity: 0; border: none; background: none; cursor: pointer; color: var(--faint); padding: 2px; }
.session-item:hover .session-item__del { opacity: 1; }

.chat__main { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); display: flex; flex-direction: column; overflow: hidden; }
.chat__log { flex: 1; overflow: auto; padding: 18px; display: grid; gap: 16px; align-content: start; }
.msg { display: grid; gap: 6px; max-width: 760px; }
.msg__who { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.msg__body { font-size: 13.5px; line-height: 1.6; white-space: pre-wrap; }
.msg--user { justify-self: end; }
.msg--user .msg__body { background: var(--accent-weak); color: var(--ink); padding: 9px 12px; border-radius: 12px 12px 3px 12px; }
.msg--user .msg__who { text-align: right; }
.msg__grounding {
  border: 1px solid var(--line); border-radius: var(--r-sm);
  font-size: 12px; overflow: hidden; margin-top: 2px;
}
.msg__grounding summary { cursor: pointer; padding: 7px 10px; background: var(--raised); font-family: var(--mono); font-size: 11px; color: var(--muted); }
.msg__grounding table { width: 100%; border-collapse: collapse; }
.msg__grounding th, .msg__grounding td { text-align: left; padding: 6px 9px; border-top: 1px solid var(--line); white-space: nowrap; }
.msg__grounding th { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.msg__note { font-size: 11.5px; color: var(--faint); font-family: var(--mono); }
.msg__note--warn { color: var(--warn); }

.chat__compose { border-top: 1px solid var(--line); padding: 12px; display: grid; gap: 8px; }
.chat__suggestions { display: flex; gap: 6px; flex-wrap: wrap; }
.chat__suggestions button { font-size: 11.5px; padding: 4px 9px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--muted); cursor: pointer; }
.chat__suggestions button:hover { border-color: var(--accent); color: var(--accent); }
.chat__compose-row { display: flex; gap: 8px; align-items: flex-end; }
.chat__compose textarea { flex: 1; }

/* --- import ----------------------------------------------- */

.drop {
  border: 1.5px dashed var(--line-strong); border-radius: var(--r-md);
  padding: 34px; text-align: center; color: var(--muted); cursor: pointer;
  transition: border-color .12s ease, background .12s ease;
}
.drop[data-hot] { border-color: var(--accent); background: var(--accent-weak); }
.drop strong { color: var(--ink); font-weight: 600; }
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin: 16px 0; }
.map-grid label { display: grid; gap: 4px; }
.result-line { display: flex; gap: 16px; font-family: var(--mono); font-size: 13px; margin: 10px 0; }
.result-line b { font-weight: 600; }

/* --- settings ------------------------------------------- */

.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 16px 18px; margin-bottom: 16px;
}
.panel h3 { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.panel > p { color: var(--muted); font-size: 12.5px; margin-bottom: 14px; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 8px 14px; font-size: 13px; align-items: center; }
.kv dt { color: var(--muted); }
.kv dd { font-family: var(--mono); font-size: 12px; word-break: break-all; display: flex; align-items: center; gap: 8px; }
.opt-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.opt-row:last-child { border-bottom: none; }
.opt-row .mono { color: var(--muted); font-size: 11px; }
.opt-row__val { flex: 1; }
.tag-off { opacity: .45; text-decoration: line-through; }

/* --- toasts ------------------------------------------- */

.toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 90; display: grid; gap: 8px; width: max-content; max-width: 92vw; }
.toast {
  background: var(--ink); color: var(--paper);
  padding: 9px 15px; border-radius: 999px; font-size: 12.5px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toast-in .18s ease;
}
.toast--err { background: var(--alarm); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }

/* --- responsive ------------------------------------- */

@media (max-width: 1080px) {
  .board { grid-template-columns: 1fr; }
  .chat { grid-template-columns: 1fr; height: auto; }
  .chat__sessions { max-height: 220px; }
}

@media (max-width: 860px) {
  :root { --rail: 0px; }
  .shell { grid-template-columns: 1fr; }
  .rail {
    position: fixed; bottom: 0; left: 0; right: 0; top: auto;
    height: auto; width: 100%;
    flex-direction: row; gap: 2px;
    border-right: none; border-top: 1px solid var(--line);
    padding: 6px; z-index: 40;
    overflow-x: auto;
  }
  .rail__brand, .rail__foot { display: none; }
  .nav-link { flex-direction: column; gap: 3px; font-size: 10px; padding: 6px 10px; white-space: nowrap; }
  .nav-link__badge { position: absolute; margin: 0; transform: translate(14px, -10px); }
  .main { padding-bottom: 64px; }
  .topbar__search { width: 46vw; }
  .drawer__grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
