:root {
  /* LiveAll.eu brand: deep royal blue + orange accent */
  --navy:       #0f2557;   /* sidebar / header */
  --navy-2:     #16306e;
  --blue:       #1f5fd6;   /* interactive blue */
  --blue-dark:  #1748a8;
  --blue-soft:  #eaf1fc;
  --orange:     #f5821f;   /* primary CTA */
  --orange-dark:#dd6f0f;
  --ink:        #16233b;
  --muted:      #6b7a8d;
  --line:       #e3e8ef;
  --panel:      #ffffff;
  --bg:         #eef2f7;
  --ok:         #1f9d6b;
  --danger:     #d23b34;
  --shadow:     0 1px 2px rgba(15,37,87,.06), 0 8px 28px rgba(15,37,87,.07);
  /* v24 theme tokens (light values). Dark values: [data-theme="dark"] below. */
  --heading:    #0f2557;   /* big numbers / headings (navy on light) */
  --panel-2:    #f6f8fb;   /* subtle surface: table hover, inset boxes */
  --line-strong:#c7d0da;
  color-scheme: light;
}
* { box-sizing: border-box; }
body {
  margin: 0; color: var(--ink); background: var(--bg);
  /* Sofia Pro is loaded via the Adobe Typekit kit dpz2wfh — same font the
     liveall.eu WordPress site uses. System fonts stay as a fallback in case
     the kit hasn't loaded yet or is blocked. */
  font: 15px/1.55 "sofia-pro", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--blue); }

/* ── Brand wordmark ── */
.brand { font-weight: 800; font-size: 21px; letter-spacing: -.4px; color: #fff; }
.brand span { color: var(--orange); }
.brand small { display: block; font-size: 10px; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: #9fb2d4; margin-top: 2px; }
.brand.center { text-align: center; color: var(--heading); }
.brand.center span { color: var(--orange); }
.brand.center small { color: var(--muted); }

/* ── Auth screens ── */
.auth-bg { background:
  radial-gradient(900px 500px at 80% -10%, #1f5fd655, transparent),
  radial-gradient(700px 500px at 0% 110%, #f5821f33, transparent), var(--navy); }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 390px; background: var(--panel);
  border-radius: 18px; padding: 34px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.auth-card h1 { margin: 10px 0 4px; font-size: 23px; }

/* ── App layout (v21: full-width app shell) ──
   The sidebar is pinned to the viewport and scrolls on its own; the page
   scrolls in .main. Content uses the whole window (capped only on very wide
   monitors so lines never become unreadable). */
.layout { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.main { min-width: 0; display: flex; flex-direction: column; }
.sidebar { background: linear-gradient(180deg, var(--navy), var(--navy-2));
  color: #cdd8ee; padding: 18px 12px 14px; display: flex; flex-direction: column; gap: 14px;
  position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }
.sidebar .brand { padding: 0 8px 6px; }
.sidebar-top { display: flex; flex-direction: column; gap: 12px; }
.topup-cta { display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--orange);
  color: #fff; font-weight: 700; font-size: 14px; text-decoration: none; padding: 10px 12px; border-radius: 10px;
  box-shadow: 0 4px 14px rgba(245,130,31,.28); }
.topup-cta:hover { background: var(--orange-dark); }
.topup-cta .ic { width: 16px; height: 16px; stroke-width: 2.4; }
.sidebar nav { display: flex; flex-direction: column; gap: 1px; }
.sidebar nav a { color: #c6d2ea; text-decoration: none; padding: 8px 10px;
  border-radius: 9px; font-size: 14px; display: flex; align-items: center; gap: 11px; line-height: 1.3; }
.sidebar nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar nav a.active { background: var(--blue); color: #fff; font-weight: 600; }
.sidebar nav .ic { width: 18px; height: 18px; flex: none; opacity: .85; }
.sidebar nav a.active .ic { opacity: 1; }
.ic { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sidebar .nav-group { margin: 14px 10px 4px; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase;
  color: #8ea4cc; font-weight: 700; }
.sidebar .nav-group:empty { margin: 10px 10px 6px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar .nav-group.admin { border-top: 1px solid rgba(255,255,255,.08); padding-top: 14px; }
/* Kept for any template still using the old separator. */
.sidebar .nav-sep { margin: 18px 8px 4px; font-size: 10px; letter-spacing: .15em; text-transform: uppercase; color: #8ea4cc; border-top: 1px solid rgba(255,255,255,.08); padding-top: 14px; }

/* ── Top app bar (phones/tablets only) ── */
.topbar { display: none; }

/* ── Masquerade banner (sticky top, very obvious) ── */
.masq-banner { position: sticky; top: 0; z-index: 60; background: var(--orange); color: #fff;
  padding: 10px 18px; display: flex; align-items: center; gap: 14px; font-weight: 600;
  box-shadow: 0 2px 10px rgba(0,0,0,.15); }
.masq-banner .stop { margin-left: auto; background: #fff; color: var(--orange-dark); padding: 6px 14px;
  border-radius: 8px; text-decoration: none; font-size: 13px; font-weight: 700; }
.masq-banner .stop:hover { background: #fff7ec; }

/* ── Password show/hide eye (auto-attached to every input[type=password]) ── */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 44px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border: 0; background: transparent; cursor: pointer;
  color: var(--muted); font-size: 18px; line-height: 1; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; padding: 0; }
.pw-eye:hover { background: var(--blue-soft); color: var(--blue); }
.sidebar nav a.external { color: #8ea4cc; }
.sidebar-foot { margin-top: auto; border-top: 1px solid rgba(255,255,255,.1); padding-top: 12px; }
.sidebar-foot .who { font-size: 13px; color: #9fb2d4; padding: 0 8px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-foot .foot-row { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 0 2px; }
.sidebar-foot .foot-row .lang-switch { margin: 0; }
.sidebar-foot .logout { color: #c6d2ea; text-decoration: none; font-size: 13.5px; padding: 4px 6px; border-radius: 6px; }
.sidebar-foot .logout:hover { color: #fff; background: rgba(255,255,255,.08); }

/* min-width:0 — .content is the 1fr column of the .layout grid; without it a
   wide table/long token forces the whole page wider than the viewport.
   v21: no fixed 1040px cap any more — the app uses the full window. */
.content { padding: 28px 36px 32px; width: 100%; max-width: 1680px; min-width: 0; }
.page-head { margin-bottom: 22px; }
.page-head h1 { margin: 0 0 4px; font-size: 25px; }

/* ── Cards ── */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 22px; box-shadow: var(--shadow); min-width: 0; }
.card-label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); margin-bottom: 10px; }
.card-value { font-size: 36px; font-weight: 800; letter-spacing: -.5px; color: var(--heading); }
.card-sub { color: var(--muted); margin: 2px 0 16px; }
.card.balance { background: linear-gradient(160deg, var(--panel), var(--blue-soft)); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; }
/* Grid items default to min-width:auto, so a long value (e.g. billing address,
   company name) refuses to shrink and spills past the card's right edge.
   min-width:0 lets the track shrink; overflow-wrap breaks the long value. */
.kv dt, .kv dd { min-width: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-weight: 600; overflow-wrap: break-word; }

/* ── Order detail / admin order edit ──
   No per-page grid/column overrides: these pages use the same uniform .cards
   grid as the rest of the app. The products table sizes to its content with
   every cell on a single line; if it ends up wider than its card, the
   .table-scroll wrapper scrolls horizontally rather than squashing columns. */
.cards.order-view table.grid th,
.cards.order-view table.grid td { white-space: nowrap; }
.table-scroll { overflow-x: auto; }

/* ── Tables ── */
table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
table.grid th, table.grid td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line);
  overflow-wrap: break-word; }
table.grid th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
table.grid tr:hover td { background: var(--panel-2); }

/* `table.data` — dense, fully-styled data table used by the admin list pages
   (flagged signups, sender-ids review).  Unlike `table.grid` it carries its own
   padding/borders so it is readable without an enclosing card. */
table.data { width: 100%; border-collapse: collapse; font-size: 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
table.data th, table.data td { text-align: left; padding: 10px 12px;
  border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: break-word; }
table.data thead th { color: var(--muted); font-weight: 600; font-size: 12px;
  text-transform: uppercase; letter-spacing: .04em; background: var(--panel-2); }
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr:hover td { background: var(--panel-2); }

/* Utility classes referenced by several templates (mono + nowrap) */
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.nowrap { white-space: nowrap; }

/* Empty-state placeholder used by the admin list pages */
.empty { padding: 24px 16px; text-align: center; color: var(--muted); }
.empty p { margin: 0; font-size: 14px; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge.ok { background: #e3f6ee; color: var(--ok); }
.badge.warn { background: #fff3df; color: var(--orange-dark); }
.badge.info { background: var(--blue-soft); color: var(--blue-dark); }
.badge.muted { background: var(--panel-2); color: var(--muted); }
.badge.danger { background: #fdeceb; color: var(--danger); }

/* ── Forms ── */
label { display: block; margin: 0 0 14px; font-size: 13px; color: var(--muted); }
input, select { width: 100%; margin-top: 6px; padding: 11px 13px; border: 1px solid var(--line);
  border-radius: 10px; font-size: 15px; color: var(--ink); background: var(--panel); }
input:focus, select:focus { outline: 2px solid var(--blue); border-color: var(--blue); }
input:disabled { background: #f1f4f8; color: var(--muted); }
.otp-input { letter-spacing: .5em; text-align: center; font-size: 24px; font-weight: 700; }

.btn { display: inline-block; border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  padding: 11px 18px; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--line-strong); }
.btn.primary { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn.primary:hover { background: var(--orange-dark); }
.btn.blue { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.blue:hover { background: var(--blue-dark); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.ok:hover { background: #178a5c; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger:hover { background: #b52e28; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--muted); }
.btn.ghost:hover { background: var(--panel); border-color: var(--line-strong); color: var(--ink); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Misc ── */
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.token { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px;
  background: #0f2557; color: #cfe0ff; padding: 12px 14px; border-radius: 10px; word-break: break-all; }
.alert { padding: 12px 15px; border-radius: 11px; margin-bottom: 16px; font-size: 14px; }
.alert.error { background: #fdeceb; color: var(--danger); }
.alert.ok { background: #e3f6ee; color: var(--ok); }
.alert.dev { background: #fff6e0; color: #8a6d0b; }
.pill { display:inline-block; background: var(--blue-soft); color: var(--blue-dark);
  padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
code { background: var(--panel-2); padding: 1px 6px; border-radius: 5px; font-size: 13px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ── Logo ── */
.logo-link { display: block; padding: 2px 8px 6px; }
.logo { width: 158px; max-width: 100%; display: block; }
.logo-auth { width: 190px; display: block; margin: 0 auto 14px; }

/* ── Blurred secret (hover / focus to reveal) ── */
.token.secret { filter: blur(7px); transition: filter .12s ease; cursor: pointer; user-select: none; }
.token.secret:hover, .token.secret.show { filter: none; user-select: text; }
.reveal-hint { font-size: 12px; color: var(--muted); margin-top: 8px; }

/* ── Top-up calculator ── */
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.calc-grid > * { min-width: 0; }   /* same min-width:auto shrink fix */
.calc-grid .full { grid-column: 1 / -1; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg label { margin: 0; }
.seg input { display: none; }
.seg span { display: block; padding: 9px 16px; font-size: 14px; cursor: pointer; color: var(--muted); }
.seg input:checked + span { background: var(--blue); color: #fff; font-weight: 600; }
.result-rows { margin-top: 8px; }
.result-rows .r { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.result-rows .r.total { border-bottom: none; font-size: 18px; font-weight: 800; color: var(--heading); padding-top: 12px; }
.result-rows .r .v { font-weight: 700; }

/* ── Table toolbar / pager ── */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar select { width: auto; margin: 0 6px; padding: 6px 10px; }
.pager { display: flex; align-items: center; gap: 8px; }
.pager button { padding: 7px 12px; }
.pager .info { color: var(--muted); font-size: 13px; }

/* ── Icon button (e.g. open message) ── */
.icon-btn { border: 1px solid var(--line); background: var(--panel); border-radius: 8px; width: 34px; height: 32px;
  cursor: pointer; font-size: 16px; line-height: 1; color: var(--blue); }
.icon-btn:hover { background: var(--blue-soft); border-color: var(--blue); }

/* ── Modal ── */
.modal { position: fixed; inset: 0; background: rgba(15,37,87,.45); display: none;
  place-items: center; padding: 20px; z-index: 50; }
.modal.open { display: grid; }
.modal-card { background: var(--panel); border-radius: 16px; padding: 24px; max-width: 560px; width: 100%;
  box-shadow: 0 24px 70px rgba(0,0,0,.3); max-height: 80vh; overflow:auto; }
.modal-card h3 { margin: 0 0 4px; }
.modal-card .meta { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.modal-card .body { white-space: pre-wrap; word-break: break-word; line-height: 1.55;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.modal-card .close { float: right; cursor: pointer; color: var(--muted); font-size: 22px; line-height: 1; border: none; background: none; }

/* ── Payment method choice (on /topup) ── */
.method-choice .methods { display: grid; gap: 10px; }
.method { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: 12px; cursor: pointer;
  background: var(--panel); transition: border-color .15s, background .15s; }
.method:hover { border-color: var(--blue); background: var(--panel-2); }
.method input[type=radio] { margin-top: 4px; accent-color: var(--blue); transform: scale(1.2); }
.method:has(input:checked) { border-color: var(--blue); background: #eef4ff; box-shadow: 0 0 0 1px var(--blue) inset; }
.method-title { font-weight: 600; color: var(--blue); margin-bottom: 2px; }
.method-sub { color: var(--muted); font-size: 13px; }
.method.is-disabled { opacity: .55; cursor: not-allowed; }
.method.is-disabled:hover { border-color: var(--line); background: var(--panel); }

/* ── Copy IBAN button on bank-transfer instructions ── */
.btn.small { padding: 4px 10px; font-size: 12px; }
.copy-btn { margin-left: 10px; vertical-align: middle; }
.copy-btn.ok { color: #fff; background: #16a34a; border-color: #16a34a; }
code.iban { user-select: all; }

/* ── Bank-transfer admin action cell ── */
.bt-actions { min-width: 220px; padding: 12px 10px; vertical-align: top; }
.bt-select { width: 100%; padding: 7px 9px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--panel); font-size: 13px; margin-bottom: 8px;
  box-sizing: border-box; }
.bt-btn-row { display: flex; gap: 6px; }
.bt-cancel-form { flex: 1; margin: 0; }
.bt-btn { flex: 1; width: 100%; padding: 7px 10px; font-size: 13px;
  text-align: center; min-height: 34px; }

/* ── Language toggle ── */
.lang-switch { display: flex; align-items: center; gap: 4px; font-size: 12px;
  letter-spacing: .05em; margin-bottom: 10px; }
.lang-switch a { color: rgba(255,255,255,.7); text-decoration: none;
  padding: 2px 6px; border-radius: 4px; }
.lang-switch a.active { color: #fff; background: rgba(255,255,255,.18); font-weight: 700; }
.lang-switch a:hover { color: #fff; background: rgba(255,255,255,.10); }
.lang-switch .sep { color: rgba(255,255,255,.35); }
.lang-switch-top { position: absolute; top: 14px; right: 18px; z-index: 5; }
.lang-switch-top a { color: var(--blue); background: rgba(31,95,214,.08); }
.lang-switch-top a.active { background: var(--blue); color: #fff; }
.lang-switch-top a:hover { background: rgba(31,95,214,.18); color: var(--blue); }
.lang-switch-top .sep { color: var(--muted); }

/* ── AI Assistant chat ── */
.agent-shell { display: flex; flex-direction: column; height: calc(100vh - 210px); min-height: 420px; padding: 0; overflow: hidden; }
/* Slim toolbar above the transcript.  It sits outside .agent-thread on purpose:
   the copy action is chrome, not conversation, so it must not scroll away with
   the messages and must never be picked up by the transcript export. */
.agent-bar { display: flex; justify-content: flex-end; gap: 8px; padding: 9px 14px;
  border-bottom: 1px solid var(--line); background: var(--panel-2); }
.btn.small { padding: 6px 12px; font-size: 12.5px; border-radius: 8px; }
.agent-thread { flex: 1; overflow-y: auto; padding: 20px 22px; display: flex; flex-direction: column; gap: 12px; }
.agent-msg { max-width: 78%; padding: 11px 15px; border-radius: 14px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.agent-msg.user { align-self: flex-end; background: var(--blue); color: #fff; border-bottom-right-radius: 4px; }
.agent-msg.bot { align-self: flex-start; background: #eef2f7; color: var(--ink); border-bottom-left-radius: 4px; }
.agent-starter { align-self: flex-start; background: var(--panel); border: 1px solid var(--line); color: var(--blue); padding: 7px 13px; border-radius: 999px; font-size: 13px; cursor: pointer; }
.agent-starter:hover { border-color: var(--blue); background: var(--blue-soft); }
.agent-composer { display: flex; gap: 10px; align-items: flex-end; padding: 14px 16px; border-top: 1px solid var(--line); background: var(--panel); }
.agent-composer textarea { flex: 1; margin: 0; resize: none; min-height: 42px; max-height: 160px; font: inherit; }
.agent-shell .hint { padding: 0 18px 14px; margin: 0; background: var(--panel); }

/* Busy state: the composer dims slightly and the send button shows a spinner.
   The textarea is deliberately NOT disabled (see agent.html setBusy) — keeping
   it live means it can hold focus and take the next prompt while Liv replies. */
.agent-composer.busy textarea { background: var(--panel-2); color: var(--muted); }
.agent-composer.busy .btn.primary { cursor: progress; opacity: 0.75; }

/* ── Thinking indicator ── */
.agent-thinking { align-self: flex-start; display: inline-flex; align-items: center; gap: 9px;
  background: #eef2f7; padding: 12px 16px; border-radius: 14px; border-bottom-left-radius: 4px; }
.agent-thinking .dots { display: inline-flex; gap: 4px; }
.agent-thinking .dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--blue);
  opacity: 0.35; animation: agent-bounce 1.25s infinite ease-in-out; }
.agent-thinking .dots i:nth-child(2) { animation-delay: 0.16s; }
.agent-thinking .dots i:nth-child(3) { animation-delay: 0.32s; }
.agent-thinking .label { font-size: 13px; color: var(--muted); }
@keyframes agent-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.35; }
  30%           { transform: translateY(-4px); opacity: 1; }
}
/* Shimmer across the label, so a long wait still reads as "working". */
.agent-thinking .label { background: linear-gradient(90deg, var(--muted) 0%, var(--muted) 40%, var(--blue) 50%, var(--muted) 60%, var(--muted) 100%);
  background-size: 220% 100%; -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; animation: agent-shimmer 2s linear infinite; }
@keyframes agent-shimmer { from { background-position: 120% 0; } to { background-position: -20% 0; } }

/* Fade+rise for each new bubble, so replies don't pop in abruptly. */
.agent-msg, .agent-send-card, .agent-thinking { animation: agent-in 0.22s ease-out; }
@keyframes agent-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* The spinner shown inside the Send button while a turn is in flight. */
.btn .agent-spin { width: 14px; height: 14px; border-radius: 50%; display: inline-block;
  border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff; animation: agent-rot 0.7s linear infinite; }
@keyframes agent-rot { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .agent-thinking .dots i,
  .agent-thinking .label,
  .agent-msg, .agent-send-card, .agent-thinking,
  .btn .agent-spin { animation: none; }
  .agent-thinking .label { -webkit-text-fill-color: var(--muted); color: var(--muted); background: none; }
}
.agent-send-card { align-self: flex-start; max-width: 78%; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--blue); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.agent-send-title { font-weight: 600; color: var(--ink); }
.agent-send-meta { color: var(--muted); font-size: 12.5px; }
.agent-send-body { white-space: pre-wrap; word-break: break-word; background: var(--panel-2); border-radius: 8px; padding: 10px 12px; }
.agent-send-link { color: var(--muted); font-size: 12.5px; word-break: break-all; }

/* ── Encoding picker on the confirm card ──
   Three options, each carrying the server's own part count and cost for that
   encoding. A lossy option (GSM-7 on text it cannot represent) is rendered
   disabled with the reason, rather than hidden — the customer should see that
   the cheaper route exists and why it is closed to them. */
.agent-enc { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 2px;
  display: flex; flex-direction: column; gap: 5px; }
.agent-enc-title { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); font-weight: 700; }
.agent-enc-opt { display: flex; gap: 7px; align-items: baseline; font-size: 13px;
  cursor: pointer; color: var(--ink); }
.agent-enc-opt input { margin: 0; flex: none; }
.agent-enc-opt strong { font-weight: 600; }
.agent-enc-opt.lossy { cursor: not-allowed; color: var(--muted); }
.agent-enc-why { display: block; font-style: normal; font-size: 11.5px;
  color: var(--danger); margin-top: 1px; }
.agent-enc-hints { font-size: 11.5px; color: var(--muted); line-height: 1.45;
  margin-top: 2px; }
.agent-enc-live { font-size: 12.5px; font-weight: 700; color: var(--blue); }

.agent-send-actions { display: flex; gap: 8px; }
.agent-send-err { color: var(--red, #d64545); font-size: 13px; margin-top: 4px; }
.agent-send-actions { flex-wrap: wrap; }
.liv-otp { width: 8.5em !important; flex: 0 1 8.5em; min-width: 0; font-size: 17px; letter-spacing: .2em;
  text-align: center; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; }
.liv-otp::placeholder { letter-spacing: normal; font-size: 13px; }
.agent-send-many { font-size: 14px; font-weight: 700; color: var(--blue); margin: 2px 0 6px; }
.agent-send-card.confirmed { border-left-color: #2e9e5b; }
.agent-send-card.cancelled { opacity: 0.6; }

/* ══════════════════════════════════════════════════════════════════════
   Responsive — mobile / tablet
   All rules are additive: they only fire on narrow viewports. Desktop
   behaviour is unchanged.
   ══════════════════════════════════════════════════════════════════════ */

/* ── Desktop: hamburger + overlay never visible ── */
.hamburger       { display: none; }
.sidebar-overlay { display: none; }

/* ── SMS Compose two-column grid (desktop) ── */
.cards.compose-grid { grid-template-columns: 1fr 360px; }

/* ── Touch-friendly tap highlights (safe everywhere) ── */
.btn, .icon-btn, nav a, .lang-switch a, .method,
summary, .pill, .seg span {
  -webkit-tap-highlight-color: rgba(15,37,87,.12);
}

/* ────────────────────────────────────────────────────────────────────
   Tablet (≤ 1024 px)
   ──────────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .content        { padding: 24px 24px; }
  .page-head h1   { font-size: 22px; }
  .card-value     { font-size: 30px; }
}

/* ────────────────────────────────────────────────────────────────────
   Mobile (≤ 768 px) — sidebar becomes slide-out drawer
   ──────────────────────────────────────────────────────────────────── */
/* ────────────────────────────────────────────────────────────────────
   Drawer navigation (≤ 960 px) — sidebar slides in, top app bar appears
   ──────────────────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .layout         { grid-template-columns: minmax(0, 1fr); }

  .sidebar {
    position: fixed; top: 0; left: 0;
    width: 280px; max-width: 84vw;
    height: 100vh; height: 100dvh; z-index: 200;
    transform: translateX(-105%);
    transition: transform .25s ease;
    box-shadow: none;
  }
  .sidebar.open {
    transform: none;
    box-shadow: 4px 0 24px rgba(15,37,87,.35);
  }

  .sidebar-overlay {
    position: fixed; inset: 0;
    background: rgba(15,37,87,.55);
    z-index: 150;
  }
  .sidebar-overlay.open { display: block; }

  /* The app bar: sticky, so menu + top-up are always one tap away and the
     menu button can never sit on top of the page title again. */
  .topbar {
    display: flex; align-items: center; gap: 10px;
    position: sticky; top: 0; z-index: 120;
    height: 52px; padding: 0 12px;
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
    background: var(--navy); color: #fff;
    box-shadow: 0 2px 10px rgba(15,37,87,.18);
  }
  .masq-banner ~ .layout .topbar { top: 0; }
  .hamburger {
    display: flex; flex: none; width: 40px; height: 40px; margin-left: -6px;
    background: transparent; border: none; border-radius: 10px; cursor: pointer;
    align-items: center; justify-content: center; color: #fff; padding: 0;
  }
  .hamburger svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
  .hamburger:hover, .hamburger:active { background: rgba(255,255,255,.1); }
  .topbar-title { flex: 1; min-width: 0; font-weight: 700; font-size: 16px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-cta { flex: none; background: var(--orange); color: #fff; text-decoration: none; font-weight: 700;
    font-size: 13px; padding: 7px 12px; border-radius: 9px; }
  .topbar-cta:hover { background: var(--orange-dark); }

  .content { padding: 20px 20px 32px; }
}

@media (max-width: 768px) {
  /* ── Content area ── (16px top/bottom keeps Liv's calc(100dvh - 84px) exact:
     52px app bar + 2×16px) */
  .content {
    padding: 16px 16px 16px;
    max-width: 100%;
  }
  .page-head        { margin-bottom: 16px; }
  .page-head h1     { font-size: 20px; }
  .page-head p      { font-size: 13px; }

  /* ── Cards ── */
  .cards            { gap: 14px; }
  .card             { padding: 16px; }
  .card-value       { font-size: 26px; }

  /* ── Key-value pairs (desktop label:value → mobile stacked) ── */
  .kv               { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dt            { font-size: 12px; }
  .kv dd            { text-align: left; font-weight: 600; margin-bottom: 8px; }

  /* ── Two-column calc grids — collapse ── */
  .calc-grid        { grid-template-columns: 1fr; }
  .calc-grid .full  { grid-column: 1; }

  /* ── Compose two-column — stack ── */
  .cards.compose-grid { grid-template-columns: 1fr; }

  /* ── Toolbar (search + pager) — stack vertically ── */
  .toolbar {
    flex-direction: column; align-items: stretch;
  }
  .toolbar input[type="text"] {
    width: 100% !important; max-width: none !important;
  }
  .toolbar > div:first-child {
    display: flex; flex-direction: column; gap: 6px;
  }
  .pager            { justify-content: center; }

  /* ── Table wrappers: horizontal scroll (tables keep native layout) ── */
  .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* ── Modal: bottomsheet style ── */
  .modal            { padding: 12px; align-items: flex-end; }
  .modal-card       { max-width: 100%; border-radius: 16px 16px 0 0; max-height: 85vh; }
  .modal-card .close { font-size: 26px; }

  /* ── Row / actions ── */
  .row              { gap: 8px; }
  .bt-actions       { min-width: 0; }

  /* ── Segmented control ── */
  .seg span         { padding: 9px 12px; font-size: 13px; }

  /* ── SMS Compose overrides ── */
  .phone-mockup     { max-width: 100% !important; }
}

/* ────────────────────────────────────────────────────────────────────
   Phone portrait (≤ 480 px)
   ──────────────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .content          { padding: 14px 12px; }
  .page-head h1     { font-size: 18px; }
  .card             { padding: 14px; }
  .card-value       { font-size: 22px; }
  .auth-card        { padding: 24px 18px; }
  /* prevent iOS auto-zoom on focus */
  input, select     { font-size: 16px; }
  .btn              { font-size: 13px; padding: 10px 14px; }
  .seg span         { font-size: 12px; padding: 8px 10px; }
}

/* ────────────────────────────────────────────────────────────────────
   Liv usage & meter (the assistant's own page)
   ──────────────────────────────────────────────────────────────────── */

/* ── Account settings: the usage statement ──
   A row of small reference figures.  Read, don't shout: this sits on a
   settings page among other cards, so it uses small type and hairline
   separators rather than the big coloured stat cards the chat page must avoid. */
.liv-facts      { display: flex; flex-wrap: wrap; gap: 0; margin-top: 16px;
                  border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.liv-fact       { flex: 1 1 150px; padding: 12px 15px; border-right: 1px solid var(--line); }
.liv-fact:last-child { border-right: 0; }
.liv-fact .k    { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
                  color: var(--muted); font-weight: 700; }
.liv-fact .v    { display: block; font-size: 19px; font-weight: 800; color: var(--heading);
                  margin-top: 3px; font-variant-numeric: tabular-nums; letter-spacing: -.3px; }
.liv-fact .v small { font-size: 11.5px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.liv-fact .n    { display: block; font-size: 11.5px; color: var(--muted); margin-top: 1px; }

/* The detail table is collapsed by default: the summary is what a customer
   checks, and the full charge list is there when they want to audit it. */
.liv-detail summary { font-size: 13.5px; font-weight: 700; cursor: pointer; color: var(--heading); }

/* The meter as toolbar chrome: one quiet line, right-aligned with the copy
   button.  It must not compete with the conversation. */
.agent-bar      { justify-content: space-between; }
.liv-meter      { display: inline-flex; align-items: center; gap: 9px; flex-wrap: wrap;
                  font-size: 12.5px; color: var(--muted); line-height: 1; }
.liv-meter b    { color: var(--heading); font-weight: 700; font-variant-numeric: tabular-nums; }
.liv-meter i    { width: 1px; height: 11px; background: var(--line); display: inline-block; }
.liv-meter .live{ color: var(--orange-dark); font-weight: 700; }

/* Free-trial progress */
.liv-trial       { margin-top: 16px; }
.liv-trial-bar   { height: 9px; border-radius: 999px; background: #e6ebf3; overflow: hidden; }
.liv-trial-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--orange)); border-radius: 999px; }
.liv-trial-txt   { font-size: 12.5px; color: var(--muted); margin-top: 7px; }

/* Daily spend bars */
.liv-chart       { display: flex; align-items: flex-end; gap: 3px; height: 92px; margin-top: 14px; }
.liv-chart .bar  { flex: 1 1 0; min-width: 3px; background: linear-gradient(180deg, var(--blue), var(--blue-dark));
                   border-radius: 3px 3px 0 0; min-height: 2px; position: relative; }
.liv-chart .bar.free { background: linear-gradient(180deg, #9dc0f0, #7ea9e6); }
.liv-chart-x     { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 5px; }

/* Turns table */
.liv-when        { white-space: nowrap; }
.liv-amt         { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.liv-free        { color: var(--ok); font-weight: 700; }
.liv-tool-list span { display: inline-block; margin: 1px 3px 1px 0; }  /* usage page; was `.liv-tools span`, which leaked into the chat header */
.liv-note        { font-size: 11.5px; color: var(--muted); }
.liv-session     { display: inline-block; font-size: 11px; color: var(--muted); font-family: ui-monospace, Menlo, Consolas, monospace; }

/* ════════════════════════════════════════════════════════════════════
   Liv — the chat app (redesigned 2026-10-06)
   One full-height card: header · scrolling thread · pinned composer.
   ════════════════════════════════════════════════════════════════════ */
:root { --liv-grad: linear-gradient(135deg, #1f5fd6 0%, #5b4fe0 55%, #f5821f 120%); }
.liv {
  display: flex; flex-direction: column; height: calc(100vh - 60px); height: calc(100dvh - 60px);
  min-height: 460px; background: var(--panel); border-radius: 20px; box-shadow: var(--shadow);
  overflow: hidden; position: relative; }

/* Avatar: brand gradient + sparkle */
.liv-av { width: 40px; height: 40px; border-radius: 50%; background: var(--liv-grad, linear-gradient(135deg,#1f5fd6,#5b4fe0 55%,#f5821f 120%));
  display: grid; place-items: center; flex: none; box-shadow: 0 4px 14px rgba(31,95,214,.28); }
.liv-av svg { width: 58%; height: 58%; fill: #fff; }
.liv-av.sm { width: 30px; height: 30px; box-shadow: none; margin-top: 2px; }
.liv-av.xl { width: 68px; height: 68px; margin: 0 auto 14px; }
.liv-av.glow { animation: liv-glow 2.8s ease-in-out infinite; }
@keyframes liv-glow { 50% { box-shadow: 0 0 0 10px rgba(91,79,224,.10), 0 8px 30px rgba(31,95,214,.35); } }

/* Header */
.liv-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel), var(--panel-2)); }
.liv-id { display: flex; align-items: center; gap: 12px; }
.liv-name { font-weight: 800; font-size: 17px; color: var(--heading); letter-spacing: -.2px; line-height: 1.2; }
.liv-tag { font-size: 10px; font-weight: 800; letter-spacing: .08em; color: #fff; background: var(--liv-grad);
  padding: 2px 6px; border-radius: 6px; vertical-align: 2px; margin-left: 2px; }
.liv-status { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.liv-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(31,157,107,.15); }
.liv-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.liv-chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--line); font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.liv-chip b { color: var(--heading); font-variant-numeric: tabular-nums; }
.liv-chip svg { width: 15px; height: 15px; color: var(--blue); }
.liv-chip.trial { background: var(--blue-soft); border-color: #d5e3fa; }
.liv-chip.trial.low { background: #fff4e8; border-color: #fbd9b5; }
.liv-chip.trial.low b { color: var(--orange-dark); }
.liv-chip.cost b { color: var(--orange-dark); }
.liv-ring { --p: 100; width: 16px; height: 16px; border-radius: 50%;
  background: conic-gradient(var(--blue) calc(var(--p) * 1%), #d5e3fa 0); position: relative; }
.liv-chip.trial.low .liv-ring { background: conic-gradient(var(--orange) calc(var(--p) * 1%), #fbd9b5 0); }
.liv-ring::after { content: ""; position: absolute; inset: 3.5px; border-radius: 50%; background: inherit; background: var(--panel); }
.liv-icon-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: inherit; font-size: 12.5px; font-weight: 600;
  cursor: pointer; transition: background .15s, border-color .15s; }
.liv-icon-btn svg { width: 16px; height: 16px; }
.liv-icon-btn:hover { background: var(--panel-2); border-color: #cfd8e4; }
.liv-icon-btn.ok { color: var(--ok); border-color: var(--ok); }
.liv-icon-btn.bad { color: var(--danger); border-color: var(--danger); }

/* Thread */
.liv-body { flex: 1; min-height: 0; position: relative; }
.liv-thread { position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; scroll-behavior: auto;
  padding: 22px clamp(14px, 4vw, 44px) 28px; display: flex; flex-direction: column; gap: 14px;
  background: radial-gradient(1200px 400px at 50% -200px, #eef3fd, transparent), #fbfcfe; }
.liv-row { display: flex; gap: 10px; align-items: flex-start; max-width: 100%; animation: liv-in .25s ease-out; }
.liv-row.user { justify-content: flex-end; }
.liv-row.note, .liv-row.error { justify-content: center; }
.liv-col { display: flex; flex-direction: column; gap: 4px; min-width: 0; max-width: min(78%, 720px); }
.liv-row.user .liv-col { align-items: flex-end; }
.liv .agent-msg { max-width: 100%; padding: 11px 15px; border-radius: 18px; font-size: 14.5px; line-height: 1.55;
  word-break: break-word; overflow-wrap: anywhere; }
.liv .agent-msg.user { background: linear-gradient(135deg, #2466e0, #1748a8); color: #fff; border-bottom-right-radius: 6px;
  white-space: pre-wrap; box-shadow: 0 4px 14px rgba(31,95,214,.18); align-self: auto; }
.liv .agent-msg.bot { background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-top-left-radius: 6px;
  white-space: normal; box-shadow: 0 1px 2px rgba(15,37,87,.04); align-self: auto; }
.liv .agent-msg.bot p { margin: 0 0 8px; }
.liv .agent-msg.bot p:last-child, .liv .agent-msg.bot ul:last-child, .liv .agent-msg.bot ol:last-child { margin-bottom: 0; }
.liv .agent-msg.bot ul, .liv .agent-msg.bot ol { margin: 4px 0 8px; padding-left: 20px; }
.liv .agent-msg.bot li { margin: 2px 0; }
.liv .agent-msg.bot h4 { margin: 6px 0 4px; font-size: 14.5px; color: var(--heading); }
.liv .agent-msg.bot code { background: var(--panel-2); border-radius: 5px; padding: 1px 5px; font-size: 13px; }
.liv .agent-msg.bot hr { border: 0; border-top: 1px solid var(--line); margin: 10px 0; }
.liv .agent-msg.bot a { word-break: break-all; }
.liv-meta { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: #98a5b6; padding: 0 6px;
  opacity: .85; flex-wrap: wrap; }
.liv-receipt { padding: 1px 8px; border-radius: 999px; background: var(--panel-2); color: var(--muted); font-variant-numeric: tabular-nums; }
.liv-receipt.free { background: #e8f6ef; color: var(--ok); }
.liv-mini { border: 0; background: none; font: inherit; font-size: 11.5px; color: var(--blue); cursor: pointer; padding: 0 2px;
  opacity: 0; transition: opacity .15s; }
.liv-row:hover .liv-mini, .liv-mini:focus, .liv-mini.strong { opacity: 1; }
.liv-mini.strong { font-weight: 700; font-size: 12.5px; }
.liv-note { font-size: 12.5px; color: var(--muted); background: var(--panel-2); padding: 6px 12px; border-radius: 999px; text-align: center; }
.liv-note.err { background: #fdecec; color: var(--danger); }
.liv-row.error .liv-col { align-items: center; flex-direction: row; gap: 10px; max-width: 100%; flex-wrap: wrap; justify-content: center; }
@keyframes liv-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Thinking bubble (reuses .agent-thinking dots from the base styles) */
.liv .agent-thinking { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; border-top-left-radius: 6px;
  padding: 12px 15px; }

/* Welcome */
.liv-welcome { margin: auto; text-align: center; max-width: 620px; padding: 20px 6px; animation: liv-in .4s ease-out; }
.liv-welcome h2 { margin: 0 0 6px; font-size: 26px; color: var(--heading); letter-spacing: -.4px; }
.liv-welcome p { margin: 0 auto 22px; color: var(--muted); font-size: 15px; max-width: 480px; }
.liv-suggest { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.liv-suggest button { display: flex; align-items: center; gap: 10px; text-align: left; padding: 13px 14px;
  border-radius: 14px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: inherit; font-size: 13.5px;
  font-weight: 600; cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .15s; }
.liv-suggest button span { width: 32px; height: 32px; border-radius: 10px; background: var(--panel-2); display: grid;
  place-items: center; font-size: 16px; flex: none; }
.liv-suggest button:hover { transform: translateY(-2px); border-color: #c9d8f3; box-shadow: 0 8px 22px rgba(31,95,214,.10); }

/* Jump-to-latest */
.liv-jump { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: inline-flex; align-items: center;
  gap: 6px; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--heading);
  font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; box-shadow: 0 6px 20px rgba(15,37,87,.14); z-index: 2; }
.liv-jump svg { width: 15px; height: 15px; }
.liv-jump[hidden] { display: none; }

/* Composer */
.liv-composer { padding: 12px clamp(12px, 3vw, 28px) 12px; border-top: 1px solid var(--line); background: var(--panel); }
.liv-composer[hidden], .liv-locked-bar[hidden] { display: none; }
.liv-input { display: flex; align-items: flex-end; gap: 8px; padding: 6px 6px 6px 16px; border: 1.5px solid var(--line);
  border-radius: 22px; background: var(--panel); transition: border-color .15s, box-shadow .15s; }
.liv-input:focus-within { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(31,95,214,.10); }
.liv-input textarea { flex: 1; border: 0; outline: 0; resize: none; margin: 0; padding: 8px 0; min-height: 22px; max-height: 180px;
  font: inherit; font-size: 15px; line-height: 1.45; background: transparent; box-shadow: none; }
.liv-send { width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; flex: none;
  background: #d9e1ec; color: #fff; transition: background .15s, transform .15s; }
.liv-send svg { width: 20px; height: 20px; }
.liv.has-text .liv-send { background: var(--orange); }
.liv.has-text .liv-send:hover { background: var(--orange-dark); transform: scale(1.05); }
.liv.busy .liv-send { background: #d9e1ec; cursor: progress; }
.liv-fine { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 11px; color: #98a5b6;
  padding: 7px 8px 0; }
.liv-locked-bar { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; padding: 16px;
  border-top: 1px solid var(--line); background: #fff8f0; font-size: 14px; color: var(--ink); }

/* The send card inside the new thread */
.liv .agent-send-card { max-width: min(78%, 620px); border-radius: 16px; box-shadow: 0 4px 18px rgba(15,37,87,.07); align-self: auto; }

/* ── Consent gate: blurs the whole page, card in the middle ── */
.liv-gate { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center;
  padding: 20px; overflow-y: auto; background: rgba(15,37,87,.30);
  -webkit-backdrop-filter: blur(10px) saturate(120%); backdrop-filter: blur(10px) saturate(120%);
  animation: liv-fade .25s ease-out; }
.liv-gate[hidden] { display: none; }
@keyframes liv-fade { from { opacity: 0; } to { opacity: 1; } }
.liv-gate-card { background: var(--panel); border-radius: 24px; width: 100%; max-width: 520px; padding: 34px 32px 24px; text-align: center;
  box-shadow: 0 30px 80px rgba(15,37,87,.30); animation: liv-pop .32s cubic-bezier(.2,.9,.3,1.2); margin: auto; }
@keyframes liv-pop { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }
.liv-gate-card h2 { margin: 0 0 8px; font-size: 23px; color: var(--heading); letter-spacing: -.3px; }
.liv-gate-card .lead { margin: 0 auto 20px; color: var(--muted); font-size: 15px; max-width: 400px; }
.liv-price { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px; }
.liv-price div { background: #f5f8fd; border: 1px solid #e3ebf8; border-radius: 14px; padding: 12px 8px; }
.liv-price span { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.liv-price b { display: block; font-size: 16px; color: var(--heading); margin-top: 3px; font-variant-numeric: tabular-nums; }
.liv-points { list-style: none; padding: 0; margin: 0 0 16px; text-align: left; }
.liv-points li { position: relative; padding: 5px 0 5px 30px; font-size: 14px; color: var(--ink); }
.liv-points li::before { content: "✓"; position: absolute; left: 0; top: 5px; width: 20px; height: 20px; border-radius: 50%;
  background: #e8f6ef; color: var(--ok); font-size: 12px; font-weight: 800; display: grid; place-items: center; }
.liv-gate-bal { font-size: 13.5px; color: var(--muted); margin: 0 0 16px; }
.liv-gate-bal b { color: var(--heading); }
.liv-gate-bal .warn { color: var(--orange-dark); font-weight: 700; }
.liv-gate-actions { display: flex; flex-direction: column; gap: 8px; }
.btn.big { padding: 13px 18px; font-size: 15px; font-weight: 700; border-radius: 14px; text-align: center; }
.liv-later { margin-top: 10px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 13.5px; cursor: pointer; padding: 6px; }
.liv-later:hover { color: var(--ink); text-decoration: underline; }
body.liv-gated { overflow: hidden; }

/* Phones */
@media (max-width: 768px) {
  .liv { height: calc(100vh - 84px); height: calc(100dvh - 84px); border-radius: 16px; }
  .liv-icon-btn span, .liv-fine span:first-child { display: none; }
  .liv-col, .liv .agent-send-card { max-width: 88%; }
  .liv-welcome h2 { font-size: 22px; }
  .liv-suggest { grid-template-columns: 1fr 1fr; }
  .liv-head { padding: 10px 12px; }
}
@media (max-width: 480px) {
  .liv-suggest { grid-template-columns: 1fr; }
  .liv-price { grid-template-columns: 1fr; }
  .liv-gate-card { padding: 26px 18px 18px; border-radius: 20px; }
  .liv-av.sm { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .liv-row, .liv-welcome, .liv-gate, .liv-gate-card, .liv-av.glow { animation: none; }
  .liv-suggest button:hover, .liv.has-text .liv-send:hover { transform: none; }
}
/* Global `input { width: 100% }` stretched the encoding radios across the card. */
.agent-enc-opt { margin: 0; }
.agent-enc-opt input[type="radio"] { width: auto; margin: 0; padding: 0; flex: none; }
.liv [hidden], .liv-chip[hidden] { display: none !important; }
.liv-chip { line-height: 1; }
.liv-gate-card .btn:focus-visible { outline: 3px solid rgba(31,95,214,.35); outline-offset: 2px; }
.liv-gate-card .btn:focus:not(:focus-visible) { outline: none; }
@media (max-width: 768px) {
  /* v21: the menu button now lives in the app bar above, not over the page,
     so Liv's header no longer needs to leave room for it. */
  .liv-head { padding-left: 12px; }
  .liv-chip.cost { display: none !important; }
  .liv-chip { height: 28px; padding: 0 9px; font-size: 12px; }
  .liv-icon-btn { height: 28px; padding: 0 8px; }
  .liv-gate { align-items: flex-start; padding: 14px; }
  .liv-gate-card { padding: 22px 18px 16px; }
  .liv-gate-card h2 { font-size: 20px; }
  .liv-gate-card .lead { font-size: 14px; margin-bottom: 14px; }
  .liv-price { grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 12px; }
  .liv-price div { padding: 9px 4px; }
  .liv-price span { font-size: 9.5px; letter-spacing: .02em; }
  .liv-price b { font-size: 13.5px; }
  .liv-points li { font-size: 13px; padding: 4px 0 4px 28px; }
  .liv-av.xl { width: 54px; height: 54px; margin-bottom: 10px; }
}
@media (max-width: 480px) { .liv-price { grid-template-columns: repeat(3, 1fr); } }
/* Greek drops accents in capitals; uppercase-by-CSS would keep them (ΣΥΝΔΡΟΜΉ). */
.liv-price span { text-transform: none; letter-spacing: 0; font-size: 11.5px; }
@media (max-width: 768px) {
  .liv-id { min-width: 0; flex: 1 1 auto; }
  .liv-status { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 62vw; display: block; }
  .liv-status i { display: inline-block; margin-right: 5px; vertical-align: 1px; }
  .liv-tools { flex-wrap: nowrap; width: 100%; }
  .liv-price span { font-size: 10px; }
}
/* Admin: stored Liv conversation */
.adm-convo { display: flex; flex-direction: column; gap: 12px; }
.adm-msg { max-width: 80%; }
.adm-msg.user { align-self: flex-end; }
.adm-meta { font-size: 11.5px; color: var(--muted); margin-bottom: 3px; }
.adm-msg.user .adm-meta { text-align: right; }
.adm-body { white-space: pre-wrap; word-break: break-word; padding: 10px 13px; border-radius: 14px; font-size: 14px; line-height: 1.5;
  background: var(--panel-2); border: 1px solid var(--line); }
.adm-msg.user .adm-body { background: #e8f0fe; border-color: #cfdcf7; }
.adm-msg.action .adm-body { background: #fff4e8; border-color: #fbd9b5; font-size: 13px; }
.liv-gate-card.small { max-width: 440px; }
.liv-leave-icon { font-size: 40px; margin-bottom: 8px; }
.liv-gate-actions .btn.big:not(.primary):not(.blue) { background: var(--panel-2); }

/* ══════════════════════════════════════════════════════════════════════
   v21 — customer-page redesign (2026-10-07)
   Shared form controls, page furniture, tabs, settings search, overview,
   support form. Everything here is additive; per-page inline styles still
   win where a page sets them explicitly.
   ══════════════════════════════════════════════════════════════════════ */

/* ── Form controls ──
   The global `input { width:100% }` above also caught checkboxes and radios,
   which then stretched across the card and sat far from their own text
   (top-up payment methods, compose encoding, schedule, signup, OTP). Reset
   them, and lay the label out as [box] text. */
input[type="checkbox"], input[type="radio"] {
  width: 16px; height: 16px; min-width: 16px; margin: 0; padding: 0; flex: none;
  accent-color: var(--blue); cursor: pointer; vertical-align: middle; }
label:not(.method):has(> input[type="checkbox"]),
label:not(.method):has(> input[type="radio"]) {
  display: inline-flex; align-items: center; gap: 8px; color: var(--ink); cursor: pointer; }
.method input[type="radio"] { margin-top: 3px; }

/* Labels read as labels (not as faint hints). */
label { color: #3c4a5e; font-weight: 600; }
label .hint, label .muted { font-weight: 400; }
.method, .seg label { font-weight: 400; color: var(--ink); }
.method .method-title { font-weight: 600; }
.hint { display: block; line-height: 1.45; }

/* Textareas never had a style: they fell back to the browser's monospace
   font and square border. Same look as inputs now. */
textarea { width: 100%; margin-top: 6px; padding: 11px 13px; border: 1px solid var(--line);
  border-radius: 10px; font: inherit; font-size: 15px; line-height: 1.5; color: var(--ink);
  background: var(--panel); resize: vertical; }
textarea:focus { outline: 2px solid var(--blue); border-color: var(--blue); }
textarea::placeholder, input::placeholder { color: #9aa7b8; font-family: inherit; letter-spacing: normal; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 0; }
input[type="file"] { padding: 9px; background: var(--panel-2); }
select { cursor: pointer; }

/* A field block: label above, control, hint below — for new markup. */
.field { margin: 0 0 16px; }
.field > label { margin: 0 0 6px; display: block; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 16px; }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 4px; }

/* ── Page furniture ── */
.page-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 20px; }
.page-head > * { grid-column: 1; min-width: 0; }
.page-head p { margin: 0; }
.page-head > .page-actions { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.narrow { max-width: 820px; }
.cards { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.card > h2, .card > h3 { margin: 0 0 12px; font-size: 17px; }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted);
  font-weight: 700; margin: 26px 0 12px; }

/* Compose / Viber: the form gets the room, the preview stays a sidebar. Keep
   the pair a sensible width on very wide monitors. */
.cards.compose-grid { grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); max-width: 1320px; align-items: start; }

/* ── Tabs (Send SMS / Upload file, Account settings) ── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 0 20px; overflow-x: auto;
  scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a, .tabs button { flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px;
  border: 0; background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--muted);
  text-decoration: none; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
  border-radius: 8px 8px 0 0; }
.tabs a:hover, .tabs button:hover { color: var(--ink); background: rgba(31,95,214,.05); }
.tabs a.active, .tabs button.active, .tabs [aria-selected="true"] { color: var(--blue); border-bottom-color: var(--blue); }
.tabs .ic { width: 16px; height: 16px; }

/* ── Account settings: search + tabbed panes ── */
.settings-search { position: relative; max-width: 560px; margin: 0 0 16px; }
.settings-search input { margin: 0; padding-left: 42px; padding-right: 40px; height: 46px; border-radius: 12px;
  box-shadow: var(--shadow); border-color: transparent; font-size: 15px; }
.settings-search .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.settings-search input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.setting:not(.card) { border-radius: 16px; }
.settings-search .clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: none;
  width: 30px; height: 30px; border-radius: 8px; cursor: pointer; color: var(--muted); font-size: 18px; line-height: 1; }
.settings-search .clear:hover { background: var(--blue-soft); color: var(--blue); }
.settings-search kbd { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font: 600 11px/1 inherit;
  color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; background: var(--panel); }
.settings-pane[hidden] { display: none !important; }
.settings-pane > .cards { align-items: start; }
.setting { scroll-margin-top: 80px; }
.setting .card-label { display: flex; align-items: center; gap: 8px; }
.settings-results-note { color: var(--muted); font-size: 13px; margin: -6px 0 14px; }
.settings-empty { text-align: center; color: var(--muted); padding: 34px 16px; }
.setting.hit { box-shadow: 0 0 0 2px var(--blue), var(--shadow); }
mark.sh { background: #fff1c2; color: inherit; padding: 0 1px; border-radius: 3px; }
/* While searching, panes lose their tabs and show every match together. */
.settings.searching .tabs { opacity: .45; pointer-events: none; }
.settings.searching .setting.miss { display: none !important; }
.pane-heading { display: none; }
.settings.searching .settings-pane:not(.no-hits) .pane-heading { display: block; }
.settings.searching .settings-pane.no-hits { display: none !important; }

/* Token box with inline actions (API & integrations) */
.token-row { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; }
.token-row .token { flex: 1 1 260px; margin: 0; display: flex; align-items: center; min-height: 44px; }

/* ── Overview ── */
.overview-top { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(0, 2.4fr); gap: 18px; margin-bottom: 18px; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin-bottom: 18px; }
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.quick a { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid var(--line);
  border-radius: 14px; background: var(--panel); text-decoration: none; color: var(--ink); transition: border-color .15s, transform .15s, box-shadow .15s; }
.quick a:hover { border-color: var(--blue); box-shadow: 0 6px 18px rgba(31,95,214,.12); transform: translateY(-1px); }
.quick .qi { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); }
.quick .qi .ic { width: 20px; height: 20px; }
.quick strong { font-size: 14.5px; }
.quick span.sub { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.quick a.ask-liv .qi { background: var(--liv-grad, linear-gradient(135deg,#1f5fd6,#5b4fe0 55%,#f5821f 120%)); color: #fff; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 18px; margin-top: 18px; align-items: start; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.card-head .card-label { margin: 0; }
.card-head a { font-size: 13px; font-weight: 600; text-decoration: none; }
.recent-list { list-style: none; margin: 0; padding: 0; }
.recent-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.recent-list li:last-child { border-bottom: 0; }
.recent-list .to { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-list .msg { grid-column: 1 / -1; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-list .when { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.mini-progress { height: 6px; border-radius: 99px; background: #eef2f7; overflow: hidden; margin-top: 6px; }
.mini-progress i { display: block; height: 100%; background: var(--blue); border-radius: 99px; }

/* ── Support: restyle the embedded Zoho Desk form to match the portal ──
   Zoho ships a fixed-width table (label column 25%, 280px inputs, plain
   buttons). Stack it: label above a full-width control, portal buttons. */
.card #zohoSupportWebToCase { max-width: 720px; }
.card #zohoSupportWebToCase .zsFormClass { width: 100%; max-width: 720px; background: transparent; }
.card #zohoSupportWebToCase table, .card #zohoSupportWebToCase tbody,
.card #zohoSupportWebToCase tr, .card #zohoSupportWebToCase td { display: block; width: 100% !important; }
.card #zohoSupportWebToCase tr:first-child { display: none; }
.card #zohoSupportWebToCase td { padding: 0 !important; text-align: left !important; }
.card #zohoSupportWebToCase tr { margin-bottom: 16px; }
.card #zohoSupportWebToCase td.zsFontClass { font-family: inherit; font-size: 13px; font-weight: 600; color: #3c4a5e; margin-bottom: 6px; white-space: normal; }
.card #zohoSupportWebToCase input[type='text'], .card #zohoSupportWebToCase textarea, .card #zohoSupportWebToCase select {
  width: 100% !important; box-sizing: border-box; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px;
  font: inherit; font-size: 15px; color: var(--ink); background: var(--panel); margin: 0; }
.card #zohoSupportWebToCase textarea { min-height: 150px; }
.card #zohoSupportWebToCase .manfieldbdr { border-left: 3px solid var(--orange) !important; }
.card #zohoSupportWebToCase #zsBrowseAttachment { display: inline-flex; align-items: center; gap: 6px; float: none; color: var(--blue);
  font: 600 14px/1 inherit; padding: 10px 14px; border: 1px dashed #b9c6da; border-radius: 10px; background: var(--panel-2); cursor: pointer; }
.card #zohoSupportWebToCase .wtcuploadinput { width: 130px; height: 38px; margin-top: -38px; float: none; display: block; }
.card #zohoSupportWebToCase #zsMaxSizeMessage, .card #zohoSupportWebToCase #zsMaxLimitMessage { float: none !important; display: block;
  font-size: 12px !important; color: var(--muted) !important; margin: 8px 0 0 !important; }
.card #zohoSupportWebToCase input[type='submit'], .card #zohoSupportWebToCase input[type='button'] {
  width: auto; display: inline-block; margin: 0 8px 0 0; padding: 11px 22px; border-radius: 10px; font: 600 14px/1.2 inherit; cursor: pointer; }
.card #zohoSupportWebToCase input[type='submit'] { background: var(--blue); border: 1px solid var(--blue); color: #fff; }
.card #zohoSupportWebToCase input[type='submit']:hover { background: var(--blue-dark); }
.card #zohoSupportWebToCase input[type='button'] { background: var(--panel); border: 1px solid var(--line); color: var(--muted); }
.card #zohoSupportWebToCase tr:has(input[type='submit']) td { text-align: left !important; }
.card #zohoSupportWebToCase .wb_FtCon { justify-content: flex-start; padding-left: 0; width: auto; color: var(--muted); font-size: 12px; }
.card #zohoSupportWebToCase br { display: none; }

/* ── Tablet: Liv keeps its exact height under the app bar (52 + 20 + 32) ── */
@media (min-width: 769px) and (max-width: 960px) {
  .liv { height: calc(100vh - 104px); height: calc(100dvh - 104px); }
}
@media (max-width: 960px) {
  .overview-grid, .overview-top { grid-template-columns: minmax(0, 1fr); }
  .cards.compose-grid { grid-template-columns: minmax(0, 1fr); }
  .page-head h1 { font-size: 22px; }
}
@media (max-width: 768px) {
  .page-head > .page-actions { grid-column: 1; grid-row: auto; margin-top: 12px; }
  .settings-search { max-width: none; }
  .settings-search kbd { display: none; }
  .quick { grid-template-columns: 1fr 1fr; }
  .tabs a, .tabs button { padding: 10px 12px; }
  textarea { font-size: 16px; }
}
@media (max-width: 380px) { .quick { grid-template-columns: 1fr; } }

/* ── Collapsible sidebar sections (2026-10-07) ──
   Heading = button with a chevron; the item list collapses with the
   0fr→1fr grid-row trick so it animates to its natural height. */
.sidebar .nav-sec { margin-top: 6px; }
.sidebar button.nav-group { display: flex; align-items: center; justify-content: space-between; width: calc(100% - 0px);
  margin: 0; padding: 8px 10px; border: 0; border-radius: 8px; background: none; cursor: pointer; font: inherit;
  font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: #8ea4cc; font-weight: 700; text-align: left; }
.sidebar button.nav-group:hover { background: rgba(255,255,255,.06); color: #c6d2ea; }
.sidebar button.nav-group:focus-visible { outline: 2px solid rgba(255,255,255,.5); outline-offset: -2px; }
.sidebar .nav-group .chev { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.4;
  stroke-linecap: round; stroke-linejoin: round; transform: rotate(-90deg); }
.sidebar .nav-sec.open .chev { transform: none; }
.sidebar .nav-items { display: grid; grid-template-rows: 0fr; }
.sidebar .nav-items > div { overflow: hidden; display: flex; flex-direction: column; gap: 1px; min-height: 0; }
.sidebar .nav-sec.open .nav-items { grid-template-rows: 1fr; }
.sidebar.nav-ready .nav-items { transition: grid-template-rows .2s ease; }
.sidebar.nav-ready .nav-group .chev { transition: transform .2s ease; }
.sidebar .nav-sec.admin { border-top: 1px solid rgba(255,255,255,.08); margin-top: 12px; padding-top: 8px; }
.sidebar .nav-rule { margin: 10px 10px 6px; border-top: 1px solid rgba(255,255,255,.08); }
@media (prefers-reduced-motion: reduce) {
  .sidebar.nav-ready .nav-items, .sidebar.nav-ready .nav-group .chev { transition: none; }
}
/* Closed sections drop out of the tab order (keyboard users skip them). */
.sidebar .nav-sec:not(.open) .nav-items > div { visibility: hidden; }
.sidebar.nav-ready .nav-items > div { transition: visibility .2s; }

/* ══════════════════════════════════════════════════════════════════════
   Dark mode (2026-10-07). Switched by <html data-theme="dark">, set from the
   sidebar toggle and restored in <head> before first paint (no flash).
   Light stays the default. Surfaces/text all run on the tokens above, so
   most components need nothing here; the rules below cover tinted badges,
   alerts and the few remaining fixed colours.
   ══════════════════════════════════════════════════════════════════════ */
:root[data-theme="dark"] {
  --navy:       #0a1120;
  --navy-2:     #0f1a2e;
  --blue:       #4f8df5;
  --blue-dark:  #3b78e0;
  --blue-soft:  #17284a;
  --ink:        #e4e9f2;
  --muted:      #94a3b8;
  --line:       #26324a;
  --line-strong:#3a4864;
  --panel:      #131c2e;
  --panel-2:    #18233a;
  --bg:         #0b1220;
  --heading:    #eef3ff;
  --ok:         #3cc28a;
  --danger:     #f0605a;
  --shadow:     0 1px 2px rgba(0,0,0,.45), 0 8px 28px rgba(0,0,0,.35);
  color-scheme: dark;
}
[data-theme="dark"] body { background: var(--bg); }
[data-theme="dark"] label { color: #b8c3d4; }
[data-theme="dark"] input, [data-theme="dark"] select, [data-theme="dark"] textarea { background: #0e1626; border-color: var(--line); color: var(--ink); }
[data-theme="dark"] input:disabled { background: #172033; color: var(--muted); }
[data-theme="dark"] textarea::placeholder, [data-theme="dark"] input::placeholder { color: #66758c; }
[data-theme="dark"] code { background: #1d2840; color: #cdd8ee; }
[data-theme="dark"] .token { background: #08101d; color: #a9c6ff; }
[data-theme="dark"] .badge.ok     { background: rgba(60,194,138,.16); color: #5fd6a4; }
[data-theme="dark"] .badge.warn   { background: rgba(245,130,31,.16); color: #ffb26b; }
[data-theme="dark"] .badge.info   { background: rgba(79,141,245,.18); color: #9cc0ff; }
[data-theme="dark"] .badge.muted  { background: rgba(148,163,184,.14); color: var(--muted); }
[data-theme="dark"] .badge.danger { background: rgba(240,96,90,.16); color: #ff8a84; }
[data-theme="dark"] .pill { background: rgba(79,141,245,.18); color: #9cc0ff; }
[data-theme="dark"] .alert.error { background: rgba(240,96,90,.14); color: #ff9893; }
[data-theme="dark"] .alert.ok    { background: rgba(60,194,138,.14); color: #6fdcae; }
[data-theme="dark"] .alert.dev   { background: rgba(245,180,40,.12); color: #f3c969; }
[data-theme="dark"] .card.balance { background: linear-gradient(160deg, var(--panel), #16264a); }
[data-theme="dark"] .method:has(input:checked) { background: rgba(79,141,245,.12); }
[data-theme="dark"] .btn.ghost:hover, [data-theme="dark"] .btn:hover { border-color: var(--line-strong); }
[data-theme="dark"] table.grid tr:hover td, [data-theme="dark"] table.data tbody tr:hover td { background: var(--panel-2); }
[data-theme="dark"] .modal { background: rgba(0,0,0,.6); }
[data-theme="dark"] mark.sh { background: #5a4a12; color: #fff3c4; }
[data-theme="dark"] .settings-search input { border-color: var(--line); }
[data-theme="dark"] .quick a:hover { box-shadow: 0 6px 18px rgba(0,0,0,.35); }
[data-theme="dark"] .mini-progress { background: #1d2840; }
[data-theme="dark"] .agent-msg.bot, [data-theme="dark"] .agent-thinking { background: var(--panel-2); color: var(--ink); }
[data-theme="dark"] .agent-send-body { background: var(--panel-2); }
[data-theme="dark"] .topup-cta { box-shadow: none; }
[data-theme="dark"] .card #zohoSupportWebToCase #zsBrowseAttachment { background: var(--panel-2); border-color: var(--line-strong); }

/* Theme switch (sidebar footer) */
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0;
  border: 1px solid rgba(255,255,255,.14); border-radius: 9px; background: transparent; color: #c6d2ea; cursor: pointer; }
.theme-toggle:hover { background: rgba(255,255,255,.08); color: #fff; }
.theme-toggle svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: block; }
[data-theme="dark"] .theme-toggle .moon { display: none; }
.sidebar-foot .foot-row { gap: 8px; }
.sidebar-foot .foot-row .logout { margin-left: auto; }

/* Liv in dark mode: the thread's light wash and the light-blue "free" bars. */
[data-theme="dark"] .liv-thread { background: radial-gradient(1200px 400px at 50% -200px, #16233f, transparent), var(--panel); }
[data-theme="dark"] .liv-chart .bar.free { background: linear-gradient(180deg, #3d5f94, #2f4f80); }
[data-theme="dark"] .liv-gate { background: rgba(0,0,0,.55); }
[data-theme="dark"] .liv-chip.trial { border-color: #2a4170; }
[data-theme="dark"] .liv-chip.trial.low { background: rgba(245,130,31,.14); border-color: #6b4317; }
[data-theme="dark"] .liv-ring { background: conic-gradient(var(--blue) calc(var(--p) * 1%), #2a3a5c 0); }
[data-theme="dark"] .liv-chip.trial.low .liv-ring { background: conic-gradient(var(--orange) calc(var(--p) * 1%), #4a3218 0); }
[data-theme="dark"] .liv-ring::after { background: var(--panel); }
[data-theme="dark"] .liv-icon-btn:hover { border-color: var(--line-strong); }
[data-theme="dark"] .liv-receipt.free, [data-theme="dark"] .liv-points li::before { background: rgba(60,194,138,.16); }
[data-theme="dark"] .liv-note.err { background: rgba(240,96,90,.14); }
[data-theme="dark"] .liv.busy .liv-send { background: #2a3650; }
[data-theme="dark"] .liv-locked-bar { background: rgba(245,130,31,.08); }
[data-theme="dark"] .liv-price div { background: var(--panel-2); border-color: var(--line); }
[data-theme="dark"] .liv-suggest button:hover { border-color: #35507f; box-shadow: 0 8px 22px rgba(0,0,0,.35); }
[data-theme="dark"] .liv-meta, [data-theme="dark"] .liv-fine { color: #7d8ba1; }

/* Liv composer: the textarea sits inside .liv-input, which already draws the
   box — keep the dark-theme input background/border off it. */
[data-theme="dark"] .liv-input textarea { background: transparent; border: 0; box-shadow: none; }
.liv-input textarea:focus, .liv-input textarea:focus-visible { outline: 0; border: 0; }

/* ── Liv: "How Liv works & your data" (2026-10-07) ── */
.liv-info-btn { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-left: 4px; padding: 0;
  border: 1px solid var(--line-strong); border-radius: 50%; background: var(--panel); color: var(--muted);
  font: 700 11px/1 inherit; cursor: pointer; vertical-align: 1px; }
.liv-info-btn:hover, .liv-info-btn:focus-visible { border-color: var(--blue); color: var(--blue); }
.liv-link { border: 0; background: none; padding: 0; font: inherit; color: var(--blue); text-decoration: underline; cursor: pointer; }
.liv-terms-note { margin: 18px auto 0; font-size: 12.5px; color: var(--muted); max-width: 480px; }
.liv-gate-terms { font-size: 12.5px; color: var(--muted); margin: 0 0 14px; }
dialog.liv-info { width: min(640px, calc(100vw - 24px)); max-height: min(86vh, 860px); padding: 0; border: 0; border-radius: 18px;
  background: var(--panel); color: var(--ink); box-shadow: 0 24px 70px rgba(0,0,0,.35); overflow: hidden; }
dialog.liv-info[open] { display: flex; flex-direction: column; }
dialog.liv-info::backdrop { background: rgba(15,37,87,.45); backdrop-filter: blur(3px); }
[data-theme="dark"] dialog.liv-info::backdrop { background: rgba(0,0,0,.6); }
.liv-info-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 12px;
  border-bottom: 1px solid var(--line); }
.liv-info-head h2 { margin: 0; font-size: 19px; color: var(--heading); }
.liv-info-x { border: 0; background: none; font-size: 26px; line-height: 1; color: var(--muted); cursor: pointer; padding: 2px 6px; border-radius: 8px; }
.liv-info-x:hover { background: var(--panel-2); color: var(--ink); }
.liv-info-body { padding: 6px 22px 10px; overflow-y: auto; font-size: 14px; line-height: 1.55; }
.liv-info-body h3 { margin: 16px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.liv-info-body ul { margin: 0; padding-left: 18px; }
.liv-info-body li { margin: 4px 0; }
.liv-info-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 22px 16px;
  border-top: 1px solid var(--line); font-size: 13px; }
@media (max-width: 480px) {
  dialog.liv-info { border-radius: 16px; max-height: 90vh; }
  .liv-info-head, .liv-info-body, .liv-info-foot { padding-left: 16px; padding-right: 16px; }
}

/* ══════════════════════════════════════════════════════════════════════
   Buy SMS / Top-up (v27, 2026-10-07): three steps + sticky order summary.
   The volume price list lives collapsed inside step 1 instead of its own
   half-page card.
   ══════════════════════════════════════════════════════════════════════ */
.buy-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); gap: 18px;
  align-items: start; max-width: 1180px; }
.buy-steps { display: grid; gap: 18px; min-width: 0; }
.buy-step { padding-top: 18px; }
.step-h { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 17px; color: var(--heading); }
.step-n { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; flex: none;
  background: var(--blue-soft); color: var(--blue); font-size: 13px; font-weight: 800; }
.buy-row { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: flex-end; margin-bottom: 14px; }
.buy-country { flex: 0 1 220px; margin: 0; }
.buy-mode { display: flex; flex-direction: column; gap: 6px; }
.buy-mode-l { font-size: 13px; font-weight: 600; color: var(--muted); }
.buy-amount { display: block; margin: 0; max-width: 320px; }
.buy-input { display: flex; align-items: stretch; margin-top: 6px; border: 1px solid var(--line-strong);
  border-radius: 12px; overflow: hidden; background: var(--panel); }
.buy-input:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(31,95,214,.15); }
.buy-unit { display: grid; place-items: center; min-width: 44px; padding: 0 10px; background: var(--panel-2);
  color: var(--muted); font-weight: 700; border-right: 1px solid var(--line); }
.buy-unit.wide { min-width: 56px; font-size: 13px; }
.buy-input input { border: 0; border-radius: 0; margin: 0; font-size: 22px; font-weight: 700; padding: 10px 12px;
  color: var(--heading); background: transparent; box-shadow: none; }
.buy-input input:focus { outline: 0; box-shadow: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.chip { border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink); border-radius: 999px;
  padding: 6px 14px; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.chip:hover { border-color: var(--blue); color: var(--blue); }
.chip.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.buy-equiv { margin: 10px 0 0; font-size: 14px; color: var(--muted); min-height: 1.2em; }
.buy-nudge { margin: 8px 0 0; padding: 9px 12px; border-radius: 10px; font-size: 13.5px;
  background: rgba(31,157,107,.09); color: var(--ink); border: 1px solid rgba(31,157,107,.25); }
.linkish { border: 0; background: none; padding: 0; font: inherit; font-weight: 700; color: var(--blue);
  text-decoration: underline; cursor: pointer; }
.tiers { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.tiers > summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--blue); padding: 4px 0; }
.tiers-sub { display: block; font-weight: 400; font-size: 12.5px; margin-left: 18px; }
.tier-table { width: 100%; max-width: 420px; border-collapse: collapse; font-size: 13.5px; margin-top: 8px; }
.tier-table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); font-weight: 600; padding: 6px 10px; border-bottom: 1px solid var(--line); }
.tier-table td { padding: 6px 10px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.tier-table tr[data-q] { cursor: pointer; }
.tier-table tr[data-q]:hover td, .tier-table tr[data-q]:focus td { background: var(--panel-2); }
.tier-table tr[data-q]:focus { outline: 0; }
.tier-table tr.on td { background: var(--blue-soft); font-weight: 700; color: var(--heading); }
.tier-table .off { color: var(--ok); font-weight: 700; font-size: 12px; margin-left: 4px; }
.buy-grid [hidden] { display: none !important; }   /* .r / .hint display rules would otherwise beat [hidden] */
.pay-tiles { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.pay-tiles .method { padding: 12px 14px; margin: 0; }
.pay-note { margin-top: 10px; }
.doc-seg { margin-bottom: 4px; }
.invoice-fields { margin-top: 12px; }
.invoice-fields .calc-grid label { margin: 0; }
.buy-summary { position: sticky; top: 18px; }
.sum-big { font-size: 34px; font-weight: 800; color: var(--heading); line-height: 1.1; margin-top: 4px;
  font-variant-numeric: tabular-nums; }
.sum-big small { font-size: 15px; font-weight: 600; color: var(--muted); }
.sum-sub { font-size: 13.5px; margin: 2px 0 6px; }
.buy-summary .result-rows .v { font-variant-numeric: tabular-nums; }
.buy-summary .result-rows .r.save .v { color: var(--ok); }
.sum-credit { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: rgba(31,157,107,.08);
  border: 1px solid rgba(31,157,107,.22); }
.sum-credit .r { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; font-weight: 600; }
.sum-credit .r .v { color: var(--ok); font-weight: 800; font-variant-numeric: tabular-nums; }
.sum-bonus { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.sum-bonus strong { color: var(--ok); }
[data-theme="dark"] .sum-credit { background: rgba(60,194,138,.1); border-color: rgba(60,194,138,.28); }
.buy-summary .btn.block { margin-top: 14px; padding-top: 12px; padding-bottom: 12px; font-size: 15px; }
.buy-summary .btn:disabled { opacity: .5; cursor: not-allowed; }
[data-theme="dark"] .buy-nudge { background: rgba(60,194,138,.1); border-color: rgba(60,194,138,.3); }
@media (max-width: 960px) {
  .buy-grid { grid-template-columns: minmax(0, 1fr); }
  .buy-summary { position: static; }
}
@media (max-width: 560px) {
  .buy-country { flex-basis: 100%; }
  .buy-amount { max-width: none; }
  .sum-big { font-size: 28px; }
}

/* ── Liv: "What Liv can do" panel + scheduled SMS card (2026-10-07) ── */
dialog.liv-caps { width: min(920px, calc(100vw - 24px)); }
.liv-caps-lead { margin: 12px 0 4px; color: var(--muted); }
.caps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin: 10px 0 6px; }
.cap-group { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: var(--panel-2); }
.liv-info-body .cap-group h3 { margin: 0 0 6px; font-size: 14px; text-transform: none; letter-spacing: 0; color: var(--heading); }
.cap-group ul { list-style: none; padding: 0; margin: 0; }
.cap-group li { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 6px 0;
  border-top: 1px solid var(--line); font-size: 13.5px; }
.cap-group li:first-child { border-top: 0; }
.cap-group.cant { background: transparent; border-style: dashed; }
.cap-group.cant li { display: list-item; list-style: none; color: var(--muted); }
.liv-try { flex: none; border: 1px solid var(--line-strong); background: var(--panel); color: var(--blue); border-radius: 999px;
  padding: 3px 10px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.liv-try:hover, .liv-try:focus-visible { border-color: var(--blue); background: var(--blue-soft); }
.liv-caps-cta { margin: 14px 0 0; }
.agent-send-when { font-weight: 700; color: var(--heading); font-size: 13.5px; margin: 2px 0 4px; }

/* ── Connect your AI (/ai-apps) ── */
.ai-jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.ai-jump a { border: 1px solid var(--line-strong); border-radius: 999px; padding: 5px 12px; font-size: 13px;
  font-weight: 600; color: var(--blue); text-decoration: none; background: var(--panel); }
.ai-jump a:hover, .ai-jump a:focus-visible { border-color: var(--blue); background: var(--blue-soft); }
.ai-jump a[aria-current="page"] { background: var(--blue); border-color: var(--blue); color: #fff; }
.ai-tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 18px; }
.ai-tool { scroll-margin-top: 80px; }
.ai-tool h2 { font-size: 18px; margin: 0 0 4px; }
.ai-steps { margin: 10px 0 0; padding-left: 20px; }
.ai-steps li { margin: 0 0 8px; line-height: 1.5; }
.ai-cmd { position: relative; margin: 6px 0 10px; }
.ai-cmd pre { margin: 0; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12.5px;
  background: #0f2557; color: #cfe0ff; padding: 12px 14px; padding-right: 112px; border-radius: 10px;
  white-space: pre-wrap; word-break: break-all; }
.ai-cmd .btn { position: absolute; top: 8px; right: 8px; }
.ai-cando { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 6px 24px; margin: 8px 0 0; }
.ai-cando ul { margin: 4px 0 0; padding-left: 18px; }
.ai-cando li { margin: 0 0 4px; }
@media (max-width: 600px) {
  .ai-cmd pre { padding-right: 14px; }
  .ai-cmd .btn { position: static; display: block; margin: 6px 0 0 auto; }
}
/* Account → API: connected AI apps (a list, so it fits the narrow card) */
.ai-conn { list-style: none; margin: 12px 0 0; padding: 0; }
.ai-conn li { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 0; border-top: 1px solid var(--line); }
.ai-conn form { margin: 0; flex: none; }
/* ── Client guide (/guide) ── */
.guide { display: grid; gap: 18px; }
.guide-sec { scroll-margin-top: 80px; }
.guide-sec h2 { font-size: 21px; margin: 0 0 10px; }
.guide-sec h3 { font-size: 16px; margin: 18px 0 6px; }
.guide-sec ol, .guide-sec ul { padding-left: 22px; margin: 6px 0 10px; }
.guide-sec li { margin: 0 0 6px; line-height: 1.55; }
.guide-shot { margin: 12px 0 16px; }
.guide-shot { max-width: 880px; }
.guide-shot img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 6px 20px rgba(15, 37, 87, .08); }
.guide-shot figcaption { font-size: 12px; color: var(--muted); margin-top: 6px; }
.guide-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 0 18px; align-items: start; }
.guide-pair .guide-shot img[src*="_mobile"] { max-width: 300px; }


/* Viber rows on Billing → Transactions (2026-10-08) */
.badge.viber { background: #efeafd; color: #59267c; }
[data-theme="dark"] .badge.viber { background: rgba(115,96,242,.22); color: #c9b8ff; }

/* Admin → Health (ops monitoring, 2026-10-08, v34) */
.health-items { margin: 6px 0 0; padding-left: 18px; }
.health-items li { margin: 2px 0; }
.health-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.health-actions form { margin: 0; }
.health-trace { white-space: pre-wrap; word-break: break-word; font-size: 12px; line-height: 1.45;
  background: var(--panel-2); border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 10px 12px; max-height: 420px; overflow: auto; margin: 6px 0 0; }

/* ── 2026-10-09 (v35) ─────────────────────────────────────────────── */
/* Liv header: two groups of one height — a read-only meter pill
   (balance │ trial │ this chat) and one joined action bar. */
.liv-tools { gap: 10px; }
.liv-meter, .liv-actions { display: inline-flex; flex-wrap: nowrap; align-items: stretch; height: 34px; overflow: hidden; flex: none; }
.liv-meter { border: 1px solid var(--line); border-radius: 999px; background: var(--panel-2); }
.liv-meter .liv-chip, .liv-meter .liv-chip.trial, .liv-meter .liv-chip.trial.low {
  height: auto; margin: 0; padding: 0 12px; border: 0; border-radius: 0; background: transparent; }
.liv-meter .liv-chip + .liv-chip { border-left: 1px solid var(--line); }
.liv-meter .liv-chip.trial.low { color: var(--orange-dark); }
.liv-actions { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.liv-actions .liv-icon-btn { height: auto; margin: 0; border: 0; border-radius: 0; background: transparent; }
.liv-actions .liv-icon-btn + .liv-icon-btn { border-left: 1px solid var(--line); }
.liv-actions .liv-icon-btn:hover { background: var(--panel-2); }
@media (max-width: 768px) {
  .liv-tools { justify-content: space-between; }
  .liv-meter, .liv-actions { height: 30px; }
  .liv-meter .liv-chip, .liv-meter .liv-chip.trial, .liv-meter .liv-chip.trial.low { padding: 0 8px; }
  /* The meter gives way first: a long (Greek) trial label ends in "…", the buttons never clip. */
  .liv-meter { flex: 0 1 auto; min-width: 0; }
  .liv-meter .liv-chip.trial { min-width: 0; overflow: hidden; }
  .liv-meter .liv-chip.trial > span:last-child { overflow: hidden; text-overflow: ellipsis; }
  .liv-actions .liv-icon-btn { padding: 0 7px; }
}

/* Admin → All orders: column titles stay put while the list scrolls. */
.table-scroll.sticky-head { max-height: calc(100vh - 230px); max-height: calc(100dvh - 230px); min-height: 320px; overflow: auto; }
.sticky-head table.grid thead th { position: sticky; top: 0; z-index: 2; background: var(--panel);
  box-shadow: inset 0 -1px 0 var(--line-strong); }

/* Admin → Customers: live search */
.live-search { position: relative; flex: 1 1 260px; max-width: 380px; }
.live-search input { width: 100%; margin: 0; padding-right: 34px; }
.live-search-spin { position: absolute; right: 11px; top: 50%; width: 14px; height: 14px; margin-top: -7px;
  border: 2px solid var(--line-strong); border-top-color: var(--blue); border-radius: 50%; opacity: 0; }
.busy .live-search-spin { opacity: 1; animation: live-spin .7s linear infinite; }
@keyframes live-spin { to { transform: rotate(360deg); } }
@media (max-width: 768px) { .live-search { max-width: none; flex-basis: auto; } }

/* Sender IDs: the code box gets its own highlighted card */
.sid-otp-card { border: 2px solid var(--blue); background: var(--blue-soft); margin-bottom: 18px; }
.sid-otp-card h2 { font-size: 18px; margin: 0 0 4px; color: var(--heading); }
.sid-otp-card > p { margin: 0 0 12px; font-size: 13.5px; }
.sid-otp { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; padding: 12px 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.sid-otp + .sid-otp { margin-top: 10px; }
.sid-otp-who { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sid-otp-who .muted { font-size: 12.5px; }
.sid-otp-name { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-weight: 700; font-size: 17px; color: var(--heading); }
.sid-otp-form { display: flex; gap: 8px; align-items: stretch; margin: 0; }
.sid-otp-input { width: 9.5em; margin: 0; padding: 10px 12px; text-align: center;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 22px !important; font-weight: 700;
  letter-spacing: .35em; border: 2px solid var(--blue); border-radius: 10px; background: var(--panel); color: var(--heading); }
.sid-otp-input::placeholder { color: var(--line-strong); letter-spacing: .25em; }
.sid-otp-input:focus { outline: 3px solid rgba(31,95,214,.25); outline-offset: 1px; }
.sid-otp-form .btn { margin: 0; }
.sid-otp-cancel { margin: 0; }
.sid-otp-cancel .linkish { color: var(--muted); font-weight: 600; font-size: 13px; }
.sid-req-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
[data-theme="dark"] .sid-otp-card { background: rgba(31,95,214,.10); }
@media (max-width: 560px) {
  .sid-req-grid { grid-template-columns: 1fr; }
  .sid-otp-form { width: 100%; }
  .sid-otp-input { flex: 1; width: auto; min-width: 0; }
}

/* Tables that become stacked rows on phones: add `stack-sm` to the table,
   `data-label` to each cell, `stack-title` / `stack-action` to the first/last. */
@media (max-width: 560px) {
  table.grid.stack-sm, .stack-sm tbody, .stack-sm tr, .stack-sm td { display: block; width: 100%; }
  .stack-sm thead { display: none; }
  .stack-sm tr { position: relative; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .stack-sm td { border: 0; padding: 3px 0; }
  .stack-sm td[data-label] { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
  .stack-sm td[data-label]::before { content: attr(data-label); color: var(--muted); font: 600 12px/1.4 "sofia-pro", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
  .stack-sm tr:last-child { border-bottom: 0; }
  .stack-sm td.stack-title { padding-right: 44px; }
  .stack-sm td.stack-action { position: absolute; top: 6px; right: 0; width: auto; padding: 0; }
  .stack-sm tr:hover td { background: transparent; }
}

/* v36 — Liv streaming (2026-10-09): the live draft and the finished reply that
   replaces it must not replay the entrance animation. */
.liv-row.live, .liv-row.live .agent-msg,
.liv-row.no-anim, .liv-row.no-anim .agent-msg { animation: none; }

/* v36 — a confirmed Liv card stays visible but can never be pressed again. */
.agent-send-card.confirmed { opacity: .85; }
.agent-send-card.confirmed .agent-enc { opacity: .6; }
.agent-send-status { font-size: 14px; font-weight: 600; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.agent-send-status.done { color: #2e9e5b; }
.agent-send-status.unsure { color: #b26b00; font-weight: 500; }
.agent-send-card.unsure { border-left-color: #e0a100; }
.agent-send-status.replaced { color: var(--muted, #6b7280); font-weight: 500; }

/* Liv: campaign page form inside the chat (2026-10-13) */
.agent-send-card.wide { max-width: 100%; width: min(680px, 100%); }
.liv-pform { display: flex; flex-direction: column; gap: 10px; }
.liv-pform .pf-field { display: flex; flex-direction: column; gap: 3px; margin: 0; min-width: 0; }
.liv-pform .pf-label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.liv-pform .pf-sub { margin-top: 4px; }
.liv-pform .pf-hint { font-size: 12px; color: var(--muted); font-weight: 400; }
.liv-pform input[type=text], .liv-pform input[type=date], .liv-pform select, .liv-pform textarea { width: 100%; font-size: 14px; box-sizing: border-box; }
.liv-pform input[type=file] { font-size: 13px; max-width: 100%; }
.liv-pform .pf-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.liv-pform .pf-btn { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 6px; }
@media (max-width: 640px) { .liv-pform .pf-row2, .liv-pform .pf-btn { grid-template-columns: 1fr; } }

/* ── Menu search (2026-10-15, v38) ──
   Box under the top-up button; while it has text the sidebar gets
   .nav-searching: every section shows open, non-matching items and empty
   sections hide, and search-only deep links (.nav-deep) appear. */
.nav-search { position: relative; }
.nav-search .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px;
  color: #8ea4cc; pointer-events: none; }
.sidebar .nav-search input { margin: 0; height: 38px; padding: 0 56px 0 34px; font-size: 14px; color: #fff;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); border-radius: 10px; }
.sidebar .nav-search input::placeholder { color: #8ea4cc; }
.sidebar .nav-search input:focus { outline: 2px solid rgba(255,255,255,.55); outline-offset: 0; border-color: transparent;
  background: rgba(255,255,255,.12); }
.nav-search input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.nav-search kbd { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font-family: inherit;
  font-size: 10.5px; font-weight: 600; line-height: 1;
  color: #8ea4cc; border: 1px solid rgba(255,255,255,.18); border-radius: 5px; padding: 3px 5px; pointer-events: none; }
.nav-search kbd[hidden] { display: none; }
.nav-search-clear { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px;
  border: 0; border-radius: 7px; background: none; color: #c6d2ea; font-size: 20px; line-height: 1; cursor: pointer; }
.nav-search-clear:hover { background: rgba(255,255,255,.1); color: #fff; }
.nav-search-clear[hidden] { display: none; }

.sidebar nav a.nav-deep { display: none; }
.sidebar nav a small { display: block; font-size: 11.5px; color: #8ea4cc; font-weight: 400; margin-top: 1px; }
.sidebar.nav-searching nav a:not(.nav-hit) { display: none; }
.sidebar.nav-searching nav a.nav-deep.nav-hit { display: flex; }
.sidebar.nav-searching .nav-sec.nav-empty,
.sidebar.nav-searching .nav-rule { display: none; }
.sidebar.nav-searching .nav-items { grid-template-rows: 1fr; transition: none; }
/* Must out-rank `.sidebar .nav-sec:not(.open) .nav-items > div {visibility:hidden}`
   (closed sections), or hits inside a closed section take space but stay invisible. */
.sidebar.nav-searching .nav-sec:not(.nav-empty) .nav-items > div { visibility: visible; transition: none; }
.sidebar.nav-searching .nav-group .chev { visibility: hidden; }
.sidebar.nav-searching button.nav-group { pointer-events: none; }
.sidebar nav a.nav-first:not(.active) { background: rgba(255,255,255,.1); color: #fff; }
.sidebar nav a.nav-first:not(.active)::after { content: "↵"; margin-left: auto; font-size: 12px; color: #8ea4cc; }
.nav-noresult { margin: -6px 10px 0; font-size: 13px; line-height: 1.5; color: #9fb2d4; }
.nav-noresult a { color: #fff; }
@media (max-width: 960px) {
  .sidebar .nav-search input { font-size: 16px; height: 42px; } /* 16px: no iOS zoom on focus */
  .nav-search kbd { display: none; }
}

/* ── Public website link (2026-10-15, v40) ── sidebar footer, opens in a new tab. */
.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; }
.sidebar-foot .site-link { display: flex; align-items: center; gap: 11px; margin: 0 0 8px; padding: 8px 10px; border-radius: 9px;
  color: #c6d2ea; text-decoration: none; font-size: 14px; line-height: 1.3; }
.sidebar-foot .site-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-foot .site-link:focus-visible { outline: 2px solid rgba(255,255,255,.55); outline-offset: -2px; }
.sidebar-foot .site-link .ic { width: 18px; height: 18px; flex: none; opacity: .85; }
.sidebar-foot .site-link .ext { width: 13px; height: 13px; flex: none; margin-left: auto; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: .7; }
.logo-auth-link { display: block; width: max-content; margin: 0 auto; border-radius: 8px; }
.logo-auth-link:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }

/* Masquerade (v41): the orange banner is sticky above the layout, so a full-height
   sticky sidebar slid under it and its footer (EN/EL, dark mode, Log out) fell
   below the window. On desktop the sidebar now starts under the banner and is
   that much shorter. --masq-h is measured by base.html (the banner can wrap). */
@media (min-width: 961px) {
  .masq-banner ~ .layout .sidebar { top: var(--masq-h, 52px);
    height: calc(100vh - var(--masq-h, 52px)); height: calc(100dvh - var(--masq-h, 52px)); }
}
/* v41: the footer (EN/EL, dark mode, Log out) stays pinned to the bottom of the
   sidebar; when the menu is taller than the window only the items above scroll.
   It spans the sidebar padding (12px sides, 14px bottom) so items scroll under it. */
.sidebar-foot { position: sticky; bottom: -14px; z-index: 2; background: var(--navy-2);
  margin: auto -12px -14px; padding: 12px 12px 14px; }
