/* VIA Apps dashboard */
:root {
  --bg: #f4f6fa; --panel: #ffffff; --panel2: #f8f9fc; --line: #e4e8f0; --line2: #eef1f6;
  --text: #141a26; --muted: #6b7485; --soft: #9aa3b2;
  --accent: #4f46e5; --accent-2: #6366f1; --accent-soft: #eef0ff; --on-accent: #fff;
  --ok: #059669; --ok-soft: #e7f7f0; --warn: #b45309; --warn-soft: #fff6e5; --bad: #dc2626; --bad-soft: #fdecec; --info-soft: #eaf3ff; --info: #1d4ed8;
  --c1: #4f46e5; --c2: #94a3b8; --c3: #f59e0b;
  --side: #0f1424; --side-text: #c6cbe0; --side-muted: #7d849f; --side-hover: #1a2136; --side-on: #262e4a;
  --radius: 12px; --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0e17; --panel: #131826; --panel2: #171d2d; --line: #252c3f; --line2: #1d2334;
    --text: #e8ebf3; --muted: #9098ad; --soft: #6c7489;
    --accent: #7c83ff; --accent-2: #8b91ff; --accent-soft: #232a4d; --on-accent: #0b0e17;
    --ok: #34d399; --ok-soft: #10291f; --warn: #fbbf24; --warn-soft: #2d2410; --bad: #f87171; --bad-soft: #2f1517; --info-soft: #14223d; --info: #93b4ff;
    --c1: #8b91ff; --c2: #5b6478; --c3: #fbbf24;
    --side: #080b13; --side-hover: #121829; --side-on: #1b2238;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0e17; --panel: #131826; --panel2: #171d2d; --line: #252c3f; --line2: #1d2334;
  --text: #e8ebf3; --muted: #9098ad; --soft: #6c7489;
  --accent: #7c83ff; --accent-2: #8b91ff; --accent-soft: #232a4d; --on-accent: #0b0e17;
  --ok: #34d399; --ok-soft: #10291f; --warn: #fbbf24; --warn-soft: #2d2410; --bad: #f87171; --bad-soft: #2f1517; --info-soft: #14223d; --info: #93b4ff;
  --c1: #8b91ff; --c2: #5b6478; --c3: #fbbf24;
  --side: #080b13; --side-hover: #121829; --side-on: #1b2238;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 20px; font-weight: 650; }
h2 { font-size: 15px; font-weight: 650; }
h3 { font-size: 14px; font-weight: 650; margin: 18px 0 6px; }
code { font: 12.5px ui-monospace, SFMono-Regular, Consolas, monospace; background: var(--panel2); border: 1px solid var(--line2); border-radius: 5px; padding: 1px 5px; }
pre { font: 12.5px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; overflow-x: auto; white-space: pre; }
small { font-size: 12px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; }
svg { fill: currentColor; }

/* ---------- shell ---------- */
.shell { display: flex; min-height: 100vh; }
.side { width: 240px; flex: none; background: var(--side); color: var(--side-text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; color: #fff; font-weight: 700; font-size: 16px; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, #6366f1, #a855f7); display: grid; place-items: center; color: #fff; font-weight: 800; }
.nav { padding: 4px 10px; display: flex; flex-direction: column; gap: 1px; flex: 1; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--side-text); font-weight: 500; }
.nav a:hover { background: var(--side-hover); text-decoration: none; color: #fff; }
.nav a.on { background: var(--side-on); color: #fff; }
.nav svg { width: 18px; height: 18px; opacity: .85; flex: none; }
.nav-apps { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 6px 18px; padding-left: 8px; border-left: 1px solid #262d45; }
.nav-apps a { padding: 5px 8px; font-size: 13px; color: var(--side-muted); font-weight: 450; }
.nav-apps a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-apps em { width: 6px; height: 6px; border-radius: 50%; margin-left: auto; flex: none; }
.dot-dev { background: #64748b; } .dot-paused { background: #f59e0b; }
.nav-icon { width: 18px; height: 18px; border-radius: 5px; flex: none; font-size: 8px; }
.nav-sep { height: 1px; background: #1f2640; margin: 8px 6px; }
.side-foot { border-top: 1px solid #1c2338; padding: 10px; display: flex; align-items: center; gap: 6px; }
.me { flex: 1; display: flex; gap: 9px; align-items: center; padding: 6px; border-radius: 8px; color: var(--side-text); min-width: 0; }
.me:hover, .me.on { background: var(--side-hover); text-decoration: none; }
.me b { display: block; color: #fff; font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.me small { color: var(--side-muted); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: #2a3354; display: grid; place-items: center; color: #fff; font-weight: 700; flex: none; }
.side-actions { display: flex; gap: 2px; }
.side-actions form { margin: 0; }
.icon-btn { background: none; border: 0; color: inherit; width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { background: var(--side-hover); }
.icon-btn svg { width: 18px; height: 18px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 12px; padding: 16px 28px; min-height: 68px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 5; }
.top-title { flex: 1; min-width: 0; }
.top-actions { display: flex; gap: 8px; }
.menu-btn { display: none; color: var(--text); }
.menu-btn:hover { background: var(--panel2); }
.content { padding: 22px 28px 60px; max-width: 1400px; width: 100%; }

.app-head { display: flex; align-items: center; gap: 12px; }
.app-head small { color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.app-icon { width: 34px; height: 34px; border-radius: 9px; object-fit: cover; flex: none; }
.app-icon.lg { width: 44px; height: 44px; border-radius: 11px; font-size: 15px; }
.app-icon-txt { display: inline-grid; place-items: center; color: #fff; font-weight: 700; font-size: 12px; letter-spacing: .3px; }

/* ---------- notices ---------- */
.notice { margin: 14px 28px 0; padding: 11px 40px 11px 14px; border-radius: 10px; border: 1px solid transparent; position: relative; }
.content .notice, .card .notice, .login-card .notice { margin: 0 0 14px; }
.notice.ok { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.notice.error { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 25%, transparent); }
.notice.warn, .notice.secret { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.notice.secret { font-weight: 600; user-select: all; }
.notice.info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 20%, transparent); }
.notice.slim { padding: 8px 12px; font-size: 13px; }
.notice a { color: inherit; text-decoration: underline; }
.notice .x { position: absolute; right: 8px; top: 7px; }
.x { background: none; border: 0; font-size: 20px; line-height: 1; color: inherit; opacity: .6; cursor: pointer; padding: 2px 6px; }
.x:hover { opacity: 1; }

/* ---------- cards, kpis ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 18px; }
.card.narrow { max-width: 560px; }
.card-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head h2 { margin-right: auto; }
.card-head > .muted { flex-basis: 100%; margin-top: -8px; font-size: 13px; }
.card-head h2 + .muted { order: 3; }
.empty { color: var(--muted); text-align: center; padding: 20px 0; margin: 0; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpis.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.kpi span { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.kpi b { display: block; font-size: 26px; font-weight: 700; letter-spacing: -.5px; margin: 2px 0; font-variant-numeric: tabular-nums; }
.kpi small { color: var(--muted); }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.cols.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols.wide-left { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; }
.cols > .card, .cols > div > .card { margin-bottom: 18px; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar.tight { margin: 0; }
.seg { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 3px; gap: 2px; }
.seg a { padding: 5px 11px; border-radius: 6px; color: var(--muted); font-weight: 500; font-size: 13px; }
.seg a:hover { color: var(--text); text-decoration: none; }
.seg a.on { background: var(--accent-soft); color: var(--accent); }
.search { width: 240px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -6px 0 20px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 550; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
.tbl { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tbl th { text-align: left; font-weight: 550; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--panel2); }
.tbl .r { text-align: right; }
.tbl tr.off td { opacity: .55; }
.tbl tr.off td:first-child { opacity: 1; }
.tbl tr.group td { background: none !important; padding-top: 16px; border-bottom: 0; }
.tbl tr.hl td { background: var(--accent-soft); }
.tbl tr.sub td { padding-top: 0; border-top: 0; }
.tbl.sortable th { cursor: pointer; }
.err-text { color: var(--bad); }
.countries { max-width: 220px; font-size: 12.5px; }
.app-cell { display: flex; align-items: center; gap: 10px; color: var(--text); }
.app-cell:hover { text-decoration: none; }
.app-cell:hover b { color: var(--accent); }
.app-cell small { display: block; color: var(--muted); }

/* ---------- badges, tags ---------- */
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; vertical-align: middle; }
.b-green { background: var(--ok-soft); color: var(--ok); }
.b-red { background: var(--bad-soft); color: var(--bad); }
.b-amber { background: var(--warn-soft); color: var(--warn); }
.b-blue { background: var(--info-soft); color: var(--info); }
.b-violet { background: var(--accent-soft); color: var(--accent); }
.b-gray { background: var(--panel2); color: var(--muted); border: 1px solid var(--line); }
.tag { display: inline-block; font-size: 11.5px; padding: 2px 8px; border-radius: 6px; background: var(--panel2); border: 1px solid var(--line); color: var(--muted); }
.tag.on { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.tag.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }

/* ---------- buttons, forms ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: 550 13.5px var(--font); cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--panel2); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-2); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--panel2); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.danger.ghost { background: transparent; color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.btn.danger.ghost:hover { background: var(--bad-soft); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 7px; }
.btn.wide { width: 100%; justify-content: center; padding: 11px; }
.btn:disabled { opacity: .6; cursor: default; }
input, select, textarea { font: 14px var(--font); color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=checkbox] { width: auto; }
input[type=file] { padding: 6px; }
textarea.code { font: 12.5px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre; }
.form { display: flex; flex-direction: column; gap: 12px; }
.form label, .grid-form label { display: flex; flex-direction: column; gap: 5px; font-weight: 550; font-size: 13px; }
.form label small { color: var(--muted); font-weight: 400; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.grid-form .full { grid-column: 1 / -1; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.form.compact { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.form label.check, label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 450; }
label.inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
label.inline input, label.inline select { width: auto; }
label.inline input[type=number] { width: 90px; }
form.inline { display: inline; }
.form-danger { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.inline-upload { display: flex; align-items: flex-end; gap: 12px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.inline-upload label { flex: 1; min-width: 260px; display: flex; flex-direction: column; gap: 5px; font-weight: 550; font-size: 13px; }
.inline-upload small { color: var(--muted); font-weight: 400; }
.sub-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.sub-actions form { margin: 0; }
.danger-zone { border-color: color-mix(in srgb, var(--bad) 30%, var(--line)); }

/* switches */
.switch { display: inline-flex !important; flex-direction: row !important; align-items: center; gap: 8px !important; cursor: pointer; font-weight: 500 !important; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch span { width: 36px; height: 20px; border-radius: 999px; background: var(--line); position: relative; flex: none; transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-soft); }
.switch input:disabled + span { opacity: .4; }
.switch.sm span { width: 30px; height: 17px; }
.switch.sm span::after { width: 13px; height: 13px; }
.switch.sm input:checked + span::after { transform: translateX(13px); }
.switch-row { display: flex; gap: 22px; flex-wrap: wrap; padding: 4px 0 6px; }

.weights { gap: 0; }
.weight-row { display: grid; grid-template-columns: 130px 110px 150px 1fr; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line2); }
.weight-row:last-of-type { border-bottom: 0; margin-bottom: 8px; }
.share .bar { height: 8px; border-radius: 99px; background: var(--c3); overflow: hidden; }
.share .bar i { display: block; height: 100%; background: var(--c2); }
.share small { color: var(--muted); }

/* ---------- apps grid ---------- */
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.app-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; color: var(--text); display: flex; flex-direction: column; gap: 14px; transition: border-color .15s, transform .15s; }
.app-card:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-1px); }
.app-card-head { display: flex; align-items: center; gap: 12px; }
.app-card-head > div { flex: 1; min-width: 0; }
.app-card-head b { display: block; font-size: 15px; }
.app-card-head small { color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-card-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.app-card-stats span { display: block; color: var(--muted); font-size: 11.5px; }
.app-card-stats b { font-size: 15px; font-variant-numeric: tabular-nums; }
.app-card-tags { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- banners ---------- */
.banner-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.banner-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--text); overflow: hidden; display: flex; flex-direction: column; transition: border-color .15s; }
.banner-card:hover { border-color: var(--accent); text-decoration: none; }
.banner-meta { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; }
.banner-meta b { font-size: 14px; }
.mini-stats { display: flex; gap: 12px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
/* banners are designed for a 360×640 phone; previews scale that frame down */
.thumb, .preview-phone { background: #0b0d12; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.thumb { height: 210px; --s: .3; }
.thumb.bottom_banner { --s: .62; }
.clip { width: calc(360px * var(--s)); height: calc(640px * var(--s)); overflow: hidden; position: relative; flex: none; }
.bottom_banner .clip { height: calc(100px * var(--s)); }
.clip iframe { width: 360px; height: 640px; border: 0; transform: scale(var(--s)); transform-origin: 0 0; pointer-events: none; display: block; }
.preview-phone { --s: .62; border-radius: 10px; padding: 14px 0; margin-bottom: 12px; }
.preview-phone.bottom_banner { --s: .9; }
.modal .preview-phone { --s: .5; }
.modal .preview-phone.bottom_banner { --s: 1; }

/* ---------- chart ---------- */
.chart { position: relative; height: 240px; }
.chart svg { width: 100%; height: 100%; overflow: visible; }
.chart .grid line { stroke: var(--line2); }
.chart .axis text { fill: var(--soft); font-size: 11px; }
.chart .legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--muted); margin-top: 8px; flex-wrap: wrap; }
.chart .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.chart .tip { position: absolute; pointer-events: none; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 4px 14px rgba(0,0,0,.12); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; white-space: nowrap; z-index: 2; }
.chart .tip b { display: block; margin-bottom: 2px; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(9, 12, 22, .55); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 50; overflow-y: auto; backdrop-filter: blur(2px); }
.modal[hidden] { display: none; }
.modal-box { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; width: 100%; max-width: 560px; padding: 22px; position: relative; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.modal-box h2 { margin: 0 30px 16px 0; font-size: 17px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.modal-x { position: absolute; right: 12px; top: 12px; }

/* ---------- prose ---------- */
.prose p { margin: 6px 0 10px; color: var(--text); }
.prose h2 { margin-bottom: 8px; }
.back { color: var(--muted); font-size: 13px; }

/* ---------- login ---------- */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1200px 600px at 20% -10%, var(--accent-soft), transparent), var(--bg); }
.login-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 10px 40px rgba(16, 24, 40, .1); padding: 30px; width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 14px; }
.login-card label { display: flex; flex-direction: column; gap: 5px; font-weight: 550; font-size: 13px; }
.login-card .brand { padding: 0; color: var(--text); }
.login-card p { margin: -6px 0 4px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols, .cols.three, .cols.wide-left { grid-template-columns: 1fr; }
  .weight-row { grid-template-columns: 120px 100px 1fr; }
  .weight-row .share { grid-column: 1 / -1; }
}
@media (max-width: 820px) {
  .side { position: fixed; left: 0; top: 0; z-index: 40; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  body.menu-open .side { transform: none; }
  .menu-btn { display: grid; }
  .top { padding: 12px 16px; }
  .content { padding: 16px 16px 50px; }
  .notice { margin: 12px 16px 0; }
  .card { padding: 16px; }
  .table-wrap { margin: 0 -16px; padding: 0 16px; }
  .kpi b { font-size: 22px; }
  .row2 { grid-template-columns: 1fr; }
  .search { width: 100%; }
  .app-card-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .kpis, .kpis.three { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 12px 14px; }
}

/* fixes after the first visual pass */
.tabs { overflow-y: hidden; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.form label.inline { flex-direction: row; align-items: center; }
.cc-more { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
/* bottom banners sit at the bottom of the phone: show the last 100 px of the frame */
.bottom_banner .clip iframe { transform: scale(var(--s)) translateY(-540px); }
.thumb, .preview-phone { background: #1b2030; }
