:root {
  --bg: #f4f6f1;
  --bg-strong: #e9f0ea;
  --surface: #ffffff;
  --surface-muted: #f7faf7;
  --ink: #18231f;
  --muted: #617168;
  --line: #d7e2db;
  --line-strong: #bccbc2;
  --green: #2f6f57;
  --teal: #0f766e;
  --blue: #365f8c;
  --amber: #a66716;
  --red: #a6423d;
  --violet: #6656a7;
  --shadow: 0 18px 42px rgba(24, 35, 31, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  letter-spacing: 0;
  font-size: 14px;
}

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

button,
input {
  font: inherit;
}

.workspace {
  min-height: 100vh;
  background:
    linear-gradient(120deg, rgba(47, 111, 87, 0.08), transparent 34%),
    linear-gradient(180deg, #fbfcf7 0%, var(--bg) 56%, #eef3ef 100%);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(210px, auto) minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 58px;
  padding: 8px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-grid;
  grid-template-columns: 36px 1fr;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--green), var(--blue));
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand strong {
  font-size: 14px;
}

.brand small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 11px;
}

.page-tabs {
  display: flex;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.page-tabs a {
  flex: 0 0 auto;
  padding: 8px 11px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.page-tabs a:hover,
.page-tabs a:focus-visible {
  border-color: var(--line);
  color: var(--ink);
  background: var(--surface-muted);
  outline: none;
}

.page-tabs a.is-active {
  color: #ffffff;
  background: var(--ink);
}

.operator-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: max-content;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface);
  font-size: 13px;
  font-weight: 700;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--muted);
}

.status-dot.ok {
  background: #1ea06b;
}

.status-dot.caution {
  background: #d3901f;
}

.status-dot.stop {
  background: var(--red);
}

.content {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 14px 24px 28px;
}

.page-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: end;
  margin-bottom: 12px;
}

.compact-title {
  align-items: center;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--green);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 880px;
  margin-bottom: 6px;
  font-size: 34px;
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 17px;
  line-height: 1.2;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 6px;
  font-size: 15px;
  line-height: 1.3;
  letter-spacing: 0;
}

.lead {
  max-width: 780px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.title-actions,
.inline-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.button,
.link-button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 7px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  cursor: pointer;
  font-weight: 800;
}

.button:hover,
.link-button:hover,
.button:focus-visible,
.link-button:focus-visible {
  border-color: var(--green);
  outline: none;
}

.button.primary {
  border-color: var(--green);
  color: #ffffff;
  background: var(--green);
}

.button.small {
  min-height: 30px;
  padding: 6px 9px;
  font-size: 13px;
}

.link-button {
  min-height: 34px;
  color: var(--green);
  background: transparent;
  font-size: 13px;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.status-strip div,
.metric-tile,
.panel,
.arch-node {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.status-strip div {
  padding: 10px 12px;
}

.label,
.metric-label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.status-strip strong {
  font-size: 13px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.overview-action-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.action-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.action-card strong,
.action-card p {
  display: block;
  margin: 0;
}

.action-card p {
  color: var(--muted);
  line-height: 1.35;
}

.metric-tile {
  min-height: 92px;
  padding: 12px;
}

.metric-value {
  display: block;
  margin-bottom: 5px;
  font-size: 28px;
  font-weight: 850;
  line-height: 1;
}

.metric-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

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

.span-4 {
  grid-column: span 4;
}

.span-5 {
  grid-column: span 5;
}

.span-6 {
  grid-column: span 6;
}

.span-7 {
  grid-column: span 7;
}

.span-8 {
  grid-column: span 8;
}

.span-12 {
  grid-column: span 12;
}

.panel {
  padding: 12px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.pill {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--muted);
  background: #edf1ef;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.pill.green {
  color: var(--green);
  background: #e4f3ea;
}

.pill.blue {
  color: var(--blue);
  background: #e7eef7;
}

.pill.amber {
  color: var(--amber);
  background: #fff1d8;
}

.pill.red {
  color: var(--red);
  background: #fbe3e1;
}

.data-table {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}

.data-row {
  display: grid;
  grid-template-columns: 86px minmax(150px, 1.2fr) minmax(130px, 1fr) 110px minmax(150px, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 52px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

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

.data-row.header {
  min-height: 34px;
  color: var(--muted);
  background: var(--surface-muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.data-row.compact-row {
  grid-template-columns: 76px minmax(160px, 1.2fr) minmax(100px, 0.8fr) auto;
}

.data-row strong,
.wait-card strong {
  display: block;
  margin-bottom: 4px;
}

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

.status {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  align-items: center;
  justify-content: center;
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--muted);
  background: #eef1ef;
  font-size: 12px;
  font-weight: 850;
}

.status.confirmed {
  color: var(--green);
  background: #e4f3ea;
}

.status.open {
  color: var(--amber);
  background: #fff1d8;
}

.status.risk {
  color: var(--red);
  background: #fbe3e1;
}

.proposal-summary {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.time-block {
  display: grid;
  min-height: 86px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #f9fbf7, #e9f2eb);
  text-align: center;
}

.time-block strong {
  display: block;
  font-size: 26px;
}

.time-block span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.activity-list,
.waitlist-stack,
.timeline,
.approval-grid {
  display: grid;
  gap: 8px;
}

.activity-item,
.wait-card,
.timeline-step,
.approval-card,
.scenario,
.risk-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.activity-item {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 10px;
  padding: 9px;
}

.activity-item time {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.activity-item p,
.wait-card p,
.timeline-step p,
.scenario span,
.risk-state p,
.note-box {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.wait-card {
  padding: 10px;
}

.wait-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.wait-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 8px 0;
}

.wait-meta span {
  padding: 5px 7px;
  border-radius: 999px;
  color: var(--muted);
  background: #edf2ee;
  font-size: 12px;
  font-weight: 750;
}

.rule-row,
.scenario-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.rule-row div {
  min-height: 88px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.rule-row strong,
.rule-row span,
.scenario strong,
.scenario span {
  display: block;
}

.rule-row span {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.5;
}

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

.timeline-step.is-active {
  border-color: var(--green);
  background: #f1f8f3;
}

.timeline-time {
  color: var(--green);
  font-weight: 850;
}

.risk-meter {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eee9;
}

.risk-fill {
  height: 100%;
  width: var(--risk-width);
  background: linear-gradient(90deg, var(--green), var(--amber), var(--red));
}

.risk-state {
  margin-top: 10px;
  padding: 10px;
}

.segmented,
.team-state {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

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

.segmented button,
.team-state button {
  min-height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  cursor: pointer;
  font-weight: 850;
}

.segmented button.is-active,
.team-state button.is-active {
  border-color: var(--green);
  color: #ffffff;
  background: var(--green);
}

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

.scenario {
  padding: 10px;
}

.scenario span {
  margin-top: 8px;
}

.proposal-detail {
  display: grid;
  gap: 9px;
}

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

.proposal-grid div {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

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

.approval-card {
  padding: 10px;
}

.approval-card.is-approved {
  border-color: var(--green);
  background: #f0f8f3;
}

.approval-card .button {
  width: 100%;
  margin-top: 9px;
}

.note-box {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.architecture-map {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) 44px minmax(190px, 1fr) 44px minmax(190px, 1fr) 44px minmax(190px, 1fr);
  align-items: center;
  margin-bottom: 18px;
}

.arch-node {
  min-height: 118px;
  padding: 13px;
}

.arch-node span,
.arch-node small {
  display: block;
  color: var(--muted);
}

.arch-node span {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.arch-node strong {
  display: block;
  margin-bottom: 6px;
  font-size: 17px;
  line-height: 1.25;
}

.primary-node {
  color: #ffffff;
  background: linear-gradient(135deg, var(--green), var(--blue));
}

.primary-node span,
.primary-node small {
  color: rgba(255, 255, 255, 0.8);
}

.arch-line {
  height: 2px;
  background: var(--line-strong);
}

.check-list {
  display: grid;
  gap: 11px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.check-list li {
  position: relative;
  padding-left: 28px;
  line-height: 1.5;
}

.check-list li::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 0;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--green);
}

.check-list.strict li::before {
  background: var(--amber);
}

body[data-page="overview"] .content {
  padding-top: 10px;
}

body[data-page="overview"] h1 {
  font-size: 30px;
}

body[data-page="overview"] .lead {
  line-height: 1.35;
}

body[data-page="overview"] .status-strip div {
  padding: 8px 10px;
}

body[data-page="overview"] .metric-tile {
  min-height: 78px;
  padding: 10px;
}

body[data-page="overview"] .metric-value {
  font-size: 24px;
}

body[data-page="overview"] .metric-note {
  line-height: 1.25;
}

body[data-page="overview"] .action-card {
  min-height: 50px;
  padding: 8px 10px;
}

body[data-page="overview"] .panel {
  padding: 10px;
}

body[data-page="overview"] .data-row.compact-row {
  min-height: 45px;
  padding: 7px 9px;
}

@media (max-width: 1120px) {
  .topbar {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .page-tabs {
    justify-content: flex-start;
  }

  .operator-chip {
    width: fit-content;
  }

  .page-title,
  .status-strip,
  .metric-grid,
  .overview-action-row,
  .architecture-map {
    grid-template-columns: 1fr;
  }

  .arch-line {
    width: 2px;
    height: 28px;
    margin-left: 22px;
  }

  .title-actions {
    justify-content: flex-start;
  }

  .span-4,
  .span-5,
  .span-6,
  .span-7,
  .span-8 {
    grid-column: span 12;
  }

  .rule-row,
  .scenario-grid,
  .approval-grid,
  .proposal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .content,
  .topbar {
    padding-left: 16px;
    padding-right: 16px;
  }

  h1 {
    font-size: 32px;
  }

  .data-row,
  .data-row.compact-row,
  .timeline-step,
  .proposal-summary,
  .action-card {
    grid-template-columns: 1fr;
  }

  .data-row.header {
    display: none;
  }

  .segmented,
  .rule-row,
  .scenario-grid,
  .approval-grid,
  .proposal-grid {
    grid-template-columns: 1fr;
  }

  .panel-header {
    display: grid;
  }
}
