:root {
  --ink: #1c2129;
  --ink-soft: #565f6d;
  --ink-faint: #8892a0;
  --paper: #ffffff;
  --canvas: #f5f6f8;
  --line: #e2e5ea;
  --accent: #2f5f4f;
  --accent-soft: #e8f0ec;
  --conf-low: #8892a0;
  --conf-medium: #b9862f;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 24, 32, 0.04), 0 4px 16px rgba(20, 24, 32, 0.05);

  /* Vertical rhythm scale (stack pattern) — named so spacing stays legible and tunable. */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 32px;
  --space-9: 40px;
  --space-10: 56px;

  /* Readable measure for prose blocks (content-limiter pattern). */
  --measure: 68ch;

  /* Minimum card widths for intrinsic auto-fit grids (card-grid pattern). */
  --card-min-conversation: 22rem;
  --card-min-verify: 14rem;
  --card-min-contradiction: 28rem;

  /* Fluid page gutter floor/ceiling (page-grid pattern, applied via clamp). */
  --gutter-min: 1rem;
  --gutter-max: 24px;

  /* Shared page-content width — header, main, and footer all align to this. */
  --page-width: 1040px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--canvas);
  color: var(--ink);
  line-height: 1.5;
}

/* ---------- Header / Stepper ---------- */

.app-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.app-header-inner {
  max-width: var(--page-width);
  margin: 0 auto;
  padding-block: 18px;
  padding-inline: clamp(var(--gutter-min), 4vw, var(--gutter-max));
  display: flex;
  align-items: center;
  gap: 40px;
}

.brand-name {
  font-weight: 650;
  font-size: 16px;
  letter-spacing: -0.01em;
  color: var(--ink);
  white-space: nowrap;
}

.brand-tagline {
  font-size: 10.5px;
  color: var(--ink-faint);
  margin-top: 1px;
  max-width: 260px;
}

@media (max-width: 900px) {
  .brand-tagline { display: none; }
}

.stepper {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
}

.step-divider {
  width: 28px;
  height: 1px;
  background: var(--line);
  flex-shrink: 0;
}

.step-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-faint);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 999px;
  font-family: inherit;
}

.step-btn:disabled { cursor: default; }
.step-btn.active { color: var(--ink); }
.step-btn.done { color: var(--accent); }

.step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  color: var(--ink-faint);
  flex-shrink: 0;
}

.step-btn.active .step-num { border-color: var(--ink); color: var(--ink); }
.step-btn.done .step-num { border-color: var(--accent); color: var(--paper); background: var(--accent); }

/* ---------- Layout ---------- */

.app-main {
  max-width: var(--page-width);
  margin: 0 auto;
  padding-block: 40px 80px;
  padding-inline: clamp(var(--gutter-min), 4vw, var(--gutter-max));
}

.screen.hidden { display: none; }
.hidden { display: none; }

.screen-head { margin-bottom: var(--space-7); }

.screen-head h1 {
  font-size: 26px;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

.subtitle {
  color: var(--ink-soft);
  font-size: 15px;
  margin: 0;
  max-width: 620px;
}

.section-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.005em;
  margin: 0 0 14px;
  color: var(--ink);
}

.section-note {
  color: var(--ink-faint);
  font-size: 13px;
  margin: -6px 0 16px;
  max-width: 620px;
  line-height: 1.5;
}

.panel-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  margin-bottom: 14px;
}

.align-section { margin-bottom: var(--space-9); }

/* ---------- Form / Card panel ---------- */

.card-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}

.hint {
  color: var(--ink-faint);
  font-size: 13px;
  margin: 0 0 8px;
}

textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 13px;
  font-size: 14.5px;
  font-family: inherit;
  color: var(--ink);
  background: #fcfcfd;
  resize: vertical;
  transition: border-color 0.15s ease;
}

textarea:focus { outline: none; border-color: var(--accent); background: var(--paper); }
textarea::placeholder { color: var(--ink-faint); }

.form-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-7);
}

.form-actions-left { justify-content: flex-start; margin-top: var(--space-3); margin-bottom: var(--space-5); }

.form-actions-conclusive {
  border-top: 1px solid var(--line);
  padding-top: var(--space-7);
}

button { font-family: inherit; }

.btn-primary {
  background: var(--ink);
  color: var(--paper);
  border: none;
  border-radius: 8px;
  padding: 11px 20px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary:hover { background: #000; }

.btn-secondary {
  background: var(--paper);
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 18px;
  font-size: 14.5px;
  font-weight: 500;
  cursor: pointer;
}

.btn-secondary:hover { background: var(--canvas); color: var(--ink); }

/* ---------- Confidence badges (shared) ---------- */

.confidence-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--paper);
}

.confidence-badge.conf-low { background: var(--conf-low); }
.confidence-badge.conf-medium { background: var(--conf-medium); }
.confidence-badge.conf-high { background: var(--accent); }

.as-meta-block { min-width: 90px; }
.as-meta-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  margin-bottom: 3px;
}

/* ---------- Describe: scenes ---------- */

.scene { margin-bottom: var(--space-10); }
.scene:last-of-type { margin-bottom: var(--space-8); }

.scene-visual { margin-bottom: var(--space-5); }
.scene-visual svg { display: block; max-width: 320px; width: 100%; height: auto; }

.scene-message {
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin: 0 0 10px;
  max-width: 620px;
}

.scene-support {
  color: var(--ink-soft);
  font-size: 15px;
  margin: 0 0 24px;
  max-width: 560px;
}

.scene-input { max-width: 640px; }
.scene-input > label {
  display: block;
  font-weight: 600;
  font-size: 14.5px;
  margin-bottom: 8px;
}

.chip-label { font-weight: 600; font-size: 14.5px; margin-bottom: 10px; }

.chip-group { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: var(--space-5); }

.chip {
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-soft);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 16px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.chip:hover { border-color: var(--ink-soft); }

.chip.selected {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.evidence-card-group { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: var(--space-5); }

.evidence-card {
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 18px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.evidence-card:hover { border-color: var(--ink-soft); }

.evidence-card.selected {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.field-inline { margin-top: 4px; max-width: 640px; }

.field-inline label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
}

.optional-tag { font-weight: 400; color: var(--ink-faint); font-size: 12px; }

.field-inline input[type="text"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 13px;
  font-size: 14.5px;
  font-family: inherit;
  color: var(--ink);
  background: #fcfcfd;
}

.field-inline input[type="text"]:focus { outline: none; border-color: var(--accent); background: var(--paper); }

/* ---------- Map: viewport + project type matrix ---------- */

.map-viewport > * { margin-bottom: var(--space-9); }
.map-viewport > *:last-child { margin-bottom: var(--space-2); }

.map-secondary-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-7);
}


.project-type-row {
  display: flex;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
}

.matrix-wrap { flex-shrink: 0; }

.matrix {
  position: relative;
  width: 300px;
  height: 300px;
  margin: 36px 44px 58px 72px;
}

.matrix-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  width: 100%;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.matrix-quadrant {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  text-align: center;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--canvas);
  border: 0.5px solid var(--line);
  transition: background 0.2s ease, color 0.2s ease;
}

.matrix-quadrant.current { background: var(--accent-soft); color: var(--accent); }

.matrix-axis-title {
  position: absolute;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
}

.axis-title-x { bottom: -40px; left: 50%; transform: translateX(-50%); white-space: nowrap; }
.axis-title-y { left: -50px; top: 50%; transform: translateY(-50%) rotate(-90deg); white-space: nowrap; }

.matrix-axis-label { position: absolute; font-size: 11px; color: var(--ink-faint); }
.axis-y-top { top: -22px; left: 50%; transform: translateX(-50%); }
.axis-y-bottom { bottom: -22px; left: 50%; transform: translateX(-50%); }
.axis-x-left { left: -26px; top: 50%; transform: translateY(-50%); }
.axis-x-right { right: -32px; top: 50%; transform: translateY(-50%); }

.matrix-dot {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ink);
  border: 3px solid var(--paper);
  box-shadow: 0 0 0 1.5px var(--ink), 0 0 0 8px var(--accent-soft);
  transform: translate(-50%, -50%);
  transition: left 0.3s ease, top 0.3s ease;
  z-index: 2;
}

.matrix-dot-label {
  position: absolute;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink);
  background: var(--paper);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--line);
  white-space: nowrap;
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition: left 0.3s ease, top 0.3s ease;
  z-index: 2;
}

.project-type-summary { flex: 1; min-width: 220px; }
.project-type-name { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 6px; }
.project-type-interpretation {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0 0 12px;
  line-height: 1.5;
  max-width: var(--measure);
  overflow-wrap: anywhere;
}

/* ---------- Map: business context map ---------- */

.context-map {
  position: relative;
  height: 360px;
  margin: 12px 0 16px;
}

.cm-lines { position: absolute; inset: 0; width: 100%; height: 100%; }
.cm-lines polygon { fill: none; stroke: var(--line); stroke-width: 0.4; }

.dim-node {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 130px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--paper);
  border: 1.5px solid var(--line);
  text-align: center;
  cursor: pointer;
  font-family: inherit;
}

.dim-node.basis-evidence { border-style: solid; border-color: var(--ink); background: var(--accent-soft); }
.dim-node.basis-inferred { border-style: dashed; border-color: var(--ink-soft); }
.dim-node.basis-missing { border-style: dotted; border-color: var(--line); background: var(--canvas); opacity: 0.85; }
.dim-node.selected { box-shadow: 0 0 0 2px var(--ink); }

.dim-node-label { font-size: 11.5px; font-weight: 600; color: var(--ink); margin-bottom: 5px; line-height: 1.25; }
.dim-node-state { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.dim-node-state.state-clear { color: var(--accent); }
.dim-node-state.state-tension { color: var(--conf-medium); }
.dim-node-state.state-unknown { color: var(--conf-low); }

.context-legend {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-soft);
  background: var(--canvas);
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 16px;
}

.context-legend span { display: flex; align-items: center; gap: 7px; }
.legend-swatch { width: 13px; height: 13px; border-radius: 3px; display: inline-block; flex-shrink: 0; }
.swatch-evidence { border: 1.5px solid var(--ink); background: var(--accent-soft); }
.swatch-inferred { border: 1.5px dashed var(--ink-soft); background: var(--paper); }
.swatch-missing { border: 1.5px dotted var(--ink-faint); background: var(--paper); }

.dim-detail { border-top: 1px solid var(--line); padding-top: 16px; }
.dim-detail-placeholder { color: var(--ink-faint); font-size: 13.5px; margin: 0; }
.dim-detail-title { font-weight: 700; font-size: 15px; margin-bottom: 10px; }
.dim-detail-row { margin-bottom: 8px; }
.dim-detail-row:last-child { margin-bottom: 0; }
.dim-detail-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  margin-bottom: 2px;
}
.dim-detail-text { font-size: 13.5px; color: var(--ink); margin: 0; max-width: var(--measure); overflow-wrap: anywhere; }

/* ---------- Map: contradictions ---------- */

.contradiction-list {
  display: grid;
  align-items: start;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(min(var(--card-min-contradiction), 100%), 1fr));
}

.contradiction-item {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
}

.tension-line { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }

.tension-node {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.tension-connector {
  flex: 1;
  height: 1px;
  background: var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tension-connector-text {
  background: var(--paper);
  padding: 0 8px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  white-space: nowrap;
}

.contradiction-title { font-size: 15.5px; margin: 0 0 6px; }
.contradiction-hypothesis {
  font-size: 13.5px;
  color: var(--ink-soft);
  margin: 0 0 10px;
  line-height: 1.5;
  max-width: var(--measure);
  overflow-wrap: anywhere;
}
.contradiction-meta { margin-bottom: 10px; }

.why-matters summary {
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
}

.why-matters ul { margin: 10px 0 0; padding-left: 18px; }
.why-matters li { font-size: 12.5px; color: var(--ink-soft); margin-bottom: 6px; line-height: 1.5; }
.why-matters li:last-child { margin-bottom: 0; }

/* ---------- Align: project context strip ---------- */

.project-context-strip {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding: 11px 16px;
  margin-bottom: var(--space-8);
  background: var(--canvas);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
}

.project-context-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  flex-shrink: 0;
}

.project-context-text {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.4;
  flex: 1;
  min-width: 200px;
  max-width: var(--measure);
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-context-text.expanded {
  -webkit-line-clamp: unset;
  display: block;
}

.project-context-toggle {
  background: none;
  border: none;
  padding: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  flex-shrink: 0;
  font-family: inherit;
}

/* ---------- Align: conversations + verify ---------- */

.conversation-grid {
  display: grid;
  align-items: start;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(min(var(--card-min-conversation), 100%), 1fr));
}

.verify-grid {
  display: grid;
  align-items: start;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(min(var(--card-min-verify), 100%), 1fr));
}

.conversation-card, .verify-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
}

/* Conversations are the primary Align content: white, shadowed, with an
   accent marker — the cards you're meant to act on first. */
.conversation-card {
  background: var(--paper);
  box-shadow: var(--shadow);
  border-left: 3px solid var(--accent);
}

/* Verify cards stay visually secondary — flat and canvas-toned — while
   sharing the same border color/radius family so they still read as
   part of the same page, just a lower-priority follow-on to the conversations above. */
.verify-card {
  background: var(--canvas);
  box-shadow: none;
}

.cc-tag-plain {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin-bottom: 8px;
}

.conversation-question { font-size: 16.5px; font-weight: 700; letter-spacing: -0.005em; margin: 0 0 10px; line-height: 1.35; }
.verify-action { font-size: 14px; font-weight: 600; margin: 0 0 10px; line-height: 1.4; }

.conversation-row { margin-bottom: 10px; }
.conversation-row:last-child { margin-bottom: 0; }

.conversation-card .conversation-row { margin-bottom: var(--space-2); }
.conversation-card .conversation-row:last-child { margin-bottom: 0; }

.conversation-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  margin-bottom: 2px;
}

.conversation-row p { margin: 0; font-size: 13px; color: var(--ink-soft); line-height: 1.5; overflow-wrap: anywhere; }

.conversation-recommended {
  font-size: 11.5px;
  font-style: italic;
  color: var(--ink-faint);
  margin: 0 0 12px;
}

/* ---------- Align: summary + detailed brief ---------- */

.summary-collapsed { margin-bottom: 12px; padding: 20px 24px; }

.summary-collapsed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.summary-collapsed-title { font-size: 15.5px; font-weight: 700; color: var(--ink); }
.summary-collapsed-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.summary-copied-confirmation {
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  margin: 10px 0 0;
}

.summary-row { margin-bottom: 16px; }
.summary-row:last-child { margin-bottom: 0; }
.summary-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: var(--space-1);
}
.summary-value { margin: 0; font-size: 14.5px; color: var(--ink); max-width: var(--measure); overflow-wrap: anywhere; }
.summary-list { margin: 0; padding-left: 18px; }
.summary-list li { font-size: 13.5px; color: var(--ink); margin-bottom: var(--space-1); }
.summary-list li:last-child { margin-bottom: 0; }

.detailed-brief {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  margin-bottom: 8px;
}

.detailed-brief .brief-section { margin-bottom: var(--space-5); }
.detailed-brief .brief-section:last-child { margin-bottom: 0; }
.detailed-brief h4 {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin: 0 0 8px;
}
.detailed-brief p, .detailed-brief ul { margin: 0; font-size: 13.5px; color: var(--ink); line-height: 1.6; max-width: var(--measure); overflow-wrap: anywhere; }
.detailed-brief ul { padding-left: 20px; }
.detailed-brief li { margin-bottom: 10px; }
.detailed-brief li:last-child { margin-bottom: 0; }

.brief-note {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-faint);
  font-style: italic;
}

/* ---------- Align: feedback ---------- */

.feedback-form { display: flex; flex-direction: column; gap: 22px; }

.feedback-q {
  border: none;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.feedback-q > label,
.feedback-q > legend {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 8px;
  padding: 0;
}
.radio-row { display: flex; gap: 18px; flex-wrap: wrap; }
.radio-row label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  font-size: 13.5px;
  color: var(--ink-soft);
  cursor: pointer;
}
.radio-row input[type="radio"] { accent-color: var(--accent); }
.feedback-q textarea { margin-top: 4px; }
.feedback-confirmation { color: var(--accent); font-size: 13.5px; font-weight: 600; margin-top: 4px; }

/* ---------- Footer ---------- */

.app-footer {
  max-width: var(--page-width);
  margin: 0 auto;
  padding-block: 24px 48px;
  padding-inline: clamp(var(--gutter-min), 4vw, var(--gutter-max));
  text-align: center;
  color: var(--ink-faint);
  font-size: 12.5px;
}
.app-footer p { margin: 0 0 4px; }
.app-footer a { color: var(--ink-soft); text-decoration: underline; }

/* ---------- Responsive: desktop enhancements ---------- */

/* Below this width every screen keeps its original single-column, stacked
   reading order (unchanged from before this pass). At and above it, three
   screens gain an intentional desktop composition: Describe becomes a
   two-column editorial layout (visual | content, alternating sides),
   Map splits its context-map + contradictions into a wider/narrower
   dashboard row, and heading sizes step up to use the extra width. */
@media (min-width: 900px) {
  .scene {
    display: grid;
    grid-template-columns: minmax(220px, 300px) 1fr;
    align-items: start;
    gap: 56px;
    margin-bottom: var(--space-9);
  }
  .scene:last-of-type { margin-bottom: var(--space-9); }

  .scene-visual { margin-bottom: 0; padding-top: 4px; }
  .scene-visual svg { max-width: 100%; }

  .scene--flip .scene-visual { order: 2; }
  .scene--flip .scene-content { order: 1; }

  .map-secondary-row {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    align-items: start;
    gap: 32px;
  }

  .screen-head h1 { font-size: 30px; }
  .section-title { font-size: 18px; }
}

/* ---------- Responsive: mobile ---------- */

@media (max-width: 760px) {
  .app-header-inner { flex-direction: column; align-items: flex-start; gap: 12px; }
  .card-panel { padding: var(--space-6); }
  .project-type-row { flex-direction: column; align-items: flex-start; gap: 24px; }
  /* Matrix + axis offsets are re-tuned together: axis-title-y/-x and axis-x-right
     read their position relative to .matrix, so its own margin on each side must
     stay >= the matching axis offset or the label pokes outside the card padding. */
  .matrix { width: 150px; height: 150px; margin: 18px 34px 30px 38px; }
  .matrix-quadrant { font-size: 9px; padding: 5px; }
  .matrix-dot-label { font-size: 9.5px; padding: 2px 6px; }
  .axis-title-x { bottom: -28px; }
  .axis-title-y { left: -34px; }
  .axis-y-top { top: -16px; }
  .axis-y-bottom { bottom: -16px; }
  .axis-x-left { left: -18px; }
  .axis-x-right { right: -20px; }
  .context-map { height: auto; }
  .dim-node {
    position: static !important;
    transform: none !important;
    width: 100%;
    margin-bottom: 10px;
  }
  .cm-lines { display: none; }
  .summary-collapsed-header { flex-direction: column; align-items: flex-start; }
}
