:root {
  --bg: #f4efe6;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-border: rgba(31, 51, 43, 0.14);
  --text: #173028;
  --muted: #5b6f66;
  --accent: #b9562b;
  --accent-soft: rgba(185, 86, 43, 0.12);
  --safe: #2e8878;
  --safe-soft: rgba(46, 136, 120, 0.14);
  --warn: #c77b21;
  --warn-soft: rgba(199, 123, 33, 0.16);
  --danger: #a03333;
  --danger-soft: rgba(160, 51, 51, 0.16);
  --demo: #2e8878;
  --live: #a03333;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(185, 86, 43, 0.14), transparent 30%),
    radial-gradient(circle at bottom right, rgba(46, 136, 120, 0.16), transparent 32%),
    var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

pre {
  margin: 0;
  padding: 14px;
  overflow-x: auto;
  border-radius: 14px;
  background: rgba(23, 48, 40, 0.06);
  font-size: 0.85rem;
}

.shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 36px 24px 72px;
}

.masthead {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 28px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  font-size: 0.75rem;
}

h1 {
  margin: 0 0 12px;
  font-size: clamp(2.6rem, 5vw, 4.6rem);
  line-height: 0.95;
}

h2,
h3 {
  margin: 0 0 12px;
}

.lede,
.section-copy,
.muted,
.hero-summary {
  color: var(--muted);
}

.topnav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.topnav a {
  padding: 10px 14px;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}

.topnav a.active {
  background: var(--text);
  color: white;
}

.notice {
  width: fit-content;
  margin: 0 0 18px;
  padding: 10px 14px;
  border-radius: 14px;
}

.notice.success {
  background: var(--safe-soft);
}

.notice.error {
  background: var(--danger-soft);
}

.hero-grid,
.overview-grid,
.automation-grid,
.attention-grid,
.activity-grid,
.settings-layout,
.detail-grid {
  display: grid;
  gap: 16px;
}

.hero-grid {
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  margin-bottom: 28px;
}

.overview-grid,
.activity-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.automation-grid,
.attention-grid,
.settings-layout {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.detail-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.hero-card,
.panel,
.pipeline-card {
  padding: 22px;
  border: 1px solid var(--panel-border);
  border-radius: 22px;
  background: var(--panel);
  backdrop-filter: blur(8px);
}

.hero-card.status-info {
  border-top: 5px solid var(--safe);
}

.hero-card.status-warning {
  border-top: 5px solid var(--warn);
}

.hero-card.status-critical {
  border-top: 5px solid var(--danger);
}

.section-block {
  margin-bottom: 28px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 14px;
}

.question-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
}

.metric-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 0;
}

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

.metric-list div {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(23, 48, 40, 0.05);
}

.metric-list dt {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric-list dd {
  margin: 0;
  font-weight: 700;
}

.value {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
}

.mode-pill,
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.mode-pill.demo {
  background: var(--safe-soft);
}

.mode-pill.live {
  background: var(--danger-soft);
}

.badge.info {
  background: var(--safe-soft);
}

.badge.warning {
  background: var(--warn-soft);
}

.badge.critical {
  background: var(--danger-soft);
}

.badge.muted {
  background: rgba(23, 48, 40, 0.08);
}

.control-layout {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr 1fr;
  gap: 16px;
}

.button-grid,
.button-stack {
  display: grid;
  gap: 10px;
}

.button-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.stack-form {
  display: grid;
  gap: 10px;
}

.compact-form {
  margin-top: 14px;
}

.stack-form label {
  display: grid;
  gap: 6px;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.95);
}

button {
  width: 100%;
  padding: 11px 14px;
  border: none;
  border-radius: 999px;
  background: var(--text);
  color: white;
  cursor: pointer;
}

button.danger {
  background: var(--danger);
}

.live-panel {
  border-top: 4px solid var(--danger);
}

.emergency-panel {
  border-top: 4px solid var(--warn);
}

.pipeline-summary,
.pipeline-columns {
  display: grid;
  gap: 16px;
}

.pipeline-summary {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  margin-bottom: 16px;
}

.pipeline-card.accent {
  border-top: 5px solid var(--accent);
}

.pipeline-columns {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.stack-list {
  display: grid;
  gap: 10px;
}

.stack-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(23, 48, 40, 0.05);
}

.stack-item.subdued {
  background: rgba(23, 48, 40, 0.035);
}

.stack-item p {
  margin: 4px 0 0;
  color: var(--muted);
}

.link-row:hover {
  background: rgba(185, 86, 43, 0.1);
}

.issue.warning {
  background: var(--warn-soft);
}

.issue.critical {
  background: var(--danger-soft);
}

.empty {
  margin: 0;
  color: var(--muted);
}

.text-link {
  color: var(--accent);
  font-weight: 600;
}

@media (max-width: 1100px) {
  .hero-grid,
  .control-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .shell {
    padding: 24px 16px 56px;
  }

  .masthead,
  .section-heading {
    flex-direction: column;
    align-items: start;
  }

  .metric-list.compact {
    grid-template-columns: 1fr 1fr;
  }
}
