/* boosting.expert prototype — design tokens + components.
   Tokens are the contract for the build session (see ../../README.md).
   ONE theme, not switchable (owner 15.10: "same as in CRM, non switchable"):
   the CRM's Discord theme (dc) — values from crm.css html[data-crm-theme="dc"] and the app's
   sidebar.css :root[data-theme="dc"]. No light theme, no prefers-color-scheme branch. */

:root {
  /* palette — CRM Discord (dc) */
  --bg: #36393F;              /* CRM --bg / --page */
  --surface: #2F3136;         /* CRM --surf / --card, sidebar */
  --surface-2: #202225;       /* inputs, CRM header (.crm-top), bottom nav */
  --surface-3: #40444B;       /* hover / selected row (--row-sel) */
  --border: #202225;          /* CRM --line */
  --border-2: #42464D;        /* CRM --line2 / --sep */
  --text: #DCDDDE;            /* CRM --tx, 9.2:1 on --bg */
  --text-muted: #B9BBBE;      /* CRM --mut, 6.6:1 on --bg */
  --text-dim: #9EA2A8;        /* CRM --dim */
  --accent: #7289DA;          /* blurple: fills only (bars, borders, rings), 3.9:1, never text */
  --accent-ink: #99AAF5;      /* blurple as text / links on dark (app --acc-ink) */
  --accent-soft: rgba(114, 137, 218, .16);
  --btn: #5B6EAE;             /* primary button: dark blurple, white text 4.8:1 (app --btn) */
  --btn-hover: #4E5F9E;
  --btn-press: #44528A;
  --btn-2: #4F545C;           /* secondary button, Discord grey (crm .crm-b) */
  --btn-2-hover: #5D6269;
  --ghost-hover: rgba(79, 84, 92, .32);
  --selected: rgba(79, 84, 92, .6); /* selected tab / nav (crm .crm-tab.is-on) */
  --on-accent: #FFFFFF;
  --ok: #7FCDA9;              /* CRM --t-ok-tx (text) */
  --ok-fill: #43B581;         /* Discord green: switch on */
  --ok-soft: #334944;
  --danger: #F79E9E;          /* CRM --bad-tx */
  --danger-fill: #F04747;
  --danger-soft: #523539;     /* CRM --bad-bg */
  --warn: #FCC263;            /* CRM --warn-tx */
  --warn-fill: #FAA61A;
  --warn-soft: #584930;
  --info: #63CFF9;            /* CRM --info-tx */
  --info-soft: #264859;
  --violet: #B0BDEB;          /* CRM --ind-tx (indigo) */
  --violet-soft: #3B4154;
  --neutral-soft: #40444B;
  --badge: #D83C3E;           /* CRM --t-badge, white digits */
  --focus: #00B0F4;           /* CRM --t-focus */
  --shadow: 0 8px 24px rgba(0, 0, 0, .4);
  --scrim: rgba(0, 0, 0, .7);

  /* status → colour (used by .badge[data-s]); same families as the CRM */
  --s-assigned: var(--info);      --s-assigned-bg: var(--info-soft);
  --s-handed: var(--violet);      --s-handed-bg: var(--violet-soft);
  --s-in_progress: var(--warn);   --s-in_progress-bg: var(--warn-soft);
  --s-done: var(--ok);            --s-done-bg: var(--ok-soft);
  --s-cancelled: var(--text-muted); --s-cancelled-bg: var(--neutral-soft);

  /* type — CRM dc --ff, plus Devanagari fallbacks for Hindi */
  --font: "Segoe UI", "gg sans", "Helvetica Neue", Roboto, Arial, "Noto Sans", "Noto Sans Devanagari", "Nirmala UI", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  --fs-xs: 12px; --fs-sm: 14px; --fs-md: 16px; --fs-lg: 18px; --fs-xl: 22px; --fs-2xl: 28px;
  --lh: 1.45;

  /* spacing (4-pt) + radius — Discord: 3–4 px controls, 8 px cards */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px;
  --r-sm: 3px; --r-md: 4px; --r-lg: 8px; --r-pill: 999px;

  /* layout */
  --tap: 44px;               /* mobile hit target */
  --topbar-h: 56px;
  --nav-h: 64px;
  --side-w: 236px;
  --content-max: 880px;
  --dur: 160ms;

  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: var(--fs-md)/var(--lh) var(--font);
  overflow-x: hidden; min-height: 100dvh;
}
:lang(hi) body, body:lang(hi) { line-height: 1.6; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: var(--fs-xl); font-weight: 700; }
h2 { font-size: var(--fs-lg); font-weight: 700; }
h3 { font-size: var(--fs-md); font-weight: 600; }
p { margin: 0; }
a { color: var(--accent-ink); }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--text-muted); }
.small { font-size: var(--fs-sm); }
.xs { font-size: var(--fs-xs); }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.stack > * + * { margin-top: var(--s3); }
.row { display: flex; align-items: center; gap: var(--s2); }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.hidden { display: none !important; }

/* ---------- app shell ---------- */
.app { min-height: 100dvh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--topbar-h);
  display: flex; align-items: center; gap: var(--s2); padding: 0 var(--s3);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border); box-shadow: 0 1px 0 rgba(4, 4, 5, .2), 0 2px 0 rgba(6, 6, 7, .05);
}
.topbar .title { font-size: var(--fs-lg); font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .brand-mini { width: 30px; height: 30px; flex: none; }
.main { flex: 1; width: 100%; max-width: var(--content-max); margin: 0 auto; padding: var(--s4) var(--s4) calc(var(--nav-h) + var(--s6) + env(safe-area-inset-bottom)); }

.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface-2); border-top: 1px solid var(--border);
}
.navlink {
  flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--text-muted); text-decoration: none; font-size: 11px; font-weight: 600; position: relative;
}
.navlink svg { width: 24px; height: 24px; }
.navlink span.lbl { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
.navlink[aria-current="page"] { color: #fff; }
.navlink .dot { position: absolute; top: 8px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--badge); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }

.sidenav { display: none; }

@media (min-width: 960px) {
  .app { flex-direction: row; }
  .sidenav {
    display: flex; flex-direction: column; gap: var(--s1); position: sticky; top: 0; height: 100dvh; width: var(--side-w); flex: none;
    padding: var(--s4) var(--s3); background: var(--surface); border-right: 1px solid var(--border);
  }
  .sidenav .brand { display: flex; align-items: center; gap: var(--s2); padding: var(--s2) var(--s2) var(--s5); font-weight: 800; font-size: var(--fs-lg); }
  .sidenav .brand img { width: 34px; height: 34px; }
  .sidenav .navlink { flex: none; flex-direction: row; justify-content: flex-start; gap: var(--s3); height: 44px; padding: 0 var(--s3); border-radius: var(--r-md); font-size: var(--fs-md); }
  .sidenav .navlink:hover { background: var(--ghost-hover); color: var(--text); }
  .sidenav .navlink[aria-current="page"] { background: var(--selected); }
  .sidenav .navlink .dot { position: static; margin-left: auto; }
  .sidenav .who { margin-top: auto; padding: var(--s3); border-top: 1px solid var(--border); font-size: var(--fs-sm); }
  .bottomnav { display: none; }
  .col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  .main { padding-bottom: var(--s8); }
  .topbar .brand-mini { display: none; }
}

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: var(--tap); padding: 0 var(--s4); border-radius: var(--r-md); border: 1px solid var(--border);
  background: var(--btn-2); color: #fff; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: background var(--dur), border-color var(--dur), transform var(--dur);
}
.btn:hover { background: var(--btn-2-hover); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn.primary { background: var(--btn); border-color: var(--btn); color: var(--on-accent); }
.btn.primary:hover { background: var(--btn-hover); border-color: var(--btn-hover); }
.btn.primary:active { background: var(--btn-press); }
.btn.danger { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text); }
.btn.ghost:hover { background: var(--ghost-hover); }
.btn.block { width: 100%; }
.btn.sm { min-height: 36px; padding: 0 var(--s3); font-size: var(--fs-sm); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.iconbtn { width: var(--tap); height: var(--tap); padding: 0; border-radius: var(--r-pill); flex: none; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: var(--fs-sm); font-weight: 600; color: var(--text-muted); }
.input, select.input, textarea.input {
  width: 100%; min-height: var(--tap); padding: 10px var(--s3); border-radius: var(--r-md);
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
}
textarea.input { min-height: 96px; resize: vertical; }
.input:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; }
.input[aria-invalid="true"] { border-color: var(--danger); }
.hint { font-size: var(--fs-xs); color: var(--text-muted); }
.err { font-size: var(--fs-sm); color: var(--danger); }

/* switch (role=switch button, one click acts on fresh state) */
.switch { position: relative; width: 48px; height: 28px; flex: none; border-radius: 14px; border: 0; background: var(--surface-3); cursor: pointer; padding: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform var(--dur); }
.switch[aria-checked="true"] { background: var(--ok-fill); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }
.switch[disabled] { opacity: .45; cursor: not-allowed; }

.seg { display: flex; padding: 3px; gap: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); }
.seg a, .seg button { flex: 1; min-height: 38px; display: flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 9px; background: transparent; color: var(--text-muted); font-weight: 600; text-decoration: none; cursor: pointer; font-size: var(--fs-sm); white-space: nowrap; padding: 0 var(--s2); }
.seg [aria-current="page"], .seg [aria-pressed="true"], .seg [aria-selected="true"] { background: var(--selected); color: #fff; }
.seg .count { min-width: 20px; height: 20px; border-radius: 10px; background: var(--btn-2); color: #fff; font-size: 11px; line-height: 20px; padding: 0 6px; }

.radio-list { display: flex; flex-direction: column; gap: var(--s2); }
.radio { display: flex; align-items: center; gap: var(--s3); min-height: var(--tap); padding: var(--s2) var(--s3); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); cursor: pointer; }
.radio input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; margin: 0; }
.radio:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.check { display: flex; gap: var(--s3); align-items: flex-start; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; margin: 2px 0 0; }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s4); }
.card.flush { padding: 0; overflow: hidden; }
.section-title { display: flex; align-items: center; gap: var(--s2); margin: var(--s6) 0 var(--s3); font-size: var(--fs-sm); font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.section-title:first-child { margin-top: 0; }
:lang(hi) .section-title { text-transform: none; letter-spacing: 0; }

.list { display: flex; flex-direction: column; }
.list > .item { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); min-height: 56px; border-top: 1px solid var(--border); }
.list > .item:first-child { border-top: 0; }
.kv { margin: 0; display: grid; grid-template-columns: minmax(96px, 38%) 1fr; gap: var(--s2) var(--s3); }
.kv dt { color: var(--text-muted); font-size: var(--fs-sm); }
.kv dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }

.badge { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 700; white-space: nowrap; background: var(--neutral-soft); color: var(--text-muted); }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.badge[data-s="assigned"] { color: var(--s-assigned); background: var(--s-assigned-bg); }
.badge[data-s="handed"] { color: var(--s-handed); background: var(--s-handed-bg); }
.badge[data-s="in_progress"] { color: var(--s-in_progress); background: var(--s-in_progress-bg); }
.badge[data-s="done"] { color: var(--s-done); background: var(--s-done-bg); }
.badge[data-s="cancelled"] { color: var(--s-cancelled); background: var(--s-cancelled-bg); }
.badge.problem { color: var(--danger); background: var(--danger-soft); }
.badge.warn { color: var(--warn); background: var(--warn-soft); }
.badge.ok { color: var(--ok); background: var(--ok-soft); }

.banner { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) var(--s4); border-radius: var(--r-md); background: var(--info-soft); color: var(--text); font-size: var(--fs-sm); }
.banner svg { width: 20px; height: 20px; flex: none; color: var(--info); margin-top: 1px; }
.banner.warn { background: var(--warn-soft); } .banner.warn svg { color: var(--warn); }
.banner.danger { background: var(--danger-soft); } .banner.danger svg { color: var(--danger); }
.banner.ok { background: var(--ok-soft); } .banner.ok svg { color: var(--ok); }

.avatar { width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; color: #fff; background: var(--surface-3); }

/* ---------- orders ---------- */
.order-card { display: block; text-decoration: none; color: inherit; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s4); transition: border-color var(--dur); }
.order-card:hover { border-color: var(--accent); }
.order-card + .order-card { margin-top: var(--s3); }
.order-card .top { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.order-card .num { font-family: var(--mono); font-size: var(--fs-sm); color: var(--text-muted); }
.order-card .svc { font-size: var(--fs-md); font-weight: 700; margin: var(--s2) 0 2px; }
.order-card .meta { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s3); font-size: var(--fs-sm); color: var(--text-muted); }
.order-card .foot { display: flex; align-items: center; gap: var(--s2); margin-top: var(--s3); flex-wrap: wrap; }
.price { font-weight: 800; font-variant-numeric: tabular-nums; }
.price .cur { font-weight: 600; color: var(--text-muted); font-size: .8em; margin-left: 3px; }

.countdown { font-variant-numeric: tabular-nums; font-weight: 700; }
.countdown.warn { color: var(--warn); }
.countdown.over { color: var(--danger); }
.bar { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 3px; }
.bar.warn > i { background: var(--warn); }
.bar.over > i { background: var(--danger); width: 100% !important; }

.timer-hero { text-align: center; padding: var(--s5) var(--s4); }
.timer-hero .countdown { font-size: var(--fs-2xl); display: block; margin: var(--s1) 0 var(--s3); }

.photos { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.photo-slot { border: 1.5px dashed var(--border); border-radius: var(--r-md); padding: var(--s3); display: flex; flex-direction: column; gap: var(--s2); min-width: 0; }
.photo-slot.filled { border-style: solid; }
.photo-slot .thumb { aspect-ratio: 4 / 3; border-radius: var(--r-sm); background: var(--surface-2) center/cover no-repeat; display: grid; place-items: center; color: var(--text-muted); overflow: hidden; }
.photo-slot .thumb svg { width: 32px; height: 32px; }
.photo-slot .acts { display: flex; flex-direction: column; gap: var(--s2); }
.photo-slot .btn { width: 100%; padding: 0 var(--s2); font-size: var(--fs-sm); }
.photo-slot input[type=file] { display: none; }

.cred { display: flex; align-items: center; gap: var(--s2); padding: var(--s2) var(--s3); border-radius: var(--r-sm); background: var(--surface-2); font-family: var(--mono); min-width: 0; }
.cred span { flex: 1; min-width: 0; overflow-wrap: anywhere; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 var(--s4) var(--s6); font-size: var(--fs-sm); }
.timeline li::before { content: ""; position: absolute; left: 6px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.timeline li::after { content: ""; position: absolute; left: 10px; top: 18px; bottom: 0; width: 1px; background: var(--border); }
.timeline li:last-child::after { display: none; }
.timeline li.problem::before { background: var(--danger); }
.timeline time { display: block; color: var(--text-muted); font-size: var(--fs-xs); }

.actionbar { position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); z-index: 10; margin: var(--s4) calc(-1 * var(--s4)) 0; padding: var(--s3) var(--s4); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--border); display: flex; gap: var(--s2); }
.actionbar .btn { flex: 1; }
@media (min-width: 960px) { .actionbar { bottom: 0; margin: var(--s4) 0 0; border: 1px solid var(--border); border-radius: var(--r-lg); } }

/* ---------- chat ---------- */
.chat { display: flex; flex-direction: column; height: calc(100dvh - var(--topbar-h)); }
.chat .tabs { padding: var(--s3) var(--s4) 0; }
.msgs { flex: 1; overflow-y: auto; overflow-x: hidden; padding: var(--s4); display: flex; flex-direction: column; gap: var(--s3); }
.daysep { align-self: center; font-size: var(--fs-xs); color: var(--text-muted); background: var(--surface-2); padding: 2px 10px; border-radius: var(--r-pill); }
.msg { display: flex; gap: var(--s2); max-width: 86%; }
.msg .bubble { background: var(--surface); border: 1px solid var(--border); border-radius: 4px var(--r-lg) var(--r-lg) var(--r-lg); padding: var(--s2) var(--s3); min-width: 0; overflow-wrap: anywhere; }
.msg .who { font-size: var(--fs-xs); font-weight: 700; display: flex; gap: var(--s2); align-items: baseline; flex-wrap: wrap; }
.msg .who .role { font-weight: 600; color: var(--text-muted); }
.msg .who time { color: var(--text-muted); font-weight: 400; }
.msg .text { font-size: var(--fs-md); margin-top: 2px; white-space: pre-wrap; }
.msg .pic { margin-top: var(--s2); border-radius: var(--r-sm); max-width: 220px; aspect-ratio: 4/3; background: var(--surface-2) center/cover; }
.msg.me { align-self: flex-end; flex-direction: row-reverse; }
.msg.me .bubble { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); border-radius: var(--r-lg) 4px var(--r-lg) var(--r-lg); }
.msg.iv .avatar { background: var(--btn); color: var(--on-accent); }
.msg.pending .bubble { opacity: .6; }
.msg .state { font-size: var(--fs-xs); color: var(--text-muted); text-align: right; }
.msg .state.failed { color: var(--danger); }

.quote { display: block; margin-top: var(--s2); padding: var(--s3); border-radius: var(--r-md); border: 1px solid var(--border); border-left: 3px solid var(--accent); background: var(--surface-2); text-decoration: none; color: inherit; min-width: 220px; max-width: 100%; }
.quote:hover { border-color: var(--accent); }
.quote .q-top { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; font-size: var(--fs-xs); color: var(--text-muted); }
.quote .q-svc { font-weight: 700; margin: 4px 0; }
.quote .q-meta { font-size: var(--fs-xs); color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 2px var(--s3); }

.composer { border-top: 1px solid var(--border); background: var(--surface); padding: var(--s2) var(--s3) calc(var(--s2) + var(--nav-h) + env(safe-area-inset-bottom)); display: flex; gap: var(--s2); align-items: flex-end; }
.composer textarea { flex: 1; min-height: var(--tap); max-height: 140px; resize: none; padding: 10px var(--s3); border-radius: 22px; }
.composer .readonly { flex: 1; display: flex; gap: var(--s2); align-items: center; padding: var(--s2) var(--s3); color: var(--text-muted); font-size: var(--fs-sm); min-height: var(--tap); }
.composer .readonly svg { width: 20px; height: 20px; flex: none; }
.composer .attach-preview { position: relative; }
@media (min-width: 960px) {
  .composer { padding-bottom: var(--s3); }
}

/* ---------- money ---------- */
.balance { display: flex; flex-direction: column; gap: var(--s1); }
.balance .amount { font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.balance .amount .cur { font-size: 18px; color: var(--text-muted); margin-left: 6px; font-weight: 700; }
.stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s2); margin-top: var(--s4); }
.stat { background: var(--surface-2); border-radius: var(--r-md); padding: var(--s2) var(--s3); min-width: 0; }
.stat .v { font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .k { font-size: var(--fs-xs); color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.amt-pos { color: var(--ok); font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.amt-neg { color: var(--danger); font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.addr { font-family: var(--mono); font-size: var(--fs-lg); line-height: 1.7; letter-spacing: .02em; overflow-wrap: anywhere; padding: var(--s3); border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--border); }
.addr b { color: var(--accent-ink); }
.steps { display: flex; gap: var(--s2); margin-bottom: var(--s4); }
.steps i { flex: 1; height: 4px; border-radius: 2px; background: var(--surface-3); }
.steps i.on { background: var(--accent); }

/* ---------- popups (own, never window.confirm) ---------- */
dialog.sheet {
  border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 560px; max-height: 88dvh;
  background: var(--surface); color: var(--text); border-radius: var(--r-lg) var(--r-lg) 0 0; box-shadow: var(--shadow);
  overflow: auto;
}
dialog.sheet::backdrop { background: var(--scrim); }
dialog.sheet .sheet-head { display: flex; align-items: center; gap: var(--s2); padding: var(--s3) var(--s3) var(--s2) var(--s4); position: sticky; top: 0; background: var(--surface); }
dialog.sheet .sheet-head h2 { flex: 1; }
dialog.sheet .sheet-body { padding: var(--s2) var(--s4) var(--s4); }
dialog.sheet .sheet-foot { display: flex; gap: var(--s2); padding: var(--s3) var(--s4) calc(var(--s4) + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); position: sticky; bottom: 0; background: var(--surface); }
dialog.sheet .sheet-foot .btn { flex: 1; }
@media (min-width: 640px) { dialog.sheet { margin: auto; border-radius: var(--r-lg); } }

.toast-wrap { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + var(--s4) + env(safe-area-inset-bottom)); z-index: 100; display: flex; flex-direction: column; gap: var(--s2); width: min(92vw, 420px); pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: var(--s3); align-items: center; padding: var(--s3) var(--s4); border-radius: var(--r-md); background: var(--surface-3); color: var(--text); box-shadow: var(--shadow); font-size: var(--fs-sm); font-weight: 600; }
.toast svg { width: 20px; height: 20px; color: var(--ok); flex: none; }
.toast.error svg { color: var(--danger); }
@media (min-width: 960px) { .toast-wrap { left: auto; right: var(--s6); transform: none; bottom: var(--s6); } }

.empty { text-align: center; padding: var(--s8) var(--s4); color: var(--text-muted); }
.empty svg { width: 48px; height: 48px; margin: 0 auto var(--s3); opacity: .6; }
.skeleton { border-radius: var(--r-lg); height: 132px; background: var(--surface); border: 1px solid var(--border); }
.skeleton + .skeleton { margin-top: var(--s3); }

/* ---------- login ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: var(--s6) var(--s4); background:
  radial-gradient(1200px 600px at 50% -10%, var(--accent-soft), transparent 60%), var(--bg); }
.login .box { width: 100%; max-width: 400px; }
.login .logo { width: 88px; height: 88px; margin: 0 auto var(--s4); }
.login h1 { text-align: center; font-size: var(--fs-2xl); }
.login .tag { text-align: center; color: var(--text-muted); margin: var(--s2) 0 var(--s6); }
.login .langs { display: flex; justify-content: center; gap: var(--s1); margin-top: var(--s5); }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 52px; }
.pw-wrap .iconbtn { position: absolute; right: 0; top: 0; }

/* ---------- prototype bar (not product UI; English only, excluded from strings) ---------- */
.protobar { position: fixed; top: var(--s2); right: var(--s2); z-index: 200; display: flex; gap: 6px; align-items: center; padding: 4px 6px; border-radius: var(--r-pill); background: #000c; color: #fff; font: 600 11px/1 var(--font); box-shadow: var(--shadow); max-width: calc(100vw - 16px); }
.protobar select, .protobar a { background: #222; color: #fff; border: 1px solid #555; border-radius: 6px; height: 26px; font: inherit; padding: 0 4px; text-decoration: none; display: inline-flex; align-items: center; }
.protobar .x { cursor: pointer; border: 0; background: none; color: #ccc; width: 24px; height: 24px; }
.protobar.min > :not(.x), .protobar.min > .pb-reset { display: none; }
.protobar { top: 10px; flex-wrap: wrap; justify-content: flex-end; border-radius: 14px; }
.protobar.min { padding: 2px; }
.noproto .protobar { display: none; }

/* ---------- motion: only when the user allows it ---------- */
@media (prefers-reduced-motion: no-preference) {
  dialog.sheet[open] { animation: sheet-in 220ms cubic-bezier(.2,.8,.2,1); }
  .toast { animation: toast-in 200ms ease-out; }
  .badge.live::before { animation: pulse 1.6s ease-in-out infinite; }
  .skeleton { animation: shimmer 1.2s ease-in-out infinite alternate; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes shimmer { to { opacity: .55; } }
.langs .btn[aria-pressed="true"] { color: #fff; background: var(--selected); }

/* ---------- dummy-team strip (REAL MODE): CRM --warn amber with #1A1300 text like the CRM bell, 9:1 ---------- */
:root { --test-bg: #FAA61A; --test-fg: #1a1300; --test-h: 0px; }
body.is-test { --test-h: 24px; }
.test-banner { position: sticky; top: 0; z-index: 25; height: var(--test-h); display: flex; align-items: center; justify-content: center;
  background: var(--test-bg); color: var(--test-fg); font-size: var(--fs-xs); font-weight: 800; letter-spacing: .08em; white-space: nowrap; }
.test-banner.fixed { position: fixed; left: 0; right: 0; }
body.is-test .topbar { top: var(--test-h); }
body.is-test .chat { height: calc(100dvh - var(--topbar-h) - var(--test-h)); }
body.is-test .login { padding-top: calc(var(--s6) + var(--test-h)); }
@media (min-width: 960px) { body.is-test .sidenav { height: 100dvh; } }
