/* Gravel app: client dashboard, admin and the website editor share this file.
   Same brand as gravel.site: Saddle brown on snow, Schibsted Grotesk + Geist + Geist Mono.
   Light only, on purpose (Theo, 6 Oct: "lighter and easier to look, clean, lean, simple").
   The one signature: the navigation sits on a real stone photo, and the selected item is a pane of glass on it
   (glass only ever sits on stone, as on the marketing site). Everything else is calm paper and hairlines. */
:root {
  --snow: #FAFAF8; --paper: #FFFFFF; --canvas: #F2EFEB;
  --stone-50: #F5F4F1; --stone-100: #EFEDE9; --stone-200: #E2DED8; --stone-300: #CFC9C1;
  --ink: #1C1612; --ink-2: #4A423C; --ink-3: #6E655D;
  --line: #E7E2DC; --line-2: #D8D1C9;
  --brown: #55331F; --brown-2: #6A4129; --brown-deep: #3E2516; --brown-900: #22150D;
  --brown-500: #8A5632; --brown-tint: #F3ECE6; --brown-tint-2: #EADCCF; --tan: #D7B08A;
  --good: #2F7A4F; --good-tint: #E6F1EA; --warn: #A65D0D; --warn-tint: #FCF1E1; --bad: #B3261E; --bad-tint: #FBEAE8;
  --info: #35597A; --info-tint: #E8EEF4; --star: #B98530;
  --display: "Schibsted Grotesk", "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --body: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --r: 14px; --r-sm: 10px; --r-xs: 8px;
  --sh-1: 0 1px 2px rgba(28, 22, 18, .05);
  --sh-2: 0 1px 2px rgba(28, 22, 18, .05), 0 12px 28px -18px rgba(28, 22, 18, .28);
  --sh-3: 0 2px 6px rgba(28, 22, 18, .08), 0 28px 60px -28px rgba(28, 22, 18, .45);
  --ease: cubic-bezier(.22, .7, .2, 1);
  --rail: 236px;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--snow); color: var(--ink); font: 400 15px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--display); letter-spacing: -.02em; line-height: 1.15; margin: 0; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
svg.i { width: 18px; height: 18px; flex: none; display: block; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: .02em; }
.label { font: 500 11px/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.muted { color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--brown-500); outline-offset: 2px; border-radius: 6px; }

/* ---------- the stone rail (desktop) and tab bar (phone) ---------- */
.shell { min-height: 100vh; }
.rail {
  position: fixed; inset: 0 auto 0 0; width: var(--rail); z-index: 30; display: flex; flex-direction: column;
  padding: 18px 14px 16px; color: #F6EEE6; isolation: isolate; overflow: hidden;
  background: #2A1B12 url(img/rail-stone.webp) center / cover no-repeat;
}
.rail::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(30, 18, 11, .62), rgba(30, 18, 11, .78) 45%, rgba(24, 14, 8, .9)); }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; text-decoration: none; color: #FFF7EF; }
.brand svg { width: 30px; height: 30px; }
.brand b { font: 800 20px/1 var(--display); letter-spacing: -.03em; }
.brand small { font: 500 10.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: rgba(255, 240, 225, .62); margin-left: auto;
  border: 1px solid rgba(255, 240, 225, .25); padding: 4px 6px; border-radius: 6px; }
.nav { display: grid; gap: 2px; }
.nav a { position: relative; display: flex; align-items: center; gap: 11px; height: 42px; padding: 0 12px; border-radius: 12px;
  text-decoration: none; color: rgba(255, 244, 234, .80); font-weight: 500; font-size: 14.5px; transition: color .2s, background .2s; }
.nav a:hover { color: #FFF; background: rgba(255, 245, 235, .07); }
.nav a .count { margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center;
  font: 600 11.5px/1 var(--mono); background: var(--tan); color: var(--brown-900); }
/* the selected item: a pane of glass resting on the stone */
.nav a[aria-current="page"] { color: var(--brown-900); font-weight: 600;
  background: linear-gradient(180deg, rgba(255, 252, 248, .90), rgba(250, 244, 237, .82));
  -webkit-backdrop-filter: blur(12px) saturate(150%); backdrop-filter: blur(12px) saturate(150%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), inset 0 -1px 0 rgba(60, 35, 20, .18), 0 1px 2px rgba(0, 0, 0, .25), 0 10px 22px -12px rgba(0, 0, 0, .7); }
.nav a[aria-current="page"] svg { color: var(--brown); }
.nav .sep { height: 1px; margin: 10px 8px; background: rgba(255, 240, 225, .14); }
.rail-foot { margin-top: auto; display: grid; gap: 10px; }
.biz { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; background: rgba(255, 245, 235, .07);
  border: 1px solid rgba(255, 240, 225, .12); text-decoration: none; }
.biz .av { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font: 700 13px/1 var(--display);
  background: var(--tan); color: var(--brown-900); flex: none; }
.biz b { display: block; font-size: 13.5px; color: #FFF7EF; line-height: 1.25; }
.biz small { display: block; font-size: 12px; color: rgba(255, 240, 225, .66); }
.help { font-size: 12.5px; color: rgba(255, 240, 225, .7); padding: 0 8px; }
.help a { color: #FFF3E6; text-underline-offset: 3px; }
.signout { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 0; border-radius: 10px; background: none; color: rgba(255, 240, 225, .72);
  font: 500 12.5px/1 var(--body); cursor: pointer; text-align: left; }
.signout svg { width: 16px; height: 16px; }
.signout:hover { background: rgba(255, 245, 235, .08); color: #FFF7EF; }

.main { margin-left: var(--rail); min-height: 100vh; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 30px clamp(18px, 3vw, 40px) 64px; }
.proto { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: center; gap: 8px; height: 30px;
  font: 500 11.5px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--brown-deep);
  background: var(--brown-tint); border-bottom: 1px solid var(--brown-tint-2); }
.proto a { text-underline-offset: 3px; }

.topbar { display: none; }
.tabbar { display: none; }
@media (max-width: 860px) {
  .rail { display: none; }
  .main { margin-left: 0; padding-bottom: 84px; }
  .wrap { padding-top: 18px; }
  .topbar { display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 16px; position: sticky; top: 30px; z-index: 19;
    background: rgba(250, 250, 248, .92); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
  .no-proto .topbar { top: 0; }
  .topbar .brand { padding: 0; color: var(--ink); }
  .topbar .brand b { font-size: 18px; }
  .topbar .brand svg { width: 26px; height: 26px; }
  .topbar .who { margin-left: auto; font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
  .topbar .who .av { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font: 700 12px/1 var(--display); background: var(--brown); color: #FFF5EC; }
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom));
    z-index: 30; height: 64px; padding: 6px; border-radius: 22px; isolation: isolate; overflow: hidden;
    background: #2A1B12 url(img/band-stone.webp) center / cover; box-shadow: 0 18px 40px -18px rgba(20, 10, 4, .8); }
  .tabbar::before { content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(30, 18, 11, .66); }
  .tabbar a { display: grid; place-items: center; align-content: center; gap: 3px; border-radius: 16px; text-decoration: none;
    color: rgba(255, 244, 234, .78); font: 500 10.5px/1 var(--body); position: relative; }
  .tabbar a svg { width: 20px; height: 20px; }
  .tabbar a[aria-current="page"] { color: var(--brown-900); font-weight: 600;
    background: linear-gradient(180deg, rgba(255, 252, 248, .92), rgba(250, 244, 237, .84));
    box-shadow: inset 0 1px 0 #fff, 0 6px 16px -10px rgba(0, 0, 0, .8); }
  .tabbar a .dot { position: absolute; top: 7px; right: calc(50% - 16px); width: 8px; height: 8px; border-radius: 50%; background: var(--tan); box-shadow: 0 0 0 2px #2A1B12; }
}

/* ---------- page header ---------- */
.ph { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.ph h1 { font-size: clamp(26px, 3.2vw, 34px); font-weight: 750; }
.ph p { color: var(--ink-2); margin-top: 6px; }
.ph .acts { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--ink-2); flex-wrap: wrap; }
.status .live { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px 0 7px; border-radius: 999px;
  background: var(--good-tint); color: var(--good); font-weight: 600; font-size: 12.5px; }
.status .live svg { width: 14px; height: 14px; }
.status a { color: var(--ink); text-underline-offset: 3px; }

/* ---------- buttons ---------- */
.btn { --h: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--h); padding: 0 16px;
  border-radius: 11px; border: 1px solid var(--line-2); background: var(--paper); color: var(--ink); font-weight: 550; font-size: 14px;
  text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s, transform .1s; box-shadow: var(--sh-1); }
.btn:hover { border-color: var(--stone-300); background: var(--stone-50); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brown); border-color: var(--brown); color: #FFF7EF;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 1px 2px rgba(34, 21, 13, .3), 0 8px 18px -10px rgba(85, 51, 31, .7); }
.btn.primary:hover { background: var(--brown-2); border-color: var(--brown-2); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--stone-100); }
.btn.danger { color: var(--bad); }
.btn.sm { --h: 32px; padding: 0 11px; font-size: 13px; border-radius: 9px; }
.btn.lg { --h: 48px; padding: 0 20px; font-size: 15px; border-radius: 13px; }
.btn.icon { width: var(--h); padding: 0; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.btn .badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center; font: 600 11.5px/1 var(--mono);
  background: rgba(255, 245, 235, .2); }
.linkish { background: none; border: 0; padding: 0; color: var(--brown-500); font-weight: 550; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- cards, tiles ---------- */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-1); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 16px 18px 0; }
.card-h h2 { font-size: 16.5px; font-weight: 700; }
.card-h .more { margin-left: auto; font-size: 13px; color: var(--brown-500); font-weight: 550; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.card-b { padding: 14px 18px 18px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-main { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .g2, .g3 { grid-template-columns: 1fr; } }
.tile { padding: 16px 16px 14px; display: flex; flex-direction: column; gap: 4px; position: relative; overflow: hidden; }
.tile .k { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-2); font-weight: 500; }
.tile .k svg { width: 16px; height: 16px; color: var(--brown-500); }
.tile .v { font: 750 30px/1.05 var(--display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; margin-top: auto; padding-top: 6px; }
.tile .d { font-size: 12.5px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.tile:has(.spark) .d { padding-right: 96px; }
@media (max-width: 560px) { .tile:has(.spark) .d { padding-right: 0; } }
.tile .d .up { color: var(--good); font-weight: 600; }
.tile .d .down { color: var(--bad); font-weight: 600; }
.tile .spark { position: absolute; right: 14px; bottom: 16px; width: 84px; height: 30px; }
@media (max-width: 560px) { .tile .spark { display: none; } }
.tile.locked { background: repeating-linear-gradient(135deg, var(--stone-50) 0 8px, #FFF 8px 16px); }
.tile.locked .v { font-size: 15px; font-family: var(--body); font-weight: 600; color: var(--ink-2); letter-spacing: 0; }

/* attention list */
.attn { display: grid; }
.attn > div { display: flex; align-items: center; gap: 12px; padding: 13px 18px; border-top: 1px solid var(--line); }
.attn > div:first-child { border-top: 0; }
.attn .ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.attn .ic svg { width: 17px; height: 17px; }
.attn .warn .ic { background: var(--warn-tint); color: var(--warn); }
.attn .bad .ic { background: var(--bad-tint); color: var(--bad); }
.attn .info .ic { background: var(--info-tint); color: var(--info); }
.attn .good .ic { background: var(--good-tint); color: var(--good); }
.attn .tx { min-width: 0; flex: 1; }
.attn .tx b { display: block; font-weight: 600; font-size: 14.5px; }
.attn .tx span { display: block; font-size: 13px; color: var(--ink-3); }
.attn .btn { flex: none; }

/* pills & chips */
.pill { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  white-space: nowrap; background: var(--stone-100); color: var(--ink-2); }
.pill svg { width: 13px; height: 13px; }
.pill.good { background: var(--good-tint); color: var(--good); }
.pill.warn { background: var(--warn-tint); color: var(--warn); }
.pill.bad { background: var(--bad-tint); color: var(--bad); }
.pill.info { background: var(--info-tint); color: var(--info); }
.pill.brown { background: var(--brown-tint); color: var(--brown); }
.pill.dark { background: var(--brown); color: #FFF5EC; }
.pill.ghost { background: transparent; border: 1px solid var(--line-2); }
.plan { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px 0 6px; border-radius: 7px; font: 600 11.5px/1 var(--body); }
.plan svg { width: 14px; height: 14px; }
.plan.pebble { background: var(--stone-100); color: var(--ink-2); }
.plan.gravel { background: linear-gradient(180deg, #4B2D1B, #2E1B10); color: #F3DEC8; }

/* lists */
.rows { display: grid; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line); text-decoration: none; color: inherit; min-width: 0; }
.rows .row:first-child { border-top: 0; }
a.row:hover, button.row:hover { background: var(--stone-50); }
button.row { width: 100%; border: 0; background: none; text-align: left; cursor: pointer; font: inherit; }
.row .av { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: none; font: 700 13px/1 var(--display); background: var(--stone-100); color: var(--ink-2); }
.row .av svg { width: 18px; height: 18px; }
.row .av.missed { background: var(--warn-tint); color: var(--warn); }
.row .av.form { background: var(--info-tint); color: var(--info); }
.row .av.text { background: var(--brown-tint); color: var(--brown); }
.row .av.call { background: var(--good-tint); color: var(--good); }
.row .tx { min-width: 0; flex: 1; }
.row .tx b { display: block; font-weight: 600; font-size: 14.5px; }
.row .tx > span { display: block; font-size: 13px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 560px) {
  .row { align-items: flex-start; }
  .row .tx > span { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .row .end { flex-direction: column; align-items: flex-end; gap: 6px; }
}
.row .when { font: 500 12px/1 var(--mono); color: var(--ink-3); white-space: nowrap; }
.row .end { display: flex; align-items: center; gap: 8px; flex: none; }

/* tables */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font: 500 11px/1 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { cursor: pointer; }
.tbl tbody tr:hover td { background: var(--stone-50); }
.tbl .biz-cell { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.tbl .biz-cell .av { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font: 700 12px/1 var(--display); background: var(--stone-100); color: var(--ink-2); flex: none; }
.tbl .biz-cell b { display: block; font-weight: 600; }
.tbl .biz-cell small { display: block; color: var(--ink-3); font-size: 12.5px; }
.tbl .r { text-align: right; }

/* forms */
.field { display: grid; gap: 6px; }
.field > span, .field > label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field small { font-size: 12.5px; color: var(--ink-3); }
.input, .select, .textarea { width: 100%; height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--paper);
  transition: border-color .15s, box-shadow .15s; font-size: 14.5px; }
.textarea { height: auto; min-height: 92px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
.input:disabled { background: var(--stone-100); color: var(--ink-3); border-color: var(--line); cursor: not-allowed; }
.input:focus, .select:focus, .textarea:focus { outline: 0; border-color: var(--brown-500); box-shadow: 0 0 0 3px rgba(138, 86, 50, .16); }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 11px; background: var(--stone-100); border: 1px solid var(--line); }
.seg button { height: 30px; padding: 0 12px; border-radius: 8px; border: 0; background: none; font-size: 13px; font-weight: 550; color: var(--ink-2); white-space: nowrap; flex: none;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.seg button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: var(--sh-1), 0 0 0 1px var(--line); }
.seg button svg { width: 16px; height: 16px; }
.switch { position: relative; width: 40px; height: 24px; flex: none; }
.switch input { position: absolute; inset: -10px; width: auto; height: auto; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--stone-300); transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #FFF; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); transition: transform .2s var(--ease); }
.switch input:checked + span { background: var(--brown); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--brown-500); outline-offset: 2px; }
.switch input:disabled + span { opacity: .5; }

/* toggle rows */
.tog { display: flex; align-items: center; gap: 12px; padding: 12px 2px; border-top: 1px solid var(--line); }
.tog:first-of-type { border-top: 0; }
.tog .t { flex: 1; min-width: 0; }
.tog b { display: block; font-weight: 600; font-size: 14.5px; }
.tog small { display: block; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tog .lockt { font-size: 12px; color: var(--ink-3); display: inline-flex; gap: 4px; align-items: center; }
.tog .lockt svg { width: 13px; height: 13px; }

/* toast */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 10px 8px 14px; border-radius: 13px;
  background: var(--brown-900); color: #FFF5EC; font-size: 14px; box-shadow: var(--sh-3); animation: toast-in .35s var(--ease); max-width: min(560px, calc(100vw - 32px)); }
.toast svg { width: 17px; height: 17px; color: var(--tan); flex: none; }
.toast a, .toast button { color: #FFE9D4; font-weight: 600; background: none; border: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; padding: 0 4px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@media (max-width: 860px) { .toasts { bottom: 92px; left: 16px; right: 16px; transform: none; } .toast { max-width: none; } .btn.sm { --h: 40px; } }

/* modal / sheet / drawer */
.scrim { position: fixed; inset: 0; z-index: 80; background: rgba(28, 18, 12, .38); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  display: grid; place-items: center; padding: 20px; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(620px, 100%); max-height: min(86vh, 900px); display: flex; flex-direction: column; background: var(--paper); border-radius: 20px;
  box-shadow: var(--sh-3); overflow: hidden; animation: pop .3s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.modal-h { padding: 20px 22px 8px; display: flex; align-items: flex-start; gap: 12px; }
.modal-h h2 { font-size: 21px; font-weight: 750; }
.modal-h p { color: var(--ink-2); font-size: 14px; margin-top: 4px; }
.modal-h .x { margin-left: auto; }
.modal-b { padding: 8px 22px 16px; overflow: auto; }
.modal-f { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; background: var(--snow); flex-wrap: wrap; }
@media (max-width: 640px) {
  .scrim { place-items: end center; padding: 0; }
  .modal { width: 100%; border-radius: 22px 22px 0 0; max-height: 92vh; animation: up .3s var(--ease); }
  @keyframes up { from { transform: translateY(30px); opacity: .5; } }
}
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 100%); z-index: 81; background: var(--paper); box-shadow: var(--sh-3);
  display: flex; flex-direction: column; animation: slide .3s var(--ease); }
@keyframes slide { from { transform: translateX(24px); opacity: .4; } }
.drawer-h { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.drawer-h h2 { font-size: 18px; font-weight: 700; }
.drawer-b { padding: 16px 18px; overflow: auto; flex: 1; display: grid; gap: 16px; align-content: start; }
.drawer-f { padding: 14px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; flex-wrap: wrap; }

/* timeline (lead conversation, history) */
.tl { display: grid; gap: 0; position: relative; }
.tl > div { display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding-bottom: 16px; position: relative; }
.tl > div::before { content: ""; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: var(--line); }
.tl > div:last-child::before { display: none; }
.tl .dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--stone-100); color: var(--ink-2); }
.tl .dot svg { width: 14px; height: 14px; }
.tl .b { padding-top: 3px; }
.tl .b b { font-weight: 600; font-size: 14px; }
.tl .b .when { font: 500 11.5px/1 var(--mono); color: var(--ink-3); margin-left: 6px; }
.bubble { margin-top: 6px; padding: 10px 12px; border-radius: 4px 14px 14px 14px; background: var(--stone-100); font-size: 14px; line-height: 1.45; max-width: 46ch; }
.bubble.us { background: var(--brown-tint); border-radius: 14px 4px 14px 14px; }

/* empty states */
.empty { padding: 34px 20px; text-align: center; color: var(--ink-3); display: grid; justify-items: center; gap: 10px; }
.empty svg { width: 34px; height: 34px; color: var(--stone-300); }

/* filters bar */
.bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.bar .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.bar .seg::-webkit-scrollbar { display: none; }
.bar .search { position: relative; flex: 1; min-width: 200px; max-width: 360px; }
.only-m { display: none; }
@media (max-width: 760px) { .only-d { display: none !important; } .only-m { display: block; } }
.bar .search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--ink-3); }
.bar .search input { padding-left: 36px; height: 38px; }

/* charts */
.chart { width: 100%; height: 160px; display: block; }
.chart text { font: 500 10.5px var(--mono); fill: var(--ink-3); }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; font-size: 14px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }

.thumb { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--stone-100); aspect-ratio: 16 / 10; }
.thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.thumb .tag { position: absolute; left: 10px; top: 10px; }

.upsell { position: relative; overflow: hidden; border-radius: var(--r); color: #FBEFE3; isolation: isolate; padding: 18px;
  background: #2A1B12 url(img/band-stone.webp) center / cover; }
.upsell::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(120deg, rgba(34, 21, 13, .9), rgba(34, 21, 13, .62)); }
.upsell h3 { font-size: 18px; color: #FFF6EC; }
.upsell p { color: rgba(251, 239, 227, .82); font-size: 14px; margin-top: 6px; max-width: 46ch; }
.upsell ul { margin: 12px 0 14px; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 14px; }
.upsell li { display: flex; gap: 8px; align-items: center; }
.upsell li svg { width: 16px; height: 16px; color: var(--tan); }
.upsell .btn { background: #FFF6EC; color: var(--brown-900); border-color: #FFF6EC; }

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

/* ---------------------------------------------------------------- sign-in pages: real stone on the left, a quiet form */
body.auth { min-height: 100vh; min-height: 100dvh; background: var(--snow); }
.auth-wrap { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(340px, 42%) 1fr; }
.auth-stone { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 34px 36px 40px;
  background: linear-gradient(180deg, rgba(20, 12, 7, .25), rgba(20, 12, 7, .05) 40%, rgba(20, 12, 7, .55)), #2A1B12 url(img/auth-stone.webp) center / cover no-repeat; }
.auth-mark { display: inline-flex; align-items: center; gap: 10px; color: #FFF7EF; }
.auth-mark svg { width: 34px; height: 34px; }
.auth-mark b { font: 800 22px/1 var(--display); letter-spacing: -.03em; }
.auth-line { align-self: flex-start; margin: 0; max-width: 360px; padding: 16px 20px; border-radius: 20px; color: #FFF7EF; font: 650 22px/1.25 var(--display); letter-spacing: -.02em;
  background: linear-gradient(180deg, rgba(40, 25, 16, .62), rgba(20, 12, 8, .74)); -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%);
  box-shadow: inset 0 1px 0 rgba(255, 228, 200, .3), inset 0 -1px 0 rgba(0, 0, 0, .4), inset 0 0 0 1px rgba(255, 236, 216, .1), 0 18px 40px -20px rgba(8, 5, 3, .8); }
.auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 40px 24px; }
.auth-card { width: min(400px, 100%); }
.auth-card h1 { font-size: 28px; font-weight: 750; }
.auth-sub { margin: 8px 0 22px; color: var(--ink-2); font-size: 15px; }
.auth-note { margin: -8px 0 18px; padding: 10px 12px; border-radius: 10px; background: var(--brown-tint); color: var(--brown-deep); font-size: 13.5px; }
.auth-form { display: grid; gap: 14px; }
.lab-row { display: flex; align-items: baseline; justify-content: space-between; }
.lab-row label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.lnk, .auth-alt a { color: var(--brown-500); font-weight: 550; font-size: 13px; text-underline-offset: 3px; }
.pw { position: relative; }
.pw .input { padding-right: 46px; }
.pw .eye { position: absolute; right: 4px; top: 4px; width: 36px; height: 34px; border: 0; border-radius: 8px; background: none; color: var(--ink-3); cursor: pointer; display: grid; place-items: center; }
.pw .eye:hover { background: var(--stone-100); color: var(--ink); }
.pw .eye svg { width: 18px; height: 18px; }
.input[data-code] { font: 600 22px/1 var(--mono); letter-spacing: .3em; text-align: center; height: 52px; }
.btn.block { width: 100%; }
.auth-ts:empty { display: none; }
.auth-err { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--bad-tint); color: var(--bad); font-size: 13.5px; font-weight: 500; }
.auth-or { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--ink-3); font-size: 12.5px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.btn.google svg { width: 18px; height: 18px; }
.auth-alt { margin: 18px 0 0; font-size: 13.5px; color: var(--ink-3); text-align: center; }
.auth-foot { margin: 0; font-size: 12.5px; color: var(--ink-3); text-align: center; }
.auth-foot a { color: var(--ink-2); text-underline-offset: 3px; }
.auth-ic { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; margin-bottom: 14px; background: var(--brown-tint); color: var(--brown); }
.auth-ic.good { background: var(--good-tint); color: var(--good); }
.auth-ic svg { width: 22px; height: 22px; }
.auth-steps { margin: 8px 0 14px; padding-left: 20px; color: var(--ink-2); font-size: 14.5px; display: grid; gap: 6px; }
.auth-qr:empty { display: none; }
.auth-qr { display: grid; place-items: center; padding: 14px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.auth-key { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; border-radius: 12px; background: var(--stone-100); }
.auth-key code { flex: 1; font: 600 14px/1.4 var(--mono); letter-spacing: .06em; word-break: break-all; }
.auth-manual { margin: 0 0 16px; font-size: 14px; }
.auth-manual summary { cursor: pointer; color: var(--brown-500); font-weight: 550; font-size: 13.5px; }
.auth-codes { list-style: none; margin: 0 0 14px; padding: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; border-radius: 14px; background: var(--stone-100); }
.auth-codes code { font: 600 14px/1.3 var(--mono); letter-spacing: .04em; }
.auth-row { display: flex; gap: 8px; }
@media (max-width: 860px) {
  .auth-wrap { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .auth-stone { min-height: 150px; padding: 22px 20px; background-image: linear-gradient(180deg, rgba(20, 12, 7, .2), rgba(20, 12, 7, .55)), url(img/auth-stone-band.webp); }
  .auth-line { display: none; }
  .auth-main { justify-content: flex-start; padding: 28px 18px 32px; }
  .auth-card h1 { font-size: 25px; }
}
