:root {
  --ink: #172333;
  --muted: #667588;
  --line: #dbe3eb;
  --paper: #ffffff;
  --bg: #f3f6f9;
  --navy: #17365d;
  --teal: #087f78;
  --teal-dark: #05645f;
  --teal-soft: #e8f7f5;
  --blue-soft: #eef4fb;
  --amber: #a86707;
  --amber-soft: #fff7df;
  --red: #b42318;
  --red-soft: #fff0ee;
  --green: #137a46;
  --green-soft: #eaf8f0;
  --shadow: 0 18px 55px rgba(31, 48, 70, 0.09);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--ink); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.topbar {
  min-height: 108px; padding: 22px clamp(22px, 5vw, 72px); display: flex; align-items: center; gap: 18px;
  background: linear-gradient(105deg, #102b4e 0%, #173d67 62%, #165c6d 100%); color: white;
}
.brand-mark { width: 58px; height: 58px; border: 1px solid rgba(255,255,255,.25); border-radius: 16px; display: grid; place-items: center; background: rgba(255,255,255,.08); }
.brand-mark { text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; }
.brand-mark:hover { transform: translateY(-1px); box-shadow: 0 5px 15px rgba(8,127,120,.12); }
.brand-mark:active { transform: scale(.97); }
.brand-mark svg { width: 34px; height: 34px; fill: none; stroke: #71e0d2; stroke-width: 2.2; stroke-linecap: round; }
.eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .18em; color: #8ee5db; font-weight: 800; margin-bottom: 3px; }
h1 { margin: 0; font-size: clamp(25px, 3vw, 36px); letter-spacing: -.03em; }
.topbar p { margin: 5px 0 0; color: #c7d4e2; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.offline-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px; background: rgba(255,255,255,.11); font-size: 13px; }
.offline-pill span { width: 8px; height: 8px; border-radius: 50%; background: #61df9c; box-shadow: 0 0 0 4px rgba(97,223,156,.13); }
.topbar .ghost-button { color: white; border-color: rgba(255,255,255,.26); }

.shell { width: min(1440px, calc(100% - 40px)); margin: 28px auto 48px; display: grid; grid-template-columns: 260px minmax(0,1fr); gap: 24px; align-items: start; }
.step-rail, .workspace { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.step-rail { padding: 18px; position: sticky; top: 18px; }
.rail-heading { padding: 4px 8px 13px; font-size: 12px; text-transform: uppercase; letter-spacing: .14em; font-weight: 800; color: var(--muted); }
.rail-step { position: relative; width: 100%; display: grid; grid-template-columns: 32px 1fr; gap: 0 10px; text-align: left; border: 0; background: transparent; padding: 10px 8px; border-radius: 11px; color: var(--muted); cursor: pointer; }
.rail-step span { grid-row: 1 / span 2; width: 28px; height: 28px; border-radius: 50%; border: 1px solid #c8d3df; display: grid; place-items: center; font-weight: 800; font-size: 12px; background: white; }
.rail-step b { font-size: 14px; color: #4f5f70; }
.rail-step small { margin-top: 2px; }
.rail-step.active { background: var(--teal-soft); }
.rail-step.active span { background: var(--teal); color: white; border-color: var(--teal); }
.rail-step.active b { color: var(--teal-dark); }
.rail-step.completed span { background: #dff3eb; color: var(--green); border-color: #a9dac1; }
.reference-card { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.reference-label { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; font-weight: 800; color: var(--muted); margin: 0 7px 7px; }
.amm-link { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; text-decoration: none; padding: 11px; border: 1px solid #b8dcd7; background: #f4fbfa; color: var(--ink); border-radius: 12px; }
.reference-card .amm-link + .amm-link { margin-top: 8px; }
.amm-link span { grid-row: 1 / span 2; background: var(--teal); color: white; border-radius: 7px; padding: 7px 6px; font-size: 10px; font-weight: 800; align-self: center; }
.amm-link b { font-size: 12px; }
.amm-link small { color: var(--teal-dark); }

.workspace { overflow: hidden; min-height: 720px; }
.progress { height: 5px; background: #e9eef3; }
.progress div { height: 100%; width: 25%; background: linear-gradient(90deg, var(--teal), #25ae9f); transition: width .25s ease; }
.step-panel { display: none; padding: clamp(24px, 4vw, 52px); }
.step-panel.active { display: block; animation: enter .2s ease-out; }
@keyframes enter { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.section-kicker { text-transform: uppercase; letter-spacing: .15em; font-size: 11px; font-weight: 850; color: var(--teal); }
h2 { margin: 8px 0 10px; font-size: clamp(26px, 3vw, 38px); letter-spacing: -.035em; }
.lead { margin: 0 0 28px; color: var(--muted); line-height: 1.65; max-width: 860px; }
h3 { margin: 0 0 14px; }

.question-list { display: grid; gap: 10px; }
.question-row { margin: 0; border: 1px solid var(--line); border-radius: 12px; padding: 15px 17px; display: grid; grid-template-columns: minmax(260px,1fr) auto auto; align-items: center; gap: 16px; }
.question-row legend { float: left; width: auto; font-weight: 700; padding: 0; }
.question-row label { display: inline-flex; align-items: center; gap: 7px; color: #4e5e6f; white-space: nowrap; }
input[type="radio"] { accent-color: var(--teal); width: 17px; height: 17px; }

.form-grid { display: grid; gap: 16px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
.form-grid.three { grid-template-columns: 1fr 1fr auto; align-items: end; }
.form-grid.four { grid-template-columns: repeat(4, minmax(0,1fr)); }
.field { display: grid; gap: 7px; }
.field span { font-size: 13px; font-weight: 750; color: #4c5b6b; }
.field em { font-weight: 500; color: #8a96a3; }
.field input, .field select { width: 100%; height: 46px; padding: 0 13px; border: 1px solid #cdd8e2; border-radius: 10px; color: var(--ink); background: #fff; outline: none; }
.field input:focus, .field select:focus, .sequence-table input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(8,127,120,.12); }
.field small { color: var(--muted); }
.subsection { border-top: 1px solid var(--line); margin-top: 28px; padding-top: 24px; }
.choice-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.choice-card { border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; gap: 11px; cursor: pointer; }
.choice-card:has(input:checked) { border-color: var(--teal); background: var(--teal-soft); box-shadow: inset 0 0 0 1px var(--teal); }
.choice-card span { display: grid; gap: 4px; }
.choice-card small { color: var(--muted); }
.mass-calculator { margin-top: 15px; background: #f7f9fb; border: 1px solid var(--line); border-radius: 12px; padding: 0 16px; }
.mass-calculator summary { cursor: pointer; padding: 14px 0; font-weight: 700; color: #4c5b6b; }
.mass-calculator[open] { padding-bottom: 15px; }
.calculator-button { height: 46px; }
.micro-message { margin-top: 9px; color: var(--teal-dark); font-size: 13px; }

.amm-instruction { display: grid; grid-template-columns: 42px 1fr; gap: 15px; align-items: start; padding: 18px; border: 1px solid #add9d4; border-radius: 14px; background: linear-gradient(135deg,#f1fbfa,#f8fcff); margin-bottom: 18px; }
.amm-instruction.compact { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; margin: 0; background: #f5fbfa; }
.instruction-number { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--teal); color: white; font-weight: 850; }
.amm-instruction b { font-size: 16px; color: var(--teal-dark); }
.amm-instruction p { margin: 5px 0 0; color: #526576; line-height: 1.55; }
.value-entry-card { border: 1px solid var(--line); border-radius: 14px; padding: 18px; background: white; }
.example-callout { margin-top: 14px; display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
.guided-value-grid { display: grid; gap: 16px; }
.guided-value-card { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: white; }
.form-grid.three-value { grid-template-columns: repeat(3,minmax(0,1fr)); padding: 18px; }
.formula-preview { margin-top: 16px; padding: 15px 18px; display: flex; justify-content: space-between; gap: 12px; border-radius: 11px; color: #425568; background: var(--blue-soft); border: 1px solid #ccdae9; }
.formula-preview span { text-transform: uppercase; letter-spacing: .1em; font-size: 10px; font-weight: 800; color: var(--muted); }
.amm-rule-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.amm-rule-check { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.rule-status { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; font-size: 12px; font-weight: 900; }
.amm-rule-check b { font-size: 11px; }.amm-rule-check p { margin: 3px 0; color: #526576; font-size: 10px; line-height: 1.4; }.amm-rule-check small { font-size: 9px; font-weight: 700; }
.amm-rule-check.valid { border-color: #b8dfca; background: #f7fcf9; }.amm-rule-check.valid .rule-status { background: var(--green-soft); color: var(--green); }.amm-rule-check.valid small { color: var(--green); }
.amm-rule-check.pending .rule-status { background: var(--blue-soft); color: #4f708f; }.amm-rule-check.pending small { color: #64798d; }
.amm-rule-check.invalid { border-color: #efbbb5; background: var(--red-soft); }.amm-rule-check.invalid .rule-status { background: #f7c9c4; color: var(--red); }.amm-rule-check.invalid small { color: var(--red); }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.legend { margin-left: auto; color: var(--muted); font-size: 12px; display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-left: 8px; }
.pre-dot { background: #7697c3; }.post-dot { background: #18a393; }
.sequence-wrap, .rise-table-wrap { border: 1px solid var(--line); border-radius: 13px; overflow: auto; max-height: 470px; }
table { border-collapse: collapse; width: 100%; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); background: #f6f8fa; position: sticky; top: 0; z-index: 2; }
th, td { padding: 9px 12px; border-bottom: 1px solid #e8edf2; }
th small { text-transform: none; letter-spacing: 0; }
.sequence-table tr.phase-post { background: #f5fbfa; }
.sequence-table tr.phase-start td { border-top: 2px solid #8ad1c8; }
.line-chip { font-weight: 850; color: var(--navy); }
.sequence-table input { width: 100%; min-width: 92px; height: 34px; border: 1px solid #d5dfe8; border-radius: 7px; padding: 0 9px; outline: none; }

.method-note { border-left: 4px solid #e0a125; background: var(--amber-soft); color: #6b4d10; border-radius: 8px; padding: 13px 15px; margin-bottom: 18px; line-height: 1.5; }
.touchdown-layout { display: grid; grid-template-columns: minmax(0,1fr) 260px; gap: 18px; align-items: start; }
.rise-table-wrap { max-height: 460px; }
.rise-table tbody tr { cursor: pointer; }
.rise-table tbody tr:hover { background: #f3f8f8; }
.rise-table tr.selected-rise { background: #e1f5f2; }
.rise-table tr.second-rise { background: #f0faf8; }
.rise-table tr.touchdown-row { background: #fff3d6; }
.rise-table td.delta-strong { color: var(--teal-dark); font-weight: 850; }
.selection-card { border: 1px solid var(--line); border-radius: 14px; padding: 18px; background: #fafcfd; position: sticky; top: 18px; }
.selection-label { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 850; }
.selection-value { font-size: 28px; font-weight: 850; margin: 6px 0; color: var(--teal-dark); }
.selection-card p { color: var(--muted); line-height: 1.5; font-size: 13px; }
.selection-card hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.touchdown-value { margin-top: 6px; font-weight: 850; font-size: 18px; color: var(--amber); }

.inline-message { margin-top: 16px; padding: 12px 14px; border-radius: 9px; background: var(--red-soft); color: #8f261d; border: 1px solid #f0c1bb; font-size: 13px; line-height: 1.5; }
.inline-message.neutral { background: var(--blue-soft); color: #355776; border-color: #ccdae9; }
.inline-message.success { background: var(--green-soft); color: #19643f; border-color: #bfe0ce; }
.panel-actions { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.panel-actions > div { display: flex; gap: 10px; }
button, .primary-button, .secondary-button { border-radius: 9px; min-height: 42px; padding: 0 16px; font-weight: 750; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.primary-button { border: 1px solid var(--teal); background: var(--teal); color: white; }
.primary-button:hover { background: var(--teal-dark); }
.secondary-button { border: 1px solid #cbd6e0; background: white; color: #405266; }
.ghost-button { border: 1px solid #cbd6e0; background: transparent; color: #405266; min-height: 38px; }
.sample-button { border: 1px solid #9fcfc9; background: var(--teal-soft); color: var(--teal-dark); min-height: 38px; }

.result-hero { border: 1px solid var(--line); border-radius: 16px; padding: clamp(22px,4vw,38px); display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; }
.result-hero.zone-1 { background: var(--green-soft); border-color: #b5dfc8; }
.result-hero.zone-2 { background: var(--amber-soft); border-color: #ead79b; }
.result-hero.zone-3, .result-hero.blocked { background: var(--red-soft); border-color: #efbbb5; }
.zone-disc { width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; background: white; border: 7px solid currentColor; font-size: 38px; font-weight: 900; }
.zone-1 .zone-disc { color: var(--green); }.zone-2 .zone-disc { color: var(--amber); }.zone-3 .zone-disc,.blocked .zone-disc { color: var(--red); }
.result-hero h2 { margin: 2px 0 6px; }
.result-hero p { margin: 0; line-height: 1.55; color: #4f5e6c; }
.result-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-top: 18px; }
.metric { border: 1px solid var(--line); border-radius: 12px; background: white; padding: 15px; }
.metric span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 750; }
.metric b { display: block; font-size: 22px; margin-top: 6px; }
.metric small { display: block; margin-top: 5px; color: var(--muted); }
.metric b.metric-small { font-size: 15px; line-height: 1.35; }
.calculation-card { margin-top: 18px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.calculation-card h3 { margin: 0; padding: 14px 17px; background: #f6f8fa; border-bottom: 1px solid var(--line); }
.calculation-steps { display: grid; grid-template-columns: repeat(4,1fr); }
.calculation-step { padding: 16px; border-right: 1px solid var(--line); }
.calculation-step:last-child { border-right: 0; }
.calculation-step span { display: inline-grid; place-items: center; width: 23px; height: 23px; border-radius: 50%; background: var(--navy); color: white; font-size: 11px; font-weight: 800; }
.calculation-step b { display: block; margin: 8px 0 4px; font-size: 13px; }
.calculation-step small { color: var(--muted); line-height: 1.45; }
.action-card { margin-top: 18px; padding: 17px; border-left: 4px solid var(--navy); border-radius: 8px; background: var(--blue-soft); }
.action-card b { display: block; margin-bottom: 5px; }
.next-action-card { margin-top: 13px; padding: 15px; border-radius: 11px; border: 1px solid var(--line); background: #fff; }
.next-action-card.zone-action-2 { border-left: 5px solid #d2a433; background: #fffbef; }
.next-action-card.zone-action-3 { border-left: 5px solid var(--red); background: #fff6f5; }
.next-action-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.next-action-heading span { font-size: 9px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 850; }
.next-action-heading b { font-size: 14px; }
.next-action-card ol { margin: 11px 0 0 20px; padding: 0; color: #405266; font-size: 10px; line-height: 1.5; }
.next-action-card li { padding-left: 4px; margin: 4px 0; }
.action-refs { margin-top: 11px; display: flex; flex-wrap: wrap; gap: 8px; }
.action-ref { display: inline-flex; align-items: center; min-height: 30px; padding: 0 10px; border: 1px solid #a9d3ce; border-radius: 7px; color: var(--teal-dark); background: #fff; text-decoration: none; font-size: 9px; font-weight: 800; }
.zone-diagram-card { margin-top: 18px; border: 1px solid var(--line); border-radius: 14px; padding: 18px; background: #fff; }
.diagram-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.diagram-heading > div:first-child { display: grid; gap: 4px; }
.diagram-heading span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; font-weight: 800; }
.diagram-heading b { font-size: 14px; }
.diagram-result { padding: 8px 12px; border-radius: 999px; font-size: 13px; font-weight: 850; }
.zone-badge-1 { color: #0c6338; background: var(--green-soft); }.zone-badge-2 { color: #765008; background: var(--amber-soft); }.zone-badge-3 { color: #8f261d; background: var(--red-soft); }
.zone-diagram { width: 100%; max-height: 500px; margin-top: 8px; overflow: visible; }
.plot-zone-1 { fill: #c9efd9; stroke: #5fba83; stroke-width: 2; }.plot-zone-2 { fill: #ffe6a3; stroke: #d2a433; stroke-width: 2; }.plot-zone-3 { fill: #ffd0cb; stroke: #d7766c; stroke-width: 2; }
.grid-line { stroke: rgba(41,58,75,.17); stroke-width: 1; }.axis-line { stroke: #30465b; stroke-width: 2; }
.axis-tick { fill: #526576; font-size: 11px; text-anchor: middle; }.axis-tick.y-tick { text-anchor: end; }
.axis-label { fill: #32475c; font-size: 12px; font-weight: 750; text-anchor: middle; }.vertical-label { transform: rotate(-90deg); transform-origin: 16px center; }
.zone-label { fill: rgba(22,35,48,.68); font-size: 13px; font-weight: 900; text-anchor: middle; }
.point-guide { stroke: #102b4e; stroke-width: 1.5; stroke-dasharray: 5 4; }.result-point { fill: #fff; stroke: #102b4e; stroke-width: 4; }.result-point-core { fill: #102b4e; }
.diagram-values { display: flex; justify-content: center; gap: 28px; padding-top: 8px; color: var(--muted); }.diagram-values b { color: var(--ink); margin-left: 4px; }
.reference-strip { margin-top: 20px; display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; gap: 10px; }
.reference-box { display: grid; gap: 4px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: #fff; text-decoration: none; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.reference-box:hover { border-color: #8dcac3; box-shadow: 0 5px 16px rgba(8,127,120,.08); transform: translateY(-1px); }
.reference-box:active { transform: scale(.995); }
.reference-strip span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; font-weight: 750; }
.reference-strip b { font-size: 12px; }
.reference-strip small { color: var(--teal-dark); font-size: 9px; font-weight: 750; }

footer { width: min(1440px,calc(100% - 40px)); margin: 0 auto 30px; display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }

/* Compact white CLP interface */
:root { font-size: 14px; background: #f7f9fb; }
body { background: #f7f9fb; }
.topbar {
  min-height: 78px; padding: 13px clamp(18px,4vw,54px); gap: 14px;
  background: #fff; color: var(--ink); border-bottom: 1px solid var(--line);
}
.brand-mark { width: 48px; height: 48px; border-radius: 13px; border-color: #b9ddd8; background: var(--teal-soft); }
.brand-mark svg { width: 29px; height: 29px; stroke: var(--teal); }
.eyebrow { font-size: 9px; color: var(--teal); margin-bottom: 2px; }
h1 { font-size: clamp(21px,2.2vw,28px); color: var(--ink); }
.topbar p { margin-top: 3px; color: var(--muted); font-size: 12px; }
.offline-pill { padding: 7px 10px; color: #286243; background: var(--green-soft); font-size: 11px; }
.topbar .ghost-button { min-height: 34px; padding: 0 12px; color: #405266; border-color: #cbd6e0; background: #fff; font-size: 12px; }
.shell { width: min(1240px,calc(100% - 32px)); margin: 18px auto 36px; grid-template-columns: 220px minmax(0,1fr); gap: 16px; }
.step-rail,.workspace { border-radius: 14px; box-shadow: 0 9px 28px rgba(31,48,70,.06); }
.step-rail { padding: 13px; top: 12px; }
.rail-heading { padding: 3px 7px 9px; font-size: 10px; }
.rail-step { grid-template-columns: 29px 1fr; padding: 8px 7px; gap: 0 8px; }
.rail-step span { width: 25px; height: 25px; font-size: 10px; }
.rail-step b { font-size: 12px; }
.rail-step small { font-size: 9px; }
.reference-card { margin-top: 12px; padding-top: 12px; }
.amm-link { padding: 9px; }
.workspace { min-height: 590px; }
.step-panel { padding: clamp(22px,3vw,38px); }
.section-kicker { font-size: 9px; }
h2 { margin: 6px 0 8px; font-size: clamp(18px,2vw,23px); }
.lead { margin-bottom: 20px; font-size: 13px; line-height: 1.5; }
h3 { font-size: 15px; }
.field span { font-size: 11px; }
.field input,.field select { height: 41px; padding: 0 11px; border-radius: 8px; font-size: 13px; }
.field small { font-size: 9px; }
.subsection { margin-top: 21px; padding-top: 18px; }
.choice-card { padding: 12px; border-radius: 10px; }
.choice-card b { font-size: 12px; }
.choice-card small { font-size: 10px; }
.mass-calculator { margin-top: 11px; border-radius: 10px; }
.mass-calculator summary { padding: 11px 0; font-size: 12px; }
.amm-instruction { grid-template-columns: 34px 1fr; gap: 12px; padding: 14px; border-radius: 11px; margin-bottom: 14px; }
.instruction-number { width: 30px; height: 30px; font-size: 12px; }
.amm-instruction b { font-size: 13px; }
.amm-instruction p { margin-top: 4px; font-size: 12px; line-height: 1.45; }
.value-entry-card,.form-grid.three-value { padding: 14px; }
.guided-value-grid { gap: 12px; }
.guided-value-card { border-radius: 11px; }
.example-callout { margin-top: 10px; font-size: 10px; }
.formula-preview { margin-top: 12px; padding: 12px 14px; font-size: 12px; }
.inline-message { margin-top: 12px; padding: 10px 12px; font-size: 11px; }
.panel-actions { margin-top: 20px; padding-top: 14px; }
button,.primary-button,.secondary-button { min-height: 38px; padding: 0 14px; border-radius: 8px; font-size: 12px; }
.result-hero { padding: 24px; border-radius: 13px; }
.zone-disc { width: 72px; height: 72px; border-width: 5px; font-size: 30px; }
.result-hero p { font-size: 12px; }
.result-grid { margin-top: 13px; gap: 9px; }
.metric { padding: 12px; border-radius: 10px; }
.metric span { font-size: 9px; }.metric b { font-size: 18px; }.metric small { font-size: 9px; }
.calculation-card,.zone-diagram-card { margin-top: 13px; border-radius: 11px; }
.calculation-card h3 { padding: 11px 14px; font-size: 13px; }
.calculation-step { padding: 13px; }
.calculation-step b { font-size: 11px; }.calculation-step small { font-size: 9px; }
.zone-diagram-card { padding: 14px; }
.zone-diagram { max-height: 390px; }
.action-card { margin-top: 13px; padding: 13px; font-size: 11px; }
.reference-strip { margin-top: 14px; padding: 0; }
footer { width: min(1240px,calc(100% - 32px)); margin-bottom: 20px; font-size: 9px; }

/* Assessment selector */
.mode-chooser { width: min(1000px,calc(100% - 32px)); margin: 34px auto 48px; }
.mode-heading { text-align: center; max-width: 720px; margin: 0 auto 24px; }
.mode-heading h2 { margin-top: 7px; }
.mode-heading p { margin: 0; color: var(--muted); line-height: 1.55; font-size: 13px; }
.mode-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.mode-card { min-height: 230px; display: grid; grid-template-columns: 58px 1fr; grid-template-rows: 1fr auto; gap: 16px; padding: 26px; text-align: left; border: 1px solid var(--line); border-radius: 17px; background: #fff; color: var(--ink); box-shadow: var(--shadow); transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.mode-card:hover { transform: translateY(-3px); box-shadow: 0 20px 52px rgba(31,48,70,.13); }
.mode-icon { width: 58px; height: 58px; border-radius: 15px; display: grid; place-items: center; }
.mode-icon svg { width: 36px; height: 36px; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.landing-mode-card { border-top: 4px solid var(--teal); }.landing-mode-card .mode-icon { background: var(--teal-soft); }.landing-mode-card svg { stroke: var(--teal); }
.turbulence-mode-card { border-top: 4px solid #5b4bb7; }.turbulence-mode-card .mode-icon { background: #f0eefe; }.turbulence-mode-card svg { stroke: #5b4bb7; }
.mode-copy { display: grid; align-content: start; gap: 7px; }
.mode-copy small { text-transform: uppercase; letter-spacing: .1em; font-size: 9px; font-style: normal; font-weight: 850; color: var(--muted); }
.mode-copy b { font-size: 20px; line-height: 1.2; }
.mode-copy em { color: var(--muted); font-size: 12px; line-height: 1.55; font-style: normal; }
.mode-arrow { grid-column: 2; align-self: end; font-size: 11px; font-weight: 800; color: var(--teal-dark); }
.turbulence-mode-card .mode-arrow { color: #40358a; }

/* Excessive-turbulence branch */
.turbulence-workflow {
  --teal: #5b4bb7;
  --teal-dark: #40358a;
  --teal-soft: #f0eefe;
}
.turbulence-workflow .amm-link { border-color: #d0c9f1; background: #f8f7fe; }
.turbulence-workflow .reference-box:hover { border-color: #a99ee1; box-shadow: 0 5px 16px rgba(91,75,183,.1); }
.weight-result-card { margin-top: 13px; border-radius: 11px; padding: 14px 16px; display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; align-items: center; }
.weight-result-card span { grid-row: 1 / span 2; text-transform: uppercase; letter-spacing: .1em; font-size: 9px; font-weight: 850; color: var(--muted); }
.weight-result-card b { font-size: 18px; }.weight-result-card small { color: var(--muted); font-size: 9px; }
.weight-result-card.pending { border: 1px solid var(--line); background: #f7f9fb; }.weight-result-card.valid { border: 1px solid #d0c9f1; background: #f8f7fe; }
.turbulence-weight-formula { border-color: #d5d0ef; background: #faf9ff; }
.turbulence-value-grid { grid-template-columns: 1fr 1fr; }
.single-value-field { padding: 14px; }
.lateral-check-card { margin-top: 12px; display: grid; grid-template-columns: 32px minmax(0,1fr) minmax(210px,.65fr); gap: 12px; align-items: center; border: 1px solid #d5d0ef; border-radius: 11px; padding: 14px; background: #faf9ff; }
.lateral-check-card > div:nth-child(2) b { color: var(--teal-dark); font-size: 12px; }.lateral-check-card p { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.turbulence-formula-guide { margin-top: 12px; border: 1px solid #d5d0ef; border-radius: 11px; overflow: hidden; background: #fff; }
.formula-guide-heading { display: flex; justify-content: space-between; gap: 14px; padding: 11px 13px; background: #f8f7fe; border-bottom: 1px solid #e2def6; }
.formula-guide-heading span { color: #5143a3; font-size: 9px; text-transform: uppercase; letter-spacing: .09em; font-weight: 850; }
.formula-guide-heading b { color: #40358a; font-size: 10px; }
.formula-guide-steps { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); }
.formula-guide-steps > div { display: grid; grid-template-columns: 23px 1fr; gap: 7px; padding: 11px; border-right: 1px solid var(--line); }
.formula-guide-steps > div:last-child { border-right: 0; }
.formula-guide-steps > div > span { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: #f0eefe; color: #5143a3; font-size: 9px; font-weight: 900; }
.formula-guide-steps p { margin: 0; color: var(--muted); font-size: 8px; line-height: 1.45; }
.formula-guide-steps p b { display: block; margin-bottom: 2px; color: var(--ink); font-size: 9px; }
.threshold-preview { margin-top: 12px; display: grid; grid-template-columns: repeat(3,1fr); border: 1px solid var(--line); border-radius: 11px; background: #fff; overflow: hidden; }
.threshold-preview:empty { display: none; }
.threshold-preview > div { padding: 12px; border-right: 1px solid var(--line); display: grid; gap: 4px; }.threshold-preview > div:nth-child(3) { border-right: 0; }
.threshold-preview span { color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; }.threshold-preview b { font-size: 10px; }
.threshold-preview > small { grid-column: 1 / -1; padding: 8px 12px; background: #f7f9fb; color: var(--muted); font-size: 8px; border-top: 1px solid var(--line); }
.turbulence-result .colour-disc { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: white; border: 5px solid currentColor; }
.turbulence-result .colour-disc span { width: 24px; height: 24px; border-radius: 50%; background: currentColor; }
.turbulence-result.green { background: var(--green-soft); border-color: #b5dfc8; color: var(--green); }
.turbulence-result.amber { background: var(--amber-soft); border-color: #ead79b; color: var(--amber); }
.turbulence-result.red { background: var(--red-soft); border-color: #efbbb5; color: var(--red); }
.turbulence-result > div:last-child { color: var(--ink); }
.turbulence-audit .calculation-step span { background: #5143a3; }
.turbulence-action-green { border-left: 5px solid var(--green); background: #f5fcf8; }
.action-copy { color: #405266; font-size: 10px; line-height: 1.5; margin: 10px 0 0; }
.parallel-action-card { margin-top: 10px; display: grid; grid-template-columns: 30px 1fr; gap: 11px; align-items: start; padding: 13px; border-radius: 10px; border: 1px solid var(--line); }
.parallel-action-card.required { background: #fff7e9; border-color: #e8cf93; }.parallel-action-card.clear { background: #f4fbf7; border-color: #b8dfca; }
.parallel-icon { width: 27px; height: 27px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; }.required .parallel-icon { color: #7a5207; background: #ffe5a1; }.clear .parallel-icon { color: var(--green); background: #dff3e8; }
.parallel-action-card b { font-size: 11px; }.parallel-action-card p { margin: 4px 0 0; color: #4d5f71; font-size: 9px; line-height: 1.5; }
.turbulence-diagram-card { border-top: 4px solid #5b4bb7; }
.turbulence-badge-green { color: #0c6338; background: var(--green-soft); }.turbulence-badge-amber { color: #765008; background: var(--amber-soft); }.turbulence-badge-red { color: #8f261d; background: var(--red-soft); }
.turbulence-point { fill: #fff; stroke: #172f52; stroke-width: 4; }.minimum-point { stroke: #5b4bb7; }
.point-label { fill: #273b50; font-size: 9px; font-weight: 850; }
.diagram-scale-note { margin-top: 8px; padding: 8px 10px; border-radius: 7px; background: var(--blue-soft); color: #486079; font-size: 8px; text-align: center; }

/* In-page technical-manual viewer */
body.manual-viewer-open { overflow: hidden; }
.manual-viewer {
  position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center;
  padding: max(12px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));
  background: rgba(20,31,45,.56); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
.manual-viewer-window {
  width: min(1500px,100%); height: min(980px,100%); overflow: hidden;
  display: grid; grid-template-rows: auto minmax(0,1fr); background: #fff;
  border: 1px solid #cfd8e2; border-radius: 14px; box-shadow: 0 24px 80px rgba(12,25,42,.3);
}
.manual-viewer-bar {
  min-height: 56px; display: flex; align-items: center; gap: 14px; padding: 8px 10px 8px 15px;
  background: #f8fafc; border-bottom: 1px solid #dbe3eb;
}
.manual-viewer-heading { min-width: 0; display: grid; gap: 2px; }
.manual-viewer-heading span { color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .12em; font-weight: 850; }
.manual-viewer-heading b { max-width: min(720px,52vw); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-size: 11px; }
.manual-viewer-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.manual-viewer-button {
  min-height: 38px; padding: 0 13px; border: 1px solid #c9d5e0; border-radius: 8px;
  background: #fff; color: #33485d; font-size: 11px; font-weight: 800; cursor: pointer;
}
.manual-viewer-button:hover { border-color: #84bbb5; color: var(--teal-dark); background: #f6fbfa; }
.manual-viewer-button.close { border-color: #e2c7c3; color: #8f2b23; }
.manual-viewer-frame { width: 100%; height: 100%; border: 0; background: #fff; }

@media (max-width: 980px) {
  .mode-cards { grid-template-columns: 1fr; }
  .shell { width: min(100% - 20px,1240px); grid-template-columns: clamp(168px,22vw,190px) minmax(0,1fr); gap: 12px; }
  .step-rail { position: sticky; top: 10px; display: block; overflow: visible; padding: 10px; }
  .rail-heading,.reference-card { display: block; }
  .rail-step { min-width: 0; padding: 8px 6px; grid-template-columns: 27px 1fr; gap: 0 7px; }
  .rail-step span { width: 24px; height: 24px; }
  .rail-step b { font-size: 11px; line-height: 1.2; }
  .rail-step small { font-size: 8px; line-height: 1.25; }
  .reference-label { margin-inline: 4px; font-size: 8px; }
  .amm-link { grid-template-columns: 1fr; gap: 4px; padding: 8px; }
  .amm-link span { grid-row: auto; justify-self: start; padding: 5px 6px; }
  .amm-link b { overflow-wrap: anywhere; font-size: 10px; }
  .amm-link small { font-size: 8px; }
  .touchdown-layout { grid-template-columns: 1fr; }
  .selection-card { position: static; }
  .result-grid { grid-template-columns: 1fr 1fr; }
  .calculation-steps { grid-template-columns: 1fr 1fr; }
  .calculation-step:nth-child(2) { border-right: 0; }
  .calculation-step:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .reference-strip { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .topbar { align-items: flex-start; flex-wrap: wrap; }
  .top-actions { width: 100%; margin-left: 76px; }
  .shell { width: min(100% - 20px,1440px); margin-top: 12px; grid-template-columns: 1fr; }
  .step-rail { position: static; display: flex; overflow-x: auto; gap: 5px; }
  .rail-heading,.reference-card { display: none; }
  .rail-step { min-width: 145px; }
  .step-panel { padding: 23px 17px; }
  .question-row { grid-template-columns: 1fr; gap: 9px; }
  .question-row legend { margin-bottom: 4px; }
  .form-grid.two,.form-grid.three,.form-grid.four,.form-grid.three-value,.choice-cards { grid-template-columns: 1fr; }
  .turbulence-value-grid,.threshold-preview { grid-template-columns: 1fr; }
  .formula-guide-heading { flex-direction: column; gap: 4px; }
  .formula-guide-steps { grid-template-columns: 1fr 1fr; }
  .formula-guide-steps > div:nth-child(2) { border-right: 0; }
  .formula-guide-steps > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .threshold-preview > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .lateral-check-card { grid-template-columns: 32px 1fr; }.lateral-check-card .field { grid-column: 1 / -1; }
  .mode-card { grid-template-columns: 50px 1fr; padding: 20px; }.mode-icon { width: 50px; height: 50px; }
  .example-callout,.formula-preview,.diagram-heading { align-items: flex-start; flex-direction: column; }
  .amm-rule-checks { grid-template-columns: 1fr; }
  .result-hero { grid-template-columns: 1fr; }
  .zone-disc { width: 72px; height: 72px; font-size: 30px; }
  .result-grid,.calculation-steps { grid-template-columns: 1fr; }
  .calculation-step { border-right: 0; border-bottom: 1px solid var(--line); }
  .reference-strip { grid-template-columns: 1fr; }
  footer { flex-direction: column; gap: 5px; width: calc(100% - 20px); }
  .manual-viewer { padding: 0; place-items: stretch; }
  .manual-viewer-window { width: 100%; height: 100%; border: 0; border-radius: 0; }
  .manual-viewer-bar { padding-top: max(8px,env(safe-area-inset-top)); padding-right: max(8px,env(safe-area-inset-right)); padding-left: max(10px,env(safe-area-inset-left)); }
  .manual-viewer-heading b { max-width: 34vw; }
  .manual-viewer-button { min-height: 40px; padding-inline: 10px; }
}

@media print {
  .top-actions,.step-rail,.progress,.panel-actions,.reference-strip,footer,.mode-chooser,.manual-viewer { display: none !important; }
  .topbar { color: #111; background: white; border-bottom: 1px solid #bbb; padding: 16px 0; }
  .brand-mark { border-color: #bbb; }.topbar p,.eyebrow { color: #444; }
  .shell { display: block; width: 100%; margin: 0; }.workspace { border: 0; box-shadow: none; }
  .step-panel { display: none !important; padding: 20px 0; }.step-panel[data-step="4"] { display: block !important; }
  #turbulenceWorkflow .t-step-panel[data-t-step="4"] { display: block !important; }
}
