:root {
  color-scheme: light;
  --ink: #202124;
  --muted: #5e6470;
  --line: #d9dee7;
  --panel: #ffffff;
  --paper: #f6f7f9;
  --accent: #0f766e;
  --accent-soft: #dff5f1;
  --warn: #a15c02;
  --warn-soft: #fff4db;
  --good: #11602f;
  --good-soft: #e4f7e9;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
}

.control-panel {
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 28px;
  overflow: auto;
}

.brand-block {
  margin-bottom: 24px;
}

.product-purpose {
  margin: 10px 0 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
}

.prototype-notice {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.text-button {
  width: auto;
  min-height: 32px;
  margin-top: 12px;
  padding: 5px 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  text-align: left;
  text-decoration: underline;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: 0;
}

.intake-form {
  display: grid;
  gap: 14px;
}

.stage-control {
  margin: 0;
  padding: 0;
  border: 0;
}

.choice-control {
  margin: 0;
  padding: 0;
  border: 0;
}

.choice-control legend {
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 700;
}

.field-help {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.choice-grid label {
  display: flex;
  align-items: center;
  min-height: 42px;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  cursor: pointer;
}

.choice-grid input {
  width: 18px;
  min-height: 18px;
  margin: 0;
  padding: 0;
}

.choice-grid label:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.stage-control legend {
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 700;
}

.advanced-inputs {
  display: grid;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.advanced-inputs summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.segmented-control label {
  display: block;
}

.segmented-control input {
  position: absolute;
  width: 1px;
  min-height: 1px;
  opacity: 0;
}

.segmented-control span {
  display: grid;
  min-height: 40px;
  place-items: center;
  border-right: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
}

.segmented-control label:last-child span {
  border-right: 0;
}

.segmented-control input:checked + span {
  background: var(--accent);
  color: white;
}

.segmented-control input:focus-visible + span {
  position: relative;
  outline: 3px solid #1d4ed8;
  outline-offset: -3px;
  z-index: 1;
}

.journal-form {
  display: grid;
  gap: 12px;
}

.checkbox-row {
  grid-template-columns: 18px 1fr;
  align-items: center;
}

.checkbox-row input {
  width: 18px;
  min-height: 18px;
  padding: 0;
}

label {
  display: grid;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea,
button {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  letter-spacing: 0;
}

textarea {
  resize: vertical;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

button {
  margin-top: 4px;
  border: 0;
  color: white;
  background: var(--accent);
  font-weight: 800;
  cursor: pointer;
}

button:disabled {
  opacity: 0.6;
  cursor: wait;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid #1d4ed8;
  outline-offset: 2px;
}

.journal-result {
  margin-top: 12px;
  color: var(--muted);
}

.journal-dashboard {
  margin-top: 14px;
}

.dashboard-empty,
.dashboard-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 12px;
}

.dashboard-empty {
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(100px, 0.6fr) minmax(100px, 0.6fr) minmax(180px, 1.8fr);
  gap: 10px;
}

.dashboard-card {
  display: grid;
  gap: 6px;
}

.dashboard-card b {
  font-size: 12px;
  color: var(--muted);
}

.dashboard-card span {
  font-weight: 800;
}

.dashboard-card.wide span {
  font-weight: 600;
  line-height: 1.45;
}

.signal-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.result-panel {
  padding: 28px;
  overflow: auto;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.status-card,
.section,
.item-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.status-card {
  padding: 12px;
}

.status-card strong {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.status-card span {
  display: block;
  margin-top: 6px;
  font-size: 20px;
  font-weight: 800;
}

.result-root {
  display: grid;
  gap: 14px;
}

.section {
  padding: 18px;
}

.section h2,
.item-card h3 {
  margin: 0 0 12px;
  font-size: 18px;
  letter-spacing: 0;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.section-heading .eyebrow {
  margin-bottom: 5px;
}

.review-badge {
  flex: 0 0 auto;
  border: 1px solid #e8bd6a;
  border-radius: 999px;
  padding: 6px 9px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 12px;
  font-weight: 800;
}

.focus-copy {
  margin: 4px 0 16px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
}

.triage-grid,
.decision-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.decision-grid section {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

.decision-grid h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

.decision-grid p {
  margin: 0;
  line-height: 1.5;
}

.triage-grid li span,
.execution-details li span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.execution-details {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
}

.execution-details summary {
  cursor: pointer;
  font-weight: 800;
}

.execution-details ol {
  margin-top: 10px;
}

.expert-review-block {
  margin-top: 12px;
  border: 1px solid #e8bd6a;
  border-radius: 8px;
  padding: 12px;
  background: var(--warn-soft);
  color: #6d4300;
}

.expert-review-block p {
  margin: 6px 0;
}

.expert-review-block span {
  font-size: 12px;
}

.evidence-boundary {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.signal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.signal {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

.signal b {
  display: block;
  margin-bottom: 6px;
}

.signal small {
  color: var(--muted);
}

.items {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.item-card {
  padding: 18px;
}

.item-card.selected {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.fit-summary {
  min-height: 42px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.selection-prompt,
.decision-empty {
  border-style: dashed;
  background: #fbfcfd;
}

.selected-offer {
  border-color: var(--accent);
}

.journal-section,
.next-action {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.next-action h2,
.journal-section h2 {
  margin: 0 0 10px;
  font-size: 16px;
}

.assisted-boundary {
  border-color: #e8bd6a;
  background: var(--warn-soft);
}

.evidence-details {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--panel);
}

.evidence-details summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.evidence-details .section {
  margin-top: 12px;
}

.item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.starter-kit {
  margin-top: 14px;
}

.starter-kit-list {
  display: grid;
  gap: 8px;
}

.starter-kit-entry {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fbfcfd;
}

.starter-kit-entry summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.starter-kit-entry pre {
  margin-top: 10px;
}

.compact-button {
  width: auto;
  min-height: 34px;
  margin-top: 10px;
  padding: 6px 10px;
}

.risk-acknowledgement {
  grid-template-columns: 18px 1fr;
  align-items: start;
  padding: 10px;
  border: 1px solid #e8bd6a;
  border-radius: 8px;
  background: var(--warn-soft);
  color: #6d4300;
}

.risk-acknowledgement input {
  width: 18px;
  min-height: 18px;
  margin-top: 1px;
  padding: 0;
}

.risk-block-message {
  margin: 0;
  color: var(--warn);
  font-size: 13px;
  font-weight: 700;
}

.secondary-button {
  background: #eef1f5;
  color: var(--text);
}

.muted {
  color: var(--muted);
}

.coverage-section li {
  font-size: 13px;
}

.item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.score {
  min-width: 58px;
  border-radius: 8px;
  padding: 8px 10px;
  text-align: center;
  font-weight: 900;
  background: var(--accent-soft);
  color: var(--accent);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 14px;
}

.pill {
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 12px;
  background: #eef1f5;
  color: var(--muted);
}

.pill.good {
  background: var(--good-soft);
  color: var(--good);
}

.pill.warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

ol,
ul {
  margin: 0;
  padding-left: 19px;
}

li {
  margin: 6px 0;
  line-height: 1.45;
}

pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .control-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .status-strip,
  .signal-grid,
  .dashboard-grid,
  .columns,
  .triage-grid,
  .decision-grid,
  .items {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  body {
    background: var(--panel);
  }

  .control-panel,
  .result-panel {
    padding: 16px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .choice-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 24px;
  }

  .item-head {
    display: grid;
  }

  .section-heading {
    display: grid;
  }

  .review-badge {
    justify-self: start;
  }

  .item-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .compact-button {
    width: 100%;
    min-height: 42px;
  }

  .starter-kit-entry,
  .section,
  .item-card {
    padding: 14px;
  }

  .status-card span {
    font-size: 18px;
  }

  pre {
    font-size: 12px;
    line-height: 1.5;
  }
}
