/* Outside-In shared shell: dark command-center tokens, sidebar, page
   container, typography, cards, chips, and mobile layout. */

:root {
  --bg: #080b10;
  --bg-soft: #0d1118;
  --card: rgba(255, 255, 255, 0.075);
  --card-strong: rgba(5, 8, 14, 0.72);
  --line: rgba(255, 255, 255, 0.13);
  --line-soft: rgba(255, 255, 255, 0.08);
  --ink: rgba(255, 255, 255, 0.94);
  --ink-mid: rgba(255, 255, 255, 0.68);
  --ink-soft: rgba(255, 255, 255, 0.48);
  --accent: #67e8f9;
  --accent-strong: #22d3ee;
  --accent-soft: rgba(103, 232, 249, 0.12);
  --green: #34d399;
  --amber: #fbbf24;
  --red: #fb7185;
  --violet: #a78bfa;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.34);
  --shell-rail: clamp(248px, 25vw, 360px);
  --shell-gap: 18px;
  --shell-radius: 22px;
  --topbar-height: 50px;
  --content-gap: 16px;
}

* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(103,232,249,.46) rgba(255,255,255,.045);
}
[hidden] { display: none !important; }
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
*::-webkit-scrollbar-track {
  background: rgba(255,255,255,.035);
  border-radius: 999px;
}
*::-webkit-scrollbar-thumb {
  min-height: 40px;
  border: 2px solid rgba(8,11,17,.88);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(103,232,249,.72), rgba(52,211,153,.56));
}
*::-webkit-scrollbar-thumb:hover {
  background:
    linear-gradient(180deg, rgba(103,232,249,.92), rgba(52,211,153,.74));
}
*::-webkit-scrollbar-corner { background: transparent; }
html, body { margin: 0; padding: 0; width: 100%; height: 100%; min-height: 100%; overflow: hidden; }
html { background: #05070b; }
body {
  position: relative;
  height: 100vh;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, sans-serif;
  font-feature-settings: 'cv11','ss01','ss03';
  color: var(--ink);
  background:
    radial-gradient(circle at 16% 0%, rgba(251, 113, 133, 0.11), transparent 24rem),
    radial-gradient(circle at 74% 8%, rgba(34, 211, 238, 0.14), transparent 28rem),
    linear-gradient(135deg, #160e12 0%, #090d14 38%, #05070b 100%);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body::before,
body::after {
  content: "";
  position: fixed;
  pointer-events: none;
}
body::before {
  inset: 0;
  background:
    linear-gradient(90deg, rgba(10,13,20,.92) 0, rgba(10,13,20,.86) var(--shell-rail), rgba(8,11,17,.56) 100%),
    radial-gradient(circle at 84% 0%, rgba(103,232,249,.12), transparent 28rem);
  z-index: 0;
}
body::after {
  display: none;
}

a { color: var(--accent); }
.num { font-family: 'JetBrains Mono', ui-monospace, monospace; font-feature-settings: 'tnum','zero'; }

.sidenav {
  position: fixed; top: 0; left: 0;
  width: var(--shell-rail); height: 100vh;
  background: transparent;
  padding: 28px 16px;
  display: flex; flex-direction: column; gap: 18px;
  overflow-y: auto;
  z-index: 20;
  backdrop-filter: none;
  box-shadow: none;
  scrollbar-gutter: stable;
}
.sidenav-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 6px; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #061016; font-size: 11px; font-weight: 800;
  background: linear-gradient(135deg, #67e8f9, #34d399);
  box-shadow: 0 0 0 1px rgba(255,255,255,.18), 0 10px 26px rgba(34,211,238,.16);
}
.brand-mark::after { content: "OI"; }
.brand-text { font-weight: 700; font-size: 15px; letter-spacing: 0; }
.sidenav-section { display: flex; flex-direction: column; gap: 14px; }
.sidenav-group {
  display: flex; flex-direction: column; flex-wrap: wrap; gap: 6px;
  min-width: 0;
}
.sidenav-group-body,
.sidenav-subbody {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.sidenav-subbody {
  gap: 5px;
}
.sidenav-group-head {
  display: flex; align-items: center; gap: 8px;
  padding: 0 8px 4px;
  font-size: 10px; color: var(--ink-soft);
  text-transform: uppercase; letter-spacing: .08em; font-weight: 800;
  width: 100%;
  height: auto;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.sidenav-group-head:hover {
  background: rgba(255,255,255,.045);
  color: var(--ink-mid);
}
.sidenav-icon,
.sidenav-subhead-icon,
.sidenav-item-icon {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
  border: 1px solid var(--line-soft);
  background: rgba(255,255,255,.055);
  color: var(--ink-mid);
}
.sidenav-icon svg,
.sidenav-subhead-icon svg,
.sidenav-item-icon svg {
  width: 15px;
  height: 15px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sidenav-icon {
  width: 24px; height: 24px; border-radius: 8px;
  color: var(--accent);
  background: rgba(103,232,249,.10);
}
.sidenav-subgroup {
  display: flex; flex-direction: column; gap: 5px;
  margin-left: 10px; padding-left: 10px;
  border-left: 1px solid rgba(255,255,255,.10);
  min-width: 0;
}
.sidenav-subgroup.is-active-section { border-left-color: rgba(103,232,249,.42); }
.sidenav-subhead {
  display: flex; align-items: center; gap: 7px;
  padding: 2px 0 1px;
  color: var(--ink-soft);
  font-size: 11px; font-weight: 750;
  width: 100%;
  height: auto;
  border: 0;
  border-radius: 7px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.sidenav-subhead:hover {
  color: var(--ink-mid);
  background: rgba(255,255,255,.035);
}
.sidenav-subhead-icon {
  width: 20px; height: 20px; border-radius: 7px;
}
.sidenav-subhead-icon svg {
  width: 12px;
  height: 12px;
}
.sidenav-item {
  display: grid; grid-template-columns: 25px minmax(0, 1fr); align-items: center; gap: 8px;
  padding: 7px 9px; border-radius: 8px;
  font-size: 13px; color: var(--ink-mid); text-decoration: none;
  transition: background .12s, color .12s, border-color .12s;
  border: 1px solid transparent;
  min-width: 0;
}
.sidenav-item-icon {
  width: 25px; height: 24px; border-radius: 7px;
  color: rgba(226,232,240,.78);
  overflow: visible;
}
.sidenav-item-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidenav-item:hover { background: rgba(255,255,255,.07); color: var(--ink); }
.sidenav-item.is-active {
  background: var(--accent-soft);
  border-color: rgba(103,232,249,.22);
  color: var(--ink);
  font-weight: 650;
}
.sidenav-item.is-active .sidenav-item-icon {
  color: #061016;
  border-color: rgba(103,232,249,.44);
  background: linear-gradient(135deg, #67e8f9, #34d399);
}

.wrap {
  position: fixed;
  top: calc(var(--shell-gap) + var(--topbar-height));
  right: 0;
  bottom: 0;
  left: calc(var(--shell-rail) + var(--shell-gap));
  max-width: none;
  min-height: 0;
  margin: 0;
  padding: 24px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--shell-radius);
  background:
    radial-gradient(circle at 82% 0%, rgba(103,232,249,.08), transparent 24rem),
    linear-gradient(180deg, rgba(18,24,36,.93), rgba(7,10,15,.985));
  box-shadow: 0 24px 72px rgba(0,0,0,.46), inset 0 1px rgba(255,255,255,.055);
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
  z-index: 5;
}
.wrap::-webkit-scrollbar-track,
.sidenav::-webkit-scrollbar-track {
  background: rgba(255,255,255,.025);
}
.wrap > * {
  position: relative;
  z-index: 1;
}
header.top {
  position: fixed;
  top: 0;
  right: 0;
  left: var(--shell-rail);
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 0;
  padding: 12px var(--shell-gap) 12px var(--content-gap);
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
  z-index: 15;
  backdrop-filter: none;
}
header.top > div:first-child { min-width: 0; }
h1 { font-size: 18px; font-weight: 750; letter-spacing: 0; margin: 0; }
.sub { color: var(--ink-mid); font-size: 13px; max-width: 760px; }
header.top .sub { display: none; }
.top-status {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
  max-width: 620px;
}
.status-pill {
  min-height: 34px;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  padding: 5px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255,255,255,.045);
  color: var(--ink-mid);
  white-space: nowrap;
}
.status-pill .kicker {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.status-pill strong {
  color: var(--ink);
  font-size: 11px;
  line-height: 1.1;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 12px; flex-wrap: wrap; }
.card-title { font-size: 14px; font-weight: 700; letter-spacing: 0; color: var(--ink); }
.card-sub { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.card-tools,
.export-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.export-button {
  min-width: 0;
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  border-color: var(--line-soft);
  background: rgba(255,255,255,.045);
  color: var(--ink-mid);
  font-size: 12px;
  font-weight: 700;
}
.export-button:hover {
  border-color: rgba(103,232,249,.34);
  background: rgba(103,232,249,.10);
  color: var(--ink);
}
.export-button[disabled] {
  cursor: not-allowed;
  opacity: .55;
}

.saved-view-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px;
  min-width: 0;
}
.saved-view-field {
  display: grid;
  gap: 5px;
  min-width: 180px;
}
.saved-view-field label,
.lens-field label {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 750;
}
.saved-view-action {
  height: 36px;
  font-size: 12px;
}
.saved-view-action[disabled] {
  cursor: not-allowed;
  opacity: .5;
}
.saved-view-status {
  min-height: 16px;
  align-self: center;
  color: var(--accent);
  font-size: 12px;
}

.live-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 650;
  border: 1px solid var(--line); background: rgba(255,255,255,.06); color: var(--ink-mid);
  white-space: nowrap;
}
.live-chip .dot { width: 7px; height: 7px; border-radius: 999px; background: #94a3b8; }
.live-chip.is-live { background: rgba(52,211,153,.11); border-color: rgba(52,211,153,.26); color: #bbf7d0; }
.live-chip.is-live .dot { background: var(--green); }
.live-chip.is-sample { background: rgba(251,191,36,.12); border-color: rgba(251,191,36,.28); color: #fde68a; }
.live-chip.is-sample .dot { background: var(--amber); }
.live-chip.is-partial { background: rgba(251,191,36,.12); border-color: rgba(251,191,36,.28); color: #fde68a; }
.live-chip.is-partial .dot { background: var(--amber); }
.live-chip.is-empty { background: rgba(148,163,184,.12); border-color: rgba(148,163,184,.28); color: #e2e8f0; }
.live-chip.is-empty .dot { background: #94a3b8; }
.live-chip.is-fail { background: rgba(251,113,133,.12); border-color: rgba(251,113,133,.3); color: #fecdd3; }
.live-chip.is-fail .dot { background: var(--red); }
.live-chip.is-loading .dot { background: #94a3b8; }

input, select, button {
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.07);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  transition: background .14s, border-color .14s, box-shadow .14s, color .14s;
}
input, select { padding: 0 10px; min-width: 0; }
input::placeholder { color: var(--ink-soft); }
input:hover,
select:hover {
  border-color: rgba(255,255,255,.22);
  background-color: rgba(255,255,255,.095);
}
select {
  appearance: none;
  -webkit-appearance: none;
  color-scheme: dark;
  padding-right: 34px;
  cursor: pointer;
  background-color: rgba(255,255,255,.07);
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(255,255,255,.74) 50%),
    linear-gradient(135deg, rgba(255,255,255,.74) 50%, transparent 50%),
    linear-gradient(180deg, rgba(255,255,255,.085), rgba(255,255,255,.035));
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 12px) 50%,
    100% 0;
  background-size:
    6px 6px,
    6px 6px,
    36px 100%;
  background-repeat: no-repeat;
}
select:focus {
  border-color: rgba(103,232,249,.58);
  box-shadow: 0 0 0 3px rgba(103,232,249,.12), inset 0 1px rgba(255,255,255,.08);
  background-color: rgba(255,255,255,.105);
}
select::-ms-expand { display: none; }
select option,
select optgroup {
  background: #0d1118;
  color: var(--ink);
}
select option {
  padding: 9px 10px;
}
select option:checked {
  background: #12303a;
  color: #e6fbff;
}
button { padding: 0 13px; font-weight: 700; cursor: pointer; }
button.primary,
a.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: var(--accent);
  color: #061016;
  font-weight: 700;
  text-decoration: none;
}
button.ghost { background: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 980px) {
  :root {
    --shell-rail: 188px;
    --shell-gap: 10px;
    --shell-radius: 16px;
    --topbar-height: 58px;
    --content-gap: 12px;
  }
  .sidenav {
    padding: 16px 10px;
    gap: 14px;
  }
  .sidenav-brand { padding-left: 4px; }
  .brand-text { font-size: 13px; }
  .sidenav-group-head {
    padding-left: 3px;
    font-size: 9px;
  }
  .sidenav-subgroup {
    margin-left: 7px;
    padding-left: 8px;
  }
  .sidenav-item {
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 7px;
    padding: 7px 7px;
    font-size: 12px;
  }
  .sidenav-item-icon {
    width: 24px;
    height: 23px;
  }
  .wrap {
    padding: 18px 14px 30px;
    left: calc(var(--shell-rail) + var(--content-gap));
    top: calc(var(--shell-gap) + var(--topbar-height));
  }
  header.top { left: var(--shell-rail); padding: 12px var(--shell-gap) 12px var(--content-gap); }
  .top-status {
    justify-content: flex-end;
    max-width: 100%;
  }
}

@media (max-width: 620px) {
  :root {
    --shell-rail: 86px;
    --shell-gap: 8px;
    --shell-radius: 14px;
    --topbar-height: 82px;
    --content-gap: 8px;
  }
  .sidenav {
    width: var(--shell-rail);
    padding: 12px 8px;
    gap: 12px;
    align-items: center;
  }
  .sidenav-brand {
    justify-content: center;
    padding: 0 0 4px;
  }
  .brand-text,
  .sidenav-label,
  .sidenav-item-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .sidenav-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }
  .sidenav-group-body,
  .sidenav-subbody {
    align-items: center;
  }
  .sidenav-group {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: center;
    gap: 7px;
    overflow: visible;
    padding-bottom: 0;
  }
  .sidenav-group-head {
    justify-content: center;
    min-width: 0;
    padding: 0;
  }
  .sidenav-subgroup {
    align-items: center;
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
    min-width: 0;
  }
  .sidenav-subhead {
    justify-content: center;
    padding-left: 0;
  }
  .sidenav-item {
    display: flex;
    justify-content: center;
    width: 42px;
    min-width: 0;
    padding: 7px;
  }
  .sidenav-item-icon {
    width: 28px;
    height: 28px;
  }
  .wrap {
    left: calc(var(--shell-rail) + var(--content-gap));
    top: calc(var(--shell-gap) + var(--topbar-height));
    padding: 16px 12px 28px;
  }
  header.top {
    left: var(--shell-rail);
    height: var(--topbar-height);
    padding: 8px;
    gap: 7px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
  }
  .top-status { gap: 6px; }
  .status-pill {
    min-height: 24px;
    padding: 3px 7px;
    flex-direction: row;
    align-items: center;
    gap: 5px;
  }
  .status-pill .kicker { display: none; }
  .status-pill strong { font-size: 10px; }
  .live-chip {
    min-height: 24px;
    padding: 3px 8px;
  }
}

@media (max-width: 430px) {
  html, body {
    overflow-y: auto;
  }
  body::after {
    display: none;
  }
  .sidenav {
    position: static;
    width: 100%;
    height: auto;
    align-items: stretch;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 12px 16px;
    gap: 14px;
    box-shadow: none;
  }
  .sidenav-brand {
    justify-content: flex-start;
    padding: 0 8px 6px;
  }
  .brand-text,
  .sidenav-label,
  .sidenav-item-text {
    position: static;
    width: auto;
    height: auto;
    padding: 0;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
  }
  .sidenav-section { display: grid; grid-template-columns: 1fr; gap: 12px; align-items: stretch; }
  .sidenav-group { flex-direction: row; flex-wrap: wrap; align-items: stretch; gap: 6px; }
  .sidenav-group-head { flex-basis: 100%; justify-content: flex-start; padding: 0 2px 2px; }
  .sidenav-group-body {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 6px;
    flex-basis: 100%;
  }
  .sidenav-subbody {
    align-items: stretch;
  }
  .sidenav-subgroup {
    flex: 1 1 230px;
    align-items: stretch;
  }
  .sidenav-subhead { justify-content: flex-start; padding-left: 2px; }
  .sidenav-item {
    display: grid;
    grid-template-columns: 25px minmax(0, 1fr);
    justify-content: stretch;
    width: auto;
    padding: 7px 9px;
  }
  .sidenav-item-icon {
    width: 25px;
    height: 24px;
  }
  .wrap {
    position: relative;
    min-height: auto;
    inset: auto;
    margin: 10px;
    padding: 16px 12px 28px;
    border-radius: var(--shell-radius);
    overflow: visible;
  }
  header.top {
    position: relative;
    inset: auto;
    height: auto;
    margin: 10px;
    padding: 16px 12px;
  }
}
