/* ============================================================================
   Reuseit Enrichment Engine — UI styles
   Single stylesheet, plain CSS (no preprocessor). Variables for theming.
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Mono:ital,wght@0,300;0,400;0,500;1,300&family=Syne:wght@600;700;800&display=swap');

/* ─── Theme tokens ──────────────────────────────────────────────────────── */
:root {
  --bg: #2a2f2b;
  --surface: #353b37;
  --surface2: #3e4540;
  --card: #313731;
  --border: #4a524c;
  --border2: #5A665D;
  --text: #FCF8ED;
  --muted: #a8b0a4;
  --muted2: #6b756d;
  --blue: #618672;
  --blue-dim: #3a4f42;
  --green: #BBD08C;
  --green-dim: #2e3a20;
  --amber: #F5E8C4;
  --amber-dim: #3d3720;
  --red: #e06060;
  --red-dim: #3d2020;
  --purple: #a8c896;

  --sidebar-w: 248px;
  --topbar-h: 56px;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 2px 8px rgba(0, 0, 0, .25);
  --transition: .18s cubic-bezier(.4, 0, .2, 1);
}

[data-theme='light'] {
  --bg: #FCF8ED;
  --surface: #ffffff;
  --surface2: #F5E8C4;
  --card: #faf6ec;
  --border: #e0d8c4;
  --border2: #c8c0a8;
  --text: #5A665D;
  --muted: #7a857c;
  --muted2: #a8b0a4;
  --blue: #618672;
  --blue-dim: #e0edd8;
  --green: #618672;
  --green-dim: #e8f0e0;
  --amber: #8a7a40;
  --amber-dim: #F5E8C4;
  --red: #c04040;
  --red-dim: #f0e0e0;
  --purple: #618672;
  --shadow: 0 1px 4px rgba(0, 0, 0, .08);
}

/* ─── Reset + base ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  line-height: 1.5;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, .display { font-family: 'Syne', sans-serif; font-weight: 700; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; font-size: inherit; cursor: pointer; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ─── App layout ─────────────────────────────────────────────────────────── */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) auto 1fr;
  grid-template-areas:
    "topbar    topbar"
    "globprog  globprog"
    "sidebar   main";
  height: 100vh;
}
.topbar { grid-area: topbar; }
.global-progress { grid-area: globprog; }
.sidebar { grid-area: sidebar; }
.main { grid-area: main; }

/* ─── Topbar ─────────────────────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  gap: 16px;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-left img { height: 22px; }
.topbar-tagline { color: var(--muted); font-size: 11px; }
.topbar-status {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar-status .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted2);
  display: inline-block;
}
.topbar-status .dot.ok { background: var(--green); }
.topbar-status .dot.warn { background: var(--amber); }
.topbar-status .dot.err { background: var(--red); }
.topbar-status .dot.live { background: var(--green); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 var(--green); }
  50% { opacity: .7; box-shadow: 0 0 0 6px transparent; }
}
.topbar-right { display: flex; align-items: center; gap: 8px; }

/* ─── Sidebar ────────────────────────────────────────────────────────────── */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar-section-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--muted2);
  padding: 14px 12px 8px;
  font-weight: 500;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--transition), color var(--transition);
  user-select: none;
}
.nav-item:hover {
  background: var(--card);
  color: var(--text);
}
.nav-item.active {
  background: var(--blue-dim);
  color: var(--text);
  border-color: var(--border);
}
/* Featured nav item (Operator) — pinned at the very top, above the group labels */
.nav-item-featured {
  position: relative;
  color: var(--text);
  font-weight: 600;
  background: var(--card);
  border-color: var(--border);
  padding-left: 16px;
}
.nav-item-featured::before {
  content: '';
  position: absolute;
  left: 0; top: 7px; bottom: 7px;
  width: 3px;
  border-radius: 999px;
  background: var(--blue);
}
.nav-item-featured .nav-icon { opacity: 1; color: var(--blue); }
.nav-item-featured:hover { background: var(--blue-dim); }
.nav-item-featured.active { background: var(--blue-dim); border-color: var(--blue); }
.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 10px 8px 6px;
}
.nav-icon {
  width: 18px;
  text-align: center;
  font-size: 14px;
  opacity: .8;
}
.nav-label { flex: 1; }
.nav-badge {
  background: var(--surface2);
  color: var(--muted);
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  font-family: 'DM Mono', monospace;
}
.nav-badge.ok { background: var(--green-dim); color: var(--green); }
.nav-badge.warn { background: var(--amber-dim); color: var(--amber); }
.nav-badge.err { background: var(--red-dim); color: var(--red); }
.nav-badge.live { background: var(--blue-dim); color: var(--blue); }

/* ─── Main content area ──────────────────────────────────────────────────── */
.main {
  background: var(--bg);
  overflow: hidden;
  position: relative;
}
.view {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.view.active { display: flex; }
.view-header {
  padding: 18px 24px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
}
.view-title h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}
.view-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}
.view-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}
.view-body.flush { padding: 0; }

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn:hover { background: var(--surface2); border-color: var(--border2); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dim); border-color: var(--blue); color: var(--text); }
.btn-success { background: var(--green); border-color: var(--green); color: #1f2820; }
.btn-success:hover { background: var(--green-dim); color: var(--green); border-color: var(--green); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: var(--red-dim); color: var(--red); border-color: var(--red); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--muted); }
.btn-ghost:hover { background: var(--card); color: var(--text); }
.btn-sm { padding: 4px 10px; font-size: 11px; }
.btn-icon { padding: 6px 8px; }

/* ─── Cards ──────────────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: -4px 0 12px;
}
.card-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 14px;
  margin: 0;
}
.card-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.card-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

/* ─── Stat cards ─────────────────────────────────────────────────────────── */
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.1px;
  color: var(--muted);
  margin-bottom: 4px;
}
.stat-value {
  font-family: 'Syne', sans-serif;
  font-size: 22px;
  font-weight: 700;
}
.stat-value.muted { color: var(--muted); }
.stat-value.green { color: var(--green); }
.stat-value.amber { color: var(--amber); }
.stat-value.blue { color: var(--blue); }
.stat-value.red { color: var(--red); }

/* ─── Inputs ─────────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
}
input[type='text'], input[type='number'], input[type='password'], input[type='search'] {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 8px 10px;
  font-family: inherit;
  font-size: 12px;
  outline: none;
  transition: border var(--transition);
}
input[type='text']:focus, input[type='number']:focus, input[type='password']:focus, input[type='search']:focus {
  border-color: var(--blue);
}
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.checkbox-row:hover { background: var(--card); color: var(--text); }
.checkbox-row input[type='checkbox'] { accent-color: var(--blue); cursor: pointer; }

/* ─── Upload zone ────────────────────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border2);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  background: var(--card);
  transition: all var(--transition);
}
.upload-zone:hover, .upload-zone.drag {
  border-color: var(--blue);
  background: var(--blue-dim);
}
.upload-zone-icon { font-size: 36px; margin-bottom: 10px; opacity: .6; }
.upload-zone strong { display: block; font-size: 14px; color: var(--text); margin-bottom: 4px; }
.upload-zone p { color: var(--muted); font-size: 11px; margin: 4px 0 0; }

/* Upload progress bar */
.upload-progress { display: flex; flex-direction: column; gap: 10px; }
.upload-progress-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.upload-progress-head strong { font-size: 13px; color: var(--text); }
.upload-progress-name { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress-track { height: 8px; background: var(--surface2); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--blue); border-radius: 999px; transition: width .15s ease; }
.progress-fill.indeterminate {
  background: linear-gradient(90deg, var(--blue-dim) 25%, var(--blue) 50%, var(--blue-dim) 75%);
  background-size: 200% 100%;
  animation: progress-slide 1.1s linear infinite;
}
@keyframes progress-slide { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.upload-progress-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--text); }

/* Operator view */
.op-summary-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.op-conn { display: flex; align-items: center; gap: 8px; font-size: 12px; white-space: nowrap; }
.op-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--border2); display: inline-block; }
.op-dot.live { background: var(--green); animation: pulse 1.4s ease-in-out infinite; }
.op-dot.stale { background: var(--amber); }
.op-summary-meta { display: flex; justify-content: space-between; font-size: 12px; margin-top: 6px; color: var(--text); }
.op-notif-btn { margin-top: 12px; }
.op-notif-on { margin-top: 12px; font-size: 12px; }
.op-banner { border-left: 3px solid var(--amber); font-size: 13px; }
.op-banner.err { border-left-color: var(--red); color: var(--red); }
.op-issue-list { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; max-height: 240px; overflow: auto; }
.op-issue-row { display: flex; align-items: center; gap: 10px; font-size: 12px; padding: 4px 0; border-bottom: 1px solid var(--border); }
.op-issue-set { min-width: 90px; }
.op-issue-msg { flex: 1; }
.op-feed-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.op-filters { display: flex; gap: 6px; }
.op-filters .btn { padding: 3px 10px; font-size: 11px; text-transform: capitalize; }
.op-filters .btn.active { background: var(--blue-dim); border-color: var(--blue); color: var(--blue); }
.op-feed-list { display: flex; flex-direction: column; margin-top: 10px; max-height: 520px; overflow: auto; }
.op-feed-row { display: grid; grid-template-columns: 88px 130px 1fr 110px 46px 56px; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 12px; }
.op-feed-row.expandable { cursor: pointer; }
.op-feed-row.expandable:hover { background: var(--blue-dim); }
.op-feed-sku { font-weight: 600; }
.op-feed-score { text-align: right; }
.op-feed-dur { text-align: right; }
.op-feed-trace { background: var(--surface2); border-radius: 6px; padding: 8px 12px; margin: 0 0 6px; font-size: 11px; max-height: 200px; overflow: auto; }
.op-trace-line { white-space: pre-wrap; color: var(--muted); padding: 1px 0; }

/* ─── Tables ─────────────────────────────────────────────────────────────── */
.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
table.data thead th {
  text-align: left;
  padding: 10px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  position: sticky;
  top: 0;
  z-index: 1;
}
table.data tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
table.data tbody tr:hover td {
  background: var(--surface2);
}
table.data tbody tr.clickable { cursor: pointer; }
table.data .truncate {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── Chips / badges ─────────────────────────────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface2);
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
  user-select: none;
}
.chip:hover { background: var(--card); color: var(--text); }
.chip.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.chip.static { cursor: default; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .3px;
}
.badge-ok { background: var(--green-dim); color: var(--green); }
.badge-warn { background: var(--amber-dim); color: var(--amber); }
.badge-err { background: var(--red-dim); color: var(--red); }
.badge-muted { background: var(--surface2); color: var(--muted); }
.badge-blue { background: var(--blue-dim); color: var(--blue); }

/* ─── Progress bar ───────────────────────────────────────────────────────── */
.progress {
  height: 6px;
  background: var(--surface2);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--blue);
  border-radius: 999px;
  transition: width .4s ease;
  width: 0%;
}
.progress-fill.success { background: var(--green); }
.progress-fill.warn { background: var(--amber); }

/* ─── Global progress band (always visible below topbar) ─────────────────── */
.global-progress {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-family: 'DM Mono', monospace;
}
.global-progress.hidden { display: none; }
.gp-label {
  color: var(--muted);
  min-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gp-bar {
  flex: 1;
  height: 6px;
  background: var(--surface2);
  border-radius: 999px;
  overflow: hidden;
  min-width: 80px;
}
.gp-fill {
  height: 100%;
  background: var(--blue);
  border-radius: 999px;
  width: 0%;
  transition: width .4s ease;
}
.gp-fill.success { background: var(--green); }
.gp-fill.warn { background: var(--amber); }
.gp-meta {
  display: flex;
  gap: 12px;
  color: var(--muted2);
  white-space: nowrap;
}
.gp-pct {
  color: var(--text);
  font-weight: 600;
  min-width: 70px;
  text-align: right;
}
.gp-time { min-width: 50px; }

/* ─── Job cards (Pipeline view) ──────────────────────────────────────────── */
.job-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 8px;
}
.job-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.job-title {
  font-size: 12px;
  font-weight: 500;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.job-meta {
  font-size: 10px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.job-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
.job-spinner.hidden { display: none; }
.job-status { display: inline-flex; align-items: center; }
@keyframes spin { to { transform: rotate(360deg); } }
.job-steps {
  display: flex;
  gap: 4px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.job-step {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  font-size: 10px;
  color: var(--muted2);
  transition: all var(--transition);
}
.job-step.active { background: var(--blue-dim); color: var(--blue); }
.job-step.done { background: var(--green-dim); color: var(--green); }
.job-step.error { background: var(--red-dim); color: var(--red); }
.job-logs {
  margin-top: 8px;
  padding: 8px 10px;
  font-size: 10px;
  color: var(--muted);
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'DM Mono', monospace;
  white-space: pre-wrap;
  word-break: break-word;
}
.job-logs.hidden { display: none; }
.job-card { cursor: pointer; transition: border-color var(--transition); }
.job-card:hover { border-color: var(--border2); }

/* ─── Log feed (Log view) ────────────────────────────────────────────────── */
.log-feed {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  font-size: 11px;
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.log-line {
  display: flex;
  gap: 8px;
  padding: 2px 4px;
  border-radius: 3px;
}
.log-line:hover { background: var(--surface2); }
.log-time {
  color: var(--muted2);
  font-size: 10px;
  flex-shrink: 0;
  min-width: 50px;
}
.log-msg { color: var(--muted); flex: 1; }
.log-line.ok .log-msg { color: var(--green); }
.log-line.err .log-msg { color: var(--red); }
.log-line.warn .log-msg { color: var(--amber); }

/* ─── Detail panel (slide-in) ────────────────────────────────────────────── */
.detail-panel {
  position: fixed;
  top: var(--topbar-h);
  right: 0;
  bottom: 0;
  width: min(560px, 100vw);
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow);
  transform: translateX(100%);
  transition: transform var(--transition);
  display: flex;
  flex-direction: column;
  z-index: 100;
}
.detail-panel.open { transform: translateX(0); }
.detail-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.detail-header h2 {
  margin: 0;
  font-size: 15px;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
}
.detail-header p {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--muted);
}
.detail-tabs {
  display: flex;
  gap: 2px;
  padding: 8px 16px 0;
  border-bottom: 1px solid var(--border);
}
.detail-tab {
  padding: 7px 12px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}
.detail-tab.active { color: var(--text); border-bottom-color: var(--blue); }
.detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}
.field-cell {
  display: grid;
  grid-template-columns: 140px 1fr 50px;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  margin-bottom: 4px;
  align-items: center;
  cursor: pointer;
  transition: background var(--transition);
}
.field-cell:hover { background: var(--surface2); }
.field-cell .fc-key { font-size: 11px; color: var(--muted); }
.field-cell .fc-val { font-size: 12px; word-break: break-word; }
.field-cell .fc-val.empty { color: var(--muted2); font-style: italic; }
.field-cell .fc-src {
  font-size: 9px;
  text-align: right;
  color: var(--muted2);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.field-cell input.edit {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--blue);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  color: var(--text);
  font-size: 12px;
}
pre.json {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 10px;
  color: var(--muted);
  overflow: auto;
  max-height: 400px;
}

/* ─── Houston view specifics ─────────────────────────────────────────────── */
.gap-set {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}
.gap-set-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
  background: var(--surface);
  transition: background var(--transition);
}
.gap-set-header:hover { background: var(--surface2); }
.gap-set-name { font-weight: 500; font-size: 13px; }
.gap-set-stats { display: flex; gap: 6px; font-size: 11px; }
.gap-set-body {
  display: none;
  padding: 8px;
  border-top: 1px solid var(--border);
}
.gap-set.open .gap-set-body { display: block; }
.gap-slug {
  display: grid;
  grid-template-columns: 200px 80px 80px 1fr;
  gap: 10px;
  padding: 6px 10px;
  font-size: 11px;
  border-radius: var(--radius-sm);
}
.gap-slug:hover { background: var(--surface2); }

.warning-row {
  display: grid;
  grid-template-columns: 140px 160px 1fr;
  gap: 10px;
  padding: 6px 10px;
  font-size: 11px;
  border-bottom: 1px solid var(--border);
}
.warning-row:last-child { border-bottom: none; }

/* ─── Rate-limit banner ──────────────────────────────────────────────────── */
.rate-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
  position: sticky;
  top: 0;
  z-index: 10;
}
.rate-banner-warn {
  background: var(--amber-dim);
  color: var(--amber);
}
.rate-banner-err {
  background: var(--red-dim);
  color: var(--red);
}
.rate-banner:hover { filter: brightness(1.1); }
.rate-banner-icon { font-size: 18px; }
.rate-banner-body { flex: 1; }
.rate-banner-headline { font-weight: 500; font-size: 13px; }
.rate-banner-sub { font-size: 11px; opacity: .8; margin-top: 2px; }

/* ─── Empty state ────────────────────────────────────────────────────────── */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.empty-icon { font-size: 32px; margin-bottom: 12px; opacity: .5; }
.empty-title {
  font-family: 'Syne', sans-serif;
  font-size: 15px;
  color: var(--text);
  margin-bottom: 6px;
}
.empty-sub { font-size: 12px; }

/* ─── Theme toggle button ────────────────────────────────────────────────── */
.theme-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: all var(--transition);
}
.theme-toggle:hover { background: var(--surface2); color: var(--text); }

/* ─── Utility ────────────────────────────────────────────────────────────── */
.muted { color: var(--muted); }
.muted2 { color: var(--muted2); }
.text-green { color: var(--green); }
.text-amber { color: var(--amber); }
.text-red { color: var(--red); }
.text-blue { color: var(--blue); }
.spacer { flex: 1; }
.row { display: flex; align-items: center; gap: 8px; }
.row.gap-lg { gap: 16px; }
.col { display: flex; flex-direction: column; gap: 8px; }
.hidden { display: none !important; }
.mono { font-family: 'DM Mono', monospace; }
.tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 4px;
  background: var(--surface2);
  color: var(--muted);
  font-size: 10px;
  font-family: 'DM Mono', monospace;
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 800px) {
  :root { --sidebar-w: 200px; }
  .view-body { padding: 14px; }
}
