:root {
  --navy: #0f2745;
  --ink: #1b2735;
  --muted: #5f6f82;
  --border: #d7dee8;
  --surface: #ffffff;
  --surface-soft: #f6f8fb;
  --focus: #1f6feb;
  --blue: #1d67b1;
  --green: #2f7d4f;
  --orange: #c26a22;
  --purple: #6750a4;
  --teal: #087f8c;
  --gold: #a97718;
  --shadow: 0 10px 30px rgba(15, 39, 69, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--surface-soft);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button, select { font: inherit; }

button { cursor: pointer; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  background: var(--navy);
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
}

.skip-link:focus { top: 1rem; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.5rem;
  align-items: center;
  padding: 1.1rem 1.5rem;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 3px 12px rgba(15, 39, 69, 0.05);
}

.eyebrow {
  margin: 0 0 0.25rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1, h2, h3 { color: var(--navy); line-height: 1.15; }

h1 { margin: 0; font-size: clamp(1.6rem, 2.8vw, 2.4rem); }

h2 { margin: 0 0 0.7rem; font-size: 1.25rem; }

h3 { margin: 0 0 0.45rem; font-size: 1rem; }

.subtitle { margin: 0.35rem 0 0; color: var(--muted); font-weight: 650; }

.header-status {
  display: grid;
  grid-template-columns: minmax(16rem, 1fr) 10rem auto;
  gap: 1rem;
  align-items: center;
}

.label {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.meter {
  height: 0.55rem;
  overflow: hidden;
  background: #e5ebf2;
  border-radius: 999px;
}

.meter span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--blue);
  border-radius: inherit;
  transition: width 180ms ease-out;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.55rem;
  border: 1px solid var(--blue);
  border-radius: 0.45rem;
  background: var(--blue);
  color: white;
  padding: 0.55rem 0.9rem;
  font-weight: 800;
}

.button:hover { filter: brightness(0.96); }

.button-secondary { background: white; color: var(--navy); border-color: var(--border); }

main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.25rem;
}

.principles-card, .guided-demo, .workspace, .context-panel, .activity-section, .stage-path {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.8rem;
  box-shadow: var(--shadow);
}

.principles-card {
  display: grid;
  grid-template-columns: 22rem 1fr;
  gap: 1rem;
  padding: 1rem;
}

.principles-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.principles-list li {
  border: 1px solid var(--border);
  border-left: 4px solid var(--blue);
  border-radius: 0.55rem;
  padding: 0.65rem;
  background: #fbfcfe;
  font-weight: 650;
}

.stage-path { margin-top: 1rem; padding: 0.75rem; overflow-x: auto; }

.stage-path ol {
  display: grid;
  grid-template-columns: repeat(7, minmax(9.5rem, 1fr));
  gap: 0.65rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stage-button {
  width: 100%;
  min-height: 7rem;
  border: 1px solid var(--border);
  border-top: 5px solid var(--stage-color);
  border-radius: 0.7rem;
  background: white;
  color: var(--ink);
  padding: 0.75rem;
  text-align: left;
}

.stage-button[aria-current="step"] {
  box-shadow: inset 0 0 0 2px var(--stage-color);
}

.stage-number {
  display: inline-grid;
  place-items: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 999px;
  background: var(--stage-color);
  color: white;
  font-weight: 900;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
  background: #eef2f7;
  color: var(--navy);
  font-size: 0.76rem;
  font-weight: 800;
}

.status-badge.complete { background: #e7f4ed; color: #17623b; }
.status-badge.in-progress { background: #eaf2fb; color: #1d5b9b; }
.status-badge.needs-review { background: #fff5df; color: #805500; }

.guided-demo {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-top: 1rem;
  padding: 1rem;
}

.guided-actions { display: flex; gap: 0.6rem; }

.workspace-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22rem;
  gap: 1rem;
  align-items: start;
  margin-top: 1rem;
}

.workspace, .context-panel, .activity-section { padding: 1rem; }

.stage-heading-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
}

.stage-purpose { max-width: 62rem; color: var(--muted); font-size: 1.02rem; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.info-card {
  border: 1px solid var(--border);
  border-radius: 0.7rem;
  background: #fbfcfe;
  padding: 1rem;
}

.record-list, .dependency-list, .activity-log { margin: 0; padding: 0; list-style: none; }

.record-list { display: grid; gap: 0.65rem; }

.record-list li {
  border: 1px solid var(--border);
  border-left: 4px solid var(--stage-color);
  border-radius: 0.55rem;
  background: white;
  padding: 0.75rem;
}

.record-meta { color: var(--muted); font-size: 0.9rem; }

.dependency-list li {
  display: flex;
  gap: 0.5rem;
  padding: 0.35rem 0;
}

.dependency-list li::before { content: '•'; color: var(--stage-color); font-weight: 900; }

.demo-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

.status-select {
  min-height: 2.55rem;
  border: 1px solid var(--border);
  border-radius: 0.45rem;
  padding: 0.45rem 0.65rem;
  background: white;
  color: var(--ink);
}

.placeholder-panel {
  margin-top: 1rem;
  border: 1px dashed #aeb8c5;
  border-radius: 0.7rem;
  padding: 1rem;
  background: #fcfdff;
}

.context-panel {
  position: sticky;
  top: 7.25rem;
}

.context-panel section + section {
  border-top: 1px solid var(--border);
  margin-top: 1rem;
  padding-top: 1rem;
}

.activity-section { margin-top: 1rem; }

.section-heading-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.activity-log { display: grid; gap: 0.65rem; margin-top: 0.85rem; }

.activity-log li {
  display: grid;
  grid-template-columns: 11rem 1fr;
  gap: 1rem;
  border: 1px solid var(--border);
  border-radius: 0.55rem;
  background: #fbfcfe;
  padding: 0.65rem;
}

.timestamp { color: var(--muted); font-size: 0.86rem; font-weight: 700; }

[data-accent="blue"] { --stage-color: var(--blue); }
[data-accent="green"] { --stage-color: var(--green); }
[data-accent="orange"] { --stage-color: var(--orange); }
[data-accent="purple"] { --stage-color: var(--purple); }
[data-accent="teal"] { --stage-color: var(--teal); }
[data-accent="gold"] { --stage-color: var(--gold); }
[data-accent="navy"] { --stage-color: var(--navy); }

@media (max-width: 1120px) {
  .app-header, .principles-card, .workspace-shell { grid-template-columns: 1fr; }
  .header-status { grid-template-columns: 1fr 10rem auto; }
  .context-panel { position: static; }
}

@media (max-width: 760px) {
  .header-status, .principles-list, .card-grid { grid-template-columns: 1fr; }
  .guided-demo, .stage-heading-row, .section-heading-row { align-items: stretch; flex-direction: column; }
  .activity-log li { grid-template-columns: 1fr; }
  main { padding: 0.75rem; }
}

.interactive-panel {
  margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: 0.7rem;
  padding: 1rem;
  background: #fcfdff;
}

.version-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 0.75rem 0 1rem;
}

.version-card {
  border: 1px solid var(--border);
  border-left: 4px solid var(--stage-color);
  border-radius: 0.65rem;
  padding: 1rem;
  background: white;
}

.version-card.selected {
  box-shadow: inset 0 0 0 2px var(--stage-color);
}

.version-card h4 { margin: 0 0 0.75rem; color: var(--navy); }
.version-card dl { display: grid; gap: 0.45rem; margin: 0 0 0.85rem; }
.version-card dt { color: var(--muted); font-size: 0.75rem; font-weight: 800; text-transform: uppercase; }
.version-card dd { margin: 0; }

.table-scroll {
  overflow-x: auto;
  margin: 0.75rem 0 1rem;
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  background: white;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 46rem;
}

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

th {
  background: #eef4fb;
  color: var(--navy);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

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

.notice, .summary-card {
  border: 1px solid var(--border);
  border-left: 4px solid var(--stage-color);
  border-radius: 0.65rem;
  padding: 0.85rem;
  background: #fbfcfe;
}

.summary-card {
  margin-top: 1rem;
  background: #f3f8ff;
}

.form-row, .filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  align-items: end;
  margin: 0.75rem 0;
}

.wide-input {
  width: 100%;
  min-height: 2.55rem;
  border: 1px solid var(--border);
  border-radius: 0.45rem;
  padding: 0.45rem 0.65rem;
  background: white;
  color: var(--ink);
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 800;
  padding: 0.15rem 0.35rem;
  text-decoration: underline;
}

@media (max-width: 760px) {
  .version-grid, .form-row, .filter-grid { grid-template-columns: 1fr; }
}

.tab-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.tab-button {
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: 0.55rem 0.55rem 0 0;
  background: #eef4fb;
  color: var(--navy);
  padding: 0.7rem 0.9rem;
  font-weight: 850;
}

.tab-button[aria-selected="true"] {
  background: white;
  box-shadow: inset 0 4px 0 var(--stage-color);
}

.tab-panel {
  display: grid;
  gap: 0.85rem;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.stage-three-panel table {
  min-width: 58rem;
}

.local-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.12rem 0.45rem;
  margin-right: 0.25rem;
  background: #f5e8ff;
  color: #56328a;
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.ready-hero {
  border: 2px solid var(--border);
  border-left: 0.55rem solid var(--stage-color);
  border-radius: 0.8rem;
  padding: 1rem;
  margin-bottom: 1rem;
  background: #fbfcfe;
}

.ready-hero strong {
  display: block;
  color: var(--navy);
  font-size: clamp(2.25rem, 6vw, 4rem);
  line-height: 1;
}

.ready-hero p {
  margin: 0.55rem 0 0;
  font-size: 1.15rem;
  font-weight: 900;
}

.ready-hero.is-ready {
  border-color: #2f7d4f;
  background: #eaf7ef;
}

.ready-hero.is-ready p {
  color: #17623b;
}

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

.readiness-grid ul {
  margin: 0;
  padding-left: 1.15rem;
}

@media (max-width: 960px) {
  .readiness-grid { grid-template-columns: 1fr; }
}

.scenario-picker {
  display: grid;
  min-width: 18rem;
}

.stage-contract {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 1rem 0;
}

.stage-contract article,
.presenter-notes {
  border: 1px solid var(--border);
  border-left: 4px solid var(--blue);
  border-radius: 0.55rem;
  background: #fbfcfe;
  padding: 0.75rem;
}

.stage-contract p,
.presenter-notes p { margin: 0.25rem 0 0; }

.presenter-toggle { margin-bottom: 0.75rem; }

.presenter-notes {
  margin: 0 0 1rem;
  background: #fff8e8;
  border-left-color: var(--gold);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(15, 39, 69, 0.58);
}

.modal-backdrop[hidden] { display: none; }

.modal-card {
  width: min(42rem, 100%);
  max-height: min(90vh, 44rem);
  overflow: auto;
  border-radius: 0.9rem;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(15, 39, 69, 0.28);
  padding: 1.25rem;
}

.model-list {
  display: grid;
  gap: 0.65rem;
  margin: 0.75rem 0 0;
  padding-left: 1.4rem;
}

.model-list li { padding-left: 0.25rem; }

@media (max-width: 1100px) {
  .stage-contract { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scenario-picker { min-width: 100%; }
}

@media print {
  body { background: white; color: black; }
  .app-header,
  .principles-card,
  .stage-path,
  .guided-demo,
  .context-panel,
  .activity-section,
  .demo-controls,
  .presenter-toggle,
  .button,
  .link-button { display: none !important; }
  main { max-width: none; padding: 0; }
  .workspace-shell { display: block; }
  .workspace,
  .interactive-panel,
  .summary-card,
  .notice {
    box-shadow: none;
    border-color: #999;
    break-inside: avoid;
  }
  .workspace { border: 0; padding: 0; }
  .stage-contract,
  .card-grid,
  .readiness-grid { grid-template-columns: 1fr 1fr; }
  .table-scroll { overflow: visible; }
  table { font-size: 0.78rem; page-break-inside: auto; }
  tr { break-inside: avoid; }
  .ready-hero { color: black; background: white; border: 1px solid #999; }
}

/* Simplified Pillar 1 happy-path cards */
.header-status { grid-template-columns: minmax(16rem, 1fr) auto; }
.pillar-one-tasks { display: grid; gap: 1rem; margin-top: 1rem; }
.task-card {
  border: 1px solid var(--border);
  border-left: 5px solid var(--stage-color);
  border-radius: 0.75rem;
  background: #fff;
  padding: 1rem;
  box-shadow: 0 6px 20px rgba(15, 39, 69, 0.06);
}
.task-card.is-complete { background: #fbfffd; border-left-color: var(--green); }
.task-heading-row { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.task-heading-row p { margin: 0; color: var(--muted); }
.task-indicator { border-radius: 999px; padding: 0.2rem 0.65rem; background: #eef2f7; color: var(--navy); font-size: 0.78rem; font-weight: 900; }
.task-card.is-complete .task-indicator { background: #e7f4ed; color: #17623b; }
.task-control-row { display: grid; grid-template-columns: minmax(18rem, 1fr) auto auto; gap: 0.75rem; align-items: end; margin-top: 1rem; }
.confirmation-line { margin-top: 0.85rem; border: 1px solid var(--border); border-radius: 0.55rem; background: #f6f8fb; padding: 0.75rem; }
.field-error { min-height: 1.25rem; margin: 0.4rem 0 0; color: #9a3412; font-weight: 750; }
.success-message { margin: 0.5rem 0 0; color: #17623b; font-weight: 800; }
.import-form { display: grid; gap: 0.25rem; margin-top: 1rem; }
@media (max-width: 760px) { .task-heading-row, .task-control-row { grid-template-columns: 1fr; } }

.pillar-two-tasks {
  display: grid;
  gap: 1rem;
}

.office-task-card {
  min-height: 32rem;
}

.task-toolbar {
  align-items: end;
  display: grid;
  gap: 0.85rem;
  grid-template-columns: minmax(14rem, 1fr) minmax(10rem, 14rem) auto;
  margin: 1rem 0;
}

.office-table-scroll {
  overflow-x: auto;
}

.office-table {
  min-width: 1200px;
}

.office-table th,
.office-table td {
  white-space: nowrap;
}

.pagination-row {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 0.85rem;
}

.form-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.checkbox-row {
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  display: flex;
  gap: 1rem;
  margin: 0;
  padding: 0.85rem;
}

.checkbox-row label {
  align-items: center;
  display: inline-flex;
  gap: 0.35rem;
}

@media (max-width: 760px) {
  .task-toolbar,
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.workspace-shell.pillar-two-full {
  grid-template-columns: minmax(0, 1fr);
}

.office-status-panel {
  align-items: center;
  border: 2px solid #b7791f;
  border-radius: 0.75rem;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin: 1rem 0;
  padding: 0.8rem 1rem;
}

.office-status-panel.is-unconfirmed {
  background: #fff8db;
  border-color: #b7791f;
  color: #5f3b00;
}

.office-status-panel.is-confirmed {
  background: #e6f4ea;
  border-color: #2f7d4f;
  color: #175c36;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.button-danger {
  background: #b42318;
  border-color: #b42318;
  color: #fff;
}

.danger-link { color: #9a3412; }

.button-subtle {
  font-size: 0.9rem;
}

.compact-modal {
  max-width: 32rem;
}

@media (max-width: 760px) {
  .office-status-panel {
    align-items: stretch;
    flex-direction: column;
  }
}

/* Pillar 3 task-oriented configuration workspace */
.workspace-shell.pillar-two-full { grid-template-columns: minmax(0, 1fr); }
.stage-three-panel { background: #fff; }
.p3-status-panel {
  border: 2px solid #b7791f;
  border-radius: 0.75rem;
  padding: 0.9rem 1rem;
}
.p3-unconfigured { background: #fff8db; border-color: #b7791f; color: #5f3b00; }
.p3-modified { background: #fff4e5; border-color: #c26a22; color: #7c3f00; }
.p3-configured { background: #e6f4ea; border-color: #2f7d4f; color: #175c36; }
.p3-toolbar {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0.85rem 0;
}
.p3-toolbar label { min-width: 16rem; flex: 1 1 16rem; }
.p3-modal-card { width: min(74rem, 100%); max-height: min(92vh, 56rem); }
.p3-modal-table { max-height: 28rem; overflow: auto; }
.p3-modal-table table { min-width: 68rem; }
.p3-party { min-width: 10rem; }
.p3-vote { max-width: 5rem; }
textarea.wide-input { min-height: 5rem; resize: vertical; }

/* Pillar 4 configuration-assignment workspace */
.pillar-four-workspace {
  display: grid;
  gap: 1rem;
}
.p4-assignment-card {
  background: #fff;
  border: 1px solid #d7dee8;
  border-radius: 1rem;
  box-shadow: 0 0.6rem 1.4rem rgba(15, 23, 42, 0.06);
  padding: 1rem;
}
.p4-controls {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0.85rem 0;
}
.p4-controls label { flex: 1 1 18rem; }
.p4-status-panel {
  border: 2px solid #b7791f;
  border-radius: 0.75rem;
  margin: 0.75rem 0;
  padding: 0.9rem 1rem;
}
.p4-unassigned {
  background: #fff8db;
  border-color: #b7791f;
  color: #5f3b00;
}
.p4-assigned {
  background: #e6f4ea;
  border-color: #2f7d4f;
  color: #175c36;
}
.p4-warning {
  background: #fff4e5;
  border: 1px solid #c26a22;
  border-radius: 0.75rem;
  color: #7c3f00;
  margin: 0.75rem 0 0;
  padding: 0.75rem 0.9rem;
}
