:root {
  color-scheme: light;
  --cream: #f6f1e8;
  --paper: #fcfaf6;
  --white: #ffffff;
  --sage: #9ead9a;
  --sage-soft: #dfe6dc;
  --green: #355a4a;
  --green-dark: #29473b;
  --copper: #b9785b;
  --copper-dark: #965e46;
  --copper-soft: #edd8cc;
  --charcoal: #343434;
  --muted: #6d6b65;
  --line: #e4dbcf;
  --danger: #9f473b;
  --shadow: 0 18px 50px rgba(53, 44, 37, 0.1);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --tap: 48px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: var(--cream);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--charcoal);
  background:
    radial-gradient(circle at 8% -10%, rgba(185, 120, 91, 0.13), transparent 30rem),
    linear-gradient(180deg, var(--paper), var(--cream));
  font-size: 17px;
  line-height: 1.55;
}

button, input, textarea, select { font: inherit; }
button, label, summary { -webkit-tap-highlight-color: transparent; }

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(185, 120, 91, 0.5);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: -80px;
  left: 16px;
  z-index: 100;
  padding: 12px 16px;
  color: var(--white);
  background: var(--green-dark);
  border-radius: 10px;
}
.skip-link:focus { top: 16px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 74px;
  padding: 12px max(18px, env(safe-area-inset-left));
  border-bottom: 1px solid rgba(228, 219, 207, 0.85);
  background: rgba(252, 250, 246, 0.93);
  backdrop-filter: blur(16px);
}

.brand-lockup { display: flex; align-items: center; gap: 11px; }
.brand-lockup p { margin: 0; line-height: 1.15; }
.brand-name { font-weight: 760; letter-spacing: -0.02em; }
.brand-method {
  margin-top: 3px !important;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 2px solid var(--copper);
  border-radius: 50%;
}
.brand-mark::before, .brand-mark span {
  content: "";
  position: absolute;
  border: 2px solid var(--copper);
  border-radius: 50%;
}
.brand-mark::before { width: 21px; height: 21px; }
.brand-mark span { width: 7px; height: 7px; background: var(--copper); }

.icon-button {
  display: grid;
  width: var(--tap);
  height: var(--tap);
  padding: 0;
  place-items: center;
  color: var(--green);
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--white);
  cursor: pointer;
}
.icon-button svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

main { width: 100%; }
#app {
  width: min(100% - 32px, 860px);
  margin: 0 auto;
  padding: 28px 0 max(54px, env(safe-area-inset-bottom));
}

.site-footer {
  padding: 0 18px max(28px, env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
}
.site-footer p { margin: 0; }
.site-footer a {
  color: var(--green-dark);
  font-weight: 760;
  text-decoration-color: rgba(53, 90, 74, 0.35);
  text-underline-offset: 3px;
}

h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { color: var(--charcoal); line-height: 1.08; letter-spacing: -0.035em; }
h1 { margin-bottom: 18px; font-size: clamp(2.05rem, 8vw, 3.8rem); }
h2 { margin-bottom: 14px; font-size: clamp(1.65rem, 6vw, 2.4rem); }
h3 { margin-bottom: 10px; font-size: 1.25rem; }

.eyebrow {
  margin-bottom: 9px;
  color: var(--copper);
  font-size: 0.82rem;
  font-weight: 820;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.lead { max-width: 39rem; margin-bottom: 24px; color: #4b4a46; font-size: 1.12rem; }
.small-note { margin-bottom: 0; color: var(--muted); font-size: 0.9rem; }
.muted { color: var(--muted); }
.accent { color: var(--copper-dark); }

.surface, .welcome-panel, .form-panel, .summary-panel {
  padding: clamp(22px, 5vw, 42px);
  border: 1px solid rgba(228, 219, 207, 0.92);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.promise-list {
  display: grid;
  gap: 14px;
  margin: 26px 0;
  padding: 0;
  list-style: none;
}
.promise-list li { display: grid; grid-template-columns: 46px 1fr; gap: 13px; align-items: start; }
.promise-list li > span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--white);
  font-weight: 800;
  border-radius: 50%;
  background: var(--green);
}

.callout {
  margin: 22px 0;
  padding: 18px;
  border-radius: var(--radius-md);
}
.callout p:last-child { margin-bottom: 0; }
.callout-label {
  margin-bottom: 4px;
  font-size: 0.8rem;
  font-weight: 820;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.callout-neutral { border: 1px solid var(--line); background: var(--cream); }
.callout-safe { color: var(--green-dark); border: 1px solid var(--sage); background: var(--sage-soft); }
.callout-warning { color: #6d3f2f; border: 1px solid var(--copper); background: var(--copper-soft); }

.consent-box {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  margin: 22px 0;
  cursor: pointer;
}
.consent-box input { width: 22px; height: 22px; margin-top: 3px; accent-color: var(--green); }

.button-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.button {
  min-height: var(--tap);
  padding: 13px 20px;
  color: var(--white);
  font-weight: 760;
  border: 1px solid var(--green);
  border-radius: 999px;
  background: var(--green);
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease;
}
.button:hover { background: var(--green-dark); transform: translateY(-1px); }
.button:disabled { color: #8f8b84; border-color: var(--line); background: #ece8e1; cursor: not-allowed; transform: none; }
.button-secondary { color: var(--green-dark); border-color: var(--line); background: var(--white); }
.button-secondary:hover { background: var(--sage-soft); }
.button-copper { border-color: var(--copper); background: var(--copper); }
.button-copper:hover { background: var(--copper-dark); }
.button-danger { border-color: var(--danger); background: var(--danger); }
.button-text { padding-inline: 8px; color: var(--green); border: 0; background: transparent; }
.button-text:hover { background: transparent; text-decoration: underline; transform: none; }
.button-block { width: 100%; justify-content: center; }
.file-button { display: inline-flex; align-items: center; }
.file-button input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }

.topline { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; }
.topline .button { flex: 0 0 auto; }

.dashboard-grid { display: grid; gap: 18px; }
.progress-card {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 22px;
  align-items: center;
  padding: 24px;
  color: var(--white);
  border-radius: var(--radius-lg);
  background: var(--green);
  box-shadow: var(--shadow);
}
.progress-ring {
  --progress: 0deg;
  display: grid;
  width: 112px;
  height: 112px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--copper-soft) var(--progress), rgba(255,255,255,.14) 0);
}
.progress-ring::before { content: ""; grid-area: 1 / 1; width: 84px; height: 84px; border-radius: 50%; background: var(--green); }
.progress-ring strong { z-index: 1; grid-area: 1 / 1; font-size: 1.38rem; }
.progress-copy p { margin-bottom: 5px; color: rgba(255,255,255,.83); }
.progress-copy h1 { margin-bottom: 8px; color: var(--white); font-size: clamp(1.75rem, 6vw, 2.65rem); }

.plan-card { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--white); }
.plan-card-head { display: flex; gap: 14px; align-items: start; justify-content: space-between; }
.plan-card dl { display: grid; gap: 14px; margin: 18px 0 0; }
.plan-card dt { color: var(--muted); font-size: 0.78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.plan-card dd { margin: 2px 0 0; font-weight: 680; }

.day-grid { display: grid; grid-template-columns: repeat(7, minmax(62px, 1fr)); gap: 9px; }
.day-button {
  min-height: 84px;
  padding: 10px 6px;
  color: var(--charcoal);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  cursor: pointer;
}
.day-button strong, .day-button span { display: block; }
.day-button strong { font-size: 1.1rem; }
.day-button span { margin-top: 3px; color: var(--muted); font-size: .76rem; }
.day-button.is-done { color: var(--white); border-color: var(--green); background: var(--green); }
.day-button.is-done span { color: rgba(255,255,255,.78); }
.day-button.is-next { border: 2px solid var(--copper); }

.action-card {
  padding: 24px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--copper-soft), var(--cream));
}
.action-card h2 { margin-bottom: 8px; }

.field { margin: 0 0 22px; }
.field label, .field legend { display: block; margin-bottom: 8px; font-weight: 760; }
.field-help { margin: -2px 0 10px; color: var(--muted); font-size: .92rem; }
.text-input, .select-input, .text-area {
  width: 100%;
  min-height: 50px;
  padding: 13px 14px;
  color: var(--charcoal);
  border: 1px solid #cfc5b8;
  border-radius: var(--radius-sm);
  background: var(--white);
}
.text-area { min-height: 92px; resize: vertical; }
.field-error { margin: 8px 0 0; color: var(--danger); font-weight: 700; }
.form-error { margin-bottom: 20px; padding: 14px 16px; color: #6d2d26; border: 1px solid #d6a49e; border-radius: var(--radius-sm); background: #f8e8e5; }

.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.choice-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.choice-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choice-card { position: relative; min-width: 0; }
.choice-card input { position: absolute; opacity: 0; pointer-events: none; }
.choice-card span {
  display: grid;
  min-height: 64px;
  padding: 10px;
  place-items: center;
  color: var(--charcoal);
  font-size: .92rem;
  font-weight: 720;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  cursor: pointer;
}
.choice-card input:checked + span { color: var(--white); border-color: var(--green); background: var(--green); }
.choice-card input:focus-visible + span { outline: 3px solid rgba(185, 120, 91, .5); outline-offset: 3px; }

.stepper { display: flex; gap: 8px; align-items: center; margin: 0 0 24px; }
.stepper span { flex: 1; height: 6px; border-radius: 999px; background: var(--line); }
.stepper span.is-active { background: var(--copper); }

.metric-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 22px 0; }
.metric { padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--cream); }
.metric strong { display: block; color: var(--green-dark); font-size: 1.8rem; }
.metric span { color: var(--muted); font-size: .9rem; }

.decision-options { display: grid; gap: 12px; margin: 24px 0; }
.decision-card { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--white); }
.decision-card.is-recommended { border: 2px solid var(--copper); box-shadow: 0 10px 28px rgba(185,120,91,.12); }
.decision-tag { display: inline-block; margin-bottom: 8px; color: var(--copper-dark); font-size: .75rem; font-weight: 820; letter-spacing: .06em; text-transform: uppercase; }
.decision-card h3 { margin-bottom: 5px; }
.decision-card p { margin-bottom: 14px; color: var(--muted); }

.summary-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 18px 0; }
.summary-strip div { padding: 14px 10px; text-align: center; border-radius: 14px; background: var(--cream); }
.summary-strip strong { display: block; font-size: 1.2rem; }
.summary-strip span { color: var(--muted); font-size: .78rem; }

.dialog {
  width: min(100% - 28px, 650px);
  max-height: min(86vh, 760px);
  padding: clamp(22px, 5vw, 34px);
  color: var(--charcoal);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: 0 30px 90px rgba(31, 27, 24, .25);
}
.dialog::backdrop { background: rgba(37, 33, 30, .48); backdrop-filter: blur(4px); }
.dialog-head { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; }
.dialog-head h2 { margin-bottom: 14px; }
.dialog-actions { display: grid; gap: 10px; margin: 22px 0; }
.example-grid { display: grid; gap: 12px; }
.example-grid div { padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--white); }
.example-grid span { display: block; margin-bottom: 3px; color: var(--copper-dark); font-size: .78rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }

.toast-region { position: fixed; right: 16px; bottom: max(18px, env(safe-area-inset-bottom)); z-index: 80; display: grid; gap: 8px; width: min(360px, calc(100% - 32px)); }
.toast { padding: 13px 16px; color: var(--white); border-radius: 14px; background: var(--green-dark); box-shadow: var(--shadow); }

.screen-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.section-gap { margin-top: 22px; }
.print-only { display: none; }

@media (max-width: 720px) {
  #app { width: min(100% - 24px, 860px); padding-top: 20px; }
  .surface, .welcome-panel, .form-panel, .summary-panel { padding: 22px 18px; border-radius: 22px; }
  .topline { display: block; }
  .topline .button { margin-top: 8px; }
  .progress-card { grid-template-columns: 92px 1fr; gap: 16px; padding: 20px 16px; }
  .progress-ring { width: 88px; height: 88px; }
  .progress-ring::before { width: 66px; height: 66px; }
  .day-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .choice-grid.four, .choice-grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .button-row .button { width: 100%; }
}

@media (max-width: 430px) {
  body { font-size: 16px; }
  .brand-name { font-size: .98rem; }
  .brand-method { font-size: .7rem; }
  .site-header { min-height: 68px; }
  .day-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .choice-grid, .choice-grid.four, .choice-grid.three { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .summary-strip { grid-template-columns: 1fr; }
}

@media print {
  .site-header, .site-footer, .button, .icon-button, .screen-actions, .toast-region { display: none !important; }
  body { background: #fff; }
  #app { width: 100%; padding: 0; }
  .summary-panel { border: 0; box-shadow: none; }
  .print-only { display: block; }
}
