:root {
  --ink: #241d16;
  --muted: #71675d;
  --line: #ddd2c4;
  --surface: #ffffff;
  --surface-soft: #eee8dd;
  --surface-amber: #ffe9dc;
  --surface-amber-pale: #fbf5eb;
  --surface-green: #e8f3ef;
  --amber: #c94d06;
  --amber-dark: #963500;
  --amber-line: #e2a47e;
  --espresso: #211a12;
  --espresso-soft: #30251a;
  --espresso-line: #574432;
  --teal: #176f69;
  --teal-dark: #105954;
  --coral: #b85f50;
  --gold: #c88a21;
  --leaf: #4f7452;
  --plum: #6e5a91;
  --blue: #356b86;
  --shadow: 0 14px 38px rgba(50, 38, 25, 0.09);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--surface-soft);
}

body {
  margin: 0;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
  letter-spacing: 0;
}

[hidden] {
  display: none !important;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

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

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.08;
}

p {
  margin: 0;
}

strong {
  font-weight: 850;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px clamp(16px, 4vw, 42px);
  border-bottom: 1px solid var(--espresso-line);
  background: rgba(33, 26, 18, 0.97);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
  color: #fffaf2;
  text-decoration: none;
}

.brand strong {
  display: block;
  font-size: clamp(0.96rem, 1.5vw, 1.12rem);
  line-height: 1.1;
}

.brand-mark {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 8px;
  background: var(--amber);
  box-shadow: none;
}

.brand-mark span {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fffaf2;
}

.brand-mark span:nth-child(1) {
  top: 10px;
  left: 10px;
}

.brand-mark span:nth-child(2) {
  right: 9px;
  top: 15px;
  background: #ffd8bd;
}

.brand-mark span:nth-child(3) {
  left: 18px;
  bottom: 9px;
  background: #ffffff;
}

.brand-mark::before,
.brand-mark::after {
  position: absolute;
  content: "";
  width: 24px;
  height: 1px;
  background: rgba(255, 250, 242, 0.72);
  transform-origin: left center;
}

.brand-mark::before {
  top: 14px;
  left: 15px;
  transform: rotate(20deg);
}

.brand-mark::after {
  bottom: 14px;
  left: 16px;
  transform: rotate(-31deg);
}

.eyebrow {
  display: block;
  margin: 0 0 5px;
  color: var(--amber-dark);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar .eyebrow {
  color: #f39a5f;
}

.topbar .button.secondary {
  color: #f8efe4;
  border-color: #68533e;
  background: var(--espresso-soft);
}

.topbar .button.secondary:hover,
.topbar .button.secondary:focus-visible {
  color: #ffffff;
  border-color: #d8783f;
  background: #3a2c1e;
}

.top-actions,
.hero-actions,
.wizard-controls {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.save-status {
  color: #d8cbbc;
  font-size: 0.78rem;
  font-weight: 750;
  white-space: nowrap;
}

.save-status.is-saving {
  color: #ffc79f;
}

.save-status.is-saved {
  color: #b9ddd4;
}

.save-status.is-error {
  color: #ffc0b6;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  min-width: 104px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 850;
  white-space: nowrap;
}

.button.primary {
  color: #ffffff;
  border-color: var(--amber);
  background: var(--amber);
}

.button.primary:hover {
  border-color: var(--amber-dark);
  background: var(--amber-dark);
}

.button.secondary {
  color: var(--ink);
  border-color: var(--line);
  background: var(--surface);
}

.button.ghost {
  color: var(--amber-dark);
  border-color: transparent;
  background: transparent;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

main {
  width: min(1200px, 100%);
  margin: 0 auto;
  padding: clamp(16px, 3vw, 32px);
}

.wizard-shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-content: start;
  align-items: stretch;
  width: min(900px, 100%);
  min-height: calc(100vh - 104px);
  margin: 0 auto;
}

.progress-panel,
.question-card,
.report-card,
.archetype-panel,
.radar-panel,
.path-panel,
.deep-report details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.progress-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 340px);
  grid-template-areas:
    "intro summary"
    "trail trail";
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  box-shadow: 0 10px 30px rgba(24, 33, 31, 0.06);
}

.progress-panel h1 {
  font-size: clamp(1.18rem, 2vw, 1.55rem);
}

.intro-copy {
  grid-area: intro;
  display: grid;
  gap: 5px;
  min-width: 0;
}

.intro-copy .eyebrow {
  margin-bottom: 0;
}

.progress-summary {
  grid-area: summary;
  display: grid;
  gap: 8px;
  min-width: 0;
}

.quiet {
  color: #5f564d;
  font-size: 0.95rem;
  font-weight: 600;
}

.progress-meter {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8e3d9;
}

.progress-meter span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--amber);
  transition: width 180ms ease;
}

.progress-meter.small {
  height: 10px;
}

.step-count,
.confidence-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-weight: 800;
}

.step-count {
  font-size: 0.9rem;
}

.step-count strong,
.confidence-line strong {
  color: var(--ink);
}

.mini-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mini-steps li {
  display: block;
  transform-origin: left center;
  animation: stepReveal 180ms ease-out both;
}

.mini-steps button {
  display: inline-grid;
  grid-template-columns: 24px auto;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 4px 10px 4px 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #fffefa;
  font-size: 0.86rem;
  font-weight: 800;
}

.mini-steps button:disabled {
  cursor: default;
  opacity: 1;
}

.mini-steps .step-marker {
  position: relative;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #f7f7f4;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.mini-steps li.is-future {
  display: none;
}

.mini-steps li.is-current button {
  color: var(--ink);
  border-color: var(--amber-line);
  background: var(--surface-amber-pale);
}

.mini-steps li.is-current .step-marker {
  color: #ffffff;
  border-color: var(--amber);
  background: var(--amber);
}

.mini-steps li.is-done button {
  color: #43534f;
  border-color: #c7d8d3;
  background: #f7fbf9;
}

.mini-steps li.is-done button:hover,
.mini-steps li.is-available button:hover {
  border-color: var(--amber-line);
  color: var(--ink);
}

.mini-steps li.is-done .step-marker {
  color: transparent;
  border-color: #9ac9c2;
  background: var(--surface-green);
  animation: checkPop 280ms cubic-bezier(0.2, 0.95, 0.35, 1.45) both;
}

.mini-steps li.is-done .step-marker::before {
  position: absolute;
  content: "";
  width: 10px;
  height: 6px;
  border-left: 2px solid var(--teal);
  border-bottom: 2px solid var(--teal);
  transform: translateY(-1px) rotate(-45deg);
}

.step-trail {
  grid-area: trail;
  display: grid;
  gap: 9px;
  padding-top: 13px;
  border-top: 1px solid #ebe4da;
}

.step-trail-label {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@keyframes stepReveal {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes checkPop {
  0% {
    transform: scale(0.72);
  }

  70% {
    transform: scale(1.16);
  }

  100% {
    transform: scale(1);
  }
}

.question-stage {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 12px;
  min-width: 0;
}

.question-card {
  display: grid;
  align-content: center;
  gap: 24px;
  min-height: 470px;
  padding: clamp(24px, 5vw, 48px);
}

.question-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.question-copy {
  display: grid;
  gap: 11px;
  max-width: 760px;
}

.question-copy h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.65rem, 3.5vw, 2.9rem);
  font-weight: 700;
}

.question-copy p {
  max-width: 680px;
  color: #574d43;
  font-size: 1.12rem;
  font-weight: 580;
  line-height: 1.55;
}

.answer-zone {
  display: grid;
  gap: 14px;
  max-width: 780px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  color: #423d35;
  font-size: 0.9rem;
  font-weight: 850;
}

input,
textarea,
select {
  width: 100%;
  min-width: 0;
  border: 1px solid #d7d0c5;
  border-radius: 8px;
  color: var(--ink);
  background: #fffefa;
}

input,
select {
  min-height: 48px;
  padding: 0 13px;
}

textarea {
  resize: vertical;
  min-height: 150px;
  padding: 13px;
}

input:focus,
textarea:focus,
select:focus {
  outline: 3px solid rgba(201, 77, 6, 0.18);
  border-color: var(--amber);
}

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

.choice {
  position: relative;
  display: grid;
  min-height: 74px;
  padding: 14px;
  border: 1px solid #d7d0c5;
  border-radius: 8px;
  background: #fffefa;
}

.choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.choice strong {
  display: block;
  margin-bottom: 3px;
  color: var(--ink);
}

.choice small {
  color: var(--muted);
  font-size: 0.84rem;
}

.choice:has(input:checked) {
  border-color: var(--amber);
  background: var(--surface-amber);
  box-shadow: inset 0 0 0 1px var(--amber);
}

.choice:has(input:focus-visible) {
  outline: 3px solid rgba(201, 77, 6, 0.18);
}

.scale-wrap {
  display: grid;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefa;
}

.scale-labels {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.scale-output {
  display: flex;
  align-items: center;
  gap: 12px;
}

.scale-output strong {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: #ffffff;
  background: var(--amber);
  font-size: 1.35rem;
}

.scale-output span {
  color: var(--muted);
}

.ai-loading {
  display: grid;
  gap: 18px;
  max-width: 620px;
  padding: 18px;
  border: 1px solid #d9d1c4;
  border-radius: 8px;
  background: #fffefa;
}

.ai-loading-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid #e9dfcd;
  border-top-color: var(--amber);
  border-radius: 50%;
  animation: spin 900ms linear infinite;
}

.ai-loading strong {
  display: block;
  color: var(--ink);
}

.ai-loading p,
.ai-loading li {
  color: var(--muted);
}

.ai-loading ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

input[type="range"] {
  min-height: 28px;
  padding: 0;
  accent-color: var(--amber);
}

.two-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 13px;
}

.website-assist {
  display: flex;
  align-items: center;
  gap: 13px;
  flex-wrap: wrap;
  padding-top: 3px;
}

.website-assist p {
  flex: 1 1 240px;
  color: var(--muted);
  font-size: 0.9rem;
}

.website-analysis-status {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 0 13px 15px;
  border-left: 3px solid var(--amber);
  color: var(--ink);
}

.website-analysis-status.is-loading {
  border-left-color: var(--amber);
}

.website-analysis-status.is-complete {
  border-left-color: var(--teal);
}

.website-analysis-status.is-error {
  border-left-color: var(--coral);
  color: #7d2f27;
}

.website-analysis-status .ai-spinner {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
}

.website-analysis-status strong,
.website-analysis-status p,
.website-analysis-status small {
  display: block;
}

.website-analysis-status p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.92rem;
}

.website-analysis-status small {
  margin-top: 5px;
  color: var(--muted);
}

.website-analysis-check {
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: var(--surface-green);
  animation: checkPop 280ms cubic-bezier(0.2, 0.95, 0.35, 1.45) both;
}

.website-analysis-check::before {
  position: absolute;
  top: 8px;
  left: 7px;
  width: 11px;
  height: 6px;
  border-left: 2px solid var(--teal);
  border-bottom: 2px solid var(--teal);
  content: "";
  transform: rotate(-45deg);
}

.wizard-controls {
  justify-content: flex-end;
}

.results-shell {
  display: grid;
  gap: 18px;
}

.report-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  padding: clamp(24px, 5vw, 48px);
  border: 1px solid var(--espresso-line);
  border-radius: 8px;
  background: var(--espresso);
  box-shadow: 0 18px 48px rgba(33, 26, 18, 0.18);
}

.report-title {
  display: grid;
  gap: 10px;
}

.report-title h1 {
  max-width: 880px;
  color: #fffaf2;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.7rem, 4.5vw, 3.6rem);
  font-weight: 700;
}

#reportSubhead {
  max-width: 720px;
  color: #f0e5d7;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.55;
}

.report-hero .eyebrow {
  color: #f39a5f;
}

.report-status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid #a7cbc4;
  border-radius: 999px;
  color: #3d3227;
  border-color: #efe4d5;
  background: #fffaf2;
  font-size: 0.84rem;
  font-weight: 850;
}

.report-status.is-local {
  color: #56351f;
  border-color: #f0c5aa;
  background: #fff2e8;
}

.hero-actions {
  justify-content: flex-end;
}

.report-hero .button.secondary {
  color: #f8efe4;
  border-color: #715b45;
  background: transparent;
}

.report-hero .button.secondary:hover,
.report-hero .button.secondary:focus-visible {
  color: #ffffff;
  border-color: #d8783f;
  background: #33271b;
}

.diagram-band {
  display: grid;
  grid-template-columns: minmax(240px, 0.85fr) minmax(290px, 1fr) minmax(240px, 0.9fr);
  gap: 14px;
}

.archetype-panel,
.radar-panel,
.path-panel {
  display: grid;
  align-content: start;
  gap: 15px;
  min-height: 300px;
  padding: 18px;
}

.archetype-panel h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.45rem, 3vw, 2.2rem);
  font-weight: 700;
}

.archetype-panel p:not(.eyebrow) {
  color: #5b5249;
  font-size: 0.98rem;
  line-height: 1.55;
}

.radar-panel {
  place-items: center;
  background: #fffdf8;
}

#wantRadar {
  display: block;
  width: min(100%, 440px);
  height: auto;
  aspect-ratio: 11 / 8;
}

.want-path {
  counter-reset: want-step;
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.want-path li {
  position: relative;
  counter-increment: want-step;
  display: grid;
  gap: 4px;
  min-height: 50px;
  padding: 7px 8px 7px 42px;
  border-left: 0;
  border-radius: 0;
  background: transparent;
}

.want-path li::before {
  position: absolute;
  top: 8px;
  left: 4px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: #ffffff;
  background: var(--coral);
  content: counter(want-step);
  font-size: 0.75rem;
  font-weight: 900;
}

.want-path li:nth-child(2)::before {
  background: var(--amber);
}

.want-path li:nth-child(3)::before {
  background: #9b7600;
}

.want-path li:nth-child(4)::before {
  background: var(--teal);
}

.want-path strong {
  color: var(--ink);
  font-size: 1.02rem;
}

.want-path span {
  color: #5b5249;
  font-size: 0.96rem;
  line-height: 1.5;
}

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

.report-card {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 190px;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(50, 38, 25, 0.06);
}

.report-card h3 {
  color: var(--ink);
  font-size: 1.16rem;
  font-weight: 850;
  line-height: 1.3;
}

.report-card p {
  color: #5b5249;
  font-size: 0.98rem;
  line-height: 1.55;
}

.card-label {
  color: var(--amber-dark);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.report-workspace {
  display: grid;
  gap: 14px;
}

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

.flow-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}

.flow-step:hover,
.flow-step:focus-visible {
  border-color: var(--amber-line);
  background: var(--surface-amber-pale);
}

.flow-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--amber-line);
  color: var(--amber-dark);
  background: var(--surface-amber-pale);
  font-size: 0.88rem;
  font-weight: 900;
}

.flow-step.is-done .flow-num {
  border-color: var(--teal);
  color: #ffffff;
  background: var(--teal);
  font-size: 0;
}

.flow-step.is-done .flow-num::before {
  content: "\2713";
  font-size: 0.88rem;
}

.flow-copy {
  display: grid;
  gap: 2px;
}

.flow-copy strong {
  font-size: 0.96rem;
  font-weight: 850;
  line-height: 1.3;
}

.flow-copy small {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.35;
}

.show-more-item {
  list-style: none;
}

.show-more {
  border: 0;
  padding: 0;
  background: none;
  color: var(--teal-dark);
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.show-more:hover,
.show-more:focus-visible {
  color: var(--amber-dark);
}

.workspace-tabs {
  display: inline-flex;
  width: fit-content;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f0f2ee;
}

.workspace-tabs button {
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  color: #58534b;
  background: transparent;
  font-weight: 850;
  white-space: nowrap;
}

.workspace-tabs button:hover,
.workspace-tabs button:focus-visible {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.62);
}

.workspace-tabs button.is-active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 6px 18px rgba(24, 33, 31, 0.08);
}

.workspace-panel {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.workspace-intro {
  display: grid;
  gap: 8px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(24, 33, 31, 0.06);
}

.workspace-intro.compact {
  padding: 16px;
}

.workspace-intro.compact h2 {
  font-size: clamp(1.1rem, 2vw, 1.45rem);
}

.workspace-intro h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.25rem, 2.4vw, 1.9rem);
  font-weight: 700;
}

.workspace-intro p:last-child {
  max-width: 760px;
  color: #5b5249;
  font-size: 1.02rem;
  font-weight: 560;
  line-height: 1.55;
}

.runtime-notice {
  display: grid;
  gap: 4px;
  padding: 13px 15px;
  border: 1px solid var(--amber-line);
  border-radius: 8px;
  color: #51452f;
  background: var(--surface-amber-pale);
  box-shadow: 0 10px 24px rgba(95, 62, 13, 0.07);
}

.runtime-notice strong {
  color: var(--amber-dark);
  font-size: 0.86rem;
  font-weight: 900;
  text-transform: uppercase;
}

.runtime-notice span {
  color: #655b4b;
}

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

.action-card {
  display: grid;
  align-content: start;
  gap: 11px;
  min-height: 230px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: inherit;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: left;
  white-space: normal;
}

.action-card:hover,
.action-card:focus-visible {
  border-color: var(--amber-line);
  background: #fffefa;
}

.action-card strong {
  color: var(--ink);
  font-size: 1.05rem;
}

.action-card-brief {
  color: #5b5249;
  font-size: 0.96rem;
  font-weight: 560;
  line-height: 1.5;
}

.action-card .card-label {
  color: var(--amber-dark);
}

.action-preview {
  display: grid;
  gap: 0;
  padding: 3px 0 3px 14px;
  border-left: 2px solid var(--amber);
  color: #312c26;
  background: transparent;
  font-size: 0.94rem;
  line-height: 1.5;
}

.action-preview span {
  display: block;
  padding: 7px 0;
}

.action-preview span + span {
  border-top: 1px solid #ebe4da;
}

.action-card-cta {
  align-self: end;
  margin-top: 2px;
  color: var(--amber-dark);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.deep-report {
  display: grid;
  gap: 12px;
}

.deep-report details {
  padding: 0;
  overflow: hidden;
}

.deep-report summary {
  padding: 18px;
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
}

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

.details-grid h3 {
  margin-bottom: 10px;
  color: var(--amber-dark);
  font-size: 1.12rem;
  font-weight: 850;
  line-height: 1.3;
}

.details-grid ul,
.details-grid ol {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 21px;
  color: #3d4945;
}

.details-grid li {
  padding-left: 2px;
}

.research-link {
  display: inline;
  width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  color: var(--teal);
  background: transparent;
  font-weight: 850;
  line-height: 1.38;
  text-align: left;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  white-space: normal;
}

.research-link:hover,
.research-link:focus-visible {
  color: var(--teal-dark);
}

.tag-list,
.website-clues {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  padding: 0 18px 18px;
}

.tag-list button,
.website-clues span {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid #d9d2c7;
  border-radius: 999px;
  color: #4d4840;
  background: #fffefa;
  font-size: 0.9rem;
  font-weight: 760;
}

.tag-list button {
  cursor: pointer;
}

.tag-list button:hover,
.tag-list button:focus-visible {
  color: var(--amber-dark);
  border-color: var(--amber-line);
  background: var(--surface-amber);
}

.website-clues {
  display: grid;
}

.website-clues p {
  color: #3d4945;
}

.language-bank button {
  font-style: italic;
  font-weight: 640;
  text-align: left;
}

.language-bank p {
  margin: 0;
  color: #6d675d;
  font-size: 0.92rem;
}

.phrase-block .tag-list,
.details-grid .tag-list {
  padding: 0;
}

.phrase-block > p {
  margin: 0 0 4px;
  color: #6d675d;
  font-size: 0.92rem;
}

.language-note {
  color: var(--amber-dark);
  font-weight: 700;
}

.investigation-panel {
  display: grid;
  gap: 18px;
  padding: clamp(18px, 3vw, 26px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.investigation-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
}

.investigation-head h2 {
  margin-bottom: 8px;
  max-width: 780px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.45rem, 3vw, 2rem);
  font-weight: 700;
  line-height: 1.14;
}

.investigation-head p:last-child {
  max-width: 760px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.investigation-actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.investigation-status {
  min-height: 24px;
  color: var(--teal);
  font-weight: 850;
}

.investigation-grid {
  display: grid;
  grid-template-columns: minmax(0, 820px);
  gap: 0;
}

.research-block {
  display: grid;
  align-content: start;
  gap: 11px;
  min-height: 0;
  padding: 20px 0;
  border: 0;
  border-top: 1px solid #e1dbd1;
  border-radius: 0;
  background: transparent;
}

.research-block.wide {
  grid-column: auto;
}

.research-block:first-child {
  padding-top: 4px;
  border-top: 0;
}

.research-block h3 {
  max-width: 720px;
  color: var(--amber-dark);
  font-size: 1.18rem;
  font-weight: 850;
  line-height: 1.32;
}

.research-block p,
.research-block li {
  color: #514c44;
  font-size: 0.98rem;
  line-height: 1.62;
}

.research-block ul {
  display: grid;
  gap: 11px;
  margin: 0;
  padding-left: 22px;
}

.source-block {
  margin-top: 6px;
  padding: 18px;
  border-top: 0;
  border-left: 3px solid var(--teal);
  border-radius: 6px;
  background: #f4f9f7;
}

.source-list {
  list-style: none;
  padding-left: 0 !important;
}

.source-list li {
  display: grid;
  gap: 4px;
  padding: 2px 0;
}

.source-list a {
  color: var(--teal);
  font-weight: 850;
  overflow-wrap: anywhere;
}

.source-list span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 760;
}

.account-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
}

.account-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(33, 26, 18, 0.66);
  backdrop-filter: blur(5px);
}

.account-dialog {
  position: relative;
  display: grid;
  gap: 22px;
  width: min(500px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: clamp(22px, 4vw, 32px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefa;
  box-shadow: 0 28px 80px rgba(33, 26, 18, 0.28);
}

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

.account-head h2 {
  max-width: 360px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.55rem, 4vw, 2.25rem);
  font-weight: 700;
}

.icon-button {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: var(--surface);
  font-size: 1.45rem;
  line-height: 1;
}

.icon-button:hover,
.icon-button:focus-visible {
  color: var(--amber-dark);
  border-color: var(--amber-line);
}

.account-google-copy {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.55;
}

.google-sign-in {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid #cfc8bd;
  border-radius: 8px;
  color: var(--ink);
  background: #ffffff;
  font-weight: 850;
}

.google-sign-in:hover,
.google-sign-in:focus-visible {
  border-color: #9d948a;
  background: #fbfaf7;
}

.google-sign-in:disabled {
  cursor: wait;
  opacity: 0.72;
}

.google-mark {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid #e0e0e0;
  border-radius: 50%;
  color: #1a73e8;
  background: #ffffff;
  font-family: Arial, sans-serif;
  font-weight: 900;
}

.account-signed-in {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.account-message {
  min-height: 22px;
  color: var(--coral);
  font-size: 0.9rem;
  font-weight: 750;
}

.account-message.is-success {
  color: var(--teal);
}

.account-signed-in {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  margin-top: 0;
}

.account-signed-in h3 {
  font-size: 1.18rem;
  line-height: 1.35;
}

.account-signed-in p:not(.eyebrow) {
  margin-top: 5px;
  color: var(--muted);
}

.account-check {
  position: relative;
  display: block;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--surface-green);
}

.account-check::before {
  position: absolute;
  top: 11px;
  left: 10px;
  width: 15px;
  height: 8px;
  border-left: 3px solid var(--teal);
  border-bottom: 3px solid var(--teal);
  content: "";
  transform: rotate(-45deg);
}

.account-panel-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  padding-top: 4px;
}

body.has-account-modal {
  overflow: hidden;
}

.background-research {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 30;
  display: grid;
  gap: 11px;
  width: min(410px, calc(100vw - 40px));
  padding: 16px;
  border: 1px solid var(--amber-line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 18px 48px rgba(47, 39, 28, 0.18);
}

.background-research-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
}

.background-research-head > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.background-research-head strong {
  overflow-wrap: anywhere;
}

.background-research-stage {
  color: var(--amber-dark);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.background-progress {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #eadfca;
}

.background-progress span {
  display: block;
  width: 38%;
  height: 100%;
  border-radius: inherit;
  background: var(--amber);
}

.background-progress.is-indeterminate span {
  animation: research-progress 1.35s ease-in-out infinite;
}

@keyframes research-progress {
  0% {
    transform: translateX(-120%);
  }

  55% {
    transform: translateX(120%);
  }

  100% {
    transform: translateX(300%);
  }
}

.background-research p {
  color: var(--muted);
  font-size: 0.9rem;
}

.background-research .button {
  justify-self: start;
}

.background-research.is-complete {
  border-color: #7db2a6;
  background: #f7fbf9;
}

.background-research.is-failed {
  border-color: #d5a29c;
  background: #fff9f8;
}

.background-research.is-failed .background-research-stage {
  color: #a5443b;
}

.background-research.is-failed .background-progress span {
  background: #b95045;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .background-progress.is-indeterminate span {
    width: 100%;
    animation: none;
    opacity: 0.65;
  }
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  width: min(360px, calc(100vw - 40px));
  padding: 12px 14px;
  border: 1px solid var(--amber-line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.background-research:not([hidden]) + .toast {
  bottom: 210px;
}

@media (max-width: 980px) {
  .topbar,
  .report-hero {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
  }

  .top-actions,
  .hero-actions {
    justify-content: flex-start;
  }

  .wizard-shell,
  .diagram-band,
  .report-grid,
  .report-workspace,
  .details-grid,
  .investigation-grid,
  .investigation-head,
  .flow-guide {
    grid-template-columns: 1fr;
  }

  .wizard-shell {
    min-height: auto;
  }

  .progress-panel {
    grid-template-columns: 1fr;
    grid-template-areas:
      "intro"
      "summary"
      "trail";
    gap: 13px;
  }
}

@media (max-width: 680px) {
  main {
    padding: 16px;
  }

  .topbar {
    position: static;
    padding: 16px;
  }

  .brand {
    align-items: flex-start;
  }

  .top-actions,
  .wizard-controls,
  .hero-actions,
  .investigation-actions {
    width: 100%;
  }

  .save-status {
    flex: 1 0 100%;
  }

  .button {
    flex: 1 1 135px;
  }

  .button.ghost {
    order: 3;
    flex-basis: 100%;
  }

  .question-card {
    min-height: 430px;
    padding: 22px;
  }

  .question-copy h2 {
    font-size: 1.8rem;
  }

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

  .workspace-tabs {
    width: 100%;
  }

  .workspace-tabs button {
    flex: 1 1 0;
    white-space: normal;
    min-height: 44px;
    padding: 4px 10px;
    font-size: 0.88rem;
    line-height: 1.25;
  }

  .background-research {
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
  }

  .background-research:not([hidden]) + .toast {
    bottom: 220px;
  }

  .account-modal {
    padding: 12px;
  }

  .account-dialog {
    max-height: calc(100vh - 24px);
    padding: 20px;
  }

  .account-panel-actions .button {
    flex-basis: 100%;
  }

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

@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;
  }
}
