/* Engineering console theme: monospace data, sans-serif chrome, dark-first. */
:root {
  --bg: #0b0f14;
  --bg-grid: #0e131a;
  --surface: #121820;
  --surface2: #171f2a;
  --surface3: #1d2733;
  --text: #dde5ef;
  --text-strong: #f2f6fb;
  --muted: #7d8fa6;
  --faint: #58697e;
  --border: #232e3d;
  --border-strong: #2f3d4f;
  --accent: #58a6ff;
  --accent-dim: rgba(88, 166, 255, 0.14);
  --success: #46d3a0;
  --error: #ff6b76;
  --warning: #f0b849;
  --pending: #7d9ec4; /* cool blue-gray — queued / yet_to_allocate */
  --neutral: #a8947a; /* warm stone — other / unclassified */
  --active: #4fc3f7;

  --radius: 6px;
  --radius-sm: 4px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --fs-xs: 11px;
  --fs-sm: 12.5px;
  --fs-md: 13.5px;
  --fs-lg: 16px;
  --header-h: 58px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-md);
  font-feature-settings: "cv05" 1, "ss01" 1;
  background:
    linear-gradient(var(--bg-grid) 1px, transparent 1px) 0 0 / 100% 28px,
    var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.mono, code, kbd, .col-name, .status-pill, .stamp {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "zero" 1;
}

/* Numbers line up column-to-column everywhere they carry meaning. */
.data-table td, .data-table th, .count, .chip strong, .metric-value {
  font-variant-numeric: tabular-nums;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

::selection { background: var(--accent-dim); color: var(--text-strong); }

/* ---------- header ---------- */

.site-header {
  background:
    linear-gradient(180deg, rgba(23, 31, 42, 0.96) 0%, rgba(11, 15, 20, 0.94) 100%);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-strong);
  box-shadow: 0 1px 0 rgba(88, 166, 255, 0.06);
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-inner {
  max-width: 1500px;
  margin: 0 auto;
  min-height: var(--header-h);
  padding: 0.55rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.1rem;
  flex-wrap: wrap;
}

.header-id { display: flex; align-items: center; gap: 0.6rem; }

.logo {
  font-weight: 700;
  font-size: var(--fs-md);
  letter-spacing: 0.04em;
  color: var(--text-strong);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-transform: uppercase;
}
.logo:hover { text-decoration: none; }
.logo-text {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  line-height: 1.1;
}
.logo-title {
  font-size: 0.92rem;
  letter-spacing: 0.06em;
}
.logo-tag {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--faint);
  text-transform: uppercase;
}
.logo-sub { color: var(--faint); font-weight: 500; text-transform: none; letter-spacing: 0; }

.logo-mark {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  flex-shrink: 0;
}

.badge {
  font-size: var(--fs-xs);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted);
}

.date-filter,
.date-inputs {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: var(--fs-xs);
  color: var(--muted);
}

.date-inputs[hidden] {
  display: none !important;
}

.date-input {
  background: var(--surface3);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.45rem;
  font-size: var(--fs-xs);
  color-scheme: dark;
}

.date-input:focus {
  outline: none;
  border-color: var(--accent);
}

.date-input:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: var(--fs-sm);
  flex-wrap: wrap;
}

.header-group {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.28rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(18, 24, 32, 0.75);
  min-height: 2.1rem;
}

.header-group-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

.header-group-status {
  min-width: 9.5rem;
}

.header-group-refresh {
  gap: 0.4rem;
}

.live-state { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--muted); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.06em; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex-shrink: 0; }
.live-state[data-state="live"] .live-dot { background: var(--success); box-shadow: 0 0 8px var(--success); }
.live-state[data-state="loading"] .live-dot { background: var(--active); animation: pulse 0.9s ease-in-out infinite; }
.live-state[data-state="error"] .live-dot { background: var(--error); box-shadow: 0 0 8px var(--error); }
.live-state[data-state="paused"] .live-dot { background: var(--warning); }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

.stamp { font-size: var(--fs-xs); color: var(--faint); min-width: 8ch; }

.auto-toggle { display: inline-flex; align-items: center; gap: 0.35rem; color: var(--muted); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.06em; cursor: pointer; user-select: none; }
.auto-toggle input { accent-color: var(--accent); cursor: pointer; margin: 0; }

.interval-select,
.btn-refresh {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  padding: 0.3rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface2);
  color: var(--text);
  cursor: pointer;
}

.btn-refresh {
  font-family: var(--font);
  font-weight: 600;
  letter-spacing: 0.03em;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.32rem 0.7rem;
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
  transition: background 0.12s ease;
}
.btn-refresh:hover { background: rgba(88, 166, 255, 0.24); }
.btn-refresh:disabled { opacity: 0.55; cursor: progress; }
.btn-refresh .refresh-icon { display: inline-block; font-size: 13px; line-height: 1; }
.btn-refresh.busy .refresh-icon { animation: spin 0.7s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }

/* Thin progress line that fills toward the next auto-refresh. */
.refresh-bar {
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, transparent, var(--accent));
  transition: width 0.25s linear;
  opacity: 0.7;
}

.site-header.is-loading {
  box-shadow:
    0 1px 0 rgba(88, 166, 255, 0.14),
    0 0 24px rgba(88, 166, 255, 0.08);
}

.refresh-bar.is-loading {
  width: 100% !important;
  opacity: 1;
  transition: none;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(88, 166, 255, 0.15) 25%,
    var(--accent) 50%,
    rgba(88, 166, 255, 0.15) 75%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: refresh-sweep 0.9s linear infinite;
}

@keyframes refresh-sweep {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

body.is-refreshing .header-group-refresh .interval-select {
  opacity: 0.65;
  pointer-events: none;
}

.alert {
  max-width: 1500px;
  margin: 0.75rem auto -0.25rem;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--error);
  border-left-width: 3px;
  border-radius: var(--radius-sm);
  background: rgba(255, 107, 118, 0.08);
  color: var(--error);
  font-family: var(--mono);
  font-size: var(--fs-sm);
  width: calc(100% - 2.5rem);
}

/* ---------- layout ---------- */

.app-shell {
  display: flex;
  flex: 1;
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
  min-height: 0;
  align-items: stretch;
}

.sidebar {
  width: 196px;
  flex-shrink: 0;
  padding: 1.1rem 0.75rem 0.85rem;
  position: sticky;
  top: var(--header-h);
  align-self: stretch;
  max-height: calc(100vh - var(--header-h));
  overflow: auto;
  transition: width 0.18s ease;
  background: rgba(14, 19, 26, 0.72);
  border-right: 1px solid var(--border-strong);
  box-shadow: inset -1px 0 0 rgba(88, 166, 255, 0.08);
  display: flex;
  flex-direction: column;
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
  padding-bottom: 0.65rem;
  min-height: 1.6rem;
  border-bottom: 1px solid var(--border-strong);
}

.sidebar-label {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 0 0.55rem;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-toggle {
  flex-shrink: 0;
  width: 1.6rem;
  height: 1.6rem;
  margin-right: 0.2rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface2);
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-toggle:hover {
  color: var(--text-strong);
  border-color: var(--border-strong);
  background: var(--surface3);
}

.sidebar-toggle-icon {
  display: block;
  width: 0.4rem;
  height: 0.4rem;
  border-left: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  margin-left: 0.1rem;
}

.sidebar.is-collapsed .sidebar-toggle-icon,
html.sidebar-collapsed .sidebar .sidebar-toggle-icon {
  transform: rotate(-135deg);
  margin-left: 0;
  margin-right: 0.1rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1 1 auto;
  min-height: 0;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-strong);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sidebar-user {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.2rem 0.55rem 0.35rem;
  min-width: 0;
}

.sidebar-user-name {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-role {
  font-size: 0.65rem;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sidebar-logout {
  color: var(--muted);
}

.sidebar-logout:hover {
  color: var(--error);
  border-color: rgba(255, 107, 118, 0.28);
  background: rgba(255, 107, 118, 0.08);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.55rem;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 500;
  border: 1px solid transparent;
}

.sidebar-link-abbr {
  display: none;
  font-family: var(--mono);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.sidebar-link:hover {
  background: var(--surface2);
  text-decoration: none;
  color: var(--text-strong);
}

.sidebar-link.active {
  background: var(--accent-dim);
  border-color: rgba(88, 166, 255, 0.28);
  color: var(--text-strong);
}

.sidebar-hint {
  margin: 1rem 0.55rem 0;
  font-size: var(--fs-xs);
  line-height: 1.4;
}

/* Collapsed rail: abbreviations only, preference persists via localStorage */
.sidebar.is-collapsed,
html.sidebar-collapsed .sidebar {
  width: 56px;
  padding-left: 0.4rem;
  padding-right: 0.4rem;
}

.sidebar.is-collapsed .sidebar-top,
html.sidebar-collapsed .sidebar .sidebar-top {
  justify-content: center;
  margin-bottom: 0.35rem;
}

.sidebar.is-collapsed .sidebar-label,
.sidebar.is-collapsed .sidebar-hint,
.sidebar.is-collapsed .sidebar-link-text,
.sidebar.is-collapsed .sidebar-user,
html.sidebar-collapsed .sidebar .sidebar-label,
html.sidebar-collapsed .sidebar .sidebar-hint,
html.sidebar-collapsed .sidebar .sidebar-link-text,
html.sidebar-collapsed .sidebar .sidebar-user {
  display: none;
}

.sidebar.is-collapsed .sidebar-toggle,
html.sidebar-collapsed .sidebar .sidebar-toggle {
  margin-right: 0;
}

.sidebar.is-collapsed .sidebar-link,
html.sidebar-collapsed .sidebar .sidebar-link {
  justify-content: center;
  padding: 0.5rem 0.25rem;
}

.sidebar.is-collapsed .sidebar-link-abbr,
html.sidebar-collapsed .sidebar .sidebar-link-abbr {
  display: inline;
}

.section-jump {
  margin: 0.25rem 0 0;
  font-size: var(--fs-sm);
}

.container {
  width: 100%;
  margin: 0;
  padding: 1.25rem;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (max-width: 860px) {
  .app-shell {
    flex-direction: column;
  }

  .sidebar,
  .sidebar.is-collapsed,
  html.sidebar-collapsed .sidebar {
    width: 100%;
    position: static;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--border-strong);
    box-shadow: inset 0 -1px 0 rgba(88, 166, 255, 0.08);
    padding: 1.1rem 0.75rem 0.75rem;
  }

  .sidebar-toggle {
    display: none;
  }

  .sidebar.is-collapsed .sidebar-label,
  .sidebar.is-collapsed .sidebar-link-text,
  html.sidebar-collapsed .sidebar .sidebar-label,
  html.sidebar-collapsed .sidebar .sidebar-link-text {
    display: block;
  }

  .sidebar.is-collapsed .sidebar-link-abbr,
  html.sidebar-collapsed .sidebar .sidebar-link-abbr {
    display: none;
  }

  .sidebar.is-collapsed .sidebar-top,
  html.sidebar-collapsed .sidebar .sidebar-top {
    justify-content: flex-start;
  }

  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .sidebar-footer {
    margin-top: 0.75rem;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
  }

  .sidebar-hint,
  .sidebar.is-collapsed .sidebar-hint,
  html.sidebar-collapsed .sidebar .sidebar-hint {
    display: none;
  }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem 1.1rem;
}

.panel > h1 { font-size: 1.15rem; letter-spacing: -0.01em; margin: 0 0 0.2rem; color: var(--text-strong); }

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.panel h2,
.metric-block h2 {
  margin: 0;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.panel-note { font-size: var(--fs-xs); color: var(--faint); font-family: var(--mono); }

.metric-block .panel-head {
  margin-bottom: 0.5rem;
  padding-bottom: 0;
  border-bottom: none;
}

.muted { color: var(--muted); }

code, .col-name { font-size: var(--fs-xs); color: var(--muted); }

/* ---------- metrics ---------- */

.metric-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr));
  grid-auto-rows: 7.75rem;
  align-items: stretch;
  gap: 0.85rem;
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: visible;
}

.metric {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  background: var(--surface);
  padding: 1.1rem 1.15rem 0.95rem;
  box-sizing: border-box;
  height: 100%;
  min-height: 7.75rem;
  width: auto;
  flex: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(88, 166, 255, 0.04);
}

/* Reserve the same footer slot used by "View list" so plain cards match */
.metric:not(.metric-action)::after {
  content: "";
  display: block;
  margin-top: auto;
  min-height: 1.05rem;
}

button.metric {
  display: flex;
  margin: 0;
  font: inherit;
  text-align: left;
  color: inherit;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.metric-action:hover,
.metric-action.is-open {
  background: var(--surface2);
  border-color: rgba(88, 166, 255, 0.35);
}

.metric-action:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.metric-action-cue {
  margin-top: auto;
  min-height: 1.05rem;
  padding-top: 0.1rem;
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.02em;
  line-height: 1.05rem;
}

.metric-action-cue .cue-close {
  display: none;
}

.metric-action.is-open .metric-action-cue .cue-open {
  display: none;
}

.metric-action.is-open .metric-action-cue .cue-close {
  display: inline;
}

.metric-action:hover .metric-action-cue {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.metric-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.metric-value {
  font-family: var(--mono);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text-strong);
  line-height: 1.2;
  letter-spacing: -0.01em;
  word-break: break-word;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
}

.metric-value.mono {
  font-size: 1.4rem;
}

.metric-hint {
  margin-top: 0.1rem;
  font-size: var(--fs-xs);
}

.metric-block .metric-row {
  margin-top: 0.15rem;
}

@media (max-width: 900px) {
  .metric-row {
    grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
  }
}

@media (max-width: 520px) {
  .metric-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.panel-head-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.chip-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.28rem 0.55rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface2);
  font-family: var(--mono);
  font-size: var(--fs-xs);
}
.chip strong { font-weight: 700; }

/* ---------- batch filter ---------- */

.batch-filter-panel .panel-head { margin-bottom: 0.35rem; }

.batch-filter-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.batch-filter-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: var(--fs-sm);
  color: var(--muted);
}

.batch-select {
  min-width: 280px;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface2);
  color: var(--text-strong);
  font-family: var(--mono);
  font-size: var(--fs-sm);
}

.batch-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
}

/* ---------- waterfall ---------- */

/* One centred board: fixed label gutter, shared track, fixed total gutter, so
   every row starts and ends on the same axis no matter how long the names are. */
.waterfall {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.waterfall-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--faint);
}

.legend-item { display: inline-flex; align-items: center; gap: 0.3rem; }

.swatch {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  border: 1px solid currentColor;
  display: inline-block;
}
.swatch.status-success { background: var(--success); color: var(--success); }
.swatch.status-active  { background: var(--active); color: var(--active); }
.swatch.status-pending { background: var(--pending); color: var(--pending); }
.swatch.status-error   { background: var(--error); color: var(--error); }
.swatch.status-review  { background: var(--warning); color: var(--warning); }
.swatch.status-neutral { background: var(--neutral); color: var(--neutral); }

.wf-row[data-statement="pl"] { margin-top: -0.18rem; }
.wf-row[data-statement="pl"] .wf-step { border-color: transparent; background: transparent; }

.wf-row {
  display: grid;
  grid-template-columns: 230px 1fr 84px;
  align-items: center;
  gap: 0.75rem;
  padding: 0.22rem 0;
}

.wf-label { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }

.wf-step {
  width: 1.35rem;
  height: 1.35rem;
  flex-shrink: 0;
  border-radius: 3px;
  background: var(--surface3);
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
}

.wf-statement {
  font-style: normal;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--faint);
  margin-left: 0.35rem;
}

.wf-name {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wf-track {
  display: flex;
  height: 20px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--surface3);
  border: 1px solid var(--border);
}

.wf-seg { display: block; height: 100%; transition: width 0.35s ease; }
.wf-seg.status-success { background: var(--success); }
.wf-seg.status-active  { background: var(--active); }
.wf-seg.status-pending { background: var(--pending); }
.wf-seg.status-error   { background: var(--error); }
.wf-seg.status-review  { background: var(--warning); }
.wf-seg.status-neutral { background: var(--neutral); }
.wf-seg + .wf-seg { border-left: 1px solid var(--surface); }

.wf-total {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--text-strong);
  text-align: right;
}

/* ---------- funnel ---------- */

.funnel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
  align-items: stretch;
  gap: 0.6rem;
}

.funnel-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.65rem 0.75rem;
  transition: border-color 0.12s ease;
}
.funnel-card:hover { border-color: var(--border-strong); }

.funnel-card h3 {
  margin: 0;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-strong);
  letter-spacing: -0.005em;
}

.funnel-card .col-name { display: block; margin-top: 0.1rem; word-break: break-all; }

.branch-tag {
  display: inline-block;
  margin-top: 0.4rem;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.05rem 0.35rem;
  border-radius: 2px;
  color: var(--warning);
  border: 1px solid rgba(240, 184, 73, 0.35);
}

.status-list {
  list-style: none;
  margin: 0.55rem 0 0;
  padding: 0.5rem 0 0;
  border-top: 1px dashed var(--border);
  max-height: 11.5rem;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.status-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.15rem 0;
  font-size: var(--fs-xs);
}

.status-list .count { font-family: var(--mono); font-weight: 700; color: var(--text-strong); flex-shrink: 0; }
.status-list .status-pill { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

.status-pill {
  display: inline-block;
  padding: 0.08rem 0.4rem;
  border-radius: 3px;
  font-size: var(--fs-xs);
  border: 1px solid transparent;
  white-space: nowrap;
}

.status-success { background: rgba(70, 211, 160, 0.12); color: var(--success); border-color: rgba(70, 211, 160, 0.3); }
.status-error   { background: rgba(255, 107, 118, 0.12); color: var(--error); border-color: rgba(255, 107, 118, 0.3); }
.status-pending { background: rgba(125, 158, 196, 0.16); color: var(--pending); border-color: rgba(125, 158, 196, 0.32); }
.status-active  { background: rgba(79, 195, 247, 0.12); color: var(--active); border-color: rgba(79, 195, 247, 0.3); }
.status-review  { background: rgba(240, 184, 73, 0.12); color: var(--warning); border-color: rgba(240, 184, 73, 0.3); }
.status-neutral { background: rgba(168, 148, 122, 0.14); color: var(--neutral); border-color: rgba(168, 148, 122, 0.3); }
.status-none    { color: var(--faint); }

/* Freshly changed values flash once so live updates are visible. */
@keyframes flash { from { background-color: var(--accent-dim); } to { background-color: transparent; } }
.value-changed { animation: flash 1.1s ease-out; }

/* ---------- tables ---------- */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  max-height: 62vh;
  overflow-y: auto;
  background: var(--surface);
  box-shadow: inset 0 1px 0 rgba(88, 166, 255, 0.04);
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-family: var(--mono);
  font-size: var(--fs-xs);
  white-space: nowrap;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: linear-gradient(180deg, var(--surface3) 0%, #1a2430 100%);
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
  border-bottom: 1px solid var(--border-strong);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table .th-sort {
  appearance: none;
  background: none;
  border: 0;
  margin: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.data-table .th-sort:hover,
.data-table .th-sort:focus-visible {
  color: var(--text);
  outline: none;
}

.data-table .th-sort::after {
  content: "↕";
  font-size: 9px;
  line-height: 1;
  opacity: 0.35;
}

.data-table .th-sort.is-active {
  color: var(--accent);
}

.data-table .th-sort.is-active[data-dir="asc"]::after {
  content: "↑";
  opacity: 1;
}

.data-table .th-sort.is-active[data-dir="desc"]::after {
  content: "↓";
  opacity: 1;
}

.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:nth-child(even) td { background: rgba(255, 255, 255, 0.015); }
.data-table tbody tr:hover td { background: var(--accent-dim); }
#companies-table tbody tr.is-return-row td {
  background: rgba(88, 166, 255, 0.18);
}
#companies-table tbody tr.is-return-row td:first-child {
  box-shadow: inset 3px 0 0 var(--accent);
}
.data-table td { color: var(--text); }
.data-table td.muted,
.data-table .muted { color: var(--faint); }
/* Display-config toggles (also gated in templates / JS). */
body[data-show-batch="0"] .cfg-batch { display: none !important; }
body[data-show-auto-refresh="0"] .auto-toggle,
body[data-show-auto-refresh="0"] #refresh-interval { display: none !important; }
body[data-show-validation-failed="0"] .cfg-validation-failed {
  display: none !important;
}

/* Detail links in tables — keep accent + cue so rows look clickable. */
.data-table td a,
.data-table td a.cell-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(88, 166, 255, 0.4);
  cursor: pointer;
}
.data-table td a:hover,
.data-table td a.cell-link:hover {
  color: var(--text-strong);
  border-bottom-color: var(--accent);
  text-decoration: none;
}
.data-table td a.cell-link::after {
  content: " ›";
  font-weight: 500;
  opacity: 0.75;
  border-bottom: none;
}
.data-table td a.cell-link:hover::after {
  opacity: 1;
}
.data-table td code { color: var(--text); }
.data-table .num { text-align: right; }
.data-table .status-pill { font-size: 10px; }

/* ---------- filters / pagination ---------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: flex-end;
  margin-bottom: 0.7rem;
}

.filters label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--faint);
}

.filters input,
.filters select,
.filters button {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  padding: 0.35rem 0.55rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface2);
  color: var(--text);
}

.filters input { min-width: 240px; }
.filters input:focus,
.filters select:focus,
.interval-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
}

.filters button {
  cursor: pointer;
  font-family: var(--font);
  font-weight: 600;
  background: var(--surface3);
  color: var(--text-strong);
}
.filters button:hover { border-color: var(--accent); color: var(--accent); }

.pagination {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  margin-top: 0.7rem;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: var(--fs-xs);
}

.pagination button {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface2);
  color: var(--text);
  cursor: pointer;
}
.pagination button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.pagination button:disabled { opacity: 0.35; cursor: not-allowed; }

/* ---------- file detail ---------- */

.file-meta {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.5rem 1.25rem;
  margin: 0;
}

.file-meta div {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
}
.file-meta dt { color: var(--faint); font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; }
.file-meta dd { margin: 0; font-family: var(--mono); font-size: var(--fs-sm); color: var(--text-strong); overflow-wrap: anywhere; }

.stepper { display: flex; flex-direction: column; gap: 0.4rem; }

.step-card {
  position: relative;
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 0.6rem 0.9rem;
  background: var(--surface2);
}

.step-card.step-inactive { opacity: 0.4; }
.step-card.step-branch { border-left-color: var(--warning); }
.step-card.step-done { border-left-color: var(--success); }
.step-card.step-running { border-left-color: var(--active); }
.step-card.step-failed { border-left-color: var(--error); }

.step-header { display: flex; align-items: center; gap: 0.7rem; }

.step-num {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: var(--radius-sm);
  background: var(--surface3);
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: var(--fs-xs);
  color: var(--muted);
  flex-shrink: 0;
}

.step-header h3 { margin: 0; font-size: var(--fs-sm); font-weight: 600; color: var(--text-strong); }
.step-header > div { flex: 1; min-width: 0; }
.step-header code { display: block; word-break: break-all; }

.worker-meta {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 0.3rem 1.25rem;
  margin: 0.6rem 0 0;
  padding-top: 0.6rem;
  border-top: 1px dashed var(--border);
  font-family: var(--mono);
  font-size: var(--fs-xs);
}

.worker-meta div { display: flex; flex-direction: column; }
.worker-meta dt { color: var(--faint); font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; }
.worker-meta dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }

.branch-connector {
  text-align: center;
  color: var(--warning);
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.error-panel pre {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 0.9rem;
  border-radius: var(--radius);
  overflow-x: auto;
  font-family: var(--mono);
  font-size: var(--fs-sm);
  color: var(--error);
}

/* ---------- footer ---------- */

.site-footer {
  max-width: 1500px;
  width: 100%;
  margin: 0 auto;
  padding: 0.8rem 1.25rem 1.4rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--faint);
  border-top: 1px solid var(--border);
}

kbd {
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 3px;
  padding: 0 0.25rem;
  background: var(--surface2);
  color: var(--muted);
  font-size: 10px;
}

@media (max-width: 760px) {
  .funnel-grid { grid-template-columns: 1fr; }
  .header-inner { align-items: flex-start; }
  .header-controls { width: 100%; justify-content: flex-start; }
  .filters input { min-width: 0; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- combo statuses split per statement ---------- */

.funnel-card-wide { grid-column: span 2; }

.statement-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 0.55rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border);
}

.statement-col h4 {
  margin: 0;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--faint);
}

.statement-col .status-list {
  margin-top: 0.3rem;
  padding-top: 0;
  border-top: none;
  max-height: none;
}

.combo-details { margin-top: 0.6rem; }

.combo-details summary {
  cursor: pointer;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--faint);
}
.combo-details summary:hover { color: var(--accent); }
.combo-details .status-list { border-top: 1px dashed var(--border); max-height: 13rem; }

@media (max-width: 760px) {
  .funnel-card-wide { grid-column: span 1; }
  .statement-split { grid-template-columns: 1fr; }
}

/* ---------- worker card totals ---------- */

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
}

.card-title { min-width: 0; }

.card-metric {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.1;
  flex-shrink: 0;
}

.card-total {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-strong);
}

.card-total-label {
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--faint);
}

/* ---------- file_meta board: statement split + page routing ---------- */

.split-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 0.75rem;
}

.split-worker {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem 0.8rem 0.8rem;
}

.split-worker h3 {
  margin: 0 0 0.5rem;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-strong);
}

.split-statements {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}

.split-head {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin-bottom: 0.3rem;
}

.split-tag {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  border: 1px solid var(--border-strong);
  border-radius: 2px;
  padding: 0 0.25rem;
}

.split-col {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--faint);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.split-total {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--text-strong);
}

.split-statement .wf-track { height: 14px; }

.split-statement .status-list {
  margin-top: 0.4rem;
  padding-top: 0.4rem;
  max-height: 9rem;
}

/* Routing is a destination, not an outcome, so it gets its own two colours. */
.route-cv { background: var(--accent); }
.route-adi { background: var(--warning); }
.swatch.route-cv { color: var(--accent); }
.swatch.route-adi { color: var(--warning); }

.status-pill.route-pill { color: var(--bg); font-weight: 700; }

.routing-bar-wrap { margin-bottom: 0.8rem; }

.routing-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 0.35rem;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--faint);
}

.routing-track { height: 22px; }

.routing-metrics { margin-bottom: 0.8rem; }

.routing-detail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.9rem;
}

.routing-detail h4 {
  margin: 0 0 0.25rem;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--faint);
}

/* Keep each count next to its label instead of stranded at the panel edge. */
.routing-detail .status-list { border-top: none; padding-top: 0; max-height: none; max-width: 460px; }

@media (max-width: 760px) {
  .split-board { grid-template-columns: 1fr; }
  .split-statements { grid-template-columns: 1fr; }
}

/* --- manual-review rows (anomaly / validation_failed) ---------------------
   These two statuses sit at the bottom of every worker-detail list and carry
   a live count from manual_review_files, so the li breaks out of the flat
   pill/count row into a stacked block. */

.status-list li.mr-row {
  display: block;
  margin-top: 0.45rem;
  padding: 0.4rem 0.45rem 0.45rem;
  border: 1px solid var(--border);
  border-left: 2px solid var(--error);
  border-radius: var(--radius-sm);
  background: var(--surface2);
}
.status-list li.mr-row + li.mr-row { margin-top: 0.35rem; }

.mr-row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}
.mr-row-head .count {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--text-strong);
  flex-shrink: 0;
}

.mr-panel { margin-top: 0.4rem; }

.mr-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  padding-bottom: 0.28rem;
  border-top: 1px dashed var(--border-strong);
  padding-top: 0.35rem;
}
.mr-tag {
  font-size: 9.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}
.mr-total {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  color: var(--faint);
}

.mr-chips {
  /* auto-fit rather than a fixed 3 so the optional "other" chip joins the
     same row instead of wrapping alone underneath. */
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 0.3rem;
}
.mr-chip {
  /* Stacked, not inline: "13,299 PROCESSED" on one line clips inside a
     three-across card, and a clipped label is worse than a taller chip. */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  padding: 0.2rem 0.35rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
}
.mr-chip b {
  font-family: var(--mono);
  font-size: var(--fs-sm);
  color: var(--text-strong);
}
.mr-chip i {
  font-style: normal;
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.mr-chip b { line-height: 1.25; }
.mr-chip.mr-processed { border-color: rgba(70, 211, 160, 0.35); }
.mr-chip.mr-processed b { color: var(--success); }
.mr-chip.mr-pending { border-color: rgba(240, 184, 73, 0.35); }
.mr-chip.mr-pending b { color: var(--warning); }
.mr-chip.mr-skipped { border-color: var(--border-strong); }
.mr-chip.mr-skipped b { color: var(--muted); }
.mr-chip.mr-other b { color: var(--active); }

.mr-sources {
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0.32rem 0 0;
  border-top: 1px dashed var(--border);
}
.mr-sources li {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.1rem 0;
  font-size: 10.5px;
}
.mr-sources code {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--faint);
  font-size: 10.5px;
}
.mr-sources .count {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--muted);
  flex-shrink: 0;
}
.mr-bucket {
  flex-shrink: 0;
  padding: 0 0.28rem;
  border-radius: 3px;
  font-size: 9px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid transparent;
}
.mr-bucket-anomaly {
  color: var(--error);
  border-color: rgba(255, 107, 118, 0.3);
  background: rgba(255, 107, 118, 0.09);
}
.mr-bucket-validation_failed {
  color: var(--warning);
  border-color: rgba(240, 184, 73, 0.3);
  background: rgba(240, 184, 73, 0.09);
}
.mr-bucket-error, .mr-bucket-other {
  color: var(--muted);
  border-color: var(--border-strong);
}

.mr-note {
  margin: 0.35rem 0 0;
  font-size: 10.5px;
  color: var(--faint);
}

/* The list scrolls at 11.5rem, which is too tight once a card carries two
   expanded review blocks. */
.funnel-card .status-list { max-height: 26rem; }

/* ---------- VAT Coverage (batch bar, index.html) ---------- */

/* Sits on the right half of the batch bar. margin-left:auto pushes it there
   without needing a wrapper or a grid; the row is already flex. */
.vat-coverage {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
}

.vc-row {
  display: flex;
  align-items: baseline;
  gap: 1.1rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.vc-title {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

/* Each stat is label / percentage / count. The percentage is the number the
   eye should land on, so it carries the weight and the colour. */
.vc-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
}

.vc-stat i {
  font-style: normal;
  font-size: var(--fs-xs);
  color: var(--muted);
}

.vc-stat b {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-md);
  font-weight: 700;
}

.vc-stat em {
  font-style: normal;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-xs);
  color: var(--faint);
}

.vc-success b { color: var(--success); }
.vc-blanks  b { color: var(--muted); }
.vc-pending b { color: var(--warning); }

.vc-meta {
  font-size: 10.5px;
  color: var(--faint);
}

/* Below this the batch select and the coverage block stop sharing a line, so
   let coverage fall to the left instead of hanging off the right edge. */
@media (max-width: 860px) {
  .vat-coverage { margin-left: 0; align-items: flex-start; }
  .vc-row { justify-content: flex-start; }
}

/* --- Coface company-first --- */
.funnel-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.funnel-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
}
.funnel-chip em { font-style: normal; color: var(--faint); font-size: var(--fs-xs); }
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
  align-items: center;
  padding: 0.55rem 0.65rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.per-page-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--fs-xs);
  margin-left: auto;
  color: var(--muted);
}

.search-field {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 16rem;
  min-width: 14rem;
  max-width: 28rem;
}

.search-icon {
  position: absolute;
  left: 0.7rem;
  width: 0.7rem;
  height: 0.7rem;
  border: 1.5px solid var(--faint);
  border-radius: 50%;
  pointer-events: none;
}

.search-icon::after {
  content: "";
  position: absolute;
  left: 0.5rem;
  top: 0.5rem;
  width: 0.35rem;
  height: 1.5px;
  background: var(--faint);
  transform: rotate(45deg);
  transform-origin: left center;
}

.search-input {
  width: 100%;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text-strong);
  border-radius: 8px;
  padding: 0.5rem 0.75rem 0.5rem 1.85rem;
  font-family: var(--font);
  font-size: var(--fs-sm);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.search-input::placeholder { color: var(--faint); }
.search-input:hover { border-color: var(--border-strong); }
.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
  background: var(--surface3);
}

.toolbar-select,
.toolbar .batch-select {
  min-width: 0;
  padding: 0.48rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-sm);
  cursor: pointer;
}

.toolbar-select:focus,
.toolbar .batch-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.pager-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
}

.pager {
  margin-top: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: var(--fs-xs);
}
.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem 1rem;
  margin: 0;
}
.meta-grid dt {
  color: var(--faint);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.meta-grid dd { margin: 0.15rem 0 0; }
.breadcrumb { margin: 0 0 1rem; font-size: var(--fs-sm); }
.breadcrumb .muted { margin: 0 0.35rem; }
.step-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}
.step-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
}
.step-card h3 { margin: 0 0 0.5rem; font-size: var(--fs-sm); }
.status-list { list-style: none; margin: 0; padding: 0; }
.status-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0.25rem 0;
}
.muted { color: var(--muted); }

body[data-view="client"] .view-ops-only { display: none !important; }
body[data-view="ops"] .view-client-only { display: none !important; }

.view-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: var(--fs-xs);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.report-panel .panel-head { margin-bottom: 0.85rem; }
.report-form { margin: 0; }
.report-card {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1.25rem 1.5rem;
  padding: 1rem 1.1rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.report-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.85rem 1.1rem;
  flex: 1 1 auto;
  min-width: 0;
}
.report-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0;
  font-size: var(--fs-sm);
}
.report-field[hidden] {
  display: none !important;
}
.report-field-label {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  color: var(--muted);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.report-hint {
  color: var(--faint);
  font-size: 0.7rem;
  text-transform: none;
  letter-spacing: 0;
}
.report-range-inputs {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.report-range-sep { line-height: 1; }
.report-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  min-width: 11rem;
}
.btn-report {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.95rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--accent-dim);
  color: var(--accent);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.btn-report:hover { background: rgba(88, 166, 255, 0.24); }
.btn-report:disabled { opacity: 0.55; cursor: progress; }
.btn-report.busy .refresh-icon { animation: spin 0.7s linear infinite; }
.report-status {
  margin: 0;
  min-height: 1.15rem;
  font-size: var(--fs-xs);
  color: var(--muted);
}
.report-status.report-status-error { color: var(--danger, #f85149); }
.report-status.report-status-ok { color: var(--ok, #3fb950); }

/* ── Login ─────────────────────────────────────────────────────────────── */
.login-body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse 70% 55% at 20% 15%, rgba(88, 166, 255, 0.14), transparent 55%),
    radial-gradient(ellipse 50% 40% at 85% 80%, rgba(70, 211, 160, 0.06), transparent 50%),
    linear-gradient(var(--bg-grid) 1px, transparent 1px) 0 0 / 100% 28px,
    var(--bg);
}
.login-shell {
  width: min(100%, 52rem);
  padding: 1.5rem;
}
.login-card {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  min-height: 28rem;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(88, 166, 255, 0.06),
    0 24px 64px rgba(0, 0, 0, 0.45);
}
.login-aside {
  position: relative;
  padding: 2.25rem 2rem;
  background:
    linear-gradient(160deg, rgba(88, 166, 255, 0.12) 0%, transparent 55%),
    var(--surface2);
  border-right: 1px solid var(--border);
  display: flex;
  align-items: flex-end;
}
.login-aside::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(var(--border) 1px, transparent 1px) 0 0 / 100% 32px;
  opacity: 0.35;
  pointer-events: none;
}
.login-aside-inner {
  position: relative;
  z-index: 1;
  max-width: 20rem;
}
.login-mark {
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  margin-bottom: 1.25rem;
  background: var(--accent);
  box-shadow: 0 0 16px var(--accent);
}
.login-kicker {
  margin: 0 0 0.45rem;
  font-size: var(--fs-xs);
  font-family: var(--mono);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.login-aside h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-strong);
  line-height: 1.15;
}
.login-aside-copy {
  margin: 0.85rem 0 0;
  color: var(--muted);
  font-size: var(--fs-md);
  line-height: 1.55;
  max-width: 18rem;
}
.login-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2.25rem 2.35rem;
  background: var(--surface);
}
.login-main-head {
  margin-bottom: 1.5rem;
}
.login-main-head h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 650;
  color: var(--text-strong);
  letter-spacing: -0.02em;
}
.login-main-head .muted {
  margin: 0.35rem 0 0;
  font-size: var(--fs-sm);
}
.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.login-field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 0;
  font-size: var(--fs-xs);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.login-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.8rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
  color: var(--text-strong);
  font-size: 0.95rem;
  font-family: var(--font);
  text-transform: none;
  letter-spacing: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.login-password-wrap {
  position: relative;
  display: block;
}
.login-password-wrap .login-input {
  padding-right: 2.75rem;
}
.login-password-toggle {
  position: absolute;
  top: 50%;
  right: 0.45rem;
  transform: translateY(-50%);
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.login-password-toggle:hover {
  color: var(--text-strong);
  background: rgba(88, 166, 255, 0.1);
}
.login-password-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.login-password-toggle .login-eye-closed { display: none; }
.login-password-toggle.is-visible .login-eye-open { display: none; }
.login-password-toggle.is-visible .login-eye-closed { display: block; }
.login-input::placeholder { color: var(--faint); }
.login-input:hover { border-color: var(--border-strong); }
.login-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
  background: var(--surface3);
}
.login-submit.is-loading {
  opacity: 0.75;
  cursor: progress;
}

.login-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.85rem 1rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--accent);
  color: #061018;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.1s ease;
}
.login-submit:hover { filter: brightness(1.08); }
.login-submit:active { transform: translateY(1px); }
.login-error {
  margin: 0;
  padding: 0.7rem 0.85rem;
  border-radius: 8px;
  background: rgba(255, 107, 118, 0.1);
  border: 1px solid rgba(255, 107, 118, 0.35);
  color: var(--error);
  font-size: var(--fs-sm);
  text-transform: none;
  letter-spacing: 0;
}
@media (max-width: 720px) {
  .login-shell { width: min(100%, 26rem); padding: 1rem; }
  .login-card {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .login-aside {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 1.35rem 1.25rem;
    align-items: flex-start;
  }
  .login-aside h1 { font-size: 1.55rem; }
  .login-aside-copy { max-width: none; }
  .login-main { padding: 1.5rem 1.35rem 1.65rem; }
}

/* ── Full-page navigation loading ───────────────────────────────────────── */
.page-loading {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 12, 18, 0.55);
  backdrop-filter: blur(3px);
  pointer-events: all;
}
.page-loading[hidden] {
  display: none !important;
}
.page-loading-card {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.15rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  color: var(--text-strong);
  font-size: var(--fs-sm);
  font-weight: 600;
}
.page-loading-spinner {
  width: 1.05rem;
  height: 1.05rem;
  border: 2px solid rgba(88, 166, 255, 0.25);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
.page-loading-label {
  min-width: 6rem;
}
html.is-page-loading,
body.is-page-loading {
  cursor: progress;
}
body.is-page-loading .app-shell,
body.is-page-loading .login-shell {
  pointer-events: none;
  user-select: none;
}

/* Top sweep bar while a full navigation is in flight */
body.is-page-loading .site-header {
  position: sticky;
}
body.is-page-loading .site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(88, 166, 255, 0.15) 25%,
    var(--accent) 50%,
    rgba(88, 166, 255, 0.15) 75%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: refresh-sweep 0.9s linear infinite;
}

/* ── Company I/O viewer (ops) ───────────────────────────────────────────── */
.artifact-actions { margin-left: auto; }

/* Keep page chrome fixed; only pane bodies scroll */
body:has(.io-page) {
  height: 100vh;
  overflow: hidden;
}
.app-shell:has(.io-page) {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  height: calc(100vh - var(--header-h));
}
.container:has(.io-page) {
  overflow: hidden;
  min-height: 0;
  height: 100%;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
}

/* Page shell: fill viewport under header; panes scroll independently */
.io-page {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
  min-height: 0;
  height: calc(100vh - var(--header-h, 3.5rem) - 2rem);
  max-height: calc(100vh - var(--header-h, 3.5rem) - 2rem);
}
.io-chrome { flex-shrink: 0; display: flex; flex-direction: column; gap: 0.55rem; }
.io-breadcrumb { margin: 0; }
.io-toolbar-panel {
  margin: 0;
  padding: 0.55rem 0.75rem 0.6rem;
}
.io-toolbar-panel .panel-head { margin-bottom: 0.2rem; padding-bottom: 0.35rem; }
.io-toolbar-meta { margin: 0; font-size: var(--fs-xs); }

/* Focus: hide top chrome only; Exit focus only while comparing */
.io-page.io-focus-mode .io-chrome { display: none !important; }
.io-exit-focus-btn {
  display: none !important;
  padding: 0.28rem 0.55rem;
  font-size: var(--fs-xs);
}
.io-page.io-focus-mode .io-exit-focus-btn {
  display: inline-flex !important;
}
.io-pane-tools {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.io-split {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.75rem;
  align-items: stretch;
  overflow: hidden;
}
.io-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
  margin: 0;
  overflow: hidden;
  padding: 0.65rem;
}
.io-pane-head {
  flex-shrink: 0;
  margin-bottom: 0.45rem;
  align-items: center;
}
.io-file-select-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: auto;
  min-width: 0;
  max-width: min(70%, 28rem);
}
.io-file-select {
  flex: 1;
  min-width: 8rem;
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.45rem;
  font-size: var(--fs-sm);
  font-family: var(--mono);
}

.io-preview,
.io-output {
  flex: 1 1 auto;
  min-height: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface2);
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.io-preview-empty { margin: 1rem; }
.io-preview-frame {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 100%;
  border: 0;
  background: #fff;
}
.io-preview-html {
  padding: 0.85rem 1rem;
  background: #fff;
  color: #1f2328;
  color-scheme: light;
}
.io-preview-html table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
  margin-bottom: 1rem;
}
.io-preview-html td,
.io-preview-html th {
  border: 1px solid #d0d7de;
  padding: 0.25rem 0.4rem;
}
.io-preview-html .io-sheet {
  width: max-content;
  min-width: 100%;
  background: #fff;
}
.io-preview-html .io-sheet td {
  background: #fff;
  color: #1f2328;
  white-space: nowrap;
  vertical-align: top;
}
.io-sheet-title {
  margin: 0.5rem 0 0.35rem;
  font-size: 0.95rem;
}

.io-tabs {
  display: inline-flex;
  gap: 0.25rem;
}
.io-tab {
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--muted);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.65rem;
  font-size: var(--fs-xs);
  font-weight: 600;
  cursor: pointer;
}
.io-tab.is-active {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
}

.io-json {
  margin: 0;
  padding: 0.85rem 1rem;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: var(--fs-xs);
}
.io-json-editor {
  padding: 0;
  overflow: hidden;
  background: #1e1e1e;
}
.io-json-editor .monaco-editor,
.io-json-editor .overflow-guard {
  border-radius: inherit;
}

/* QC fields: edit-ready form (readonly until data-qc-mode=edit) */
.io-qc-form {
  margin: 0;
  min-height: 100%;
}
.io-sections {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 0.65rem 0.7rem 1rem;
}
.io-section-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: hidden;
}
.io-section-title {
  margin: 0;
  padding: 0.5rem 0.75rem;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border-bottom: 1px solid var(--border);
}
.io-collapse-toggle {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  margin: 0;
  border: 0;
  cursor: pointer;
  text-align: left;
}
.io-collapse-chevron {
  flex: 0 0 auto;
  width: 0.4rem;
  height: 0.4rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  margin-top: -0.15rem;
}
.io-collapse-toggle[aria-expanded="false"] .io-collapse-chevron {
  transform: rotate(-45deg);
  margin-top: 0;
}
.io-section-card.is-collapsed > .io-section-body,
.io-section-item.is-collapsed > :not(.io-collapse-toggle),
.io-section-sub.is-collapsed > :not(.io-collapse-toggle) {
  display: none;
}
.io-section-card.is-collapsed > .io-section-title,
.io-section-item.is-collapsed > .io-section-item-head,
.io-section-sub.is-collapsed > .io-section-sub-title {
  border-bottom-color: transparent;
}
.io-section-body { padding: 0; }
.io-section-empty { margin: 0.65rem 0.75rem; }
.io-qc-list {
  display: flex;
  flex-direction: column;
}
.io-qc-row {
  display: grid;
  grid-template-columns: minmax(10rem, 36%) minmax(0, 1fr);
  gap: 0;
  border-bottom: 1px solid var(--border);
  align-items: stretch;
}
.io-qc-row:last-child { border-bottom: none; }
.io-qc-row.is-empty .io-qc-value-display {
  color: var(--faint);
  font-style: italic;
}
.io-qc-label {
  padding: 0.55rem 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border-right: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--muted);
  line-height: 1.35;
}
.io-qc-control {
  padding: 0.45rem 0.75rem;
  display: flex;
  align-items: flex-start;
  min-width: 0;
}
.io-qc-value-display {
  width: 100%;
  min-width: 0;
  color: var(--text-strong, var(--text));
  font-size: var(--fs-sm);
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.io-qc-form[data-qc-mode="edit"] .io-qc-value-display {
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  background: #0f151c;
  padding: 0.4rem 0.55rem;
}
.io-section-item {
  margin: 0.65rem 0.65rem 0.75rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: inset 3px 0 0 var(--accent);
}
.io-section-item.is-even {
  box-shadow: inset 3px 0 0 var(--success, #46d3a0);
  background: rgba(70, 211, 160, 0.04);
}
.io-section-item.is-odd {
  background: rgba(88, 166, 255, 0.04);
}
.io-section-item + .io-section-item {
  margin-top: 0.85rem;
}
.io-section-item-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.75rem;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text);
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}
.io-record-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.7rem;
  height: 1.35rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: var(--accent-dim);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
}
.io-record-count {
  margin-left: auto;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
}
.io-section-item.is-even .io-record-badge {
  background: rgba(70, 211, 160, 0.16);
  color: var(--success, #46d3a0);
}
.io-section-children {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin: 0.7rem 0.65rem 0.85rem 0.7rem;
  padding: 0.15rem 0 0.15rem 0.75rem;
  border-left: 3px solid var(--accent);
}
.io-section-children .io-section-children {
  border-left-color: var(--success, #46d3a0);
}
.io-section-children .io-section-children .io-section-children {
  border-left-color: var(--warning, #f0b849);
}
.io-section-children .io-section-children .io-section-children .io-section-children {
  border-left-color: #c792ea;
}
.io-section-sub {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: rgba(88, 166, 255, 0.05);
  overflow: hidden;
}
.io-section-sub-title {
  padding: 0.45rem 0.75rem;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text);
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}
.io-nested-json {
  margin: 0;
  padding: 0.65rem 0.75rem;
  font-size: var(--fs-xs);
  overflow: auto;
}

@media (max-width: 1100px) {
  body:has(.io-page),
  .app-shell:has(.io-page),
  .container:has(.io-page) {
    height: auto;
    max-height: none;
    overflow: visible;
  }
  .io-page {
    height: auto;
    max-height: none;
    min-height: 0;
  }
  .io-split {
    grid-template-columns: 1fr;
    overflow: visible;
  }
  .io-pane {
    height: auto;
    max-height: 70vh;
  }
  .io-preview,
  .io-output {
    min-height: 18rem;
  }
}

