/* Mira web: tokens, shell and components (docs/web/core.md). One markup for phone and desk: under 760 px a top bar
   and bottom tabs, from 760 px a rail (icons only up to 1100 px), from 1280 px an optional right panel. A site themes
   itself by redefining the tokens under body[data-site=<project>] in its own CSS (web/<domain>/<domain>.css). */

:root {
  color-scheme: light;
  /* Surfaces and text */
  --bg: #f6f3ee; --bg-2: #efebe3; --surface: #ffffff; --surface-2: #faf8f4; --line: #e6e0d5; --line-2: #d6cec0;
  --ink: #17201f; --ink-2: #4f5a58; --ink-3: #626b69; --ink-inv: #ffffff;
  /* Brand (the rail, the login's left side) and accent (actions, links, the current tab): Mira's teal and fox */
  --brand: #0d4650; --brand-2: #0a3a43; --brand-3: #155a66; --brand-ink: #e9f3f2; --brand-ink-2: #9fc2c2;
  --accent: #b84c0e; --accent-2: #9c3f0a; --accent-ink: #ffffff; --accent-soft: #fbe7da; --accent-line: #f3c4a4;
  --focus: #1f8a9a;
  /* Tones */
  --ok: #1d7a4d; --ok-soft: #dff2e7; --wait: #8a5900; --wait-soft: #fbefd2; --bad: #b8323c; --bad-soft: #fbe2e3;
  --info: #22608f; --info-soft: #e0edf8; --mute: #5f6765; --mute-soft: #eceae5;
  /* Type */
  --f-ui: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --f-mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, Consolas, monospace;
  --t-xs: 12px; --t-s: 13px; --t-m: 15px; --t-l: 17px; --t-xl: 21px; --t-2xl: 27px;
  /* Shape */
  --r-s: 8px; --r: 12px; --r-l: 18px; --r-pill: 999px;
  --shadow-1: 0 1px 2px rgba(23, 32, 31, .06), 0 1px 1px rgba(23, 32, 31, .04);
  --shadow-2: 0 10px 30px -12px rgba(23, 32, 31, .28), 0 2px 6px rgba(23, 32, 31, .06);
  --shadow-3: 0 24px 60px -20px rgba(10, 30, 30, .45);
  /* Layout */
  --rail-w: 248px; --rail-w-s: 76px; --top-h: 56px; --tab-h: 62px; --panel-w: 380px; --content-max: 1120px;
  --gut: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
:root[data-theme="dark"] { color-scheme: dark; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { color-scheme: dark; } }
/* Dark: the same roles, redefined; a site's dark palette goes under body[data-site=x] in the same two places. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101616; --bg-2: #151d1d; --surface: #182121; --surface-2: #1c2626; --line: #273333; --line-2: #354343;
    --ink: #e8eeec; --ink-2: #a9b6b4; --ink-3: #8b9995; --ink-inv: #101616;
    --brand: #0b2e34; --brand-2: #08252a; --brand-3: #124049; --brand-ink: #e2efee; --brand-ink-2: #86a9a8;
    --accent: #f08a4b; --accent-2: #ff9c5e; --accent-ink: #1a0d04; --accent-soft: #3a2416; --accent-line: #6a3a1c;
    --focus: #4fb7c6;
    --ok: #5cc98f; --ok-soft: #173326; --wait: #e2b04f; --wait-soft: #362a12; --bad: #ff7f88; --bad-soft: #3b1c20;
    --info: #79b6e6; --info-soft: #172b3b; --mute: #98a3a1; --mute-soft: #232d2d;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4); --shadow-2: 0 12px 30px -12px rgba(0, 0, 0, .7); --shadow-3: 0 24px 60px -20px rgba(0, 0, 0, .8);
  }
}
:root[data-theme="dark"] {
  --bg: #101616; --bg-2: #151d1d; --surface: #182121; --surface-2: #1c2626; --line: #273333; --line-2: #354343;
  --ink: #e8eeec; --ink-2: #a9b6b4; --ink-3: #8b9995; --ink-inv: #101616;
  --brand: #0b2e34; --brand-2: #08252a; --brand-3: #124049; --brand-ink: #e2efee; --brand-ink-2: #86a9a8;
  --accent: #f08a4b; --accent-2: #ff9c5e; --accent-ink: #1a0d04; --accent-soft: #3a2416; --accent-line: #6a3a1c;
  --focus: #4fb7c6;
  --ok: #5cc98f; --ok-soft: #173326; --wait: #e2b04f; --wait-soft: #362a12; --bad: #ff7f88; --bad-soft: #3b1c20;
  --info: #79b6e6; --info-soft: #172b3b; --mute: #98a3a1; --mute-soft: #232d2d;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4); --shadow-2: 0 12px 30px -12px rgba(0, 0, 0, .7); --shadow-3: 0 24px 60px -20px rgba(0, 0, 0, .8);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; font: 400 var(--t-m)/1.5 var(--f-ui); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p, ul, ol, figure, blockquote, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--f-mono); font-size: .92em; }
.muted { color: var(--ink-2); } .faint { color: var(--ink-3); }
.small { font-size: var(--t-s); } .xs { font-size: var(--t-xs); }
.nowrap { white-space: nowrap; } .clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--surface); padding: 8px 12px; border-radius: var(--r-s); }
.skip:focus { left: 8px; }
.ico { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ico.s { width: 16px; height: 16px; } .ico.l { width: 24px; height: 24px; }
.stack { display: grid; gap: var(--gap, 16px); align-content: start; min-width: 0; }
.row-x { display: flex; align-items: center; gap: var(--gap, 10px); min-width: 0; flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.grid-2, .grid-3, .grid-4 { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
/* Blocks for one layout only: a phone and a desk may each get their own markup for the same thing. */
@media (max-width: 759.98px) { .only-desk { display: none !important; } }
@media (min-width: 760px) { .only-phone { display: none !important; } }

/* ---------- Shell ---------- */
.app { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr auto;
  grid-template-areas: "top" "main" "tabs"; }
.rail { display: none; }
.topbar { grid-area: top; position: sticky; top: 0; z-index: 20; height: var(--top-h); display: flex; align-items: center; gap: 6px;
  padding: 0 8px 0 var(--gut); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid transparent; }
.topbar.scrolled, .topbar.line { border-bottom-color: var(--line); }
.topbar .t-title { flex: 1; min-width: 0; display: grid; line-height: 1.2; }
.topbar .t-title b { font-size: var(--t-l); font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .t-title small { font-size: var(--t-xs); color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .t-brand { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: var(--ink); text-decoration: none; }
.topbar .t-brand img { width: 30px; height: 30px; border-radius: 50%; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; border: 0; background: transparent;
  color: var(--ink-2); cursor: pointer; text-decoration: none; flex: none; }
.icon-btn:hover { background: var(--bg-2); color: var(--ink); text-decoration: none; }
.icon-btn .dot { position: absolute; top: 8px; right: 8px; min-width: 9px; height: 9px; border-radius: 9px; background: var(--accent); box-shadow: 0 0 0 2px var(--bg); }
.icon-btn .count { position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent);
  color: var(--accent-ink); font-size: 11px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bg); }
.back { display: inline-grid; place-items: center; width: 38px; height: 38px; margin-left: -10px; border-radius: 50%; color: var(--ink); }
.back:hover { background: var(--bg-2); text-decoration: none; }
.me-av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; background: var(--accent-soft); color: var(--accent-2); flex: none; }

.main { grid-area: main; min-width: 0; padding: 14px var(--gut) calc(28px + var(--safe-b)); }
.main > .inner { max-width: var(--content-max); margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; min-width: 0; }
.panel { display: none; }
.panel-inline { display: grid; gap: 14px; }

.tabs { grid-area: tabs; position: sticky; bottom: 0; z-index: 20; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b); background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
.tabs a { display: grid; justify-items: center; align-content: center; gap: 3px; color: var(--ink-3); font-size: 11.5px; font-weight: 600; text-decoration: none; position: relative; }
.tabs a .ico { width: 23px; height: 23px; }
.tabs a.on { color: var(--accent-2); }
.tabs a.on .ico { stroke-width: 2.1; }
.tabs a.on::before { content: ''; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
.tabs a .count { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font-size: 10.5px; display: grid; place-items: center; }

@media (min-width: 760px) {
  .app { grid-template-columns: var(--rail-w-s) minmax(0, 1fr); grid-template-rows: auto 1fr; grid-template-areas: "rail top" "rail main"; }
  .tabs { display: none; }
  .rail { grid-area: rail; display: flex; flex-direction: column; position: sticky; top: 0; height: 100dvh; background: var(--brand); color: var(--brand-ink);
    padding: 14px 10px; gap: 4px; overflow-y: auto; }
  .rail .r-brand { display: flex; align-items: center; gap: 10px; padding: 4px 4px 16px; color: var(--brand-ink); text-decoration: none; }
  .rail .r-brand img { width: 40px; height: 40px; border-radius: 12px; flex: none; box-shadow: 0 0 0 2px rgba(255, 255, 255, .12); }
  .rail .r-brand span { display: none; }
  .rail .r-brand b { font-size: 16px; font-weight: 700; letter-spacing: -.01em; display: block; line-height: 1.15; }
  .rail .r-brand small { font-size: 12px; color: var(--brand-ink-2); display: block; }
  .rail .r-sec { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-ink-2); padding: 14px 10px 4px; display: none; }
  .rail a.r-link { display: grid; justify-items: center; gap: 2px; padding: 9px 4px; border-radius: 12px; color: var(--brand-ink-2); font-size: 11px; font-weight: 600;
    text-decoration: none; position: relative; text-align: center; }
  .rail a.r-link:hover { background: var(--brand-3); color: var(--brand-ink); }
  .rail a.r-link.on { background: var(--brand-3); color: #fff; }
  .rail a.r-link.on::before { content: ''; position: absolute; left: -10px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
  .rail a.r-link .ico { width: 22px; height: 22px; }
  .rail a.r-link .count { position: absolute; top: 4px; right: 8px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font-size: 10.5px; display: grid; place-items: center; }
  .rail .r-foot { margin-top: auto; display: grid; gap: 8px; padding-top: 12px; }
  .rail .r-status { display: none; }
  .topbar { padding: 0 20px 0 24px; height: 64px; }
  .topbar .t-brand { display: none; }
  .back { margin-left: -8px; }
  .main { padding: 22px 24px 48px; }
  .search-top { display: flex; }
}
@media (min-width: 1100px) {
  .app { grid-template-columns: var(--rail-w) minmax(0, 1fr); }
  .rail { padding: 18px 14px; }
  .rail .r-brand span { display: block; min-width: 0; }
  .rail .r-sec { display: block; }
  .rail a.r-link { grid-template-columns: 22px minmax(0, 1fr) auto; justify-items: start; align-items: center; gap: 12px; padding: 9px 12px; font-size: 14.5px; font-weight: 550; text-align: left; }
  .rail a.r-link.on::before { left: -14px; }
  .rail a.r-link .count { position: static; }
  .rail .r-status { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 14px; background: var(--brand-2); font-size: 13px; color: var(--brand-ink-2); line-height: 1.35; }
  .rail .r-status b { color: var(--brand-ink); font-weight: 600; display: block; }
  .main { padding: 26px 36px 56px; }
}
@media (min-width: 1280px) {
  .app.has-panel { grid-template-columns: var(--rail-w) minmax(0, 1fr) var(--panel-w); grid-template-areas: "rail top top" "rail main panel"; }
  .app.has-panel .panel { grid-area: panel; display: grid; align-content: start; gap: 16px; padding: 22px 22px 40px 0; position: sticky; top: 64px; max-height: calc(100dvh - 64px); overflow-y: auto; }
  .app.has-panel .panel-inline { display: none; }
}
/* The top bar's search (desk) */
.search-top { display: none; align-items: center; gap: 8px; height: 40px; width: min(420px, 38vw); margin-left: auto; padding: 0 12px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-3); }
.search-top input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; color: var(--ink); }
.search-top:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 20%, transparent); }

/* ---------- Page header ---------- */
.ph { display: grid; gap: 6px; }
.ph .ph-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ph h1 { font-size: var(--t-2xl); line-height: 1.15; font-weight: 750; letter-spacing: -.02em; }
.ph p { color: var(--ink-2); max-width: 70ch; }
.ph .kicker { font-size: var(--t-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-2); }
@media (max-width: 759.98px) { .ph h1 { font-size: 23px; } }
.section-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-h h2 { font-size: var(--t-l); font-weight: 680; letter-spacing: -.01em; }
.section-h a { font-size: var(--t-s); font-weight: 600; }

/* ---------- Buttons and fields ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: var(--r-pill);
  border: 1px solid transparent; background: var(--accent); color: var(--accent-ink); font-weight: 650; font-size: var(--t-m); cursor: pointer;
  text-decoration: none; white-space: nowrap; transition: background .15s, transform .05s; }
.btn:hover { background: var(--accent-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn.ghost:hover { background: var(--bg-2); }
.btn.soft { background: var(--accent-soft); color: var(--accent-2); }
.btn.soft:hover { background: color-mix(in srgb, var(--accent-soft) 80%, var(--accent)); }
.btn.dark { background: var(--ink); color: var(--ink-inv); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.s { height: 34px; padding: 0 13px; font-size: var(--t-s); }
.btn.block { width: 100%; }
.btn[disabled], .btn.busy { opacity: .55; pointer-events: none; }
.link-btn { border: 0; background: none; padding: 0; color: var(--accent-2); font-weight: 600; cursor: pointer; }
.field { display: grid; gap: 6px; }
.field label, .label { font-size: var(--t-s); font-weight: 600; color: var(--ink-2); }
.input, .select, .textarea { width: 100%; min-height: 44px; padding: 10px 13px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--surface);
  color: var(--ink); outline: 0; font-size: 16px; }
.select { appearance: none; padding-right: 34px; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 17px) 19px, calc(100% - 12px) 19px; background-size: 5px 5px; background-repeat: no-repeat; }
.textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 20%, transparent); }
.hint { font-size: var(--t-xs); color: var(--ink-3); }
.error-text { font-size: var(--t-s); color: var(--bad); font-weight: 600; }

/* ---------- Cards, lists, rows ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow-1); min-width: 0; }
.card.pad { padding: 16px; }
@media (min-width: 760px) { .card.pad { padding: 20px; } }
.card .card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px 10px; }
.card .card-h h3 { font-size: var(--t-m); font-weight: 680; }
.card .card-h .muted { font-size: var(--t-s); }
.card .card-b { padding: 0 16px 16px; }
.card.flat { box-shadow: none; }
.card.tint { background: var(--accent-soft); border-color: var(--accent-line); }
.card.brand { background: var(--brand); color: var(--brand-ink); border-color: transparent; }
a.card { display: block; color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s; }
a.card:hover { border-color: var(--line-2); box-shadow: var(--shadow-2); text-decoration: none; }

.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; box-shadow: var(--shadow-1); }
.list.bare { background: transparent; border: 0; box-shadow: none; border-radius: 0; }
.list > li + li, .list > .row + .row { border-top: 1px solid var(--line); }
.row { display: flex; align-items: center; gap: 12px; padding: 13px 16px; min-width: 0; color: inherit; text-decoration: none; position: relative; }
a.row:hover, .row.link:hover { background: var(--surface-2); text-decoration: none; }
.row .r-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.row .r-title { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .r-title.wrap { white-space: normal; }
.row .r-sub { font-size: var(--t-s); color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .r-sub.wrap { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.row .r-meta { display: grid; justify-items: end; gap: 4px; font-size: var(--t-xs); color: var(--ink-3); flex: none; text-align: right; }
.row .chev { color: var(--ink-3); flex: none; }
.row.unread::before { content: ''; position: absolute; left: 6px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--accent); }

/* ---------- Chips, avatars, stats ---------- */
.chip { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: var(--r-pill); font-size: var(--t-xs); font-weight: 650;
  background: var(--mute-soft); color: var(--mute); white-space: nowrap; line-height: 1; }
.chip .ico { width: 13px; height: 13px; stroke-width: 2.2; }
.chip.ok { background: var(--ok-soft); color: var(--ok); } .chip.wait { background: var(--wait-soft); color: var(--wait); }
.chip.bad { background: var(--bad-soft); color: var(--bad); } .chip.info { background: var(--info-soft); color: var(--info); }
.chip.accent { background: var(--accent-soft); color: var(--accent-2); }
.chip.line { background: transparent; border: 1px solid var(--line-2); color: var(--ink-2); }
.chip .pulse { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.75); } }
@media (prefers-reduced-motion: reduce) { .chip .pulse, .typing i { animation: none; } }
.av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; flex: none; color: #fff; overflow: hidden; }
.av.s { width: 28px; height: 28px; font-size: 11px; } .av.l { width: 48px; height: 48px; font-size: 17px; }
.av img { width: 100%; height: 100%; object-fit: cover; }
.av.t0 { background: #2f7d6d; } .av.t1 { background: #b65a2c; } .av.t2 { background: #5b5fb3; } .av.t3 { background: #9a4a7a; } .av.t4 { background: #3f6e9e; } .av.t5 { background: #7a6a2a; }
.stat { display: grid; gap: 2px; padding: 14px 16px; }
.stat b { font-size: 26px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat span { font-size: var(--t-s); color: var(--ink-2); }
.stat small { font-size: var(--t-xs); color: var(--ink-3); }
.stat.ok b { color: var(--ok); } .stat.wait b { color: var(--wait); } .stat.bad b { color: var(--bad); } .stat.accent b { color: var(--accent-2); }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow-1); overflow: hidden; }
.stats .stat + .stat { border-left: 1px solid var(--line); }
.stats .stat:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); } .stats .stat:nth-child(4) { border-top: 1px solid var(--line); }
@media (min-width: 760px) { .stats { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); grid-auto-flow: column; } .stats .stat:nth-child(n) { border-top: 0; border-left: 1px solid var(--line); } .stats .stat:first-child { border-left: 0; } }

/* ---------- Tabs (in page), segmented, filters ---------- */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--r-pill); background: var(--bg-2); border: 1px solid var(--line); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg a, .seg button { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: var(--r-pill); border: 0; background: transparent; color: var(--ink-2);
  font-weight: 600; font-size: var(--t-s); white-space: nowrap; text-decoration: none; cursor: pointer; }
.seg a.on, .seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.seg .n { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.ptabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gut)); padding: 0 var(--gut); }
.ptabs a { padding: 10px 12px 11px; color: var(--ink-2); font-weight: 600; font-size: var(--t-s); white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none; }
.ptabs a.on { color: var(--ink); border-bottom-color: var(--accent); }
@media (min-width: 760px) { .ptabs { margin: 0; padding: 0; } }
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filters .f-search { flex: 1 1 220px; display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line-2); color: var(--ink-3); min-width: 0; }
.filters .f-search input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; font-size: 16px; color: var(--ink); }
.filters .f-search:focus-within { border-color: var(--focus); }
.filters .select { width: auto; min-height: 42px; border-radius: var(--r-pill); font-size: var(--t-s); font-weight: 600; padding-left: 14px; }
.chipset { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chipset a, .chipset label { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 13px; border-radius: var(--r-pill); border: 1px solid var(--line-2); background: var(--surface);
  color: var(--ink-2); font-weight: 600; font-size: var(--t-s); white-space: nowrap; text-decoration: none; cursor: pointer; }
.chipset a.on, .chipset input:checked + span { background: var(--ink); color: var(--ink-inv); border-color: var(--ink); }
.chipset input { position: absolute; opacity: 0; pointer-events: none; }
.chipset .n { font-size: 11px; opacity: .7; font-variant-numeric: tabular-nums; }
@media (max-width: 759.98px) { .chipset { margin: 0 calc(-1 * var(--gut)); padding: 0 var(--gut) 2px; } }

/* ---------- Table: cards under 760 px ---------- */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow-1); overflow: hidden; }
.table { width: 100%; border-collapse: collapse; font-size: var(--t-s); }
.table th { text-align: left; font-size: var(--t-xs); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); padding: 11px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table td.n, .table th.n { text-align: right; font-variant-numeric: tabular-nums; }
.table a.cell-link { color: var(--ink); font-weight: 600; }
@media (max-width: 759.98px) {
  .table-wrap.cards { background: transparent; border: 0; box-shadow: none; border-radius: 0; }
  .table.cards thead { display: none; }
  .table.cards, .table.cards tbody, .table.cards tr, .table.cards td { display: block; }
  .table.cards tr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 12px 14px; margin-bottom: 10px; box-shadow: var(--shadow-1); }
  .table.cards td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 12px; }
  .table.cards td::before { content: attr(data-l); color: var(--ink-3); font-size: var(--t-xs); font-weight: 600; flex: none; }
  .table.cards td.lead { font-size: var(--t-m); padding-bottom: 6px; }
  .table.cards td.lead::before { content: none; }
}

/* ---------- Timeline ---------- */
.timeline { display: grid; gap: 0; position: relative; }
.timeline li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; padding-bottom: 14px; position: relative; }
.timeline li::before { content: ''; position: absolute; left: 10px; top: 18px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::before { content: none; }
.timeline .tl-dot { width: 22px; height: 22px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-2); display: grid; place-items: center; z-index: 1; }
.timeline .tl-dot.ok { border-color: var(--ok); background: var(--ok-soft); } .timeline .tl-dot.accent { border-color: var(--accent); background: var(--accent-soft); }
.timeline .tl-dot.wait { border-color: var(--wait); background: var(--wait-soft); }
.timeline .tl-b { display: grid; gap: 2px; padding-top: 1px; min-width: 0; }
.timeline .tl-b b { font-weight: 600; font-size: var(--t-s); }
.timeline .tl-b span { font-size: var(--t-s); color: var(--ink-2); overflow-wrap: anywhere; }
.timeline .tl-b time { font-size: var(--t-xs); color: var(--ink-3); }

/* ---------- Empty, notice, toast ---------- */
.empty { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 36px 20px; color: var(--ink-2); }
.empty .e-ico { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--bg-2); color: var(--ink-3); }
.empty b { color: var(--ink); font-size: var(--t-l); }
.empty p { max-width: 42ch; font-size: var(--t-s); }
.empty .row-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 13px 15px; border-radius: var(--r); background: var(--info-soft); color: var(--ink); font-size: var(--t-s); }
.notice .ico { color: var(--info); margin-top: 1px; }
.notice.wait { background: var(--wait-soft); } .notice.wait .ico { color: var(--wait); }
.notice.bad { background: var(--bad-soft); } .notice.bad .ico { color: var(--bad); }
.notice.ok { background: var(--ok-soft); } .notice.ok .ico { color: var(--ok); }
.toast { position: fixed; z-index: 60; left: 50%; bottom: calc(var(--tab-h) + 16px + var(--safe-b)); transform: translateX(-50%); display: flex; gap: 10px; align-items: center;
  padding: 11px 16px; border-radius: var(--r-pill); background: var(--ink); color: var(--ink-inv); font-weight: 600; font-size: var(--t-s); box-shadow: var(--shadow-3);
  animation: toast 4.2s ease forwards; max-width: calc(100vw - 32px); }
@media (min-width: 760px) { .toast { bottom: 28px; } }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, 10px); } 6%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, 6px); visibility: hidden; } }

/* ---------- Sheet: a bottom sheet on a phone, a side drawer on a desk (a <dialog>) ---------- */
dialog.sheet { border: 0; padding: 0; background: var(--surface); color: var(--ink); max-width: none; max-height: none; box-shadow: var(--shadow-3); }
dialog.sheet::backdrop { background: rgba(8, 20, 20, .42); backdrop-filter: blur(2px); }
dialog.sheet .sh-h { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; background: var(--surface); border-bottom: 1px solid var(--line); z-index: 1; }
dialog.sheet .sh-h h2 { font-size: var(--t-l); font-weight: 680; }
dialog.sheet .sh-b { padding: 16px; display: grid; gap: 14px; }
@media (max-width: 759.98px) {
  dialog.sheet { margin: auto 0 0; width: 100%; max-height: 88dvh; border-radius: 20px 20px 0 0; padding-bottom: var(--safe-b); }
  dialog.sheet[open] { animation: sheet-up .22s ease-out; }
  dialog.sheet .sh-h::before { content: ''; position: absolute; top: 6px; left: 50%; width: 38px; height: 4px; margin-left: -19px; border-radius: 4px; background: var(--line-2); }
}
@media (min-width: 760px) {
  dialog.sheet { margin: 0 0 0 auto; width: min(520px, 92vw); height: 100dvh; border-radius: 20px 0 0 20px; }
  dialog.sheet[open] { animation: sheet-in .2s ease-out; }
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: .4; } }
@keyframes sheet-in { from { transform: translateX(40px); opacity: .4; } }

/* ---------- Mira: state, conversations, messages ---------- */
.mira-state { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-l); background: var(--brand); color: var(--brand-ink); }
.mira-state img { width: 40px; height: 40px; border-radius: 50%; flex: none; }
.mira-state b { display: block; font-weight: 650; }
.mira-state span { font-size: var(--t-s); color: var(--brand-ink-2); }
.state-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }
.state-dot.busy { background: var(--accent); animation: pulse 1.4s infinite; } .state-dot.rest { background: var(--wait); box-shadow: 0 0 0 3px color-mix(in srgb, var(--wait) 25%, transparent); }

.ask { display: grid; gap: 10px; padding: 14px; border-radius: var(--r-l); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.ask .ask-h { display: flex; align-items: center; gap: 10px; font-weight: 650; }
.ask .ask-h img { width: 28px; height: 28px; border-radius: 50%; }
.ask .ask-box { display: flex; gap: 8px; align-items: flex-end; }
.ask textarea { flex: 1; min-height: 46px; max-height: 180px; resize: none; padding: 11px 14px; border-radius: 22px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink); outline: 0; font-size: 16px; line-height: 1.4; }
.ask textarea:focus { border-color: var(--focus); background: var(--surface); }
.ask .sugg { display: flex; gap: 6px; flex-wrap: wrap; }
.ask .sugg button { border: 1px solid var(--accent-line); background: var(--accent-soft); color: var(--accent-2); border-radius: var(--r-pill); padding: 6px 12px; font-size: var(--t-s); font-weight: 600; cursor: pointer; }
.send-btn { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; cursor: pointer; flex: none; }
.send-btn:hover { background: var(--accent-2); }
.attach-btn { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); display: grid; place-items: center; cursor: pointer; flex: none; }

.convo-row .r-title { display: flex; gap: 8px; align-items: center; }
.door { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: var(--mute-soft); color: var(--mute); }
.door.wa { background: #dcf5e4; color: #157a3c; } .door.web { background: var(--info-soft); color: var(--info); }
:root[data-theme="dark"] .door.wa { background: #163223; color: #6fd69a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .door.wa { background: #163223; color: #6fd69a; } }

.thread { display: grid; gap: 14px; padding-bottom: 8px; }
.day-sep { justify-self: center; font-size: var(--t-xs); font-weight: 650; color: var(--ink-3); background: var(--bg-2); padding: 3px 10px; border-radius: var(--r-pill); }
.msg { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 10px; align-items: start; max-width: 760px; }
.msg .av { width: 32px; height: 32px; font-size: 12px; }
.msg .m-h { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: var(--t-s); }
.msg .m-h b { font-weight: 650; }
.msg .m-h time { font-size: var(--t-xs); color: var(--ink-3); }
.msg .bubble { margin-top: 4px; padding: 10px 14px; border-radius: 4px 16px 16px 16px; background: var(--surface); border: 1px solid var(--line); overflow-wrap: anywhere; line-height: 1.5; }
.msg .bubble p + p, .msg .bubble ul, .msg .bubble ol, .msg .bubble pre { margin-top: 8px; }
.msg .bubble ul { list-style: disc; padding-left: 20px; } .msg .bubble ol { list-style: decimal; padding-left: 20px; }
.msg .bubble pre { background: var(--bg-2); padding: 10px; border-radius: var(--r-s); overflow-x: auto; font: 13px/1.45 var(--f-mono); }
.msg .bubble code { font-family: var(--f-mono); font-size: .9em; background: var(--bg-2); padding: 1px 5px; border-radius: 5px; }
.msg.me { justify-self: stretch; display: flex; justify-content: flex-end; max-width: none; }
.msg.me > div { display: flex; flex-direction: column; align-items: flex-end; max-width: min(640px, 88%); min-width: 0; }
.msg.me .bubble { max-width: 100%; }
.msg.me .av, .msg.me .m-h b { display: none; }
.msg.me .m-h { justify-content: flex-end; }
.msg.me .bubble { background: var(--accent-soft); border-color: var(--accent-line); border-radius: 16px 4px 16px 16px; }
.msg.mira .bubble { background: var(--surface); }
.msg.cont { margin-top: -10px; }
.msg.cont .bubble { margin-top: 0; }
.msg .bubble > .files:first-child { margin-top: 0; }
.msg .bubble > .files:first-child + * { margin-top: 8px; }
.file-chip.static { cursor: default; }
.file-chip.static:hover { border-color: var(--line); }
.file-chip .ico { flex: none; color: var(--ink-3); }
.more-older { display: flex; justify-content: center; margin: 4px 0 14px; }
.msg .files { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.file-chip { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 8px 12px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); font-size: var(--t-s); font-weight: 600; text-decoration: none; }
.file-chip:hover { border-color: var(--line-2); text-decoration: none; }
.file-chip .ext { font-size: 10px; font-weight: 800; padding: 3px 5px; border-radius: 5px; background: var(--info-soft); color: var(--info); text-transform: uppercase; }
.file-chip .ext.pdf { background: var(--bad-soft); color: var(--bad); } .file-chip .ext.xls, .file-chip .ext.xlsx, .file-chip .ext.csv { background: var(--ok-soft); color: var(--ok); }
.msg .img-out { margin-top: 8px; max-width: 320px; border-radius: var(--r); border: 1px solid var(--line); }
.acts { display: grid; gap: 4px; padding: 8px 12px; margin-left: 42px; border-left: 2px solid var(--line); font-size: var(--t-xs); color: var(--ink-3); font-family: var(--f-mono); max-width: 720px; }
.acts summary { cursor: pointer; font-family: var(--f-ui); font-weight: 600; color: var(--ink-2); }
.typing { display: inline-flex; gap: 4px; align-items: center; padding: 12px 14px; border-radius: 4px 16px 16px 16px; background: var(--surface); border: 1px solid var(--line); margin-top: 4px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); animation: pulse 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
.turn-note { justify-self: center; display: flex; gap: 10px; align-items: center; font-size: var(--t-s); color: var(--ink-2); padding: 8px 12px; border-radius: var(--r); background: var(--wait-soft); }
.composer { position: sticky; bottom: calc(var(--tab-h) + var(--safe-b)); z-index: 10; padding: 10px 0 6px; background: linear-gradient(to top, var(--bg) 80%, transparent); }
@media (min-width: 760px) { .composer { bottom: 0; padding-bottom: 18px; } }
.composer form { display: flex; gap: 8px; align-items: flex-end; max-width: 760px; }
.composer textarea { flex: 1; min-height: 46px; max-height: 40dvh; resize: none; padding: 11px 16px; border-radius: 23px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); outline: 0; font-size: 16px; line-height: 1.4; box-shadow: var(--shadow-2); }
.composer textarea:focus { border-color: var(--focus); }
.composer .picked { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 0 8px; }

/* ---------- Login ---------- */
.login { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); background: var(--bg); }
.login .l-hero { background: var(--brand); color: var(--brand-ink); padding: 28px 24px 30px; display: grid; gap: 14px; align-content: end; position: relative; overflow: hidden; }
.login .l-hero::after { content: ''; position: absolute; right: -80px; top: -80px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 45%, transparent), transparent 70%); opacity: .55; }
.login .l-hero img { width: 64px; height: 64px; border-radius: 20px; box-shadow: 0 0 0 3px rgba(255, 255, 255, .12); position: relative; z-index: 1; }
.login .l-hero .kicker { font-size: var(--t-xs); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--brand-ink-2); }
.login .l-hero h1 { font-size: 30px; line-height: 1.1; font-weight: 760; letter-spacing: -.02em; position: relative; z-index: 1; }
.login .l-hero p { color: var(--brand-ink-2); max-width: 40ch; position: relative; z-index: 1; }
.login .l-form { padding: 26px 24px 40px; display: grid; gap: 16px; align-content: start; max-width: 440px; width: 100%; justify-self: center; }
.login .l-form h2 { font-size: var(--t-xl); font-weight: 700; letter-spacing: -.01em; }
.login .code-boxes { display: none; gap: 8px; }
.login .code-boxes input { width: 100%; height: 58px; text-align: center; font-size: 24px; font-weight: 700; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--surface); outline: 0; }
.login .code-boxes input:focus { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 20%, transparent); }
.login .code-one { font-size: 26px; letter-spacing: .4em; text-align: center; font-weight: 700; height: 60px; }
.login .l-alt { display: flex; gap: 14px; align-items: center; font-size: var(--t-s); color: var(--ink-3); }
@media (min-width: 900px) {
  .login { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
  .login .l-hero { padding: 56px 64px; align-content: space-between; }
  .login .l-hero h1 { font-size: 46px; max-width: 14ch; }
  .login .l-hero p { font-size: var(--t-l); }
  .login .l-form { align-content: center; padding: 56px; }
  .login.js .code-boxes { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .login.js .code-one { display: none; }
}

/* ---------- Print ---------- */
@media print { .rail, .tabs, .topbar, .composer, .ask { display: none !important; } .app { display: block; } body { background: #fff; } }

/* A conversation on a phone: no bottom tabs, the composer at the bottom edge. */
@media (max-width: 759.98px) {
  .app.chat { grid-template-rows: auto 1fr; grid-template-areas: "top" "main"; }
  .app.chat .tabs { display: none; }
  .app.chat .composer { bottom: 0; padding-bottom: calc(8px + var(--safe-b)); }
  .app.chat .main { padding-bottom: 0; }
}
.mention { color: var(--accent-2); font-weight: 650; }
.acts ol { display: grid; gap: 3px; margin-top: 6px; }
.acts li { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acts li b { font-family: var(--f-ui); font-weight: 600; color: var(--ink-2); }
.acts[open] summary { margin-bottom: 2px; }
dl dt { font-weight: 500; } dl dd { font-weight: 600; text-align: right; }
/* Shown where the right panel is not (under 1280 px); the panel's copy is hidden when the panel falls inline. */
@media (min-width: 1100px) { .no-wide { display: none !important; } } /* the rail shows Mira's state from 1100 px */
.panel-inline .mira-state { display: none; }
/* A conversation on a phone: the top bar carries the title; the details card waits on a desk. */
@media (max-width: 759.98px) { .app.chat .ph h1 { display: none; } .app.chat .panel-inline { display: none; } }
@media (min-width: 760px) and (max-width: 1279.98px) { .app.chat .panel-inline { order: -1; } }
/* A public page (no login): the site's logo and name, then the content in one column. */
.pub-top { display: flex; align-items: center; gap: 10px; padding: 14px var(--gut); border-bottom: 1px solid var(--line); background: var(--surface); }
.pub-top img { width: 32px; height: 32px; border-radius: 9px; }
.pub-main { padding: 22px var(--gut) 48px; }
.pub-main > .inner { max-width: 640px; margin: 0 auto; display: grid; gap: 18px; }
/* The rail's colour down the whole page (a full-page screenshot, a long page): the body paints the rail's column. */
@media (min-width: 760px) { body.app { background: linear-gradient(to right, var(--brand) var(--rail-w-s), var(--bg) var(--rail-w-s)); } }
@media (min-width: 1100px) { body.app { background: linear-gradient(to right, var(--brand) var(--rail-w), var(--bg) var(--rail-w)); } }
/* A secret reply (a code, a password): the box hides what is typed; the thread shows only that one was sent. */
.composer form { flex-wrap: wrap; }
.secret-toggle { flex-basis: 100%; display: flex; justify-content: flex-end; font-size: var(--t-xs); color: var(--ink-3); cursor: pointer; margin-top: -2px; }
.secret-toggle span { display: inline-flex; gap: 4px; align-items: center; padding: 3px 8px; border-radius: var(--r-pill); }
.secret-toggle input { position: absolute; opacity: 0; }
.secret-toggle input:checked + span { background: var(--wait-soft); color: var(--wait); font-weight: 650; }
.secret-toggle input:focus-visible + span { outline: 2px solid var(--focus); }
.composer.secret textarea { -webkit-text-security: disc; font-family: var(--f-mono); letter-spacing: .1em; }
.bubble.secret { display: inline-flex; gap: 6px; align-items: center; color: var(--ink-2); font-style: italic; }
/* Tanya Mira from any page: a button above the tabs (phone) or in the corner (desk), a sheet with the page as ref. */
.fab { position: fixed; z-index: 15; right: 16px; bottom: calc(var(--tab-h) + 14px + var(--safe-b)); display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 16px 0 6px;
  border-radius: var(--r-pill); border: 0; background: var(--brand); color: var(--brand-ink); font-weight: 650; box-shadow: var(--shadow-3); cursor: pointer; }
.fab img { width: 36px; height: 36px; border-radius: 50%; }
.fab:hover { background: var(--brand-3); }
@media (max-width: 759.98px) { .fab span { display: none; } .fab { padding: 6px; width: 48px; justify-content: center; } }
@media (min-width: 760px) { .fab { bottom: 24px; right: 24px; } }
.app.has-panel .fab { right: 24px; }
dialog.sheet .ask { box-shadow: none; border: 0; padding: 0; }
.r-sub .hit, .hit { color: var(--ink-2); font-size: var(--t-s); }
form[data-composer].drop { outline: 2px dashed var(--accent); outline-offset: 4px; border-radius: var(--r-l); }
.search-top kbd { font: 600 11px var(--f-mono); color: var(--ink-3); border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 5px; }
dialog.cmdk { width: min(640px, 92vw); margin: 12vh auto auto; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-3); }
dialog.cmdk::backdrop { background: rgba(8, 20, 20, .35); }
dialog.cmdk .f-search { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 12px; border-radius: var(--r); border: 1px solid var(--line-2); color: var(--ink-3); }
dialog.cmdk input { border: 0; outline: 0; background: transparent; flex: 1; font-size: 16px; color: var(--ink); }
dialog.cmdk [data-results] { max-height: 52vh; overflow-y: auto; margin: 8px 0; }
dialog.cmdk .row { border-radius: var(--r-s); padding: 9px 12px; }
dialog.cmdk .row.sel { background: var(--accent-soft); }
/* Desk top bar: the page's own heading carries the title; the bar keeps the way back, search and the bell. */
@media (min-width: 760px) {
  .topbar .t-title.only-desk { visibility: hidden; }
  .topbar .back + .t-title b { display: none; }
  .topbar .back + .t-title small { font-size: var(--t-m); color: var(--ink-2); font-weight: 600; }
}
.fab[hidden] { display: none; }
/* Mira's state card: readable in both themes, set apart from a dark page. */
.mira-state b { color: var(--brand-ink); }
.mira-state span { color: color-mix(in srgb, var(--brand-ink) 78%, transparent); }
:root[data-theme="dark"] .mira-state { border: 1px solid var(--line-2); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mira-state { border: 1px solid var(--line-2); } }
/* Phone page header: title, then its line, then its action, so the action reads as the next step. */
@media (max-width: 759.98px) {
  .ph .ph-row { display: contents; }
  .ph > p { order: 2; }
  .ph .ph-row > .row-x { order: 3; }
  .ph .ph-row > .row-x .btn { height: 40px; }
}
/* A list row's title may take two lines on a phone rather than cut a word in half. */
@media (max-width: 759.98px) {
  .row .r-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; }
  .row .r-meta { max-width: 38%; }
}
/* Login on a phone: a compact hero, the form right under it. */
@media (max-width: 899.98px) { .login { grid-template-rows: auto 1fr; align-content: start; } .login .l-hero { padding-top: 32px; } }
/* Review: the rail keeps every link in view on a 900 px desk; Mira's state there is two lines at most. */
@media (min-width: 1100px) {
  .rail a.r-link { padding: 8px 12px; }
  .rail .r-status { padding: 10px 12px; }
  .rail .r-status > span > :not(b) { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
}
.stack > .btn, form.stack > button.btn { justify-self: start; }
.chipset label > span { display: inline-flex; align-items: center; gap: 6px; }
.chipset label:has(input:checked) { background: var(--ink); color: var(--ink-inv); border-color: var(--ink); }
.chipset label:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
/* A public page shows the company's name and initial, never the group's picture (internal art). */
.pub-mark { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: #fff; font-weight: 750; flex: none; }
/* A one-line message box keeps its hint on one line (an ellipsis, not a half-cut second line). */
.ask textarea::placeholder, .composer textarea::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
