/* ==========================================================================
   happ · Agent Admin — UI kit
   Rebuilt from the reference set desk-00…22 + mob-00…22.
   Layout is driven by a CONTAINER QUERY on .shell (width < 1000px = mobile),
   so the same document can be forced into either design:
       <html data-mode="mobile">  → 390px phone canvas
       <html data-mode="desktop"> → 1280px+ PC canvas
   ========================================================================== */

:root {
  --sidebar-w: 260px;
  --radius: 10px;
  --radius-sm: 8px;
  --font: "Inter", "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --accent: #ff6b35;
  --blue: #2f7bf6;
  --good: #35c46a;
  --warn: #e0a72c;
  --bad: #ef4d4d;
  --shadow: 0 18px 40px rgba(0, 0, 0, .45);
  --dur: .16s;
}

html[data-theme="dark"] {
  --bg: #0c0e10;
  --bg-soft: #101316;
  --panel: #14181b;
  --panel-2: #191e22;
  --panel-3: #1f252a;
  --border: #262d33;
  --border-strong: #333c44;
  --text: #e7eaed;
  --text-dim: #b9c0c7;
  --muted: #8a939c;
  --faint: #636c75;
  --accent-soft: #3a2016;
  --blue-soft: #16283f;
  --warn-soft: #2c2413;
  --good-soft: #122c1c;
  --dot-idle: #4a5a6b;
}

html[data-theme="light"] {
  --bg: #f4f6f8;
  --bg-soft: #eceff2;
  --panel: #ffffff;
  --panel-2: #f8fafb;
  --panel-3: #eef1f4;
  --border: #e1e5ea;
  --border-strong: #cbd2d9;
  --text: #12171c;
  --text-dim: #39424b;
  --muted: #6b747d;
  --faint: #9aa3ac;
  --accent-soft: #ffe7dd;
  --blue-soft: #e3edfd;
  --warn-soft: #fdf4dd;
  --good-soft: #e2f6e9;
  --dot-idle: #97a3ae;
  --shadow: 0 16px 36px rgba(20, 30, 40, .12);
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  background: #07090a;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ==========================================================================
   Canvas / shell
   ========================================================================== */
.shell {
  container-type: inline-size;
  position: relative;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  margin: 0 auto;
}

html[data-mode="desktop"] body { overflow-x: auto; }
html[data-mode="desktop"] .shell { min-width: 1280px; }

html[data-mode="mobile"] body { overflow: auto; }
html[data-mode="mobile"] .shell {
  width: 390px;
  min-width: 390px;
  height: 844px;
  max-height: 100dvh;
  margin: 18px auto;
  border: 1px solid var(--border-strong);
  border-radius: 26px;
  box-shadow: var(--shadow);
}

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: 1fr auto;
  height: 100%;
  overflow: hidden;
}

/* ---------- desktop sidebar ---------- */
.sidebar {
  grid-column: 1; grid-row: 1;
  display: flex; flex-direction: column; gap: 4px;
  padding: 16px 12px 12px;
  background: var(--bg-soft);
  border-right: 1px solid var(--border);
  min-height: 0;
}

.nav { display: flex; flex-direction: column; gap: 3px; overflow-y: auto; min-height: 0; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: none; color: var(--text-dim); cursor: pointer; text-align: left;
  transition: background var(--dur), color var(--dur), border-color var(--dur);
}
.nav-item .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--dot-idle); flex: none; }
.nav-item:hover { background: var(--panel); color: var(--text); }
.nav-item.is-active {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--accent); font-weight: 600;
}
.nav-item.is-active .dot { background: var(--accent); }
.sidebar-foot { margin-top: auto; padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }

/* ---------- mobile top bar (hidden on desktop) ---------- */
.brandbar { display: none; }
.ibtn {
  flex: none;
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-strong);
  border-radius: 13px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.ibtn:active { background: var(--panel); }
.brandlogo {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--accent); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 21px; font-weight: 700; line-height: 1;
  flex: none;
}
.brandtext { display: flex; flex-direction: column; line-height: 1.15; }
.brandtext b { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.brandtext i { font-style: normal; font-size: 13px; color: var(--muted); }
.agentstatus { margin-left: auto; display: inline-flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--text-dim); }
.agentstatus .ok { width: 9px; height: 9px; border-radius: 50%; background: var(--good); flex: none; }

/* ---------- main ---------- */
.main { grid-column: 2; grid-row: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }

.topbar { padding: 14px 18px 10px; }

.askbar { display: flex; gap: 10px; }
.askbar input {
  flex: 1; min-width: 0;
  padding: 12px 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  font-family: var(--mono); font-size: 13.5px;
}
.askbar input::placeholder { color: var(--faint); }
.askbar input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel); color: var(--text);
  cursor: pointer; white-space: nowrap;
  transition: background var(--dur), border-color var(--dur), transform var(--dur);
}
.btn:hover { border-color: var(--border-strong); background: var(--panel-2); }
.btn:active { transform: translateY(1px); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.accent:hover { background: #ff7d4a; border-color: #ff7d4a; }
.btn.ghost { background: transparent; }
.btn.wide { width: 100%; }
.btn.sm { padding: 7px 11px; font-size: 13px; }
.btn.icon { padding: 8px 10px; }
.send {
  padding: 12px 22px; border-radius: var(--radius);
  background: var(--accent); border: 1px solid var(--accent);
  color: #fff; font-weight: 600; cursor: pointer;
}

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; align-items: center; padding: 0 18px 12px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 8px 14px; border: 1px solid transparent; border-radius: var(--radius-sm);
  background: none; color: var(--muted); cursor: pointer; white-space: nowrap;
}
.tab:hover { color: var(--text); background: var(--panel); }
.tab.is-active { background: var(--panel); border-color: var(--border-strong); color: var(--text); font-weight: 600; }

/* ---------- content ---------- */
.content { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 18px 22px; display: flex; flex-direction: column; gap: 14px; }

.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.panel-title { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.panel-sub { color: var(--muted); font-size: 12.5px; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; min-width: 0; }
.kpi .label { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .value { font-family: var(--mono); font-size: 26px; font-weight: 500; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .value .unit { font-size: 15px; color: var(--muted); margin-left: 6px; }
.kpi .foot { margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.kpi .foot .up { color: var(--good); }
.kpi .value.bad { color: var(--bad); }

.cols { display: grid; grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr); gap: 12px; align-items: start; }

.bars { display: flex; flex-direction: column; gap: 11px; }
.bar-row { display: grid; grid-template-columns: 150px 1fr 120px; gap: 12px; align-items: center; }
.bar-name { font-family: var(--mono); font-size: 12.5px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; }
.bar-track { height: 9px; border-radius: 6px; background: var(--panel-3); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; background: var(--blue); }
.bar-fill.hot { background: var(--accent); }
.bar-val { font-family: var(--mono); font-size: 12.5px; text-align: right; color: var(--text-dim); }

.products { display: flex; flex-direction: column; }
.product { padding: 11px 0; border-top: 1px solid var(--border); }
.product:first-child { border-top: 0; padding-top: 0; }
.product-head { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.product-name { font-weight: 600; }
.product-val { font-family: var(--mono); font-size: 12.5px; color: var(--text-dim); }

.chip {
  display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--panel-2);
  font-family: var(--mono); font-size: 11.5px; color: var(--muted); white-space: nowrap;
}
.chip.accent { border-color: color-mix(in srgb, var(--accent) 55%, transparent); color: var(--accent); background: var(--accent-soft); }

.insight { color: var(--text-dim); font-size: 13.5px; }

.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 130px; }
.field > span { font-size: 12px; color: var(--muted); font-family: var(--mono); }
.field.wide { flex: 1 1 220px; }
input, select {
  padding: 9px 11px; background: var(--panel-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); outline: none; min-width: 0; width: 100%;
}
input:focus, select:focus { border-color: var(--accent); }
select { appearance: none; padding-right: 30px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.seg button { padding: 8px 14px; background: var(--panel-2); border: 0; cursor: pointer; color: var(--muted); white-space: nowrap; }
.seg button.is-active { background: var(--panel-3); color: var(--text); font-weight: 600; }
.check { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; cursor: pointer; }
.check input { width: 15px; height: 15px; accent-color: var(--accent); padding: 0; width: auto; }
.spacer { margin-left: auto; }

.banner {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 13px 15px; border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent);
  background: var(--warn-soft); color: var(--text-dim); font-size: 13px;
}
.banner b { color: var(--text); }
.banner .ic { color: var(--warn); }

.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; min-width: 560px; }
table.fit { min-width: 0; }
thead th {
  text-align: left; padding: 9px 12px;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); font-weight: 500; border-bottom: 1px solid var(--border); white-space: nowrap;
}
tbody td { padding: 11px 12px; border-bottom: 1px solid var(--border); font-family: var(--mono); font-size: 13px; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--panel-2); }
td.num, th.num { text-align: right; }
td .cell-sub { display: block; font-size: 11.5px; color: var(--muted); }
.link { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }

.empty {
  padding: 34px 18px; text-align: center; color: var(--muted);
  border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); font-size: 13.5px;
}

.split { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 12px; align-items: start; }
.list { display: flex; flex-direction: column; gap: 4px; max-height: 62vh; overflow-y: auto; }
.list-item { padding: 11px 13px; border: 1px solid transparent; border-radius: var(--radius-sm); background: none; cursor: pointer; text-align: left; width: 100%; }
.list-item:hover { background: var(--panel-2); }
.list-item.is-active { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.list-item .li-title { font-weight: 600; }
.list-item .li-meta { font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin-top: 3px; }

.subhead { font-family: var(--mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 4px 0 10px; }
.region { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 13px; margin-bottom: 12px; background: var(--panel-2); }
.region-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.region-name { font-weight: 600; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.range-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 10px; align-items: center; margin-bottom: 8px; }
.range-row .lbl { display: none; }
.back-row { display: none; }

/* ---------- agent transcript ---------- */
.transcript { display: flex; flex-direction: column; gap: 12px; }
.role { font-family: var(--mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.bubble { padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel-2); font-family: var(--mono); font-size: 13px; }
.bubble.tool { color: var(--good); background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 35%, transparent); }
.bubble.think { color: var(--muted); font-style: italic; }
.suggestions { display: flex; flex-wrap: wrap; gap: 8px; }
.suggestion { padding: 7px 12px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--panel-2); color: var(--text-dim); cursor: pointer; font-size: 12.5px; }
.suggestion:hover { border-color: var(--accent); color: var(--accent); }
.caret { display: inline-block; width: 8px; height: 14px; background: var(--accent); vertical-align: -2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- status bar (desktop only) ---------- */
.statusbar {
  grid-column: 1 / 3; grid-row: 2;
  display: flex; align-items: center; gap: 22px;
  padding: 7px 16px;
  background: var(--bg-soft); border-top: 1px solid var(--border);
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  white-space: nowrap; overflow-x: auto; scrollbar-width: none;
}
.statusbar::-webkit-scrollbar { display: none; }
.statusbar .ok { color: var(--good); }
.statusbar .sep { color: var(--faint); }
.statusbar .grow { margin-left: auto; }

/* ---------- toast ---------- */
.toast {
  position: absolute; right: 18px; bottom: 46px;
  padding: 12px 16px; border-radius: var(--radius);
  border: 1px solid var(--border-strong); background: var(--panel-3);
  box-shadow: var(--shadow); font-family: var(--mono); font-size: 13px;
  opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 60;
  max-width: min(360px, calc(100% - 36px));
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ---------- modal ---------- */
.backdrop {
  position: absolute; inset: 0; background: rgba(4, 6, 8, .62);
  display: none; align-items: center; justify-content: center; padding: 20px; z-index: 70;
}
.backdrop.show { display: flex; }
.modal {
  width: min(520px, 100%); max-height: 90%; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--border-strong);
  border-radius: 14px; padding: 22px; box-shadow: var(--shadow);
}
.modal h3 { margin: 0 0 8px; font-size: 18px; }
.modal p { margin: 0 0 18px; color: var(--muted); font-size: 13px; }
.modal .field { min-width: 0; margin-bottom: 14px; }
.modal input[readonly] { color: var(--muted); }
.ro-text { padding: 2px 0; color: var(--muted); font-family: var(--mono); font-size: 13px; word-break: break-word; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }

/* ---------- drawer ---------- */
.backdrop.drawer { align-items: stretch; justify-content: flex-start; padding: 0; }
.drawer-panel {
  width: min(288px, 84%); height: 100%;
  background: var(--bg-soft); border-right: 1px solid var(--border);
  padding: 16px 14px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto;
}

/* ---------- mode chooser (first screen) ---------- */
.chooser {
  position: absolute; inset: 0; z-index: 90;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 26px; text-align: center;
  background: radial-gradient(1200px 600px at 50% -10%, #1b2026 0%, #0c0e10 60%);
}
html[data-theme="light"] .chooser { background: radial-gradient(1200px 600px at 50% -10%, #ffffff 0%, #eef1f4 60%); }
.chooser.hidden { display: none; }
.chooser .kicker { font-family: var(--mono); font-size: 12px; letter-spacing: .28em; text-transform: uppercase; color: var(--muted); }
.chooser h1 { margin: 0; font-size: 30px; letter-spacing: -.02em; }
.chooser .sub { margin: 0 0 22px; color: var(--muted); font-size: 13.5px; max-width: 520px; }
.choices { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; }
.choice {
  width: 216px; padding: 24px 20px 22px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  border: 1px solid var(--border-strong); border-radius: 18px;
  background: var(--panel); color: var(--text); cursor: pointer;
  transition: border-color var(--dur), transform var(--dur), background var(--dur);
}
.choice:hover { border-color: var(--accent); transform: translateY(-2px); background: var(--panel-2); }
.choice svg { color: var(--accent); }
.choice b { font-size: 16px; letter-spacing: .12em; font-family: var(--mono); }
.choice span { color: var(--muted); font-size: 12.5px; }
.chooser .hint { margin-top: 26px; color: var(--faint); font-size: 12px; font-family: var(--mono); }

/* ==========================================================================
   MOBILE DESIGN  —  container width < 1000px
   Matches mob-00 … mob-22: happ header with agent status, ask row,
   scrollable tabs, 2-column KPI/filters, drawer nav, bottom-sheet settings.
   ========================================================================== */
@container (max-width: 999px) {
  .app { display: flex; flex-direction: column; height: 100%; overflow: hidden; }

  .sidebar { display: none; }

  .brandbar {
    display: flex; align-items: center; gap: 12px;
    flex: none; padding: 12px 14px;
    background: var(--bg); border-bottom: 1px solid var(--border);
    z-index: 30;
  }

  .main { flex: 1 1 auto; min-height: 0; }

  .topbar { padding: 14px; border-bottom: 1px solid var(--border); flex: none; }
  .askbar { gap: 10px; }
  .askbar input { padding: 13px 14px; font-size: 14px; border-radius: 14px; }
  .send { padding: 13px 20px; border-radius: 14px; font-size: 15px; }

  .tabs { flex: none; padding: 14px; gap: 4px; }
  .tab { padding: 11px 15px; border-radius: 13px; font-size: 15px; }
  .tab.is-active { border-color: var(--border-strong); }

  .content { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 14px; gap: 14px; }

  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .kpi { padding: 16px; border-radius: 14px; }
  .kpi .label { font-size: 13px; margin-bottom: 10px; white-space: normal; }
  .kpi .value { font-size: 17px; letter-spacing: -.04em; }
  .kpi .value .unit { font-size: 13.5px; margin-left: 5px; }
  .kpi .foot { font-size: 13px; }

  .panel { padding: 16px; border-radius: 14px; }
  .panel-head { align-items: flex-start; flex-wrap: nowrap; gap: 10px; }
  .panel-title { font-size: 19px; line-height: 1.25; }
  .panel-head .toolbar { flex-direction: column; align-items: stretch; gap: 8px; flex: 0 0 auto; min-width: 52%; }
  .panel-head .field { min-width: 0; }

  .cols { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .list { max-height: none; }
  .list-item { padding: 14px 12px; }
  .list-item .li-title { font-size: 16px; }
  .list-item .li-meta { font-size: 13px; }

  .bar-row { grid-template-columns: minmax(0, 1fr) 54px auto; grid-template-areas: "name track value"; gap: 12px; }
  .bar-name { grid-area: name; font-size: 13.5px; }
  .bar-track { grid-area: track; height: 11px; }
  .bar-val { grid-area: value; font-size: 13.5px; }
  .bars { gap: 13px; }

  .filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; align-items: end; }
  .field { min-width: 0; gap: 7px; }
  .field > span { font-size: 13px; font-family: var(--font); }
  .field.wide { grid-column: auto; }
  .filters > .btn { width: 100%; padding: 13px 12px; border-radius: 13px; }
  .filters > .btn[style] { flex: none !important; }
  input, select { padding: 13px 12px; border-radius: 13px; font-size: 14px; }
  .toolbar { gap: 10px; }
  .toolbar .spacer { margin-left: 0; width: 100%; }
  .seg { overflow-x: auto; max-width: 100%; scrollbar-width: none; }
  .seg::-webkit-scrollbar { display: none; }
  .seg button { padding: 11px 14px; font-size: 14px; }
  .check { font-size: 14px; }
  .check input { width: 18px; height: 18px; }

  .banner { font-size: 14px; padding: 15px; border-radius: 14px; gap: 10px; }
  .empty { padding: 30px 18px; font-size: 15px; border-radius: 14px; }

  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .range-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .range-row .lbl { display: block; font-size: 11px; color: var(--muted); font-family: var(--mono); }
  .range-row .rm { grid-column: 1 / -1; }
  .region { padding: 14px; }
  .back-row { display: block; margin-bottom: 12px; }

  table { min-width: 520px; }
  thead th, tbody td { padding: 12px 10px; font-size: 13.5px; }
  tbody td .cell-sub { font-size: 12px; }

  .suggestions { flex-direction: column; align-items: flex-start; }
  .suggestion { border-radius: 12px; padding: 11px 14px; font-size: 14px; }
  .bubble { font-size: 14.5px; padding: 14px; border-radius: 14px; }
  .role { font-size: 12.5px; }

  /* status bar is a desktop feature */
  .statusbar { display: none; }

  .toast {
    left: 24px; right: 24px; bottom: 24px; max-width: none;
    border-radius: 14px; padding: 14px 16px; font-size: 14px; text-align: center;
  }

  .backdrop { padding: 0; align-items: flex-end; }
  .backdrop.drawer { align-items: stretch; }
  .modal {
    width: 100%; max-height: 92%;
    border-radius: 22px 22px 0 0;
    border-left: 0; border-right: 0; border-bottom: 0;
    padding: 22px 18px calc(22px + env(safe-area-inset-bottom));
  }
  .modal h3 { font-size: 20px; }
  .modal p { font-size: 14px; }
  .modal .field > span { font-size: 14px; font-family: var(--font); }
  .modal-actions .btn { padding: 13px 20px; border-radius: 13px; }

  .drawer-panel { width: 288px; padding: 16px 14px; gap: 2px; }
  .nav-item { padding: 12px 14px; font-size: 16px; gap: 14px; border-radius: 12px; }
  .nav-item .dot { width: 12px; height: 12px; }
  .nav-item.is-active { font-weight: 500; }
  .sidebar-foot .btn { padding: 15px; font-size: 15px; }
}

@container (max-width: 359px) {
  .agentstatus { display: none; }
  .kpis { grid-template-columns: minmax(0, 1fr); }
  .filters { grid-template-columns: minmax(0, 1fr); }
}
