:root {
  --bg: #f3f2ed;
  --panel: #fffefa;
  --panel-2: #f8f7f2;
  --line: #deddd5;
  --line-2: #c8c7bd;
  --ink: #161814;
  --ink-2: #565a51;
  --ink-3: #85897e;
  --header: #11130f;
  --header-2: #1b1e18;
  --lime: #c7f25a;
  --lime-ink: #263400;
  --orange: #e86f37;
  --ok-bg: #e7f4d2;
  --ok: #35630c;
  --warn-bg: #fff0ce;
  --warn: #7c4d05;
  --bad-bg: #fce5df;
  --bad: #a63c27;
  --acc-bg: #e9efdb;
  --acc: #49631b;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(18, 20, 15, .05), 0 8px 30px rgba(18, 20, 15, .035);
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 8% 0%, rgba(199, 242, 90, .10), transparent 24rem),
    var(--bg);
  color: var(--ink);
  font: 13px/1.5 Manrope, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
code, pre, .mono { font-family: "DM Mono", ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
a { color: var(--acc); }

.appbar, body > header {
  height: 60px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 20;
  color: #f4f5ef;
  background:
    linear-gradient(90deg, rgba(199, 242, 90, .07), transparent 32%),
    rgba(16, 18, 14, .96);
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .35), 0 10px 30px rgba(10, 12, 8, .18);
  backdrop-filter: saturate(140%) blur(14px);
}
.identity { display: flex; align-items: center; gap: 10px; min-width: 0; color: inherit; text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 32px; height: 32px; flex: none;
  border-radius: 10px; color: var(--lime-ink);
  background: linear-gradient(145deg, #d8ff72, var(--lime) 55%, #a9d63c);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 0 0 1px rgba(199, 242, 90, .25), 0 6px 18px rgba(199, 242, 90, .18);
}
.brand-text { display: grid; line-height: 1.1; }
.brand-text strong { font-size: 15px; font-weight: 700; letter-spacing: -.03em; }
.brand-text small { margin-top: 3px; color: #858a7d; font: 500 9px/1 "DM Mono", monospace; letter-spacing: .08em; text-transform: uppercase; }
header nav {
  display: flex; align-items: center; gap: 2px; justify-self: center;
  padding: 3px; overflow-x: auto; scrollbar-width: none;
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .06); border-radius: 11px;
}
header nav::-webkit-scrollbar { display: none; }
header nav a {
  display: flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 8px;
  color: #a2a79a; text-decoration: none; font-size: 12px; font-weight: 500; white-space: nowrap;
  transition: color .12s, background .12s;
}
header nav a:hover { color: #fff; background: rgba(255, 255, 255, .06); }
header nav a.on { color: #10120e; background: var(--lime); font-weight: 600; box-shadow: 0 1px 8px rgba(199, 242, 90, .25); }
header nav a.nav-ext { color: #7f8478; }
.external { margin-left: 4px; font-size: 10px; opacity: .8; }
header .status { display: flex; align-items: center; gap: 9px; justify-content: flex-end; min-width: 0; }
.status-pill {
  position: relative; display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px;
  border-radius: 999px; border: 1px solid rgba(255, 255, 255, .09); background: rgba(255, 255, 255, .04);
  color: #d7dbd0; font: 500 11px/1 Manrope, sans-serif; white-space: nowrap; cursor: default; outline: none;
}
.status-pill:hover, .status-pill:focus-visible { border-color: rgba(255, 255, 255, .18); }
.live-dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: #7f8478; }
.status-pill.ok .live-dot { background: var(--lime); box-shadow: 0 0 0 4px rgba(199, 242, 90, .12); animation: pulse 2.4s ease-out infinite; }
.status-pill.warn .live-dot { background: #f2b33d; box-shadow: 0 0 0 4px rgba(242, 179, 61, .14); }
.status-pill.bad .live-dot { background: #f06a4b; box-shadow: 0 0 0 4px rgba(240, 106, 75, .16); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(199, 242, 90, .45); } 70% { box-shadow: 0 0 0 7px rgba(199, 242, 90, 0); } 100% { box-shadow: 0 0 0 0 rgba(199, 242, 90, 0); } }
@media (prefers-reduced-motion: reduce) { .status-pill.ok .live-dot { animation: none; } }
.status-pop {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 30; width: 320px; padding: 12px 14px;
  display: none; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .1); background: #171a14;
  color: #b9bdb1; font: 10px/1.6 "DM Mono", monospace; white-space: normal; box-shadow: 0 18px 40px rgba(0, 0, 0, .35);
}
.status-pill:hover .status-pop, .status-pill:focus-within .status-pop { display: block; }
.status-pop dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 0; }
.status-pop dt { color: #7f8478; }
.status-pop dd { margin: 0; color: #e5e8df; text-align: right; overflow: hidden; text-overflow: ellipsis; }
header #auth { display: flex; gap: 6px; }
header #auth input { width: 170px; background: var(--header-2); color: #fff; border-color: #42463b; }

main { max-width: 1440px; margin: 0 auto; padding: 34px 30px 70px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin: 0 0 26px; }
.page-head h1 { margin: 3px 0 4px; font-size: clamp(25px, 3vw, 36px); line-height: 1.08; letter-spacing: -.045em; font-weight: 600; }
.page-head p, .section-head p, .panel-head p { margin: 0; color: var(--ink-3); }
.eyebrow { color: var(--orange); font: 500 10px/1 "DM Mono", monospace; letter-spacing: .12em; }
.section-head { display: flex; justify-content: space-between; align-items: end; margin: 30px 0 10px; }
h2 { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
.section-head p { font-size: 11px; margin-top: 2px; }

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.tile { position: relative; min-height: 116px; padding: 15px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.tile::before { content: ""; position: absolute; width: 50px; height: 50px; border-radius: 50%; right: -20px; top: -20px; background: var(--lime); opacity: .25; }
.tile .k { color: var(--ink-2); font-size: 11px; }
.tile .v { margin: 13px 0 1px; font-size: 29px; font-weight: 600; line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.tile .s { color: var(--ink-3); font-size: 10px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; box-shadow: var(--shadow); }
.console-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.monitor-filters { margin-top: 14px; }
.monitor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 10px; }
.monitor-panel { min-width: 0; }
.monitor-panel .panel-head { margin-bottom: 2px; }
.metric-list { display: grid; }
.metric-row { display: grid; grid-template-columns: minmax(95px, 1fr) minmax(150px, 2fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.metric-row:last-child { border-bottom: 0; }
.metric-name { min-width: 0; font: 500 10px/1.3 "DM Mono", monospace; overflow: hidden; text-overflow: ellipsis; }
.metric-copy { min-width: 0; }
.metric-copy strong { display: block; font-size: 11px; font-weight: 600; }
.metric-copy span { color: var(--ink-3); font-size: 9px; }
.metric-number { text-align: right; font: 500 10px/1.4 "DM Mono", monospace; white-space: nowrap; }
.ratio-bar { height: 5px; margin-top: 5px; overflow: hidden; border-radius: 4px; background: var(--line); }
.ratio-bar span { display: block; height: 100%; border-radius: inherit; background: var(--ok); }
.ratio-bar.warn span { background: var(--warn); }
.ratio-bar.bad span { background: var(--bad); }
tr.health-critical td:first-child { box-shadow: inset 3px 0 var(--bad); }
tr.health-warning td:first-child { box-shadow: inset 3px 0 var(--warn); }
.problem-list { max-width: 310px; color: var(--ink-2); font-size: 10px; }
.form-card { display: flex; flex-direction: column; min-width: 0; }
.recent-panel { margin-top: 18px; }
.recent-panel .filter-bar { margin: 10px 0 12px; }
.recent-panel .table-wrap { margin: 0; }
.inspect-pair { margin-top: 5px; padding: 0; color: var(--blue); font-size: 10px; }
.panel-head { display: flex; gap: 11px; align-items: flex-start; padding-bottom: 14px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 15px; }
.panel-head p { font-size: 11px; }
.step-mark { display: grid; place-items: center; min-width: 28px; height: 28px; border-radius: 8px; background: var(--header); color: var(--lime); font: 500 10px/1 "DM Mono", monospace; }
.form-card > label, .form-card .field-grid label { display: block; margin: 9px 0 4px; color: var(--ink-2); font-size: 11px; font-weight: 600; }
.form-card label span { color: var(--ink-3); font-weight: 400; }
.form-card > select, .form-card > input { width: 100%; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.field-grid input, .field-grid select { width: 100%; }
.check { display: flex !important; align-items: center; gap: 7px; font-weight: 400 !important; cursor: pointer; }
.check input { width: 15px; height: 15px; }
.option-row { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; }
.command-preview { position: relative; margin-top: 12px; padding: 9px 72px 9px 10px; border-radius: 8px; background: var(--header); }
.command-preview > span { display: block; margin-bottom: 4px; color: var(--lime); font: 500 8px/1 "DM Mono", monospace; letter-spacing: .09em; }
.command-preview pre { margin: 0; overflow-x: auto; white-space: pre-wrap; color: #d9ddd1; }
.command-preview button { position: absolute; top: 9px; right: 10px; color: #b6bdad; }
.submit-row { display: flex; align-items: center; gap: 10px; margin-top: 13px; }
.feedback { color: var(--ink-3); font: 10px/1.4 "DM Mono", monospace; }
.compact-textarea { min-height: 54px; }
.result-box { margin-top: 13px; padding: 12px; min-height: 66px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); overflow: auto; }
.empty-state { display: grid; place-items: center; color: var(--ink-3); font-size: 11px; text-align: center; }
.plan-list { display: grid; gap: 6px; }
.plan-item { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: start; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.plan-item:last-child { border: 0; padding-bottom: 0; }
.plan-item a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); text-decoration: none; }
.plan-item .count { color: var(--ink-3); font: 10px "DM Mono", monospace; }
.maintenance-action { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.maintenance-action strong { font-size: 12px; }
.maintenance-action p { margin: 1px 0 0; color: var(--ink-3); font-size: 10px; }
.maintenance-action.destructive strong { color: var(--bad); }
.inline { display: flex; gap: 6px; }
.inline input { width: 66px; }
.inset-form { padding: 10px; background: var(--panel-2); border-bottom: 1px solid var(--line); }
.inset-form textarea { min-height: 70px; }

.banner { margin-top: 10px; padding: 10px 13px; border: 1px solid #ead5a7; border-radius: var(--radius); background: var(--warn-bg); color: var(--warn); font-size: 11px; }
.banner.bad { background: var(--bad-bg); border-color: #ecc7bd; color: var(--bad); }
.banner.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.banner.row .banner-text { flex: 1; min-width: 220px; }
.banner.row button { flex: 0 0 auto; }
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; background: var(--panel); }
th { padding: 9px 11px; text-align: left; border-bottom: 1px solid var(--line); background: var(--panel-2); color: var(--ink-3); font: 500 9px/1.2 "DM Mono", monospace; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
td { padding: 10px 11px; border-bottom: 1px solid var(--line); font-size: 12px; vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
th.tiny { width: 28px; }
tr.kid td, tr.pair td { background: var(--panel-2); }
tr.kid td:first-child, tr.pair td:first-child { padding-left: 26px; }
tr.page > td:first-child, tr.channel, tr.domain { cursor: pointer; }
tr.channel:hover td, tr.domain:hover td { background: var(--panel-2); }
tr.domain td { font-weight: 600; }

.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 20px; font: 500 9px/1.4 "DM Mono", monospace; white-space: nowrap; }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.acc { background: var(--acc-bg); color: var(--acc); }
.chip.mute { color: var(--ink-3); background: var(--panel-2); border: 1px solid var(--line); }

.filter-bar, .bar { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: 14px 0 10px; }
.grow { flex: 1; min-width: 180px; }
select, input, button, .button-link {
  height: 34px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 8px;
  background: var(--panel); color: var(--ink); font: 500 11px/1 Manrope, sans-serif;
}
select:focus, input:focus, textarea:focus { outline: 2px solid rgba(128, 158, 55, .2); border-color: #899b60; }
button, .button-link { cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
button:hover, .button-link:hover { border-color: var(--ink-3); }
button.primary, .button-link.primary { border-color: var(--header); background: var(--header); color: #fff; }
button.primary:hover, .button-link.primary:hover { background: var(--header-2); }
button.ghost { background: transparent; }
button.danger { color: var(--bad); border-color: #d8a294; }
button:disabled { opacity: .45; cursor: default; }
textarea { width: 100%; min-height: 90px; padding: 9px 10px; resize: vertical; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel); color: var(--ink); font: 11px/1.55 "DM Mono", monospace; }

.actions { position: sticky; bottom: 12px; display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: rgba(255, 254, 250, .96); box-shadow: 0 8px 30px rgba(0,0,0,.12); z-index: 4; }
.actions .group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 10px; color: var(--ink-3); font-size: 11px; }
.hint { color: var(--ink-3); font-size: 11px; margin: 8px 0 0; }
.err { position: fixed; right: 22px; top: 78px; max-width: 480px; margin: 0; padding: 12px 14px; z-index: 50; color: var(--bad); background: var(--bad-bg); border: 1px solid #e5b5a9; border-radius: 10px; box-shadow: 0 12px 40px rgba(0,0,0,.18); }
.err.ok { color: var(--ok); background: var(--ok-bg); border-color: #b9d68f; }
.hidden { display: none !important; }

.reference-intro { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 12px; }
.reference-intro strong { font-size: 15px; }
.reference-intro p { max-width: 680px; margin: 3px 0 0; color: var(--ink-3); font-size: 11px; }
.api-base { display: grid; gap: 3px; min-width: 240px; padding: 10px 12px; border-radius: 9px; background: var(--header); color: #fff; }
.api-base span { color: var(--lime); font: 500 8px "DM Mono", monospace; letter-spacing: .1em; }
.api-base code { color: #c3c7bd; }
.command-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.command-card { min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 13px; padding: 15px; box-shadow: var(--shadow); }
.command-card h2 { margin-bottom: 3px; }
.command-card > p { margin: 0 0 13px; min-height: 32px; color: var(--ink-3); font-size: 10px; }
.command-line { display: grid; grid-template-columns: 1fr auto; gap: 6px; align-items: start; margin-top: 7px; }
.command-line pre { min-width: 0; margin: 0; padding: 9px; overflow-x: auto; white-space: pre-wrap; border-radius: 7px; background: var(--header); color: #d9ddd1; }
.command-line button { height: 31px; font-size: 9px; }
.endpoint-list { display: grid; gap: 5px; }
.endpoint { display: grid; grid-template-columns: 46px 1fr; gap: 7px; align-items: start; }
.method { color: var(--orange); font: 500 9px "DM Mono", monospace; }
.endpoint code { overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }

.veil { display: none; position: fixed; inset: 0; z-index: 30; background: rgba(12, 14, 10, .48); backdrop-filter: blur(2px); }
.veil.on { display: block; }
.drawer { position: fixed; inset: 0 0 0 auto; width: min(780px, 100%); z-index: 31; overflow-y: auto; transform: translateX(100%); transition: transform .18s ease-out; background: var(--panel); border-left: 1px solid var(--line); }
.drawer.on { transform: none; }
.drawer .head { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding: 15px 18px; background: rgba(255,254,250,.96); border-bottom: 1px solid var(--line); }
.drawer .body { padding: 18px 20px 44px; }
.drawer .head strong { font-weight: 600; }
.facts { margin: 0; }
.facts dt { margin: 14px 0 4px; color: var(--ink-3); font: 500 9px "DM Mono", monospace; text-transform: uppercase; }
.facts dt:first-child { margin-top: 0; }
.facts dd, .facts p { margin: 0; }
.facts ul { margin: 0; padding-left: 18px; }
.facts li { margin: 2px 0; word-break: break-all; }

.channel-health { margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.channel-health h3 { margin: 12px 0 8px; font: 600 12px Manrope, sans-serif; }
.channel-health h3:first-child { margin-top: 0; }
.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 8px 0; }
.stat { padding: 8px 10px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line); }
.stat .mono { font-size: 16px; font-weight: 600; }
.stat .muted { font-size: 10px; margin-top: 2px; }
.stat.ok { border-color: #b9d68f; background: var(--ok-bg); }
.stat.warn { border-color: #e0c48a; background: var(--warn-bg); }
.proj-list { margin: 0; padding-left: 18px; }
.proj-list li { margin: 4px 0; }
.sample-list { display: grid; gap: 8px; margin: 8px 0 4px; }
.sample-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); }
.sample-main { min-width: 0; }
.sample-main a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; word-break: break-word; }
.sample-main a:hover { color: var(--acc); }
.sample-meta { white-space: nowrap; font-size: 10px; text-align: right; }
@media (max-width: 720px) {
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sample-row { grid-template-columns: 1fr; }
  .sample-meta { text-align: left; }
}
.snip { display: flex; gap: 8px; align-items: flex-start; }
.snip pre { flex: 1; min-width: 0; margin: 0; padding: 9px 11px; overflow: auto; user-select: all; white-space: pre-wrap; border: 1px solid var(--line); border-radius: 7px; background: var(--panel-2); color: var(--ink); }
.json-view .snip { margin-top: 8px; }
.json-view .snip pre { max-height: min(55vh, 520px); white-space: pre; }
button.quiet { height: auto; padding: 0; border: 0; background: none; color: var(--acc); font-size: 10px; }
button.quiet:hover { text-decoration: underline; }
.spark { display: block; width: 100%; height: 64px; }
.axis { display: flex; justify-content: space-between; margin-top: -2px; color: var(--ink-3); font-size: 10px; }
.empty { padding: 16px 0; color: var(--ink-3); font-size: 11px; }
.meter { width: 72px; height: 4px; margin: 5px 0 0 auto; overflow: hidden; border-radius: 3px; background: var(--line); }
.meter > span { display: block; height: 100%; border-radius: inherit; background: var(--bad); }
.meter.ok > span { background: var(--ok); }
.meter.warn > span { background: var(--warn); }
.sub { display: flex; flex-wrap: wrap; gap: 4px 8px; margin-top: 2px; }

@media (max-width: 1080px) {
  .appbar, body > header { height: auto; grid-template-columns: auto 1fr; gap: 10px 12px; padding: 10px 16px; }
  header nav { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; }
  header .status { min-width: 0; }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ov-grid { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .command-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .monitor-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .appbar, body > header { grid-template-columns: 1fr auto; padding: 10px 14px; }
  .identity { min-width: 0; }
  .status-pop { width: min(320px, calc(100vw - 28px)); }
  .kpis { grid-template-columns: 1fr 1fr; }
  .head-actions { width: 100%; justify-content: space-between; }
  main { padding: 24px 14px 50px; }
  .page-head { align-items: flex-start; flex-direction: column; margin-bottom: 20px; }
  .page-head > button, .page-head > .button-link { width: 100%; }
  .tiles, .console-grid, .command-grid { grid-template-columns: 1fr; }
  .field-grid { grid-template-columns: 1fr; }
  .reference-intro { align-items: stretch; flex-direction: column; }
  .api-base { min-width: 0; }
  .actions { align-items: stretch; flex-direction: column; }
  .actions .group { width: 100%; }
  .tile { min-height: 100px; }
}

/* fila de jobs: linha abre o detalhe com a saída do worker */
#job-queue tr.job-row { cursor: pointer; }
#job-queue tr.job-row:hover td, #job-queue tr.job-row.open td { background: var(--panel-2); }
#job-queue tr.job-detail td { padding: 10px 14px 16px; background: var(--panel-2); }
.job-detail h4 { margin: 12px 0 6px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
.job-detail-error { padding: 8px 10px; border-radius: 7px; background: var(--bad-bg); color: var(--bad); white-space: pre-wrap; }
.job-detail-pre { margin: 0; padding: 9px 11px; max-height: 360px; overflow: auto; white-space: pre-wrap; word-break: break-all; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: var(--ink); }
.feedback.bad { color: var(--bad); }

/* -- overview ---------------------------------------------------------------------- */
.head-actions { display: flex; align-items: center; gap: 8px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel); }
.seg button { height: 28px; padding: 0 11px; border: 0; border-radius: 7px; background: transparent; color: var(--ink-2); }
.seg button:hover { background: var(--panel-2); }
.seg button.on { background: var(--header); color: #fff; }

.verdict {
  display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; margin-bottom: 12px;
  padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); box-shadow: var(--shadow);
  border-left: 4px solid var(--ink-3);
}
.verdict.ok { border-left-color: #5d9a1d; background: linear-gradient(90deg, rgba(231, 244, 210, .7), var(--panel) 45%); }
.verdict.warn { border-left-color: #d69a1d; background: linear-gradient(90deg, rgba(255, 240, 206, .8), var(--panel) 45%); }
.verdict.bad { border-left-color: var(--bad); background: linear-gradient(90deg, rgba(252, 229, 223, .85), var(--panel) 45%); }
.verdict-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; font-size: 18px; font-weight: 700; }
.verdict.ok .verdict-icon { background: var(--ok-bg); color: var(--ok); }
.verdict.warn .verdict-icon { background: var(--warn-bg); color: var(--warn); }
.verdict.bad .verdict-icon { background: var(--bad-bg); color: var(--bad); }
.verdict h2 { font-size: 17px; letter-spacing: -.02em; }
.verdict p { margin: 2px 0 0; color: var(--ink-2); font-size: 12px; }
.verdict .facts-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }

.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.kpi { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 126px; padding: 14px 15px 13px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.kpi .k { display: flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 11px; font-weight: 600; }
.kpi .k::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); }
.kpi.ok .k::before { background: #5d9a1d; }
.kpi.warn .k::before { background: #d69a1d; }
.kpi.bad .k::before { background: var(--bad); }
.kpi .v { margin: 10px 0 2px; font-size: 26px; font-weight: 650; line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .v small { margin-left: 4px; color: var(--ink-3); font-size: 12px; font-weight: 500; letter-spacing: 0; }
.kpi .s { color: var(--ink-3); font-size: 10.5px; }
.kpi .foot { margin-top: auto; padding-top: 8px; }
.kpi .spark { height: 28px; }
.delta { display: inline-flex; align-items: center; gap: 3px; padding: 1px 6px; border-radius: 20px; font: 500 10px/1.5 "DM Mono", monospace; white-space: nowrap; }
.delta.down { background: var(--ok-bg); color: var(--ok); }
.delta.up { background: var(--bad-bg); color: var(--bad); }
.delta.flat { background: var(--panel-2); color: var(--ink-3); border: 1px solid var(--line); }

.ov-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 12px; margin-top: 12px; }
.chart-panel { min-width: 0; }
.chart-panel .panel-head { justify-content: space-between; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: flex-end; }
.legend span { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font: 500 10px/1.4 "DM Mono", monospace; }
.legend i { width: 14px; height: 2px; border-radius: 2px; }
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: 210px; overflow: visible; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .axis-label { fill: var(--ink-3); font: 10px "DM Mono", monospace; }
.chart .series { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .bar { pointer-events: none; }
.chart .end-label { font: 500 10px "DM Mono", monospace; fill: var(--ink-2); }
.chart .cross { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .dot { stroke: var(--panel); stroke-width: 2; }
.tip { position: absolute; top: 6px; z-index: 3; min-width: 150px; padding: 8px 10px; pointer-events: none; border-radius: 9px; background: var(--header); color: #e7eadf; font: 10px/1.6 "DM Mono", monospace; box-shadow: 0 10px 28px rgba(0, 0, 0, .2); }
.tip b { display: block; margin-bottom: 3px; color: #fff; font-weight: 500; }
.tip div { display: flex; justify-content: space-between; gap: 14px; }
.tip i { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 2px; }
.chart-empty { display: grid; place-items: center; height: 210px; color: var(--ink-3); font-size: 11px; text-align: center; border: 1px dashed var(--line-2); border-radius: 10px; background: var(--panel-2); }

.slot-list, .actor-list { display: grid; gap: 0; }
.sup-label { margin: 2px 0 6px; color: var(--ink-3); font: 500 9px/1 "DM Mono", monospace; letter-spacing: .08em; text-transform: uppercase; }
.sup-label + .slot-list { margin-bottom: 14px; }
.slot, .actor { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); }
.slot:last-child, .actor:last-child { border-bottom: 0; }
.slot strong, .actor strong { font-size: 12px; font-weight: 600; }
.slot .mono, .actor .mono { color: var(--ink-3); }
.slot .mono.warn { color: var(--warn); }
.slot .bar-track { height: 3px; margin-top: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.slot .bar-track span { display: block; height: 100%; background: var(--lime-ink); opacity: .55; border-radius: inherit; }
.actor .err-line { color: var(--bad); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px; }
.slot-free { color: var(--ink-3); font-size: 11px; padding: 7px 0; border-bottom: 1px dashed var(--line); }

table.drill tr.lvl0 { cursor: pointer; }
table.drill tr.lvl0:hover td { background: var(--panel-2); }
table.drill tr.lvl0 td:first-child { font-weight: 600; }
table.drill tr.lvl0.open td { background: var(--panel-2); }
table.drill tr.lvl1 td { background: #fbfaf6; font-size: 11.5px; }
table.drill tr.lvl1 td:first-child { padding-left: 34px; }
.caret { display: inline-block; width: 12px; color: var(--ink-3); transition: transform .12s; }
tr.open .caret { transform: rotate(90deg); }
.swatch { display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 2px; vertical-align: 1px; }
td .cellbar { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
td .cellbar .ratio-bar { width: 88px; margin: 0; }
.muted { color: var(--ink-3); }

.cycle-summary { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.cycle-summary .chip { font-size: 10px; padding: 3px 9px; }
.burn { font: 500 11px "DM Mono", monospace; white-space: nowrap; }

details.notes { margin-top: 26px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: var(--shadow); }
details.notes summary { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; cursor: pointer; font-weight: 600; list-style: none; }
details.notes summary::-webkit-details-marker { display: none; }
details.notes summary::before { content: "▸"; margin-right: 8px; color: var(--ink-3); }
details.notes[open] summary::before { content: "▾"; }
details.notes summary > span:first-child { flex: 1; }
details.notes > div { padding: 0 16px 14px; }
.mini-stats { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.mini-stats div { display: grid; }
.mini-stats b { font-size: 16px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.mini-stats span { color: var(--ink-3); font-size: 10px; }

@media (max-width: 1080px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ov-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi { min-height: 0; }
  .head-actions { width: 100%; justify-content: space-between; }
  .verdict { grid-template-columns: 1fr; gap: 10px; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .chart-panel .panel-head { flex-direction: column; }
  .legend { justify-content: flex-start; }
}

/* -- operate ----------------------------------------------------------------------- */
.ops-grid { display: grid; grid-template-columns: minmax(340px, 440px) minmax(0, 1fr); gap: 12px; margin-top: 12px; align-items: start; }
.launch { position: sticky; top: 76px; }
.seg-full { display: flex; width: 100%; margin-bottom: 4px; }
.seg-full button { flex: 1; }
.launch-pane { padding-top: 4px; }
.pane-lead { margin: 8px 0 0; color: var(--ink-3); font-size: 11px; }
.activity { min-width: 0; }
.activity .filter-bar { margin-top: 0; }
.activity .table-wrap { box-shadow: none; }
tr.act-row { cursor: pointer; }
tr.act-row:hover td { background: var(--panel-2); }
tr.act-row.open td { background: var(--acc-bg); }
tr.act-row.open td:first-child { box-shadow: inset 3px 0 var(--acc); }
.result-cell { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-cell.bad { color: var(--bad); }

.job-facts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.job-fact { display: grid; gap: 4px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); min-width: 0; }
.job-fact span { color: var(--ink-3); font: 500 9px/1 "DM Mono", monospace; text-transform: uppercase; letter-spacing: .06em; }
.job-fact strong { font-size: 11.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-head, .records-head { display: flex; align-items: center; gap: 10px; margin: 16px 0 6px; }
.log-head h4, .records-head h4 { margin: 0; flex: 1; }
.records-head h4 + .feedback { margin-right: auto; }
.drawer h4 { margin: 16px 0 6px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
.job-log { max-height: 340px; background: #14160f; color: #d9ddd1; border-color: #2a2d24; }
.job-detail-pre.short { max-height: 140px; }
.records .bar { margin: 0 0 8px; }
.records .table-wrap { box-shadow: none; max-height: 480px; overflow: auto; }
table.mini th { position: sticky; top: 0; z-index: 1; }
table.mini td { padding: 7px 9px; font-size: 11px; }
td.wrap { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
tr.rec-row { cursor: pointer; }
tr.rec-row:hover td, tr.rec-row.open td { background: var(--panel-2); }
tr.rec-detail td { background: var(--panel-2); padding: 8px 12px 12px; }
.json-tree-box { max-height: 520px; overflow: auto; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); }
.jt-node > summary { cursor: pointer; list-style: none; font: 11px/1.7 "DM Mono", monospace; }
.jt-node > summary::-webkit-details-marker { display: none; }
.jt-node > summary::before { content: "▸"; display: inline-block; width: 12px; color: var(--ink-3); }
.jt-node[open] > summary::before { content: "▾"; }
.jt-kids { padding-left: 14px; border-left: 1px dashed var(--line-2); margin-left: 4px; }
.jt-leaf { padding-left: 12px; font: 11px/1.7 "DM Mono", monospace; word-break: break-all; }
.jt-key { color: var(--ink-2); }
.jt-meta { color: var(--ink-3); }
.jt-string { color: #2f6b12; }
.jt-number { color: #1f5fb0; }
.jt-boolean { color: #9a4a12; }
.jt-null { color: var(--ink-3); }
.jt-kids > button.quiet { margin: 4px 0 4px 12px; }

details.danger-zone { margin-top: 18px; }
details.danger-zone summary > span:first-child { color: var(--bad); }

@media (max-width: 1080px) {
  .ops-grid { grid-template-columns: 1fr; }
  .launch { position: static; }
  .job-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* -- orchestrator ------------------------------------------------------------------- */
.orch-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(340px, 1fr); gap: 12px; margin-top: 12px; align-items: start; }
.orch-grid-even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.orch-facts { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 4px; }
.orch-control #orch-diff .banner { margin: 10px 0 0; }
.lane { display: grid; }
.lane-row { display: grid; grid-template-columns: minmax(150px, 1.1fr) minmax(160px, 1.4fr) auto; gap: 14px; align-items: center; padding: 9px 8px; border-bottom: 1px solid var(--line); border-radius: 6px; }
.lane-row:last-child { border-bottom: 0; }
.lane-row.running { background: linear-gradient(90deg, var(--acc-bg), transparent 70%); }
.lane-row.clickable { cursor: pointer; }
.lane-row.clickable:hover { background: var(--panel-2); }
.lane-row.blocked_store { opacity: .72; }
.lane-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lane-name strong { font-size: 12px; font-weight: 600; }
.lane-score .mono { color: var(--ink-2); font-size: 10px; }
.lane-score .mono.warn { color: var(--warn); }
.lane-score .ratio-bar { margin-top: 4px; }
.lane-right { display: flex; align-items: center; gap: 8px; justify-content: flex-end; white-space: nowrap; }
.lane-right .mono { color: var(--ink-3); font-size: 10px; }
.lane-right .mono.warn { color: var(--warn); }

.timeline-panel { margin-top: 12px; position: relative; }
.timeline-panel .panel-head { justify-content: space-between; }
#orch-timeline { position: relative; }
.timeline { display: grid; gap: 3px; }
.tl-row { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 12px; align-items: center; }
.tl-label { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.tl-label strong { font-size: 11.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-label .mono { font-size: 9.5px; }
.tl-track { position: relative; height: 20px; border-radius: 5px; background: repeating-linear-gradient(90deg, var(--panel-2) 0 calc(25% - 1px), var(--line) calc(25% - 1px) 25%); }
.tl-bar { position: absolute; top: 3px; bottom: 3px; min-width: 3px; border-radius: 3px; cursor: pointer; opacity: .85; box-shadow: 0 0 0 1px var(--panel); }
.tl-bar:hover { opacity: 1; box-shadow: 0 0 0 2px var(--ink); z-index: 2; }
.tl-bar.failed { box-shadow: 0 0 0 1px var(--panel), inset 0 0 0 2px var(--bad); background-image: repeating-linear-gradient(135deg, rgba(166, 60, 39, .55) 0 3px, transparent 3px 6px) !important; }
.tl-bar.running { background-image: linear-gradient(90deg, transparent, rgba(255, 255, 255, .5)); animation: tlpulse 1.6s ease-in-out infinite; }
@keyframes tlpulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .tl-bar.running { animation: none; } }
.tl-axis-row { margin-top: 2px; }
.tl-axis { position: relative; height: 14px; }
.tl-axis span { position: absolute; transform: translateX(-50%); color: var(--ink-3); font: 9.5px "DM Mono", monospace; white-space: nowrap; }
.tl-axis span:first-child { transform: none; }
.tl-axis span:last-child { transform: translateX(-100%); }
.tl-failed-key { display: inline-block; width: 8px !important; height: 8px !important; border-radius: 2px; box-shadow: inset 0 0 0 2px var(--bad); background: var(--bad-bg) !important; }
.bad-text { color: var(--bad); }

@media (max-width: 1080px) {
  .orch-grid, .orch-grid-even { grid-template-columns: 1fr; }
  .tl-row { grid-template-columns: 110px minmax(0, 1fr); }
  .lane-row { grid-template-columns: 1fr; gap: 6px; }
  .lane-right { justify-content: flex-start; }
}

/* Self Commerce ----------------------------------------------------------- */
.sc-layout { display: grid; gap: 16px; margin-top: 16px; }
.sc-detail-head { margin-top: 0; }
.sc-ops { margin-top: 12px; }
.sc-scroll { max-height: 280px; overflow: auto; }
.sc-scroll table { box-shadow: none; }
#sc-stores tbody tr { cursor: pointer; }
#sc-stores tbody tr:hover td { background: var(--panel-2); }
#sc-stores tbody tr.on td { background: var(--acc-bg); }
#sc-categories tbody tr, #sc-brands tbody tr { cursor: pointer; }
#sc-categories tbody tr:hover td, #sc-brands tbody tr:hover td { background: var(--panel-2); }
#sc-artifacts { min-height: 120px; padding: 14px; }
.sc-runs { margin-top: 16px; }
.sc-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.sc-stage { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: start; padding: 12px 14px; border-top: 1px solid var(--line); }
.sc-stage h3 { margin: 0; font-size: 14px; }
.sc-stage p { margin: 4px 0 0; color: var(--ink-3); font-size: 12.5px; }
#sc-runs tbody tr { cursor: pointer; }
#sc-runs tbody tr.on td { background: var(--acc-bg); }
#sc-pipeline { padding-bottom: 4px; }
@media (min-width: 1100px) {
  .sc-layout { grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); align-items: start; }
}
