:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f7ef;
  color: #172118;
  --leaf-900: #17351f;
  --leaf-800: #214728;
  --leaf-700: #315f32;
  --leaf-600: #47783e;
  --leaf-200: #dceacb;
  --leaf-100: #ecf5df;
  --cream: #fbfbf3;
  --lime: #d6e96f;
  --pit: #684a2f;
  --ink: #172118;
  --muted: #657264;
  --line: rgba(49, 95, 50, 0.16);
  --shadow: 0 22px 60px rgba(39, 67, 37, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 0%, rgba(214, 233, 111, 0.28), transparent 28rem),
    linear-gradient(135deg, #f7f8ef 0%, #eef4e5 48%, #f8f5ea 100%);
}

.shell {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 132px;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  background: rgba(255, 255, 250, 0.76);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border-radius: 18px;
  background: linear-gradient(145deg, #e4f1c3, #ffffff);
  box-shadow: inset 0 0 0 1px rgba(49, 95, 50, 0.12), 0 18px 38px rgba(49, 95, 50, 0.15);
  color: var(--leaf-900);
  font-size: 24px;
  font-weight: 950;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--leaf-700);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  color: var(--leaf-900);
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1;
}

h2 {
  color: var(--ink);
  font-size: 22px;
}

h3 {
  color: var(--leaf-800);
  font-size: 14px;
}

main {
  padding: 22px 0 56px;
}

.toolbar,
.gate-actions,
.panel-head,
.tabs {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toolbar {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.session-pill {
  min-height: 38px;
  max-width: 320px;
  overflow: hidden;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-pill.online {
  color: var(--leaf-800);
  background: rgba(236, 245, 223, 0.9);
}

.session-pill.locked,
.session-pill.offline {
  color: #8a4f20;
  background: rgba(255, 244, 224, 0.9);
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 15px;
  border: 1px solid rgba(49, 95, 50, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--leaf-900);
  font: inherit;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

button:hover,
.button:hover {
  border-color: rgba(49, 95, 50, 0.34);
  transform: translateY(-1px);
}

button:focus-visible,
.button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(214, 233, 111, 0.95);
  outline-offset: 3px;
}

.button.primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--leaf-800), var(--leaf-600));
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(49, 95, 50, 0.22);
}

.button.secondary {
  color: var(--leaf-800);
}

.button.danger {
  border-color: rgba(138, 79, 32, 0.28);
  color: #7a3d18;
  background: rgba(255, 244, 224, 0.92);
}

button:disabled {
  cursor: wait;
  opacity: 0.58;
  transform: none;
}

.icon-button {
  width: 44px;
  padding: 0;
  font-size: 20px;
}

.gate-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  min-height: 300px;
  padding: 34px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  background:
    linear-gradient(120deg, rgba(255, 255, 250, 0.92), rgba(236, 245, 223, 0.76)),
    radial-gradient(circle at 88% 20%, rgba(214, 233, 111, 0.28), transparent 22rem);
  box-shadow: var(--shadow);
}

.gate-panel.hidden,
.dashboard.hidden {
  display: none;
}

.gate-copy {
  max-width: 760px;
}

.gate-icon {
  display: inline-grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin-bottom: 18px;
  border-radius: 20px;
  background: #ffffff;
  color: var(--leaf-900);
  box-shadow: 0 18px 36px rgba(49, 95, 50, 0.12);
  font-size: 24px;
  font-weight: 950;
}

.gate-copy h2 {
  margin-bottom: 10px;
  font-size: clamp(28px, 4vw, 44px);
}

.gate-copy p:last-child {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.gate-panel.busy .gate-icon {
  animation: pulse 1.7s ease-in-out infinite;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.lane-grid,
.metric-grid,
.pipeline-grid,
.three-column {
  display: grid;
  gap: 12px;
}

.lane-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.metric-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.host-metrics {
  margin-bottom: 16px;
}

.trend-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.trend-status {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.trend-status span {
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 250, 0.72);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.trend-section-label {
  grid-column: 1 / -1;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.trend-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 250, 0.66);
}

.trend-card-head,
.trend-card-foot {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.trend-card-head span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.trend-card-head strong {
  display: block;
  margin-top: 5px;
  color: var(--leaf-900);
  font-size: 24px;
  line-height: 1;
}

.trend-card-head small,
.trend-card-foot span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.trend-card-foot {
  align-items: baseline;
}

.trend-card-foot span:last-child {
  flex: 0 0 auto;
  color: var(--leaf-800);
  font-weight: 800;
}

.sparkline {
  display: block;
  width: 100%;
  height: 84px;
  margin: 10px 0;
}

.sparkline-line {
  fill: none;
  stroke: var(--leaf-700);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.sparkline-line-flat {
  stroke-dasharray: 6 4;
}

.trend-flat-note {
  margin-top: -2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.sparkline-area {
  fill: rgba(214, 233, 111, 0.18);
  stroke: none;
}

.empty-sparkline {
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
}

.emphasis-grid,
.drive-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.drive-summary {
  display: grid;
  gap: 12px;
  margin-bottom: 10px;
}

.three-column {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.source-stage-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.source-stage-column {
  min-width: 0;
}

.source-stage-column h3 {
  margin: 0 0 6px;
  color: var(--leaf-800);
  font-size: 13px;
  text-transform: uppercase;
}

.source-table table {
  table-layout: fixed;
}

.source-table th,
.source-table td {
  padding: 8px 10px;
  line-height: 1.25;
}

.source-table th:last-child,
.source-table td:last-child {
  text-align: right;
}

.source-table td {
  overflow-wrap: anywhere;
}

.parse-throughput {
  display: grid;
  gap: 12px;
}

.parse-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.mini-kpi,
.parse-card {
  border: 1px solid var(--line);
  background: rgba(255, 255, 250, 0.62);
}

.mini-kpi {
  min-height: 92px;
  padding: 12px;
  border-radius: 12px;
}

.mini-kpi span,
.mini-kpi small,
.parse-card-head span {
  color: var(--muted);
}

.mini-kpi span {
  display: block;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.mini-kpi strong {
  display: block;
  margin: 6px 0 4px;
  color: var(--leaf-900);
  font-size: 24px;
  line-height: 1;
}

.mini-kpi small {
  font-size: 12px;
  line-height: 1.3;
}

.mini-kpi.warn {
  border-color: rgba(138, 79, 32, 0.28);
  background: rgba(255, 244, 224, 0.82);
}

.parse-throughput-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 14px;
  align-items: start;
}

.parse-card {
  min-width: 0;
  padding: 12px;
  border-radius: 14px;
}

.parse-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.parse-card-head h3 {
  margin: 0;
  color: var(--leaf-800);
  font-size: 13px;
  text-transform: uppercase;
}

.parse-card-head span {
  flex: 0 0 auto;
  font-size: 12px;
}

.source-movement-table {
  display: grid;
  gap: 0;
}

.movement-head,
.movement-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) repeat(4, minmax(58px, 74px));
  gap: 10px;
  align-items: center;
}

.movement-head {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  color: var(--leaf-800);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.movement-head span:not(:first-child),
.movement-row span {
  justify-self: end;
}

.movement-row {
  min-height: 38px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}

.movement-row:last-child {
  border-bottom: 0;
}

.movement-row strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.count-pill {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(229, 240, 218, 0.86);
  color: var(--leaf-900);
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.count-pill.good {
  background: rgba(218, 239, 214, 0.92);
  color: #1f5d2e;
}

.count-pill.warn {
  background: #fff2d6;
  color: #7a3d18;
}

.failure-list {
  display: grid;
}

.failure-row {
  display: grid;
  gap: 5px;
  min-height: 52px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.failure-row:last-child {
  border-bottom: 0;
}

.failure-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}

.failure-meta strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.failure-meta span,
.failure-meta b {
  font-size: 12px;
}

.failure-meta span {
  color: #7a3d18;
}

.failure-meta b {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 24px;
  border-radius: 999px;
  background: #fff2d6;
  color: #7a3d18;
}

.failure-row p {
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-card,
.panel,
.subpanel {
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 250, 0.82);
  box-shadow: 0 16px 46px rgba(39, 67, 37, 0.08);
  backdrop-filter: blur(14px);
}

.lane-card,
.metric-card {
  border: 1px solid var(--line);
  background: rgba(255, 255, 250, 0.58);
}

.summary-card {
  min-height: 116px;
  padding: 14px;
  border-radius: 12px;
  border-left: 4px solid var(--leaf-200);
}

.lane-card,
.metric-card {
  min-height: 96px;
  padding: 14px;
  border-radius: 12px;
}

.lane-card span,
.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.lane-card strong,
.metric-card strong {
  display: block;
  margin: 8px 0 5px;
  color: var(--leaf-900);
  font-size: 24px;
}

.lane-card small,
.metric-card small {
  color: var(--muted);
  line-height: 1.35;
}

.summary-card.warn {
  border-left-color: #f0b45d;
}

.summary-card.good {
  border-left-color: var(--leaf-600);
}

.summary-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.summary-card-head i {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--leaf-600);
  box-shadow: 0 0 0 4px rgba(71, 120, 62, 0.12);
}

.summary-card.warn .summary-card-head i {
  background: #c97b2a;
  box-shadow: 0 0 0 4px rgba(201, 123, 42, 0.14);
}

.summary-card.neutral .summary-card-head i {
  background: var(--lime);
  box-shadow: 0 0 0 4px rgba(214, 233, 111, 0.22);
}

.summary-card-head span,
.summary-card small {
  display: block;
  color: var(--muted);
}

.summary-card-head span {
  overflow: hidden;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.summary-card strong {
  display: block;
  margin: 6px 0;
  color: var(--ink);
  font-size: 25px;
  line-height: 1.1;
}

.summary-card small {
  font-size: 12px;
  line-height: 1.35;
}

.panel {
  margin-top: 16px;
  padding: 20px;
  border-radius: 18px;
}

.panel-head {
  justify-content: space-between;
  margin-bottom: 16px;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.two-column > .empty {
  grid-column: 1 / -1;
}

.subpanel {
  padding: 14px;
  border-radius: 14px;
}

.subpanel h3 {
  margin-bottom: 10px;
}

.notice {
  margin-bottom: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(49, 95, 50, 0.18);
  border-radius: 12px;
  background: rgba(237, 247, 221, 0.78);
  color: var(--leaf-900);
}

.notice.neutral {
  border-color: rgba(138, 79, 32, 0.2);
  background: rgba(255, 242, 214, 0.68);
}

.notice.warn {
  border-color: rgba(138, 79, 32, 0.36);
  background: rgba(255, 228, 198, 0.82);
}

.notice p {
  margin: 0;
  line-height: 1.45;
}

.notice p + p {
  margin-top: 6px;
}

.mono-block {
  width: 100%;
  min-height: 210px;
  max-height: 480px;
  overflow: auto;
  margin: 0;
  padding: 14px;
  border: 1px solid rgba(214, 233, 111, 0.18);
  border-radius: 12px;
  background: #10180f;
  color: #eaf7dc;
  font: 12px/1.55 "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  white-space: pre-wrap;
}

.mono-block.compact {
  min-height: 190px;
}

.mono-block.log {
  min-height: 380px;
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  width: 220px;
  color: var(--leaf-700);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.shell-explore {
  width: min(1680px, 100%);
}

.viz-staleness-banner {
  grid-column: 1 / -1;
  margin-bottom: 2px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(180, 120, 20, 0.45);
  background: rgba(255, 244, 214, 0.95);
  color: #5c3d00;
  font-size: 0.92rem;
  line-height: 1.45;
}

.hero-compact {
  min-height: 108px;
  padding: 20px 24px;
}

.viz-workspace {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(280px, 3fr);
  gap: 18px;
  align-items: stretch;
}

.viz-map-pane {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 720px;
}

.viz-filters-host {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.viz-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.viz-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.viz-chip,
.viz-chip-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.viz-chip em {
  color: var(--muted);
  font-style: normal;
  font-size: 11px;
}

.viz-chip input,
.viz-chip-toggle input {
  accent-color: var(--leaf-700);
}

.viz-search {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 220px;
  flex: 1;
}

.viz-search span {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--leaf-700);
}

.viz-search input {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
}

.viz-hint,
.viz-lod-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.viz-canvas {
  position: relative;
  flex: 1;
  min-height: 560px;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(236, 245, 223, 0.42));
}

.viz-sidebar {
  min-height: 720px;
  overflow: auto;
}

.viz-sidebar-inner {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.viz-sidebar-sub {
  margin: 0;
  color: var(--muted);
}

.viz-sidebar-meta {
  display: grid;
  gap: 8px;
}

.viz-sidebar-meta div {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.viz-sidebar-meta dt {
  margin: 0;
  color: var(--leaf-700);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.viz-sidebar-meta dd {
  margin: 0;
  word-break: break-word;
}

.viz-neighbors h3,
.viz-manifest-panel h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.viz-neighbor-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.viz-neighbor-list button {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
}

.viz-neighbor-list button strong {
  display: block;
  font-size: 13px;
}

.viz-neighbor-list button span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.viz-neighbor-list .muted {
  color: var(--muted);
  font-size: 13px;
}

.viz-chunk-text-body {
  margin: 0;
  max-height: 220px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.viz-semantic-neighbors h3 {
  color: var(--leaf-700);
}

.viz-manifest-summary dl {
  margin: 0;
  display: grid;
  gap: 8px;
}

.viz-manifest-summary dt {
  color: var(--leaf-700);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.viz-manifest-summary dd {
  margin: 0 0 8px;
  font-size: 13px;
}

.viz-tooltip {
  font-size: 12px;
  line-height: 1.4;
}

@media (max-width: 1080px) {
  .viz-workspace {
    grid-template-columns: 1fr;
  }

  .viz-map-pane,
  .viz-sidebar {
    min-height: auto;
  }

  .viz-canvas {
    min-height: 420px;
  }
}

.progress-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.progress-card {
  min-height: 118px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.54);
}

.progress-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.progress-top span {
  color: var(--leaf-700);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.progress-top strong {
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
}

.progress-bar {
  height: 8px;
  margin: 14px 0 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(49, 95, 50, 0.11);
}

.progress-bar div {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--leaf-700), var(--lime));
}

.progress-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.section-label {
  margin: 18px 0 8px;
  color: var(--leaf-700);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.compact-table {
  margin-bottom: 8px;
}

.movement-table table {
  table-layout: fixed;
}

.movement-table th:nth-child(1),
.movement-table td:nth-child(1) {
  width: 15%;
  font-weight: 800;
}

.movement-table th:nth-child(2),
.movement-table td:nth-child(2),
.movement-table th:nth-child(3),
.movement-table td:nth-child(3),
.movement-table th:nth-child(5),
.movement-table td:nth-child(5),
.movement-table th:nth-child(6),
.movement-table td:nth-child(6) {
  width: 10%;
  white-space: nowrap;
}

.movement-table th:nth-child(4),
.movement-table td:nth-child(4) {
  width: 19%;
  white-space: nowrap;
}

.movement-table th:nth-child(7),
.movement-table td:nth-child(7) {
  width: 26%;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--leaf-700);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

td {
  color: #263226;
}

tr:last-child td {
  border-bottom: 0;
}

.tabs {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.tabs button {
  min-height: 44px;
  padding: 0 13px;
  color: var(--muted);
}

.tabs button.active {
  border-color: transparent;
  background: var(--leaf-800);
  color: #ffffff;
}

.muted,
.empty {
  color: var(--muted);
  font-size: 13px;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.04);
  }
}

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

@media (max-width: 1180px) {
  .summary-grid,
  .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .progress-grid,
  .trend-grid,
  .lane-grid,
  .parse-kpis,
  .parse-throughput-grid,
  .source-stage-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .shell {
    padding: 14px;
  }

  .hero,
  .gate-panel,
  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar,
  .tabs {
    justify-content: flex-start;
  }

  .summary-grid,
  .lane-grid,
    .metric-grid,
    .progress-grid,
    .trend-grid,
    .three-column,
  .drive-summary,
  .parse-kpis,
  .parse-throughput-grid,
  .source-stage-grid,
  .two-column {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .movement-head,
  .movement-row {
    grid-template-columns: minmax(82px, 1fr) repeat(4, minmax(38px, 46px));
    gap: 6px;
  }

  .movement-head {
    font-size: 9px;
  }

  .count-pill {
    min-width: 30px;
    padding: 0 5px;
    font-size: 11px;
  }
}

/* Top-of-page status bar + consolidated alerts (split pipeline dashboard) */
.summary-grid > .span-full {
  grid-column: 1 / -1;
}

.statusbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--cream);
  border: 1px solid var(--line);
  border-left: 5px solid var(--leaf-600);
}

.statusbar.warn {
  border-left-color: #e0a23a;
}

.statusbar.neutral {
  border-left-color: #7fa8cf;
}

.statusbar-main {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.statusbar-badge {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 999px;
  color: var(--leaf-900);
  background: var(--leaf-200);
}

.statusbar-badge.warn {
  background: #f6dca6;
  color: #5b3d12;
}

.statusbar-badge.neutral {
  background: #d7e6f3;
  color: #244157;
}

.statusbar-note {
  color: var(--ink);
  font-size: 14px;
}

.statusbar-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

.alerts-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* 5-stage pipeline flow strip (replaces 18-card summary grid) */
.flow-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.flow-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--cream);
  border: 1px solid var(--line);
  border-top: 4px solid var(--leaf-400);
  min-height: 148px;
}

.flow-stage.warn {
  border-top-color: #e0a23a;
}

.flow-stage.good {
  border-top-color: var(--leaf-600);
}

.flow-stage.neutral {
  border-top-color: #9eb8c8;
}

.flow-stage-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.flow-stage-short {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--leaf-200);
  color: var(--leaf-900);
  font-size: 11px;
  font-weight: 800;
}

.flow-stage-name {
  font-weight: 700;
  font-size: 13px;
  flex: 1;
}

.flow-status-chip {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e8eef2;
  color: #3d5566;
}

.flow-status-chip.good {
  background: var(--leaf-200);
  color: var(--leaf-900);
}

.flow-status-chip.warn {
  background: #f6dca6;
  color: #5b3d12;
}

.flow-backlog {
  font-size: 24px;
  line-height: 1.1;
}

.flow-backlog-label,
.flow-detail,
.flow-last {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.flow-metrics {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  font-weight: 600;
}

.flow-arrow {
  display: none;
}

.legal-units-panel {
  margin-top: 12px;
}

.legal-units-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 8px;
}

.legal-units-head span {
  font-weight: 700;
}

.legal-units-head small {
  color: var(--muted);
  font-size: 12px;
}

.legal-units-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}

.legal-unit-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
}

.legal-unit-card.good {
  border-left: 4px solid var(--leaf-600);
}

.legal-unit-card.warn {
  border-left: 4px solid #e0a23a;
}

.legal-unit-card.neutral {
  border-left: 4px solid #c5d0d8;
}

.legal-unit-kind {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.legal-unit-card strong {
  font-size: 13px;
}

.legal-unit-card small {
  color: var(--muted);
  font-size: 12px;
}

.metric-grid > .span-full,
.host-metrics > .span-full {
  grid-column: 1 / -1;
}

@media (max-width: 1100px) {
  .flow-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .flow-strip {
    grid-template-columns: 1fr;
  }
}
