/* Titli Video SDK: shared design system for the vendor console and the operator panel.
   Same language as the landing site: Plus Jakarta Sans, the Titli butterfly, light by default, a quiet
   violet ink, and the brand gradient spent in exactly three places (active nav, balance gauge, progress). */
:root {
  --font: "Plus Jakarta Sans", "Noto Sans Devanagari", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --brand-g: linear-gradient(100deg, #ff4d7e, #ff9a3c 32%, #8b5cf6 66%, #3b82f6);
  --bg: #f6f6fa;
  --surface: #ffffff;
  --surface-2: #f7f7fb;
  --surface-3: #efeff6;
  --line: #e8e8f1;
  --line-strong: #d9d9e7;
  --ink: #0f1033;
  --ink-2: #3d3f60;
  --ink-3: #62657f;
  --accent: #5b3ce0;
  --accent-hover: #4c2fcf;
  --accent-ink: #ffffff;
  --accent-soft: #efeaff;
  --audio: #c97a10;
  --video: #5b3ce0;
  --c-video: #5b3ce0; --c-audio: #c97a10; --c-3: #0e9f96;   /* chart palette, validated (light) */
  --live: #0b8a77;
  --live-soft: #dcf5f0;
  --warn: #a8650a;
  --warn-soft: #fdf1dc;
  --danger: #c8283c;
  --danger-soft: #fde6e8;
  --ok: #157a46;
  --ok-soft: #def4e7;
  --zebra: #fafafd;
  --shadow: 0 1px 2px rgba(15, 16, 51, .05), 0 6px 20px -8px rgba(15, 16, 51, .08);
  --shadow-pop: 0 18px 50px -12px rgba(15, 16, 51, .28);
  --r-s: 8px;
  --r-m: 12px;
  --r-l: 16px;
  --side: 252px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
body[data-app="admin"] { --accent: #0a7f73; --accent-hover: #086d63; --accent-soft: #dcf2ef; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0b1f; --surface: #11132f; --surface-2: #151838; --surface-3: #1c1f47; --line: #23264d; --line-strong: #33376a;
    --ink: #eef0ff; --ink-2: #c4c7e6; --ink-3: #9497ba; --zebra: #13163a;
    --accent: #b3a5ff; --accent-hover: #c5baff; --accent-ink: #0f1033; --accent-soft: #2a2360;
    --audio: #f0aa45; --video: #a594ff; --c-video: #8e7bff; --c-audio: #bd8020; --c-3: #22a897;
    --live: #35c9b0; --live-soft: #123a37; --warn: #f0aa45; --warn-soft: #3a2c12; --danger: #ff7685; --danger-soft: #3d1a22; --ok: #4fd08a; --ok-soft: #133524;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 24px -10px rgba(0, 0, 0, .5); --shadow-pop: 0 20px 56px -12px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
  :root:not([data-theme="light"]) body[data-app="admin"] { --accent: #3cc9b6; --accent-hover: #5fd8c7; --accent-soft: #10383a; --accent-ink: #062320; }
}
:root[data-theme="dark"] {
  --bg: #0a0b1f; --surface: #11132f; --surface-2: #151838; --surface-3: #1c1f47; --line: #23264d; --line-strong: #33376a;
  --ink: #eef0ff; --ink-2: #c4c7e6; --ink-3: #9497ba; --zebra: #13163a;
  --accent: #b3a5ff; --accent-hover: #c5baff; --accent-ink: #0f1033; --accent-soft: #2a2360;
  --audio: #f0aa45; --video: #a594ff; --c-video: #8e7bff; --c-audio: #bd8020; --c-3: #22a897;
  --live: #35c9b0; --live-soft: #123a37; --warn: #f0aa45; --warn-soft: #3a2c12; --danger: #ff7685; --danger-soft: #3d1a22; --ok: #4fd08a; --ok-soft: #133524;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 24px -10px rgba(0, 0, 0, .5); --shadow-pop: 0 20px 56px -12px rgba(0, 0, 0, .7);
  color-scheme: dark;
}
:root[data-theme="dark"] body[data-app="admin"] { --accent: #3cc9b6; --accent-hover: #5fd8c7; --accent-soft: #10383a; --accent-ink: #062320; }

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 14.5px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; font-feature-settings: "cv11", "ss01";
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.012em; color: var(--ink); }
h1 { font-size: 28px; line-height: 1.15; letter-spacing: -0.025em; font-weight: 750; }
h2 { font-size: 16.5px; line-height: 1.3; }
h3 { font-size: 14.5px; }
p { margin: 0 0 8px; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
.num, .tnum, .stat .v, .amount, .big { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent-soft); }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; background: linear-gradient(to right, var(--surface) calc(var(--side) - 1px), var(--line) calc(var(--side) - 1px), var(--line) var(--side), transparent var(--side)); }
.side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px;
  padding: 18px 14px 14px; border-right: 1px solid var(--line); background: var(--surface); overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 18px; }
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-name { font-weight: 750; font-size: 15px; line-height: 1.15; letter-spacing: -0.01em; }
.brand-sub { font-size: 12px; color: var(--ink-3); }
.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 2px; }
.nav-group { font-size: 11.5px; color: var(--ink-3); font-weight: 600; padding: 12px 10px 3px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 11px; padding: 7px 10px; border-radius: var(--r-s);
  color: var(--ink-2); font-weight: 550; text-decoration: none; transition: background-color .15s, color .15s;
}
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .75; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.nav a[aria-current="page"]::before { content: ""; position: absolute; left: -14px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand-g); }
.nav a[aria-current="page"] svg { opacity: 1; }
.nav .count { margin-left: auto; font-size: 11.5px; background: var(--danger); color: #fff; border-radius: 99px; padding: 0 7px; font-weight: 700; line-height: 18px; min-width: 20px; text-align: center; }
.nav .count.soft { background: var(--surface-3); color: var(--ink-2); }
.side-foot { margin-top: auto; padding-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.side-user { display: flex; align-items: center; gap: 6px; padding: 8px 4px 2px; border-top: 1px solid var(--line); }
.side-user .who { min-width: 0; flex: 1; }
.side-user .who div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 750; font-size: 13px; flex: none; }

.main { min-width: 0; padding: 28px 36px 64px; }
.page { max-width: 1240px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .sub { color: var(--ink-3); margin-top: 6px; max-width: 72ch; }
.crumbs { font-size: 13px; color: var(--ink-3); margin-bottom: 8px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.topbar { display: none; }
.env-flag { font-size: 11.5px; font-weight: 700; color: var(--warn); background: var(--warn-soft); border-radius: 99px; padding: 2px 9px; align-self: flex-start; margin-left: auto; }

/* status pill (API + media health) */
.status-pill { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); padding: 6px 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface-2); text-decoration: none; }
.status-pill:hover { text-decoration: none; color: var(--ink); }
.status-pill .dot { width: 7px; height: 7px; }
.status-pill.bad .dot { background: var(--danger); } .status-pill.ok .dot { background: var(--live); } .status-pill.wait .dot { background: var(--ink-3); }

/* ---------- balance meter (signature element) ---------- */
.meter { border: 1px solid var(--line); border-radius: var(--r-m); padding: 12px; background: var(--surface-2); }
.meter .label { font-size: 12px; color: var(--ink-3); display: flex; justify-content: space-between; gap: 8px; }
.meter .amount { font-size: 22px; font-weight: 750; letter-spacing: -0.02em; margin: 2px 0 8px; }
.meter .bar { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; position: relative; }
.meter .fill { height: 100%; border-radius: 99px; background: var(--brand-g); transform-origin: left; transition: width .6s var(--ease); }
.meter.low .fill { background: var(--warn); }
.meter.empty .fill { background: var(--danger); }
.meter .runway { font-size: 12px; color: var(--ink-2); margin-top: 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 8px; }
.meter .runway b { font-weight: 700; color: var(--ink); }

.hero-balance { position: relative; display: grid; grid-template-columns: 1.3fr 1fr; border-radius: var(--r-l); overflow: hidden; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); margin-bottom: 18px; }
.hero-balance .left { padding: 24px 26px; }
.hero-balance .right { padding: 22px 26px; background: var(--surface-2); border-left: 1px solid var(--line); display: grid; gap: 14px; align-content: center; }
.hero-balance .big { font-size: 44px; font-weight: 750; letter-spacing: -0.035em; line-height: 1.05; margin: 8px 0 16px; }
.hero-balance .gauge { height: 10px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.hero-balance .gauge > div { height: 100%; background: var(--brand-g); border-radius: 99px; transition: width .7s var(--ease); }
.hero-balance.low .gauge > div { background: var(--warn); }
.hero-balance.empty .gauge > div { background: var(--danger); }
.hero-balance > * { min-width: 0; }
.hero-note .badge { white-space: normal; line-height: 1.4; padding: 3px 9px; }
.hero-note { margin-top: 12px; font-size: 13px; color: var(--ink-2); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.runway-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.runway-row .k { color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.runway-row .v { font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.dot.audio { background: var(--c-audio); } .dot.video { background: var(--c-video); } .dot.c3 { background: var(--c-3); } .dot.live { background: var(--live); }
.dot.pulse { box-shadow: 0 0 0 0 var(--live); animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--live) 60%, transparent); } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 0; flex-wrap: wrap; }
.card-head .hint { color: var(--ink-3); font-size: 13px; }
.card-body { padding: 16px 20px 20px; }
.card-sep { border-top: 1px solid var(--line); }
.card + .card, .grid + .card, .card + .grid, .stats + .card, .stats + .grid, .grid + .grid, .callout + .grid, .callout + .stats, .callout + .card, .tabs + .card { margin-top: 18px; }
.callout.mb + .grid, .callout.mb + .stats, .callout.mb + .card { margin-top: 0; }
.grid { display: grid; gap: 18px; align-items: start; }
.grid > .card + .card { margin-top: 0; }
.grid > * { min-width: 0; }
.grid.two { grid-template-columns: 1fr 1fr; }
/* row action buttons with and without an icon sit on one line (audit 2026-11-28) */
td.actions-cell .btn { vertical-align: middle; }
/* two tables side by side only when both fit without clipping their last column (audit 2026-11-28) */
.grid.two.fit-tables { grid-template-columns: repeat(auto-fit, minmax(min(100%, 600px), 1fr)); }
.grid.three { grid-template-columns: repeat(3, 1fr); }
.grid.four { grid-template-columns: repeat(4, 1fr); }
.grid.side-r { grid-template-columns: 1.6fr 1fr; }
.stack { display: grid; gap: 18px; align-content: start; }
.stats { display: flex; flex-wrap: wrap; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; box-shadow: var(--shadow); }
.stat { background: var(--surface); padding: 16px 18px; min-width: 0; flex: 1 1 170px; }
.stat .k { color: var(--ink-3); font-size: 12.5px; display: flex; align-items: center; gap: 6px; font-weight: 550; }
.stat .v { font-size: clamp(19px, 1.2vw + 12px, 26px); font-weight: 750; letter-spacing: -0.025em; margin-top: 4px; overflow-wrap: anywhere; line-height: 1.2; }
.stat .s { color: var(--ink-3); font-size: 12.5px; margin-top: 2px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 26px 0 10px; }

/* ---------- controls ---------- */
.btn {
  appearance: none; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 650; font-size: 13.5px; padding: 8px 14px; border-radius: var(--r-s);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; line-height: 1.2;
  transition: background-color .15s, border-color .15s, transform .12s var(--ease), box-shadow .15s; text-decoration: none;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 16px -10px var(--accent); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger-ghost { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.btn.danger-ghost:hover { background: var(--danger-soft); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.btn.block { width: 100%; padding: 11px 14px; }
.btn[aria-busy="true"]::after { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn { appearance: none; border: 0; background: transparent; color: var(--ink-2); padding: 7px; border-radius: var(--r-s); cursor: pointer; display: inline-grid; place-items: center; transition: background-color .15s, color .15s; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; min-width: 0; }
.field > label, .label-text { font-weight: 650; font-size: 13px; color: var(--ink-2); }
.field .help { font-size: 12.5px; color: var(--ink-3); line-height: 1.45; }
.field .eg { color: var(--ink-3); display: block; margin-top: 2px; }
.field .eg code { font-size: 12px; background: var(--surface-3); border-radius: 5px; padding: 1px 5px; color: var(--ink-2); overflow-wrap: anywhere; }
.input, select.input, textarea.input {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--r-s); padding: 9px 11px; width: 100%; min-width: 0; transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: color-mix(in srgb, var(--ink-3) 75%, transparent); }
textarea.input { min-height: 84px; 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(--danger); }
.input-group { display: flex; align-items: stretch; min-width: 0; }
.input-group .prefix, .input-group .suffix { display: grid; place-items: center; padding: 0 10px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink-3); font-size: 13px; white-space: nowrap; flex: none; }
.input-group .prefix { border-right: 0; border-radius: var(--r-s) 0 0 var(--r-s); }
.input-group .suffix { border-left: 0; border-radius: 0 var(--r-s) var(--r-s) 0; }
.input-group .input { border-radius: 0; }
.input-group .input:first-child { border-radius: var(--r-s) 0 0 var(--r-s); }
.input-group .prefix + .input { border-radius: 0 var(--r-s) var(--r-s) 0; }
.input-group .prefix + .input:not(:last-child) { border-radius: 0; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-row.three { grid-template-columns: 1fr 1fr 1fr; }
.form-row > * { min-width: 0; }
.search { max-width: 340px; min-width: min(100%, 260px); }
.search-wrap { position: relative; display: inline-flex; align-items: center; min-width: 0; }
.search-wrap svg { position: absolute; left: 10px; width: 16px; height: 16px; color: var(--ink-3); pointer-events: none; }
.search-wrap .input { padding-left: 32px; }
.search-wrap kbd { position: absolute; right: 8px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; min-width: 0; }
.filters .input { width: auto; max-width: 100%; }
.filters form { min-width: 0; }
kbd { font: 600 11px/1 var(--mono); color: var(--ink-3); border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; padding: 3px 5px; background: var(--surface); }

.toggle { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.toggle:last-child { border-bottom: 0; }
.toggle .t { font-weight: 650; }
.toggle .d { color: var(--ink-3); font-size: 12.5px; }
.switch { position: relative; width: 40px; height: 23px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; margin: 0; position: absolute; top: 0; left: 0; cursor: pointer; z-index: 1; }
.switch input:disabled { cursor: not-allowed; }
.switch span { position: absolute; inset: 0; background: var(--line-strong); border-radius: 99px; transition: background-color .18s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; transition: transform .18s var(--ease); box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(17px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r-s); overflow: hidden; background: var(--surface); max-width: 100%; overflow-x: auto; }
.seg button { appearance: none; border: 0; background: transparent; color: var(--ink-2); font: inherit; font-weight: 650; font-size: 13px; padding: 7px 12px; cursor: pointer; white-space: nowrap; transition: background-color .15s, color .15s; }
.seg button + button { border-left: 1px solid var(--line-strong); }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
/* a fade at the right edge says "more tabs this way" on narrow screens (UX P2-12) */
@media (max-width: 860px) { .tabs { -webkit-mask-image: linear-gradient(to right, #000 85%, transparent); mask-image: linear-gradient(to right, #000 85%, transparent); padding-right: 24px; } }
.tabs button { appearance: none; border: 0; background: none; font: inherit; font-weight: 650; color: var(--ink-3); padding: 10px 12px; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; transition: color .15s, border-color .15s; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.tabs .count { font-size: 11px; background: var(--surface-3); color: var(--ink-2); border-radius: 99px; padding: 0 6px; margin-left: 6px; }

/* ---------- tables: sticky header, zebra, hover, sortable ---------- */
.table-wrap { overflow-x: auto; }
.table-wrap.tall { max-height: min(70vh, 760px); overflow: auto; }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
table.t th { text-align: left; font-weight: 650; color: var(--ink-3); font-size: 12.5px; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); position: sticky; top: 0; z-index: 1; }
table.t td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tbody tr:nth-child(even) td { background: var(--zebra); }
table.t tbody tr:last-child td { border-bottom: 0; }
table.t tbody tr.click { cursor: pointer; }
table.t tbody tr:hover td { background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface)); }
table.t .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.t .muted { color: var(--ink-3); }
table.t th.num { text-align: right; }
table.t th .sort { appearance: none; border: 0; background: none; font: inherit; color: inherit; padding: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
table.t th .sort:hover, table.t th[aria-sort="ascending"] .sort, table.t th[aria-sort="descending"] .sort { color: var(--ink); }
table.t th .sort svg { width: 12px; height: 12px; opacity: .45; transition: transform .15s; }
table.t th[aria-sort="ascending"] .sort svg { opacity: 1; transform: rotate(180deg); }
table.t th[aria-sort="descending"] .sort svg { opacity: 1; }
.card > .table-wrap { border-top: 1px solid var(--line); margin-top: 14px; border-radius: 0 0 var(--r-l) var(--r-l); }
.card > .table-wrap table.t th:first-child, .card > .table-wrap table.t td:first-child { padding-left: 20px; }
.card > .table-wrap table.t th:last-child, .card > .table-wrap table.t td:last-child { padding-right: 20px; }
.table-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-3); flex-wrap: wrap; }
.cell-clip { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 650; background: var(--surface-3); color: var(--ink-2); white-space: nowrap; line-height: 1.5; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.live { background: var(--live-soft); color: var(--live); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.badge.audio { background: color-mix(in srgb, var(--audio) 15%, transparent); color: var(--audio); }
.badge.video { background: color-mix(in srgb, var(--video) 15%, transparent); color: var(--video); }
.badge svg { width: 12px; height: 12px; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line-strong); color: var(--ink-2); background: var(--surface); }
.chip button { appearance: none; border: 0; background: none; color: inherit; padding: 0 0 0 2px; cursor: pointer; font: inherit; line-height: 1; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

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

.secret { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-s); padding: 6px 6px 6px 11px; font-family: var(--mono); font-size: 12.5px; min-width: 0; }
.secret span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.callout { border-radius: var(--r-m); padding: 12px 14px; background: var(--accent-soft); color: var(--ink); font-size: 13.5px; display: flex; gap: 10px; align-items: flex-start; border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent); }
.callout.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 22%, transparent); }
.callout.danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 22%, transparent); }
.callout.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 22%, transparent); }
.callout svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.callout > div { min-width: 0; overflow-wrap: anywhere; }
.callout code { overflow-wrap: anywhere; word-break: break-word; white-space: normal; }
a.callout { text-decoration: none; transition: transform .15s var(--ease), box-shadow .15s; }
a.callout:hover { transform: translateY(-1px); box-shadow: var(--shadow); }

pre.code { background: #0e1030; color: #dfe2f7; border-radius: var(--r-m); padding: 14px 16px; overflow-x: auto; font-family: var(--mono); font-size: 12.5px; line-height: 1.65; margin: 0; border: 1px solid #23264d; }
pre.code .c { color: #8a8fb8; } pre.code .s { color: #9ce0c6; } pre.code .k { color: #c3b6ff; }
.code-box { position: relative; }
.code-box .copy-abs { position: absolute; top: 8px; right: 8px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28); border-radius: 8px; color: #fff; }
.code-box .copy-abs .icon-btn { color: #fff; }
.code-box .copy-abs:hover { background: rgba(255,255,255,.26); }

.empty { text-align: center; padding: 42px 20px; color: var(--ink-3); }
.empty h3 { color: var(--ink); margin-bottom: 6px; font-size: 15.5px; }
.empty > div { max-width: 48ch; margin: 0 auto; }
.empty .btn { margin-top: 14px; }
.empty-icon { width: 46px; height: 46px; margin: 0 auto 12px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.empty-icon svg { width: 22px; height: 22px; }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: sk 1.3s ease-in-out infinite; border-radius: var(--r-s); height: 14px; }
.sk-row { display: grid; grid-template-columns: 1.2fr 2fr 1fr 1fr; gap: 16px; padding: 12px 20px; border-top: 1px solid var(--line); }
.sk-stat { height: 26px; width: 60%; margin-top: 8px; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- charts ---------- */
.chart { width: 100%; display: block; overflow: visible; }
.chart .gridline { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--ink-3); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart .bar-audio { fill: var(--c-audio); }
.chart .bar-video { fill: var(--c-video); }
.chart .bar-hover { fill: var(--surface-3); }
.chart .ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .ln.c1 { stroke: var(--c-video); } .chart .ln.c3 { stroke: var(--c-3); }
.chart .area.c1 { fill: var(--c-video); opacity: .1; }
.chart .mk { stroke: var(--surface); stroke-width: 2; }
.chart .mk.c1 { fill: var(--c-video); } .chart .mk.c3 { fill: var(--c-3); }
.chart .xhair { stroke: var(--line-strong); stroke-width: 1; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-tip { position: absolute; pointer-events: none; background: var(--surface); color: var(--ink); border: 1px solid var(--line); padding: 8px 10px; border-radius: var(--r-s); font-size: 12px; white-space: nowrap; box-shadow: var(--shadow-pop); z-index: 5; line-height: 1.55; font-variant-numeric: tabular-nums; }
.chart-tip b { font-weight: 700; }
.chart-box { position: relative; }
.chart-table { margin-top: 10px; }
.chart-table summary { cursor: pointer; font-size: 12.5px; color: var(--ink-3); }

/* ---------- overlays ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(10, 11, 31, .48); backdrop-filter: blur(2px); display: grid; place-items: center; padding: 16px; z-index: 50; animation: fade .16s ease; }
.modal { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--surface); border-radius: var(--r-l); box-shadow: var(--shadow-pop); border: 1px solid var(--line); animation: rise .2s var(--ease); }
.modal.wide { width: min(860px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 0; gap: 12px; }
.modal-head h2 { font-size: 17px; }
.modal-body { padding: 14px 20px 6px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 18px; flex-wrap: wrap; }
.modal-body .modal-foot { padding: 8px 0 12px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.toasts { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 60; max-width: calc(100vw - 32px); }
.toast { display: flex; align-items: flex-start; gap: 10px; background: var(--ink); color: var(--surface); padding: 11px 12px 11px 14px; border-radius: var(--r-m); box-shadow: var(--shadow-pop); font-size: 13.5px; width: 380px; max-width: 100%; animation: toastIn .22s var(--ease); }
.toast svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.toast .x { margin-left: auto; color: inherit; opacity: .7; padding: 2px; }
.toast.ok svg.k { color: #4fd08a; }
.toast.error { background: var(--danger); color: #fff; }
.toast.out { animation: toastOut .18s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(16px); } }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: #0a0b1f; color: #e8ebf6; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; isolation: isolate; }
.auth-side h2 { font-size: 34px; line-height: 1.15; letter-spacing: -0.025em; max-width: 15ch; font-weight: 750; color: #fff; }
.auth-side p { color: #b7bad6; max-width: 42ch; }
.auth-form { display: grid; place-items: center; padding: 32px 20px; background: var(--surface); position: relative; }
.auth-form form, .auth-form .auth-box { width: min(440px, 100%); }
.auth-form h1 { margin-bottom: 6px; }
.auth-form .sub { color: var(--ink-3); margin-bottom: 22px; }
.auth-switch { margin-top: 16px; color: var(--ink-3); font-size: 13.5px; text-align: center; }
.auth-lang { position: absolute; top: 16px; right: 16px; }
.err { color: var(--danger); font-size: 12.5px; margin: 2px 0 0; }
.auth-premium .brand-panel .mesh { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.auth-premium .brand-panel .mesh i { position: absolute; border-radius: 50%; filter: blur(10px); opacity: .9; }
.auth-premium .brand-panel .mesh i:nth-child(1) { width: 70%; aspect-ratio: 1; left: -20%; top: -20%; background: radial-gradient(closest-side, rgba(255,77,126,.45), transparent); }
.auth-premium .brand-panel .mesh i:nth-child(2) { width: 70%; aspect-ratio: 1; right: -25%; top: 10%; background: radial-gradient(closest-side, rgba(139,92,246,.45), transparent); }
.auth-premium .brand-panel .mesh i:nth-child(3) { width: 60%; aspect-ratio: 1; left: 10%; bottom: -25%; background: radial-gradient(closest-side, rgba(59,130,246,.35), transparent); }
.auth-premium .brand-panel h2 { background: linear-gradient(100deg, #fff, #ffd6e2 40%, #d9ccff); -webkit-background-clip: text; background-clip: text; color: transparent; }
body[data-app="admin"] .auth-premium .brand-panel .mesh i:nth-child(2) { background: radial-gradient(closest-side, rgba(60,201,182,.4), transparent); }
.auth-premium .brand-link { color: #fff; text-decoration: none; gap: 10px; }
.auth-points { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 10px; color: #d3d6f0; }
.auth-points li { display: flex; gap: 10px; align-items: center; }
.auth-points svg { width: 18px; height: 18px; flex: none; padding: 3px; border-radius: 50%; background: var(--brand-g); color: #fff; }
.auth-foot { color: #9194b6; }
.auth-premium .brand-btn { background: var(--brand-g); border: 0; color: #fff; font-weight: 750; box-shadow: 0 10px 24px -12px rgba(139,92,246,.7); }
.auth-premium .brand-btn:hover:not(:disabled) { filter: brightness(1.05); background: var(--brand-g); }
.pw-eye { cursor: pointer; font: inherit; font-size: 12.5px; border-left: 0; }
.pw-meter { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--ink-3); margin-top: 4px; }
.pw-meter .bars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; width: 140px; }
.pw-meter .bars i { height: 5px; border-radius: 3px; background: var(--line); }
.pw-meter .s1 i:nth-child(-n+1) { background: var(--danger); }
.pw-meter .s2 i:nth-child(-n+2) { background: var(--warn); }
.pw-meter .s3 i:nth-child(-n+3) { background: #3b82f6; }
.pw-meter .s4 i { background: var(--ok); }
.terms { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; margin: 4px 0 14px; color: var(--ink-2); }
.terms input { margin-top: 3px; width: 16px; height: 16px; accent-color: #8b5cf6; flex: none; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.code-input { font: 700 26px/1 var(--mono); letter-spacing: 10px; text-align: center; padding: 14px; }
.auth-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: -6px 0 14px; font-size: 13px; }

/* ---------- misc ---------- */
.row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.row.between { justify-content: space-between; }
.row.top { align-items: flex-start; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mt { margin-top: 14px; } .mt-s { margin-top: 8px; } .mt-l { margin-top: 24px; } .mb { margin-bottom: 14px; } .mb-s { margin-bottom: 8px; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.list-plain li:last-child { border-bottom: 0; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps > li { counter-increment: s; position: relative; padding: 0 0 22px 42px; }
.steps > li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 750; display: grid; place-items: center; font-size: 13px; }
.steps > li h3 { margin-bottom: 6px; padding-top: 3px; }
.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.timeline li { padding: 0 0 14px 16px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
.timeline li.ok::before { border-color: var(--ok); } .timeline li.warn::before { border-color: var(--warn); } .timeline li.danger::before { border-color: var(--danger); } .timeline li.muted::before { border-color: var(--line-strong); }
.thread { display: grid; gap: 12px; }
.msg { border: 1px solid var(--line); border-radius: var(--r-m); padding: 12px 14px; background: var(--surface); max-width: 88%; }
.msg.mine { background: var(--accent-soft); border-color: transparent; justify-self: end; }
.msg .meta { font-size: 12px; color: var(--ink-3); margin-bottom: 4px; }
.msg .body { white-space: pre-wrap; overflow-wrap: anywhere; }
.diff { display: grid; gap: 2px; font-size: 12.5px; }
.diff .k { color: var(--ink-3); }
.diff del { color: var(--danger); text-decoration: line-through; } .diff ins { color: var(--ok); text-decoration: none; }
.progress { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress > div { height: 100%; border-radius: 99px; background: var(--accent); transition: width .5s var(--ease); }
.progress.warn > div { background: var(--warn); } .progress.danger > div { background: var(--danger); }
.kbd-list { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; align-items: center; font-size: 13.5px; }

/* ---------- payments ---------- */
.copy-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--surface-2); }
.copy-row + .copy-row { margin-top: 8px; }
.copy-row > div { min-width: 0; }
.copy-row .k { font-size: 12px; color: var(--ink-3); }
.copy-row .v { font-weight: 650; overflow-wrap: anywhere; }
.pay-grid { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 18px; align-items: start; }
.pay-grid > * { min-width: 0; }
.qr-box { border: 1px solid var(--line); border-radius: var(--r-m); padding: 12px; background: #fff; display: grid; place-items: center; }
.qr-box img, .qr-box svg { width: 100%; max-width: 260px; height: auto; display: block; }
.method-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-bottom: 14px; }
.method-tabs button { appearance: none; text-align: left; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); border-radius: var(--r-m); padding: 10px 12px; cursor: pointer; font: inherit; transition: border-color .15s, background-color .15s; }
.method-tabs button .d { font-size: 12px; color: var(--ink-3); }
.method-tabs button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.thumb { max-width: 100%; max-height: 70vh; border-radius: var(--r-s); border: 1px solid var(--line); display: block; margin: 0 auto; }
.status-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.secret-state { display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--ink-3); flex-wrap: wrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.dropzone { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1.5px dashed var(--line-strong); border-radius: var(--r-m); background: var(--surface-2); cursor: pointer; transition: border-color .15s, background-color .15s; }
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
.dropzone:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.dropzone .dz-icon { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); color: var(--accent); }
.dropzone .dz-icon svg { width: 20px; height: 20px; }
.dropzone .dz-text { display: flex; flex-wrap: wrap; gap: 0 4px; align-items: baseline; min-width: 0; font-size: 13.5px; }
.dropzone .dz-hint { flex-basis: 100%; margin-top: 2px; }
.file-chip { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface-2); min-width: 0; }
.file-thumb { width: 48px; height: 48px; flex: none; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; color: var(--ink-3); }
.file-thumb svg { width: 20px; height: 20px; }
.file-chip .meta { flex: 1; min-width: 0; }
.file-chip .name { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pay-card { border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; margin-bottom: 16px; }
.pay-amount { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; background: var(--accent-soft); }
.pay-amount .k { font-size: 12.5px; font-weight: 650; color: var(--ink-2); }
.pay-amount .v { font-size: 26px; font-weight: 750; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.pay-amount .s { font-size: 12.5px; color: var(--ink-3); }
.pay-body { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 18px; padding: 16px; align-items: start; }
.pay-body.no-qr { grid-template-columns: minmax(0, 1fr); }
.pay-qr { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pay-qr .qr-box { width: 100%; padding: 10px; }
.upi-app-btn { display: none; }

/* ---------- onboarding ---------- */
.onboarding .ob-bar { height: 4px; background: var(--line); margin: 14px 20px 0; border-radius: 4px; overflow: hidden; }
.onboarding .ob-bar > div { height: 100%; background: var(--brand-g); transition: width .6s var(--ease); }
.ob-steps { list-style: none; margin: 0; padding: 16px 20px 20px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.ob-steps li { display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.ob-num { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 750; font-size: 13px; background: var(--accent-soft); color: var(--accent); }
.ob-steps li.done .ob-num { background: var(--ok-soft); color: var(--ok); }
.ob-steps li.done b { color: var(--ink-3); }
.ob-num svg { width: 14px; height: 14px; }

/* ---------- i18n + tips ---------- */
.lang-btn { font: inherit; font-weight: 750; font-size: 12.5px; min-width: 32px; height: 32px; line-height: 1; padding: 0 6px; }
.lang-btn[lang="hi"] { font-size: 13.5px; }
.lang-seg button { padding: 6px 11px; }
.stat .k-text { min-width: 0; }
.tip { display: inline-flex; vertical-align: -2px; margin-left: 4px; flex: none; }
.tip-btn { appearance: none; border: 0; background: transparent; padding: 2px; margin: -2px; color: var(--ink-3); cursor: help; border-radius: 50%; display: inline-grid; place-items: center; line-height: 0; opacity: .8; }
.tip-btn:hover, .tip-btn[aria-expanded="true"] { color: var(--accent); opacity: 1; }
.tip-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; opacity: 1; }
.tip-btn svg { width: 13px; height: 13px; }
.tip-pop { position: fixed; z-index: 90; max-width: calc(100vw - 16px); width: max-content; background: var(--ink); color: var(--surface); font: 400 12.5px/1.45 var(--font); letter-spacing: normal; text-align: left; white-space: normal; padding: 8px 10px; border-radius: 8px; box-shadow: var(--shadow-pop); pointer-events: none; animation: fade .12s ease; }
:lang(hi) body, :lang(hi) .btn, :lang(hi) .input { font-family: "Noto Sans Devanagari", var(--font); }
:lang(hi) h1, :lang(hi) h2 { letter-spacing: 0; line-height: 1.35; }
:lang(hi) .stat .k, :lang(hi) table.t th { letter-spacing: 0; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .grid.three, .grid.four { grid-template-columns: 1fr 1fr; }
  .grid.side-r { grid-template-columns: 1fr; }
  .hero-balance { grid-template-columns: 1fr; }
  .hero-balance .right { border-left: 0; border-top: 1px solid var(--line); }
  .ob-steps { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); background: none; }
  .side { position: fixed; inset: 0 auto 0 0; width: 284px; z-index: 40; transform: translateX(-100%); transition: transform .22s var(--ease); box-shadow: var(--shadow-pop); }
  .nav a[aria-current="page"]::before { left: -14px; }
  .shell.nav-open .side { transform: none; }
  .shell.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(10,11,31,.45); z-index: 30; }
  .topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 20; }
  .main { padding: 18px 16px 56px; }
  .grid.two, .grid.three, .grid.four, .form-row, .form-row.three { grid-template-columns: minmax(0, 1fr); }
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  h1 { font-size: 23px; }
  .hero-balance .big { font-size: 34px; }
  .search, .search-wrap { max-width: none; flex: 1 1 100%; }
  .filters .input, .filters select.input { flex: 1 1 140px; }
  .page-head .actions { width: 100%; }
}
@media (max-width: 640px) {
  .pay-grid, .pay-body { grid-template-columns: 1fr; }
  .qr-box { max-width: 260px; margin: 0 auto; }
  .pay-amount .v { font-size: 22px; }
  .upi-app-btn { display: flex; width: 100%; }
  .ob-steps { grid-template-columns: 1fr; }
  .stat .v { font-size: 22px; }
  .stat { flex-basis: 140px; }
  .card-head { padding: 16px 16px 0; }
  .card-body { padding: 14px 16px 16px; }
  .msg { max-width: 100%; }
  .toasts { left: 16px; right: 16px; bottom: 16px; }
  .toast { width: 100%; }
  .modal-back { place-items: end center; padding: 0; }
  .modal, .modal.wide { width: 100%; max-height: 92vh; border-radius: var(--r-l) var(--r-l) 0 0; }
  /* tables that become stacked cards on phones (label from data-label) */
  .t.cards thead { display: none; }
  .t.cards, .t.cards tbody, .t.cards tr, .t.cards td { display: block; width: 100%; }
  .t.cards tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .t.cards tbody tr:nth-child(even) td, .t.cards tbody tr:hover td { background: transparent; }
  .t.cards tr:last-child { border-bottom: 0; }
  .t.cards td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 3px 0 !important; border: 0; text-align: right; min-width: 0; max-width: none; white-space: normal; overflow-wrap: anywhere; }
  .t.cards td::before { content: attr(data-label); color: var(--ink-3); font-size: 12.5px; text-align: left; flex: none; font-family: var(--font); max-width: 45%; }
  .t.cards td:not([data-label])::before { content: none; }
  .t.cards td.primary-cell { font-weight: 650; justify-content: flex-start; text-align: left; padding-bottom: 6px !important; }
  .t.cards td.actions-cell { justify-content: flex-end; flex-wrap: wrap; padding-top: 8px !important; }
  .table-wrap.tall { max-height: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
@media print {
  .side, .topbar, .toasts, .modal-foot, .btn, .icon-btn { display: none !important; }
  .shell { display: block; } .main { padding: 0; } .modal-back { position: static; background: none; } .modal { box-shadow: none; border: 0; max-height: none; }
}

/* dark mode: danger fills carry dark ink so text keeps 4.5:1 (UX P2-5) */
:root[data-theme="dark"] .btn.danger, :root[data-theme="dark"] .nav .count:not(.soft) { color: #2a0710; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.danger, :root:not([data-theme="light"]) .nav .count:not(.soft) { color: #2a0710; } }
.alert-bar { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--danger); color: #fff; padding: 10px 16px; border-radius: var(--r-m); margin-bottom: 16px; }
:root[data-theme="dark"] .alert-bar { color: #2a0710; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .alert-bar { color: #2a0710; } }
.alert-bar a, .alert-bar button { color: inherit; font-weight: 700; }

/* Live Hosts: host cards and avatars (operator + console) */
.lh-hosts { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.lh-host { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); transition: border-color .15s, transform .15s, box-shadow .15s; min-width: 0; }
.lh-host:hover { border-color: var(--line-strong); box-shadow: var(--shadow); transform: translateY(-1px); }
.lh-host.busy { opacity: .72; }
.lh-photo { position: relative; flex: none; }
.lh-avatar { border-radius: 50%; object-fit: cover; display: block; background: var(--surface-3); }
.lh-avatar-ph { display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 750; }
.lh-dot { position: absolute; right: 1px; bottom: 1px; width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--surface); }
.lh-dot.on { background: var(--ok); }
.lh-dot.busy { background: var(--warn); }
.lh-meta { min-width: 0; flex: 1; }
.lh-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lh-mini .stat { flex: 1 1 140px; }
.lh-hero { display: flex; gap: 16px; align-items: center; padding: 22px; border-radius: var(--r-l); border: 1px solid var(--line); background: linear-gradient(135deg, var(--accent-soft), var(--surface) 70%); }
.lh-hero .lh-hero-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink, #fff); flex: none; }
@media (max-width: 640px) { .lh-hosts { grid-template-columns: 1fr; } .lh-hero { flex-direction: column; align-items: flex-start; } }
/* Short ID + copy ("Call 19a4d6b3"), event names under their readable label */
.short-id { display: inline-flex; align-items: center; gap: 4px; }
.short-id .icon-btn { width: 24px; height: 24px; }
.short-id .icon-btn svg { width: 14px; height: 14px; }
.dev-code { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.dev-code.block { display: block; white-space: normal; margin-top: 2px; }
.dev-code code { font-size: 11.5px; color: var(--ink-3); background: none; padding: 0; overflow-wrap: anywhere; white-space: normal; }
.dev-details { margin-top: 8px; font-size: 12.5px; color: var(--ink-3); }
.dev-details > summary { cursor: pointer; color: var(--ink-2); width: fit-content; }
.dev-details-body { margin-top: 6px; display: grid; gap: 4px; }
.dev-details-body code { overflow-wrap: anywhere; }
code.ev-code { display: block; font-size: 11.5px; color: var(--ink-3); background: none; padding: 0; overflow-wrap: anywhere; }
.help code, .hint code, .callout code, .muted code, p code, li code { font-size: 12px; background: var(--surface-3); border-radius: 5px; padding: 0 4px; overflow-wrap: anywhere; }
/* Live Hosts audio/video */
.lh-cap { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 650; color: var(--ink-2); background: var(--surface-3); border-radius: 99px; padding: 1px 8px; }
.badge.lh-type { gap: 4px; display: inline-flex; align-items: center; }
.badge.lh-type.audio { background: var(--accent-soft); color: var(--accent); }
/* Live Hosts pricing */
.lh-tiers { border: 1px solid var(--line); border-radius: var(--r-l); padding: 12px; min-width: 0; }
.lh-tiers table.t.compact td, .lh-tiers table.t.compact th { padding: 6px 4px; }
.lh-ps { border: 1px solid var(--line); border-radius: var(--r-l); padding: 12px; }
.lh-bd { white-space: normal; max-width: 260px; margin-left: auto; }
/* ---- v4 polish ---- */
/* Free-minutes bar ("monthly 42 of 60 left") */
.lh-bar { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.lh-bar > span { display: block; height: 100%; border-radius: 99px; background: var(--live); transition: width .3s var(--ease); }
.lh-ps, .lh-tiers { background: var(--surface-2); }
.lh-ps .badge { font-variant-numeric: tabular-nums; }
.lh-pricing h3 { margin-bottom: 4px; }
/* A progress bar inside a stat card's sub-line (System tiles) */
.stat .s .progress { margin-top: 6px; }
/* Toggle rows inside a modal or a card body keep the same rhythm; the description never pushes the switch off-screen */
.toggle > div:first-child { min-width: 0; }
.toggle .d { line-height: 1.45; margin-top: 2px; overflow-wrap: anywhere; }
.toggle.mb { border-bottom: 0; margin-bottom: 12px; }
/* (i) tips: a comfortable tap target on touch screens without changing the layout */
@media (pointer: coarse) { .tip-btn { padding: 8px; margin: -8px; } }
/* Header hint next to a search box or a segmented switch wraps under it on phones instead of squeezing it */
@media (max-width: 640px) { .card-head .hint { flex-basis: 100%; } .card-head .search-wrap { flex: 1 1 100%; } }
/* Empty states: icon chip, calmer text */
.empty .btn { margin-top: 14px; }
/* dark mode: red toast keeps 4.5:1 like the other danger fills */
:root[data-theme="dark"] .toast.error { color: #2a0710; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .toast.error { color: #2a0710; } }
/* Long file inputs never widen a card on phones */
input[type="file"] { max-width: 100%; font: inherit; font-size: 13px; color: var(--ink-2); }
/* Live Hosts tier editor: the two tier boxes stack when the card is narrow (vendor detail column), and the small
   table always fits its box (no sticky header, inputs shrink) */
.lh-pricing form > .grid.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.lh-tiers table.t.compact { width: 100%; table-layout: fixed; }
.lh-tiers table.t.compact th { position: static; white-space: normal; background: transparent; border-bottom: 0; vertical-align: bottom; }
.lh-tiers table.t.compact th:last-child, .lh-tiers table.t.compact td:last-child { width: 44px; text-align: right; }
.lh-tiers .input-group, .lh-tiers .input { min-width: 0; }
.lh-tiers table.t.compact tr:hover td { background: transparent; }

/* Analytics: filter chips that are buttons (stage filter on the Journeys tab) */
button.chip { cursor: pointer; font-family: inherit; line-height: 1.6; }
button.chip:hover { border-color: var(--accent); }
button.chip[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }

/* Analytics funnel: 2:1 on desktop, one column on phones (audit-ops: the side column was squeezed to ~110 px at 390 px) */
.grid.two.fn-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 760px) { .grid.two.fn-2-1 { grid-template-columns: minmax(0, 1fr); } }

/* Gifts (console + operator panel) */
.gf-icon { flex: none; border-radius: 10px; object-fit: contain; background: var(--surface-2); border: 1px solid var(--line); display: inline-grid; place-items: center; color: var(--ink-3); }
.gf-icon.ph svg { width: 55%; height: 55%; }
.gf-eg { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--ink-2); background: var(--accent-soft); border-radius: var(--r-m); padding: 10px 12px; }
.gf-eg svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--accent); }
.gf-price .input-group { width: 150px; max-width: 100%; }
.gf-price .err { text-align: right; max-width: 240px; margin-left: auto; white-space: normal; }
.gf-table td { vertical-align: middle; }
.t td .switch { display: inline-block; vertical-align: middle; }
.gf-table tr.gf-hidden .gf-icon, .gf-table tr.gf-hidden b { opacity: .55; }
.gf-check { width: 28px; }
@media (min-width: 641px) { .gf-table td.primary-cell { min-width: 210px; } }
.gf-total { min-height: 42px; display: flex; align-items: center; font-size: 20px; font-variant-numeric: tabular-nums; }
.gf-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; }
.gf-split > div { background: var(--surface); padding: 10px 12px; min-width: 0; }
.gf-split .k { font-size: 12px; color: var(--ink-3); } .gf-split .v { font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
/* Gifts: money never breaks across lines. A tile wraps to the next row instead of breaking its number. */
.gf-fit .stat { min-width: min-content; }
.gf-fit .stat .v { white-space: nowrap; overflow-wrap: normal; }
.gf-two { white-space: nowrap; }
.gf-table td.num, table.gf-sends td.num { white-space: nowrap; }
.gf-btn-field .btn { align-self: flex-start; }
tr.gf-detail > td { background: var(--surface-2); padding-top: 12px; padding-bottom: 12px; white-space: normal; }
.gf-kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px 20px; font-size: 13px; }
.gf-kv .k { font-size: 12px; color: var(--ink-3); } .gf-kv .v { overflow-wrap: anywhere; }
.gf-gift-cell { min-width: 0; }
@media (max-width: 640px) { .t.cards tr.gf-detail { padding-top: 4px; } .t.cards tr.gf-detail > td { display: block; text-align: left; padding: 10px 12px !important; border-radius: var(--r-m); }
  .t.cards td.primary-cell > .gf-gift-cell { width: 100%; } .gf-kv { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .gf-price { width: 100%; } .gf-price form { justify-content: flex-end; } .gf-price .input-group { width: 130px; } .t.cards td.gf-check { justify-content: flex-start; } }
