:root {
  --bg: #f6f7f9; --panel: #ffffff; --ink: #0f1720; --ink-2: #3b4652; --muted: #6b7682; --line: #e4e7eb; --line-2: #eef0f3;
  --accent: #3d4cf5; --accent-ink: #ffffff; --accent-soft: #eef0ff;
  --block: #d4314f; --block-soft: #fdecef; --review: #8a5a12; --review-soft: #fdf5e6; --pass: #1f8a5b; --pass-soft: #e8f6ef; --warn: #9a6700;
  --radius: 12px; --radius-sm: 8px; --shadow: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
body.modal-open { overflow: hidden; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 24px; font-weight: 650; }
h2 { font-size: 15px; font-weight: 600; }
h3 { font-size: 15px; font-weight: 600; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: 0.9em; }
.tabular { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* shell */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 20px; padding: 20px 14px; background: #0e1320; color: #c9d1dc; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; font-weight: 650; font-size: 16px; padding: 2px 8px; }
.brand:hover { text-decoration: none; }
.sidebar .brand { color: #fff; }
.logo { width: 28px; height: 28px; flex: none; }
.logo rect { fill: var(--accent); }
.logo path { fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 8px; color: #aeb8c5; font-weight: 500; }
.sidebar nav a svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sidebar nav a:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.sidebar nav a.on { background: rgba(255,255,255,.1); color: #fff; }
.account { margin-top: auto; display: grid; gap: 8px; padding: 12px 10px; border-top: 1px solid rgba(255,255,255,.08); }
.account-name { display: grid; color: #fff; }
.account-name .muted { color: #8a95a3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-pill { justify-self: start; font-size: 12px; padding: 2px 8px; border-radius: 99px; background: rgba(61,76,245,.25); color: #c8cdff; }
.main { min-width: 0; padding: 32px clamp(16px, 4vw, 44px) 80px; }
.page { max-width: 1180px; margin: 0 auto; display: grid; gap: 20px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head p { margin-top: 4px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.center { min-height: 100vh; display: grid; place-items: center; }

/* cards */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; display: grid; gap: 14px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.stack { display: grid; gap: 14px; }
.callout { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; border-radius: var(--radius); background: linear-gradient(120deg, #eef0ff, #f5f3ff); border: 1px solid #dfe2ff; flex-wrap: wrap; }
.callout p { margin-top: 2px; }

/* kpis */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.kpi { text-align: left; font: inherit; color: inherit; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 2px; box-shadow: var(--shadow); }
.kpi-link { cursor: pointer; }
.kpi-link:hover { border-color: #cfd4ff; }
.kpi-label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.kpi-value { font-size: 26px; font-weight: 650; letter-spacing: -0.02em; }
.kpi-sub { font-size: 12.5px; color: var(--muted); }
.kpi-block .kpi-value { color: var(--block); }
.kpi-review .kpi-value { color: var(--review); }

/* chart */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 180px; padding-top: 8px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; min-width: 0; }
.bar { width: 100%; max-width: 38px; margin-top: auto; background: #c9cffd; border-radius: 6px 6px 2px 2px; display: flex; flex-direction: column-reverse; overflow: hidden; }
.bar-block { background: var(--block); width: 100%; }
.bar-review { background: #e6b35a; width: 100%; }
.bar-label { font-size: 11px; color: var(--muted); }
.rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rank-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.rank-row span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-bar { display: flex; height: 6px; background: var(--line-2); border-radius: 99px; overflow: hidden; margin-top: 4px; }
.seg-fire { background: var(--block); } .seg-review { background: #e6b35a; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 4px 10px; border-radius: 99px; background: var(--line-2); font-size: 13px; text-transform: capitalize; }
.chip b { margin-left: 4px; }

/* buttons and inputs */
.btn { font: inherit; font-size: 14px; font-weight: 550; padding: 8px 14px; border-radius: 9px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; min-height: 38px; transition: background .12s, border-color .12s; }
.btn:hover:not(:disabled) { background: #f7f8fa; border-color: #d5dae0; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover:not(:disabled) { background: #2f3de0; border-color: #2f3de0; }
.btn-danger { background: var(--block); border-color: var(--block); color: #fff; }
.btn-danger-soft { color: var(--block); }
.btn-danger-soft:hover:not(:disabled) { background: var(--block-soft); border-color: #f4c2cc; }
.btn-ghost { background: transparent; border-color: rgba(255,255,255,.14); color: #c9d1dc; }
.btn-ghost:hover:not(:disabled) { background: rgba(255,255,255,.08); }
.btn-sm { padding: 5px 10px; font-size: 13px; min-height: 32px; }
.btn-lg { padding: 11px 16px; font-size: 15px; min-height: 44px; justify-content: center; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.icon-btn { font: inherit; font-size: 20px; line-height: 1; width: 34px; height: 34px; border-radius: 8px; border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--muted); flex: none; }
.icon-btn:hover { background: var(--line-2); color: var(--ink); }
.link { font: inherit; background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; }
input, select, textarea { font: inherit; font-size: 14.5px; color: var(--ink); background: #fff; border: 1px solid #d5dae0; border-radius: 9px; padding: 8px 11px; width: 100%; min-height: 40px; }
textarea { resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(61,76,245,.15); }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; min-height: 0; accent-color: var(--accent); }
.field { display: grid; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field-label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field-hint { font-size: 12.5px; color: var(--muted); }
.field-error { font-size: 12.5px; color: var(--block); }
.has-error input, .has-error textarea { border-color: var(--block); }
.inline { display: inline-flex; align-items: center; gap: 8px; }
.inline select { width: auto; }
.seg { display: inline-flex; background: #eceef2; padding: 3px; border-radius: 10px; gap: 2px; flex-wrap: wrap; }
.seg button { font: inherit; font-size: 13.5px; font-weight: 550; padding: 6px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); cursor: pointer; min-height: 32px; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 99px; background: rgba(0,0,0,.06); font-size: 12px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.toolbar input[type="search"] { max-width: 320px; }
.search { flex: 1; display: flex; justify-content: flex-end; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs button { font: inherit; font-size: 14px; font-weight: 550; padding: 10px 12px; border: 0; background: none; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }

/* badges */
.badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 99px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.badge-block { background: var(--block-soft); color: var(--block); }
.badge-review { background: var(--review-soft); color: var(--review); }
.badge-pass { background: var(--pass-soft); color: var(--pass); }
.badge-warn { background: #fff4d6; color: var(--warn); }
.prob { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.prob-bar { width: 40px; height: 5px; border-radius: 99px; background: rgba(0,0,0,.08); overflow: hidden; }
.prob-bar span { display: block; height: 100%; background: currentColor; }

/* alerts */
.alert { padding: 11px 14px; border-radius: 10px; font-size: 14px; }
.alert ul { margin: 6px 0 0; padding-left: 18px; }
.alert-error { background: var(--block-soft); color: #8f1d33; border: 1px solid #f6ccd4; }
.alert-ok { background: var(--pass-soft); color: #145c3d; border: 1px solid #c4e8d6; }
.alert-warn { background: #fff7e0; color: #7a5200; border: 1px solid #f3dfa6; }
.empty { text-align: center; padding: 36px 16px; display: grid; gap: 6px; justify-items: center; }
.empty-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--line-2); display: grid; place-items: center; color: var(--muted); font-size: 20px; }
.empty p { max-width: 420px; font-size: 14px; }
.loading { display: flex; gap: 6px; justify-content: center; padding: 40px; }
.loading span { width: 8px; height: 8px; border-radius: 50%; background: #c3c9d1; animation: pulse 1s infinite ease-in-out; }
.loading span:nth-child(2) { animation-delay: .15s; } .loading span:nth-child(3) { animation-delay: .3s; }
@keyframes pulse { 0%, 100% { opacity: .3; transform: scale(.8); } 50% { opacity: 1; transform: scale(1); } }

/* table */
.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 10px 16px; background: #fafbfc; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; }
.row-link { cursor: pointer; }
.row-link:hover td { background: #fafbff; }

/* turns */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.turn, .review-item { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--pass); border-radius: var(--radius); padding: 16px 18px; display: grid; gap: 10px; box-shadow: var(--shadow); }
.turn-block, .review-item:has(.badge-block) { border-left-color: var(--block); }
.turn-review, .review-item:has(.badge-review) { border-left-color: #e6b35a; }
.turn-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.turn-n { font-weight: 600; font-size: 14px; }
.bubble { position: relative; padding: 10px 14px 10px; border-radius: 10px; font-size: 14.5px; background: var(--line-2); overflow-wrap: anywhere; }
.bubble .who { display: block; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 2px; }
.bubble-agent { background: #f1f3ff; }
.bubble-agent.struck { background: #fbf1f3; color: #7d5560; }
.bubble-agent.struck .txt { text-decoration: line-through; text-decoration-color: rgba(212,49,79,.5); }
.bubble-said { background: var(--pass-soft); }
.fired { display: flex; flex-wrap: wrap; gap: 6px; }
.fire { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px; border-radius: 8px; font-size: 13px; }
.fire em { font-style: normal; font-size: 11.5px; opacity: .75; }
.fire-fire { background: var(--block-soft); color: var(--block); }
.fire-review { background: var(--review-soft); color: var(--review); }
.signals { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--ink-2); }
.signals b { text-transform: capitalize; font-weight: 600; }
.sig-alert { color: var(--block); }
.review-list { display: grid; gap: 14px; }
.review-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sig-list { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; font-size: 14px; }
.sig-list dt { color: var(--muted); }
.sig-list dd { margin: 0; text-transform: none; }
.result-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* agents */
.agent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.agent-card { font: inherit; text-align: left; color: inherit; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: grid; gap: 6px; cursor: pointer; box-shadow: var(--shadow); transition: border-color .12s, transform .12s; }
.agent-card:hover { border-color: #c9cffd; transform: translateY(-1px); }
.agent-vertical { justify-self: start; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); background: var(--accent-soft); padding: 2px 8px; border-radius: 99px; }
.agent-id { color: var(--muted); }
.agent-meta { margin-top: -10px; }
.unsaved { font-size: 13px; color: var(--review); font-weight: 600; }
.template-list { display: grid; gap: 8px; }
.template { display: flex; gap: 10px; align-items: center; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.template.on { border-color: var(--accent); background: var(--accent-soft); }
.template span { display: grid; }
.defaults { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; padding: 10px 12px; background: #fafbfc; border-radius: 10px; }
.thresholds { display: inline-flex; gap: 10px; flex-wrap: wrap; }
.thresholds label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); }
.thresholds input { width: 78px; min-height: 34px; padding: 5px 8px; }
.rules { list-style: none; margin: 0; padding: 0; display: grid; }
.rule { border-top: 1px solid var(--line-2); }
.rule:first-child { border-top: 0; }
.rule.off .rule-title { color: var(--muted); text-decoration: line-through; }
.rule-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.rule-toggle { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font: inherit; background: none; border: 0; padding: 6px 4px; text-align: left; cursor: pointer; color: inherit; border-radius: 8px; }
.rule-toggle.static { cursor: default; }
.rule-toggle:not(.static):hover { background: #fafbfc; }
.chev { width: 14px; color: var(--muted); }
.rule-title { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kind { flex: none; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 6px; background: var(--line-2); color: var(--ink-2); text-transform: uppercase; letter-spacing: .03em; }
.kind-judge { background: var(--accent-soft); color: var(--accent); }
.sev { width: auto; min-height: 34px; padding: 4px 8px; font-size: 13px; font-weight: 600; }
.sev-block { color: var(--block); } .sev-review { color: var(--review); } .sev-log { color: var(--muted); }
.rule-form { display: grid; gap: 12px; padding: 4px 4px 16px 26px; }
.rule-form-foot { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.switch { flex: none; width: 40px; height: 24px; border-radius: 99px; border: 0; background: #cdd2d9; position: relative; cursor: pointer; padding: 0; transition: background .15s; }
.switch span { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.switch.on { background: var(--accent); }
.switch.on span { transform: translateX(16px); }
.switch:disabled { opacity: .45; cursor: not-allowed; }
.price-rows, .intent-rows, .hours { display: grid; gap: 8px; }
.price-row { display: grid; grid-template-columns: 1fr 150px auto; gap: 8px; align-items: center; }
.dollar { position: relative; }
.dollar span { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.dollar input { padding-left: 24px; }
.hours-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 42px; flex-wrap: wrap; }
.hours-row .inline { min-width: 130px; }
.hours-times { display: inline-flex; align-items: center; gap: 8px; }
.hours-times input { width: 130px; }
.intent-row { display: grid; grid-template-columns: 200px 1fr auto; gap: 8px; }
.code-edit { font-size: 13px; min-height: 360px; white-space: pre; }
.list { list-style: none; margin: 0; padding: 0; display: grid; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.list li:first-child { border-top: 0; }
.list li.off { opacity: .55; }
.list .ok { color: var(--pass); font-weight: 600; } .list .bad { color: var(--block); font-weight: 600; }
.danger-zone { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px; border: 1px solid #f6ccd4; border-radius: 10px; background: #fffafa; flex-wrap: wrap; }
.code { position: relative; }
.code pre { margin: 0; padding: 16px; background: #0e1320; color: #dfe6ef; border-radius: 10px; overflow-x: auto; font: 13px/1.55 var(--mono); }
.code-copy { position: absolute; top: 8px; right: 8px; }
.secret { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 12px; background: #fafbfc; border: 1px dashed #c9cfd6; border-radius: 10px; overflow-wrap: anywhere; }
.meter { height: 10px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.meter span.hot { background: var(--block); }
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.plan { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: grid; gap: 6px; align-content: start; }
.plan.on { border-color: var(--accent); background: var(--accent-soft); }
.plan ul { margin: 0; padding-left: 16px; color: var(--ink-2); }
.plan-price b { font-size: 22px; }

/* modal and toast */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15,23,32,.45); display: grid; place-items: center; padding: 16px; z-index: 50; animation: fade .12s; }
.modal { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: #fff; border-radius: 14px; box-shadow: 0 20px 50px rgba(0,0,0,.25); display: grid; }
.modal-head, .modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px; }
.modal-head { border-bottom: 1px solid var(--line-2); }
.modal-foot { border-top: 1px solid var(--line-2); justify-content: flex-end; }
.modal-body { padding: 18px; display: grid; gap: 12px; }
@keyframes fade { from { opacity: 0; } }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); padding: 10px 16px; border-radius: 10px; background: #0e1320; color: #fff; font-size: 14px; z-index: 60; box-shadow: 0 8px 24px rgba(0,0,0,.2); max-width: calc(100vw - 32px); }
.toast-error { background: var(--block); }

/* auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(1200px 600px at 20% -10%, #e7e9ff 0%, transparent 60%), var(--bg); }
.auth-card { width: min(420px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 28px; box-shadow: 0 10px 30px rgba(16,24,40,.08); display: grid; gap: 14px; }
.auth-card .brand { padding: 0; margin-bottom: 6px; }
.auth-switch { text-align: center; font-size: 14px; color: var(--muted); }

/* responsive */
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; z-index: 40; flex-direction: row; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); gap: 0; border-top: 1px solid rgba(255,255,255,.08); }
  .sidebar .brand, .sidebar .account { display: none; }
  .sidebar nav { flex-direction: row; flex: 1; justify-content: space-around; }
  .sidebar nav a { flex-direction: column; gap: 3px; padding: 6px 4px; font-size: 11px; flex: 1; justify-content: center; min-height: 52px; }
  .sidebar nav a svg { width: 20px; height: 20px; }
  .main { padding: 20px 14px calc(96px + env(safe-area-inset-bottom)); }
  .grid-2 { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plans { grid-template-columns: 1fr; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
  .table td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .table td::before { content: attr(data-label); color: var(--muted); font-size: 13px; text-align: left; }
  .table .num { text-align: right; }
  .toolbar input[type="search"] { max-width: none; }
  .search { justify-content: stretch; }
  .intent-row { grid-template-columns: 1fr auto; }
  .intent-row input:first-child { grid-column: 1 / -1; }
  .price-row { grid-template-columns: 1fr 110px auto; }
  .rule-form { padding-left: 4px; }
  .rule-row { flex-wrap: wrap; }
  .rule-toggle { flex-basis: 100%; }
  .page-head h1 { font-size: 21px; }
  .hours-times input { width: 112px; }
}
@media (max-width: 420px) {
  .kpi-value { font-size: 22px; }
  .card { padding: 16px; }
  .hours-row { align-items: flex-start; flex-direction: column; gap: 4px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

@media (max-width: 560px) {
  .defaults { flex-direction: column; align-items: stretch; }
  .defaults .inline { flex-wrap: wrap; min-width: 0; }
  .defaults select { width: 100%; max-width: 100%; }
}

.narrow { max-width: 420px; }
.small-head { font-size: 14px; margin: 8px 0 0; }
.center-row { justify-content: center; padding: 12px; }
.scores summary { cursor: pointer; font-size: 13px; color: var(--muted); } .table.compact td { padding: 4px 8px; }

/* account banners (email confirmation, payment problems) */
.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14px; background: var(--review-soft); color: var(--review); border: 1px solid #f1dfba; }
.banner .btn { margin-left: auto; }
.banner.warn { background: var(--block-soft); color: var(--block); border-color: #f5c6cf; }
