:root {
  --navy: #0c2940;
  --navy-2: #173f5f;
  --blue: #2f75b5;
  --blue-soft: #e9f2f9;
  --ink: #172333;
  --muted: #657384;
  --line: #d8e0e7;
  --soft: #f4f7f9;
  --white: #fff;
  --green: #15745a;
  --amber: #9a5f08;
  --red: #aa3f44;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-width: 320px;
  margin: 0;
  padding-bottom: 86px;
  color: var(--ink);
  background: var(--soft);
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}

button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
.tour-wrap { width: min(1240px, calc(100% - 32px)); margin-inline: auto; }
.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  transform: translateY(-140%);
  border-radius: 6px;
  background: var(--navy);
  color: var(--white);
  padding: 9px 12px;
}
.skip-link:focus { transform: none; }

.tour-header {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .97);
}
.header-inner {
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}
.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 7px;
  background: #111;
  color: var(--white);
  font-size: 13px;
  font-weight: 900;
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; line-height: 1; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.tour-header nav { display: flex; align-items: center; gap: 8px; }
.tour-header nav a {
  border-radius: 6px;
  padding: 9px 11px;
  color: #405166;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}
.tour-header nav a:hover, .tour-header nav a:focus-visible { background: var(--blue-soft); color: var(--navy); }
.tour-header nav .workspace-link { background: var(--navy); color: var(--white); }

.tour-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: end;
  padding: 28px 0 22px;
}
.eyebrow {
  margin: 0 0 7px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.tour-intro h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(30px, 4vw, 50px);
  line-height: 1.03;
  letter-spacing: 0;
}
.tour-intro p:last-child { max-width: 760px; margin: 12px 0 0; color: var(--muted); }
.scenario-stamp {
  min-width: 220px;
  border-left: 3px solid var(--blue);
  padding: 5px 0 5px 16px;
}
.scenario-stamp span, .scenario-stamp small { display: block; color: var(--muted); font-size: 11px; }
.scenario-stamp strong { display: block; margin: 3px 0; font-size: 16px; }

.tour-layout {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  min-height: 630px;
  border: 1px solid var(--line);
  background: var(--white);
  box-shadow: 0 14px 38px rgba(15, 43, 65, .09);
}
.tour-guide {
  display: grid;
  grid-template-rows: auto 1fr;
  background: var(--navy);
  color: var(--white);
}
.guide-copy { padding: 24px; border-bottom: 1px solid rgba(255, 255, 255, .14); }
.guide-copy > span { color: #9ec4df; font-size: 11px; font-weight: 850; text-transform: uppercase; }
.guide-copy h2 { margin: 6px 0 16px; font-size: 22px; line-height: 1.15; letter-spacing: 0; }
.guide-copy dl { display: grid; gap: 12px; margin: 0; }
.guide-copy dl div { border-top: 1px solid rgba(255, 255, 255, .12); padding-top: 10px; }
.guide-copy dt { color: #9ec4df; font-size: 9px; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.guide-copy dd { margin: 3px 0 0; color: #dbe7ef; font-size: 12px; line-height: 1.4; }
.tour-steps { display: grid; align-content: start; padding: 10px; }
.tour-steps button {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 9px;
  align-items: center;
  min-height: 50px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #d8e5ed;
  padding: 7px 9px;
  text-align: left;
  cursor: pointer;
}
.tour-steps button:hover, .tour-steps button:focus-visible { background: rgba(255, 255, 255, .08); outline: none; }
.tour-steps button[aria-current="step"] { background: var(--white); color: var(--navy); }
.tour-steps b { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 6px; background: rgba(255, 255, 255, .11); font-size: 12px; }
.tour-steps button[aria-current="step"] b { background: var(--blue-soft); color: var(--blue); }
.tour-steps span, .tour-steps small { display: block; }
.tour-steps span { font-size: 13px; font-weight: 850; }
.tour-steps small { color: #9fb5c4; font-size: 10px; font-weight: 600; }
.tour-steps button[aria-current="step"] small { color: var(--muted); }

.tour-stage { min-width: 0; padding: 28px; outline: none; }
.stage-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}
.stage-header h2 { max-width: 720px; margin: 0; font-size: 28px; line-height: 1.12; letter-spacing: 0; }
.record-status { flex: 0 0 auto; border: 1px solid #b8c9d6; border-radius: 999px; background: var(--blue-soft); color: var(--navy-2); padding: 6px 10px; font-size: 11px; font-weight: 850; }
.stage-body { padding-top: 22px; }
.stage-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(250px, .65fr); gap: 20px; }
.work-block { border: 1px solid var(--line); border-radius: 8px; padding: 20px; }
.work-block > h3, .result-block > h3 { margin: 0 0 5px; font-size: 17px; letter-spacing: 0; }
.work-block > p, .result-block > p { margin: 0 0 18px; color: var(--muted); font-size: 13px; }
.result-block { border-left: 4px solid var(--blue); background: var(--soft); padding: 20px; }
.result-block.navy { border-left-color: var(--navy); background: #edf2f5; }
.result-label { display: block; color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.result-value { display: block; margin: 5px 0 12px; color: var(--navy); font-size: 24px; line-height: 1.1; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field-grid .wide { grid-column: 1 / -1; }
label { display: grid; gap: 5px; color: #425165; font-size: 11px; font-weight: 800; }
select, input[type="number"], input[type="text"] {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cbd5dd;
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  padding: 9px 10px;
}
input[type="range"] { width: 100%; accent-color: var(--blue); }
.metric-line { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; margin-top: 14px; }
.metric-line strong { color: var(--navy); }
.summary-list { display: grid; gap: 9px; margin: 14px 0 0; padding: 0; list-style: none; }
.summary-list li { border-top: 1px solid var(--line); padding-top: 9px; color: #415164; font-size: 12px; }
.source-list, .readiness-list, .choice-list, .role-list { display: grid; gap: 8px; }
.source-row, .readiness-row, .choice-button, .role-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  padding: 10px 12px;
  color: var(--ink);
  text-align: left;
}
button.source-row, button.choice-button, button.role-button { cursor: pointer; }
.source-row:hover, .choice-button:hover, .role-button:hover { border-color: #8bb2cf; }
.source-row strong, .readiness-row strong, .choice-button strong, .role-button strong { display: block; font-size: 13px; }
.source-row small, .readiness-row small, .choice-button small, .role-button small { display: block; color: var(--muted); font-size: 10px; }
.source-state { min-width: 70px; border-radius: 999px; padding: 5px 8px; background: #e7f3ef; color: var(--green); font-size: 10px; font-weight: 850; text-align: center; text-transform: uppercase; }
.source-state.stale { background: #fff1d8; color: var(--amber); }
.source-state.missing { background: #f8e7e8; color: var(--red); }
.readiness-row { grid-template-columns: auto minmax(0, 1fr); }
.readiness-row input { width: 18px; height: 18px; accent-color: var(--green); }
.choice-button[aria-pressed="true"], .role-button[aria-pressed="true"] { border-color: var(--blue); background: var(--blue-soft); }
.value-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 16px 0; }
.value-grid div { border: 1px solid var(--line); background: var(--white); padding: 12px; }
.value-grid span, .value-grid strong { display: block; }
.value-grid span { color: var(--muted); font-size: 10px; }
.value-grid strong { margin-top: 4px; color: var(--navy); font-size: 18px; }
.packet-output { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 14px; }
.packet-output strong, .packet-output span { display: block; }
.packet-output span { margin-top: 4px; color: var(--muted); font-size: 12px; }
.complete-panel { display: grid; gap: 16px; align-content: center; min-height: 420px; text-align: center; }
.complete-panel .result-value { font-size: 34px; }
.complete-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; }
.complete-actions a { border-radius: 6px; padding: 11px 15px; font-size: 13px; font-weight: 850; text-decoration: none; }
.complete-actions .primary { background: var(--navy); color: var(--white); }
.complete-actions .secondary { border: 1px solid var(--line); background: var(--white); }

.tour-dock {
  position: fixed;
  z-index: 60;
  right: 0;
  bottom: 0;
  left: 0;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 -8px 26px rgba(15, 43, 65, .1);
}
.dock-inner { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(180px, .6fr) auto; gap: 18px; min-height: 72px; align-items: center; }
.dock-copy { min-width: 0; }
.dock-copy span, .dock-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dock-copy span { color: var(--blue); font-size: 10px; font-weight: 850; text-transform: uppercase; }
.dock-copy strong { margin-top: 2px; font-size: 12px; }
.dock-progress { height: 5px; overflow: hidden; border-radius: 999px; background: #e2e8ed; }
.dock-progress i { display: block; width: 12.5%; height: 100%; background: var(--blue); transition: width .2s ease; }
.dock-actions { display: flex; gap: 8px; }
.dock-actions button {
  min-width: 78px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  padding: 8px 12px;
  font-weight: 850;
  cursor: pointer;
}
.dock-actions button:disabled { color: #9aa6b2; cursor: default; }
.dock-actions .next-button { min-width: 130px; border-color: var(--navy); background: var(--navy); color: var(--white); }

@media (max-width: 900px) {
  .tour-layout { grid-template-columns: 1fr; }
  .tour-guide { position: static; grid-template-rows: auto auto; }
  .guide-copy { display: grid; grid-template-columns: minmax(180px, .7fr) minmax(0, 1.3fr); gap: 18px; }
  .guide-copy dl { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .guide-copy h2 { margin-bottom: 0; }
  .tour-steps { display: flex; overflow-x: auto; scroll-snap-type: x proximity; }
  .tour-steps button { flex: 0 0 145px; scroll-snap-align: start; }
}

@media (max-width: 640px) {
  body { padding-bottom: 122px; }
  .tour-wrap { width: min(100% - 18px, 1240px); }
  .header-inner { min-height: 62px; }
  .tour-header nav a:not(.workspace-link) { display: none; }
  .tour-intro { grid-template-columns: 1fr; gap: 16px; padding: 22px 0 18px; }
  .tour-intro h1 { font-size: 32px; }
  .scenario-stamp { min-width: 0; }
  .guide-copy { grid-template-columns: 1fr; padding: 18px; }
  .guide-copy dl { grid-template-columns: 1fr; gap: 8px; }
  .guide-copy dl div { padding-top: 7px; }
  .tour-stage { padding: 18px 14px; }
  .stage-header { display: grid; }
  .stage-header h2 { font-size: 23px; }
  .record-status { justify-self: start; }
  .stage-grid, .field-grid { grid-template-columns: 1fr; }
  .field-grid .wide { grid-column: auto; }
  .value-grid { grid-template-columns: 1fr; }
  .dock-inner { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; min-height: 112px; padding-block: 8px; }
  .dock-copy { grid-column: 1 / -1; }
  .dock-progress { align-self: center; }
  .dock-actions button { min-width: 66px; }
  .dock-actions .next-button { min-width: 116px; }
}
