:root {
  --navy: #1f3148;
  --navy-2: #2e455f;
  --teal: #1f6f73;
  --teal-soft: #e7f2f1;
  --amber: #a86718;
  --amber-soft: #fbf1df;
  --red: #a3463f;
  --red-soft: #faecea;
  --green: #327257;
  --green-soft: #e8f3ed;
  --ink: #1c2733;
  --muted: #667382;
  --line: #d9dfe5;
  --surface: #ffffff;
  --canvas: #f5f7f8;
  --shadow: 0 12px 30px rgba(31, 49, 72, .08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.service-description { margin-top: -4px; padding: 12px 14px; border-left: 3px solid var(--teal); background: #f4f8f8; color: var(--ink); }
.service-description strong, .service-description span { display: block; }
.service-description span { margin-top: 4px; color: var(--muted); font-size: 13px; line-height: 1.45; }
body { margin: 0; min-width: 320px; background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.app-header {
  min-height: 76px;
  display: grid;
  grid-template-columns: minmax(230px, 1fr) auto minmax(190px, 1fr);
  align-items: center;
  gap: 24px;
  padding: 10px 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; width: fit-content; }
.brand img { width: 52px; height: 52px; object-fit: cover; }
.brand span { display: grid; gap: 2px; }
.brand strong { font-size: 15px; }
.brand small, .save-state, .rail-summary small { color: var(--muted); font-size: 12px; }
.header-purpose { justify-self: center; color: var(--navy); font-size: 13px; font-weight: 750; }
.top-nav { display: flex; align-items: center; gap: 4px; padding: 4px; background: #eef1f3; border-radius: 8px; }
.nav-button { border: 0; background: transparent; color: var(--muted); padding: 9px 13px; border-radius: 6px; font-weight: 650; font-size: 13px; }
.nav-button:hover { color: var(--ink); }
.nav-button.active { color: white; background: var(--navy); }
.save-state { justify-self: end; display: flex; gap: 8px; align-items: center; }
.status-dot { width: 8px; height: 8px; background: var(--green); border-radius: 50%; }

main { max-width: 1500px; margin: 0 auto; padding: 34px 32px 54px; }
.view { display: none; }
.view.active { display: block; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; margin-bottom: 24px; }
.page-head.compact { align-items: center; }
.eyebrow { color: var(--amber); text-transform: uppercase; font-size: 12px; font-weight: 800; letter-spacing: .08em; margin: 0 0 8px; }
h1 { font-family: Georgia, "Times New Roman", serif; color: var(--navy); font-size: clamp(30px, 4vw, 46px); line-height: 1.06; margin: 0; max-width: 790px; letter-spacing: 0; }
.lede { color: var(--muted); font-size: 16px; line-height: 1.55; max-width: 760px; margin: 12px 0 0; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.button { min-height: 42px; border-radius: 6px; border: 1px solid transparent; padding: 10px 16px; font-weight: 750; }
.button.primary { background: var(--teal); color: white; }
.button.primary:hover { background: #185d60; }
.button.secondary { background: white; border-color: var(--line); color: var(--navy); }
.button.full { width: 100%; margin-top: 8px; }
.icon-button { width: 42px; height: 42px; border-radius: 6px; border: 1px solid var(--line); background: white; color: var(--navy); font-size: 20px; }

.assessment-shell { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 8px; overflow: hidden; }
.assessment-progress { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 24px; border-bottom: 1px solid var(--line); background: #f1f4f5; }
.assessment-progress .rail-summary { border-bottom: 0; padding: 0; }
.assessment-progress > p { max-width: 520px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.assessment-rail { background: #f1f4f5; border-right: 1px solid var(--line); padding: 22px 16px; }
.rail-summary { display: flex; align-items: center; gap: 13px; padding: 0 7px 20px; border-bottom: 1px solid var(--line); }
.rail-summary > div { display: grid; gap: 5px; }
.score-ring { width: 62px; height: 62px; border: 6px solid #cfd8dc; border-top-color: var(--teal); border-radius: 50%; display: grid; place-content: center; text-align: center; background: white; }
.score-ring strong { font-size: 19px; line-height: 1; }
.score-ring small { font-size: 10px; }
.module-list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 3px; }
.module-item button { width: 100%; border: 0; background: transparent; display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 8px; padding: 9px 8px; border-radius: 6px; text-align: left; color: var(--muted); }
.module-item button:hover { background: white; color: var(--ink); }
.module-item.active button { background: white; box-shadow: 0 2px 9px rgba(31,49,72,.08); color: var(--navy); font-weight: 750; }
.module-number { width: 24px; height: 24px; border: 1px solid #c5cdd4; display: grid; place-items: center; border-radius: 50%; font-size: 11px; }
.module-item.complete .module-number { background: var(--green); color: white; border-color: var(--green); }
.module-score { font-size: 11px; color: var(--muted); }
.assessment-workspace { min-width: 0; display: flex; flex-direction: column; }
.property-strip { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 12px; padding: 18px 24px; border-bottom: 1px solid var(--line); background: #fbfcfc; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
input, select, textarea { width: 100%; border: 1px solid #cbd3da; border-radius: 5px; background: white; color: var(--ink); padding: 10px 11px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(31,111,115,.12); }
textarea { resize: vertical; min-height: 88px; line-height: 1.45; }
.all-modules { display: grid; gap: 18px; padding: 24px; background: #f4f6f7; }
.module-panel { padding: 28px 30px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.category-number { display: block; margin-bottom: 5px; color: var(--teal); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.module-kicker { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 22px; }
.module-kicker h2 { margin: 0 0 6px; color: var(--navy); font-size: 24px; }
.module-kicker p { margin: 0; color: var(--muted); line-height: 1.5; }
.risk-badge { white-space: nowrap; border-radius: 999px; padding: 7px 10px; font-size: 11px; font-weight: 800; background: #eef1f3; color: var(--muted); }
.risk-badge.high { background: var(--red-soft); color: var(--red); }
.risk-badge.medium { background: var(--amber-soft); color: var(--amber); }
.risk-badge.low { background: var(--green-soft); color: var(--green); }
.question-list { display: grid; gap: 11px; }
.question-row { display: grid; grid-template-columns: minmax(0, 1fr) 175px; align-items: center; gap: 18px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 6px; }
.question-row strong { font-size: 14px; line-height: 1.4; }
.evidence-grid { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 180px 1fr; gap: 14px; }
.full-field { grid-column: 1 / -1; }
.evidence-help { grid-column: 1 / -1; background: var(--teal-soft); color: #2c5e60; padding: 10px 12px; border-left: 3px solid var(--teal); font-size: 12px; line-height: 1.45; }
.module-controls { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-top: 1px solid var(--line); padding: 16px 24px; }
.module-controls span { color: var(--muted); font-size: 13px; }

.purchase-panel {
  max-width: 980px;
  margin: 26px auto 0;
  padding: 26px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--teal);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
}
.purchase-panel h2 { margin: 0; color: var(--navy); font-size: 25px; }
.purchase-panel > div:first-child > p:last-child { max-width: 720px; margin: 8px 0 20px; color: var(--muted); line-height: 1.55; }
.package-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.package-option { display: block; cursor: pointer; }
.package-option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.package-option span { display: block; min-height: 128px; padding: 18px; border: 2px solid var(--line); border-radius: 6px; background: #fbfcfc; }
.package-option strong, .package-option small { display: block; }
.package-option strong { color: var(--navy); font-size: 15px; }
.package-option small { margin-top: 9px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.package-option input:checked + span { border-color: var(--teal); background: var(--teal-soft); }
.package-option input:focus-visible + span { outline: 3px solid rgba(31,111,115,.18); outline-offset: 2px; }
.submission-confirm { grid-template-columns: 18px 1fr; gap: 10px; align-items: start; margin: 20px 0 14px; color: var(--ink); font-weight: 600; line-height: 1.45; }
.submission-confirm input { width: 16px; margin-top: 2px; }
.purchase-panel > .button { width: 100%; }
.payment-note { margin: 10px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; text-align: center; }
.service-disclaimer { margin-top: 22px; padding: 15px 17px; border: 1px solid var(--line); border-left: 4px solid var(--amber); background: #fffdf8; }
.service-disclaimer strong { color: var(--navy); font-size: 13px; }
.service-disclaimer p { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.button:disabled { cursor: not-allowed; opacity: .62; }

.submission-complete { max-width: 850px; margin: 36px auto; padding: 42px; border: 1px solid var(--line); border-top: 5px solid var(--green); border-radius: 8px; background: white; box-shadow: var(--shadow); }
.confirmation-mark { width: 52px; height: 52px; display: grid; place-items: center; margin-bottom: 18px; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 28px; font-weight: 900; }
.submission-complete h1 { font-size: 38px; }
.confirmation-lede { margin: 12px 0 24px; color: var(--muted); font-size: 16px; line-height: 1.55; }
.confirmation-details { display: grid; grid-template-columns: 1fr 1fr; margin: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.confirmation-details div { padding: 15px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.confirmation-details dt { color: var(--muted); font-size: 11px; font-weight: 750; text-transform: uppercase; }
.confirmation-details dd { margin: 5px 0 0; color: var(--navy); font-size: 14px; font-weight: 750; }
.confirmation-note { display: grid; gap: 5px; margin-top: 20px; padding: 14px 16px; border-left: 4px solid var(--teal); background: var(--teal-soft); }
.confirmation-note strong { color: var(--navy); }
.confirmation-note span { color: #3e5f61; font-size: 13px; line-height: 1.5; }

.plan-overview, .client-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.metric { background: white; border: 1px solid var(--line); border-left: 4px solid var(--teal); padding: 16px; border-radius: 6px; display: grid; gap: 4px; }
.metric strong { font-size: 25px; color: var(--navy); }
.metric span { font-size: 12px; color: var(--muted); }
.plan-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); }
.plan-tab { border: 0; background: transparent; color: var(--muted); padding: 13px 18px; font-weight: 750; border-bottom: 3px solid transparent; }
.plan-tab.active { color: var(--teal); border-bottom-color: var(--teal); }
.plan-surface { background: white; border: 1px solid var(--line); border-top: 0; min-height: 360px; padding: 24px; }
.plan-header { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 18px; }
.plan-header h2 { margin: 0; color: var(--navy); }
.plan-header p { margin: 4px 0 0; color: var(--muted); }
.period-progress { min-width: 92px; text-align: right; }
.period-progress strong { display: block; color: var(--navy); font-size: 17px; }
.period-progress span { color: var(--muted); font-size: 11px; }
.progress-track { height: 6px; margin: -7px 0 20px; overflow: hidden; border-radius: 999px; background: #e5e9ec; }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: var(--green); transition: width .2s ease; }
.action-list { display: grid; gap: 10px; }
.action-row { display: grid; grid-template-columns: 30px 30px minmax(0, 1fr) minmax(230px, .55fr); gap: 12px; align-items: center; min-height: 76px; padding: 12px 15px; border: 1px solid var(--line); border-left: 4px solid transparent; border-radius: 6px; background: white; transition: border-color .15s ease, background .15s ease; }
.action-row.starred { border-left-color: var(--amber); background: #fffdf7; }
.action-row.completed { background: #f7f9f8; }
.action-row.completed .action-main strong { color: var(--muted); text-decoration: line-through; }
.check-control { display: block; width: 24px; height: 24px; cursor: pointer; }
.check-control input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.check-control span { width: 24px; height: 24px; display: grid; place-items: center; border: 2px solid #aeb9c1; border-radius: 4px; background: white; }
.check-control input:checked + span { border-color: var(--green); background: var(--green); }
.check-control input:checked + span::after { content: '✓'; color: white; font-size: 16px; font-weight: 900; }
.check-control input:focus-visible + span { outline: 3px solid rgba(31,111,115,.18); outline-offset: 2px; }
.star-button { width: 30px; height: 34px; border: 0; background: transparent; color: #98a4ad; font-size: 25px; line-height: 1; padding: 0; }
.star-button[aria-pressed="true"] { color: var(--amber); }
.action-main strong { display: block; margin-bottom: 4px; }
.department-label { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.action-main small, .action-cell small { display: block; color: var(--muted); line-height: 1.4; }
.action-cell { font-size: 13px; }
.action-cell strong { color: var(--navy); font-size: 12px; }
.accountability { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.action-details { grid-column: 3 / -1; margin-top: -2px; color: var(--muted); font-size: 11px; }
.action-details summary { width: fit-content; cursor: pointer; color: var(--teal); font-weight: 750; }
.action-details div { margin-top: 8px; padding: 9px 11px; border-left: 3px solid var(--line); background: #f7f9fa; }
.action-details p { margin: 3px 0; }
.claim-chip { display: inline-flex; width: fit-content; margin-top: 7px; border-radius: 999px; padding: 4px 7px; font-size: 10px; text-transform: uppercase; font-weight: 800; background: #eef1f3; color: var(--muted); }
.claim-chip.verified { background: var(--green-soft); color: var(--green); }
.claim-chip.observed { background: var(--teal-soft); color: var(--teal); }
.empty-state { min-height: 260px; display: grid; place-content: center; text-align: center; color: var(--muted); }
.empty-state strong { color: var(--navy); font-size: 20px; margin-bottom: 7px; }

.table-wrap { background: white; border: 1px solid var(--line); border-radius: 6px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; border-bottom: 1px solid var(--line); padding: 14px 16px; font-size: 13px; }
th { color: var(--muted); font-size: 11px; text-transform: uppercase; background: #f7f9fa; }
tbody tr:last-child td { border-bottom: 0; }
.stage { display: inline-flex; border-radius: 999px; padding: 5px 8px; background: var(--amber-soft); color: var(--amber); font-size: 11px; font-weight: 800; }
.stage.active { background: var(--green-soft); color: var(--green); }
.text-button { border: 0; color: var(--teal); background: transparent; font-weight: 750; }

.handoff-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(330px, .7fr); gap: 18px; align-items: start; }
.handoff-summary, .activation-panel { background: white; border: 1px solid var(--line); border-radius: 6px; padding: 24px; }
.handoff-summary h2, .activation-panel h2 { color: var(--navy); margin: 0 0 8px; }
.handoff-summary > p, .activation-panel > p { color: var(--muted); line-height: 1.5; }
.handoff-flow { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 22px 0; }
.flow-step { min-height: 92px; border: 1px solid var(--line); padding: 12px; display: grid; align-content: space-between; border-radius: 5px; }
.flow-step strong { font-size: 12px; color: var(--navy); }
.flow-step span { font-size: 11px; color: var(--muted); }
.carry-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0; list-style: none; }
.carry-list li { padding: 10px; background: #f6f8f9; border-left: 3px solid var(--teal); font-size: 13px; }
.field-label { margin-top: 14px; }
.check-row { grid-template-columns: 18px 1fr; gap: 10px; align-items: start; margin-top: 16px; font-weight: 600; line-height: 1.4; color: var(--ink); }
.check-row input { width: 16px; margin-top: 2px; }
.form-message { font-size: 12px; color: var(--red); min-height: 18px; }

footer { border-top: 1px solid var(--line); padding: 22px 32px; color: var(--muted); font-size: 11px; text-align: center; background: white; }
.toast { position: fixed; right: 24px; bottom: 24px; background: var(--navy); color: white; padding: 12px 16px; border-radius: 6px; box-shadow: var(--shadow); transform: translateY(120px); opacity: 0; transition: .22s ease; z-index: 50; }
.toast.show { transform: translateY(0); opacity: 1; }

#printPreview { max-width: 900px; margin: 0 auto; padding: 24px; color: var(--ink); background: white; font: 12px/1.45 Arial, sans-serif; }
#printPreview .print-toolbar { position: sticky; top: 0; z-index: 2; display: flex; justify-content: flex-end; gap: 8px; margin: -24px -24px 22px; padding: 12px 24px; border-bottom: 1px solid var(--line); background: var(--canvas); }
#printPreview .print-toolbar button { border: 1px solid var(--line); border-radius: 5px; padding: 9px 13px; background: white; color: var(--navy); font-weight: 700; }
#printPreview .print-toolbar .primary { border-color: var(--teal); background: var(--teal); color: white; }
#printPreview header { border-bottom: 3px solid var(--teal); padding-bottom: 14px; margin-bottom: 18px; }
#printPreview h1 { margin: 0; color: var(--navy); font: 700 28px/1.1 Georgia, serif; }
#printPreview header p { margin: 6px 0 0; color: var(--muted); }
#printPreview .summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 15px 0 20px; }
#printPreview .summary div { border: 1px solid var(--line); border-left: 4px solid var(--teal); padding: 9px; }
#printPreview .summary strong { display: block; color: var(--navy); font-size: 18px; }
#printPreview .summary span { color: var(--muted); font-size: 10px; }
#printPreview .print-section { break-inside: avoid; margin: 0 0 18px; }
#printPreview .print-section-head { display: flex; justify-content: space-between; align-items: end; border-bottom: 1px solid #aeb8c0; padding-bottom: 6px; }
#printPreview .print-section h2 { margin: 0; color: var(--navy); font-size: 17px; }
#printPreview .print-section-head p { margin: 2px 0 0; color: var(--muted); }
#printPreview .print-section-head > strong { color: var(--teal); }
#printPreview .print-action { break-inside: avoid; border-bottom: 1px solid var(--line); padding: 9px 2px; }
#printPreview .print-action h3 { margin: 0 0 4px; font-size: 13px; }
#printPreview .print-action p { margin: 3px 0; }
#printPreview .print-meta { color: #465564; }
#printPreview .print-empty { color: var(--muted); font-style: italic; }
#printPreview footer { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 8px; color: var(--muted); font-size: 9px; }

@media (max-width: 1080px) {
  .app-header { grid-template-columns: 1fr auto; }
  .top-nav { grid-row: 2; grid-column: 1 / -1; overflow-x: auto; justify-content: center; }
  .save-state { grid-column: 2; grid-row: 1; }
  .assessment-shell { grid-template-columns: 230px minmax(0, 1fr); }
  .property-strip { grid-template-columns: 1fr 1fr; }
  .package-options { grid-template-columns: 1fr; }
  .package-option span { min-height: 0; }
  .action-row { grid-template-columns: 30px 30px minmax(0, 1fr); }
  .accountability, .action-details { grid-column: 3; }
  .handoff-flow { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 760px) {
  .assessment-progress { align-items: flex-start; flex-direction: column; }
  .all-modules { padding: 12px; }
  .app-header { padding: 10px 16px; gap: 12px; }
  .brand small, .save-state, .header-purpose { display: none; }
  .top-nav { justify-content: flex-start; }
  .nav-button { white-space: nowrap; }
  main { padding: 24px 14px 42px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .head-actions { justify-content: flex-start; }
  .assessment-shell { display: block; }
  .assessment-rail { border-right: 0; border-bottom: 1px solid var(--line); }
  .module-list { display: flex; overflow-x: auto; }
  .module-item { min-width: 46px; }
  .module-item button { display: block; text-align: center; }
  .module-name, .module-score { display: none; }
  .module-number { margin: auto; }
  .property-strip { grid-template-columns: 1fr; }
  .module-panel { padding: 22px 18px; }
  .module-kicker { flex-direction: column; }
  .question-row, .evidence-grid { grid-template-columns: 1fr; }
  .full-field { grid-column: auto; }
  .purchase-panel { padding: 20px 16px; }
  .submission-complete { margin: 12px 0; padding: 26px 20px; }
  .submission-complete h1 { font-size: 31px; }
  .confirmation-details { grid-template-columns: 1fr; }
  .plan-overview, .client-metrics { grid-template-columns: 1fr 1fr; }
  .plan-tabs { overflow-x: auto; }
  .plan-tab { white-space: nowrap; }
  .action-row { grid-template-columns: 28px 28px 1fr; padding: 13px 11px; }
  .accountability, .action-details { grid-column: 3; }
  .handoff-grid { grid-template-columns: 1fr; }
  .handoff-flow, .carry-list { grid-template-columns: 1fr; }
}

@media print {
  #applicationRoot, #printPreview .print-toolbar, .toast { display: none !important; }
  body { background: white; }
  #printPreview { display: block !important; max-width: none; margin: 0; padding: 0; }
}
