:root {
  color-scheme: light;
  --paper: #f7f0e4;
  --paper-strong: #efe3d2;
  --surface: #fffdf8;
  --ink: #35251e;
  --ink-soft: #6c5a50;
  --olive: #66704b;
  --olive-dark: #4e5838;
  --olive-pale: #e8eadb;
  --copper: #a9602d;
  --copper-dark: #7e431f;
  --copper-pale: #f2dfcd;
  --sand: #d7c4a9;
  --line: #d9cbb8;
  --danger: #8f332f;
  --danger-pale: #f9e8e3;
  --shadow: 0 18px 48px rgba(67, 44, 30, 0.1);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 4% 2%, rgba(169, 96, 45, 0.08), transparent 22rem),
    radial-gradient(circle at 96% 18%, rgba(102, 112, 75, 0.1), transparent 26rem),
    var(--paper);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.55;
}

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

button,
summary,
input[type="range"],
input[type="checkbox"],
input[type="radio"] {
  cursor: pointer;
}

button:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(169, 96, 45, 0.45);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  transform: translateY(-160%);
  padding: 0.7rem 1rem;
  border-radius: 999px;
  color: white;
  background: var(--ink);
}

.skip-link:focus {
  transform: none;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(100% - 2rem, 74rem);
  margin: 0 auto;
  padding: 1.1rem 0 0.8rem;
}

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

.brand-mark {
  flex: 0 0 auto;
  width: 3rem;
  height: 3rem;
  border: 1px solid rgba(111, 86, 66, 0.13);
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 7px 22px rgba(72, 45, 28, 0.12);
}

.eyebrow {
  margin: 0 0 0.16rem;
  color: var(--copper-dark);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  line-height: 1.25;
  text-transform: uppercase;
}

.brand-title {
  margin: 0;
  overflow: hidden;
  font-family: var(--serif);
  font-size: clamp(1.25rem, 4.5vw, 1.75rem);
  font-weight: 700;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-title span {
  color: var(--olive-dark);
}

.data-menu {
  position: relative;
  flex: 0 0 auto;
}

.data-menu summary {
  min-height: 44px;
  padding: 0.64rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  list-style: none;
  color: var(--ink);
  background: rgba(255, 253, 248, 0.72);
  font-size: 0.9rem;
  font-weight: 750;
}

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

.data-menu-panel {
  position: absolute;
  z-index: 20;
  top: calc(100% + 0.5rem);
  right: 0;
  width: min(19rem, calc(100vw - 2rem));
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.data-menu-panel p {
  margin: 0 0 0.75rem;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.data-menu-panel button {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 0.6rem 0.4rem;
  border: 0;
  border-top: 1px solid var(--line);
  color: var(--ink);
  background: transparent;
  text-align: left;
  font-weight: 700;
}

.data-menu-panel .danger-link {
  color: var(--danger);
}

.save-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 28px;
  padding: 0.2rem 1rem;
  border-block: 1px solid rgba(167, 143, 113, 0.23);
  color: var(--ink-soft);
  background: rgba(255, 253, 248, 0.48);
  font-size: 0.78rem;
}

.save-dot {
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 50%;
  background: var(--olive);
  box-shadow: 0 0 0 3px rgba(102, 112, 75, 0.12);
}

.station-nav {
  display: flex;
  gap: 0.5rem;
  width: min(100% - 1rem, 74rem);
  margin: 0.75rem auto 0;
  padding: 0.25rem 0.5rem 0.7rem;
  overflow-x: auto;
  scrollbar-width: thin;
}

.station-nav button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.58rem 0.9rem;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--ink-soft);
  background: transparent;
  font-size: 0.9rem;
  font-weight: 750;
  white-space: nowrap;
}

.station-nav button span {
  display: inline-grid;
  width: 1.45rem;
  height: 1.45rem;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 0.73rem;
}

.station-nav button[aria-current="page"] {
  border-color: var(--line);
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 7px 20px rgba(67, 44, 30, 0.07);
}

#workspace {
  width: min(100% - 2rem, 68rem);
  min-height: 66vh;
  margin: 0 auto;
  padding: clamp(1.25rem, 4vw, 3rem) 0 4rem;
}

.page-intro {
  display: grid;
  gap: 1.25rem;
  margin-bottom: 1.4rem;
}

.page-intro h1,
.home-title {
  max-width: 16ch;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.1rem, 8vw, 4.7rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 0.98;
}

.page-intro h1 {
  max-width: 20ch;
  font-size: clamp(2rem, 6vw, 3.7rem);
}

.lead {
  max-width: 42rem;
  margin: 0;
  color: var(--ink-soft);
  font-size: clamp(1.03rem, 2vw, 1.17rem);
}

.home-grid {
  display: grid;
  gap: 1rem;
}

.home-opening {
  position: relative;
  overflow: hidden;
  padding: clamp(1.35rem, 5vw, 3.25rem);
  border: 1px solid rgba(133, 104, 76, 0.18);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(255, 253, 248, 0.98), rgba(239, 227, 210, 0.88));
  box-shadow: var(--shadow);
}

.home-opening::after {
  position: absolute;
  right: -4.5rem;
  bottom: -6rem;
  width: 18rem;
  height: 18rem;
  border: 1px solid rgba(169, 96, 45, 0.18);
  border-radius: 50%;
  box-shadow:
    0 0 0 2.7rem rgba(102, 112, 75, 0.05),
    0 0 0 5.4rem rgba(169, 96, 45, 0.04);
  content: "";
}

.home-opening > * {
  position: relative;
  z-index: 1;
}

.home-opening .lead {
  max-width: 36rem;
  margin-top: 1.25rem;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.4rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.72rem 1.08rem;
  border: 1px solid var(--olive-dark);
  border-radius: 999px;
  color: white;
  background: var(--olive-dark);
  font-weight: 800;
  text-decoration: none;
}

.button:hover {
  background: var(--olive);
}

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

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

.button.danger {
  border-color: var(--danger);
  background: var(--danger);
}

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

.progress-panel {
  margin-top: 1rem;
  padding: 1.1rem 1.15rem;
  border-radius: var(--radius-md);
  color: white;
  background: var(--ink);
}

.progress-panel-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.progress-panel p {
  margin: 0;
}

.progress-panel strong {
  font-family: var(--serif);
  font-size: 1.55rem;
  font-weight: 500;
}

.progress-track {
  height: 0.52rem;
  margin-top: 0.85rem;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.16);
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #d8a46c, #8b9664);
}

.station-cards {
  display: grid;
  gap: 0.85rem;
  margin-top: 1rem;
}

.station-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.9rem;
  width: 100%;
  min-height: 94px;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--ink);
  background: rgba(255, 253, 248, 0.84);
  text-align: left;
  box-shadow: 0 8px 24px rgba(67, 44, 30, 0.05);
}

.station-card:hover {
  border-color: rgba(169, 96, 45, 0.48);
  transform: translateY(-1px);
}

.station-number {
  display: grid;
  width: 2.6rem;
  height: 2.6rem;
  place-items: center;
  border-radius: 50%;
  color: var(--copper-dark);
  background: var(--copper-pale);
  font-family: var(--serif);
  font-size: 1.35rem;
}

.station-copy strong,
.station-copy small {
  display: block;
}

.station-copy strong {
  font-size: 1.01rem;
}

.station-copy small {
  margin-top: 0.14rem;
  color: var(--ink-soft);
  font-size: 0.84rem;
}

.station-state {
  color: var(--olive-dark);
  font-size: 0.78rem;
  font-weight: 800;
  text-align: right;
}

.content-card {
  padding: clamp(1.1rem, 4vw, 2rem);
  border: 1px solid rgba(133, 104, 76, 0.2);
  border-radius: var(--radius-lg);
  background: rgba(255, 253, 248, 0.94);
  box-shadow: var(--shadow);
}

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

.section-head h2,
.form-section h2,
.result-card h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.45rem, 4vw, 2rem);
  font-weight: 500;
  line-height: 1.1;
}

.section-head p,
.form-section > p {
  margin: 0.45rem 0 0;
  color: var(--ink-soft);
}

.step-badge {
  flex: 0 0 auto;
  padding: 0.38rem 0.72rem;
  border-radius: 999px;
  color: var(--olive-dark);
  background: var(--olive-pale);
  font-size: 0.78rem;
  font-weight: 800;
}

.form-section {
  padding: 1.45rem 0;
  border-top: 1px solid var(--line);
}

.form-section:first-of-type {
  border-top: 0;
}

.field {
  display: block;
  margin-top: 1.1rem;
}

.field-label,
fieldset legend {
  display: block;
  margin-bottom: 0.48rem;
  color: var(--ink);
  font-weight: 780;
}

.field-help {
  display: block;
  margin-top: 0.34rem;
  color: var(--ink-soft);
  font-size: 0.86rem;
}

input[type="date"],
select,
textarea,
input[type="text"] {
  width: 100%;
  min-height: 48px;
  padding: 0.78rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: #fffefa;
}

textarea {
  min-height: 104px;
  resize: vertical;
}

.char-count {
  display: block;
  margin-top: 0.3rem;
  color: var(--ink-soft);
  font-size: 0.78rem;
  text-align: right;
}

fieldset {
  min-width: 0;
  margin: 1.2rem 0 0;
  padding: 0;
  border: 0;
}

.scale-list {
  display: grid;
  gap: 1rem;
}

.scale-field {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fffefa;
}

.scale-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.9rem;
}

.scale-top label {
  font-weight: 760;
}

.scale-value {
  display: grid;
  flex: 0 0 auto;
  width: 2.3rem;
  height: 2.3rem;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--copper-dark);
  font-family: var(--serif);
  font-size: 1.13rem;
}

input[type="range"] {
  width: 100%;
  height: 2rem;
  margin: 0.6rem 0 0;
  accent-color: var(--olive-dark);
}

.scale-anchors {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--ink-soft);
  font-size: 0.76rem;
}

.choice-grid {
  display: grid;
  gap: 0.65rem;
}

.choice {
  position: relative;
  display: flex;
  align-items: flex-start;
  min-height: 52px;
  gap: 0.7rem;
  padding: 0.78rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fffefa;
}

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

.choice input {
  flex: 0 0 auto;
  width: 1.2rem;
  height: 1.2rem;
  margin: 0.16rem 0 0;
  accent-color: var(--olive-dark);
}

.choice-copy strong,
.choice-copy small {
  display: block;
}

.choice-copy small {
  margin-top: 0.15rem;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.week-tabs {
  display: flex;
  gap: 0.45rem;
  margin: 0 -0.2rem 1.2rem;
  padding: 0.2rem 0.2rem 0.5rem;
  overflow-x: auto;
}

.week-tab {
  flex: 0 0 auto;
  min-width: 48px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink-soft);
  background: var(--surface);
  font-weight: 820;
}

.week-tab[aria-current="step"] {
  border-color: var(--copper-dark);
  color: white;
  background: var(--copper-dark);
}

.week-tab[data-complete="true"]:not([aria-current="step"]) {
  border-color: var(--olive);
  color: var(--olive-dark);
  background: var(--olive-pale);
}

.week-focus {
  padding: 1rem 1.05rem;
  border-left: 4px solid var(--copper);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--copper-pale);
}

.week-focus p {
  margin: 0.2rem 0 0;
  color: var(--ink-soft);
}

.week-focus strong {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
}

.safety-check {
  margin-top: 1.2rem;
  padding: 1rem;
  border: 1px solid #dfb0a5;
  border-radius: var(--radius-md);
  background: var(--danger-pale);
}

.safety-check label {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  font-weight: 760;
}

.safety-check input {
  width: 1.2rem;
  height: 1.2rem;
  margin-top: 0.15rem;
  accent-color: var(--danger);
}

.safety-message {
  margin: 0.75rem 0 0;
  color: #64231f;
}

.result-card {
  margin-top: 1.4rem;
  padding: 1.3rem;
  border: 1px solid rgba(102, 112, 75, 0.4);
  border-radius: var(--radius-md);
  background: var(--olive-pale);
}

.result-card[data-tone="simplify"] {
  border-color: rgba(169, 96, 45, 0.38);
  background: var(--copper-pale);
}

.result-card[data-tone="ask"] {
  border-color: #b89772;
  background: #f3e9dc;
}

.result-card p {
  margin: 0.7rem 0 0;
}

.result-label {
  display: inline-block;
  margin-bottom: 0.4rem;
  color: var(--olive-dark);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.question-box {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid rgba(99, 73, 55, 0.22);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.64);
}

.question-box p {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.08rem;
}

.question-box .button {
  margin-top: 0.75rem;
}

.notice {
  margin-top: 1rem;
  padding: 0.95rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  background: var(--paper-strong);
}

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

.notice.safety {
  color: #64231f;
  background: var(--danger-pale);
}

.summary-list {
  display: grid;
  gap: 0.75rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.summary-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.82rem 0;
  border-bottom: 1px solid var(--line);
}

.summary-list span {
  color: var(--ink-soft);
}

.summary-list strong {
  text-align: right;
}

.review-grid {
  display: grid;
  gap: 0.8rem;
}

.review-date {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fffefa;
}

.review-date strong {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--copper-dark);
}

.privacy-note {
  display: grid;
  gap: 0.25rem;
  margin-top: 1.2rem;
  padding: 1rem;
  border: 1px dashed rgba(102, 112, 75, 0.55);
  border-radius: var(--radius-md);
  color: var(--ink-soft);
  background: rgba(232, 234, 219, 0.48);
  font-size: 0.88rem;
}

.privacy-note strong {
  color: var(--olive-dark);
}

.site-footer {
  width: min(100% - 2rem, 68rem);
  margin: 0 auto;
  padding: 1.6rem 0 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.site-footer p {
  margin: 0.25rem 0;
}

.toast {
  position: fixed;
  z-index: 50;
  right: 1rem;
  bottom: 1rem;
  max-width: min(23rem, calc(100vw - 2rem));
  padding: 0.78rem 1rem;
  border-radius: 999px;
  color: white;
  background: var(--ink);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(0.75rem);
  transition: 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: none;
}

.confirm-dialog {
  width: min(31rem, calc(100vw - 2rem));
  padding: 1.35rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.confirm-dialog::backdrop {
  background: rgba(48, 33, 25, 0.55);
  backdrop-filter: blur(3px);
}

.confirm-dialog h2 {
  margin: 0.35rem 0 0;
  font-family: var(--serif);
  font-size: 1.8rem;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.7rem;
  margin-top: 1.4rem;
}

.print-report {
  display: none;
}

.noscript {
  margin: 1rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: var(--danger-pale);
}

@media (min-width: 720px) {
  .home-grid {
    grid-template-columns: 1.18fr 0.82fr;
    align-items: start;
  }

  .home-opening {
    grid-row: span 2;
    min-height: 31rem;
  }

  .station-cards {
    margin-top: 0;
  }

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

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

  .page-intro {
    grid-template-columns: minmax(0, 1fr) minmax(18rem, 0.7fr);
    align-items: end;
  }
}

@media (max-width: 540px) {
  .site-header {
    width: min(100% - 1.25rem, 74rem);
  }

  .brand-lockup {
    gap: 0.5rem;
  }

  .brand-mark {
    width: 2.65rem;
    height: 2.65rem;
  }

  .data-menu summary {
    padding-inline: 0.7rem;
  }

  #workspace {
    width: min(100% - 1.15rem, 68rem);
  }

  .content-card {
    border-radius: 22px;
  }

  .section-head {
    display: block;
  }

  .step-badge {
    display: inline-block;
    margin-top: 0.7rem;
  }

  .dialog-actions {
    flex-direction: column-reverse;
  }

  .dialog-actions .button {
    width: 100%;
  }
}

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

@media print {
  @page {
    size: A4;
    margin: 15mm;
  }

  body {
    color: #241a16;
    background: white;
    font-size: 10.5pt;
  }

  body.printing-report > :not(#printReport) {
    display: none !important;
  }

  body.printing-report #printReport {
    display: block !important;
  }

  .report-cover {
    min-height: 245mm;
    padding: 18mm 12mm;
    border: 1px solid #cab8a2;
    page-break-after: always;
  }

  .report-cover img {
    width: 24mm;
    height: 24mm;
    border-radius: 50%;
  }

  .report-cover h1 {
    max-width: 12ch;
    margin: 24mm 0 7mm;
    font-family: Georgia, serif;
    font-size: 34pt;
    font-weight: 500;
    line-height: 1;
  }

  .report-section {
    margin: 0 0 9mm;
    break-inside: avoid;
  }

  .report-section h2 {
    margin: 0 0 4mm;
    padding-bottom: 2mm;
    border-bottom: 1px solid #cab8a2;
    font-family: Georgia, serif;
    font-size: 18pt;
    font-weight: 500;
  }

  .report-table {
    width: 100%;
    border-collapse: collapse;
  }

  .report-table th,
  .report-table td {
    padding: 3mm;
    border: 1px solid #d9cbb8;
    text-align: left;
    vertical-align: top;
  }

  .report-table th {
    background: #e8eadb;
  }

  .report-list {
    padding-left: 5mm;
  }

  .report-note {
    margin-top: 10mm;
    color: #5e514a;
    font-size: 9pt;
  }
}
