:root {
  --page: var(--HALO_CERAMIC);
  --page-deep: var(--HALO_MIST);
  --surface: var(--HALO_PAPER);
  --ink: var(--HALO_INK);
  --steel: var(--HALO_STEEL);
  --steel-soft: var(--HALO_CONTROL_NAVY_SECONDARY);
  --muted: var(--HALO_STEEL_MID);
  --rule: color-mix(in srgb, var(--HALO_SILVER) 78%, transparent);
  --rule-strong: color-mix(in srgb, var(--HALO_STEEL) 56%, transparent);
  --warm: var(--HALO_ELECTRIC_COBALT);
  --warm-on-dark: var(--HALO_REFRACTION_CYAN);
  --warm-soft: color-mix(in srgb, var(--HALO_ELECTRIC_COBALT) 12%, transparent);
}

*, *::before, *::after { box-sizing: border-box; }
html { min-width: 0; background: var(--page-deep); }
body { min-width: 0; margin: 0; background: var(--page); color: var(--ink); font-family: var(--HALO_FONT_BODY); font-size: 16px; line-height: 1.4; overflow-x: hidden; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
.boundary-page { min-height: 100vh; background: var(--page); }
.boundary-header, main, .boundary-footer { width: min(1200px, calc(100% - 48px)); margin-inline: auto; }

.boundary-header { display: flex; width: 100%; min-height: 72px; align-items: center; gap: 24px; padding-inline: max(24px, calc((100% - 1200px) / 2)); border-bottom: 1px solid color-mix(in srgb, var(--HALO_REFRACTION_CYAN) 28%, var(--HALO_CONTROL_NAVY)); background: var(--HALO_CONTROL_NAVY); }
.boundary-brand { display: inline-flex; flex: 0 0 auto; align-items: center; }
.boundary-brand img { display: block; width: 92px; height: auto; }
.boundary-descriptor { margin: 0; color: var(--HALO_STEEL_MID); font-size: 0.72rem; letter-spacing: 0.08em; }
.boundary-header-mark { margin-left: auto; color: var(--HALO_REFRACTION_CYAN); font-family: var(--HALO_FONT_TECHNICAL); font-size: 0.58rem; letter-spacing: 0.14em; }

.boundary-instrument { margin: 28px 0 0; border: 1px solid var(--rule-strong); border-inline-start: 3px solid var(--HALO_SIGNAL_RED); background: var(--surface); box-shadow: -1px 0 0 var(--HALO_REFRACTION_CYAN); }
.instrument-view { outline: 0; }
.boundary-static-fallback { max-width: 780px; padding: clamp(28px, 5vw, 64px); }
.boundary-static-fallback h1 { margin: 7px 0 18px; color: var(--ink); font-family: var(--HALO_FONT_DISPLAY); font-size: clamp(2rem, 5vw, 4.25rem); font-weight: 600; letter-spacing: -0.055em; line-height: .96; }
.boundary-static-fallback p { max-width: 680px; color: var(--steel-soft); font-size: .92rem; line-height: 1.55; }
.boundary-static-fallback .primary-action { width: fit-content; margin-top: 12px; padding-inline: 18px; text-decoration: none; }
.mode-heading, .result-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 22px 26px 20px; border-bottom: 1px solid var(--rule); background: var(--HALO_PAPER); }
.section-kicker, .result-label, .decision-label { margin: 0; color: var(--warm); font-size: 0.6rem; font-weight: 700; letter-spacing: 0.15em; line-height: 1.3; text-transform: uppercase; }
.mode-heading h1, .result-heading h2 { margin: 5px 0 0; color: var(--ink); font-family: var(--HALO_FONT_DISPLAY); font-size: clamp(1.75rem, 3vw, 2.45rem); font-weight: 600; letter-spacing: -0.055em; line-height: 1; }
.mode-promise { margin: 5px 0 0; color: var(--ink); font-size: 0.98rem; }
.mode-support { margin: 5px 0 0; color: var(--muted); font-size: 0.78rem; }
.mode-safety, .result-mark { max-width: 280px; margin: 2px 0 0; color: var(--muted); font-size: 0.63rem; letter-spacing: 0.07em; line-height: 1.4; text-align: right; text-transform: uppercase; }
.mode-safety strong { color: var(--ink); }

.decision-row { display: grid; grid-template-columns: minmax(170px, 0.32fr) minmax(0, 1fr); align-items: center; gap: 18px; padding: 15px 26px; border-bottom: 1px solid var(--rule); }
.decision-prompt { margin: 3px 0 0; color: var(--steel-soft); font-size: 0.78rem; }
.decision-input, .context-textarea { width: 100%; border: 1px solid var(--rule-strong); border-radius: 0; outline: 0; background: var(--HALO_CERAMIC); color: var(--ink); }
.decision-input { min-height: 42px; padding: 8px 12px; }
.decision-input::placeholder, .context-textarea::placeholder { color: #75838c; }
.decision-input:focus, .context-textarea:focus { border-color: var(--HALO_ELECTRIC_COBALT); box-shadow: 0 0 0 3px color-mix(in srgb, var(--HALO_ELECTRIC_COBALT) 16%, transparent); }

.instrument-spine { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 9px; padding: 11px 26px; border-bottom: 1px solid var(--rule); background: var(--HALO_MIST); color: var(--steel); font-family: var(--HALO_FONT_TECHNICAL); font-size: 0.58rem; font-weight: 700; letter-spacing: 0.13em; }
.instrument-spine i { color: var(--warm); font-style: normal; }

.boundary-fields, .result-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); background: var(--HALO_MIST); }
.boundary-field, .result-item { min-width: 0; padding: 13px 19px 13px 26px; border-top: 1px solid var(--rule); }
.boundary-field:nth-child(even), .result-item:nth-child(even) { padding-right: 26px; padding-left: 19px; border-left: 1px solid var(--rule); }
.boundary-field:nth-child(4n + 1), .boundary-field:nth-child(4n + 2) { background: var(--HALO_PAPER); }
.boundary-field:nth-child(4n + 3), .boundary-field:nth-child(4n + 4) { background: color-mix(in srgb, var(--HALO_MIST) 72%, var(--HALO_PAPER)); }
.boundary-number { display: inline-block; margin-right: 8px; color: var(--HALO_ELECTRIC_COBALT); font-family: var(--HALO_FONT_TECHNICAL); font-size: 0.58rem; letter-spacing: 0.13em; vertical-align: middle; }
.boundary-field h2 { display: inline; margin: 0; color: var(--ink); font-family: var(--HALO_FONT_DISPLAY); font-size: 0.83rem; font-weight: 700; letter-spacing: 0.1em; }
.boundary-question { display: block; margin: 5px 0 9px; color: var(--steel-soft); font-size: 0.76rem; line-height: 1.25; }
.state-fieldset { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; min-width: 0; margin: 0; padding: 0; border: 0; }
.state-fieldset legend { margin-right: 3px; color: var(--muted); font-size: 0.56rem; letter-spacing: 0.1em; text-transform: uppercase; }
.state-choice { position: relative; }
.state-choice input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.state-choice label { display: inline-flex; min-height: 30px; align-items: center; padding: 5px 8px; border: 1px solid var(--rule-strong); color: var(--steel-soft); cursor: pointer; font-family: var(--HALO_FONT_TECHNICAL); font-size: 0.58rem; font-weight: 700; letter-spacing: 0.055em; line-height: 1; text-transform: uppercase; }
.state-choice label:hover { border-color: var(--steel); }
.state-choice input:focus-visible + label { outline: 2px solid var(--ink); outline-offset: 2px; }
.state-choice input:checked + label { border-color: var(--HALO_ELECTRIC_COBALT); background: var(--warm-soft); color: var(--ink); font-weight: 800; }
.state-choice input[value="UNKNOWN"]:checked + label { border-color: var(--HALO_STEEL); background: var(--HALO_MIST); color: var(--HALO_STEEL); }

.context-disclosure { margin-top: 8px; }
.context-disclosure summary { display: flex; width: fit-content; align-items: center; gap: 10px; color: var(--muted); cursor: pointer; font-size: 0.58rem; letter-spacing: 0.1em; list-style: none; text-transform: uppercase; }
.context-disclosure summary::-webkit-details-marker { display: none; }
.context-disclosure summary::before { content: "+"; color: var(--warm); font-size: 0.8rem; }
.context-disclosure[open] summary::before { content: "–"; }
.context-status { color: var(--warm); }
.context-textarea { min-height: 58px; margin-top: 8px; resize: vertical; padding: 7px 9px; font-size: 0.72rem; line-height: 1.3; }
.context-note { margin: 4px 0 0; color: var(--muted); font-size: 0.58rem; }

.build-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; padding: 16px 26px; border-top: 1px solid var(--rule-strong); background: var(--HALO_CONTROL_NAVY); }
.primary-action, .commercial-cta { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; border: 1px solid var(--warm); border-radius: 0; background: var(--warm); color: var(--surface); cursor: pointer; font-size: 0.65rem; font-weight: 800; letter-spacing: 0.1em; text-decoration: none; text-transform: uppercase; }
.primary-action { padding: 9px 15px; }
.primary-action:hover, .primary-action:focus-visible, .commercial-cta:hover, .commercial-cta:focus-visible { background: var(--HALO_CONTROL_NAVY_SECONDARY); }
.primary-action:focus-visible, .commercial-cta:focus-visible, .secondary-action:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.action-note { margin: 0; color: var(--HALO_STEEL_MID); font-family: var(--HALO_FONT_TECHNICAL); font-size: 0.62rem; }

.result-heading { padding-bottom: 15px; }
.result-heading h2 { margin-top: 4px; }
.result-decision { display: grid; grid-template-columns: minmax(170px, 0.32fr) minmax(0, 1fr); align-items: center; gap: 18px; padding: 13px 26px; border-bottom: 1px solid var(--rule); }
.result-decision-value { overflow-wrap: anywhere; color: var(--ink); font-size: 1rem; font-weight: 500; line-height: 1.2; }
.result-sequence { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 9px; padding: 9px 26px; border-bottom: 1px solid var(--rule); color: var(--steel-soft); }
.sequence-node { display: inline-flex; align-items: baseline; gap: 5px; padding: 3px 4px; font-size: 0.58rem; letter-spacing: 0.09em; }
.sequence-node b { color: var(--warm); font-size: 0.55rem; font-weight: 700; }
.sequence-node strong { font-weight: 700; }
.result-sequence i { color: var(--warm); font-style: normal; }
.sequence-node.is-first { border-bottom: 1px solid var(--warm); background: var(--warm-soft); color: var(--ink); }
.result-value { display: block; margin-top: 5px; color: var(--ink); font-size: clamp(1rem, 1.8vw, 1.35rem); font-weight: 500; letter-spacing: -0.025em; line-height: 1.1; }
.first-marker { display: inline-block; margin-left: 9px; color: var(--warm); font-size: 0.52rem; font-weight: 700; letter-spacing: 0.08em; vertical-align: middle; }
.result-item.first-unestablished { border-left: 3px solid var(--warm); background: color-mix(in srgb, var(--HALO_ELECTRIC_COBALT) 6%, transparent); }
.result-description { margin: 7px 0 0; color: var(--steel-soft); font-size: 0.7rem; line-height: 1.3; overflow-wrap: anywhere; }
.result-description span { color: var(--muted); font-size: 0.55rem; letter-spacing: 0.08em; text-transform: uppercase; }
.result-insights { display: grid; grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr); border-top: 1px solid var(--rule-strong); }
.first-boundary-card, .boundary-position { min-width: 0; padding: 13px 26px; }
.first-boundary-card:not(.is-complete) { border-left: 3px solid var(--warm); background: color-mix(in srgb, var(--HALO_ELECTRIC_COBALT) 6%, transparent); }
.first-boundary-value { display: block; margin-top: 5px; color: var(--ink); font-size: clamp(1rem, 2vw, 1.35rem); font-weight: 500; letter-spacing: -0.025em; line-height: 1.1; overflow-wrap: anywhere; }
.position-note { margin: 7px 0 0; color: var(--muted); font-size: 0.62rem; line-height: 1.3; }
.boundary-position { border-left: 1px solid var(--rule); }
.boundary-position > p:last-child { margin: 5px 0 0; color: var(--steel-soft); font-size: 0.78rem; line-height: 1.35; }
.result-meta { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); border-top: 1px solid var(--rule); }
.unresolved-block, .next-question { min-width: 0; padding: 12px 26px; }
.next-question { border-left: 1px solid var(--rule); }
.unresolved-list { margin: 5px 0 0; padding: 0; list-style: none; }
.unresolved-list li { color: var(--steel-soft); font-size: 0.68rem; line-height: 1.25; }
.unresolved-list li::before { content: "—"; margin-right: 7px; color: var(--warm); }
.unresolved-block > p:not(.result-label), .next-question p:last-child { margin: 5px 0 0; color: var(--steel-soft); font-size: 0.7rem; line-height: 1.3; }
.epistemic-line { display: flex; flex-wrap: wrap; gap: 5px 12px; padding: 10px 26px; border-top: 1px solid var(--rule); color: var(--steel-soft); font-size: 0.65rem; line-height: 1.3; }
.epistemic-line strong { color: var(--ink); font-size: 0.58rem; letter-spacing: 0.09em; }
.commercial-strip { display: grid; grid-template-columns: minmax(150px, 0.7fr) minmax(0, 1.35fr) auto auto; align-items: center; gap: 10px 18px; padding: 13px 26px; border-top: 1px solid var(--ink); background: var(--ink); }
.commercial-strip .result-label { color: var(--warm-on-dark); }
.commercial-strip h3 { margin: 3px 0 0; color: var(--surface); font-size: 0.95rem; font-weight: 500; letter-spacing: -0.02em; }
.commercial-strip-copy { margin: 0; color: #c4cdd0; font-size: 0.7rem; line-height: 1.3; }
.commercial-facts { display: flex; flex-wrap: wrap; gap: 5px 10px; color: var(--surface); font-size: 0.57rem; font-weight: 700; letter-spacing: 0.08em; white-space: nowrap; }
.commercial-facts span:last-child { color: var(--warm-on-dark); }
.commercial-cta { min-height: 36px; padding: 8px 11px; white-space: nowrap; }
.result-actions { display: flex; gap: 18px; padding: 10px 26px 14px; }
.secondary-action { padding: 0; border: 0; border-bottom: 1px solid var(--rule-strong); background: transparent; color: var(--steel-soft); cursor: pointer; font-size: 0.6rem; letter-spacing: 0.12em; text-transform: uppercase; }
.secondary-action:hover { color: var(--ink); border-color: var(--warm); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.boundary-footer { display: flex; justify-content: space-between; gap: 24px; padding: 24px 0 30px; color: var(--muted); font-size: 0.57rem; letter-spacing: 0.12em; }

@media (max-width: 768px) {
  .boundary-header, main, .boundary-footer { width: min(100% - 32px, 600px); }
  .boundary-header { min-height: 62px; gap: 14px; }
  .boundary-brand { min-height: 44px; min-width: 72px; }
  .boundary-brand img { width: 66px; }
  .boundary-descriptor { display: none; }
  .boundary-header-mark { font-size: 0.55rem; }
  .boundary-instrument { margin-top: 16px; }
  .mode-heading, .result-heading { display: block; padding: 18px; }
  .mode-safety, .result-mark { max-width: none; margin-top: 9px; text-align: left; }
  .decision-row, .result-decision { grid-template-columns: 1fr; gap: 8px; padding: 14px 18px; }
  .instrument-spine { padding: 10px 18px; gap: 5px 7px; font-size: 0.55rem; }
  .instrument-spine i { display: none; }
  .result-sequence { padding: 9px 18px; gap: 5px 7px; }
  .boundary-fields, .result-grid, .result-meta, .result-insights, .commercial-strip { grid-template-columns: 1fr; }
  .boundary-field, .boundary-field:nth-child(even), .result-item, .result-item:nth-child(even) { padding: 15px 18px; border-left: 0; }
  .result-item.first-unestablished { border-left: 3px solid var(--warm); }
  .boundary-field { border-top: 1px solid var(--rule); }
  .state-choice label { min-height: 44px; }
  .context-disclosure summary { min-height: 44px; padding-block: 8px; }
  .build-row { align-items: stretch; flex-direction: column; padding: 15px 18px; }
  .primary-action { width: 100%; min-height: 44px; }
  .result-meta { border-top: 1px solid var(--rule); }
  .next-question { border-top: 1px solid var(--rule); border-left: 0; }
  .first-boundary-card, .boundary-position { padding: 15px 18px; }
  .boundary-position { border-top: 1px solid var(--rule); border-left: 0; }
  .epistemic-line, .commercial-strip, .result-actions { padding-right: 18px; padding-left: 18px; }
  .commercial-strip { align-items: start; gap: 8px; }
  .commercial-facts { white-space: normal; }
  .commercial-cta { width: fit-content; min-height: 44px; }
  .result-actions .secondary-action,.preview-controls .secondary-action { min-height: 44px; padding-block: 10px; }
  .boundary-footer { display: grid; gap: 8px; }
  .boundary-footer a { display: inline-flex; min-height: 44px; align-items: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}

/* A2A — the portable object is a compact third mode, not a second page. */
.portable-action { border-bottom-color: var(--warm); color: var(--ink); font-weight: 800; }
.portable-action:hover, .portable-action:focus-visible { color: var(--warm); }
.preview-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 20px 26px 15px; border-bottom: 1px solid var(--rule); }
.preview-heading h2 { margin: 4px 0 0; color: var(--ink); font-size: clamp(1.65rem, 2.8vw, 2.25rem); font-weight: 500; letter-spacing: -0.055em; line-height: 1; }
.preview-workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, .4fr); min-width: 0; }
.portable-preview-frame { display: flex; min-height: 0; align-items: center; justify-content: center; padding: 24px; background: #eeece5; border-right: 1px solid var(--rule-strong); }
.portable-preview-frame img { display: block; width: min(100%, 560px); max-height: calc(100vh - 260px); height: auto; aspect-ratio: 4 / 5; border: 1px solid var(--rule-strong); box-shadow: 0 12px 26px rgba(16, 26, 34, .14); object-fit: contain; }
.preview-sidebar { display: flex; min-width: 0; flex-direction: column; justify-content: center; }
.preview-note { display: grid; gap: 8px; padding: 22px 24px; border-bottom: 1px solid var(--rule); }
.preview-note strong { color: var(--warm); font-size: .62rem; letter-spacing: .13em; }
.preview-note span { color: var(--steel-soft); font-size: .72rem; line-height: 1.4; }
.preview-controls { display: flex; flex-direction: column; align-items: flex-start; gap: 15px; padding: 22px 24px 24px; }
.preview-controls .primary-action { min-width: 148px; }
.preview-message { flex-basis: 100%; min-height: 0; margin: 0; color: var(--steel); font-size: .68rem; }

@media (max-width: 768px) {
  .preview-heading { display: block; padding: 18px; }
  .preview-heading .result-mark { max-width: none; margin-top: 9px; text-align: left; }
  .preview-workspace { grid-template-columns: 1fr; }
  .portable-preview-frame { padding: 16px 18px; border-right: 0; border-bottom: 1px solid var(--rule-strong); }
  .portable-preview-frame img { width: 100%; max-height: none; }
  .preview-sidebar { display: block; }
  .preview-note { gap: 6px; padding: 15px 18px; }
  .preview-controls { align-items: stretch; padding: 15px 18px 18px; }
  .preview-controls .primary-action, .preview-controls .secondary-action { width: fit-content; }
}

/* HALO-P3-PUBLIC-LEGAL-PRIVACY-V1 */
.boundary-footer a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.boundary-footer a:hover,
.boundary-footer a:focus-visible {
  color: var(--warm);
}
