:root {
  --ink: #15312b;
  --ink-2: #24453e;
  --paper: #f4f1e8;
  --white: #fffefa;
  --line: #d5d0c2;
  --muted: #606c68;
  --mint: #b9ded2;
  --mint-dark: #2c7465;
  --amber: #f1bd4d;
  --amber-dark: #805405;
  --coral: #d96f59;
  --coral-soft: #f6ddd6;
  --blue: #407a99;
  --blue-soft: #dceaf0;
  --shadow: 0 20px 55px rgba(21, 49, 43, .09);
  --radius: 8px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: Geist, "Avenir Next", "Segoe UI", sans-serif;
  letter-spacing: 0;
}
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
a { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 3px solid #286c94;
  outline-offset: 3px;
}
[hidden] { display: none !important; }
.shell { width: min(1480px, calc(100% - 36px)); margin-inline: auto; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--line);
  background: rgba(244, 241, 232, .95);
  backdrop-filter: blur(15px);
}
.nav { min-height: 68px; display: flex; align-items: center; gap: 26px; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 900; text-decoration: none; white-space: nowrap; }
.brand-mark { width: 34px; height: 34px; padding: 7px; display: grid; grid-template-columns: 1fr 1fr; gap: 3px; background: var(--ink); border-radius: 6px; }
.brand-mark i { background: var(--amber); border-radius: 1px; }
.brand-mark i:last-child { grid-column: span 2; }
.nav nav { display: flex; align-items: center; gap: 18px; flex: 1; }
.nav nav a { text-decoration: none; color: var(--muted); font-size: 13px; font-weight: 800; }
.nav nav a:hover { color: var(--ink); }
.local-note { margin: 0; color: var(--muted); font-size: 12px; text-align: right; }
.local-note strong { color: var(--mint-dark); }

.hero { padding: 58px 0 38px; display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 56px; align-items: end; }
.eyebrow { margin: 0 0 9px; color: var(--mint-dark); font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.hero h1 { max-width: 1100px; margin: 0; font-size: clamp(2.35rem, 5vw, 5.25rem); line-height: .98; font-weight: 900; }
.hero-copy { max-width: 800px; margin: 20px 0 0; color: var(--muted); font-size: clamp(16px, 1.5vw, 19px); line-height: 1.58; }
.hero-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: start; }
.status { grid-column: 1 / -1; min-height: 38px; margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }

.button, .icon-button {
  min-height: 42px;
  border: 1px solid var(--ink);
  border-radius: 5px;
  background: var(--white);
  color: var(--ink);
  padding: 0 14px;
  font-weight: 850;
}
.button:hover, .icon-button:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(21, 49, 43, .11); }
.button.primary { background: var(--amber); color: #1c281f; border-color: var(--amber-dark); }
.button.danger { color: #8c392c; border-color: #c99084; background: #fff7f4; }
.button.small { min-height: 35px; padding: 0 10px; font-size: 12px; }
.icon-button { width: 38px; height: 38px; min-height: 38px; padding: 0; display: grid; place-items: center; font-size: 22px; }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.metric { min-height: 118px; border: 1px solid var(--line); background: var(--white); padding: 16px; display: flex; flex-direction: column; justify-content: space-between; }
.metric span { color: var(--muted); font-size: 12px; font-weight: 850; }
.metric strong { display: block; font-size: clamp(26px, 3.1vw, 39px); font-variant-numeric: tabular-nums; }
.metric small { color: var(--muted); line-height: 1.35; }

.workspace { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-flow: dense; gap: 14px; align-items: start; }
.panel { min-width: 0; border: 1px solid var(--line); background: var(--white); box-shadow: 0 10px 28px rgba(21, 49, 43, .05); }
.panel.discovery { grid-column: span 5; }
.panel.output { grid-column: span 7; }
.panel.scope { grid-column: span 5; }
.panel.features { grid-column: span 7; }
.panel.content-panel { grid-column: span 7; }
.panel.sitemap-panel { grid-column: span 5; }
.panel-head { min-height: 68px; padding: 13px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-head h2 { margin: 0; font-size: 18px; }
.panel-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.panel-body { padding: 16px; }
.panel-body.compact { padding: 0; }
.step-chip { flex: 0 0 auto; border-radius: 4px; padding: 6px 8px; background: #e9e6db; color: var(--muted); font-size: 11px; font-weight: 900; }
.step-chip.accent { background: var(--mint); color: var(--ink); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.form-grid .full { grid-column: 1 / -1; }
label, legend { color: var(--ink-2); font-size: 12px; font-weight: 850; }
input, select, textarea {
  width: 100%;
  min-height: 43px;
  margin-top: 7px;
  border: 1px solid #c8c4b8;
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  padding: 9px 11px;
}
textarea { resize: vertical; line-height: 1.45; }
.choice-field { margin: 0; padding: 0; border: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.choice-field legend { margin-bottom: 6px; }
.choice-field label { min-height: 39px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); padding: 7px 10px; background: #fbfaf5; border-radius: 5px; }
.choice-field input { width: 17px; min-height: 17px; margin: 0; }

.brief-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.summary-block { min-height: 104px; border: 1px solid var(--line); padding: 13px; background: #fbfaf5; }
.summary-block span { display: block; color: var(--muted); font-size: 11px; font-weight: 850; text-transform: uppercase; letter-spacing: .05em; }
.summary-block strong { display: block; margin-top: 8px; font-size: 16px; line-height: 1.35; }
.summary-block p { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.score-bars { margin-top: 14px; display: grid; gap: 8px; }
.score-bars > div { display: grid; grid-template-columns: 82px minmax(0, 1fr) 42px; gap: 9px; align-items: center; font-size: 12px; }
.score-bars span { color: var(--muted); font-weight: 800; }
.score-bars strong { text-align: right; font-variant-numeric: tabular-nums; }
progress { width: 100%; height: 9px; border: 0; border-radius: 0; background: #e4e0d4; }
progress::-webkit-progress-bar { background: #e4e0d4; }
progress::-webkit-progress-value { background: var(--mint-dark); }
progress::-moz-progress-bar { background: var(--mint-dark); }
.assumption-note { margin-top: 14px; border-left: 6px solid var(--amber); padding: 12px 14px; background: #fff8e7; }
.assumption-note h3 { margin: 0; font-size: 13px; }
.assumption-note p { margin: 7px 0 0; color: #615b4b; font-size: 12px; line-height: 1.5; }

.priority-list { display: grid; }
.priority-row { min-height: 59px; display: grid; grid-template-columns: minmax(0, 1fr) 126px 34px; gap: 9px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line); }
.priority-row:first-child { border-top: 0; }
.priority-row strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.priority-row select { min-height: 36px; margin: 0; padding: 5px 7px; font-size: 11px; }
.priority-row button { width: 32px; height: 32px; border: 0; background: transparent; color: var(--coral); font-size: 18px; }

.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.feature-card { min-height: 110px; display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--line); border-radius: 5px; padding: 10px; background: #fbfaf5; }
.feature-card .check-line { display: flex; align-items: flex-start; gap: 8px; }
.feature-card input[type="checkbox"] { width: 17px; min-height: 17px; margin: 1px 0 0; }
.feature-card strong { font-size: 12px; line-height: 1.3; }
.feature-card small { color: var(--muted); line-height: 1.35; }
.feature-card select { min-height: 33px; margin: auto 0 0; padding: 4px 7px; font-size: 11px; }
.subhead { margin: 18px 0 9px; font-size: 14px; }
.requirement-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.requirement-grid label { min-height: 52px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 5px; padding: 8px; background: var(--white); }
.requirement-grid input { width: 17px; min-height: 17px; margin: 0; }

.inventory { display: grid; }
.inventory-row { min-height: 62px; display: grid; grid-template-columns: minmax(0, 1fr) 120px; gap: 10px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line); }
.inventory-row:first-child { border-top: 0; }
.inventory-row strong { font-size: 13px; }
.inventory-row small { display: block; color: var(--muted); margin-top: 4px; line-height: 1.35; }
.inventory-row select { min-height: 36px; margin: 0; padding: 5px; font-size: 11px; }

.sitemap { min-height: 310px; position: relative; padding: 10px; display: grid; align-content: start; gap: 22px; background: linear-gradient(90deg, rgba(44,116,101,.06) 1px, transparent 1px), linear-gradient(rgba(44,116,101,.06) 1px, transparent 1px); background-size: 22px 22px; }
.site-root { justify-self: center; min-width: 125px; padding: 11px; border: 2px solid var(--ink); background: var(--amber); text-align: center; font-weight: 900; }
.site-children { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.site-children:before { content: ""; position: absolute; left: 50%; top: -22px; width: 1px; height: 22px; background: var(--ink); }
.site-node { min-height: 54px; padding: 9px; border: 1px solid var(--line); border-left: 5px solid var(--mint-dark); background: var(--white); font-size: 12px; font-weight: 850; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.site-node.later { border-left-color: var(--blue); color: #4b6775; }
.site-node small { color: var(--muted); font-size: 9px; text-transform: uppercase; }

.chapter { padding: 150px 0 20px; }
.chapter-heading { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .75fr); gap: 60px; align-items: end; margin-bottom: 34px; }
.chapter-heading h2 { max-width: 900px; margin: 0; font-size: clamp(2rem, 4vw, 4rem); line-height: 1.02; }
.chapter-heading > p { margin: 0; color: var(--muted); line-height: 1.65; }
.roadmap-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.roadmap-card { min-height: 280px; border: 1px solid var(--line); padding: 20px; background: var(--white); position: relative; overflow: hidden; }
.roadmap-card:before { content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 7px; background: var(--mint-dark); }
.roadmap-card:nth-child(2):before { background: var(--blue); }
.roadmap-card:nth-child(3):before { background: var(--coral); }
.roadmap-card span { color: var(--muted); font-size: 11px; font-weight: 900; text-transform: uppercase; }
.roadmap-card h3 { margin: 18px 0 12px; font-size: 22px; }
.roadmap-card p { color: var(--muted); line-height: 1.55; }
.roadmap-card ul { padding-left: 19px; line-height: 1.55; }
.risk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.risk-grid article { border: 1px solid var(--line); background: var(--ink); color: var(--white); padding: 22px; }
.risk-grid h3 { margin: 0 0 14px; }
.signal-list { margin: 0; padding-left: 20px; line-height: 1.6; color: #dce6e3; }

.vendor-layout { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 12px; }
.question-bank, .rubric { border: 1px solid var(--line); background: var(--white); padding: 18px; min-width: 0; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.section-head h2, .section-head h3 { margin: 0; }
.question-bank ol { margin: 0; padding-left: 23px; display: grid; gap: 12px; color: var(--ink-2); line-height: 1.5; }
.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 620px; border-collapse: collapse; font-size: 12px; }
th, td { border: 1px solid var(--line); padding: 9px; text-align: center; }
th:first-child { text-align: left; }
thead th { background: #eeeadf; }
table input { min-width: 105px; min-height: 35px; margin: 0; padding: 5px 7px; font-size: 11px; }
table select { min-width: 70px; min-height: 35px; margin: 0; padding: 5px; }
tfoot { font-weight: 900; background: var(--mint); }

.saved { padding: 150px 0 20px; }
.saved-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.saved-card { border: 1px solid var(--line); background: var(--white); padding: 15px; }
.saved-card h3 { margin: 0 0 6px; font-size: 16px; }
.saved-card p { color: var(--muted); font-size: 12px; line-height: 1.45; }
.saved-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 13px 0; }
.saved-card dt { color: var(--muted); font-size: 10px; }
.saved-card dd { margin: 2px 0 0; font-weight: 900; }
.saved-card .card-actions { display: flex; gap: 7px; }
.empty-state { grid-column: 1 / -1; padding: 34px; border: 1px dashed #aaa597; color: var(--muted); text-align: center; }

.guidance { padding-bottom: 150px; }
.guidance-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.guidance-grid article { min-height: 210px; border: 1px solid var(--line); background: var(--white); padding: 18px; }
.guidance-grid h3 { margin: 0 0 12px; }
.guidance-grid p { margin: 0; color: var(--muted); line-height: 1.6; font-size: 13px; }

dialog { width: min(500px, calc(100% - 28px)); border: 1px solid var(--line); border-radius: 7px; padding: 0; background: var(--white); color: var(--ink); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(15, 31, 27, .56); backdrop-filter: blur(4px); }
dialog form { padding: 18px; display: grid; gap: 14px; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.dialog-head h2 { margin: 0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
footer { background: var(--ink); color: var(--white); padding: 34px 0; }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.footer-grid p { color: #c8d5d2; line-height: 1.5; margin: 7px 0 0; }

@media (max-width: 1080px) {
  .hero { grid-template-columns: 1fr; gap: 25px; }
  .hero-actions { max-width: 500px; }
  .panel.discovery, .panel.output, .panel.scope, .panel.features, .panel.content-panel, .panel.sitemap-panel { grid-column: 1 / -1; }
  .sticky-output { position: static; }
  .guidance-grid { grid-template-columns: 1fr 1fr; }
  .vendor-layout { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .shell { width: min(100% - 22px, 1480px); }
  .nav { min-height: 62px; }
  .nav nav { display: none; }
  .local-note { margin-left: auto; max-width: 140px; }
  .hero { padding-top: 36px; }
  .hero h1 { font-size: clamp(2.25rem, 11vw, 3.8rem); }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric { min-height: 104px; }
  .form-grid, .brief-summary { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .choice-field { grid-template-columns: 1fr; }
  .feature-grid, .requirement-grid { grid-template-columns: 1fr 1fr; }
  .chapter { padding-top: 100px; }
  .chapter-heading { grid-template-columns: 1fr; gap: 20px; }
  .roadmap-grid, .risk-grid, .saved-grid { grid-template-columns: 1fr; }
  .guidance-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .brand span:last-child { display: none; }
  .hero-actions { grid-template-columns: 1fr; }
  .status { grid-column: auto; }
  .metrics { grid-template-columns: 1fr; }
  .feature-grid, .requirement-grid { grid-template-columns: 1fr; }
  .priority-row { grid-template-columns: minmax(0, 1fr) 108px 30px; padding-inline: 10px; }
  .inventory-row { grid-template-columns: 1fr 105px; padding-inline: 10px; }
  .site-children { grid-template-columns: 1fr; }
  .score-bars > div { grid-template-columns: 66px minmax(0, 1fr) 38px; }
  table { min-width: 0; table-layout: fixed; }
  table th:first-child { width: 34%; }
  th, td { padding: 5px 3px; }
  table input, table select { width: 100%; min-width: 0; padding: 4px 3px; font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
@media print {
  .topbar, .hero-actions, .icon-button, .button, dialog, footer { display: none !important; }
  body { background: #fff; }
  .shell { width: 100%; }
  .hero, .chapter, .saved { padding: 22px 0; }
  .panel, .metric, .roadmap-card, .question-bank, .rubric, .guidance-grid article { box-shadow: none; break-inside: avoid; }
}
