:root {
  color-scheme: dark;
  --bg: #08141f;
  --panel: #102334;
  --panel-strong: #152c40;
  --ink: #f4f0e7;
  --muted: #aebdca;
  --line: #2d4c62;
  --accent: #f1c75b;
  --accent-ink: #16202a;
  --sea: #65d5c5;
  --danger: #ff9e8e;
  --warning: #f1c75b;
  --focus: #8fdcff;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.24);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { background: var(--bg); scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 300px;
  color: var(--ink);
  background:
    radial-gradient(circle at 80% 0%, rgba(50, 116, 135, 0.18), transparent 35rem),
    linear-gradient(180deg, #091722 0%, var(--bg) 45%);
  line-height: 1.5;
  overflow-x: hidden;
}

button, textarea, input { font: inherit; }

button, summary, label[for="artifact-file"] { -webkit-tap-highlight-color: transparent; }

button:focus-visible,
textarea:focus-visible,
input:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 100;
  padding: 0.8rem 1rem;
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: 0.5rem;
}

.skip-link:focus { top: 1rem; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.25rem clamp(1rem, 4vw, 2rem);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: 0.8rem;
  font-weight: 900;
  letter-spacing: -0.05em;
}

.brand strong, .brand small { display: block; }
.brand small { color: var(--muted); font-size: 0.78rem; }

main {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(300px, 0.8fr);
  gap: 1rem;
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
}

main > * { min-width: 0; }
.boot-shell,
.review-panel,
.inspection-panel,
.lens-cloud-shell { grid-column: 1 / -1; }

.boot-shell {
  display: flex;
  min-height: 34vh;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  color: var(--muted);
}

.processing-dot {
  width: 0.7rem;
  height: 0.7rem;
  flex: 0 0 auto;
  background: var(--accent);
  border-radius: 50%;
  animation: processing-pulse 1.2s ease-in-out infinite;
}

@keyframes processing-pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.82); }
  50% { opacity: 1; transform: scale(1); }
}

.orientation-shell {
  position: sticky;
  top: 0.5rem;
  grid-column: 2;
  grid-row: 1 / span 2;
  max-height: calc(100vh - 6rem);
  padding: 0;
  overflow: auto;
  scrollbar-width: thin;
}
.orientation-shell > .section-kicker,
.orientation-shell > h1,
.orientation-shell > .timeline { display: none; }

.section-kicker {
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1, h2, h3, p { overflow-wrap: anywhere; }

h1 {
  max-width: 760px;
  margin: 0.35rem 0 1.4rem;
  font-size: clamp(2.15rem, 5vw, 3.8rem);
  line-height: 1;
  letter-spacing: -0.055em;
}

h2 { margin: 0.35rem 0 0.75rem; font-size: clamp(1.55rem, 3.6vw, 2.4rem); line-height: 1.08; }
h3 { margin: 0; font-size: 1.05rem; }
#primary-title:focus { outline: none; }

.timeline {
  display: flex;
  align-items: center;
  width: 100%;
  margin: 1rem 0 1.5rem;
  overflow-x: auto;
  scrollbar-width: thin;
}

.timeline-step {
  flex: 0 0 auto;
  padding: 0.45rem 0.7rem;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.timeline-step.active { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.timeline-line { flex: 1 0 1.2rem; min-width: 1.2rem; height: 1px; background: var(--line); }

.path-context {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  overflow: visible;
}
.path-context::-webkit-scrollbar,
.focus-grid::-webkit-scrollbar { display: none; }
.path-context > div { min-height: 88px; padding: 0.75rem; }
.path-context > div { min-width: 0; padding: 0.9rem 1rem; border: 1px solid var(--line); border-radius: 14px; background: rgba(18, 39, 56, 0.72); }
.path-context span, .task-horizon > span { display: block; margin-bottom: 0.3rem; color: var(--muted); font-size: 0.76rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.path-context strong { display: block; overflow-wrap: anywhere; }

.readiness {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.7rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(18, 39, 56, 0.5);
}
.readiness span { color: var(--muted); font-size: 0.76rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.readiness strong { display: block; margin-top: 0.2rem; }
.readiness-marks { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.35rem; }
.readiness-mark { width: 0.75rem; height: 0.75rem; border: 2px solid var(--muted); border-radius: 50%; }
.readiness-mark[data-state="YES"], .readiness-mark[data-state="NO"] { background: var(--sea); border-color: var(--sea); }
.readiness-mark[data-state="PARTIAL"] { border-color: var(--accent); background: linear-gradient(90deg, var(--accent) 50%, transparent 50%); }
.readiness-mark[data-state="CONFLICTED"] { border-color: var(--danger); background: var(--danger); }

.helm-focus {
  margin-top: 0.75rem;
  padding: 1rem;
  background: rgba(8, 20, 31, 0.58);
  border: 1px solid var(--line);
  border-radius: 1rem;
}
.helm-focus-heading { display: flex; align-items: start; justify-content: space-between; gap: 1rem; }
.helm-focus-heading h2 { margin: 0.2rem 0 0; font-size: 1.05rem; letter-spacing: -0.015em; }
.focus-state { padding: 0.28rem 0.55rem; color: var(--sea); background: rgba(101, 213, 197, 0.1); border: 1px solid rgba(101, 213, 197, 0.45); border-radius: 999px; font-size: 0.72rem; font-weight: 850; text-transform: uppercase; letter-spacing: 0.08em; }
.planning-route-button { display: flex; width: 100%; min-height: 56px; align-items: center; justify-content: space-between; gap: 0.75rem; margin-top: 0.7rem; padding: 0.7rem 0.8rem; color: var(--ink); text-align: left; background: rgba(21, 44, 64, 0.36); border: 1px solid rgba(98, 132, 157, 0.5); border-radius: 0.75rem; cursor: pointer; }
.planning-route-button:hover { border-color: var(--accent); background: rgba(246, 198, 80, 0.08); }
.planning-route-button strong, .planning-route-button small { display: block; }
.planning-route-button strong { font-size: 0.82rem; }
.planning-route-button small { margin-top: 0.12rem; color: var(--muted); font-size: 0.66rem; font-weight: 600; }
.planning-route-button > span:last-child { color: var(--accent); font-size: 1.15rem; }
.planning-route { margin-top: 0.85rem; padding: 0.2rem 0; background: rgba(21, 44, 64, 0.36); border: 1px solid rgba(98, 132, 157, 0.34); border-radius: 0.75rem; }
.planning-route-dialog { width: min(620px, calc(100vw - 2rem)); max-height: min(720px, calc(100vh - 2rem)); padding: 1.1rem; color: var(--ink); background: #0d2232; border: 1px solid rgba(246, 198, 80, 0.58); border-radius: 1rem; box-shadow: 0 24px 70px rgba(0, 0, 0, 0.58); overflow: auto; }
.planning-route-dialog::backdrop { background: rgba(2, 10, 16, 0.78); backdrop-filter: blur(5px); }
.planning-route-dialog h2 { margin: 0.2rem 0 0; font-size: clamp(1.25rem, 3vw, 1.7rem); }
.planning-route-dialog > p { margin: 0.7rem 0 0; color: var(--muted); line-height: 1.5; }
.dialog-heading { display: flex; align-items: start; justify-content: space-between; gap: 1rem; }
.dialog-close { width: 48px; height: 48px; flex: 0 0 48px; color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 0.7rem; cursor: pointer; font-size: 1.6rem; }
.planning-obstacles { display: grid; grid-template-columns: 1fr; gap: 0.42rem; margin: 0.65rem 0 0; padding: 0 0.7rem 0.75rem; list-style: none; }
.planning-obstacles li { display: grid; min-width: 0; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 0.35rem; padding: 0.4rem 0.45rem; color: var(--muted); background: rgba(5, 16, 25, 0.52); border: 1px solid var(--line); border-radius: 0.55rem; }
.planning-obstacles .route-marker { display: grid; width: 18px; height: 18px; place-items: center; border: 2px solid #547188; border-radius: 50%; color: #07141f; font-size: 0.68rem; font-weight: 900; }
.planning-obstacles .route-label { min-width: 0; font-size: 0.72rem; font-weight: 750; line-height: 1.2; overflow-wrap: anywhere; }
.planning-obstacles small { font-size: 0.58rem; font-weight: 800; text-transform: uppercase; }
.planning-obstacles li[data-route-state="cleared"] { color: var(--ink); border-color: rgba(101, 213, 197, 0.35); }
.planning-obstacles li[data-route-state="cleared"] .route-marker { background: var(--sea); border-color: var(--sea); }
.planning-obstacles li[data-route-state="active"] { color: var(--ink); background: rgba(246, 198, 80, 0.1); border-color: rgba(246, 198, 80, 0.72); }
.planning-obstacles li[data-route-state="active"] .route-marker { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(246, 198, 80, 0.12); }
.planning-obstacles li[data-route-state="active"] small { color: var(--accent); }
.planning-obstacles li[data-route-state="unmapped"] { opacity: 0.7; border-style: dashed; }
.command-brief { display: grid; gap: 0.45rem; margin: 0.7rem 0 0; }
.command-brief > div { min-width: 0; padding: 0.58rem 0.65rem; background: rgba(21, 44, 64, 0.48); border-radius: 0.65rem; }
.command-brief dt { color: var(--muted); font-size: 0.62rem; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; }
.command-brief dd { margin: 0.22rem 0 0; font-size: 0.76rem; font-weight: 700; }
.command-brief .command-order { background: rgba(246, 198, 80, 0.1); border: 1px solid rgba(246, 198, 80, 0.4); }
.command-brief .command-order dt { color: var(--accent); }
.command-brief .command-order dd { color: var(--ink); font-size: 0.88rem; }
.helm-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.45rem; margin: 0.7rem 0; padding: 0 0.7rem; }
.helm-metrics div { padding: 0.55rem; text-align: center; background: rgba(101, 213, 197, 0.07); border: 1px solid rgba(101, 213, 197, 0.2); border-radius: 0.65rem; }
.helm-metrics dt { color: var(--muted); font-size: 0.62rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; }
.helm-metrics dd { margin: 0.15rem 0 0; color: var(--sea); font-size: 1.25rem; font-weight: 900; }
.deferred-impact summary { color: var(--muted); font-size: 0.72rem; }
.deferred-impact[open] summary { color: var(--accent); }
.deferred-impact h2 { margin: 0.45rem 0; font-size: 0.9rem; }
.deferred-impact p { margin: 0.45rem 0; color: var(--muted); font-size: 0.76rem; }

.lens-cloud-shell { width: min(980px, 100%); margin: 1.4rem auto 0; padding: 1.15rem 0 0; border-top: 1px solid var(--line); }
.lens-cloud-heading { display: flex; align-items: end; justify-content: space-between; gap: 1.2rem; }
.lens-cloud-heading h2 { margin-bottom: 0; font-size: clamp(1.35rem, 2.6vw, 1.9rem); }
.lens-cloud-heading p { max-width: 510px; margin: 0; color: var(--muted); font-size: 0.9rem; }
.lens-cloud-intro { max-width: 680px; margin: 0.55rem 0 0; color: var(--muted); font-size: 0.9rem; }
.lens-cloud { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.9rem; }
.lens-button {
  min-height: 48px;
  padding: 0.6rem 0.85rem;
  color: var(--ink);
  text-align: left;
  background: rgba(15, 36, 52, 0.58);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}
.lens-button span { display: inline; }
.lens-button small { display: block; }
.lens-button span { font-weight: 800; }
.lens-button small { margin-top: 0.05rem; color: var(--muted); font-size: 0.68rem; }
.lens-button[data-weight="3"] span { font-size: 1.05rem; }
.lens-button[data-weight="2"] span { font-size: 0.96rem; }
.lens-button[data-weight="1"] span { font-size: 0.88rem; }
.lens-button:hover, .lens-button[aria-expanded="true"] { border-color: var(--accent); background: var(--panel-strong); }
.lens-button[data-impact="true"] { border-color: rgba(242, 196, 94, 0.72); }
.lens-button[data-impact="true"] small { color: var(--accent); }
.lens-preview { position: relative; max-width: 760px; margin-top: 0.65rem; padding: 1rem 3rem 1rem 1rem; border: 1px solid var(--accent); border-radius: 0.8rem; background: var(--panel); }
.lens-preview p { margin: 0.45rem 0 0.8rem; }
.lens-facts { display: grid; gap: 0.35rem; margin: 0.65rem 0; padding-left: 1.15rem; }
.lens-counts, .latent-note { color: var(--muted); font-size: 0.84rem; }
.impact-note { margin-top: 0.55rem; color: var(--accent); font-size: 0.84rem; font-weight: 750; }
.impact-card { border-color: rgba(242, 196, 94, 0.72); }
.impact-card h2 { margin: 0.35rem 0 0.85rem; font-size: 1.08rem; }
.impact-card p { margin-bottom: 0.35rem; color: var(--muted); }
.impact-update { display: grid; gap: 0.5rem; margin-top: 0.75rem; }
.impact-update[hidden] { display: none; }
.impact-option { width: 100%; text-align: left; }
.preview-close { position: absolute; top: 0.3rem; right: 0.4rem; width: 44px; height: 44px; color: var(--ink); background: transparent; border: 0; cursor: pointer; font-size: 1.4rem; }

.area {
  min-width: 0;
  padding: 0.9rem;
  background: rgba(15, 36, 52, 0.75);
  border: 1px solid var(--line);
  border-radius: 0.8rem;
}

.area strong, .area span { display: block; }
.area span { margin-top: 0.25rem; color: var(--muted); font-size: 0.82rem; }
.area[data-status="YES"] { border-color: rgba(101, 213, 197, 0.65); }
.area[data-status="CONFLICTED"] { border-color: var(--danger); }

.content-grid { display: grid; grid-column: 1; grid-row: 2; grid-template-columns: minmax(0, 1fr); gap: 1rem; align-items: start; }
.content-grid.fresh-start { grid-column: 1 / -1; grid-row: 1; grid-template-columns: minmax(0, 1fr); justify-content: center; padding-top: clamp(1.5rem, 4vw, 3rem); }
.content-grid.fresh-start .primary-card { min-height: 0; }

.primary-card,
.support-card,
.add-panel,
.review-panel,
.inspection-panel {
  background: linear-gradient(145deg, rgba(21, 44, 64, 0.98), rgba(14, 32, 47, 0.98));
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  box-shadow: var(--shadow);
}

.primary-card {
  display: flex;
  min-height: 0;
  height: 100%;
  flex-direction: column;
  padding: clamp(1.1rem, 2.4vw, 1.65rem);
  overflow: hidden;
}
#primary-content {
  min-height: 0;
  padding-right: 0.35rem;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(143, 220, 255, 0.5) transparent;
}
#primary-content::-webkit-scrollbar { width: 7px; }
#primary-content::-webkit-scrollbar-track { background: transparent; }
#primary-content::-webkit-scrollbar-thumb { background: rgba(143, 220, 255, 0.42); border-radius: 999px; }
.processing-overlay {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgba(3, 11, 18, 0.78);
  backdrop-filter: blur(6px);
}
.processing-overlay[hidden] { display: none; }
.processing-dialog {
  display: grid;
  width: min(360px, calc(100vw - 2rem));
  justify-items: center;
  gap: 0.9rem;
  padding: 1.6rem 1.35rem;
  text-align: center;
  color: var(--ink);
  background: linear-gradient(145deg, rgba(21, 44, 64, 0.99), rgba(10, 27, 40, 0.99));
  border: 1px solid rgba(246, 198, 80, 0.72);
  border-radius: 1.15rem;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
}
.helm-wheel {
  position: relative;
  display: grid;
  width: 88px;
  height: 88px;
  place-items: center;
  color: var(--ink);
  border-radius: 50%;
}
.helm-wheel::before {
  position: absolute;
  inset: 0;
  content: "";
  background: conic-gradient(from 0deg, var(--accent), rgba(246, 198, 80, 0.08) 34%, var(--teal) 68%, var(--accent));
  border-radius: inherit;
  animation: helm-wheel-spin 1.25s linear infinite;
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 0);
  mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 0);
}
.helm-wheel span {
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}
.processing-message { font-size: 1.08rem; }
.processing-support { max-width: 28ch; color: var(--muted); font-size: 0.86rem; }
body.processing-open { overflow: hidden; }

@keyframes helm-wheel-spin { to { transform: rotate(1turn); } }
.task-horizon { margin: 1.35rem 0 0; padding-top: 0.45rem; border-top: 1px solid var(--line); }
.task-horizon summary { color: var(--muted); }
.task-horizon ol { display: grid; gap: 0.45rem; margin: 0; padding-left: 1.35rem; }
.task-horizon li { color: var(--ink); }
.task-horizon + .button { margin-top: 1rem; }
.support-card { padding: 1.2rem; }
.context-column { display: grid; grid-template-columns: 1fr; gap: 0.55rem; margin-top: 0.7rem; }
.changed-card { border-color: rgba(101, 213, 197, 0.5); }
.changed-card h2 { margin: 0.2rem 0 0.35rem; font-size: 0.95rem; }
.changed-card ul { max-height: 76px; margin: 0.35rem 0 0; padding-left: 1rem; overflow: auto; color: var(--muted); font-size: 0.72rem; }
.changed-card li + li { margin-top: 0.4rem; }
.orientation-shell .support-card { padding: 0.75rem; box-shadow: none; }
.quiet-card { box-shadow: none; background: rgba(15, 36, 52, 0.55); }
summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 750; }
.history-content { padding-top: 0.7rem; color: var(--muted); font-size: 0.9rem; }
.history-item { padding: 0.6rem 0; border-top: 1px solid var(--line); }

.muted, .gate-copy, .trust-note { color: var(--muted); }
.gate-copy { max-width: 660px; font-size: 1.05rem; }
.trust-note { font-size: 0.86rem; }

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 0.72rem 1rem;
  border: 1px solid transparent;
  border-radius: 0.7rem;
  cursor: pointer;
  font-weight: 800;
}

.button:disabled { cursor: wait; opacity: 0.6; }
.button-primary { color: #071b22; background: var(--sea); border-color: var(--sea); }
.button-secondary { color: var(--ink); background: var(--panel-strong); border-color: var(--line); }
.button-quiet { color: var(--ink); background: transparent; border-color: var(--line); }
.button:hover:not(:disabled) { filter: brightness(1.08); }
.button-row { display: flex; flex-wrap: wrap; gap: 0.7rem; justify-content: flex-end; }
.button-row.align-start { justify-content: flex-start; margin-top: 1.5rem; }

.front-door-copy { max-width: 820px; }
.front-door-copy h2 { max-width: 760px; font-size: clamp(2rem, 4.4vw, 3.35rem); }
.entry-story { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.85rem; margin-top: 1.5rem; }
.entry-card { min-width: 0; overflow: hidden; background: rgba(7, 20, 31, 0.68); border: 1px solid var(--line); border-radius: 0.9rem; }
.entry-card img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; }
.entry-card-copy { display: grid; gap: 0.55rem; padding: 0.9rem; }
.entry-card-copy p { min-height: 3rem; margin: 0; color: var(--muted); font-size: 0.88rem; }
.entry-card-copy .button { width: 100%; margin-top: 0.2rem; }
.front-door-trust { max-width: 760px; margin: 1rem 0 0; }
.back-to-front { margin-bottom: 1rem; }
.attention-note { margin-bottom: 1rem; padding: 0.9rem 1rem; color: var(--ink); background: rgba(255, 158, 142, 0.1); border: 1px solid var(--danger); border-radius: 0.75rem; }
.guidance-note { margin-bottom: 1rem; padding: 0.9rem 1rem; color: var(--ink); background: rgba(101, 213, 197, 0.08); border: 1px solid rgba(101, 213, 197, 0.5); border-radius: 0.75rem; }
.completion-mark { display: grid; width: 3rem; height: 3rem; margin-bottom: 1rem; place-items: center; color: var(--accent-ink); background: var(--sea); border-radius: 50%; font-size: 1.5rem; font-weight: 900; }

.gate-form { display: grid; gap: 1rem; margin-top: 1.5rem; }
.gate-form label, .gate-form legend { font-weight: 750; }
.gate-form fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.gate-form fieldset .choice-grid { margin-top: 0.65rem; }
textarea, select, input[type="date"], input[type="month"], input[type="text"] {
  width: 100%;
  min-height: 50px;
  padding: 0.9rem 1rem;
  color: var(--ink);
  background: #091925;
  border: 1px solid #547188;
  border-radius: 0.75rem;
}
select { appearance: auto; }
textarea { resize: vertical; }

.choice-grid { display: grid; gap: 0.75rem; }
.hypothesis-grid {
  display: flex;
  width: 100%;
  height: 330px;
  gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.hypothesis-grid::-webkit-scrollbar { display: none; }
.hypothesis-grid .hypothesis {
  display: grid;
  flex: 0 0 100%;
  height: auto;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}
.carousel-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 0.7rem; }
.carousel-position { color: var(--muted); font-size: 0.8rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.direction-instruction { margin: 0.3rem 0 0; color: var(--ink); font-size: 0.9rem; }
.carousel-controls { display: flex; gap: 0.4rem; }
.carousel-button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: var(--ink);
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  font-weight: 900;
}
.carousel-button:disabled { cursor: default; opacity: 0.35; }
.direction-nav-button { width: auto; min-width: 96px; padding: 0 0.8rem; border-radius: 0.7rem; }
.natural-answer { padding-top: 0.25rem; border-top: 1px solid var(--line); }
.natural-answer summary { color: var(--sea); }
.natural-answer[open] { display: grid; gap: 0.75rem; }
.choice-option, .hypothesis {
  position: relative;
  padding: 1rem;
  background: rgba(7, 20, 31, 0.55);
  border: 1px solid var(--line);
  border-radius: 0.8rem;
}
.choice-option { display: flex; min-height: 54px; align-items: center; gap: 0.75rem; cursor: pointer; }
.choice-option input { width: 1.25rem; height: 1.25rem; accent-color: var(--accent); }
.hypothesis p { margin: 0.5rem 0 0.8rem; color: var(--muted); }
.hypothesis-details { min-height: 0; padding-right: 0.35rem; overflow: visible; }
.direction-actions { display: grid; grid-template-columns: minmax(0, 1.4fr) 1fr 1fr; gap: 0.55rem; margin-bottom: 0.65rem; padding: 0.65rem; background: rgba(246, 198, 80, 0.07); border: 1px solid rgba(246, 198, 80, 0.38); border-radius: 0.75rem; }
.direction-actions .button { width: 100%; min-width: 0; }
.evidence-note { font-size: 0.8rem; color: var(--sea); }
.direction-exploration { display: grid; gap: 1rem; margin: 1.25rem 0; }
.direction-exploration section { padding: 1rem; background: rgba(7, 20, 31, 0.55); border: 1px solid var(--line); border-radius: 0.8rem; }
.direction-exploration h3 { margin-bottom: 0.55rem; }
.direction-exploration p { margin: 0; color: var(--muted); }
.direction-exploration ul { margin: 0; padding-left: 1.25rem; }
.direction-exploration li + li { margin-top: 0.45rem; }
.direction-exploration .decision-record { border-color: rgba(241, 199, 91, 0.52); }
.direction-exploration .learning-record { border-color: rgba(101, 213, 197, 0.52); }
.decision-bundle { display: grid; gap: 0.75rem; }
.decision-bundle section { padding: 0.85rem 1rem; background: rgba(7, 20, 31, 0.55); border: 1px solid var(--line); border-radius: 0.8rem; }
.decision-bundle section p { margin: 0.35rem 0 0.65rem; color: var(--muted); font-size: 0.88rem; }
.decision-bundle textarea { min-height: 76px; }
.learning-next-move { margin-top: 1.2rem; padding: clamp(1rem, 2.4vw, 1.4rem); background: rgba(7, 20, 31, 0.62); border: 1px solid rgba(101, 213, 197, 0.5); border-radius: 0.9rem; }
.learning-next-move > span { display: block; color: var(--sea); font-size: 0.72rem; font-weight: 850; letter-spacing: 0.1em; text-transform: uppercase; }
.learning-next-move > strong { display: block; margin-top: 0.45rem; font-size: clamp(1.05rem, 2vw, 1.3rem); }
.learning-next-move > p { margin: 0.6rem 0 0; color: var(--muted); }
.next-move-actions { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); margin: 1rem 0 0; }
.working-record-details { margin-top: 0.85rem; padding: 0.2rem 0.85rem; border: 1px solid var(--line); border-radius: 0.75rem; }
.working-record-details p { color: var(--muted); }
.conversation-lead { margin-bottom: 1.15rem; padding: 0 0 1rem; border-bottom: 1px solid var(--line); }
.conversation-lead p { margin: 0; color: var(--muted); }
.conversation-lead .conversation-ack { margin-bottom: 0.45rem; color: var(--ink); font-size: clamp(1.05rem, 3vw, 1.3rem); font-weight: 850; }

.affected-areas { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.8rem; }
.affected-area { padding: 0.35rem 0.6rem; border-radius: 999px; background: rgba(101, 213, 197, 0.12); color: var(--sea); font-size: 0.78rem; font-weight: 750; }

.add-panel,
.review-panel,
.inspection-panel { position: relative; margin: 1rem 0; padding: clamp(1.25rem, 4vw, 2.2rem); }
.add-panel {
  position: fixed;
  z-index: 90;
  top: 50%;
  left: 50%;
  width: min(720px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  margin: 0;
  overflow: auto;
  padding: 1.15rem;
  border-color: rgba(241, 199, 91, 0.78);
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.26), 0 0 0 1px rgba(241, 199, 91, 0.08);
  transform: translate(-50%, -50%);
}
.add-panel .section-kicker { font-size: 0.7rem; }
.add-panel h2 { margin: 0.1rem 0 0.4rem; padding-right: 3rem; font-size: clamp(1.08rem, 1.6vw, 1.3rem); }
.add-panel .muted { margin: 0 0 0.7rem; font-size: 0.85rem; }
.add-panel form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.45rem 0.75rem; align-items: stretch; }
.add-panel form > label { grid-column: 1 / -1; font-size: 0.82rem; }
.add-panel textarea { grid-column: 1; grid-row: 2; min-height: 70px; max-height: 70px; padding: 0.7rem 0.8rem; resize: none; }
.add-panel .input-actions { grid-column: 2; grid-row: 2; display: grid; width: 185px; margin: 0; }
.add-panel .input-actions .button { width: 100%; }
.add-panel .input-actions .button-primary { margin-left: 0; }
.add-panel .file-status { display: none; }
.add-panel .trust-note { margin: 0.4rem 0 0; font-size: 0.72rem; }
.add-panel.input-attention { animation: input-attention 480ms ease-out; }
body.input-open { overflow: hidden; }
body.input-open::before { position: fixed; z-index: 80; inset: 0; content: ""; background: rgba(2, 10, 16, 0.78); backdrop-filter: blur(5px); }
.clear-input { position: absolute; top: 0.8rem; right: 0.8rem; min-height: 44px; padding: 0.35rem 0.55rem; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 0.55rem; cursor: pointer; font-size: 0.76rem; font-weight: 800; }
@keyframes input-attention { 0% { box-shadow: 0 0 0 0 rgba(241, 199, 91, 0.55); } 100% { box-shadow: var(--shadow); } }
.icon-button { position: absolute; top: 0.75rem; right: 0.75rem; width: 44px; height: 44px; color: var(--ink); background: transparent; border: 0; border-radius: 50%; cursor: pointer; font-size: 1.7rem; }
.input-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.7rem; margin-top: 0.8rem; }
.input-actions .button-primary { margin-left: auto; }
.file-status { flex: 1 1 220px; color: var(--muted); font-size: 0.83rem; }
.file-button { cursor: pointer; }
.review-statements { display: grid; gap: 0.6rem; margin: 1rem 0; padding: 0; list-style: none; }
.review-statements li { padding: 0.75rem 0.9rem; border-left: 4px solid var(--accent); background: rgba(8, 20, 31, 0.55); }
.review-summary { color: var(--sea); }

.control-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.7rem; margin-top: 1rem; }
.orientation-shell .control-nav { display: block; margin-top: 0.6rem; }
.orientation-shell .control-nav .button { min-height: 44px; padding: 0.55rem 0.45rem; font-size: 0.74rem; }
.plan-tools { border: 1px solid var(--line); border-radius: 0.7rem; }
.plan-tools > summary { min-height: 46px; justify-content: center; color: var(--muted); font-size: 0.76rem; }
.plan-tools > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.45rem; padding: 0 0.55rem 0.55rem; }
.lens-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; margin: 1rem 0; }
.lens-metrics div { padding: 0.75rem; border: 1px solid var(--line); border-radius: 0.7rem; }
.lens-metrics dt { color: var(--muted); font-size: 0.78rem; }
.lens-metrics dd { margin: 0.2rem 0 0; font-size: 1.35rem; font-weight: 850; }
.history-version { display: grid; width: 100%; min-height: 68px; margin-top: 0.55rem; padding: 0.8rem; color: var(--ink); text-align: left; background: rgba(8, 20, 31, 0.45); border: 1px solid var(--line); border-radius: 0.7rem; cursor: pointer; }
.history-version span, .history-version small { color: var(--muted); }
.history-snapshot { margin-top: 1rem; padding: 1rem; border: 1px solid var(--accent); border-radius: 0.8rem; }
.comparison-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin: 1rem 0; }
.comparison-grid section { min-width: 0; padding: 1rem; border: 1px solid var(--line); border-radius: 0.8rem; background: rgba(8, 20, 31, 0.45); }
.comparison-grid ul { margin-bottom: 0; padding-left: 1.1rem; }
.conflict-note { padding: 0.9rem; border: 1px solid var(--danger); border-radius: 0.75rem; }
.inline-guidance { margin: 0.85rem 0 0; padding: 0.8rem 0.9rem; color: var(--ink); background: rgba(255, 210, 106, 0.08); border-left: 3px solid var(--warning); border-radius: 0.35rem; }

.status { position: fixed; right: 1rem; bottom: 1rem; z-index: 50; max-width: min(420px, calc(100% - 2rem)); padding: 0.85rem 1rem; color: var(--ink); background: #1b3448; border: 1px solid var(--line); border-radius: 0.7rem; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translateY(1rem); transition: 160ms ease; }
.status.visible.error { opacity: 1; transform: none; border-color: var(--danger); }

footer { width: min(1180px, calc(100% - 2rem)); margin: 3rem auto 0; padding: 2rem 0 4rem; color: var(--muted); border-top: 1px solid var(--line); font-size: 0.85rem; }
footer details { max-width: 700px; }

.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
[hidden] { display: none !important; }

@media (min-width: 821px) {
  .direction-exploration { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .direction-exploration > section:first-child { grid-column: 1 / -1; }
  body.dashboard-active { height: 100vh; overflow: hidden; }
  body.dashboard-active main {
    height: calc(100vh - 88px);
    grid-template-rows: minmax(0, 1fr);
    padding-bottom: 0.75rem;
  }
  body.dashboard-active .content-grid { grid-row: 1; }
  body.dashboard-active .orientation-shell { grid-row: 1; }
  body.dashboard-active .content-grid { min-height: 0; height: 100%; }
  body.dashboard-active .orientation-shell { height: 100%; max-height: none; overflow: hidden; }
  body.dashboard-active footer { display: none; }
  body.dashboard-active .hypothesis-grid { height: auto; min-height: 0; }
}

@media (min-width: 821px) and (max-height: 900px) {
  .site-header { padding-top: 0.8rem; padding-bottom: 0.8rem; }
  body.dashboard-active main { height: calc(100vh - 72px); }
  .primary-card { padding: 1.15rem 1.35rem; }
  .primary-card h2 { font-size: clamp(1.75rem, 2.7vw, 2.05rem); }
  .primary-card .gate-copy { margin-top: 0.45rem; margin-bottom: 0.55rem; font-size: 0.96rem; }
  .decision-bundle { gap: 0.55rem; margin-top: 0.8rem; }
  .decision-bundle section { padding: 0.65rem 0.8rem; }
  .decision-bundle section p { margin: 0.2rem 0 0.4rem; font-size: 0.78rem; }
  .decision-bundle textarea { min-height: 58px; padding: 0.65rem 0.75rem; }
  .orientation-shell .path-context { gap: 0.5rem; }
  .orientation-shell .path-context > div { min-height: 76px; padding: 0.65rem 0.75rem; }
  .orientation-shell .helm-focus { margin-top: 0.55rem; padding: 0.8rem; }
  .orientation-shell .command-brief { gap: 0.35rem; margin-top: 0.5rem; }
  .orientation-shell .command-brief > div { padding: 0.48rem 0.55rem; }
  .orientation-shell .planning-route-button { min-height: 50px; margin-top: 0.5rem; padding: 0.55rem 0.65rem; }
}

@media (max-width: 820px) {
  main { grid-template-columns: minmax(0, 1fr); }
  .orientation-shell { grid-column: 1; grid-row: auto; }
  .content-grid, .content-grid.fresh-start { grid-column: 1; grid-row: auto; }
  .add-panel { top: auto; bottom: 0; left: 0; width: 100%; max-height: min(72vh, 560px); border-bottom-right-radius: 0; border-bottom-left-radius: 0; transform: none; }
  .add-panel form { display: grid; grid-template-columns: 1fr; }
  .add-panel form > label, .add-panel textarea, .add-panel .input-actions { grid-column: 1; grid-row: auto; }
  .add-panel .input-actions { width: 100%; }
  .content-grid { grid-row: 1; grid-template-columns: 1fr; }
  .orientation-shell { grid-row: 2; }
  .control-nav { grid-column: 1; grid-row: 4; }
  .path-context { grid-template-columns: 1fr; }
  .context-column { grid-template-columns: 1fr; }
  .entry-story { grid-template-columns: 1fr; }
  .entry-card { display: grid; grid-template-columns: minmax(145px, 0.9fr) minmax(0, 1.1fr); }
  .entry-card img { height: 100%; aspect-ratio: auto; }
  .lens-cloud-heading { align-items: start; flex-direction: column; gap: 0.4rem; }
  .focus-grid { grid-template-columns: 1fr; }
  .context-column { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .site-header { padding: 0.9rem 1rem; }
  .brand small { display: none; }
  .button-quiet { padding-inline: 0.75rem; }
  main { width: min(100% - 1rem, 1180px); }
  .orientation-shell { padding: 0.75rem 0 0.25rem; }
  .orientation-shell > .section-kicker,
  .orientation-shell > h1,
  .orientation-shell > .timeline { display: none; }
  .path-context { gap: 0.45rem; }
  .readiness { align-items: flex-start; flex-direction: column; }
  .readiness-marks { justify-content: flex-start; }
  .comparison-grid, .lens-metrics { grid-template-columns: 1fr; }
  .control-nav .button { width: auto; }
  .helm-focus { margin-top: 0.5rem; }
  .add-panel { max-height: min(38vh, 300px); padding: 1rem; }
  .add-panel h2 { margin-bottom: 0.55rem; padding-right: 3.25rem; font-size: 1.15rem; }
  .add-panel .section-kicker, .add-panel .muted, .add-panel .trust-note, .add-panel .file-status { display: none; }
  .add-panel .gate-form, .add-panel form { gap: 0.5rem; }
  .add-panel textarea { min-height: 72px; max-height: 90px; padding: 0.7rem 0.8rem; }
  .add-panel .input-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-top: 0.55rem; }
  .add-panel .input-actions .button { width: 100%; }
  .area { padding: 0.75rem; }
  .area span { font-size: 0.75rem; }
  .input-actions .button, .button-row .button { width: 100%; }
  .input-actions .button-primary { margin-left: 0; }
  .timeline-step { font-size: 0.66rem; padding-inline: 0.5rem; }
  textarea, input[type="date"], input[type="month"], input[type="text"] { font-size: 16px; }
  .content-grid.fresh-start { padding-top: 1.2rem; }
  .carousel-heading { align-items: stretch; flex-direction: column; }
  .carousel-controls { display: grid; grid-template-columns: 1fr 1fr; }
  .direction-nav-button { width: 100%; }
  .direction-actions { grid-template-columns: 1fr; }
  .planning-obstacles { grid-template-columns: 1fr; }
  .primary-card { padding: 1.1rem; }
  .entry-card { display: block; }
  .entry-card img { height: auto; aspect-ratio: 16 / 9; }
  .entry-card-copy p { min-height: 0; }
  .lens-button { flex: 1 1 auto; min-width: 118px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
  .processing-dot { animation: none; opacity: 1; }
  .helm-wheel::before { animation: none; }
}
