/* OverPush console.
   Light is the default; dark is opt-in from the sidebar. One radius scale
   (6 / 8 / 12), one control height (34px), solid hairlines, gold only as an
   accent (logo, avatars, chart marks). */

:root {
  --bg: #f7f7f5;
  --side: #fbfbfa;
  --card: #ffffff;
  --card-2: #fafaf9;
  --head: #fafaf8;
  --ink: #18181b;
  --ink-2: #52525b;
  --ink-3: #8a8a93;
  --line: #e9e7e2;
  --line-2: #dcd9d2;
  --hover: #f3f2ef;
  --code: rgba(24, 24, 27, .05);
  --gold: #9a7330;
  --gold-grad: linear-gradient(160deg, #f6e6c0 0%, #d8b673 55%, #b58d4b 100%);
  --on-gold: #1b1408;
  --focus: rgba(154, 115, 48, .35);
  /* Chart marks: validated against --card (OKLCH band, chroma, 3:1). */
  --series: #a8741c;
  --critical: #c7333f;
  --ok: #1d7f4e;
  --warn: #9a6200;
  --grid: rgba(24, 24, 27, .07);
  --shadow: 0 1px 2px rgba(24, 24, 27, .05);
  --shadow-lg: 0 12px 32px -12px rgba(24, 24, 27, .25), 0 0 0 1px rgba(24, 24, 27, .06);
  --auth-bg:
    radial-gradient(900px 520px at 50% 18%, rgba(216, 182, 115, .22), transparent 65%),
    radial-gradient(1100px 700px at 6% 100%, rgba(140, 160, 225, .18), transparent 60%),
    radial-gradient(900px 600px at 100% 0%, rgba(160, 190, 235, .16), transparent 60%),
    #f6f5f1;
  --body: "Geist", ui-sans-serif, system-ui, sans-serif;
  --serif: "Instrument Serif", ui-serif, Georgia, serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0a0a0b;
  --side: #0d0d0f;
  --card: #111113;
  --card-2: #16161a;
  --head: #141417;
  --ink: #f2f1ee;
  --ink-2: #a6a5a0;
  --ink-3: #6e6d69;
  --line: #222226;
  --line-2: #2e2e33;
  --hover: #1a1a1e;
  --code: rgba(255, 255, 255, .06);
  --gold: #d8b673;
  --focus: rgba(216, 182, 115, .35);
  --series: #bf8526;
  --critical: #e25c50;
  --ok: #4fbf8a;
  --warn: #e0a640;
  --grid: rgba(255, 255, 255, .06);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-lg: 0 16px 40px -12px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .06);
  --auth-bg:
    radial-gradient(900px 520px at 50% 18%, rgba(216, 182, 115, .14), transparent 65%),
    radial-gradient(1100px 700px at 6% 100%, rgba(90, 110, 180, .14), transparent 60%),
    #0a0a0b;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 14px/1.5 var(--body); -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
code { background: var(--code); padding: 1px 5px; border-radius: 5px; }
button, input, select { font: inherit; color: inherit; }
.i { flex: none; display: block; }
.strong { font-weight: 600; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- shell ---------- */
.shell { display: flex; min-height: 100%; }
.side {
  width: 244px; flex: none; background: var(--side); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 14px; padding: 16px 12px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 9px; padding: 4px 6px; text-decoration: none; font-weight: 650; font-size: 15px; letter-spacing: -.01em; }
.brand img { width: 24px; height: 24px; border-radius: 6px; }

.org-switch {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); cursor: pointer;
}
.org-switch:hover { border-color: var(--line-2); }
.org-av {
  width: 28px; height: 28px; border-radius: 7px; flex: none; display: grid; place-items: center;
  background: var(--gold-grad); color: var(--on-gold); font-weight: 700; font-size: 13px;
}
.org-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.org-switch select {
  appearance: none; -webkit-appearance: none; border: 0; background: none; padding: 0; margin: 0;
  height: auto; box-shadow: none; font-weight: 600; font-size: 13.5px; width: 100%; cursor: pointer; text-overflow: ellipsis;
}
.org-switch select:focus { outline: none; box-shadow: none; }
.org-switch:focus-within { outline: 2px solid var(--focus); outline-offset: 1px; }
.org-role { font-size: 11.5px; color: var(--ink-3); text-transform: capitalize; }
.org-caret { color: var(--ink-3); flex: none; pointer-events: none; }

.side-nav { display: flex; flex-direction: column; gap: 1px; }
.side-nav a, .side-nav button {
  display: flex; align-items: center; justify-content: flex-start; gap: 10px; height: 34px; padding: 0 10px; border-radius: 8px;
  text-decoration: none; color: var(--ink-2); border: 0; background: none; box-shadow: none; font-weight: 400;
  cursor: pointer; text-align: left; width: 100%;
}
.side-nav a .i, .side-nav button .i { color: var(--ink-3); }
.side-nav a:hover, .side-nav button:hover { background: var(--hover); color: var(--ink); }
.side-nav a.on { background: var(--card); color: var(--ink); font-weight: 550; box-shadow: var(--shadow), 0 0 0 1px var(--line); }
.side-nav a.on .i { color: var(--gold); }
.side-nav .ext { margin-left: auto; color: var(--ink-3); font-size: 12px; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.me { display: flex; align-items: center; gap: 10px; padding: 12px 4px 0; border-top: 1px solid var(--line); }
.me-av {
  width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--ink); color: var(--bg); font-weight: 600; font-size: 13px;
}
.me-text { flex: 1; min-width: 0; text-decoration: none; display: flex; flex-direction: column; }
.who { font-size: 13px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-sub { font-size: 11.5px; color: var(--ink-3); }

.main { flex: 1; min-width: 0; }
main { max-width: 1160px; margin: 0 auto; padding: 28px 36px 80px; }
.mobile-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--side);
  position: sticky; top: 0; z-index: 10;
}
@media (max-width: 860px) {
  .side { position: fixed; z-index: 30; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: var(--shadow-lg); }
  main { padding: 20px 16px 64px; }
}
@media (min-width: 861px) { .mobile-top { display: none !important; } }

/* ---------- type & page ---------- */
h1 { font-size: 22px; font-weight: 650; letter-spacing: -.02em; margin: 0; line-height: 1.25; }
h1 .serif, .serif {
  font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--gold);
}
h2 { font-size: 15px; font-weight: 600; margin: 0; }
.crumbs { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--ink-3); margin-bottom: 12px; flex-wrap: wrap; }
.crumbs a { text-decoration: none; color: var(--ink-3); }
.crumbs a:hover { color: var(--ink); }
.crumbs span:last-child:not(:first-child) { color: var(--ink-2); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head p { margin: 6px 0 0; }
.section { margin-top: 28px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.section-head .faint, .section-head a { font-size: 13px; }
.section-head a { color: var(--ink-2); text-decoration: none; }
.section-head a:hover { color: var(--ink); }

/* ---------- surfaces ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.card-pad { padding: 18px 20px; }
.grid { display: grid; gap: 14px; }
.grid.charts { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow);
}
.stat { background: var(--card); padding: 16px 18px; }
.stat .label { font-size: 12.5px; color: var(--ink-2); }
.stat .value { font-size: 26px; font-weight: 600; letter-spacing: -.02em; margin-top: 6px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat .value.bad { color: var(--critical); }
.stat .note { font-size: 12px; color: var(--ink-3); margin-top: 6px; }

.app-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.app-icon {
  width: 32px; height: 32px; border-radius: 8px; flex: none; display: grid; place-items: center;
  background: var(--gold-grad); color: var(--on-gold); font-weight: 700; font-size: 14px;
  box-shadow: inset 0 0 0 1px rgba(27, 20, 8, .08);
}
.app-icon.lg { width: 46px; height: 46px; border-radius: 12px; font-size: 20px; }
.id-chip {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 5px; height: 24px; padding: 0 8px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--card-2); color: var(--ink-2); cursor: pointer;
}
.id-chip .mono { font-size: 11.5px; }
.id-chip:hover { color: var(--ink); border-color: var(--line-2); }
.id-chip .i { width: 13px; height: 13px; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 24px; overflow-x: auto; }
.tabs a {
  padding: 9px 12px; text-decoration: none; color: var(--ink-2); border-bottom: 2px solid transparent;
  margin-bottom: -1px; white-space: nowrap; font-weight: 500;
}
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--ink); border-bottom-color: var(--ink); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
thead th {
  background: var(--head); color: var(--ink-3); font-weight: 500; font-size: 12.5px; white-space: nowrap;
  padding-top: 9px; padding-bottom: 9px;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr.link { cursor: pointer; }
tbody tr.link:hover td { background: var(--hover); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.chev { width: 36px; color: var(--ink-3); padding-left: 0; }
td b { white-space: nowrap; font-weight: 600; }
.plats { display: flex; gap: 12px; flex-wrap: wrap; }
.empty { padding: 44px 20px; text-align: center; color: var(--ink-2); }
.empty-title { font-size: 15px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.empty p { margin: 0 auto; max-width: 460px; }

/* ---------- badges & platform ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 6px;
  font-size: 12px; font-weight: 500; white-space: nowrap; line-height: 1;
  background: var(--code); color: var(--ink-2); border: 1px solid transparent;
}
.badge.ok, .badge.bad, .badge.warn, .badge.gold { background: color-mix(in srgb, currentColor 9%, transparent); border-color: color-mix(in srgb, currentColor 22%, transparent); }
.badge.ok::before, .badge.bad::before, .badge.warn::before, .badge.gold::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor;
}
.badge.ok { color: var(--ok); }
.badge.bad { color: var(--critical); }
.badge.warn { color: var(--warn); }
.badge.gold { color: var(--gold); }
.plat { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); white-space: nowrap; }
.plat .i { color: var(--ink-3); }

/* ---------- controls ---------- */
input, select {
  height: 34px; background: var(--card); border: 1px solid var(--line-2); border-radius: 8px; padding: 0 11px;
  box-shadow: var(--shadow);
}
select { padding-right: 28px; }
input:focus, select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--focus); }
button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 12px;
  border: 1px solid var(--line-2); background: var(--card); border-radius: 8px; cursor: pointer;
  font-weight: 500; white-space: nowrap; box-shadow: var(--shadow); transition: background .12s, border-color .12s;
}
button:hover { background: var(--hover); }
button.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
button.primary:hover { background: color-mix(in srgb, var(--ink) 86%, var(--bg)); }
button.danger { color: var(--critical); }
button.danger:hover { background: color-mix(in srgb, var(--critical) 8%, transparent); border-color: color-mix(in srgb, var(--critical) 35%, transparent); }
button.sm { height: 28px; padding: 0 10px; font-size: 13px; }
button.icon { width: 30px; height: 30px; padding: 0; border-color: transparent; background: none; box-shadow: none; color: var(--ink-2); }
button.icon:hover { background: var(--hover); color: var(--ink); }
button.link { height: auto; padding: 0; border: 0; background: none; box-shadow: none; font-weight: 400; }
button:disabled { opacity: .45; cursor: default; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > input { flex: 1; min-width: 180px; }
.switch { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 13px; cursor: pointer; user-select: none; }
.switch input { width: 15px; height: 15px; padding: 0; box-shadow: none; accent-color: var(--ink); }
.copy { display: flex; gap: 8px; align-items: center; background: var(--card-2); border: 1px solid var(--line); padding: 6px 6px 6px 12px; border-radius: 8px; }
.copy code { flex: 1; overflow-wrap: anywhere; background: none; padding: 0; }

/* ---------- ⋮ menu ---------- */
.menu { position: relative; display: inline-block; }
.menu-list {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 196px;
  background: var(--card); border-radius: 10px; padding: 4px; box-shadow: var(--shadow-lg);
}
.menu-list button {
  width: 100%; justify-content: flex-start; border: 0; background: none; box-shadow: none;
  height: 32px; padding: 0 10px; border-radius: 6px; font-weight: 400;
}
.menu-list button:hover { background: var(--hover); }
.menu-list button.danger:hover { background: color-mix(in srgb, var(--critical) 8%, transparent); }

/* ---------- charts ---------- */
.chart { padding: 16px 18px 12px; }
.chart h2 { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.chart .big { font-size: 24px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.chart svg { width: 100%; height: 150px; display: block; margin-top: 10px; overflow: visible; }
.chart .axis { fill: var(--ink-3); font-size: 10.5px; font-family: var(--body); }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .hit { fill: transparent; }
.chart details { margin-top: 6px; font-size: 12.5px; color: var(--ink-2); }
.chart details summary { cursor: pointer; }
.chart details table th, .chart details table td { padding: 6px 8px; }
.tip {
  position: fixed; z-index: 50; pointer-events: none; background: var(--card); border-radius: 8px;
  padding: 7px 10px; font-size: 12.5px; box-shadow: var(--shadow-lg);
}
.tip b { font-variant-numeric: tabular-nums; }
.bar { height: 6px; border-radius: 99px; background: var(--code); overflow: hidden; min-width: 80px; }
.bar > i { display: block; height: 100%; background: var(--series); border-radius: 99px; }

/* ---------- misc ---------- */
.narrow { max-width: 420px; margin: 9vh auto; }
label.field { display: block; font-size: 13px; font-weight: 500; color: var(--ink-2); margin: 14px 0 6px; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--line); align-items: center; }
.feed li:last-child { border-bottom: 0; }
.feed time { color: var(--ink-3); font-size: 12.5px; white-space: nowrap; min-width: 140px; }
.feed .what { flex: 1; min-width: 0; }
pre.details { white-space: pre-wrap; font-size: 12px; max-height: 320px; overflow: auto; background: var(--code); padding: 10px; border-radius: 8px; }
#toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 60;
  background: var(--ink); color: var(--bg); padding: 9px 14px; border-radius: 8px; max-width: calc(100% - 32px);
  font-size: 13.5px; box-shadow: var(--shadow-lg);
}
dialog {
  border: 0; border-radius: 14px; background: var(--card); color: var(--ink);
  padding: 22px; width: min(440px, calc(100% - 32px)); box-shadow: var(--shadow-lg);
}
dialog::backdrop { background: rgba(10, 10, 12, .45); }
dialog h2 { font-size: 16px; margin-bottom: 6px; }
dialog input, dialog select { width: 100%; }
dialog .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* ---------- sign in ---------- */
body.is-auth main { max-width: none; padding: 0; }
.auth { min-height: 100vh; display: grid; place-items: center; padding: 48px 16px; background: var(--auth-bg); }
.auth-box { width: min(380px, 100%); text-align: center; }
.auth-brand { display: inline-flex; align-items: center; gap: 11px; margin-bottom: 40px; font-size: 28px; font-weight: 700; letter-spacing: -.035em; }
.auth-brand img { width: 40px; height: 40px; border-radius: 10px; box-shadow: 0 8px 22px -10px rgba(120, 85, 25, .55); }
.auth-title { font-size: 22px; font-weight: 650; letter-spacing: -.02em; margin: 0 0 26px; }
.auth-sub { color: var(--ink-2); margin: -12px 0 22px; }
.auth-form { display: flex; flex-direction: column; gap: 10px; }
.auth-form .auth-sub { margin: 0 0 6px; }
.auth-form input { height: 44px; border-radius: 10px; padding: 0 14px; font-size: 15px; }
.auth-form input.code-input { text-align: center; font-family: var(--mono); font-size: 20px; letter-spacing: .45em; padding-left: calc(14px + .45em); }
button.btn-lg { height: 44px; border-radius: 10px; font-size: 15px; width: 100%; }
.auth-google { display: flex; justify-content: center; min-height: 44px; }
.auth-or {
  display: flex; align-items: center; gap: 14px; margin: 20px 0;
  color: var(--ink-3); font-size: 12px; text-transform: uppercase; letter-spacing: .08em;
}
.auth-or::before, .auth-or::after { content: ''; flex: 1; height: 1px; background: var(--line-2); }
.auth-links { display: flex; gap: 8px; justify-content: center; color: var(--ink-3); font-size: 13px; margin-top: 6px; }
.auth-links .link { color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.auth-help { margin: 36px 0 6px; color: var(--ink-2); font-size: 13.5px; }
.auth-legal { margin: 0; color: var(--ink-3); font-size: 12.5px; }
.auth-legal a { color: var(--ink-2); text-underline-offset: 3px; }
