/* Social Publisher — single stylesheet, no build step. */
:root {
  --bg: #f4f5f8; --surface: #fff; --surface-2: #f8f9fb; --border: #e3e6ec; --text: #1c2130; --muted: #667085;
  --accent: #4f46e5; --accent-2: #eef0ff; --accent-text: #fff;
  --ok: #067647; --ok-bg: #dcfae6; --warn: #b54708; --warn-bg: #fef0c7; --err: #b42318; --err-bg: #fee4e2;
  --info: #175cd3; --info-bg: #d1e9ff; --neutral: #475467; --neutral-bg: #eaecf0;
  --radius: 10px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  --sidebar: 232px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1218; --surface: #171b24; --surface-2: #1d2230; --border: #2a3040; --text: #e6e8ee; --muted: #98a2b3;
    --accent: #818cf8; --accent-2: #262a4a; --accent-text: #0f1218;
    --ok: #75e0a7; --ok-bg: #053321; --warn: #fdb022; --warn-bg: #4e1d09; --err: #fda29b; --err-bg: #55160c;
    --info: #84caff; --info-bg: #102a56; --neutral: #cfd4dc; --neutral-bg: #2a3040;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
h3 { font-size: 1rem; margin: 0 0 .5rem; }
code, pre, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85em; }
pre { white-space: pre-wrap; word-break: break-word; background: var(--surface-2); padding: .6rem .75rem; border-radius: 8px; border: 1px solid var(--border); margin: .25rem 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.hidden { display: none !important; }

/* ---------- layout ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar); background: var(--surface); border-right: 1px solid var(--border); position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; z-index: 20; }
.brandmark { display: flex; align-items: center; gap: .6rem; padding: 1.1rem 1.1rem .9rem; font-weight: 700; color: var(--text); }
.brandmark .logo { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, #6366f1, #ec4899); display: grid; place-items: center; color: #fff; font-size: .9rem; }
.nav { padding: .25rem .6rem; display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav a { display: flex; align-items: center; gap: .6rem; padding: .5rem .7rem; border-radius: 8px; color: var(--muted); font-weight: 500; }
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--accent-2); color: var(--accent); }
.nav .ico { width: 1.2rem; text-align: center; }
.nav .sep { height: 1px; background: var(--border); margin: .5rem .3rem; }
.sidebar-foot { padding: .8rem 1rem; border-top: 1px solid var(--border); font-size: .8rem; color: var(--muted); }
.sidebar-foot form { display: inline; }
.main { margin-left: var(--sidebar); flex: 1; min-width: 0; }
.topbar { display: none; }
.content { padding: 1.5rem 2rem 3rem; max-width: 1280px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-head .sub { color: var(--muted); margin-top: .2rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.backdrop { display: none; }

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 0 40px rgba(0,0,0,.2); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 15; }
  .main { margin-left: 0; }
  .topbar { display: flex; align-items: center; gap: .75rem; padding: .7rem 1rem; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
  .topbar .title { font-weight: 700; flex: 1; }
  .content { padding: 1rem 1rem 3rem; }
  h1 { font-size: 1.3rem; }
}

/* ---------- components ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem 1.2rem; margin-bottom: 1rem; }
.card > h2:first-child { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > h2:first-child { padding: 1rem 1.2rem 0; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 1100px) { .split { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem 1rem; box-shadow: var(--shadow); display: block; color: var(--text); }
a.stat:hover { text-decoration: none; border-color: var(--accent); }
.stat .label { color: var(--muted); font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stat .value { font-size: 1.7rem; font-weight: 700; margin-top: .15rem; font-variant-numeric: tabular-nums; }
.stat .hint { font-size: .8rem; color: var(--muted); }
.stat.err .value { color: var(--err); }
.stat.ok .value { color: var(--ok); }
.stat.warn .value { color: var(--warn); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .5rem .9rem; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; line-height: 1.2; min-height: 38px; text-decoration: none !important; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--err); border-color: color-mix(in srgb, var(--err) 40%, var(--border)); }
.btn.danger:hover { background: var(--err-bg); }
.btn.warn { color: var(--warn); }
.btn.sm { padding: .3rem .6rem; min-height: 30px; font-size: .82rem; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.inline-form { display: inline; margin: 0; }
.menu-btn { background: none; border: 0; font-size: 1.4rem; color: var(--text); padding: .2rem .4rem; cursor: pointer; }

.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .12rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 600; background: var(--neutral-bg); color: var(--neutral); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.b-draft { background: var(--neutral-bg); color: var(--neutral); }
.b-ready, .b-pending { background: var(--info-bg); color: var(--info); }
.b-scheduled { background: var(--accent-2); color: var(--accent); }
.b-publishing { background: var(--warn-bg); color: var(--warn); }
.b-published, .b-connected, .b-ok, .b-info { background: var(--ok-bg); color: var(--ok); }
.b-failed, .b-error, .b-expired { background: var(--err-bg); color: var(--err); }
.b-paused, .b-warning, .b-not_connected { background: var(--warn-bg); color: var(--warn); }
.b-cancelled { background: var(--neutral-bg); color: var(--muted); text-decoration: line-through; }
.b-demo { background: #f2f4f7; color: #475467; border: 1px dashed #98a2b3; }
@media (prefers-color-scheme: dark) { .b-demo { background: #2a3040; color: #cfd4dc; } }

.pf { display: inline-grid; place-items: center; min-width: 26px; height: 22px; padding: 0 5px; border-radius: 6px; font-size: .7rem; font-weight: 800; color: #fff; letter-spacing: .02em; vertical-align: middle; }
.pf-youtube { background: #e11d2a; }
.pf-facebook { background: #1877f2; }
.pf-instagram { background: linear-gradient(45deg, #f59e0b, #e1306c, #833ab4); }
.pf-tiktok { background: #111; box-shadow: inset 2px 0 0 #25f4ee, inset -2px 0 0 #fe2c55; }
.pf.st-failed { outline: 2px solid var(--err); outline-offset: 1px; }
.pf.st-published { outline: 2px solid var(--ok); outline-offset: 1px; }
.pf.st-cancelled { opacity: .35; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; margin-right: .35rem; flex: none; }

.alert { padding: .7rem 1rem; border-radius: 8px; margin-bottom: 1rem; border: 1px solid transparent; }
.alert.success { background: var(--ok-bg); color: var(--ok); }
.alert.error { background: var(--err-bg); color: var(--err); }
.alert.warning { background: var(--warn-bg); color: var(--warn); }
.alert.info { background: var(--info-bg); color: var(--info); }
.alert ul { margin: .3rem 0 0; padding-left: 1.2rem; }
.banner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* tables collapse into cards on phones */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { padding: .6rem .8rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.tbl th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; background: var(--surface-2); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.tbl .title-cell { font-weight: 600; max-width: 380px; }
.tbl .title-cell .muted { font-weight: 400; }
@media (max-width: 760px) {
  .tbl.stack thead { display: none; }
  .tbl.stack, .tbl.stack tbody, .tbl.stack tr, .tbl.stack td { display: block; width: 100%; }
  .tbl.stack tr { border-bottom: 1px solid var(--border); padding: .5rem 0; }
  .tbl.stack td { border: 0; padding: .2rem 1rem; }
  .tbl.stack td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: .8rem; }
}

.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: .65rem 0; border-bottom: 1px solid var(--border); display: flex; gap: .75rem; align-items: flex-start; justify-content: space-between; }
.list li:last-child { border-bottom: 0; }
.list .main-col { min-width: 0; flex: 1; }
.list .main-col .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; }
.kv dt { color: var(--muted); font-size: .85rem; }
.kv dd { margin: 0; word-break: break-word; }

.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; overflow-x: auto; }
.tabs a { padding: .55rem .85rem; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.active { color: var(--accent); border-color: var(--accent); }
.tabs a:hover { text-decoration: none; color: var(--text); }
.tabs .count { font-size: .75rem; background: var(--neutral-bg); border-radius: 999px; padding: 0 .45rem; margin-left: .25rem; }

.filters { display: flex; gap: .5rem; flex-wrap: wrap; align-items: end; margin-bottom: 1rem; }
.filters .field { margin: 0; min-width: 150px; }

/* forms */
.field { margin-bottom: 1rem; }
.field label, .label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: .3rem; }
.field .help { color: var(--muted); font-size: .8rem; margin-top: .25rem; }
input[type=text], input[type=password], input[type=search], input[type=datetime-local], input[type=number], input[type=url], select, textarea {
  width: 100%; padding: .55rem .7rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-size: 16px; min-height: 40px;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); border-color: var(--accent); }
input[type=color] { width: 56px; height: 40px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); padding: 2px; }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 500; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.checks { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip-check { display: inline-flex; align-items: center; gap: .4rem; padding: .4rem .7rem; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; background: var(--surface); }
.chip-check:has(input:checked) { border-color: var(--accent); background: var(--accent-2); }
.counter { float: right; font-weight: 400; color: var(--muted); font-size: .8rem; }
.counter.over { color: var(--err); font-weight: 700; }
.form-actions { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; padding-top: .5rem; }

.target-list { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.target { display: flex; gap: .6rem; align-items: center; border: 1px solid var(--border); border-radius: 10px; padding: .6rem .7rem; cursor: pointer; background: var(--surface); }
.target:has(input:checked) { border-color: var(--accent); background: var(--accent-2); }
.target input { width: 18px; height: 18px; accent-color: var(--accent); }
.target .meta { min-width: 0; }
.target .meta > span { display: block; }
.target .name { font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.mode-list { display: grid; gap: .5rem; }
.mode { display: flex; gap: .6rem; align-items: flex-start; border: 1px solid var(--border); border-radius: 10px; padding: .65rem .75rem; cursor: pointer; }
.mode:has(input:checked) { border-color: var(--accent); background: var(--accent-2); }
.mode input { margin-top: .25rem; accent-color: var(--accent); }
.mode .d { font-size: .82rem; color: var(--muted); }
.mode .extra { margin-top: .5rem; }

details.override { border: 1px solid var(--border); border-radius: 10px; margin-bottom: .5rem; background: var(--surface); }
details.override summary { padding: .6rem .8rem; cursor: pointer; font-weight: 600; display: flex; align-items: center; gap: .5rem; list-style: none; }
details.override summary::-webkit-details-marker { display: none; }
details.override summary::after { content: "▸"; margin-left: auto; color: var(--muted); }
details.override[open] summary::after { content: "▾"; }
details.override .body { padding: 0 .8rem .6rem; }

/* media */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.media-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; color: var(--text); box-shadow: var(--shadow); }
.media-card:hover { text-decoration: none; border-color: var(--accent); }
.media-card video, .media-thumb { width: 100%; aspect-ratio: 16/10; object-fit: contain; background: #0b0d12; display: block; }
.media-card .info { padding: .6rem .75rem; font-size: .85rem; }
.media-card .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player { width: 100%; max-height: 70vh; background: #000; border-radius: var(--radius); display: block; }
.dropzone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 1.4rem; text-align: center; background: var(--surface); transition: border-color .15s, background .15s; }
.dropzone.drag { border-color: var(--accent); background: var(--accent-2); }
.progress { height: 8px; background: var(--neutral-bg); border-radius: 999px; overflow: hidden; margin-top: .75rem; }
.progress > div { height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.preview-box video { width: 100%; max-height: 260px; background: #000; border-radius: 8px; }

/* calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--border); gap: 1px; }
.cal .dow { background: var(--surface-2); padding: .4rem; font-size: .75rem; font-weight: 700; text-transform: uppercase; color: var(--muted); text-align: center; }
.cal .day { background: var(--surface); min-height: 112px; padding: .35rem; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal .day.other { background: var(--surface-2); }
.cal .day.other .num { opacity: .45; }
.cal .day.today .num { background: var(--accent); color: var(--accent-text); border-radius: 999px; padding: 0 .4rem; }
.cal .num { font-size: .8rem; font-weight: 700; align-self: flex-start; }
.cal .ev { display: block; font-size: .75rem; padding: 2px 5px; border-radius: 5px; background: var(--surface-2); border-left: 3px solid var(--accent); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal .ev:hover { text-decoration: none; filter: brightness(.96); }
.cal .ev.s-failed { background: var(--err-bg); }
.cal .ev.s-published { background: var(--ok-bg); }
.cal .ev.s-paused { background: var(--warn-bg); }
.agenda { display: none; }
@media (max-width: 760px) { .cal { display: none; } .agenda { display: block; } }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: .5rem 0 .5rem 1rem; border-left: 2px solid var(--border); position: relative; font-size: .88rem; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: .85rem; width: 10px; height: 10px; border-radius: 50%; background: var(--border); }
.timeline li.lv-error::before { background: var(--err); }
.timeline li.lv-warning::before { background: var(--warn); }
.timeline li.lv-info::before { background: var(--ok); }

.delivery { border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem 1rem; margin-bottom: .75rem; }
.delivery-head { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.delivery-head .who { font-weight: 600; flex: 1; min-width: 160px; }
.error-box { background: var(--err-bg); color: var(--err); border-radius: 8px; padding: .55rem .7rem; margin-top: .6rem; font-size: .88rem; word-break: break-word; }
.code-chip { font-family: ui-monospace, monospace; font-weight: 700; font-size: .78rem; }

.empty { text-align: center; padding: 2rem 1rem; color: var(--muted); }
.empty .big { font-size: 2rem; }
.pager { display: flex; gap: .5rem; justify-content: center; align-items: center; margin-top: 1rem; }

/* login */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card .brandmark { justify-content: center; font-size: 1.2rem; padding: 0 0 1rem; }

/* integrations / diagnostics */
.findings { list-style: none; margin: .4rem 0 0; padding: 0; }
.findings li { padding: .45rem .6rem; border-radius: 8px; margin-bottom: .35rem; font-size: .86rem; border-left: 3px solid var(--border); background: var(--surface-2); word-break: break-word; }
.findings li.f-error { border-left-color: var(--err); background: var(--err-bg); }
.findings li.f-warning { border-left-color: var(--warn); background: var(--warn-bg); }
.findings li.f-info { border-left-color: var(--info); background: var(--info-bg); }
.findings .code-chip { margin-right: .35rem; }
.b-healthy { background: var(--ok-bg); color: var(--ok); }
.b-degraded, .b-unknown { background: var(--warn-bg); color: var(--warn); }
.b-failing { background: var(--err-bg); color: var(--err); }
.b-missing { background: var(--err-bg); color: var(--err); }
.b-set { background: var(--ok-bg); color: var(--ok); }
.ok-mark { color: var(--ok); font-weight: 700; }
.bad-mark { color: var(--err); font-weight: 700; }
.mode.disabled { opacity: .65; cursor: not-allowed; }
.copy-row { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.copy-row code { background: var(--surface-2); padding: .2rem .45rem; border-radius: 6px; word-break: break-all; }

/* ---------- analytics ---------- */
.b-partial, .b-rate_limited, .b-never { background: var(--warn-bg); color: var(--warn); }
.b-auth_error, .b-error { background: var(--err-bg); color: var(--err); }
.b-never { background: var(--neutral-bg); color: var(--neutral); }
.b-running { background: var(--info-bg); color: var(--info); }
.na { color: var(--muted); font-style: italic; font-size: .85em; cursor: help; }
.stat .value.na { font-size: 1.05rem; font-style: normal; font-weight: 600; margin-top: .55rem; }
.num { font-variant-numeric: tabular-nums; }
.up { color: var(--ok); font-weight: 600; }
.down { color: var(--err); font-weight: 600; }
.metric-cards { grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); }
.metric-cards .stat .value { font-variant-numeric: normal; font-size: 1.55rem; }
.stat.na-card { background: var(--surface-2); }
.reasons { margin-top: .3rem; }
.reasons ul { margin: .25rem 0 0; padding-left: 1rem; font-size: .78rem; color: var(--muted); }
.sync-strip { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .55rem .9rem; margin-bottom: 1rem; }
.filters .date-field { min-width: 140px; }
input[type=date] { width: 100%; padding: .5rem .6rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-size: 16px; min-height: 40px; }
select.compact { width: auto; min-height: 30px; padding: .2rem .4rem; font-size: .85rem; }
.card > h2 .inline-form { display: inline-flex; align-items: center; gap: .3rem; font-weight: 400; }
pre.raw { max-height: 420px; overflow: auto; font-size: .78rem; }
.cap-matrix td { min-width: 150px; }

/* charts: single series, 2px line + 10% wash, ≤24px columns with 4px rounded data end */
.viz { --viz-1: #2a78d6; margin: .25rem 0 0; position: relative; }
@media (prefers-color-scheme: dark) { .viz { --viz-1: #3987e5; } }
.viz-plot { display: flex; height: 220px; }
.viz-y { position: relative; width: 52px; flex: none; }
.viz-y span { position: absolute; right: 8px; transform: translateY(50%); font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.viz-area { position: relative; flex: 1; min-width: 0; }
.viz-grid { position: absolute; left: 0; right: 0; border-top: 1px solid var(--border); }
.viz-grid.zero { border-top-color: color-mix(in srgb, var(--muted) 55%, var(--border)); }
.viz-bands { position: absolute; inset: 0; display: flex; }
.viz-band { flex: 1; position: relative; min-width: 0; outline: none; }
.viz-band:hover, .viz-band:focus-visible { background: color-mix(in srgb, var(--viz-1) 7%, transparent); }
.viz-bar { position: absolute; left: 50%; transform: translateX(-50%); width: min(24px, calc(100% - 2px)); background: var(--viz-1); border-radius: 4px 4px 0 0; }
.viz-bar.neg { border-radius: 0 0 4px 4px; }
.viz-band:hover .viz-bar, .viz-band:focus-visible .viz-bar { filter: brightness(1.12); }
.viz-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.viz-line { fill: none; stroke: var(--viz-1); stroke-width: 2px; stroke-linejoin: round; stroke-linecap: round; }
.viz-wash { fill: var(--viz-1); opacity: .1; }
.viz-dot { position: absolute; width: 12px; height: 12px; border-radius: 50%; background: var(--viz-1); border: 2px solid var(--surface); transform: translate(-50%, 50%); pointer-events: none; }
.viz-endlabel { position: absolute; right: 0; transform: translateY(-60%); font-size: .8rem; font-weight: 600; color: var(--text); background: var(--surface); padding: 0 .25rem; border-radius: 4px; pointer-events: none; }
.viz-band.xh::after { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; border-left: 1px solid var(--muted); opacity: 0; }
.viz-band.xh:hover::after, .viz-band.xh:focus-visible::after { opacity: .6; }
.viz-band.xh i { position: absolute; left: 50%; width: 10px; height: 10px; border-radius: 50%; background: var(--viz-1); border: 2px solid var(--surface); transform: translate(-50%, 50%); opacity: 0; }
.viz-band.xh:hover i, .viz-band.xh:focus-visible i { opacity: 1; }
.viz-x { position: relative; height: 1.4rem; margin-left: 52px; }
.viz-x span { position: absolute; transform: translateX(-50%); font-size: .75rem; color: var(--muted); white-space: nowrap; top: .25rem; }
.viz-tip { position: fixed; z-index: 50; pointer-events: none; background: var(--text); color: var(--bg); font-size: .8rem; font-weight: 600; padding: .3rem .55rem; border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,.18); max-width: 260px; }
.viz-table { margin-top: .4rem; }
@media (max-width: 760px) { .metric-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; } .metric-cards .stat .value { font-size: 1.3rem; } }
@media (max-width: 760px) { .viz-plot { height: 180px; } .viz-y { width: 44px; } .viz-x { margin-left: 44px; } }
@media (forced-colors: active) { .viz-bar, .viz-dot { background: CanvasText; } .viz-line { stroke: CanvasText; } }
