@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Space+Grotesk:wght@500;700&display=swap');

:root {
  --bg: #12100e;
  --bg-strong: #1a1714;
  --surface: rgba(28, 25, 23, 0.95);
  --surface-strong: #26221f;
  --ink: #f4efe6;
  --muted: #9a9288;
  --line: rgba(255, 255, 255, 0.1);
  --accent: #e56b40;
  --accent-deep: #b24c26;
  --sage: #4ade80;
  --gold: #f59e0b;
  --danger: #f87171;
  --shadow: 0 20px 70px rgba(0, 0, 0, 0.5);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 14px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Inter", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(229, 107, 64, 0.08), transparent 28%),
    radial-gradient(circle at top right, rgba(74, 222, 128, 0.05), transparent 24%),
    var(--bg);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.7), transparent 88%);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -52px;
  z-index: 10;
  padding: 12px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
}

.skip-link:focus {
  top: 16px;
}

.app-shell {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 64px;
}

.app-shell.setup-complete {
  padding-bottom: 120px;
}

.app-shell.setup-complete .hero {
  display: none;
}

.hero,
.flow-grid,
.connector-grid,
.schema-grid,
.planner-grid,
.schedule-layout,
.monitor-strip,
.dashboard-grid {
  display: grid;
  gap: 24px;
}

.app-view {
  display: none;
  animation: fadeIn 0.3s ease;
}

.app-view.active {
  display: block;
}

.setup-settings-detail {
  display: grid;
  gap: 24px;
}

.app-shell:not(.setup-complete) .setup-settings-detail {
  display: none;
}

.setup-tunnel {
  padding: 32px;
}

.setup-container {
  padding: 32px;
}

.setup-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.wizard-step {
  display: none;
  padding: 24px 0 0;
}

.wizard-step.active {
  display: block;
  animation: slideIn 0.3s ease;
}

.wizard-step > .chip-group,
.wizard-step > .instruction-list,
.wizard-step > .benefit-block,
.wizard-step > .wizard-actions,
.wizard-step > .setup-step-cta,
.wizard-step > .wizard-field {
  margin-top: 18px;
}

.wizard-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.wizard-field {
  max-width: 240px;
}

#view-setup.settings-mode .setup-header {
  gap: 12px;
}

#view-setup.settings-mode .progress-bar,
#view-setup.settings-mode .wizard-actions,
#view-setup.settings-mode .setup-step-cta,
#view-setup.settings-mode #complete-setup-btn {
  display: none;
}

#view-setup.settings-mode .wizard-step {
  display: block;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  animation: none;
}

#view-setup.settings-mode .wizard-step:first-of-type {
  border-top: 0;
}

.progress-bar {
  height: 6px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  width: 33.333%;
  height: 100%;
  background: var(--accent);
  transition: width 0.3s ease;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-around;
  gap: 12px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(18, 16, 14, 0.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(16px);
  z-index: 100;
}

.bottom-nav[hidden] {
  display: none;
}

.nav-tab {
  flex: 1;
  min-height: 48px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
}

.nav-tab.active {
  color: var(--ink);
  background: rgba(229, 107, 64, 0.16);
  border-color: rgba(229, 107, 64, 0.24);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.hero {
  grid-template-columns: 1.35fr 0.95fr;
  align-items: stretch;
  margin-bottom: 26px;
}

.hero-copy {
  padding: 34px 8px 34px 0;
}

.eyebrow,
.panel-label,
.mini-label,
.status-stamp {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(169, 118, 26, 0.12);
  color: var(--gold);
  border: 1px solid rgba(169, 118, 26, 0.2);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.badge.danger {
  background: rgba(151, 50, 45, 0.12);
  color: var(--danger);
  border: 1px solid rgba(151, 50, 45, 0.25);
  animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
  0% {
    box-shadow: 0 0 0 0 rgba(151, 50, 45, 0.4);
  }

  70% {
    box-shadow: 0 0 0 6px rgba(151, 50, 45, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(151, 50, 45, 0);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(10px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.eyebrow,
.panel-label {
  color: var(--accent);
  font-weight: 700;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.02;
}

h1,
h2 {
  font-family: "Space Grotesk", monospace;
  font-weight: 700;
}

h1,
h2,
h3,
.metric-value,
.status-value,
.spark-value {
  font-family: "Space Grotesk", monospace;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h1 {
  max-width: 10.5ch;
  margin-top: 8px;
  font-size: clamp(3.1rem, 7vw, 6rem);
}

h2 {
  font-size: clamp(1.95rem, 3vw, 2.7rem);
}

h3 {
  font-size: 1.08rem;
}

p {
  margin: 0;
  line-height: 1.58;
}

.lede,
.panel-note,
.column-header p,
.dashboard-subhead,
.flow-card p {
  color: var(--muted);
}

.lede {
  max-width: 60ch;
  margin: 18px 0 24px;
  font-size: 1.05rem;
}

.hero-actions,
.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

button,
select,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  transition:
    transform 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease;
}

.primary-button:hover,
.secondary-button:hover,
.chip:hover {
  transform: translateY(-1px);
}

.primary-button {
  background: var(--accent);
  color: #fff7f0;
  box-shadow: var(--shadow);
}

.primary-button:hover,
.primary-button:focus-visible {
  background: var(--accent-deep);
}

.secondary-button {
  background: var(--surface-strong);
  border-color: var(--line);
  color: var(--ink);
}

.secondary-button:hover,
.secondary-button:focus-visible {
  background: #332d29;
}

.compact {
  min-height: 42px;
  padding: 0 16px;
}

.card,
.data-card,
.metric-card,
.flow-card {
  border: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.card,
.panel {
  border-radius: var(--radius-xl);
}

.hero-status,
.panel {
  padding: 24px;
}

.status-header,
.panel-header,
.data-card-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.status-stamp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.connection-badge {
  display: inline-flex;
  min-width: 72px;
  justify-content: center;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.connection-badge.connected {
  color: var(--sage);
  border-color: rgba(74, 222, 128, 0.45);
  background: rgba(74, 222, 128, 0.12);
}

.connection-badge.degraded {
  color: var(--gold);
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.16);
}

.connection-badge.disconnected {
  color: var(--danger);
  border-color: rgba(248, 113, 113, 0.5);
  background: rgba(248, 113, 113, 0.14);
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.status-grid div,
.metric-card {
  position: relative;
  overflow: hidden;
}

.status-grid div::before,
.metric-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), transparent 60%);
}

.status-value {
  display: block;
  font-size: 1.35rem;
  font-weight: 700;
}

.status-value.accent {
  color: var(--accent);
}

.status-label,
.metric-label,
.metric-trend,
.benefit-block,
.instruction-list,
.summary-list,
.timeline-item p {
  color: var(--muted);
}

.panel {
  margin-top: 24px;
}

.flow-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 28px;
}

.flow-card,
.setup-column,
.planner-column,
.data-card {
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(31, 28, 26, 0.96);
}

.flow-step {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  border-radius: 999px;
  background: rgba(178, 76, 38, 0.12);
  color: var(--accent-deep);
  font-weight: 700;
}

.flow-card p,
.column-header {
  margin-top: 10px;
}

.connector-grid,
.planner-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 28px;
}

.schema-grid,
.schedule-layout {
  grid-template-columns: 1.1fr 0.9fr;
  margin-top: 20px;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0;
}

.chip {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(35, 31, 28, 0.95);
  color: var(--ink);
}

.chip[aria-checked="true"] {
  border-color: rgba(229, 107, 64, 0.42);
  background: rgba(229, 107, 64, 0.18);
  color: var(--ink);
}

.instruction-list,
.summary-list,
.trust-list {
  padding-left: 18px;
}

.instruction-list {
  margin: 16px 0 0;
}

.instruction-list li + li,
.summary-list li + li,
.trust-list li + li {
  margin-top: 10px;
}

.benefit-block,
.planner-metric,
.schema-row,
.trigger-item,
.approval-card,
.table-row,
.schedule-row {
  border-radius: var(--radius-md);
  background: rgba(18, 16, 14, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.approval-card {
  margin-top: 18px;
  padding: 14px;
}

.approval-status {
  display: grid;
  gap: 6px;
}

.approval-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 16px 0 12px;
}

.approval-callout {
  display: block;
  margin-bottom: 4px;
  color: var(--accent);
}

.benefit-block {
  margin-top: 18px;
  padding: 14px 16px;
}

.csv-upload-zone {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: rgba(18, 16, 14, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.csv-upload-note,
.csv-schema-status,
.csv-upload-title,
.csv-preview-header {
  color: var(--muted);
}

.csv-upload-label {
  display: grid;
  gap: 8px;
}

.csv-upload-label input[type="file"] {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px dashed rgba(229, 107, 64, 0.34);
  background: rgba(35, 31, 28, 0.95);
  color: var(--ink);
}

.csv-schema-status.good {
  color: var(--sage);
}

.csv-schema-status.danger {
  color: var(--danger);
}

.csv-preview-grid,
.csv-mapper-grid {
  display: grid;
  gap: 10px;
}

.csv-preview-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(35, 31, 28, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.csv-preview-value {
  text-align: right;
}

.schema-block,
.trigger-list,
.section-table,
.schedule-table,
.timeline {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.schema-row,
.trigger-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
}

.schema-row span,
.trigger-item span,
.table-head,
.schedule-head {
  color: var(--muted);
}

.form-grid,
.planner-metrics,
.metric-grid {
  display: grid;
  gap: 14px;
}

.form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 18px 0;
}

.field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.95rem;
}

.field span {
  color: var(--ink);
  font-weight: 500;
}

.field input,
.field select {
  min-height: 46px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(22, 19, 17, 0.98);
  color: var(--ink);
}

.emphasis-panel {
  background:
    linear-gradient(135deg, rgba(74, 222, 128, 0.08), transparent 48%),
    rgba(31, 28, 26, 0.98);
}

.planner-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.planner-metric {
  padding: 14px;
}

.dashboard-subhead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 20px 0 18px;
}

.monitor-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 18px;
}

.strip-card {
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.05), transparent 55%),
    rgba(31, 28, 26, 0.95);
  box-shadow: var(--shadow);
}

.strip-card strong {
  display: block;
  margin: 8px 0 6px;
  font-size: 1.15rem;
}

.chart-hint {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

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

.metric-card {
  padding: 18px;
  border-radius: var(--radius-lg);
}

.metric-value {
  display: block;
  margin: 8px 0 6px;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
}

.metric-trend.good,
.positive {
  color: var(--sage);
}

.metric-trend.warning,
.negative {
  color: var(--danger);
}

.dashboard-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 20px;
}

.action-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 48px 24px;
  background: var(--surface-strong);
  border-radius: var(--radius-xl);
  border: 2px solid rgba(178, 76, 38, 0.15);
  margin-top: 24px;
}

.action-headline {
  font-size: clamp(2.2rem, 5vw, 3rem);
  margin: 16px 0 8px;
  color: var(--ink);
}

.action-context {
  font-size: 1.2rem;
  color: var(--muted);
  max-width: 600px;
  margin-bottom: 24px;
}

.action-impact {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 32px;
  padding: 12px 24px;
  background: rgba(229, 107, 64, 0.08);
  border-radius: 999px;
}

.impact-metric {
  font-weight: 700;
  font-size: 1.1rem;
}

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

.action-controls {
  display: flex;
  gap: 16px;
  width: 100%;
  max-width: 500px;
  justify-content: center;
}

.giant {
  min-height: 64px;
  font-size: 1.2rem;
  padding: 0 32px;
  flex: 1;
}

.action-summary {
  max-width: 720px;
  margin-top: 24px;
  color: var(--muted);
}

.action-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  justify-content: center;
  margin-top: 18px;
}

.compact-statuses {
  font-size: 0.96rem;
}

.geek-mode {
  margin-top: 24px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: rgba(18, 16, 14, 0.94);
  border: 1px solid var(--line);
}

.geek-mode summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 500;
}

.geek-content {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.emphasis {
  background:
    linear-gradient(135deg, rgba(229, 107, 64, 0.16), transparent 45%),
    rgba(37, 31, 27, 0.98);
}

.wide {
  grid-column: span 2;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.badge {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(178, 76, 38, 0.12);
  color: var(--accent-deep);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.badge.subtle {
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
}

.schedule-day-cell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}

.schedule-day-cell small {
  flex-basis: 100%;
}

.override-badge {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  font-size: 0.65rem;
  padding: 3px 6px;
  border: 1px solid rgba(245, 158, 11, 0.28);
}

.danger-action {
  color: var(--danger);
  border-color: rgba(151, 50, 45, 0.3);
  background: rgba(151, 50, 45, 0.05);
}

.danger-action:hover,
.danger-action:focus-visible {
  background: rgba(151, 50, 45, 0.12);
  border-color: var(--danger);
}

.recommendation-type {
  margin-top: 18px;
  font-size: 1.2rem;
  font-weight: 700;
}

.recommendation-message {
  margin-top: 10px;
  font-size: 1rem;
}

.recommendation-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-top: 16px;
  color: var(--muted);
}

.table-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.9fr;
  gap: 12px;
  padding: 10px 12px;
}

.schedule-row {
  display: grid;
  grid-template-columns: 0.75fr 0.9fr 0.8fr 1.55fr 0.95fr;
  gap: 12px;
  padding: 12px;
}

.schedule-day-cell,
.schedule-demand-cell,
.schedule-hours-cell,
.schedule-role-cell,
.schedule-focus-cell {
  display: grid;
  gap: 4px;
}

.schedule-day-cell strong,
.schedule-demand-cell strong,
.schedule-hours-cell strong,
.schedule-role-cell strong {
  font-size: 0.98rem;
}

.token-rack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-start;
}

.shift-token,
.shift-note {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(38, 34, 31, 0.98);
  font-size: 0.85rem;
  line-height: 1.35;
}

.shift-token {
  cursor: grab;
  transition:
    transform 120ms ease,
    box-shadow 120ms ease,
    border-color 120ms ease,
    background-color 120ms ease;
}

.shift-token:hover {
  transform: translateY(-1px);
  border-color: rgba(178, 76, 38, 0.45);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
}

.shift-token:active,
.shift-token.dragging {
  cursor: grabbing;
}

.shift-token.dragging {
  opacity: 0.5;
}

.shift-token.drag-over {
  border-color: var(--accent);
  background: rgba(229, 107, 64, 0.16);
  box-shadow: 0 0 0 2px rgba(229, 107, 64, 0.18);
}

.unfilled-slot {
  background: rgba(248, 113, 113, 0.12);
  border: 1px dashed var(--danger);
  color: var(--danger);
  font-weight: 600;
  cursor: default;
}

.unfilled-slot.drag-over {
  background: rgba(248, 113, 113, 0.22);
  border-style: solid;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(248, 113, 113, 0.2);
}

.shift-note {
  color: var(--muted);
  background: rgba(28, 25, 23, 0.88);
}

.schedule-day-cell small,
.schedule-demand-cell small,
.schedule-hours-cell small,
.schedule-role-cell small,
.schedule-focus-cell {
  color: var(--muted);
}

.schedule-role-cell small {
  font-size: 0.82rem;
  line-height: 1.45;
}

.schedule-focus-cell {
  align-content: start;
  font-size: 0.92rem;
}

.schedule-row.proposed {
  border-color: rgba(169, 118, 26, 0.38);
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.12), rgba(26, 23, 20, 0.96));
}

.schedule-row.approved {
  border-color: rgba(39, 90, 77, 0.28);
  background: linear-gradient(90deg, rgba(74, 222, 128, 0.12), rgba(26, 23, 20, 0.96));
}

.schedule-row.held {
  border-color: rgba(151, 50, 45, 0.24);
  background: linear-gradient(90deg, rgba(248, 113, 113, 0.1), rgba(26, 23, 20, 0.96));
}

.table-head,
.schedule-head {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.schedule-legend {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.92rem;
}

.timeline-item {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 14px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.timeline-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.spark-chart,
.load-chart {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.spark-chart {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: end;
  min-height: 180px;
}

.spark-bar {
  display: flex;
  flex-direction: column;
  justify-content: end;
  gap: 8px;
  min-height: 180px;
}

.spark-column {
  border-radius: 14px 14px 6px 6px;
  min-height: 24px;
  background: linear-gradient(180deg, rgba(229, 107, 64, 0.95), rgba(229, 107, 64, 0.28));
}

.spark-column.good {
  background: linear-gradient(180deg, rgba(74, 222, 128, 0.95), rgba(74, 222, 128, 0.28));
}

.spark-column.warning {
  background: linear-gradient(180deg, rgba(248, 113, 113, 0.95), rgba(248, 113, 113, 0.28));
}

.spark-label {
  color: var(--muted);
  font-size: 0.82rem;
}

.spark-value {
  font-size: 0.88rem;
  font-weight: 700;
}

.load-row {
  display: grid;
  grid-template-columns: 110px 1fr 68px;
  gap: 12px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 160ms ease, transform 160ms ease;
}

.load-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.load-row.active {
  background: rgba(229, 107, 64, 0.12);
}

.load-name,
.load-value {
  font-size: 0.92rem;
}

.load-track {
  position: relative;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.load-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(74, 222, 128, 0.95), rgba(74, 222, 128, 0.42));
}

.load-fill.warning {
  background: linear-gradient(90deg, rgba(229, 107, 64, 0.95), rgba(229, 107, 64, 0.42));
}

.load-fill.danger {
  background: linear-gradient(90deg, rgba(248, 113, 113, 0.95), rgba(248, 113, 113, 0.42));
}

.drilldown-card {
  margin-top: 18px;
}

.drilldown-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.drilldown-head strong {
  font-size: 1.2rem;
}

.drilldown-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.table-row.is-clickable {
  cursor: pointer;
  transition: background-color 160ms ease, transform 160ms ease;
}

.table-row.is-clickable:hover {
  background: rgba(255, 255, 255, 0.04);
}

.table-row.is-clickable.active {
  background: rgba(229, 107, 64, 0.12);
}

.timeline-time {
  color: var(--accent);
  font-weight: 700;
}

.noscript-banner {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto 24px;
  padding: 14px 18px;
  border-radius: 16px;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.32);
  color: #fcd34d;
}

:focus-visible {
  outline: 3px solid rgba(229, 107, 64, 0.45);
  outline-offset: 3px;
}

@media (max-width: 1040px) {
  .hero,
  .flow-grid,
  .connector-grid,
  .schema-grid,
  .planner-grid,
  .schedule-layout,
  .monitor-strip,
  .metric-grid,
  .dashboard-grid,
  .dashboard-subhead,
  .planner-metrics,
  .drilldown-metrics {
    grid-template-columns: 1fr;
  }

  .wide {
    grid-column: auto;
  }
}

@media (max-width: 680px) {
  .app-shell {
    width: min(100% - 20px, 100%);
    padding-top: 20px;
  }

  .hero-status,
  .panel,
  .setup-column,
  .planner-column,
  .data-card,
  .flow-card,
  .metric-card {
    padding: 18px;
  }

  .status-grid,
  .form-grid,
  .table-row,
  .schedule-row,
  .timeline-item {
    grid-template-columns: 1fr;
  }

  h1 {
    max-width: none;
  }

  .action-hero {
    padding: 32px 18px;
  }

  .action-controls {
    flex-direction: column;
    max-width: none;
  }

  .giant {
    width: 100%;
  }

  .action-impact,
  .action-status-row {
    border-radius: var(--radius-lg);
  }
}
