/* Shulman CRM — one design language. Tokens first; components use only tokens.
   Direction: a finance office's case file. Cool sage-grey paper, ink-green as the single accent,
   brass only for money, a serif (Frank Ruhl Libre) for people's names and page titles, IBM Plex Sans Hebrew for everything else.
   Surfaces are separated by hairlines, not shadows; only floating layers (dialogs, toasts) cast a shadow. */
:root {
  --bg: #eef1ef; --surface: #ffffff; --surface-2: #f5f7f6; --ink: #142321; --ink-2: #33433f; --muted: #62706c;
  --line: #dce3e0; --line-2: #c6d0cc;
  --accent: #14423d; --accent-ink: #ffffff; --accent-soft: #e2edea; --accent-line: #a9c6bf;
  --brass: #7d5a17;
  --ok: #1d7a46; --ok-soft: #e4f3ea; --warn: #8f5400; --warn-soft: #fbefd6; --bad: #b42318; --bad-soft: #fbe9e7;
  --info: #3b4a8c; --info-soft: #e9ecf8;
  --r: 10px; --r-sm: 8px; --shadow: none;
  --shadow-lg: 0 16px 48px rgba(20,35,33,.22);
  --font: "IBM Plex Sans Hebrew", "Segoe UI", "Arial Hebrew", Arial, sans-serif;
  --serif: "Frank Ruhl Libre", "Times New Roman", serif;
  --t: 140ms cubic-bezier(.2,.7,.3,1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1216; --surface: #171b21; --surface-2: #1c2129; --ink: #eef0f3; --ink-2: #c9ced8; --muted: #9098a8;
    --line: #272d36; --line-2: #343b46; --brass: #d9b36a; --accent: #4fb3a5; --accent-ink: #08201d; --accent-soft: #15302d; --accent-line: #24524b;
    --ok: #5cc98b; --ok-soft: #13291d; --warn: #f0b44c; --warn-soft: #2d2412; --bad: #f2776b; --bad-soft: #321816;
    --info: #9fb0f5; --info-soft: #1b2140; --shadow: 0 1px 2px rgba(0,0,0,.3); --shadow-lg: 0 12px 40px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 15px; height: 15px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; padding: 20px 14px;
  border-inline-end: 1px solid var(--line); background: var(--surface); }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 20px; font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.brand .mark { width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-weight: 700; }
.brand small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--ink-2); font-weight: 500; transition: background var(--t); }
.nav a:hover { background: var(--surface-2); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.nav .count { margin-inline-start: auto; background: var(--accent); color: var(--accent-ink); font-size: 12px; border-radius: 99px; padding: 0 7px; min-width: 20px; text-align: center; }
.side .foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; }
.me { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 600;
  background: var(--accent-soft); color: var(--accent); flex: none; }
.avatar.agent { background: var(--info-soft); color: var(--info); }
.main { min-width: 0; padding: 28px 36px 64px; max-width: 1180px; width: 100%; }
.demo-bar { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--warn); background: var(--warn-soft);
  border-radius: 10px; padding: 7px 12px; margin-bottom: 18px; }
.demo-bar a { color: inherit; text-decoration: underline; margin-inline-start: auto; }
.tabbar { display: none; }

/* ---------- type & layout ---------- */
h1 { font-size: 26px; line-height: 1.25; margin: 0; letter-spacing: -.02em; font-weight: 700; }
h2 { font-size: 16px; margin: 0; font-weight: 600; }
h3 { font-size: 14px; margin: 0; font-weight: 600; color: var(--ink-2); }
.muted { color: var(--muted); } .small { font-size: 13px; } .num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.head .sub { color: var(--muted); margin-top: 4px; }
.head .actions { margin-inline-start: auto; display: flex; gap: 8px; align-items: center; }
.grid { display: grid; gap: 16px; }
.cols-3 { grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); align-items: start; }
.cols-2 { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.row { display: flex; align-items: center; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.spacer { flex: 1; }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card > .card-h { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card > .card-h .count { color: var(--muted); font-weight: 500; font-size: 13px; }
.card > .card-b { padding: 6px 0; }
.card > .card-b:has(> .item:first-child) { padding-top: 0; }
.card > .card-b > .item:first-child { border-top: 0; }
.card.pad { padding: 18px; }
.item { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--line); min-height: 58px; }
.item:last-child { border-bottom: 0; }
.item .body { min-width: 0; flex: 1; }
.item .title { font-weight: 600; display: flex; gap: 8px; align-items: center; }
.item .line { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.item { color: inherit; transition: background var(--t); } a.item:hover { background: var(--surface-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); flex: none; }
.dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); } .dot.ok { background: var(--ok); } .dot.accent { background: var(--accent); }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background var(--t), border-color var(--t), transform var(--t); }
.btn:hover { background: var(--surface-2); border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn.danger { color: var(--bad); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.busy { pointer-events: none; opacity: .7; }
.btn.busy::after { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.field .hint { font-size: 12px; color: var(--muted); }
.input, select.input, textarea.input { height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); width: 100%;
  transition: border-color var(--t), box-shadow var(--t); }
textarea.input { height: auto; min-height: 76px; padding: 9px 12px; resize: vertical; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input[aria-invalid="true"] { border-color: var(--bad); }
.search { position: relative; flex: 1; min-width: 220px; max-width: 460px; }
.search .input { height: 42px; padding-inline-start: 40px; font-size: 15px; }
.search svg { position: absolute; inset-inline-start: 13px; top: 12px; color: var(--muted); }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: none; padding: 5px 12px; border-radius: 7px; cursor: pointer; color: var(--muted); font-weight: 500; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line-2);
  background: var(--surface); cursor: pointer; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }

/* ---------- status pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 99px; font-size: 12px; font-weight: 600;
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.pill.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.pill.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.steps { display: inline-flex; gap: 3px; align-items: center; font-size: 12px; color: var(--muted); }
.steps span { padding: 1px 8px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); }
.steps span.on { background: var(--accent-soft); color: var(--accent); border-color: transparent; font-weight: 600; }

/* ---------- client card ---------- */
.client-head { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.client-head .avatar { width: 52px; height: 52px; font-size: 19px; }
.client-head .meta { display: flex; gap: 12px; color: var(--muted); font-size: 14px; flex-wrap: wrap; margin-top: 3px; }
.handler { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--r); margin-bottom: 16px; border: 1px solid var(--line); background: var(--surface); }
.handler.agent { background: var(--info-soft); border-color: transparent; color: var(--info); }
.handler.human { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.handler .btn { margin-inline-start: auto; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: flex; gap: 6px; align-items: center; }
.tabs a[aria-current="page"] { color: var(--ink); border-color: var(--accent); }
.tabs .n { font-size: 11px; background: var(--warn-soft); color: var(--warn); border-radius: 99px; padding: 0 6px; font-weight: 600; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 10px 14px; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; } .kv dd.num { text-align: right; }
.next { border-inline-start: 3px solid var(--accent); padding: 12px 16px; background: var(--surface); border-radius: 0 var(--r) var(--r) 0; }

/* conversation */
.thread { display: flex; flex-direction: column; gap: 8px; padding: 18px; max-height: 62vh; overflow-y: auto; background: var(--surface-2); }
.bubble { max-width: 78%; padding: 9px 13px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); align-self: flex-start; white-space: pre-wrap; word-break: break-word; }
.bubble.out { align-self: flex-end; background: var(--accent-soft); border-color: transparent; }
.bubble.agent { background: var(--info-soft); }
.bubble.note { align-self: center; background: var(--warn-soft); border-color: transparent; font-size: 14px; max-width: 90%; }
.bubble.call { align-self: center; background: transparent; border-style: dashed; font-size: 13px; color: var(--ink-2); }
.bubble.cancelled { opacity: .55; text-decoration: line-through; }
.bubble .meta { display: flex; gap: 6px; align-items: center; font-size: 11.5px; color: var(--muted); margin-top: 3px; justify-content: flex-end; }
.day { align-self: center; font-size: 12px; color: var(--muted); padding: 4px 0; }
.composer { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); align-items: flex-end; }
.composer textarea { min-height: 42px; max-height: 160px; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: 10px; font-size: 14px; background: var(--warn-soft); color: var(--warn); }
.notice.bad { background: var(--bad-soft); color: var(--bad); }
.notice.info { background: var(--info-soft); color: var(--info); }
.notice.ok { background: var(--ok-soft); color: var(--ok); }

/* documents */
.drop { border: 1.5px dashed var(--line-2); border-radius: var(--r); padding: 22px; text-align: center; color: var(--muted); cursor: pointer; transition: border-color var(--t), background var(--t); background: var(--surface); }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.drop strong { color: var(--ink); }
.checklist li { display: flex; gap: 8px; align-items: center; padding: 6px 0; }
.checklist { list-style: none; margin: 0; padding: 0; }
.viewer { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 0; height: min(78vh, 760px); }
.viewer .src { background: var(--surface-2); border-inline-end: 1px solid var(--line); display: grid; place-items: center; overflow: auto; }
.viewer .src img { width: 100%; height: 100%; object-fit: contain; padding: 12px; }
.viewer .src iframe { width: 100%; height: 100%; border: 0; }
.viewer .facts { overflow: auto; padding: 18px; }
.fact { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; }
.fact .q { font-size: 12.5px; color: var(--muted); margin-top: 4px; border-inline-start: 2px solid var(--accent-line); padding-inline-start: 8px; }
.fact.unclear { border-color: var(--warn); background: var(--warn-soft); }

/* contracts */
.editor { display: grid; grid-template-columns: 340px 1fr; gap: 0; height: min(80vh, 820px); }
.editor .form { padding: 18px; overflow: auto; border-inline-end: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.editor iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.calc { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; font-size: 13px; }

/* table */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: start; font-weight: 500; color: var(--muted); font-size: 12.5px; padding: 8px 18px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px 18px; border-bottom: 1px solid var(--line); }
.table tr:last-child td { border-bottom: 0; }
.meter { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--line); }
.meter > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .4s ease; }
.meter.alert > i { background: var(--warn); } .meter.over > i { background: var(--bad); }

/* states */
.empty { text-align: center; padding: 34px 18px; color: var(--muted); }
.empty svg { width: 30px; height: 30px; color: var(--accent); margin-bottom: 6px; }
.empty strong { display: block; color: var(--ink); font-weight: 600; margin-bottom: 2px; }
.skel { background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: sh 1.2s infinite; border-radius: 8px; height: 14px; }
@keyframes sh { to { background-position: -200% 0; } }
.skel-item { padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; border-bottom: 1px solid var(--line); }
.error-box { text-align: center; padding: 40px 18px; }

/* toast + modal */
#toasts { position: fixed; bottom: 22px; inset-inline-start: 50%; transform: translateX(50%); display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.toast { display: flex; align-items: center; gap: 10px; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; box-shadow: var(--shadow-lg);
  font-weight: 500; animation: up .18s ease-out; max-width: min(92vw, 520px); }
.toast.bad { background: var(--bad); color: #fff; } .toast.ok svg { color: #7fe0a6; }
@keyframes up { from { opacity: 0; transform: translateY(8px); } }
dialog { border: 0; padding: 0; border-radius: 16px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); }
dialog.wide { width: min(1120px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(15,18,22,.45); backdrop-filter: blur(2px); }
dialog[open] { animation: pop .16s ease-out; }
@keyframes pop { from { opacity: 0; transform: scale(.98); } }
.m-h { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.m-b { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.m-f { display: flex; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); justify-content: flex-start; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login .card { width: min(380px, 100%); padding: 30px; display: flex; flex-direction: column; gap: 14px; }
details > summary { cursor: pointer; color: var(--muted); font-size: 13px; padding: 8px 0; list-style: none; }
details > summary::before { content: "▸ "; } details[open] > summary::before { content: "▾ "; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- phone ---------- */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .main { padding: 16px 16px 92px; }
  .tabbar { display: flex; position: fixed; bottom: 0; inset-inline: 0; background: var(--surface); border-top: 1px solid var(--line); z-index: 20;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11.5px; color: var(--muted); padding: 4px 14px; border-radius: 10px; }
  .tabbar a[aria-current="page"] { color: var(--accent); }
  .cols-3, .cols-2 { grid-template-columns: 1fr; }
  h1 { font-size: 22px; }
  .head .actions { margin-inline-start: 0; width: 100%; }
  .search { max-width: none; }
  .viewer, .editor { grid-template-columns: 1fr; height: auto; }
  .viewer .src { height: 50vh; border: 0; border-bottom: 1px solid var(--line); }
  .editor iframe { height: 60vh; }
  .editor .form { border: 0; }
  .bubble { max-width: 90%; }
  .item { padding: 11px 14px; }
  .kv { grid-template-columns: 90px 1fr; }
  .hide-sm { display: none !important; }
  dialog { width: 100vw; max-height: 100dvh; border-radius: 16px 16px 0 0; margin: auto 0 0; }
}

.editor .form > .pill { align-self: flex-start; }

/* ---------- type: serif for names and page titles ---------- */
h1, .client-head h1, .brand > div, .login .brand > div, .conv .title, .thread-h .title { font-family: var(--serif); letter-spacing: 0; }
h1 { font-weight: 700; font-size: 28px; }
.money { color: var(--brass); font-variant-numeric: tabular-nums; }
.card > .card-h { border-bottom-color: var(--line); }
.card > .card-h h2 { font-size: 15px; }

/* ---------- WhatsApp inbox ---------- */
.inbox { display: grid; grid-template-columns: 340px minmax(0, 1fr); height: calc(100vh - 110px); min-height: 520px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.inbox-list { border-inline-end: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.inbox-tools { padding: 12px; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--line); }
.inbox-tools .search { max-width: none; min-width: 0; }
.inbox-tools .seg { display: flex; } .inbox-tools .seg button { flex: 1; padding-inline: 6px; }
.inbox-items { overflow-y: auto; flex: 1; }
.conv { display: flex; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); color: inherit; align-items: center; }
.conv:hover { background: var(--surface-2); }
.conv.on { background: var(--accent-soft); box-shadow: inset -3px 0 0 var(--accent); }
.conv .body { min-width: 0; flex: 1; }
.conv .title { font-weight: 700; font-size: 15.5px; }
.conv .line { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-thread { display: flex; flex-direction: column; min-height: 0; overflow-y: auto; }
.thread-h { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.thread-h .title { font-weight: 700; font-size: 17px; }
.inbox-thread .handler { margin: 12px 16px 0; }
.inbox-thread #tconv { flex: 1; display: flex; flex-direction: column; min-height: 0; margin-top: 12px; }
.inbox-thread #tconv > .card { border: 0; border-top: 1px solid var(--line); border-radius: 0; flex: 1; display: flex; flex-direction: column; }
.inbox-thread .thread { max-height: none; flex: 1; min-height: 280px; }
.inbox-empty { margin: auto; }
.back-sm { display: none; }
@media (max-width: 860px) {
  .inbox { grid-template-columns: 1fr; height: auto; min-height: 0; border: 0; background: transparent; overflow: visible; }
  .inbox-list { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
  .inbox.has-open .inbox-list, .inbox:not(.has-open) .inbox-thread { display: none; }
  .inbox-thread { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
  .back-sm { display: inline-flex; }
}

.seg button { white-space: nowrap; }
.composer .seg { flex: none; }

/* ---------- guideline fixes ---------- */
.skip { position: absolute; inset-inline-start: 12px; top: -48px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 8px; }
.skip:focus { top: 12px; }
html { -webkit-tap-highlight-color: transparent; }
button, a, .chip, .btn { touch-action: manipulation; }
h1, h2 { text-wrap: balance; }
dialog, .inbox-items, .thread, .viewer .facts, .editor .form { overscroll-behavior: contain; }
select.input { background-color: var(--surface); color: var(--ink); }
.conv, .item { content-visibility: auto; contain-intrinsic-size: auto 64px; }
.main:focus { outline: none; }

/* ---------- golden window: the one place brass gets the stage ---------- */
.gold { border: 1px solid color-mix(in srgb, var(--brass) 35%, var(--line)); border-radius: var(--r); background: var(--surface); margin-bottom: 18px; overflow: hidden; }
.gold-h { display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; background: color-mix(in srgb, var(--brass) 9%, var(--surface)); border-bottom: 1px solid var(--line); color: var(--ink-2); }
.gold-h > svg { color: var(--brass); margin-top: 3px; }
.gold-h h2 { font-family: var(--serif); font-size: 18px; color: var(--ink); }
.gold-item { display: flex; gap: 14px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.gold-item:last-child { border-bottom: 0; }
.gold-item .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.gold-item .title { font-family: var(--serif); font-weight: 700; font-size: 16px; color: var(--ink); }
.gold-clock { display: inline-flex; gap: 5px; align-items: center; font-size: 13px; color: var(--brass); font-variant-numeric: tabular-nums; white-space: nowrap; }
.gold-clock.urgent { color: var(--bad); font-weight: 600; }
@media (max-width: 860px) { .gold-item { flex-wrap: wrap; } .gold-item .btn { width: 100%; } }

.pkg-list li { align-items: flex-start; } .pkg-list li svg { margin-top: 3px; color: var(--muted); }

/* =====================================================================
   "Golden ledger" (29.10, built with impeccable + ui-ux-pro-max).
   Navy ink on cool white for trust (ui-ux-pro-max: banking / CRM rows),
   gold owns exactly one role: WhatsApp's free 24h window. Frank Ruhl Libre
   for names, titles and the window's numerals; Noto Sans Hebrew for the rest.
   No hero-metric strip, no identical card grid, no dark chrome (impeccable).
   ===================================================================== */
:root {
  --bg: oklch(97.6% .006 250); --surface: #fff; --surface-2: oklch(96.4% .008 250);
  --ink: oklch(24% .035 258); --ink-2: oklch(36% .03 258); --muted: oklch(48% .022 258);
  --line: oklch(91.5% .01 250); --line-2: oklch(85% .014 250);
  --accent: oklch(40% .12 258); --accent-ink: #fff; --accent-soft: oklch(95.5% .025 258); --accent-line: oklch(84% .05 258);
  --gold: oklch(68% .135 78); --gold-track: oklch(93% .04 85); --gold-ink: oklch(43% .095 70);
  --gold-wash: oklch(97.6% .028 88); --gold-cta: oklch(52% .12 68);
  --brass: var(--gold-ink);
  --ok: oklch(46% .11 155); --ok-soft: oklch(95.5% .03 155); --warn: oklch(47% .1 65); --warn-soft: oklch(96% .04 85);
  --bad: oklch(50% .17 27); --bad-soft: oklch(96% .025 27); --info: oklch(45% .13 290); --info-soft: oklch(95.5% .03 290);
  --r: 16px; --r-sm: 10px; --shadow: none; --shadow-lg: 0 18px 48px -12px oklch(24% .035 258 / .28);
  --font: "Noto Sans Hebrew", "Segoe UI", Arial, sans-serif; --serif: "Frank Ruhl Libre", "Noto Sans Hebrew", serif;
  --ease: cubic-bezier(.16, 1, .3, 1); --t: 150ms var(--ease);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: oklch(20% .015 258); --surface: oklch(24.5% .018 258); --surface-2: oklch(27.5% .02 258);
  --ink: oklch(95% .008 250); --ink-2: oklch(85% .012 250); --muted: oklch(74% .02 250);
  --line: oklch(33% .02 258); --line-2: oklch(40% .022 258);
  --accent: oklch(78% .1 258); --accent-ink: oklch(20% .03 258); --accent-soft: oklch(31% .045 258); --accent-line: oklch(45% .07 258);
  --gold-track: oklch(36% .045 80); --gold-ink: oklch(84% .11 85); --gold-wash: oklch(27% .03 80); --gold-cta: oklch(78% .13 80);
  --ok: oklch(80% .12 155); --ok-soft: oklch(30% .04 155); --warn: oklch(83% .11 80); --warn-soft: oklch(30% .04 80);
  --bad: oklch(77% .13 27); --bad-soft: oklch(31% .05 27); --info: oklch(80% .1 290); --info-soft: oklch(31% .05 290);
  --shadow-lg: 0 18px 48px -12px #000a; color-scheme: dark;
} }
html, body { font-size: 16px; line-height: 1.55; font-variant-numeric: tabular-nums; }
::selection { background: var(--gold-track); color: var(--ink); }
html { caret-color: var(--accent); scrollbar-color: var(--line-2) transparent; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
h1 { font: 700 32px/1.2 var(--serif); letter-spacing: -.01em; }
h2 { font-size: 17px; font-weight: 700; }
.head { margin-bottom: 28px; }
.head .sub { font-size: 15px; color: var(--muted); margin-top: 6px; }

/* shell: a quiet light rail; the page is the stage */
.side { background: var(--surface); border-inline-end: 1px solid var(--line); padding: 22px 14px; }
.brand { font: 700 21px var(--serif); color: var(--ink); }
.brand small { font: 500 12px var(--font); }
.brand .mark { width: 40px; height: 40px; border-radius: 12px; background: var(--ink); color: var(--gold); font: 900 22px var(--serif); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { min-height: 44px; padding: 10px 14px; border-radius: 12px; color: var(--ink-2); font-size: 15px; }
.nav a svg.i { width: 20px; height: 20px; color: var(--muted); }
.nav a:hover { background: var(--surface-2); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.nav a[aria-current="page"] svg.i { color: var(--accent); }
.nav .count { background: var(--ink); color: var(--surface); font-weight: 700; }
.side .me { background: var(--surface-2); border-radius: 14px; }
.main { padding-top: 32px; max-width: 1240px; min-width: 0; overflow-x: clip; }

/* surfaces: hairlines, no shadows, one radius per role */
.card { border-radius: var(--r); box-shadow: none; }
.card > .card-h { padding: 16px 18px 10px; border-bottom: 0; }
.card > .card-h > svg.i:first-child { color: var(--muted); }
.card > .card-h h2 { font-size: 17px; }
.card > .card-h .count { color: var(--muted); font-weight: 500; font-size: 14px; background: none; border: 0; padding: 0; }
.item { min-height: 64px; padding: 12px 18px; border-bottom: 1px solid var(--line); transition: background var(--t); }
.item:first-child { border-top: 1px solid var(--line); }
.item .title { font-size: 15.5px; font-weight: 700; }
.item .line { font-size: 14px; }
a.item:active, .conv:active { background: var(--accent-soft); }
.avatar { width: 40px; height: 40px; font-weight: 700; font-size: 14px; background: var(--accent-soft); color: var(--accent); }
.avatar.agent { background: var(--info-soft); color: var(--info); }
.avatar[data-c="0"] { background: oklch(95% .03 258); color: oklch(42% .12 258); }
.avatar[data-c="1"] { background: oklch(95% .03 300); color: oklch(44% .12 300); }
.avatar[data-c="2"] { background: oklch(95.5% .035 75); color: oklch(45% .09 65); }
.avatar[data-c="3"] { background: oklch(95.5% .025 20); color: oklch(47% .13 20); }
.avatar[data-c="4"] { background: oklch(95.5% .03 160); color: oklch(42% .09 160); }
.avatar[data-c="5"] { background: oklch(95.5% .02 220); color: oklch(42% .08 220); }

/* controls: 44px targets, pressed feedback, no gradients */
.btn { height: 44px; padding: 0 16px; border-radius: 12px; font-weight: 600; }
.btn.sm { height: 36px; padding: 0 12px; border-radius: 10px; font-size: 14px; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: none; background: color-mix(in oklch, var(--accent) 88%, var(--ink)); }
.input, select.input { height: 44px; border-radius: 12px; }
.search .input { height: 48px; border-radius: 14px; }
.pill { height: 26px; padding: 0 10px; font-weight: 600; font-size: 13px; }
.chip { height: 36px; }
.tabs a { min-height: 44px; }
.next { border-inline-start: 0; border: 1px solid var(--accent-line); border-radius: var(--r); background: var(--accent-soft); }

/* Today: a status sentence instead of a KPI strip; two reading columns, not three equal cards */
.today { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.today > .stack { gap: 28px; }
.sec-h { display: flex; align-items: baseline; gap: 8px; margin: 0 0 10px; }
.sec-h h2 { font-size: 19px; }
.sec-h .count { color: var(--muted); font-size: 15px; font-weight: 500; }
.sec-h .spacer { flex: 1; }
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.list > .item:first-child { border-top: 0; }
.list > .item:last-child { border-bottom: 0; }
.list .sub-h { padding: 12px 18px 6px; font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: center; border-top: 1px solid var(--line); }

/* golden window: the one gold moment */
.gold { background: var(--gold-wash); border: 1px solid var(--gold-track); border-radius: 24px; color: var(--ink); box-shadow: none; overflow: visible; margin: 0; }
.gold-h { background: none; border: 0; padding: 18px 20px 0; color: var(--gold-ink); align-items: center; gap: 8px; font-weight: 600; font-size: 14.5px; }
.gold-h > svg { width: 20px; height: 20px; padding: 0; background: none; color: var(--gold-ink); box-shadow: none; margin: 0; }
.gold-h h2 { font: inherit; color: inherit; }
.gold-hero { display: flex; align-items: center; gap: 20px; padding: 16px 20px 18px; }
.ring { width: 144px; height: 144px; flex: none; position: relative; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .ticks { stroke: var(--gold-ink); stroke-dasharray: 1.5 13.16; opacity: .5; }
.ring .track { stroke: var(--gold-track); }
.ring .arc { stroke: var(--gold); stroke-linecap: round; }
.ring.urgent .arc { stroke: var(--bad); }
.ring .t { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring b { font: 900 54px/.9 var(--serif); letter-spacing: -.02em; color: var(--ink); }
.ring small { font-size: 13px; font-weight: 600; color: var(--gold-ink); margin-top: 4px; }
.gold-who { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.gold-who .title { font: 700 28px/1.15 var(--serif); color: var(--ink); }
.gold-who .chips .pill { background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); height: 30px; }
.gold .btn.gold-go { background: var(--gold-cta); border-color: var(--gold-cta); color: #fff; height: 52px; border-radius: 16px; font-size: 16px; }
.gold .btn.gold-go:hover { background: color-mix(in oklch, var(--gold-cta) 88%, var(--ink)); }
.gold-cta { padding: 0 20px 18px; }
.gold-cta .btn { width: 100%; }
.gold-item { display: flex; align-items: center; gap: 12px; padding: 10px 20px; min-height: 60px; border: 0; border-top: 1px solid var(--gold-track); }
.gold-item .body { flex: 1; min-width: 0; gap: 2px; }
.gold-item .title { font: 700 16px var(--serif); color: var(--ink); }
.gold-item .line { font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini { width: 38px; height: 38px; flex: none; transform: rotate(-90deg); }
.mini .track { stroke: var(--gold-track); } .mini .arc { stroke: var(--gold); stroke-linecap: round; } .mini.urgent .arc { stroke: var(--bad); }
.gold-clock { background: none; border: 0; padding: 0; color: var(--gold-ink); font-weight: 600; font-size: 14px; }
.gold-clock.urgent { color: var(--bad); background: none; }
.gold-more { color: var(--gold-ink); border-top: 1px solid var(--gold-track); min-height: 48px; border-radius: 0 0 24px 24px; }
.gold-more:hover { background: color-mix(in oklch, var(--gold-track) 40%, transparent); }
.gold-more svg { transform: rotate(90deg); }
.gold-item[hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .ring .arc { animation: ringDraw 900ms var(--ease) both; }
  .ring b { animation: ringRise 600ms 250ms var(--ease) both; }
  @keyframes ringDraw { from { stroke-dashoffset: 327; } }
  @keyframes ringRise { from { opacity: .25; } }
}

/* inbox + thread inherit the ledger */
.conv { min-height: 68px; }
.conv.on { background: var(--accent-soft); box-shadow: inset -3px 0 0 var(--accent); }
.bubble { border-radius: 16px; }
.bubble.out { background: var(--accent-soft); }

@media (max-width: 860px) {
  .today { grid-template-columns: 1fr; gap: 24px; }
  h1 { font-size: 25px; }
  .main { padding: 18px 16px calc(96px + env(safe-area-inset-bottom)); }
  .tabbar { background: var(--surface); border-top: 1px solid var(--line); }
  .tabbar a { min-height: 52px; justify-content: center; color: var(--muted); font-size: 12px; }
  .tabbar a[aria-current="page"] { color: var(--accent); font-weight: 700; }
  .ring { width: 120px; height: 120px; } .ring b { font-size: 46px; }
  .gold-hero { gap: 16px; padding: 14px 16px 16px; }
  .gold-who .title { font-size: 24px; }
  .gold-cta, .gold-h { padding-inline: 16px; }
  .gold-item { padding-inline: 16px; }
}
.grid > *, .stack > * { min-width: 0; }
@media (max-width: 1180px) { .today { grid-template-columns: minmax(0, 1fr); } }

/* 29.10 owner feedback: no yellow. The window sits on white; gold is a muted brass line in the ring only,
   the action is navy like every other primary action. */
:root { --gold: oklch(63% .085 72); --gold-track: oklch(93% .012 250); --gold-ink: oklch(45% .06 70); --gold-wash: var(--surface); --gold-cta: var(--accent);
  --warn-soft: oklch(96% .012 250); --warn: oklch(42% .03 258); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --gold: oklch(76% .08 78); --gold-track: oklch(34% .02 258); --gold-ink: oklch(80% .06 80); --warn: oklch(85% .02 250); --warn-soft: oklch(29% .02 258); } }
.gold { border: 1px solid var(--line); }
.gold .btn.gold-go { color: var(--accent-ink); }
.demo-bar { border: 1px solid var(--line); }
.gold { overflow: hidden; min-width: 0; }
.gold-hero > *, .gold-item > .body { min-width: 0; }
@media (max-width: 860px) { .inbox { grid-template-columns: minmax(0, 1fr); } .inbox-list, .inbox-tools, .inbox-tools .seg { min-width: 0; } .inbox-tools .seg { overflow-x: auto; scrollbar-width: none; }
  .today { grid-template-columns: minmax(0, 1fr); } .gold-item { flex-wrap: nowrap; } .gold-item .btn { width: auto; } .gold-item .gold-clock { display: none; } }

/* =====================================================================
   "Fresh" (29.10, owner: modern, clean, fun). One rounded family (Rubik),
   an electric-blue action colour, pastel status chips, pill buttons, big radii.
   The free-window ring stays the signature, now in the brand blue.
   ===================================================================== */
:root {
  --font: "Rubik", "Segoe UI", Arial, sans-serif; --serif: var(--font);
  --bg: oklch(97.8% .009 265); --surface: #fff; --surface-2: oklch(96.6% .012 265);
  --ink: oklch(23% .04 268); --ink-2: oklch(35% .035 268); --muted: oklch(50% .03 268);
  --line: oklch(92.5% .014 265); --line-2: oklch(87% .02 265);
  --accent: oklch(55% .21 264); --accent-ink: #fff; --accent-soft: oklch(95.5% .035 264); --accent-line: oklch(85% .07 264);
  --gold: var(--accent); --gold-track: oklch(92% .04 264); --gold-ink: var(--accent); --gold-wash: oklch(97% .022 255); --gold-cta: var(--accent);
  --ok: oklch(50% .13 160); --ok-soft: oklch(95.5% .045 160); --warn: oklch(52% .13 60); --warn-soft: oklch(96% .045 75);
  --bad: oklch(57% .19 22); --bad-soft: oklch(95.5% .035 22); --info: oklch(52% .17 300); --info-soft: oklch(95.5% .035 300);
  --r: 22px; --r-sm: 14px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: oklch(19% .02 268); --surface: oklch(23.5% .025 268); --surface-2: oklch(27% .028 268);
  --ink: oklch(96% .008 265); --ink-2: oklch(86% .015 265); --muted: oklch(74% .025 265);
  --line: oklch(32% .03 268); --line-2: oklch(40% .035 268);
  --accent: oklch(72% .15 264); --accent-ink: oklch(18% .03 268); --accent-soft: oklch(31% .06 264); --accent-line: oklch(46% .1 264);
  --gold-track: oklch(34% .05 264); --gold-wash: oklch(26% .04 260);
  --ok: oklch(80% .13 160); --ok-soft: oklch(30% .05 160); --warn: oklch(82% .12 70); --warn-soft: oklch(31% .05 70);
  --bad: oklch(76% .14 22); --bad-soft: oklch(31% .06 22); --info: oklch(80% .11 300); --info-soft: oklch(31% .06 300);
} }
body, button, input, select, textarea { font-family: var(--font); }
h1 { font: 800 30px/1.2 var(--font); letter-spacing: -.02em; }
h2, .sec-h h2 { font-weight: 700; letter-spacing: -.01em; }
.brand { font: 800 21px var(--font); }
.brand .mark { background: var(--accent); color: #fff; border-radius: 14px; font: 800 21px var(--font); }
.nav a { border-radius: 999px; }
.nav a[aria-current="page"] { background: var(--accent); color: #fff; }
.nav a[aria-current="page"] svg.i { color: #fff; }
.nav .count { background: var(--bad); color: #fff; }
.nav a[aria-current="page"] .count { background: #fff; color: var(--accent); }

.btn { border-radius: 999px; font-weight: 600; }
.btn.primary { box-shadow: 0 6px 16px -8px oklch(55% .21 264 / .55); }
.btn.primary:active { box-shadow: none; }
.seg { border-radius: 999px; } .seg button { border-radius: 999px; }
.seg button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.input, select.input, .search .input { border-radius: 16px; }
.pill { border-radius: 999px; border: 0; }
.chip { border-radius: 999px; }
.card, .list { border-radius: var(--r); }
.avatar { border-radius: 14px; }
.client-head .avatar { border-radius: 18px; }

/* section headings get a small coloured badge, so the page reads at a glance */
.sec-h h2::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 4px; margin-inline-end: 8px; background: var(--accent); vertical-align: 1px; }
.today > .stack:first-child > section:not(.gold) .sec-h h2::before { background: oklch(70% .17 30); }
.today > .stack:last-child > section:first-child .sec-h h2::before { background: oklch(72% .15 160); }
.today > .stack:last-child > section:last-child .sec-h h2::before { background: oklch(65% .17 300); }

/* the free window: a fresh sky card, blue ring, one big pill action */
.gold { background: var(--gold-wash); border: 0; border-radius: 28px; }
.gold-h { color: var(--accent); }
.gold-h > svg { color: var(--accent); }
.ring .ticks { stroke: var(--accent); opacity: .35; }
.ring b { font: 800 56px/.9 var(--font); color: var(--ink); }
.ring small { color: var(--accent); }
.gold-who .title { font: 800 26px/1.15 var(--font); }
.gold-who .chips .pill { background: var(--surface); color: var(--ink-2); border: 0; box-shadow: 0 1px 0 var(--line); }
.gold .btn.gold-go { border-radius: 999px; height: 54px; }
.gold-item { border-top: 1px solid var(--gold-track); }
.gold-item .title { font: 700 16px var(--font); }
.gold-item .btn { background: var(--surface); border-color: var(--accent-line); color: var(--accent); }
.gold-more { color: var(--accent); border-top: 1px solid var(--gold-track); border-radius: 0 0 28px 28px; }
.ring.urgent .arc, .mini.urgent .arc { stroke: var(--bad); }

.tabbar a[aria-current="page"] { color: var(--accent); }
.tabbar a[aria-current="page"] svg.i { background: var(--accent-soft); border-radius: 999px; padding: 3px 14px; width: 50px; height: 28px; }
.demo-bar { background: var(--surface); border: 1px solid var(--line); color: var(--muted); border-radius: 999px; }
.handler.human { background: var(--accent-soft); color: var(--accent); }
.next { background: var(--accent-soft); border: 0; }
.bubble { border-radius: 20px; }
.bubble.out { background: var(--accent); color: #fff; border: 0; }
.bubble.out .meta { color: oklch(92% .03 264); }
.money { color: var(--ink); font-weight: 700; }
@media (max-width: 860px) { h1 { font-size: 25px; } }

/* =====================================================================
   "Gallery" (29.10, chosen by the owner on the skills' recommendation).
   A white cube: ink on white, hairlines, sharp corners, Heebo from 300 to 900.
   One committed ultramarine field, and only where it does a job: the free
   WhatsApp window. Primary actions share that blue; everything else is quiet.
   ===================================================================== */
:root {
  --font: "Heebo", "Segoe UI", Arial, sans-serif; --serif: var(--font);
  --bg: #fafafa; --surface: #fff; --surface-2: #f3f3f4;
  --ink: #111; --ink-2: #2b2b2e; --muted: #6b6b72;
  --line: #e4e4e7; --line-2: #111;
  --accent: #1f2fd6; --accent-ink: #fff; --accent-soft: #eef0ff; --accent-line: #b9c0f5;
  --gold: #fff; --gold-track: rgb(255 255 255 / .22); --gold-ink: #fff; --gold-wash: #1f2fd6; --gold-cta: #fff;
  --ok: #0e7a4b; --ok-soft: #e8f5ee; --warn: #8a5a00; --warn-soft: #f6f1e6; --bad: #c4102e; --bad-soft: #fcebee;
  --info: #1f2fd6; --info-soft: #eef0ff;
  --r: 4px; --r-sm: 3px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0f0f12; --surface: #17171b; --surface-2: #1f1f24; --ink: #f2f2f4; --ink-2: #d6d6db; --muted: #9a9aa3;
  --line: #2a2a31; --line-2: #f2f2f4; --accent: #8f9bff; --accent-ink: #0f0f12; --accent-soft: #1d2150; --accent-line: #3a44a8;
  --gold-wash: #1f2fd6; --ok: #6fd3a2; --ok-soft: #12291f; --warn: #e8c070; --warn-soft: #2a2414; --bad: #ff7a8e; --bad-soft: #33161c;
  --info: #8f9bff; --info-soft: #1d2150;
} }
body, button, input, select, textarea { font-family: var(--font); }
h1 { font: 900 34px/1.05 var(--font); letter-spacing: -.035em; }
h2, .sec-h h2 { font-weight: 700; letter-spacing: -.01em; }
.head .sub { color: var(--muted); }
.demo-bar { border-radius: var(--r); background: var(--surface); color: var(--muted); }

/* rail */
.brand { font: 900 22px var(--font); letter-spacing: -.03em; }
.brand .mark { background: var(--accent); color: #fff; border-radius: var(--r); font: 900 21px var(--font); }
.nav a { border-radius: var(--r); font-weight: 500; }
.nav a[aria-current="page"] { background: none; color: var(--accent); font-weight: 700; box-shadow: inset -3px 0 0 var(--accent); }
.nav a[aria-current="page"] svg.i { color: var(--accent); }
.nav .count, .nav a[aria-current="page"] .count { background: var(--ink); color: var(--surface); border-radius: var(--r); }

/* controls: precise, square-ish */
.btn { border-radius: var(--r); font-weight: 700; }
.btn.primary { background: var(--accent); border-color: var(--accent); box-shadow: none; }
.btn.sm { border-radius: var(--r); }
.btn:not(.primary):not(.ghost) { border-color: var(--ink); }
.seg, .seg button { border-radius: var(--r); }
.seg { background: var(--surface); border-color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.input, select.input, .search .input { border-radius: var(--r); }
.pill, .chip { border-radius: var(--r); }
.card, .list { border-radius: var(--r); }
.avatar, .client-head .avatar { border-radius: var(--r); }
.avatar, .avatar[data-c] { background: var(--surface-2); color: var(--ink); }
.avatar.agent { background: var(--accent-soft); color: var(--accent); }
.tabs a[aria-current="page"] { border-color: var(--accent); color: var(--accent); }
.next { background: var(--surface); border: 1px solid var(--ink); border-radius: var(--r); }
.handler.human { background: var(--surface); border: 1px solid var(--ink); color: var(--ink); }
.bubble { border-radius: 14px; }
.bubble.out { background: var(--accent); color: #fff; }

/* sections: gallery wall labels over hairline lists, no tinted cards */
.sec-h { border-bottom: 1px solid var(--ink); padding-bottom: 8px; margin-bottom: 0; }
.sec-h h2 { font-size: 15px; font-weight: 500; color: var(--muted); }
.sec-h h2::before { content: none; }
.sec-h .count { margin-inline-start: auto; order: 3; font: 900 18px var(--font); color: var(--ink); }
.sec-h .spacer { display: none; }
.list { border: 0; background: none; border-radius: 0; }
.list > .item, .list > .item:first-child { border-top: 0; border-bottom: 1px solid var(--line); padding-inline: 2px; }
.list .sub-h { border-top: 0; padding-inline: 2px; }

/* the one committed field: the free window */
.gold { background: var(--gold-wash); color: #fff; border: 0; border-radius: var(--r); }
.gold-h, .gold-h > svg { color: rgb(255 255 255 / .85); }
.gold-hero { gap: 24px; padding: 20px 22px; }
.ring { width: 168px; height: 168px; }
.ring .ticks { stroke: #fff; opacity: .4; }
.ring .track { stroke: rgb(255 255 255 / .2); }
.ring .arc { stroke: #fff; }
.ring.urgent .arc { stroke: #ffb3c0; }
.ring b { font: 900 76px/.8 var(--font); letter-spacing: -.05em; color: #fff; }
.ring small { color: rgb(255 255 255 / .85); font-weight: 400; }
.gold-who .title { font: 700 30px/1.05 var(--font); letter-spacing: -.02em; color: #fff; }
.gold-who .chips .pill { background: transparent; color: #fff; box-shadow: none; border: 1px solid rgb(255 255 255 / .5); }
.gold-who .pill.info { background: #fff; color: var(--gold-wash); }
.gold-cta { padding: 0 22px 20px; }
.gold .btn.gold-go { background: #fff; color: #1f2fd6; border: 0; border-radius: var(--r); font-weight: 900; height: 54px; }
.gold .btn.gold-go:hover { background: #eef0ff; }
.gold-item { border-top: 1px solid rgb(255 255 255 / .2); padding-inline: 22px; }
.gold-item .title { color: #fff; font: 700 16px var(--font); }
.gold-item .line { color: rgb(255 255 255 / .75); }
.gold .gold-item .btn { background: transparent; border: 1px solid rgb(255 255 255 / .6); color: #fff; }
.gold-clock, .gold-clock.urgent { color: #fff; font-weight: 700; }
.mini .track { stroke: rgb(255 255 255 / .2); } .mini .arc { stroke: #fff; } .mini.urgent .arc { stroke: #ffb3c0; }
.gold-more { color: #fff; border-top: 1px solid rgb(255 255 255 / .2); border-radius: 0; }
.gold-more:hover { background: rgb(255 255 255 / .06); }
.gold :focus-visible { outline-color: #fff; }

.tabbar a[aria-current="page"] svg.i { background: none; padding: 0; width: 22px; height: 22px; }

/* approval odds (internal): one big number, every point explained */
.odds-head { display: flex; align-items: center; gap: 18px; padding: 4px 18px 14px; }
.odds-score { display: grid; justify-items: center; line-height: 1; }
.odds-score b { font: 900 56px/.85 var(--font); letter-spacing: -.05em; color: var(--accent); }
.odds-score span { font-size: 12px; color: var(--muted); margin-top: 4px; }
.odds-band { font-weight: 900; font-size: 20px; }
.odds-band.ok { color: var(--ok); } .odds-band.warn { color: var(--warn); } .odds-band.bad { color: var(--bad); }
.odds-list { list-style: none; margin: 0; padding: 0 18px; }
.odds-list li { display: flex; gap: 12px; align-items: baseline; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.odds-pts { flex: none; width: 42px; font-weight: 900; font-variant-numeric: tabular-nums; color: var(--muted); direction: ltr; text-align: end; }
.odds-pts.up { color: var(--ok); } .odds-pts.down { color: var(--bad); }
.odds-act { margin: 6px 18px 0; padding: 12px 14px; border: 1px solid var(--ink); border-radius: var(--r); }
.odds-act ol { margin: 6px 0 0; padding-inline-start: 18px; } .odds-act li { padding: 2px 0; }
.odds-note { padding: 10px 18px 16px; }
.lend { margin: 8px 18px 0; }
.lend-h { font-size: 13px; color: var(--muted); padding-bottom: 6px; border-bottom: 1px solid var(--ink); }
.lend-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.lend-tile { width: 38px; height: 38px; flex: none; border-radius: var(--r); display: grid; place-items: center; font-weight: 900; font-size: 13px;
  background: var(--surface-2); color: var(--ink); }
.fit-fits .lend-tile { background: var(--accent); color: var(--accent-ink); }
.lend-body { flex: 1; min-width: 0; }
.lend-name { font-weight: 700; }
.lend-why { font-size: 13px; color: var(--muted); }
.lend-end { display: grid; justify-items: end; gap: 2px; flex: none; }
.lend-fit { font-weight: 900; font-size: 14px; }
.fit-fits .lend-fit { color: var(--ok); } .fit-borderline .lend-fit { color: var(--warn); } .fit-no .lend-fit { color: var(--bad); }
.fit-no { opacity: .72; }
.claim { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.claim-ic { width: 32px; height: 32px; flex: none; border-radius: var(--r); display: grid; place-items: center; }
.lvl-bad .claim-ic { background: var(--bad-soft); color: var(--bad); }
.lvl-warn .claim-ic { background: var(--warn-soft); color: var(--warn); }
.lvl-ok .claim-ic { background: var(--ok-soft); color: var(--ok); }
.claim-why { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; }
.sav-row { display: grid; grid-template-columns: 1.3fr 1fr auto 1fr 1fr auto; gap: 6px; margin-bottom: 6px; align-items: center; }
.sav-liq { gap: 4px; white-space: nowrap; }
@media (max-width: 860px) { .sav-row { grid-template-columns: 1fr 1fr; } .sav-row [data-del] { justify-self: start; } }
.call-sum { margin-top: 6px; white-space: normal; display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.call-sum svg.i { color: var(--accent); }
.call-tr summary { font-size: 13px; padding: 4px 0; }
.call-tr div { font-size: 13.5px; line-height: 1.7; white-space: normal; text-align: start; }

/* live call sheet: slides in from the top, the ring pulses only while the phone actually rings (impeccable: motion = state) */
.call-sheet { position: fixed; z-index: 60; top: calc(14px + env(safe-area-inset-top, 0px)); inset-inline-start: 50%; translate: 50% 0;
  width: min(420px, calc(100vw - 24px)); background: var(--surface); color: var(--ink); border: 1px solid var(--ink); border-radius: 18px;
  box-shadow: var(--shadow-lg); padding: 16px; display: grid; gap: 12px; animation: csIn 320ms var(--ease) both; }
.call-sheet.leaving { animation: csOut 180ms ease-in both; }
@keyframes csIn { from { opacity: 0; transform: translateY(-24px) scale(.98); } }
@keyframes csOut { to { opacity: 0; transform: translateY(-16px); } }
.cs-top { display: flex; align-items: center; gap: 14px; }
.cs-ring { position: relative; width: 52px; height: 52px; flex: none; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; }
.cs-ring svg.i { width: 24px; height: 24px; position: relative; z-index: 1; }
.cs-ring i { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--accent); opacity: 0; }
.is-ringing .cs-ring i { animation: csPulse 1.6s cubic-bezier(.16, 1, .3, 1) infinite; }
.is-ringing .cs-ring i:nth-child(3) { animation-delay: .8s; }
.is-ringing .cs-ring svg.i { animation: csShake 1.6s ease-in-out infinite; }
@keyframes csPulse { 0% { opacity: .55; transform: scale(1); } 100% { opacity: 0; transform: scale(1.9); } }
@keyframes csShake { 0%, 60%, 100% { rotate: 0deg; } 10%, 30% { rotate: -14deg; } 20%, 40% { rotate: 14deg; } }
.cs-who { flex: 1; min-width: 0; }
.cs-state { font-size: 13px; color: var(--accent); font-weight: 700; }
.cs-name { font: 900 22px/1.15 var(--font); letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-sub { font-size: 13px; color: var(--muted); }
.cs-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cs-fact { padding: 10px 6px; display: grid; gap: 2px; text-align: center; }
.cs-fact + .cs-fact { border-inline-start: 1px solid var(--line); }
.cs-fact b { font: 900 22px/1 var(--font); font-variant-numeric: tabular-nums; }
.cs-fact span { font-size: 12px; color: var(--muted); display: inline-flex; gap: 4px; justify-content: center; align-items: center; }
.cs-last { display: flex; gap: 8px; font-size: 14px; color: var(--ink-2); }
.cs-last span { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cs-open { width: 100%; height: 48px; }
@media (prefers-reduced-motion: reduce) {
  .call-sheet, .call-sheet.leaving { animation: none; }
  .is-ringing .cs-ring i { animation: none; opacity: .4; transform: scale(1.25); }  /* still reads as "ringing", no movement */
  .is-ringing .cs-ring svg.i { animation: none; }
}
.brief { white-space: normal; line-height: 1.7; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.tabbar a[aria-current="page"] { color: var(--accent); }
@media (max-width: 860px) {
  h1 { font-size: 27px; }
  .ring { width: 132px; height: 132px; } .ring b { font-size: 60px; }
  .gold-who .title { font-size: 24px; }
  .gold-hero, .gold-cta, .gold-item { padding-inline: 16px; }
}

/* ---------- monthly target (one bar: in / on its way / left) ---------- */
.goal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r, 4px); padding: 18px 20px 14px; margin-bottom: 24px; }
.goal-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.goal-label { font-size: 13px; color: var(--muted); font-weight: 500; }
.goal-num b { font-size: 30px; font-weight: 900; letter-spacing: -.02em; color: var(--ink); }
.goal-num span { color: var(--muted); font-size: 15px; }
.goal-side { text-align: left; }
.goal-side > b { font-size: 22px; font-weight: 700; color: var(--accent); display: inline-flex; gap: 6px; align-items: center; }
.goal-bar { position: relative; display: flex; height: 10px; margin: 14px 0 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.goal-bar i { display: block; height: 100%; transform-origin: right; animation: goalIn .9s cubic-bezier(.2, .8, .2, 1) both; }
.goal-bar i.in { background: var(--accent); }
.goal-bar i.way { background: var(--accent-line); animation-delay: .15s; }
.goal-legend { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); }
.goal-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-inline-end: 6px; vertical-align: -1px; }
.goal-legend i.in { background: var(--accent); }
.goal-legend i.way { background: var(--accent-line); }
.goal-set { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.goal-set span { display: inline-flex; gap: 8px; align-items: center; font-weight: 700; }
.goal-set .input { max-width: 160px; }
@keyframes goalIn { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { .goal-bar i { animation: none; } }
@media (max-width: 600px) { .goal-side { text-align: right; } .goal-num b { font-size: 26px; } }

.paid-ask { margin-bottom: 24px; border-color: var(--accent-line); }
.paid-ask .item { gap: 10px; flex-wrap: wrap; }
.paid-ask .pay-row { padding-inline: 18px; }


/* ---------- failures said out loud: on every screen until someone closes them ---------- */
.alert-bar { margin-bottom: 14px; flex: none; }
.alert-bar > summary { display: flex; align-items: center; gap: 10px; padding: 8px 14px; min-height: 40px; cursor: pointer; list-style: none;
  background: var(--bad-soft); color: var(--bad); border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent); border-radius: var(--r, 4px); }
.alert-bar > summary::-webkit-details-marker { display: none; }
.alert-bar > summary b { flex: 1; min-width: 0; font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alert-n { flex: none; font-size: 13px; font-weight: 600; text-decoration: underline; }
.alert-list { display: grid; gap: 8px; margin-top: 8px; max-height: 45vh; overflow-y: auto; }
.alert-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 14px;
  background: var(--bad-soft); color: var(--bad); border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent); border-radius: var(--r, 4px); }
.alert-row > svg { margin-top: 2px; }
.alert-txt { display: grid; gap: 2px; min-width: 0; }
.alert-txt b { font-weight: 700; }
.alert-txt span, .alert-txt a { color: var(--ink-2); font-size: 14px; }
.alert-txt a { text-decoration: underline; justify-self: start; }
.alert-count { font-weight: 500; opacity: .75; }

/* ---------- "שולם?": who, how much, one decision ---------- */
.pay-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "who sum" "act act"; gap: 10px 20px;
  padding: 14px 0; border-top: 1px solid var(--line); }
.pay-row:first-child { border-top: 0; padding-top: 2px; }
.pay-who { grid-area: who; display: grid; gap: 3px; min-width: 0; }
.pay-who > a:first-child { font-weight: 700; font-size: 16px; color: var(--ink); }
.pay-who > span { color: var(--muted); font-size: 14px; }
.pay-who .pay-q { color: var(--ink-2); font-size: 14px; }
.pay-file { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; color: var(--accent); justify-self: start; }
.pay-sum { grid-area: sum; display: grid; justify-items: end; align-content: start; }
.pay-sum span, .pay-sum small { color: var(--muted); font-size: 13px; }
.pay-sum b { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.pay-act { grid-area: act; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- SUMIT documents inside the proof card ---------- */
.docs { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); display: grid; gap: 2px; }
.docs-h { font-size: 14px; font-weight: 700; color: var(--muted); margin: 0 0 6px; }
.doc-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main act" "meta act"; gap: 4px 12px; padding: 10px 0; }
.doc-row + .doc-row { border-top: 1px dashed var(--line); }
.doc-main { grid-area: main; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.doc-sum { font-weight: 700; } .doc-sum small { color: var(--muted); font-weight: 400; }
.doc-meta { grid-area: meta; display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 13px; flex-wrap: wrap; }
.doc-act { grid-area: act; display: flex; gap: 6px; align-items: center; }
.doc-row.is-off .doc-main { text-decoration: line-through; color: var(--muted); }
.docs-cancel { justify-self: start; margin-top: 8px; }

/* ---------- opportunity radar ---------- */
.op-row { padding: 16px 0; border-top: 1px solid var(--line); display: grid; gap: 4px; }
.op-row:first-child { border-top: 0; padding-top: 4px; }
.op-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.op-name { font-weight: 700; font-size: 16px; color: var(--ink); }
.op-when { margin-inline-start: auto; color: var(--muted); font-size: 13px; }
.op-title { margin: 2px 0 0; font-weight: 500; }
.op-detail { margin: 0; color: var(--muted); font-size: 14px; }
.op-pitch { margin-top: 8px; display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; background: var(--surface-2);
  border-inline-start: 3px solid var(--accent); border-radius: var(--r, 4px); }
.op-pitch p { margin: 0; flex: 1; font-size: 14px; line-height: 1.6; }

/* readiness: the detail is the instruction, never cut it */
#readyBox .item .line { white-space: normal; overflow: visible; text-overflow: clip; }
@media (max-width: 600px) { .pay-row { grid-template-columns: 1fr; grid-template-areas: "who" "sum" "act"; } .pay-sum { justify-items: start; } .op-pitch { flex-direction: column; } }

.card-b > .docs:first-child { margin-top: 0; padding-top: 0; border-top: 0; }


.agree { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; cursor: pointer; }
.agree input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--accent); }


/* ================= WhatsApp conversation (Gallery) ================= */
.inbox-thread { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.wa-h { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface); flex-wrap: wrap; }
.wa-h-who { display: grid; min-width: 0; }
.wa-h-name { font-weight: 800; font-size: 17px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-h-who .num { color: var(--muted); font-size: 13px; }
.wa-h-act { margin-inline-start: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.wa-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; font-size: 13px; font-weight: 600; }
.wa-chip.agent { background: var(--accent-soft); color: var(--accent); }
.wa-chip.human { background: var(--ok-soft); color: var(--ok); }

.wa-split { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 260px; }
.wa-main { display: flex; flex-direction: column; min-height: 0; }
.wa-ctx { border-inline-start: 1px solid var(--line); padding: 16px; overflow-y: auto; display: grid; align-content: start; gap: 18px; background: var(--surface); }
.wa-ctx-sec h3 { font-size: 13px; font-weight: 700; color: var(--muted); margin: 0 0 6px; }
.wa-ctx-sec > b { display: block; font-size: 15px; }
.wa-ctx-sec > .num { display: block; font-size: 22px; font-weight: 800; margin-top: 2px; }
.wa-ctx-sec ul { margin: 0 0 10px; padding-inline-start: 18px; display: grid; gap: 4px; font-size: 14px; }
.wa-odds { display: flex; align-items: baseline; gap: 8px; margin-top: 8px; }
.wa-odds .num { font-size: 20px; font-weight: 800; color: var(--accent); }
.wa-odds small, .ok-line { color: var(--muted); font-size: 13px; }
.ok-line { display: inline-flex; gap: 6px; align-items: center; color: var(--ok); }
.wa-ctx-act { display: flex; flex-wrap: wrap; gap: 6px; }

.wa { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r, 4px); height: min(72vh, 760px); }
.wa.in-inbox { border: 0; border-radius: 0; height: 100%; flex: 1; }
.wa-thread { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px clamp(12px, 3vw, 28px) 10px;
  display: flex; flex-direction: column; gap: 10px; background: var(--surface-2); scroll-behavior: smooth; }
.wa-day { position: sticky; top: 0; z-index: 1; display: flex; justify-content: center; margin: 6px 0 2px; pointer-events: none; }
.wa-day span { background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 600; padding: 3px 12px; border-radius: 99px; }

.wa-msg { max-width: min(78%, 560px); align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  border-start-start-radius: 4px; padding: 8px 12px 6px; box-shadow: 0 1px 0 rgb(0 0 0 / .03); }
.wa-msg.cont { margin-top: -6px; border-start-start-radius: 14px; }
.wa-msg.out { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-color: transparent; border-start-start-radius: 14px; border-start-end-radius: 4px; }
.wa-msg.out.cont { border-start-end-radius: 14px; }
.wa-msg.agent { align-self: flex-end; border-inline-end: 3px solid var(--accent); border-start-start-radius: 14px; border-start-end-radius: 4px; }
.wa-msg.note { align-self: center; max-width: min(88%, 620px); background: var(--warn-soft); border: 1px dashed color-mix(in srgb, var(--warn) 45%, transparent); border-radius: 6px; }
.wa-msg.cancelled { opacity: .55; } .wa-msg.cancelled .wa-text { text-decoration: line-through; }
.wa-msg.sending { opacity: .75; animation: waIn .22s ease-out both; } .wa-msg.failed { outline: 2px solid var(--bad); }
.wa-who { display: inline-flex; gap: 5px; align-items: center; font-size: 12px; font-weight: 700; color: var(--accent); margin-bottom: 2px; }
.wa-msg.note .wa-who { color: var(--warn); }
.wa-text { white-space: normal; overflow-wrap: anywhere; line-height: 1.55; }
.wa-meta { display: flex; justify-content: flex-end; align-items: center; gap: 6px; margin-top: 2px; font-size: 11.5px; color: var(--muted); }
.wa-msg.out .wa-meta { color: color-mix(in srgb, var(--accent-ink) 75%, transparent); }
.wa-tick { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.wa-msg.out .wa-tick.read { stroke: #9fe7ff; } .wa-msg.agent .wa-tick.read { stroke: var(--accent); }
.wa-tick.failed, .wa-tick.unknown { stroke: var(--bad); } .wa-msg.out .wa-tick.failed, .wa-msg.out .wa-tick.unknown { stroke: #ffd2d8; }
.wa-demo { font-size: 10.5px; font-weight: 700; padding: 0 6px; border-radius: 99px; background: color-mix(in srgb, currentColor 14%, transparent); }
.wa-link { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; color: inherit; }
.wa-msg:not(.out) .wa-link { color: var(--accent); }

.wa-event { align-self: center; display: grid; grid-template-columns: auto 1fr auto; gap: 4px 8px; align-items: center; max-width: min(88%, 560px);
  padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; color: var(--ink-2); }
.wa-event time { color: var(--muted); font-size: 12px; }
.wa-callsum, .wa-tr, .wa-event > .wa-link { grid-column: 1 / -1; }
.wa-callsum { font-size: 14px; line-height: 1.55; } .wa-callsum b { display: block; font-size: 12px; color: var(--accent); }
.wa-tr summary { cursor: pointer; font-size: 13px; color: var(--accent); }
.wa-empty { margin: auto; display: grid; justify-items: center; gap: 6px; text-align: center; color: var(--muted); }
.wa-empty b { color: var(--ink); }

.wa-warn { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 14px; background: var(--bad-soft); color: var(--bad); font-size: 14px; }
.wa-compose { border-top: 1px solid var(--line); padding: 10px clamp(10px, 2vw, 18px) 8px; display: grid; gap: 8px; background: var(--surface); }
.wa-quick { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.wa-quick .chip { white-space: nowrap; flex: none; }
.chip.accent { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); font-weight: 600; }
.wa-closed { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--ink-2); background: var(--surface-2); padding: 8px 12px; border-radius: 8px; }
.wa-closed span { flex: 1; }
.wa-box { border: 1px solid var(--line-2, var(--line)); border-radius: 12px; background: var(--surface); overflow: hidden; transition: border-color .15s ease, box-shadow .15s ease; }
.wa-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.wa.noting .wa-box { border-color: color-mix(in srgb, var(--warn) 55%, transparent); background: var(--warn-soft); }
.wa.noting .wa-box:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 18%, transparent); }
.wa-mode { display: flex; gap: 2px; padding: 6px 8px 0; }
.wa-mode button { border: 0; background: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); padding: 4px 10px; border-radius: 99px; cursor: pointer; min-height: 30px; }
.wa-mode button[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); }
.wa.noting .wa-mode button[aria-selected="true"] { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.wa-mode button:disabled { opacity: .45; cursor: not-allowed; }
.wa-mode small { font-weight: 500; opacity: .8; }
.wa-input { display: flex; align-items: flex-end; gap: 8px; padding: 4px 6px 6px 8px; }
.wa-input textarea { flex: 1; border: 0; outline: none; resize: none; background: transparent; font: inherit; color: var(--ink); padding: 8px 6px; min-height: 40px; max-height: 168px; line-height: 1.5; }
.wa-send { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; cursor: pointer;
  transition: transform .12s ease, opacity .12s ease; }
.wa-send:hover { opacity: .92; } .wa-send:active { transform: scale(.94); }
.wa-send svg { transform: scaleX(-1); }  /* the paper plane points the way RTL text flows */
.wa.noting .wa-send { background: var(--warn); }
.wa-hint { font-size: 12px; color: var(--muted); text-align: end; }
@keyframes waIn { from { opacity: 0; transform: translateY(6px); } to { opacity: .75; transform: none; } }
@media (prefers-reduced-motion: reduce) { .wa-msg.sending { animation: none; } .wa-thread { scroll-behavior: auto; } }
@media (max-width: 1180px) { .wa-split { grid-template-columns: minmax(0, 1fr); } .wa-ctx { display: none; } }
@media (max-width: 860px) {
  .wa-msg { max-width: 88%; } .wa-h { padding: 10px 12px; } .wa-h-act .btn { min-height: 36px; }
  .wa-hint { display: none; }
}

/* the inbox decides by the room it actually has (container), not the screen: below ~900px the open conversation takes it all */
#main { container-type: inline-size; container-name: main; }
@container main (max-width: 900px) {
  .inbox { grid-template-columns: minmax(0, 1fr); }
  .inbox.has-open .inbox-list { display: none; }
  .inbox:not(.has-open) .inbox-thread { display: none; }
  .inbox .back-sm { display: inline-flex; }
}
@container main (min-width: 901px) { .inbox .back-sm { display: none; } }

/* the inbox fills exactly what's left of the screen under any bars above it; the composer never falls below the fold */
#main:has(> .inbox) { display: flex; flex-direction: column; height: 100dvh; overflow: hidden; padding-bottom: 16px; }
#main:has(> .inbox) > .inbox { flex: 1; height: auto; min-height: 0; }
@media (max-width: 860px) { #main:has(> .inbox) { height: calc(100dvh - 64px); } }

/* phones and narrow panes: one row that exactly fills what's left; the composer always shows above the tab bar */
#main:has(> .inbox) > .inbox { display: grid; grid-template-rows: minmax(0, 1fr); overflow: hidden; }
.inbox-thread, .inbox-list { min-height: 0; }
.wa-thread { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--muted) 45%, transparent) transparent; }
.wa-thread::-webkit-scrollbar { width: 6px; } .wa-thread::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--muted) 45%, transparent); border-radius: 6px; }
@media (max-width: 860px) {
  #main:has(> .inbox) { height: calc(100dvh - 64px - env(safe-area-inset-bottom)); padding-bottom: 8px; }
}
.wa-day span { box-shadow: 0 2px 8px rgb(0 0 0 / .08); }  /* the floating day label reads as floating, over the bubbles it passes */


/* ================= WhatsApp: the one bold screen (young, energetic, still Gallery) ================= */
:root { --wa-us: #1f2fd6; --wa-bot: #7b5cff; --wa-mint: #12c48b; --wa-sun: #ffd84d; --wa-mist: #f4f5ff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --wa-us: #4757ff; --wa-bot: #9a83ff; --wa-mist: #14162a; --wa-sun: #f2c94c; } }

/* faces: a steady colour per person, the agent wears a small lilac badge */
.wa-av { position: relative; flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 900; font-size: 16px; color: #fff; letter-spacing: -.02em; }
.wa-av.av0 { background: #1f2fd6; } .wa-av.av1 { background: #e2366b; } .wa-av.av2 { background: #0f9d74; }
.wa-av.av3 { background: #f08a24; } .wa-av.av4 { background: #7b5cff; } .wa-av.av5 { background: #0b7fc7; }
.wa-av > i { position: absolute; bottom: -2px; inset-inline-end: -2px; width: 20px; height: 20px; border-radius: 50%; background: var(--wa-bot);
  border: 2px solid var(--surface); display: grid; place-items: center; } .wa-av > i svg { width: 12px; height: 12px; color: #fff; }

/* the list: big faces, bold names, who's waiting jumps out */
.inbox-items { padding: 6px; }
.wa-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 14px;
  color: inherit; text-decoration: none; transition: background-color .12s ease; }
.wa-row:hover { background: var(--wa-mist); }
.wa-row.on { background: color-mix(in srgb, var(--wa-us) 10%, var(--surface)); box-shadow: inset 3px 0 0 var(--wa-us); }
.wa-row-b { min-width: 0; display: grid; gap: 2px; }
.wa-row-top { display: flex; gap: 8px; align-items: baseline; }
.wa-row-top b { font-weight: 700; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-row-top time { margin-inline-start: auto; font-size: 12px; color: var(--muted); flex: none; }
.wa-row-msg { font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-row-msg em { font-style: normal; color: var(--ink-2); }
.wa-row.waiting .wa-row-top b { font-weight: 900; } .wa-row.waiting .wa-row-msg { color: var(--ink); font-weight: 500; }
.wa-wait { margin-inline-start: auto; flex: none; font-size: 11.5px; font-weight: 800; color: #fff; background: var(--wa-us); padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.wa-wait.late { background: #e2366b; } .wa-wait.soon { background: #f08a24; }

/* the canvas: a fine ultramarine dot grid on mist, ours vivid, the agent lilac, notes sunny */
.wa-thread { background-color: var(--wa-mist);
  background-image: radial-gradient(color-mix(in srgb, var(--wa-us) 14%, transparent) 1px, transparent 1.2px); background-size: 18px 18px; gap: 8px; }
.wa-msg { font-size: 15.5px; border-radius: 18px; border-start-start-radius: 6px; border-color: transparent; box-shadow: none; padding: 9px 14px 6px; }
.wa-msg.cont { border-start-start-radius: 18px; }
.wa-msg.out { background: var(--wa-us); border-start-end-radius: 6px; }
.wa-msg.agent { background: var(--surface); border: 2px solid color-mix(in srgb, var(--wa-bot) 55%, transparent); border-inline-end-width: 2px; border-start-end-radius: 6px; }
.wa-msg.agent .wa-who { color: var(--wa-bot); }
.wa-msg.note { background: var(--wa-sun); color: #3a2f00; border: 0; border-radius: 10px; transform: rotate(-.4deg); }
.wa-msg.note .wa-who, .wa-msg.note .wa-meta { color: #6b5600; }
.wa-msg.out .wa-tick.read, .wa-msg.agent .wa-tick.read { stroke: var(--wa-mint); }
.wa-msg.out .wa-tick.read { stroke: #7dffcf; }
.wa-day span { font-weight: 800; color: var(--wa-us); border: 0; }
.wa-event { border: 0; border-radius: 99px; box-shadow: 0 1px 0 color-mix(in srgb, var(--wa-us) 12%, transparent); }
.wa-event:has(.wa-callsum, .wa-tr) { border-radius: 16px; }

/* quick replies: thumb-sized pills with an emoji, the missing-documents one is the hot one */
.wa-quick { gap: 8px; }
.wa-qc { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: 99px; cursor: pointer;
  border: 1.5px solid color-mix(in srgb, var(--wa-us) 22%, var(--line)); background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; font-weight: 600;
  transition: transform .12s ease, background-color .12s ease; white-space: nowrap; }
.wa-qc:hover { background: var(--wa-mist); } .wa-qc:active { transform: scale(.96); }
.wa-qc.hot { background: var(--wa-us); color: #fff; border-color: transparent; }
.wa-qc span { font-size: 16px; }

/* the composer floats: one rounded pill, a big round send that takes off */
.wa-compose { border-top: 0; background: var(--wa-mist); padding-top: 8px; }
.wa-box { border-radius: 22px; border: 2px solid transparent; background: var(--surface); box-shadow: 0 6px 22px -10px color-mix(in srgb, var(--wa-us) 45%, transparent); }
.wa-box:focus-within { border-color: var(--wa-us); box-shadow: 0 8px 26px -10px color-mix(in srgb, var(--wa-us) 60%, transparent); }
.wa.noting .wa-box { background: color-mix(in srgb, var(--wa-sun) 30%, var(--surface)); border-color: var(--wa-sun); }
.wa-mode { padding: 8px 10px 0; gap: 4px; }
.wa-mode button { display: inline-flex; gap: 5px; align-items: center; font-weight: 700; min-height: 32px; padding: 4px 12px; }
.wa-mode button[aria-selected="true"] { background: var(--wa-us); color: #fff; }
.wa.noting .wa-mode button[aria-selected="true"] { background: var(--wa-sun); color: #3a2f00; }
.wa-mode small { font-weight: 600; }
.wa-input textarea { font-size: 16px; }
.wa-send { width: 48px; height: 48px; background: var(--wa-us); box-shadow: 0 6px 16px -6px var(--wa-us); }
.wa.noting .wa-send { background: #3a2f00; box-shadow: none; }
.wa-send.go svg { animation: waGo .45s cubic-bezier(.2, .8, .2, 1); }
@keyframes waGo { 0% { transform: scaleX(-1) translate(0, 0); } 45% { transform: scaleX(-1) translate(10px, -10px); opacity: 0; } 46% { transform: scaleX(-1) translate(-8px, 8px); opacity: 0; } 100% { transform: scaleX(-1) translate(0, 0); opacity: 1; } }
.wa-closed { background: var(--surface); border-radius: 14px; flex-wrap: wrap; }
.wa-closed span { min-width: min(240px, 100%); }
.wa-save[hidden] { display: none; }
.wa-av.av3 { background: #c96a10; }  /* white initials stay readable */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .st-new { --st: #8b96ff; }
  :root:not([data-theme="light"]) .st-chip[aria-pressed="true"], :root:not([data-theme="light"]) .st-chip[aria-pressed="true"] b { color: #0d1020; }
  :root:not([data-theme="light"]) .st-chip[aria-pressed="true"] i { background: #0d1020; }
  :root:not([data-theme="light"]) .wa-file-st.ok { color: #6fdca6; }
}
@media (max-width: 860px) {
  .actions { flex-wrap: wrap; }  /* "לקוח חדש" must never slide off a phone screen */
  .tabbar a { flex: 1; min-width: 0; padding-inline: 2px; white-space: nowrap; font-size: 11px; }
  #main:has(> .inbox.has-open) { padding-top: 8px; }
  #main:has(> .inbox.has-open) .demo-bar { display: none; }  /* an open chat on a phone: the conversation gets the room */
}
@container main (max-width: 600px) {
  .wa-h { padding: 8px 10px; gap: 8px; row-gap: 6px; }
  .wa-h-who { flex: 1; }
  .wa-h-act { order: 3; flex: 0 0 100%; margin: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .wa-h-act > * { flex: none; }
  .wa-closed { font-size: 13px; }
}
#main:has(> .inbox) { padding-top: 14px; }
#main:has(> .inbox) .demo-bar { margin-bottom: 10px; }

/* header: the person, big; who's handling, as one bright chip */
.wa-h { padding: 12px 18px; } .wa-h-name { font-size: 19px; font-weight: 900; }
.wa-chip.agent { background: color-mix(in srgb, var(--wa-bot) 14%, var(--surface)); color: var(--wa-bot); }
.wa-chip.human { background: color-mix(in srgb, var(--wa-mint) 16%, var(--surface)); color: #0a7a56; }

/* nothing open yet: an invitation, not a void */
.wa-hello { margin: auto; display: grid; justify-items: center; gap: 8px; text-align: center; padding: 24px; }
.wa-hello-ic { width: 72px; height: 72px; border-radius: 24px; background: var(--wa-us); color: #fff; display: grid; place-items: center; transform: rotate(-6deg); }
.wa-hello-ic svg { width: 34px; height: 34px; }
.wa-hello b { font-size: 18px; font-weight: 900; } .wa-hello span { color: var(--muted); max-width: 32ch; }
@media (prefers-reduced-motion: reduce) { .wa-send.go svg { animation: none; } .wa-msg.note { transform: none; } }

/* inbox filters: pills in our colour, the count rides along */
.inbox-tools .seg { border: 0; background: var(--wa-mist); border-radius: 99px; padding: 4px; gap: 2px; }
.inbox-tools .seg button { border-radius: 99px; border: 0; background: transparent; color: var(--ink-2); font-weight: 700; min-height: 36px; }
.inbox-tools .seg button[aria-pressed="true"] { background: var(--wa-us); color: #fff; box-shadow: 0 4px 12px -6px var(--wa-us); }
.inbox-tools .seg button[aria-pressed="true"] .muted { color: color-mix(in srgb, #fff 80%, transparent); }
.inbox-tools .search .input { border-radius: 99px; background: var(--wa-mist); border-color: transparent; }
.inbox-tools .search .input:focus { border-color: var(--wa-us); background: var(--surface); }
.inbox-items { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--muted) 40%, transparent) transparent; }
.wa-av svg { width: 20px; height: 20px; color: #fff; }

.wa-day { position: static; }  /* stacked sticky day labels looked messy: plain separators read cleaner */


/* the deal's story between the messages: small, centred, with an emoji; a win gets the mint */
.wa-story { align-self: center; display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 99px; font-size: 13.5px; font-weight: 600;
  background: color-mix(in srgb, var(--wa-us) 9%, var(--surface)); color: var(--ink-2); max-width: 92%; }
.wa-story span { font-size: 15px; } .wa-story time { color: var(--muted); font-size: 11.5px; font-weight: 500; }
.wa-story.win { background: color-mix(in srgb, var(--wa-mint) 18%, var(--surface)); color: color-mix(in srgb, var(--ok) 70%, var(--ink)); }

/* a file the client sent: a card in the stream, on the client's side */
.wa-file { align-self: flex-start; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 12px; align-items: center;
  max-width: min(78%, 420px); padding: 10px 12px; border-radius: 18px; border-start-start-radius: 6px; background: var(--surface); color: inherit; text-decoration: none;
  border: 2px solid transparent; transition: border-color .12s ease; }
.wa-file:hover { border-color: color-mix(in srgb, var(--wa-us) 35%, transparent); }
.wa-file-ic { grid-row: 1 / 3; width: 44px; height: 52px; border-radius: 8px; background: color-mix(in srgb, var(--wa-us) 12%, var(--surface)); color: var(--wa-us);
  display: grid; place-items: center; }
.wa-file-b { display: grid; min-width: 0; } .wa-file-b b { font-weight: 800; } .wa-file-b small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-file-st { font-size: 11.5px; font-weight: 800; padding: 2px 8px; border-radius: 99px; background: var(--wa-mist); color: var(--ink-2); justify-self: end; }
.wa-file-st.new { background: var(--wa-us); color: #fff; } .wa-file-st.ok { background: color-mix(in srgb, var(--wa-mint) 20%, var(--surface)); color: #0a6b4c; }
.wa-file time { grid-column: 3; font-size: 11.5px; color: var(--muted); justify-self: end; }

/* the suggested reply leads the row */
.wa-qc.smart { background: color-mix(in srgb, var(--wa-bot) 14%, var(--surface)); color: var(--wa-bot); border-color: color-mix(in srgb, var(--wa-bot) 40%, transparent); }

/* one tap to call, right next to the name */
.wa-call { width: 42px; height: 42px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer;
  background: color-mix(in srgb, var(--wa-mint) 18%, var(--surface)); color: #0a7a56; transition: transform .12s ease; }
.wa-call:hover { transform: scale(1.06); } .wa-call:active { transform: scale(.94); }

/* "next in line": the queue walks itself */
.wa-next { display: inline-flex; align-items: center; gap: 6px; padding: 0 6px 0 14px; min-height: 40px; border-radius: 99px; font-weight: 800; font-size: 14px;
  background: var(--wa-us); color: #fff; text-decoration: none; box-shadow: 0 6px 16px -8px var(--wa-us); transition: transform .12s ease; }
.wa-next b { background: #fff; color: var(--wa-us); border-radius: 99px; min-width: 24px; height: 24px; display: grid; place-items: center; font-size: 12.5px; padding: 0 6px; }
.wa-next:hover { transform: translateX(-2px); }
/* personal quick replies: a star, and a small × to remove */
.wa-snips { display: contents; }
.wa-qc.mine { padding: 0; gap: 0; overflow: hidden; border-color: color-mix(in srgb, var(--wa-sun) 70%, var(--line)); }
.wa-qc.mine button { border: 0; background: none; font: inherit; color: inherit; cursor: pointer; min-height: 36px; display: inline-flex; align-items: center; gap: 6px; padding: 0 4px 0 12px; }
.wa-qc.mine button.x { padding: 0 8px; color: var(--muted); } .wa-qc.mine button.x:hover { color: var(--bad); }
.wa-hint { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.wa-hint span { margin-inline-start: auto; }
.wa-save { border: 0; background: color-mix(in srgb, var(--wa-sun) 35%, var(--surface)); color: #6b5600; font: inherit; font-size: 12.5px; font-weight: 700;
  border-radius: 99px; padding: 4px 12px; display: inline-flex; gap: 6px; align-items: center; cursor: pointer; min-height: 30px; }
.wa-save svg { fill: currentColor; stroke: none; }

/* voice notes: play it, or just read it */
.wa-voice { display: flex; align-items: center; gap: 8px; }
.wa-voice-ic { width: 36px; height: 36px; border-radius: 50%; background: var(--wa-us); display: grid; place-items: center; font-size: 17px; flex: none; }
.wa-voice audio { height: 36px; max-width: 240px; }
.wa-voice-tr { margin-top: 6px; padding-top: 6px; border-top: 1px dashed color-mix(in srgb, var(--wa-us) 25%, transparent); line-height: 1.55; }
.wa-voice-tr::before { content: "תמלול: "; font-weight: 800; color: var(--wa-us); font-size: 12.5px; }
.wa-voice-st { margin-top: 4px; font-size: 13px; color: var(--muted); }

.brief-tabs { display: flex; margin-bottom: 12px; } .brief-tabs button { flex: 1; display: inline-flex; gap: 6px; justify-content: center; align-items: center; }


/* five statuses, one colour each, everywhere: chip on a client, filter on the list */
.st-new { --st: #1f2fd6; } .st-docs { --st: #f08a24; } .st-submitted { --st: #7b5cff; } .st-won { --st: #0f9d74; } .st-lost { --st: #8a8f9c; }
.st-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 13px; font-weight: 700; white-space: nowrap;
  color: var(--st); background: color-mix(in srgb, var(--st) 12%, var(--surface)); }
.st-pill i, .st-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--st); display: inline-block; }
.st-filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.st-chip { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 14px; border-radius: 99px; cursor: pointer; font: inherit; font-size: 14px;
  font-weight: 600; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink-2); }
.st-chip b { font-weight: 800; color: var(--muted); }
.st-chip[aria-pressed="true"] { background: var(--st, var(--accent)); border-color: transparent; color: #fff; }
.st-chip[aria-pressed="true"] b { color: color-mix(in srgb, #fff 80%, transparent); } .st-chip[aria-pressed="true"] i { background: #fff; }

/* ---------- collections ---------- */
.cl-top { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r, 4px); overflow: hidden; margin-bottom: 20px; }
.cl-top > div { background: var(--surface); padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; }
.cl-top span { font-size: 13px; color: var(--muted); }
.cl-top b { font-size: 26px; font-weight: 900; letter-spacing: -.02em; color: var(--ink); }
.cl-top small { color: var(--muted); }
.cl-top .hot b { color: var(--bad); }
.cl-row { display: grid; grid-template-columns: minmax(200px, 1fr) 84px 120px 58px minmax(0, 420px); gap: 10px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.cl-row > .pill { justify-self: start; white-space: normal; height: auto; }
.cl-sum { text-align: right; }
.cl-row:last-child { border-bottom: 0; }
.cl-who { display: flex; flex-direction: column; min-width: 0; }
.cl-who a { font-weight: 700; color: var(--ink); }
.cl-sum { font-size: 17px; }
.cl-steps { display: inline-flex; gap: 5px; }
.cl-steps i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--line-2, var(--line)); }
.cl-steps i.on { background: var(--accent); border-color: var(--accent); }
.cl-steps i.due { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cl-act { justify-self: end; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; }
.cl-case { border: 1px solid var(--line); border-radius: var(--r, 4px); padding: 14px 16px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 10px; }
.cl-case.stale { border-color: var(--bad); box-shadow: inset 3px 0 0 var(--bad); }
.cl-case.closed { opacity: .7; }
.cl-case-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cl-case-h a { font-weight: 700; color: var(--ink); }
.cl-flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 8px; }
.cl-flow > div { background: var(--surface-2); border-radius: var(--r, 4px); padding: 8px 10px; display: flex; flex-direction: column; }
.cl-flow span { font-size: 12px; color: var(--muted); }
.cl-flow b { font-size: 16px; }
.cl-flow .owed { background: var(--bad-soft); }
.cl-flow .owed b { color: var(--bad); }
.cl-warn { margin: 0; display: flex; gap: 6px; align-items: center; color: var(--bad); font-size: 13.5px; }
.cl-closed summary { cursor: pointer; color: var(--muted); padding: 8px 0; }
.cl-h3 { font-size: 14px; margin: 16px 0 8px; }
.cl-ledger { display: flex; flex-direction: column; }
.cl-e { display: grid; grid-template-columns: 110px auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.cl-e.pending { background: var(--warn-soft); padding-inline: 8px; }
.cl-e.rejected { opacity: .55; text-decoration: line-through; }
@container (max-width: 640px) {
  .cl-row { grid-template-columns: minmax(0, 1fr) auto; }
  .cl-steps { order: 5; }
  .cl-act { grid-column: 1 / -1; justify-self: start; justify-content: flex-start; }
  .cl-top b { font-size: 20px; }
  .cl-e { grid-template-columns: 1fr auto; }
}
.cl-plan { display: inline-flex; gap: 3px; }
.cl-plan i { width: 14px; height: 6px; border-radius: 2px; background: var(--line); }
.cl-plan i.on { background: var(--ok); }
.cl-plan i.late { background: var(--bad); }
.cl-preview { margin-top: 10px; padding: 10px 12px; background: var(--surface-2); border-radius: var(--r, 4px); }

.sub-t { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 6px; }
.fb-src { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.fb-who { display: flex; flex-direction: column; flex: 1 1 160px; min-width: 0; overflow-wrap: anywhere; }


/* =====================================================================
   "Studio" (1.11, the owner's call: "young, but business people").
   Replaces Gallery's white cube. A deep aubergine-navy rail anchors the
   business side; electric indigo, soft rounded surfaces and Rubik headlines
   carry the young side. Emerald = money in, coral = needs you now.
   ===================================================================== */
:root {
  --font: "Heebo", "Segoe UI", Arial, sans-serif; --display: "Rubik", "Heebo", Arial, sans-serif;
  --bg: #dddbe8; --surface: #efedf5; --surface-2: #e5e3ee;
  --ink: #17142e; --ink-2: #37334f; --muted: #5c5874;
  --line: #d2cfdf; --line-2: #bcb8cf;
  --accent: #4a37f5; --accent-ink: #fff; --accent-soft: #ecebff; --accent-line: #c3bdfb;
  --rail: #17142e; --rail-2: #262243; --rail-ink: #c6c3dc;
  --ok: #067a56; --ok-soft: #dcf6ec; --warn: #9a5b00; --warn-soft: #fdf0d9; --bad: #d12c3f; --bad-soft: #fdeaed;
  --hot: #ff5a5f; --info: #4a37f5; --info-soft: #ecebff;
  --gold-wash: #4a37f5;
  --r: 14px; --r-sm: 10px;
  --shadow: 0 1px 2px rgb(23 20 46 / .05), 0 6px 20px rgb(23 20 46 / .05);
  --shadow-lg: 0 18px 50px rgb(23 20 46 / .22);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #100e20; --surface: #1a1730; --surface-2: #231f3d; --ink: #f2f1f8; --ink-2: #d5d2e4; --muted: #9c98b4;
  --line: #2c2847; --line-2: #3d3860; --accent: #9d93ff; --accent-ink: #15122b; --accent-soft: #2a2559; --accent-line: #4a4391;
  --rail: #0b0a18; --rail-2: #1d1a35; --rail-ink: #b5b1cc; --hot: #ff7b7f;
  --ok: #4fdbab; --ok-soft: #10302a; --warn: #f2c063; --warn-soft: #2e2613; --bad: #ff8592; --bad-soft: #3a1820;
  --info: #9d93ff; --info-soft: #2a2559; --gold-wash: #3a2ad0;
  --shadow: 0 1px 2px rgb(0 0 0 / .3);
} }
h1 { font: 800 32px/1.12 var(--display); letter-spacing: -.02em; }
h2, .sec-h h2 { font-family: var(--display); font-weight: 600; letter-spacing: -.005em; }
.main { padding: 30px 40px 72px; max-width: 1240px; }

/* rail */
.side { background: var(--rail); border: 0; color: var(--rail-ink); padding: 22px 14px; }
[hidden] { display: none !important; }
.brand { color: var(--ink); font: 700 21px var(--display); letter-spacing: -.01em; }
.brand small { color: var(--muted); font: 400 12px var(--font); }
.side .brand { color: #fff; }
.side .brand small { color: var(--rail-ink); }
.brand .mark { width: 36px; height: 36px; border-radius: 11px; background: var(--accent); color: #fff; font: 700 20px var(--display); }
.nav a { color: var(--rail-ink); border-radius: 11px; min-height: 44px; font-weight: 500; }
.nav a:hover { background: var(--rail-2); color: #fff; }
.nav a[aria-current="page"], .nav a[aria-current="page"] svg.i { background: #fff; color: var(--ink); font-weight: 700; box-shadow: none; }
.nav a[aria-current="page"] svg.i { background: none; color: var(--accent); }
.nav .count, .nav a[aria-current="page"] .count { background: var(--hot); color: #fff; border-radius: 99px; font-weight: 700; }
.side .foot, .side .foot a, .side .foot button, .me { color: var(--rail-ink); }
.side .me { background: var(--rail-2); color: #fff; }
.side .me * { color: inherit; }
.side .me .muted, .side .me small { color: var(--rail-ink); }
.side .me .btn, .side .me button { background: transparent; border-color: transparent; color: var(--rail-ink); }
.side .me .avatar { background: var(--accent); color: #fff; }
.gold .gold-item .btn:not(.primary):not(.ghost) { background: transparent; border-color: rgb(255 255 255 / .6); color: #fff; }
.gold .gold-item .btn:not(.primary):not(.ghost):hover { background: rgb(255 255 255 / .12); color: #fff; border-color: #fff; }
.side .foot a:hover, .side .foot button:hover { background: var(--rail-2); color: #fff; }

/* controls */
.btn, .btn.sm, .seg, .input, select.input, .search .input { border-radius: var(--r-sm); }
.btn { font-weight: 600; }
.btn:not(.primary):not(.ghost) { border-color: var(--line-2); background: var(--surface); }
.btn:not(.primary):not(.ghost):hover { border-color: var(--accent); color: var(--accent); background: var(--surface); }
.btn.primary { background: var(--accent); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.1); }
.input, select.input { border-color: var(--line-2); }
.seg { background: var(--surface-2); border-color: transparent; padding: 3px; }
.seg button { border-radius: 8px; min-height: 30px; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--accent); font-weight: 700; box-shadow: var(--shadow); }
.pill, .chip { border-radius: 99px; }
.avatar, .client-head .avatar { border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.avatar[data-c] { background: var(--accent-soft); color: var(--accent); }
.handler.human, .next { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); color: var(--ink); }
.tabs a[aria-current="page"] { border-color: var(--accent); color: var(--accent); font-weight: 700; }

/* surfaces: soft cards instead of ruled lines */
.card, .list, .goal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.today { gap: 22px; }
.today section:not(.gold) { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px 18px 8px; scroll-margin-top: 16px; }
.today section .list { border: 0; box-shadow: none; background: none; border-radius: 0; }
.sec-h { border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.sec-h h2 { font-size: 16px; color: var(--ink); }
.sec-h .count { font: 700 14px var(--display); color: var(--accent); background: var(--accent-soft); border-radius: 99px; padding: 1px 10px; }
.list > .item:last-child { border-bottom: 0; }
a.item:hover { background: var(--surface-2); }

/* the home pulse: where the day stands, one tap to each list */
.pulse { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.tile { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 10px; padding: 14px 16px; min-height: 92px; text-align: start; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); transition: transform var(--t), border-color var(--t); }
.tile:hover { transform: translateY(-2px); border-color: var(--accent); }
.tile b { font: 800 32px/1 var(--display); letter-spacing: -.02em; color: var(--ink); grid-row: 1; grid-column: 1; }
.tile > span:last-child { grid-column: 1 / -1; color: var(--muted); font-size: 14px; }
.tile-ic { grid-row: 1; grid-column: 2; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: var(--accent-soft); color: var(--accent); }
.tile.hot .tile-ic { background: var(--bad-soft); color: var(--hot); }
.tile.hot b { color: var(--hot); }

/* money: the month's target is the banner of the business */
.goal { background: var(--rail); color: #fff; border: 0; padding: 22px 24px 18px; }
.goal-label, .goal-num span, .goal-legend { color: var(--rail-ink); }
.goal-num b { color: #fff; font: 800 36px var(--display); }
.goal-side > b { color: #fff; font-family: var(--display); }
.goal-bar { background: var(--rail-2); }
.goal-bar i.in, .goal-legend i.in { background: #2ee6a6; }
.goal-bar i.way, .goal-legend i.way { background: #8378ff; }
.goal .btn:not(.primary) { background: transparent; color: #fff; border-color: #5d5880; }
.goal a { color: #fff; }

/* the free window keeps its field, softer */
.gold { border-radius: var(--r); box-shadow: var(--shadow); }
.gold .btn.gold-go { border-radius: var(--r-sm); color: var(--gold-wash); }
.ring b, .gold-who .title, .cs-name, .odds-score b { font-family: var(--display); }
.odds-act { border-color: var(--line); }
.lend-h { border-bottom-color: var(--line); }
.bubble.out { background: var(--accent); }
.call-sheet { border-color: var(--line); }

/* phones */
@media (max-width: 860px) {
  h1 { font-size: 25px; }
  .main { padding: 18px 16px 96px; }
  .pulse { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
  .tile { min-height: 82px; padding: 12px 14px; }
  .tile b { font-size: 26px; }
  .tabbar { background: var(--rail); border-top: 0; }
  .tabbar a { color: var(--rail-ink); }
  .tabbar a[aria-current="page"], .tabbar a[aria-current="page"] svg.i { color: #fff; }
}
@media (prefers-reduced-motion: reduce) { .tile { transition: none; } .tile:hover { transform: none; } }
/* service keys */
.keys { border-bottom: 1px solid var(--line); padding: 0 18px; }
.keys:last-child { border-bottom: 0; }
.keys summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; cursor: pointer; list-style: none; }
.keys summary::-webkit-details-marker { display: none; }
.keys form { padding-bottom: 14px; }