/* Hallmark · pre-emit critique: P5 H4 E4 S5 R5 V4 */
:root {
  color-scheme: light;
  --ink: #17272b;
  --muted: #5c6d70;
  --paper: #f7f4ed;
  --surface: #ffffff;
  --surface-soft: #eef6f3;
  --line: #d6dfdc;
  --accent: #0f766e;
  --accent-deep: #0a554f;
  --accent-pale: #d8eeea;
  --highlight: #f2a93b;
  --header: #0d3534;
  --header-ink: #f8fffd;
  --positive: #137352;
  --positive-pale: #e3f3eb;
  --caution: #a85d0d;
  --caution-pale: #fff0d5;
  --critical: #a73339;
  --critical-pale: #fbe7e8;
  --planned: #17679e;
  --planned-pale: #e4f0f8;
  --shadow: 0 16px 44px rgba(24, 53, 55, 0.09);
  --radius: 18px;
  --font-ui: "Avenir Next", "Gill Sans", Calibri, sans-serif;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-md: 1rem;
  --text-lg: 1.25rem;
  --risk-context-low: #d9ece7;
  --risk-context-lowest: #dbe8ee;
  font-family: var(--font-ui);
  font-synthesis: none;
}

:root[data-theme="navy"] {
  --ink: #15263a;
  --muted: #5d6c7c;
  --paper: #f3f2ed;
  --surface-soft: #edf1f6;
  --line: #d2dae4;
  --accent: #17375e;
  --accent-deep: #0e2948;
  --accent-pale: #dfe9f4;
  --highlight: #d99a24;
  --header: #102b4d;
  --planned: #17679e;
  --planned-pale: #e3eef8;
}

:root[data-theme="coral"] {
  --ink: #263238;
  --muted: #637074;
  --paper: #faf3ec;
  --surface-soft: #f5e9e1;
  --line: #dfd5ce;
  --accent: #9b463b;
  --accent-deep: #713229;
  --accent-pale: #f2dcd6;
  --highlight: #d75b4b;
  --header: #263238;
  --planned: #236a78;
  --planned-pale: #e1f0f2;
}

:root[data-theme="contrast"] {
  --ink: #111827;
  --muted: #374151;
  --paper: #f5f6f8;
  --surface-soft: #e9f2f4;
  --line: #9ca3af;
  --accent: #006579;
  --accent-deep: #004e5e;
  --accent-pale: #d5eff3;
  --highlight: #f2b705;
  --header: #111827;
  --positive: #006b4d;
  --caution: #8a4b00;
  --critical: #9c1c2b;
  --planned: #005fa3;
  --shadow: 0 0 0 1px #9ca3af;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 300px;
  background: var(--paper);
}

body {
  margin: 0;
  min-width: 300px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 2%, color-mix(in srgb, var(--accent-pale) 75%, transparent) 0, transparent 26rem),
    linear-gradient(135deg, var(--paper), #fff 48%, var(--paper));
  -webkit-font-smoothing: antialiased;
}

button,
select {
  font: inherit;
}

button,
a,
select {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
select:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--planned) 70%, white);
  outline-offset: 3px;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: default;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2 {
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: -0.025em;
}

.app-shell {
  min-height: 100vh;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 22px max(24px, calc((100vw - 1560px) / 2));
  color: var(--header-ink);
  background:
    linear-gradient(115deg, color-mix(in srgb, var(--header) 93%, black), var(--header) 55%, color-mix(in srgb, var(--accent) 88%, black));
  border-bottom: 4px solid var(--highlight);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.brand-mark {
  position: relative;
  display: grid;
  flex: 0 0 62px;
  width: 62px;
  height: 62px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50% 50% 46% 54%;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 0 5px rgba(255, 255, 255, 0.06);
}

.brand-mark span {
  font-family: Georgia, serif;
  font-size: 25px;
  font-weight: 700;
}

.brand-mark i {
  position: absolute;
  right: 6px;
  top: 3px;
  color: var(--highlight);
  font-size: 20px;
  font-style: normal;
  font-weight: 800;
}

.eyebrow {
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.app-header .eyebrow {
  color: color-mix(in srgb, var(--highlight) 82%, white);
}

.app-header h1 {
  margin: 0;
  font-size: clamp(1.65rem, 2.2vw, 2.3rem);
  line-height: 1.05;
}

.header-subtitle {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.9rem;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 9px;
}

.connection-pill,
.version-block span,
.scenario-badge,
.definition-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 750;
}

.connection-pill {
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
}

.connection-pill.online {
  color: #c5f5dc;
}

.connection-pill.offline {
  color: #ffe3a6;
}

.reset-button,
.quiet-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 13px;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.82rem;
  font-weight: 750;
}

.reset-button:hover,
.quiet-button:hover {
  background: rgba(255, 255, 255, 0.18);
}

.safety-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px max(24px, calc((100vw - 1560px) / 2));
  color: #4b3511;
  background: #fff2cf;
  border-bottom: 1px solid #e9ce8f;
}

.safety-strip > .icon {
  color: #8b5b00;
}

.safety-strip p {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.45;
}

.version-block {
  display: flex;
  gap: 6px;
}

.version-block span {
  padding: 5px 8px;
  color: #6f4d08;
  border: 1px solid #dbbc74;
  background: rgba(255, 255, 255, 0.5);
}

.theme-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
  max-width: 1600px;
  margin: 0 auto;
  padding: 10px 20px;
  color: var(--muted);
  font-size: 0.74rem;
}

.theme-row > span {
  margin-right: 3px;
  font-weight: 750;
}

.theme-choice {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 5px 9px;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  font-size: 0.72rem;
}

.theme-choice:hover {
  background: var(--surface);
}

.theme-choice.is-selected {
  color: var(--ink);
  border-color: var(--line);
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(30, 50, 55, 0.07);
}

.swatches {
  display: inline-flex;
  overflow: hidden;
  width: 25px;
  height: 14px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 4px;
}

.swatches i {
  flex: 1;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(380px, 450px) minmax(0, 1fr);
  align-items: start;
  gap: 22px;
  max-width: 1600px;
  margin: 0 auto;
  padding: 10px 20px 30px;
}

.controls-panel,
.scenario-builder,
.view-card,
.progress-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 96%, var(--accent-pale));
  box-shadow: var(--shadow);
}

.controls-panel {
  overflow: hidden;
}

.panel-heading {
  padding: 24px 24px 20px;
  color: white;
  background:
    linear-gradient(130deg, var(--accent-deep), var(--accent));
}

.panel-heading .eyebrow {
  color: color-mix(in srgb, var(--highlight) 80%, white);
}

.panel-heading h2,
.scenario-title h2,
.view-title h2,
.factor-header h2,
.judgement-card h2,
.comparison-card h2,
.evidence-footer h2 {
  margin-bottom: 6px;
  font-size: 1.35rem;
}

.panel-heading p:last-child {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.82rem;
  line-height: 1.45;
}

.control-stack {
  display: grid;
}

.control-section {
  padding: 20px 22px 23px;
  border-bottom: 1px solid var(--line);
}

.control-section:last-child {
  border-bottom: 0;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-bottom: 19px;
}

.section-number {
  display: grid;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  place-items: center;
  color: white;
  border-radius: 50%;
  background: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
}

.section-heading h3 {
  margin: 2px 0 3px;
  font-size: 1rem;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.4;
}

.control-field {
  min-width: 0;
  margin: 0 0 18px;
  padding: 0;
  border: 0;
}

.control-field:last-child {
  margin-bottom: 0;
}

.control-field legend,
.denominator-select {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
}

.field-help {
  margin: 3px 0 8px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(var(--columns), minmax(0, 1fr));
  gap: 5px;
  margin-top: 8px;
}

.segment {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  min-height: 42px;
  padding: 7px 6px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 0.73rem;
  font-weight: 720;
  line-height: 1.15;
  text-align: center;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.segment:hover:not(.is-selected) {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: var(--surface-soft);
}

.segment:active {
  transform: translateY(1px);
}

.segment.is-selected {
  color: white;
  border-color: transparent;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.12);
}

.segment.tone-positive {
  background: var(--positive);
}

.segment.tone-caution {
  background: var(--caution);
}

.segment.tone-critical {
  background: var(--critical);
}

.segment.tone-neutral {
  background: var(--accent);
}

.segment.tone-planned {
  background: var(--planned);
}

.results-panel {
  min-width: 0;
}

.scenario-builder {
  margin-bottom: 14px;
  padding: 22px;
  border-top: 5px solid var(--planned);
}

.scenario-title,
.view-title,
.factor-header,
.progress-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.scenario-title .eyebrow,
.view-title .eyebrow,
.factor-header .eyebrow,
.progress-heading .eyebrow {
  margin-bottom: 3px;
}

.scenario-title h2,
.view-title h2,
.factor-header h2,
.progress-heading h3 {
  margin-bottom: 0;
}

.scenario-badge {
  padding: 7px 10px;
  color: var(--planned);
  border: 1px solid color-mix(in srgb, var(--planned) 35%, white);
  background: var(--planned-pale);
}

.scenario-intro {
  max-width: 780px;
  margin: 10px 0 18px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.scenario-builder .control-field {
  max-width: 560px;
}

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

.plan-toggle {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 10px;
  min-height: 66px;
  padding: 11px 12px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  text-align: left;
}

.plan-toggle:hover:not(:disabled) {
  border-color: var(--planned);
  background: var(--planned-pale);
}

.plan-toggle.is-active {
  color: color-mix(in srgb, var(--planned) 90%, black);
  border-color: var(--planned);
  background: var(--planned-pale);
  box-shadow: inset 4px 0 0 var(--planned);
}

.plan-toggle.is-complete {
  color: color-mix(in srgb, var(--positive) 90%, black);
  border-color: color-mix(in srgb, var(--positive) 45%, var(--line));
  background: var(--positive-pale);
  opacity: 0.82;
}

.plan-check {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  color: transparent;
  border: 2px solid var(--line);
  border-radius: 6px;
  background: white;
}

.plan-toggle.is-active .plan-check {
  color: white;
  border-color: var(--planned);
  background: var(--planned);
}

.plan-toggle.is-complete .plan-check {
  color: white;
  border-color: var(--positive);
  background: var(--positive);
}

.plan-toggle strong,
.plan-toggle small {
  display: block;
}

.plan-toggle strong {
  margin-bottom: 3px;
  font-size: 0.79rem;
}

.plan-toggle small {
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.3;
}

.view-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 0 0 14px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 88%, var(--paper));
}

.view-tabs button {
  min-height: 42px;
  padding: 8px 12px;
  color: var(--muted);
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 0.82rem;
  font-weight: 800;
}

.view-tabs button:hover {
  color: var(--ink);
  background: var(--surface-soft);
}

.view-tabs button[aria-current="page"] {
  color: white;
  background: var(--accent);
  box-shadow: 0 5px 14px color-mix(in srgb, var(--accent) 22%, transparent);
}

.view-stack {
  display: grid;
  gap: 14px;
}

.view-card,
.progress-card {
  min-width: 0;
  padding: 23px;
}

.view-title > div,
.factor-header > div,
.scenario-title > div {
  min-width: 0;
}

.view-title h2,
.factor-header h2,
.scenario-title h2 {
  overflow-wrap: break-word;
}

.definition-chip {
  max-width: 250px;
  padding: 7px 11px;
  color: var(--accent-deep);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  background: var(--accent-pale);
  line-height: 1.25;
  text-align: center;
}

.profile-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 19px;
}

.profile-card {
  position: relative;
  overflow: hidden;
  min-height: 160px;
  padding: 18px;
  border: 1px solid var(--line);
  border-left: 6px solid var(--critical);
  border-radius: 12px;
  background: linear-gradient(135deg, var(--critical-pale), white 75%);
}

.profile-card.profile-high {
  border-left-color: var(--caution);
  background: linear-gradient(135deg, var(--caution-pale), white 75%);
}

.profile-card.profile-moderate {
  border-left-color: var(--positive);
  background: linear-gradient(135deg, var(--positive-pale), white 75%);
}

.profile-card.is-scenario::after {
  content: "";
  position: absolute;
  right: -22px;
  top: -22px;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--planned) 14%, transparent);
}

.profile-card p {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.profile-card h3 {
  margin-bottom: 4px;
  font-family: Georgia, serif;
  font-size: 1.7rem;
  line-height: 1.05;
}

.profile-card > strong,
.profile-card > small {
  display: block;
}

.profile-card > strong {
  margin-bottom: 9px;
  font-size: 0.78rem;
}

.profile-card > small {
  color: var(--muted);
  font-size: 0.69rem;
  line-height: 1.4;
}

.spectrum-wrap {
  margin-top: 22px;
}

.spectrum {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 12px;
}

.spectrum-cell {
  display: flex;
  min-width: 0;
  padding: 13px 10px 10px;
  flex-direction: column;
  align-items: center;
  color: #391315;
  border-right: 1px solid rgba(255, 255, 255, 0.6);
  background: #efb6b8;
  text-align: center;
}

.spectrum-cell:last-child {
  border-right: 0;
}

.spectrum-high {
  color: #563606;
  background: #f3d08e;
}

.spectrum-moderate {
  color: #134631;
  background: #addbc7;
}

.spectrum-cell > strong {
  display: flex;
  min-height: 2.5em;
  align-items: flex-start;
  justify-content: center;
  font-size: 0.88rem;
  line-height: 1.2;
}

.spectrum-cell > span {
  display: block;
  min-height: 3.5em;
  font-size: 0.64rem;
  line-height: 1.3;
}

.marker-space {
  display: flex;
  width: 100%;
  min-height: 52px;
  margin-top: 8px;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
}

.spectrum-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  padding: 4px 5px;
  color: white;
  border-radius: 5px;
  background: #1f2e33;
  font-size: 0.65rem;
  font-weight: 800;
}

.spectrum-marker i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: white;
}

.planned-marker {
  background: var(--planned);
}

.spectrum-direction {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.64rem;
}

.profile-change,
.denominator-warning,
.same-week-note,
.method-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 15px;
  padding: 11px 13px;
  border-radius: 9px;
  font-size: 0.78rem;
  line-height: 1.45;
}

.profile-change.same,
.same-week-note,
.method-note {
  color: color-mix(in srgb, var(--planned) 76%, var(--ink));
  border: 1px solid color-mix(in srgb, var(--planned) 28%, var(--line));
  background: var(--planned-pale);
}

.profile-change.changed {
  color: color-mix(in srgb, var(--positive) 80%, var(--ink));
  border: 1px solid color-mix(in srgb, var(--positive) 28%, var(--line));
  background: var(--positive-pale);
}

.profile-change .icon,
.denominator-warning .icon,
.same-week-note .icon,
.method-note .icon {
  flex: 0 0 auto;
  margin-top: 1px;
}

.judgement-card {
  display: grid;
  grid-template-columns: minmax(210px, 0.8fr) minmax(360px, 1.2fr);
  align-items: center;
  gap: 24px;
}

.judgement-card > div > p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.judgement-card .control-field {
  margin: 0;
}

.progress-card {
  border-top: 5px solid var(--accent);
}

.progress-heading {
  margin-bottom: 18px;
}

.progress-heading h3 {
  font-family: Georgia, serif;
  font-size: 1.25rem;
}

.progress-heading > span {
  padding: 5px 8px;
  color: var(--muted);
  border-radius: 6px;
  background: var(--surface-soft);
  font-size: 0.68rem;
  font-weight: 800;
}

.progress-row {
  display: grid;
  grid-template-columns: 88px 1fr 38px;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
  font-size: 0.75rem;
}

.progress-track {
  overflow: hidden;
  height: 12px;
  border-radius: 999px;
  background: #e8e7e2;
}

.progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 220ms ease;
}

.progress-row.planned .progress-track i {
  background: var(--planned);
}

.progress-row > span {
  font-weight: 800;
  text-align: right;
}

.factor-header {
  margin-bottom: 18px;
}

.mini-tabs {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.mini-tabs button {
  padding: 6px 10px;
  color: var(--muted);
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 0.72rem;
  font-weight: 800;
}

.mini-tabs button[aria-selected="true"] {
  color: white;
  background: var(--accent);
}

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

.factor-list {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
}

.factor-list h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 0.82rem;
}

.factor-list h3 span {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-soft);
  font-size: 0.68rem;
}

.factor-list ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.factor-list li {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 8px 9px;
  border-radius: 7px;
  font-size: 0.73rem;
  line-height: 1.35;
}

.factor-list li .icon {
  flex: 0 0 auto;
}

.factor-lower {
  border-top: 4px solid var(--positive);
}

.factor-lower li {
  color: color-mix(in srgb, var(--positive) 80%, var(--ink));
  background: var(--positive-pale);
}

.factor-higher {
  border-top: 4px solid var(--critical);
}

.factor-higher li {
  color: color-mix(in srgb, var(--critical) 80%, var(--ink));
  background: var(--critical-pale);
}

.factor-context {
  margin-top: 10px;
  border-top: 4px solid var(--planned);
}

.factor-context li {
  color: color-mix(in srgb, var(--planned) 75%, var(--ink));
  background: var(--planned-pale);
}

.factor-list > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.73rem;
}

.method-note {
  margin: 0;
}

.method-note p,
.denominator-warning p,
.same-week-note p {
  margin: 0;
}

.outcomes-title {
  align-items: end;
}

.denominator-select {
  display: grid;
  min-width: 270px;
  gap: 5px;
}

.denominator-select select {
  width: 100%;
  min-height: 40px;
  padding: 7px 34px 7px 10px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.denominator-warning {
  color: #6b4705;
  border: 1px solid #edd091;
  background: #fff5dc;
}

.outcome-figure {
  margin-top: 22px;
}

.outcome-number {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.outcome-number strong {
  color: var(--accent-deep);
  font-family: Georgia, serif;
  font-size: clamp(3rem, 7vw, 5rem);
  line-height: 0.95;
}

.outcome-number span {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 800;
}

.outcome-figure > p {
  margin: 8px 0 20px;
  color: var(--muted);
  font-size: 0.78rem;
}

.confidence-visual {
  margin: 0 0 24px;
}

.confidence-track {
  position: relative;
  height: 12px;
  margin: 0 6px 7px;
  border-radius: 99px;
  background: #e5e9e7;
}

.confidence-range {
  position: absolute;
  top: 2px;
  height: 8px;
  border-radius: inherit;
  background: color-mix(in srgb, var(--accent) 68%, white);
}

.confidence-track i {
  position: absolute;
  top: -5px;
  width: 3px;
  height: 22px;
  border-radius: 3px;
  background: var(--accent-deep);
  transform: translateX(-1px);
}

.confidence-visual > div:last-child {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.68rem;
}

.confidence-visual strong {
  color: var(--ink);
}

.people-grid {
  display: grid;
  grid-template-columns: repeat(20, minmax(6px, 1fr));
  gap: 5px;
  max-width: 720px;
}

.people-grid i,
.people-legend i {
  display: block;
  aspect-ratio: 1;
  border-radius: 50% 50% 45% 45%;
}

.people-grid i {
  width: 100%;
}

.people-grid i.survived,
.people-legend i.survived {
  background: var(--accent);
}

.people-grid i.not-survived,
.people-legend i.not-survived {
  background: #d9dcda;
  box-shadow: inset 0 0 0 1px #c5c9c7;
}

.people-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 13px;
  color: var(--muted);
  font-size: 0.7rem;
}

.people-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.people-legend i {
  width: 12px;
}

.comparison-card > p {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

.numeric-comparison {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  margin: 18px 0;
}

.numeric-comparison > div {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-soft);
}

.numeric-comparison > b {
  color: var(--planned);
  font-size: 1.6rem;
}

.numeric-comparison span,
.numeric-comparison strong,
.numeric-comparison small {
  display: block;
}

.numeric-comparison span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

.numeric-comparison strong {
  margin: 4px 0;
  color: var(--accent-deep);
  font-family: Georgia, serif;
  font-size: 2.2rem;
}

.numeric-comparison small {
  color: var(--muted);
  font-size: 0.7rem;
}

.numeric-comparison .planned-number {
  border-color: color-mix(in srgb, var(--planned) 35%, var(--line));
  background: var(--planned-pale);
}

.timing-caveat {
  margin-bottom: 0;
  font-style: italic;
}

.table-card .view-title > span {
  color: var(--accent);
  font-family: Georgia, serif;
  font-size: 1.5rem;
  font-weight: 700;
}

.outcome-table-wrap {
  overflow-x: auto;
  max-width: 100%;
  margin-top: 18px;
}

.outcome-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 0.76rem;
}

.outcome-table th,
.outcome-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.outcome-table thead th {
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 0.67rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.outcome-table tbody th {
  font-weight: 700;
}

.outcome-table tr.is-active {
  color: var(--accent-deep);
  background: var(--accent-pale);
}

.impairment-note {
  margin-top: 17px;
  padding: 14px;
  border-left: 5px solid var(--accent);
  border-radius: 4px 9px 9px 4px;
  background: var(--surface-soft);
}

.impairment-note strong {
  font-size: 0.82rem;
}

.impairment-note p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.73rem;
  line-height: 1.45;
}

.pathway-list {
  position: relative;
  display: grid;
  gap: 0;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.pathway-list::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 20px;
  bottom: 22px;
  width: 2px;
  background: color-mix(in srgb, var(--accent) 32%, var(--line));
}

.pathway-list li {
  position: relative;
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 14px;
  padding: 0 0 20px;
}

.pathway-number {
  z-index: 1;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: white;
  border: 4px solid var(--surface);
  border-radius: 50%;
  background: var(--accent);
  font-size: 0.75rem;
  font-weight: 800;
}

.pathway-content {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.pathway-content h3 {
  margin-bottom: 4px;
  font-size: 0.9rem;
}

.pathway-content > p {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.73rem;
  line-height: 1.4;
}

.status-pair {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.status-pair span {
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 0.67rem;
  font-weight: 800;
}

.status-pair .good {
  color: var(--positive);
  background: var(--positive-pale);
}

.status-pair .concern {
  color: var(--critical);
  background: var(--critical-pale);
}

.status-pair .pending {
  color: var(--caution);
  background: var(--caution-pale);
}

.status-pair .planned {
  color: var(--planned);
  background: var(--planned-pale);
}

.evidence-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  max-width: 1560px;
  margin: 12px auto 34px;
  padding: 23px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 0.76rem;
}

.evidence-footer h2 {
  color: var(--ink);
}

.evidence-footer p:last-child {
  margin: 0;
  line-height: 1.5;
}

.source-links {
  display: grid;
  align-content: start;
  gap: 7px;
}

.source-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  color: var(--accent-deep);
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  font-weight: 750;
  text-decoration: none;
}

.source-links a:hover {
  border-color: var(--accent);
  background: var(--accent-pale);
}

@media (max-width: 1120px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .control-stack {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
  }

  .control-section {
    height: 100%;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .control-section:last-child {
    border-right: 0;
  }
}

@media (max-width: 860px) {
  .app-header {
    align-items: flex-start;
  }

  .header-actions {
    max-width: 250px;
  }

  .safety-strip {
    grid-template-columns: auto 1fr;
  }

  .version-block {
    grid-column: 2;
  }

  .control-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .control-section {
    border-bottom: 0;
  }

  .control-section:first-child {
    grid-column: 1 / -1;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .control-section:nth-child(2) {
    border-right: 1px solid var(--line);
  }

  .judgement-card,
  .evidence-footer {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .app-header {
    display: grid;
    padding: 18px 16px;
  }

  .brand-mark {
    flex-basis: 52px;
    width: 52px;
    height: 52px;
  }

  .brand-mark span {
    font-size: 22px;
  }

  .header-subtitle {
    font-size: 0.75rem;
  }

  .header-actions {
    max-width: none;
    justify-content: flex-start;
  }

  .safety-strip {
    padding: 11px 16px;
  }

  .theme-row {
    justify-content: flex-start;
    padding-inline: 12px;
  }

  .theme-choice {
    font-size: 0;
  }

  .theme-choice .swatches {
    width: 32px;
  }

  .workspace {
    padding: 6px 10px 22px;
  }

  .control-stack {
    grid-template-columns: 1fr;
  }

  .control-section:first-child {
    grid-column: auto;
  }

  .control-section:nth-child(2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .panel-heading,
  .control-section,
  .scenario-builder,
  .view-card,
  .progress-card {
    padding: 18px;
  }

  .control-section:first-child .segmented {
    grid-template-columns: repeat(auto-fit, minmax(48px, 1fr));
  }

  .control-section:not(:first-child) .segmented,
  .scenario-builder .segmented,
  .judgement-card .segmented {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .plan-grid,
  .profile-card-grid,
  .factor-grid {
    grid-template-columns: 1fr;
  }

  .view-title,
  .factor-header,
  .progress-heading,
  .outcomes-title {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .definition-chip {
    max-width: none;
    justify-self: start;
  }

  .view-tabs button {
    padding-inline: 6px;
    font-size: 0.72rem;
  }

  .spectrum-cell {
    padding-inline: 5px;
  }

  .spectrum-cell > strong {
    min-height: 3.6em;
    font-size: 0.73rem;
  }

  .spectrum-cell > span {
    min-height: 5.2em;
    font-size: 0.55rem;
  }

  .spectrum-marker {
    font-size: 0.57rem;
  }

  .spectrum-direction {
    font-size: 0.56rem;
  }

  .denominator-select {
    min-width: 0;
    width: 100%;
  }

  .people-grid {
    grid-template-columns: repeat(10, minmax(8px, 1fr));
    gap: 5px;
  }

  .outcome-number {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .numeric-comparison {
    grid-template-columns: 1fr;
  }

  .numeric-comparison > b {
    transform: rotate(90deg);
    justify-self: center;
  }

  .evidence-footer {
    margin-bottom: 12px;
    padding: 18px;
  }
}

@media (max-width: 390px) {
  .app-header h1 {
    font-size: 1.42rem;
  }

  .connection-pill {
    width: 100%;
  }

  .version-block {
    flex-wrap: wrap;
  }

  .view-tabs {
    grid-template-columns: 1fr;
  }

  .view-tabs button {
    min-height: 36px;
  }

  .progress-row {
    grid-template-columns: 70px 1fr 30px;
  }

  .status-pair {
    display: grid;
  }
}

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

@media print {
  body {
    background: white;
  }

  .app-header,
  .theme-row,
  .controls-panel,
  .scenario-builder,
  .view-tabs,
  .reset-button {
    display: none !important;
  }

  .workspace,
  .evidence-footer {
    display: block;
    max-width: none;
    padding: 0;
  }

  .view-card,
  .progress-card {
    break-inside: avoid;
    box-shadow: none;
  }
}

/* v2.1 visual system: a restrained clinician workflow with the visualisation dominant. */
@media screen {
  html,
  body {
    overflow-x: clip;
  }

  body {
    background: var(--paper);
    font-family: var(--font-ui);
    font-size: var(--text-sm);
  }

  h1,
  h2,
  h3 {
    font-family: var(--font-ui);
    font-style: normal;
    letter-spacing: -0.012em;
    line-height: 1.2;
  }

  .eyebrow {
    margin-bottom: 3px;
    font-size: var(--text-xs);
    letter-spacing: 0.08em;
  }

  .app-header {
    gap: 20px;
    padding: 17px max(20px, calc((100vw - 1500px) / 2));
    border-bottom: 2px solid var(--highlight);
    background: var(--header);
  }

  .brand-lockup {
    gap: 0;
  }

  .app-header h1 {
    font-size: 1.625rem;
    line-height: 1.15;
  }

  .header-subtitle {
    margin-top: 4px;
    font-size: var(--text-xs);
  }

  .header-actions {
    flex-wrap: nowrap;
    gap: 8px;
  }

  .connection-pill,
  .reset-button,
  .settings-menu > summary {
    min-height: 40px;
    padding: 8px 11px;
    border-radius: 8px;
    font-size: var(--text-xs);
    white-space: nowrap;
  }

  .settings-menu {
    position: relative;
  }

  .settings-menu > summary {
    display: inline-flex;
    align-items: center;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.08);
    font-weight: 750;
    list-style: none;
    cursor: pointer;
  }

  .settings-menu > summary::-webkit-details-marker {
    display: none;
  }

  .settings-menu > summary::after {
    content: "+";
    margin-left: 7px;
    font-size: var(--text-md);
    line-height: 1;
  }

  .settings-menu[open] > summary::after {
    content: "-";
  }

  .settings-panel {
    position: absolute;
    z-index: 20;
    top: calc(100% + 8px);
    right: 0;
    display: grid;
    width: 260px;
    gap: 12px;
    padding: 14px;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: var(--shadow);
  }

  .theme-select {
    display: grid;
    gap: 5px;
    font-size: var(--text-xs);
    font-weight: 750;
  }

  .theme-select select,
  .settings-action {
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface);
    font-size: var(--text-sm);
  }

  .settings-action {
    text-align: left;
  }

  .settings-panel p {
    margin: 0;
    color: var(--muted);
    font-size: var(--text-xs);
    line-height: 1.45;
  }

  .safety-strip {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    padding: 9px max(20px, calc((100vw - 1500px) / 2));
  }

  .safety-strip p {
    font-size: var(--text-xs);
    line-height: 1.4;
  }

  .workspace {
    grid-template-columns: minmax(320px, 350px) minmax(0, 1fr);
    gap: 16px;
    max-width: 1500px;
    padding: 18px 20px 28px;
  }

  .controls-panel,
  .scenario-builder,
  .view-card,
  .progress-card {
    border-radius: 12px;
    box-shadow: 0 5px 18px rgba(24, 53, 55, 0.06);
  }

  .panel-heading {
    padding: 17px 18px 15px;
    color: var(--ink);
    border-bottom: 1px solid var(--line);
    background: var(--surface);
  }

  .panel-heading .eyebrow {
    color: var(--accent);
  }

  .panel-heading h2,
  .scenario-title h2,
  .view-title h2,
  .workflow-heading h2,
  .judgement-card h2,
  .comparison-card h2,
  .evidence-footer h2 {
    margin-bottom: 5px;
    font-size: var(--text-lg);
  }

  .panel-heading p:last-child {
    color: var(--muted);
    font-size: var(--text-xs);
  }

  .control-section {
    padding: 16px 18px 18px;
  }

  .section-heading {
    gap: 10px;
    margin-bottom: 15px;
  }

  .section-number {
    flex-basis: 25px;
    width: 25px;
    height: 25px;
    font-size: var(--text-xs);
  }

  .section-heading h3 {
    margin-top: 3px;
    font-size: var(--text-md);
  }

  .section-heading p,
  .field-help {
    font-size: var(--text-xs);
  }

  .control-field {
    margin-bottom: 14px;
  }

  .control-field legend,
  .denominator-select {
    font-size: var(--text-sm);
  }

  .segmented {
    gap: 4px;
    margin-top: 7px;
  }

  .segment,
  .view-tabs button,
  .mini-tabs button {
    min-height: 40px;
    padding: 7px 8px;
    border-radius: 7px;
    font-size: var(--text-xs);
    line-height: 1.15;
  }

  .outcomes-step,
  .view-stack,
  .results-panel {
    display: grid;
    gap: 12px;
  }

  .workflow-step {
    min-width: 0;
  }

  .workflow-heading {
    display: grid;
    grid-template-columns: 25px minmax(0, 1fr) auto;
    align-items: start;
    gap: 10px;
  }

  .workflow-heading > div {
    min-width: 0;
  }

  .workflow-heading h2 {
    overflow-wrap: anywhere;
  }

  .workflow-heading p:last-child {
    max-width: 850px;
    margin: 0;
    color: var(--muted);
    font-size: var(--text-sm);
    line-height: 1.45;
  }

  .scenario-builder {
    margin: 0;
    padding: 17px;
    border-top: 1px solid var(--line);
    border-left: 4px solid var(--planned);
    box-shadow: none;
  }

  .scenario-badge,
  .definition-chip {
    padding: 6px 9px;
    border-radius: 7px;
    font-size: var(--text-xs);
  }

  .scenario-intro {
    margin: 7px 0 14px;
    font-size: var(--text-sm);
  }

  .scenario-builder .control-field {
    max-width: 620px;
  }

  .plan-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    margin-top: 12px;
  }

  .plan-toggle {
    min-height: 54px;
    gap: 8px;
    padding: 9px 10px;
    border-radius: 8px;
  }

  .plan-check {
    width: 20px;
    height: 20px;
    border-radius: 5px;
  }

  .plan-toggle strong,
  .plan-toggle small {
    font-size: var(--text-xs);
  }

  .view-tabs {
    gap: 4px;
    margin: 0;
    padding: 4px;
    border-radius: 10px;
  }

  .view-card,
  .progress-card {
    padding: 18px;
  }

  .profile-overview {
    border-top: 4px solid var(--accent);
  }

  .spectrum-wrap {
    margin-top: 14px;
  }

  .spectrum-note {
    margin: 0 0 10px;
    color: var(--muted);
    font-size: var(--text-xs);
    line-height: 1.4;
  }

  .spectrum {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    border-radius: 9px;
  }

  .spectrum-cell {
    padding: 10px 7px 8px;
  }

  .spectrum-low {
    color: var(--accent-deep);
    background: var(--risk-context-low);
  }

  .spectrum-extremely-low {
    color: var(--ink);
    background: var(--risk-context-lowest);
  }

  .spectrum-cell.is-context-only {
    background-image: repeating-linear-gradient(135deg, transparent 0 9px, rgba(255, 255, 255, 0.42) 9px 18px);
  }

  .spectrum-cell > strong {
    min-height: 2.4em;
    font-size: var(--text-sm);
  }

  .spectrum-cell > span {
    min-height: 3.5em;
    font-size: var(--text-xs);
  }

  .marker-space {
    min-height: 48px;
    margin-top: 6px;
  }

  .spectrum-marker {
    min-height: 22px;
    padding: 3px 4px;
    font-size: var(--text-xs);
    white-space: nowrap;
  }

  .spectrum-direction {
    font-size: var(--text-xs);
  }

  .profile-card-grid {
    gap: 8px;
    margin-top: 12px;
  }

  .profile-card {
    min-height: 125px;
    padding: 14px;
    border-left-width: 4px;
    border-radius: 9px;
    background: var(--surface);
  }

  .profile-card p,
  .profile-card > strong,
  .profile-card > small {
    font-size: var(--text-xs);
  }

  .profile-card h3,
  .progress-heading h3 {
    font-family: var(--font-ui);
    font-size: var(--text-lg);
  }

  .profile-change,
  .denominator-warning,
  .same-week-note,
  .method-note {
    gap: 8px;
    margin-top: 12px;
    padding: 9px 11px;
    border-radius: 7px;
    font-size: var(--text-xs);
  }

  .judgement-card {
    grid-template-columns: minmax(220px, 0.75fr) minmax(380px, 1.25fr);
    gap: 18px;
  }

  .judgement-card > div > p:last-child,
  .progress-row,
  .factor-list h3,
  .factor-list li,
  .factor-list > p {
    font-size: var(--text-xs);
  }

  .progress-card {
    border-top: 1px solid var(--line);
    border-left: 4px solid var(--accent);
  }

  .progress-heading,
  .factor-header {
    margin-bottom: 13px;
  }

  .progress-heading > span,
  .factor-list h3 span {
    font-size: var(--text-xs);
  }

  .mini-tabs {
    gap: 3px;
    padding: 3px;
    border-radius: 8px;
  }

  .mini-tabs button {
    min-height: 34px;
    padding: 6px 9px;
  }

  .factor-grid {
    gap: 8px;
  }

  .factor-list {
    padding: 13px;
    border-radius: 9px;
  }

  .factor-list li {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 7px;
    padding: 7px 8px;
  }

  .factor-tag {
    align-self: start;
    padding: 2px 5px;
    color: var(--critical);
    border: 1px solid color-mix(in srgb, var(--critical) 25%, var(--line));
    border-radius: 4px;
    background: var(--surface);
    font-size: 0.6875rem;
    font-weight: 800;
    line-height: 1.25;
    white-space: nowrap;
  }

  .factor-card .method-note {
    margin-top: 10px;
  }

  .outcome-number strong,
  .numeric-comparison strong {
    font-family: var(--font-ui);
  }

  .outcome-number strong {
    font-size: clamp(3rem, 6vw, 4.25rem);
  }

  .outcome-number span {
    font-size: var(--text-md);
  }

  .outcome-figure > p,
  .denominator-warning,
  .confidence-visual,
  .outcome-table,
  .timing-caveat,
  .impairment-note,
  .pathway-content p,
  .status-pair {
    font-size: var(--text-xs);
  }

  .evidence-footer {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
    gap: 22px;
    max-width: 1500px;
    padding: 20px;
    font-size: var(--text-xs);
  }

  .evidence-footer .workflow-heading {
    grid-template-columns: 25px minmax(0, 1fr);
  }

  .source-links a {
    min-height: 40px;
    padding: 8px 10px;
    border-radius: 7px;
    font-size: var(--text-xs);
  }
}

@media screen and (max-width: 1120px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .control-stack {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media screen and (max-width: 860px) {
  .app-header {
    align-items: flex-start;
  }

  .header-actions {
    flex-wrap: wrap;
  }

  .control-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .control-section:first-child {
    grid-column: 1 / -1;
  }

  .judgement-card,
  .evidence-footer {
    grid-template-columns: 1fr;
  }

  .plan-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media screen and (max-width: 680px) {
  .app-header {
    display: grid;
    padding: 16px;
  }

  .app-header h1 {
    font-size: 1.375rem;
    overflow-wrap: anywhere;
  }

  .header-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    width: 100%;
  }

  .settings-panel {
    position: fixed;
    top: 128px;
    right: 16px;
    left: 16px;
    width: auto;
  }

  .safety-strip {
    padding: 9px 16px;
  }

  .workspace {
    padding: 10px;
  }

  .control-stack,
  .plan-grid,
  .profile-card-grid,
  .factor-grid {
    grid-template-columns: 1fr;
  }

  .control-section:first-child {
    grid-column: auto;
  }

  .workflow-heading {
    grid-template-columns: 25px minmax(0, 1fr);
  }

  .workflow-heading .mini-tabs {
    grid-column: 2;
    justify-self: start;
  }

  .view-title,
  .scenario-title,
  .progress-heading,
  .outcomes-title {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .definition-chip,
  .scenario-badge {
    justify-self: start;
  }

  .view-tabs {
    grid-template-columns: 1fr;
  }

  .spectrum-cell {
    padding-inline: 4px;
  }

  .spectrum-cell > strong {
    min-height: 3em;
    font-size: 0.6875rem;
    overflow-wrap: anywhere;
  }

  .spectrum-cell > span {
    min-height: 2.8em;
    font-size: 0.5625rem;
  }

  .spectrum-marker {
    gap: 3px;
    padding-inline: 2px;
    font-size: 0.5625rem;
  }

  .spectrum-marker i {
    display: none;
  }

  .factor-list li {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .factor-tag {
    grid-column: 2;
    justify-self: start;
  }
}

@media screen and (max-width: 390px) {
  .header-actions {
    grid-template-columns: 1fr 1fr;
  }

  .connection-pill {
    grid-column: 1 / -1;
  }

  .settings-menu > summary,
  .reset-button {
    width: 100%;
    justify-content: center;
  }
}
