@import url("lib/colors_and_type.css");

/* ===== Orchestrator surfaces — extend Orange tokens ===== */
:root {
  --sidebar-w: 208px;
  --sidebar-w-collapsed: 56px;
  --topbar-h: 56px;
  --footer-h: 32px;
  --content-pad: 20px;
  --panel-bg: #fff;
  --panel-border: var(--color-grey-400);
  --soft-bg: var(--color-grey-100);
  --line: var(--color-grey-300);
  --ink: var(--color-black);
  --ink-soft: var(--color-grey-700);
  --ink-faint: var(--color-grey-600);
  --orange: var(--color-orange-1);
  --orange-hover: var(--color-orange-2);
  --eu: #003399;
}

*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden; /* scroll lives in .main only */
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--soft-bg);
  font-size: 14px;
  line-height: 1.45;
}
button { font-family: inherit; }

/* App shell layout */
.app {
  height: 100vh; /* fixed viewport height — no body scroll */
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr var(--footer-h);
  grid-template-areas:
    "topbar topbar"
    "sidebar main"
    "sidebar footer";
}
.app.collapsed { grid-template-columns: var(--sidebar-w-collapsed) 1fr; }

/* ===== Topbar ===== */
.topbar {
  grid-area: topbar;
  display: flex;
  align-items: center;
  gap: 24px;
  height: var(--topbar-h);
  padding: 0 24px;
  background: #fff;
  border-bottom: 1px solid var(--panel-border);
  z-index: 50; /* grid keeps it fixed — no sticky needed */
}
.brand-lockup {
  display: flex; align-items: center; gap: 12px;
  min-width: calc(var(--sidebar-w) - 12px);
}
.brand-divider {
  width: 1px; height: 28px;
  background: var(--color-grey-400);
}
.brand-co {
  display: flex; flex-direction: column; gap: 3px;
  line-height: 1;
}
.brand-co-eyebrow {
  font-size: 13px; font-weight: 700; color: #000;
  letter-spacing: -0.01em;
}
.brand-co-partner {
  display: inline-flex; align-items: center; gap: 5px;
}

/* Breadcrumb in topbar */
.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px;
  color: var(--ink-faint);
  flex: 1;
}
.breadcrumb a, .breadcrumb button {
  color: var(--ink-faint); background: none; border: 0; padding: 0;
  text-decoration: none; cursor: pointer; font: inherit;
}
.breadcrumb a:hover, .breadcrumb button:hover { color: var(--orange); }
.breadcrumb .sep { opacity: 0.5; }
.breadcrumb .current { color: var(--ink); font-weight: 700; }

.topbar-right {
  display: flex; align-items: center; gap: 12px;
}
.region-pill {
  display: inline-flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 12px;
  background: var(--color-grey-100);
  border: 1px solid var(--panel-border);
  font-size: 12px; font-weight: 700;
}
.region-pill .lock {
  width: 12px; height: 12px;
  color: var(--ink-faint);
}
.eu-flag {
  width: 18px; height: 12px;
  background: var(--eu);
  display: inline-grid; place-items: center;
  color: #fc0; font-size: 7px; font-weight: 700;
  letter-spacing: 0;
}
.eu-flag::before {
  content: "★"; font-size: 9px; line-height: 1;
}
.avatar {
  width: 32px; height: 32px;
  background: #000; color: #fff;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700;
  border-radius: 50%;
}

/* ===== Sidebar ===== */
.sidebar {
  grid-area: sidebar;
  background: #fff;
  border-right: 1px solid var(--panel-border);
  display: flex; flex-direction: column;
  overflow: hidden; /* grid row handles height — no sticky needed */
  z-index: 5;
}
.sidebar .nav { padding: 6px 0 8px; flex: 1; display: flex; flex-direction: column; overflow-y: auto; }
.sidebar .nav-section {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--ink-faint);
  padding: 12px 16px 6px;
}
.sidebar .nav-divider {
  height: 1px; background: var(--line); margin: 8px 16px;
}
.sidebar .nav-group { padding: 10px 0 6px; }
.sidebar .nav-group + .nav-group { border-top: 1px solid var(--line); }
.sidebar .nav-act {
  display: flex; flex-direction: column;
  padding: 8px 16px 4px;
  position: relative;
  gap: 2px;
}
.sidebar .nav-act-num {
  font-size: 9px; font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
  text-transform: uppercase;
  font-family: var(--font-mono);
  white-space: nowrap;
}
.sidebar .nav-group.is-active .nav-act-num {
  color: var(--orange);
}
.sidebar .nav-group.is-active .nav-act::before {
  content: "";
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 2px;
  background: var(--orange);
}
.sidebar .nav-act-meta {
  display: flex; align-items: baseline; gap: 6px;
  line-height: 1.15;
  min-width: 0; flex-wrap: wrap;
}
.sidebar .nav-act-title {
  font-size: 12px; font-weight: 700; color: #000;
  letter-spacing: -0.01em;
}
.sidebar .nav-act-desc {
  font-size: 11px; color: var(--ink-faint);
  font-weight: 400;
}
.sidebar .nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px;
  width: 100%;
  background: none; border: 0;
  text-align: left;
  font-size: 13px; font-weight: 500; color: var(--ink);
  cursor: pointer;
  font-family: inherit;
  position: relative;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.sidebar .nav-item .ico { width: 16px; height: 16px; color: var(--ink-soft); flex-shrink: 0; }
.sidebar .nav-item:hover { background: var(--color-grey-100); }
.sidebar .nav-item.active {
  background: transparent;
  color: var(--orange);
  font-weight: 700;
}
.sidebar .nav-item.active::before { content: none; }
.sidebar .nav-item.active .ico { color: var(--orange); }

.sidebar .sovereign-card {
  margin: 12px;
  padding: 12px;
  background: #000;
  color: #fff;
  border-left: 3px solid var(--orange);
}
.sidebar .sovereign-card .h {
  display: flex; align-items: center; gap: 8px;
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--orange);
  margin-bottom: 6px;
}
.sidebar .sovereign-card .body {
  font-size: 11px;
  line-height: 1.4;
  color: rgba(255,255,255,0.85);
}
.sidebar .sovereign-card .dot {
  display: inline-block; width: 6px; height: 6px;
  background: var(--color-success);
  border-radius: 50%;
  margin-right: 6px;
  box-shadow: 0 0 0 2px rgba(50,200,50,0.2);
}

.sidebar-toggle {
  background: #fff;
  border: 1px solid var(--panel-border);
  cursor: pointer;
  color: var(--ink-soft);
  font-family: inherit;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.sidebar-toggle:hover { background: var(--color-grey-100); color: var(--orange); }

/* Collapsed sidebar */
.app.collapsed .sidebar .nav-item { justify-content: center; padding: 10px; }
.app.collapsed .sidebar .nav-item .label,
.app.collapsed .sidebar .nav-section,
.app.collapsed .sidebar .nav-act,
.app.collapsed .sidebar .nav-group { border: 0 !important; }
.app.collapsed .sidebar .nav-act,
.app.collapsed .sidebar .nav-divider { display: none; }
.app.collapsed .sidebar .sovereign-card .body,
.app.collapsed .brand-co,
.app.collapsed .brand-divider { display: none; }
.app.collapsed .sidebar .sovereign-card { padding: 8px; text-align: center; }
.app.collapsed .brand-lockup { min-width: calc(var(--sidebar-w-collapsed) - 12px); }

/* ===== Main + Footer ===== */
.main {
  grid-area: main;
  padding: var(--content-pad);
  min-width: 0;
  max-width: 100%;
  overflow-y: auto; /* only .main scrolls, not the body */
  overflow-x: hidden;
}
.footer {
  grid-area: footer;
  background: #000; color: rgba(255,255,255,0.7);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; font-size: 11px;
  letter-spacing: 0.02em;
}
.footer .orange-square-mini {
  display: inline-block; width: 10px; height: 10px;
  background: var(--orange); margin-right: 6px; vertical-align: -1px;
}

/* ===== Common UI ===== */
.btn {
  appearance: none;
  border: 2px solid transparent;
  background: transparent;
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  line-height: 1;
  padding: 12px 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background var(--dur-fast) var(--easing-standard),
              color var(--dur-fast) var(--easing-standard),
              border-color var(--dur-fast) var(--easing-standard);
  border-radius: 0;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary { background: var(--orange); color: #fff; border-color: var(--orange); }
.btn-primary:hover { background: var(--orange-hover); border-color: var(--orange-hover); }
.btn-primary:disabled { background: var(--color-grey-400); border-color: var(--color-grey-400); color: var(--color-grey-700); cursor: not-allowed; }
.btn-secondary { background: #000; color: #fff; border-color: #000; }
.btn-secondary:hover { background: #333; border-color: #333; }
.btn-outline { background: transparent; color: #000; border-color: #000; }
.btn-outline:hover { background: #000; color: #fff; }
.btn-ghost { background: transparent; color: #000; border-color: transparent; padding: 10px 14px; }
.btn-ghost:hover { background: var(--color-grey-200); }
.btn-sm { padding: 8px 14px; font-size: 12px; }
.btn-lg { padding: 16px 28px; font-size: 14px; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--orange); }

/* Panels/cards */
.panel {
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--panel-border);
}
.panel-pad { padding: 24px; }
.panel-sm-pad { padding: 16px; }

/* Badges and chips */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  font-size: 11px; font-weight: 700;
  background: var(--color-grey-200);
  color: var(--ink);
  border: 1px solid transparent;
  line-height: 1.2;
}
.chip-outline { background: transparent; border-color: var(--panel-border); }
.chip-orange { background: rgba(255,121,0,0.1); color: var(--orange); }
.chip-eu { background: rgba(0,51,153,0.08); color: var(--eu); }
.chip-success { background: rgba(50,200,50,0.12); color: #1e8e1e; }
.chip-dark { background: #000; color: #fff; }
.chip-pill { border-radius: 999px; padding: 3px 10px; font-size: 11px; }
.chip .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  display: inline-block;
}
.chip-pill.live .dot {
  background: var(--color-success);
  box-shadow: 0 0 0 3px rgba(50,200,50,0.2);
  animation: pulse-dot 1.6s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 3px rgba(50,200,50,0.2); }
  50% { box-shadow: 0 0 0 6px rgba(50,200,50,0); }
}

.kicker {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--orange);
  margin-bottom: 6px;
}

/* Forms */
.input {
  font: inherit; font-size: 13px;
  border: 1px solid var(--color-grey-500);
  background: #fff;
  padding: 10px 14px;
  height: 40px;
  border-radius: 0;
  outline: none;
  width: 100%;
}
.input:focus { border-color: #000; box-shadow: 0 0 0 2px var(--orange); }

/* Code block */
.code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: #0b0b0b;
  color: #e3e3e3;
  padding: 16px 18px;
  white-space: pre-wrap;
  word-break: break-all;
  position: relative;
}
.code .copy {
  position: absolute; top: 10px; right: 10px;
  background: rgba(255,255,255,0.08);
  color: #fff; border: 1px solid rgba(255,255,255,0.2);
  padding: 4px 10px; font-size: 10px; font-weight: 700;
  cursor: pointer; text-transform: uppercase; letter-spacing: 0.06em;
}
.code .copy:hover { background: var(--orange); border-color: var(--orange); }

/* Toggle */
.toggle {
  display: inline-flex; align-items: center;
  gap: 8px;
  cursor: pointer; user-select: none;
}
.toggle .track {
  width: 36px; height: 20px;
  background: var(--color-grey-400);
  border-radius: 999px;
  position: relative;
  transition: background var(--dur-fast);
}
.toggle .track::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--dur-fast);
}
.toggle.on .track { background: var(--orange); }
.toggle.on .track::after { transform: translateX(16px); }
.toggle.locked .track { opacity: 0.65; cursor: not-allowed; }

/* Page header */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}
.page-head h1 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
  line-height: 1.1;
}
.page-head .subtitle {
  font-size: 14px; color: var(--ink-soft);
  margin: 0;
  max-width: 720px;
}

/* Section heads */
.h-section {
  font-size: 13px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink-soft);
  margin: 0 0 12px;
}

/* ===== Detail screen — tab content styling ===== */
.detail-h3 {
  font-size: 14px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  margin: 0 0 12px;
  color: var(--ink-soft);
}

.modelcard p { line-height: 1.65; margin: 0 0 10px; font-size: 14px; }
.modelcard .mc-list { margin: 0 0 8px; padding-left: 18px; line-height: 1.7; font-size: 13.5px; }
.modelcard .mc-list li { margin-bottom: 4px; }
.modelcard .mc-list strong { color: #000; }
.modelcard .mc-callout {
  margin-top: 12px;
  padding: 12px 14px;
  background: rgba(255,204,0,0.12);
  border-left: 3px solid var(--color-warning);
  font-size: 13px; line-height: 1.55;
}
.modelcard .mc-callout strong { color: #000; }
.modelcard .mc-table { width: 100%; font-size: 13px; border-collapse: collapse; }
.modelcard .mc-table td { padding: 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.modelcard .mc-table td:first-child { color: var(--ink-soft); width: 40%; }
.modelcard .mc-table td:last-child { font-weight: 500; }
.modelcard .mc-table tr:last-child td { border-bottom: 0; }
.modelcard .mc-code {
  background: #0b0b0b; color: #e3e3e3;
  padding: 14px 16px; font-family: var(--font-mono);
  font-size: 12px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word;
  margin: 0;
}
.modelcard .mc-link { color: var(--orange); text-decoration: none; font-weight: 600; }
.modelcard .mc-link:hover { text-decoration: underline; }
.modelcard .mc-meta { margin: 6px 0 0; font-size: 11px; color: var(--ink-faint); }
.modelcard code {
  background: var(--color-grey-200); padding: 1px 5px; font-size: 11px;
  font-family: var(--font-mono); border-radius: 2px;
}

/* ===== Files tab ===== */
.filetree-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--line);
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--ink-faint);
  background: var(--color-grey-100);
}
.filetree-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--line);
  transition: background var(--dur-fast);
}
.filetree-row:hover { background: var(--color-grey-100); }
.filetree-row:last-child { border-bottom: 0; }

/* ===== Benchmark table ===== */
.bench-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.bench-table thead th {
  text-align: left;
  padding: 14px 12px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--ink-faint);
  border-bottom: 2px solid var(--line);
  background: var(--color-grey-100);
}
.bench-table .th-sub {
  font-size: 9px; font-weight: 500;
  color: var(--ink-faint);
  text-transform: none; letter-spacing: 0;
  margin-top: 2px;
}
.bench-table tbody td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.bench-table tbody tr:last-child td { border-bottom: 0; }
.bench-table tbody tr.target td { background: rgba(255,121,0,0.04); }
.bench-table tbody tr.target .m-name { color: var(--orange); font-weight: 700; }
.bench-table tbody tr.reference td { background: rgba(0,0,0,0.025); }
.bench-table .model-cell { font-weight: 500; width: 220px; }
.bench-table .m-name { font-size: 13px; font-weight: 700; }
/* ===== Endpoint tabs ===== */
.endpoint-tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}
.endpoint-tab {
  background: none; border: 0;
  padding: 12px 18px;
  display: inline-flex; align-items: center; gap: 8px;
  font-family: inherit; font-size: 13px; font-weight: 700;
  color: var(--ink-faint);
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color var(--dur-fast), border-color var(--dur-fast);
}
.endpoint-tab:hover { color: var(--ink); }
.endpoint-tab.active {
  color: #000;
  border-bottom-color: var(--orange);
}
.endpoint-tab-badge {
  background: var(--orange); color: #fff;
  font-size: 9px; font-weight: 700;
  padding: 1px 5px; line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ===== Logs view ===== */
.logs-toolbar {
  padding: 12px 16px;
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--line);
  gap: 12px;
  flex-wrap: wrap;
}
.logs-segmented {
  display: inline-flex;
  border: 1px solid var(--color-grey-500);
}
.logs-segmented button {
  background: #fff; border: 0;
  border-left: 1px solid var(--color-grey-500);
  padding: 6px 12px;
  font-family: inherit; font-size: 11px; font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
}
.logs-segmented button:first-child { border-left: 0; }
.logs-segmented button.active { background: #000; color: #fff; }
.logs-count {
  background: var(--color-grey-200); color: var(--ink-soft);
  padding: 1px 5px; font-size: 10px;
  margin-left: 4px;
  font-family: var(--font-mono);
}
.logs-segmented button.active .logs-count { background: rgba(255,255,255,0.15); color: rgba(255,255,255,0.85); }
.logs-stream {
  height: 380px;
  overflow-y: auto;
  background: #0b0b0b;
  color: #cfcfcf;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
  padding: 8px 0;
}
.logs-line {
  display: grid;
  grid-template-columns: 100px 60px 95px 1fr auto;
  gap: 12px;
  padding: 3px 16px;
  align-items: baseline;
  white-space: nowrap;
}
.logs-line:hover { background: rgba(255,255,255,0.04); }
.logs-ts { color: #777; }
.logs-level { font-weight: 700; color: #3b82f6; }
.logs-warn .logs-level { color: #f59e0b; }
.logs-error .logs-level { color: #ef4444; }
.logs-error { background: rgba(239,68,68,0.06); }
.logs-warn  { background: rgba(245,158,11,0.04); }
.logs-req { color: #a78bfa; }
.logs-msg { color: #e3e3e3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logs-meta { color: #777; font-size: 11px; display: flex; gap: 12px; }
.logs-meta span { white-space: nowrap; }
.logs-footer {
  padding: 8px 16px;
  background: var(--color-grey-100);
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--ink-faint);
  display: flex; justify-content: space-between;
}

/* ===== Versions ===== */
.version-row {
  display: flex; align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background var(--dur-fast);
}
.version-row:last-child { border-bottom: 0; }
.version-row:hover { background: var(--color-grey-100); }
.version-row.selected { background: rgba(255,121,0,0.04); box-shadow: inset 2px 0 0 var(--orange); }
/* ===== Review YAML modal ===== */
.review-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 100;
  display: grid; place-items: center;
  padding: 24px;
  animation: fade-in 180ms var(--easing-standard) both;
}
.review-modal {
  background: #fff;
  width: min(880px, 96vw);
  max-height: 92vh;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 60px rgba(0,0,0,0.35);
}
.review-head {
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px;
}
.review-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}
.review-chips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.review-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: #fff;
}
.review-chip-icon {
  width: 28px; height: 28px;
  background: var(--color-grey-100);
  color: var(--ink-soft);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.review-chip-label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--ink-faint);
}
.review-chip-value {
  font-size: 13px; font-weight: 700; color: #000;
}
.review-yaml-wrap {
  background: #0b0b0b;
  margin-bottom: 16px;
  border: 1px solid #1f1f1f;
}
.review-yaml-head {
  padding: 8px 14px;
  display: flex; justify-content: space-between; align-items: center;
  background: #141414;
  border-bottom: 1px solid #1f1f1f;
}
.review-yaml {
  margin: 0;
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  color: #d1d5db;
  white-space: pre-wrap;
  max-height: 320px;
  overflow-y: auto;
}
.review-checks {
  background: var(--color-grey-100);
  padding: 16px;
}
.review-check {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.review-check:last-child { border-bottom: 0; }
.review-check-icon {
  width: 24px; height: 24px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.review-foot {
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  background: var(--color-grey-100);
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* ===== POP detail drill-down panel ===== */
.pop-overlay {
  position: fixed; inset: var(--topbar-h) 0 0 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 90;
  animation: fade-in 180ms var(--easing-standard) both;
}
.pop-panel {
  position: fixed; top: var(--topbar-h); right: 0;
  width: min(400px, 92vw);
  height: calc(100vh - var(--topbar-h));
  background: #fff;
  z-index: 91;
  box-shadow: -16px 0 32px rgba(0, 0, 0, 0.18);
  display: flex; flex-direction: column;
  animation: slide-in-right 240ms var(--easing-decelerate) both;
}
@keyframes slide-in-right {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}
.pop-panel-head {
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px;
  flex-shrink: 0;
}
.pop-close {
  width: 28px; height: 28px;
  background: var(--color-grey-100);
  border: 0;
  display: grid; place-items: center;
  cursor: pointer;
  color: var(--ink);
  transition: background var(--dur-fast);
}
.pop-close:hover { background: var(--color-grey-200); }
.pop-panel-body {
  padding: 18px 24px 24px;
  overflow-y: auto;
  flex: 1;
}
.pop-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
}
.pop-stats .panel { box-shadow: inset 0 0 0 1px var(--panel-border); }
.pop-section {
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.pop-section:last-of-type { border-bottom: 0; }
.pop-section-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
}
.divider { height: 1px; background: var(--line); border: 0; margin: 24px 0; }
.row { display: flex; gap: 12px; align-items: center; }
.row.between { justify-content: space-between; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); }
.mono { font-family: var(--font-mono); }
.nowrap { white-space: nowrap; }

/* Animations */
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
/* Note: must NOT use transform — it creates a containing block that breaks
   position:fixed descendants (e.g. the POP detail panel, modals). */
.fade-in { animation: fade-in 220ms var(--easing-standard) both; }

@keyframes spin {
  to { transform: rotate(360deg); }
}
.spin { animation: spin 1s linear infinite; }

/* Skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--color-grey-200) 0%, var(--color-grey-300) 50%, var(--color-grey-200) 100%);
  background-size: 200% 100%;
  animation: skel 1.2s linear infinite;
}
@keyframes skel {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}
