:root {
  --bg: #f6f2ea;
  --bg-deep: #ece3d7;
  --paper: rgba(255, 252, 247, 0.94);
  --paper-strong: #fffdfa;
  --panel-tint: rgba(245, 238, 229, 0.74);
  --line: rgba(31, 33, 27, 0.12);
  --line-strong: rgba(31, 33, 27, 0.22);
  --text: #171915;
  --muted: #5c584f;
  --accent: #25453d;
  --accent-soft: rgba(37, 69, 61, 0.08);
  --sand: #8b6242;
  --sand-soft: rgba(139, 98, 66, 0.1);
  --danger: #92483a;
  --danger-soft: rgba(146, 72, 58, 0.12);
  --display: "Cormorant Garamond", Georgia, serif;
  --body: "Source Serif 4", Georgia, serif;
  --meta: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  --radius-xl: 34px;
  --radius-lg: 26px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --shadow: 0 18px 48px rgba(31, 33, 27, 0.05);
}

html {
  scroll-behavior: smooth;
}

html.page-scale-80 {
  zoom: 0.8;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(139, 98, 66, 0.08), transparent 24%),
    radial-gradient(circle at 82% 12%, rgba(37, 69, 61, 0.08), transparent 20%),
    linear-gradient(180deg, #faf7f1 0%, var(--bg) 48%, var(--bg-deep) 100%);
  color: var(--text);
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.72;
}

body.modal-open {
  overflow: hidden;
}

.page-veil {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0)),
    radial-gradient(circle at 18% 24%, rgba(255, 255, 255, 0.5), transparent 18%),
    radial-gradient(circle at 85% 78%, rgba(255, 255, 255, 0.34), transparent 18%);
  z-index: -1;
}

.site-shell {
  width: min(1380px, calc(100% - 2.4rem));
  margin: 0 auto;
  padding: 1.25rem 0 5.5rem;
}

.topbar {
  position: sticky;
  top: 1rem;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1rem 1.2rem;
  margin-bottom: 3.2rem;
  border: 1px solid rgba(31, 33, 27, 0.08);
  border-radius: 999px;
  background: rgba(255, 251, 246, 0.82);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 28px rgba(31, 33, 27, 0.04);
}

.brand,
.topnav a {
  color: inherit;
  text-decoration: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  font-family: var(--body);
  font-size: 1.05rem;
  font-weight: 500;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 999px;
  border: 1px solid rgba(37, 69, 61, 0.16);
  background: linear-gradient(135deg, rgba(37, 69, 61, 0.11), rgba(139, 98, 66, 0.14));
  color: var(--accent);
  font-family: var(--meta);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.topnav {
  display: inline-flex;
  align-items: center;
  gap: 1.45rem;
}

.topnav a {
  font-family: var(--meta);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.scope-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 0.92rem;
  border: 1px solid rgba(37, 69, 61, 0.12);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--meta);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

main section {
  margin-bottom: 5.4rem;
}

.surface {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  gap: 1.6rem;
  align-items: start;
}

.hero-copy,
.atlas-card,
.adjacent-card,
.use-card,
.logic-card,
.ending-card,
.workspace-card,
.insight-card,
.coverage-card,
.site-footer {
  padding: 2rem;
}

.hero-copy {
  padding: 2.35rem;
}

.hero-intro-grid,
.atlas-layout,
.atlas-steps,
.atlas-summary,
.use-grid,
.workspace-grid,
.insight-grid,
.coverage-grid,
.logic-layout {
  display: grid;
  gap: 1.4rem;
}

.eyebrow,
.mini-label,
.note-label,
.fact-label,
.card-index,
.logic-step span,
.step-index {
  font-family: var(--meta);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0 0 0.9rem;
  color: var(--sand);
}

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

.mini-label {
  margin: 0 0 0.55rem;
  color: var(--muted);
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--text);
  font-family: var(--display);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.03em;
}

h1 {
  font-size: clamp(3.35rem, 5.2vw, 5.35rem);
}

h2 {
  font-size: clamp(2.25rem, 3.2vw, 3.2rem);
}

h3 {
  font-size: clamp(1.5rem, 2vw, 2.1rem);
}

p,
li {
  margin: 0;
  color: var(--muted);
}

.hero-text,
.section-note,
.atlas-caption,
.question-message {
  font-size: 1rem;
}

.hero-text {
  max-width: 50rem;
  margin: 0;
}

.hero-copy h1 {
  max-width: none;
  font-size: clamp(3.6rem, 4.9vw, 5.2rem);
}

.hero-intro-grid {
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.hero-intro-main {
  max-width: 78rem;
}

.hero-intro-side {
  display: grid;
  gap: 0.95rem;
  max-width: 50rem;
  justify-self: start;
}

.hero-actions,
.sample-row,
.choice-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.hero-actions {
  margin-top: 0.1rem;
  margin-bottom: 0;
}

button,
input,
textarea,
select {
  font: inherit;
}

.button,
.ghost-button,
.sample-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.button:hover,
.ghost-button:hover,
.sample-button:hover,
.choice-chip:hover {
  transform: translateY(-1px);
}

.button {
  padding: 0.98rem 1.3rem;
}

.button.primary {
  background: linear-gradient(135deg, var(--accent), #2f564d);
  color: #fffdfa;
  box-shadow: 0 14px 32px rgba(37, 69, 61, 0.16);
}

.button.secondary,
.ghost-button,
.sample-button {
  padding: 0.86rem 1.02rem;
  background: rgba(255, 252, 247, 0.78);
  border-color: var(--line);
  color: var(--text);
}

.button.wide {
  width: 100%;
}

.hero-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.fact-item {
  padding: 1.15rem 1.2rem;
  border: 1px solid rgba(31, 33, 27, 0.08);
  border-radius: var(--radius-md);
  background: rgba(250, 245, 238, 0.72);
}

.fact-label {
  display: inline-flex;
  margin-bottom: 0.6rem;
  color: var(--sand);
}

.fact-item strong {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--text);
  font-family: var(--display);
  font-size: 1.4rem;
  line-height: 1;
}

.domain-hero {
  padding: 2rem;
}

.domain-hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.2rem;
  align-items: start;
  justify-items: center;
  text-align: center;
  margin-bottom: 1.55rem;
}

.domain-hero-copy {
  max-width: 86rem;
}

.domain-hero-copy h1 {
  max-width: 28ch;
  font-size: clamp(2.75rem, 3.85vw, 4.05rem);
}

.domain-hero-side {
  display: grid;
  gap: 1.1rem;
  justify-items: center;
  max-width: 52rem;
}

.domain-hero .hero-text {
  max-width: 52rem;
  line-height: 1.58;
}

.domain-hero .hero-actions {
  justify-content: center;
  gap: 1rem;
  margin-top: 0.15rem;
}

.domain-hero .hero-facts {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.15rem;
  grid-auto-rows: 1fr;
}

.domain-hero .fact-item {
  padding: 1.2rem 1.22rem;
  min-height: 0;
}

.domain-hero .fact-item strong {
  font-size: 1.28rem;
}

.atlas-card {
  padding: 2rem;
}

.atlas-head {
  grid-template-columns: 1fr;
  gap: 1rem;
  justify-items: center;
  text-align: center;
  margin-bottom: 1.45rem;
}

.atlas-caption {
  max-width: 62rem;
  font-size: 1rem;
  line-height: 1.65;
  text-align: center;
}

.atlas-head h2 {
  max-width: 30ch;
  font-size: clamp(2.35rem, 3.2vw, 3.45rem);
  margin-inline: auto;
}

.atlas-layout {
  grid-template-columns: minmax(14rem, 0.94fr) minmax(24rem, 1.12fr) minmax(14rem, 0.94fr);
  align-items: stretch;
}

.atlas-steps {
  align-content: center;
}

.atlas-step-card {
  padding: 1.1rem 1.15rem;
  border: 1px solid rgba(31, 33, 27, 0.08);
  border-radius: var(--radius-md);
  background: rgba(255, 252, 247, 0.86);
  box-shadow: 0 12px 24px rgba(31, 33, 27, 0.05);
}

.atlas-step-card strong {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--text);
}

.atlas-figure-shell {
  position: relative;
  min-height: 34rem;
  overflow: hidden;
  border: 1px solid rgba(31, 33, 27, 0.08);
  border-radius: calc(var(--radius-xl) - 4px);
  background:
    linear-gradient(180deg, rgba(252, 248, 242, 0.94), rgba(240, 234, 224, 0.9)),
    linear-gradient(90deg, rgba(37, 69, 61, 0.04) 1px, transparent 1px),
    linear-gradient(rgba(37, 69, 61, 0.04) 1px, transparent 1px);
  background-size: auto, 5.2rem 5.2rem, 5.2rem 5.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 1.5rem;
}

.atlas-figure-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.32));
  pointer-events: none;
}

.atlas-diagram {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  max-width: 34rem;
}

.atlas-figure-caption {
  position: absolute;
  left: 50%;
  z-index: 2;
  transform: translateX(-50%);
  padding: 0.45rem 0.8rem;
  border: 1px solid rgba(31, 33, 27, 0.08);
  border-radius: 999px;
  background: rgba(255, 252, 247, 0.88);
  color: var(--muted);
  font-family: var(--meta);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.atlas-figure-caption-top {
  top: 1rem;
}

.atlas-figure-caption-bottom {
  bottom: 1rem;
  max-width: calc(100% - 2rem);
  text-align: center;
}

.note-label {
  display: inline-flex;
  margin-bottom: 0.45rem;
  color: var(--sand);
}

.atlas-summary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.15rem;
  padding-top: 1.15rem;
  border-top: 1px solid rgba(31, 33, 27, 0.08);
}

.atlas-summary strong,
.logic-step strong,
.ending-list strong,
.use-card strong,
.meta-item strong,
.candidate-head strong {
  color: var(--text);
}

.adjacent-list,
.ending-list,
.logic-steps,
.coverage-card ul,
.use-card ul,
.note-list,
.entry-form,
.question-stack,
.candidate-list,
.ledger-list {
  display: grid;
  gap: 1rem;
}

.section-heading {
  max-width: 68rem;
  margin-bottom: 1.6rem;
}

.section-heading h2 {
  max-width: none;
  margin-bottom: 0.55rem;
  font-size: clamp(1.85rem, 2.5vw, 2.6rem);
}

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

.use-card {
  min-height: 0;
}

.card-index {
  display: inline-flex;
  margin-bottom: 0.9rem;
  color: var(--sand);
}

.use-card p {
  margin: 0.95rem 0 1rem;
}

.use-card ul,
.coverage-card ul {
  padding-left: 1.1rem;
}

.use-card li,
.coverage-card li {
  margin-bottom: 0.4rem;
}

.logic-layout {
  grid-template-columns: minmax(0, 1.2fr) minmax(20rem, 0.8fr);
  align-items: stretch;
}

.logic-card,
.ending-card {
  height: 100%;
}

.logic-card {
  display: grid;
  grid-template-rows: auto 1fr;
}

.ending-card {
  display: grid;
  grid-template-rows: auto auto 1fr;
}

.logic-step {
  display: grid;
  grid-template-columns: 3.1rem 1fr;
  gap: 1rem;
  align-items: start;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(31, 33, 27, 0.08);
}

.logic-step:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.logic-step span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

.ending-card h3 {
  margin-bottom: 1.1rem;
}

.ending-list {
  display: grid;
  grid-template-rows: repeat(3, 1fr);
  height: 100%;
}

.ending-list > div {
  padding: 1rem 0;
  border-top: 1px solid rgba(31, 33, 27, 0.08);
}

.ending-list > div:first-child {
  padding-top: 0;
  border-top: 0;
}

.workspace-grid {
  grid-template-columns: minmax(22rem, 0.92fr) minmax(0, 1.08fr);
}

#workspace .section-heading {
  max-width: 72rem;
  margin-bottom: 0;
  padding-inline: 1.35rem;
}

#workspace .section-heading h2 {
  max-width: 26ch;
  font-family: var(--body);
  font-size: clamp(1.7rem, 2.15vw, 2.15rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-bottom: 0.2rem;
}

#workspace .workspace-grid {
  gap: 1rem;
  align-items: stretch;
  grid-auto-rows: 1fr;
}

#workspace .workspace-card {
  padding: 1.15rem;
  height: 100%;
  display: flex;
  flex-direction: column;
}

#workspace .panel-head {
  margin-bottom: 0.05rem;
}

#workspace .entry-form,
#workspace .question-stack {
  gap: 0.72rem;
}

#workspace .sample-row {
  gap: 0.5rem;
}

#workspace .sample-button {
  padding: 0.58rem 0.78rem;
}

#workspace .workspace-note,
#workspace .meta-item,
#workspace .question-shell {
  padding: 0.78rem 0.82rem;
}

#workspace .question-shell {
  flex: 1;
}

#workspace .meta-grid {
  gap: 0.6rem;
  margin: 0.8rem 0 0.85rem;
}

#workspace .question-message {
  max-width: 12rem;
  font-size: 0.88rem;
}

.knee-textarea {
  min-height: 6.9rem;
}

#workspace .section-note {
  max-width: none;
  font-size: 0.96rem;
  line-height: 1.52;
}

#demo .section-heading {
  max-width: 58rem;
  margin-bottom: 1.2rem;
}

#demo .workspace-grid {
  gap: 1rem;
}

#demo .workspace-card {
  padding: 1.45rem;
}

#demo .panel-head {
  margin-bottom: 0.2rem;
}

#demo .entry-form,
#demo .redirect-stack {
  gap: 0.85rem;
}

#demo .sample-row {
  gap: 0.65rem;
}

#demo .sample-button {
  padding: 0.72rem 0.88rem;
}

#demo .workspace-note,
#demo .redirect-step {
  padding: 0.85rem 0.95rem;
}

#demo .redirect-step p,
#demo .workspace-note {
  font-size: 0.96rem;
  line-height: 1.58;
}

.handoff-textarea {
  min-height: 8.75rem;
}

.insight-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 1.6rem;
}

.insight-card-wide {
  grid-column: 1 / -1;
}

.panel-head,
.candidate-head,
.question-head,
.ledger-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.field {
  display: grid;
  gap: 0.55rem;
}

.field span,
.meta-label {
  color: var(--muted);
  font-size: 0.96rem;
}

input,
textarea,
select {
  width: 100%;
  padding: 1rem 1.05rem;
  border: 1px solid rgba(31, 33, 27, 0.12);
  border-radius: var(--radius-sm);
  background: rgba(255, 253, 249, 0.94);
  color: var(--text);
}

textarea {
  min-height: 15rem;
  resize: vertical;
}

.workspace-note,
.meta-item,
.question-shell,
.question-block,
.candidate-card,
.ledger-entry,
.note-item {
  border: 1px solid rgba(31, 33, 27, 0.08);
  border-radius: var(--radius-md);
  background: rgba(250, 245, 238, 0.72);
}

.workspace-note,
.meta-item,
.question-shell,
.question-block,
.candidate-card,
.ledger-entry,
.note-item {
  padding: 1.1rem;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.35rem 0 1.5rem;
}

.question-message {
  max-width: 20rem;
  text-align: right;
}

.question-head-copy {
  display: grid;
  gap: 0.25rem;
}

.question-block-active {
  display: grid;
  gap: 0.85rem;
}

.question-nav {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  margin-top: auto;
}

.question-head span {
  color: var(--sand);
  text-transform: capitalize;
  font-size: 0.85rem;
}

.question-note {
  margin-top: 0.75rem;
  color: var(--sand);
}

.choice-chip {
  position: relative;
  cursor: pointer;
}

.choice-chip input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.choice-chip span {
  display: inline-flex;
  align-items: center;
  min-height: 2.85rem;
  padding: 0.82rem 1rem;
  border: 1px solid rgba(31, 33, 27, 0.12);
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.94);
}

.choice-chip input:checked + span {
  border-color: rgba(37, 69, 61, 0.18);
  background: var(--accent-soft);
  color: var(--accent);
}

.field-compact select {
  max-width: 14rem;
}

.field-hint {
  font-size: 0.9rem;
  color: var(--muted);
}

.note-item {
  background: var(--sand-soft);
  color: #725234;
}

.status-banner {
  margin-top: 1rem;
  padding: 0.95rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
}

.status-banner[data-tone="warning"] {
  background: rgba(139, 98, 66, 0.16);
  color: #785230;
}

.status-banner[data-tone="danger"] {
  background: var(--danger-soft);
  color: var(--danger);
}

.status-banner[data-tone="success"] {
  background: rgba(37, 69, 61, 0.16);
  color: var(--accent);
}

.result-body,
.candidate-list,
.ledger-list {
  min-height: 0;
}

.result-body {
  display: grid;
  gap: 1rem;
}

.result-summary-card,
.candidate-modal-meta-item,
.candidate-modal-detail,
.shortlist-note {
  border: 1px solid rgba(31, 33, 27, 0.08);
  border-radius: var(--radius-md);
  background: rgba(250, 245, 238, 0.72);
}

.result-summary-card,
.candidate-modal-meta-item,
.candidate-modal-detail {
  padding: 1.1rem;
}

.result-summary-actions {
  display: grid;
  gap: 0.85rem;
  align-items: start;
}

.result-summary-note,
.candidate-modal-message,
.candidate-modal-card-copy p,
.candidate-modal-detail p,
.shortlist-note p {
  color: var(--muted);
}

.shortlist-note strong {
  display: block;
  margin-bottom: 0.4rem;
}

.candidate-card.emphasis {
  background: linear-gradient(180deg, rgba(239, 245, 241, 0.88), rgba(255, 251, 246, 0.94));
}

.candidate-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.7rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--meta);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

.result-warning {
  color: #79522e;
}

.result-danger {
  color: var(--danger);
}

.ledger-entry details {
  margin-top: 0.85rem;
}

.ledger-entry summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
}

.ledger-payload {
  margin: 0.75rem 0 0;
  padding: 1rem;
  overflow-x: auto;
  border: 1px solid rgba(31, 33, 27, 0.08);
  border-radius: var(--radius-sm);
  background: #f7f4ee;
  color: var(--muted);
}

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

.candidate-modal-shell {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1.2rem;
}

.candidate-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 25, 21, 0.42);
  backdrop-filter: blur(8px);
}

.candidate-modal {
  position: relative;
  z-index: 1;
  width: min(880px, 100%);
  max-height: min(88vh, 940px);
  overflow-y: auto;
  padding: 1.35rem;
  background: rgba(255, 252, 247, 0.97);
}

.candidate-modal-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.modal-close {
  white-space: nowrap;
}

.candidate-modal-message {
  margin-bottom: 1rem;
}

.candidate-modal-meta,
.candidate-modal-list,
.candidate-modal-detail-grid {
  display: grid;
  gap: 1rem;
}

.candidate-modal-meta {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.candidate-modal-meta-item span,
.candidate-modal-detail span {
  display: inline-flex;
  margin-bottom: 0.45rem;
  color: var(--sand);
  font-family: var(--meta);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.candidate-modal-meta-item strong,
.candidate-modal-card strong {
  color: var(--text);
}

.candidate-modal-card {
  padding: 1.2rem;
  border: 1px solid rgba(31, 33, 27, 0.08);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.96), rgba(241, 236, 228, 0.88));
}

.candidate-modal-card-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
}

.candidate-modal-card-copy {
  display: grid;
  gap: 0.2rem;
}

.candidate-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  border: 1px solid rgba(37, 69, 61, 0.14);
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--meta);
  font-size: 0.88rem;
  letter-spacing: 0.08em;
}

.candidate-modal-detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 1rem;
}

.site-footer {
  display: grid;
  gap: 0.65rem;
  max-width: 52rem;
}

button:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  transform: none;
}

@media (max-width: 1220px) {
  .domain-hero-grid,
  .hero-intro-grid,
  .atlas-head,
  .atlas-layout,
  .workspace-grid,
  .logic-layout {
    grid-template-columns: 1fr;
  }

  .use-grid,
  .hero-facts,
  .coverage-grid,
  .insight-grid,
  .atlas-summary,
  .candidate-modal-meta,
  .candidate-modal-detail-grid {
    grid-template-columns: 1fr;
  }

  .atlas-figure-shell {
    order: -1;
  }

  .insight-card-wide {
    grid-column: auto;
  }

  .atlas-caption,
  .question-message {
    text-align: left;
    max-width: none;
  }
}

@media (max-width: 920px) {
  .site-shell {
    width: min(100% - 1rem, 1380px);
  }

  .topbar {
    position: static;
    display: grid;
    justify-items: start;
    border-radius: 1.75rem;
  }

  .topnav {
    flex-wrap: wrap;
  }

  .hero-copy,
  .atlas-card,
  .use-card,
  .logic-card,
  .ending-card,
  .workspace-card,
  .insight-card,
  .coverage-card,
  .site-footer {
    padding: 1.7rem;
  }

  .hero-copy {
    padding: 1.95rem 1.7rem;
  }

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

  .domain-hero .hero-facts {
    grid-template-columns: 1fr;
  }

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

  .candidate-modal-card-head {
    grid-template-columns: 1fr;
  }

  .atlas-figure-shell {
    min-height: 31rem;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 17px;
  }

  h1 {
    font-size: 3.25rem;
  }

  h2 {
    font-size: 2.25rem;
  }

  .atlas-head,
  .hero-intro-grid,
  .panel-head,
  .question-head,
  .candidate-head,
  .ledger-head,
  .candidate-modal-head {
    display: grid;
  }

  .hero-copy h1,
  .domain-hero-copy h1,
  .section-heading h2,
  .atlas-head h2 {
    max-width: none;
  }

  .hero-facts,
  .meta-grid,
  .atlas-steps,
  .candidate-modal-meta,
  .candidate-modal-detail-grid {
    grid-template-columns: 1fr;
  }

  .atlas-figure-shell {
    min-height: auto;
    padding: 3.5rem 1rem 4.75rem;
  }

  .atlas-diagram {
    height: auto;
    max-width: 26rem;
  }

  .atlas-figure-caption {
    width: calc(100% - 2rem);
    white-space: normal;
  }
}

.workflow-section {
  display: grid;
  gap: 0.7rem;
}

.workflow-shell {
  display: grid;
  gap: 0.65rem;
  align-items: start;
}

.workflow-shell.surface {
  padding: 1.3rem;
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.9), rgba(242, 236, 227, 0.74));
  box-shadow: none;
  border-color: rgba(31, 33, 27, 0.04);
}

.workflow-shell > .workflow-card.surface {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.workflow-shell-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.2rem;
}

.workflow-shell-title {
  margin: 0;
  max-width: 34rem;
  color: var(--text);
  font-family: var(--display);
  font-size: clamp(2rem, 2.2vw, 2.55rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.workflow-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: flex-end;
}

.workflow-card,
.coverage-band-card,
.review-card {
  padding: 1.35rem;
}

.rail-card,
.context-card,
.question-panel,
.candidate-state-card,
.candidate-state-note,
.coverage-item,
.outcome-summary-card {
  border: 1px solid rgba(31, 33, 27, 0.08);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.96), rgba(244, 238, 229, 0.78));
}

.rail-card,
.context-card,
.question-panel,
.candidate-state-card,
.candidate-state-note,
.coverage-item,
.outcome-summary-card {
  padding: 1rem;
}

.rail-metrics,
.candidate-state-list,
.coverage-list {
  display: grid;
  gap: 0.85rem;
}

.candidate-state-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(37, 69, 61, 0.12);
  background: rgba(255, 252, 247, 0.92);
  color: var(--accent);
  font-family: var(--meta);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
}

.rail-metric strong,
.coverage-item strong,
.outcome-meta-item strong,
.candidate-state-card strong {
  display: block;
  color: var(--text);
}

.candidate-state-card p {
  margin-top: 0.2rem;
}

.rail-metrics {
  grid-template-columns: minmax(16rem, 1.75fr) repeat(3, minmax(0, 1fr));
}

.rail-metric {
  padding: 0.9rem 0.95rem;
  border: 1px solid rgba(31, 33, 27, 0.05);
  border-radius: var(--radius-md);
  background: rgba(250, 245, 238, 0.42);
  min-width: 0;
}

.rail-metric-value-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.rail-metric-session strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-copy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-height: 2rem;
  padding: 0.45rem 0.72rem;
  border: 1px solid rgba(31, 33, 27, 0.08);
  border-radius: 999px;
  background: rgba(255, 252, 247, 0.94);
  color: var(--text);
  font-family: var(--meta);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

.metric-copy-button:hover {
  transform: translateY(-1px);
  background: rgba(248, 244, 237, 0.98);
}

.metric-copy-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
}

.rail-label,
.parser-badge,
.result-chip,
.question-progress,
.result-kicker,
.outcome-meta-item span,
.micro-label {
  font-family: var(--meta);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.rail-label,
.micro-label {
  color: var(--muted);
}

.rail-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.8rem;
}

.parser-badge,
.result-chip,
.question-progress {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.3rem;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(31, 33, 27, 0.08);
  background: rgba(255, 252, 247, 0.9);
  color: var(--accent);
}

.parser-badge[data-mode="rule_fallback"] {
  color: #785230;
  background: rgba(139, 98, 66, 0.12);
}

.result-chip[data-tone="success"] {
  color: var(--accent);
  background: rgba(37, 69, 61, 0.12);
}

.result-chip[data-tone="warning"] {
  color: #785230;
  background: rgba(139, 98, 66, 0.12);
}

.result-chip[data-tone="danger"] {
  color: var(--danger);
  background: rgba(146, 72, 58, 0.12);
}

.workflow-card {
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.92), rgba(244, 238, 229, 0.7));
  box-shadow: none;
  border-color: rgba(31, 33, 27, 0.04);
}

.workflow-shell .status-banner {
  margin-top: 0;
}

.stage-copy {
  max-width: 60rem;
}

.signal-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.58rem 0.82rem;
  border-radius: 999px;
  border: 1px solid rgba(37, 69, 61, 0.12);
  background: rgba(37, 69, 61, 0.08);
  color: var(--accent);
  font-size: 0.95rem;
  line-height: 1.2;
}

.intake-form,
.interview-layout,
.question-stage-form,
.outcome-meta-grid,
.coverage-band-grid {
  display: grid;
  gap: 1rem;
}

.intake-form {
  gap: 0.95rem;
}

.intake-stage {
  min-height: auto;
}

.intake-stage .stage-copy,
.interview-stage .question-caption,
.result-stage .result-summary {
  font-size: 1.02rem;
}

.intake-form .field {
  gap: 0.8rem;
}

.intake-stage .knee-textarea {
  min-height: 16rem;
  padding: 1.25rem 1.3rem;
  border-radius: 24px;
  background: rgba(255, 253, 249, 0.98);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  line-height: 1.72;
}

.intake-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: end;
}

.intake-actions .button {
  min-width: 14rem;
}

.interview-layout {
  grid-template-columns: 1fr;
  align-items: start;
}

.interview-context {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.interview-context .question-message {
  max-width: none;
  text-align: left;
}

.question-stage-form {
  align-content: start;
  width: 100%;
}

.question-panel {
  padding: 1.35rem;
}

.question-panel-head {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.question-phase-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 0.48rem 0.78rem;
  border-radius: 999px;
  background: rgba(139, 98, 66, 0.1);
  color: var(--sand);
  font-family: var(--meta);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.question-title {
  margin: 0;
  color: var(--text);
  font-family: var(--body);
  font-size: clamp(1.6rem, 2.2vw, 2.1rem);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.02em;
}

.question-caption {
  max-width: 40rem;
}

.question-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 1rem;
}

.question-actions .button {
  min-width: 12rem;
}

.choice-group,
.scale-choice-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.scale-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.question-panel .choice-chip span {
  min-height: 3.9rem;
  padding: 0.9rem 1rem;
  background: rgba(255, 253, 249, 0.96);
}

.scale-chip span {
  display: grid;
  justify-items: start;
  gap: 0.12rem;
  width: 100%;
}

.scale-chip strong {
  color: var(--text);
  font-family: var(--meta);
  font-size: 0.96rem;
}

.scale-chip small {
  color: var(--muted);
  font-size: 0.8rem;
}

.outcome-summary-card {
  display: grid;
  gap: 0.85rem;
}

.outcome-success {
  background: linear-gradient(180deg, rgba(239, 245, 241, 0.92), rgba(251, 247, 241, 0.94));
}

.outcome-warning {
  background: linear-gradient(180deg, rgba(248, 240, 231, 0.92), rgba(251, 247, 241, 0.94));
}

.outcome-danger {
  background: linear-gradient(180deg, rgba(248, 236, 233, 0.94), rgba(251, 247, 241, 0.94));
}

.result-kicker {
  color: var(--sand);
}

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

.outcome-meta-item {
  padding: 0.85rem 0.9rem;
  border: 1px solid rgba(31, 33, 27, 0.08);
  border-radius: var(--radius-sm);
  background: rgba(255, 252, 247, 0.74);
}

.coverage-heading {
  max-width: 74rem;
}

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

.coverage-band-card {
  display: grid;
  gap: 1rem;
}

.coverage-item {
  display: grid;
  gap: 0.25rem;
}

.candidate-modal {
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.98), rgba(243, 238, 229, 0.94));
}

@media (max-width: 1220px) {
  .coverage-band-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 920px) {
  .workflow-shell.surface {
    padding: 1.2rem;
  }

  .workflow-card,
  .coverage-band-card,
  .review-card {
    padding: 1.2rem;
  }

  .workflow-shell > .workflow-card.surface {
    padding: 0;
  }

  .workflow-shell-head,
  .workflow-toolbar-actions {
    display: grid;
  }

  .rail-metrics,
  .outcome-meta-grid,
  .interview-context {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 720px) {
  .intake-actions {
    display: grid;
  }

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

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