:root {
  --bg: #f8f4ec;
  --surface: #fffdfa;
  --surface-strong: #ede7dc;
  --text: #1f2d27;
  --muted: #66736d;
  --line: #e3dbcf;
  --sage: #668774;
  --sage-dark: #2f5747;
  --blue: #8eaec1;
  --amber: #c99b55;
  --rose: #bb715f;
  --shadow: 0 18px 54px rgba(51, 43, 31, 0.11);
  --shadow-soft: 0 8px 28px rgba(51, 43, 31, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 8% 8%, rgba(102, 135, 116, 0.16), transparent 28%),
    linear-gradient(180deg, #fffdf8 0%, var(--bg) 44%, #f1eee6 100%);
  color: var(--text);
  letter-spacing: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(31, 45, 39, 0.035) 1px, transparent 1px);
  background-size: 100% 72px;
  mask-image: linear-gradient(to bottom, transparent, #000 18%, transparent 86%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px min(6vw, 72px);
  background: rgba(255, 253, 250, 0.86);
  border-bottom: 1px solid rgba(229, 219, 204, 0.75);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 850;
  font-size: 1.08rem;
}

.brand-mark {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 38px;
  border: 2px solid var(--sage-dark);
  border-radius: 10px 10px 13px 13px;
  background: linear-gradient(180deg, #fffdf8, #edf2e8);
}

.brand-mark::before {
  content: "";
  position: absolute;
  left: 9px;
  top: -8px;
  width: 16px;
  height: 16px;
  border-left: 2px solid var(--sage-dark);
  border-top: 2px solid var(--sage-dark);
  transform: rotate(45deg);
  background: #fffdf8;
}

.brand-mark::after {
  content: "";
  position: absolute;
  left: 13px;
  top: 15px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--sage);
  box-shadow: 0 0 0 5px rgba(102, 135, 116, 0.14);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--muted);
  font-size: 0.93rem;
}

.main-nav a {
  white-space: nowrap;
}

.nav-action,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 750;
  cursor: pointer;
}

.nav-action,
.button.primary {
  background: var(--sage-dark);
  color: #fff;
  box-shadow: 0 12px 26px rgba(47, 87, 71, 0.18);
}

.button.secondary {
  background: rgba(255, 253, 250, 0.74);
  border-color: var(--line);
  color: var(--sage-dark);
}

.button.full {
  width: 100%;
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(420px, 1.08fr);
  gap: min(6vw, 72px);
  align-items: center;
  min-height: calc(100vh - 76px);
  padding: 76px min(6vw, 72px) 84px;
}

.hero h1 {
  margin: 0;
  max-width: 720px;
  font-size: clamp(2.8rem, 5.6vw, 5.9rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.hero p {
  max-width: 610px;
  margin: 26px 0 0;
  color: var(--muted);
  font-size: clamp(1.06rem, 1.4vw, 1.2rem);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.product-preview,
.panel,
.auth-card,
.smart-form,
.report-sheet,
.side-panel,
.price-card,
.ritual-card {
  background: rgba(255, 253, 250, 0.92);
  border: 1px solid rgba(226, 217, 203, 0.92);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.product-preview {
  position: relative;
  overflow: hidden;
  padding: 28px;
  box-shadow: var(--shadow);
}

.product-preview::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 92px;
  background: linear-gradient(90deg, rgba(102, 135, 116, 0.16), rgba(142, 174, 193, 0.12));
  pointer-events: none;
}

.product-preview > * {
  position: relative;
}

.preview-top,
.report-header,
.meter-top,
.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.preview-top span,
.meter-top span,
.ritual-card span {
  color: var(--muted);
  font-size: 0.88rem;
}

.preview-top strong {
  font-size: 2rem;
}

.score-ring {
  display: grid;
  place-items: center;
  width: 168px;
  height: 168px;
  margin: 34px auto;
  border-radius: 50%;
  background: conic-gradient(var(--sage) 0 66%, #eadfcd 66% 100%);
  box-shadow: inset 0 0 0 18px #fffaf4, 0 18px 44px rgba(102, 135, 116, 0.14);
}

.score-ring.large {
  width: 190px;
  height: 190px;
  margin: 0;
}

.score-ring span {
  font-size: 3.4rem;
  font-weight: 850;
}

.score-ring small {
  display: block;
  margin-top: -24px;
  color: var(--muted);
}

.score-ring.strong {
  background: conic-gradient(var(--sage) 0 78%, #eadfcd 78% 100%);
}

.score-ring.care {
  background: conic-gradient(var(--amber) 0 64%, #eadfcd 64% 100%);
}

.score-ring.watch {
  background: conic-gradient(var(--rose) 0 48%, #eadfcd 48% 100%);
}

.preview-grid,
.module-grid,
.metrics-grid,
.price-grid,
.ritual-grid,
.settings-grid,
.report-grid,
.form-grid,
.range-grid {
  display: grid;
  gap: 16px;
}

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

.preview-grid div,
.module-grid article,
.feature-list article {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 250, 241, 0.72);
  box-shadow: 0 1px 0 rgba(255,255,255,0.8) inset;
}

.preview-grid b,
.preview-grid span,
.list-row span {
  display: block;
}

.preview-grid span,
.list-row span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

.section,
.form-page,
.report-page,
.pricing-page,
.chat-layout {
  padding: 72px min(6vw, 72px);
}

.split {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 48px;
}

.section h2,
.form-page h1,
.pricing-page h1,
.chat-layout h1 {
  margin: 0;
  font-size: clamp(2rem, 3.8vw, 3.6rem);
  line-height: 1.05;
}

.section p,
.section-heading p,
.coach-intro p {
  color: var(--muted);
  line-height: 1.7;
  font-size: 1.05rem;
}

.feature-list {
  display: grid;
  gap: 14px;
}

.feature-list span {
  color: var(--sage);
  font-weight: 850;
}

.calm-band {
  background: linear-gradient(180deg, #eef2e8, #f5f2ea);
}

.section-heading {
  max-width: 780px;
  margin-bottom: 34px;
}

.module-grid {
  grid-template-columns: repeat(4, 1fr);
}

.pricing-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: linear-gradient(135deg, #2f5747, #41695a);
  color: #fff;
}

.pricing-strip p {
  color: rgba(255,255,255,0.78);
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
  padding: 32px min(4vw, 48px);
}

.side-panel {
  align-self: start;
  padding: 26px;
  position: sticky;
  top: 96px;
  background:
    linear-gradient(180deg, rgba(255, 253, 250, 0.96), rgba(245, 242, 234, 0.92)),
    radial-gradient(circle at top right, rgba(102, 135, 116, 0.16), transparent 34%);
}

.side-panel h1 {
  margin: 0 0 8px;
}

.side-panel p {
  color: var(--muted);
  line-height: 1.6;
}

.side-panel .button + .button {
  margin-top: 10px;
}

.panel-kicker {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--sage-dark);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.family-note {
  display: grid;
  gap: 6px;
  margin: 20px 0;
  padding: 16px;
  border: 1px solid rgba(102, 135, 116, 0.22);
  border-radius: var(--radius);
  background: rgba(238, 242, 232, 0.72);
}

.family-note strong {
  color: var(--sage-dark);
}

.family-note span {
  color: var(--muted);
  line-height: 1.55;
}

.workspace {
  display: grid;
  gap: 20px;
}

.dashboard-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(22px, 3.5vw, 36px);
  background:
    radial-gradient(circle at 88% 12%, rgba(142, 174, 193, 0.26), transparent 32%),
    linear-gradient(135deg, #fffdf8, #eef2e8);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.dashboard-hero h2 {
  margin: 0;
  font-size: clamp(2.2rem, 4vw, 4.4rem);
  line-height: 0.98;
}

.dashboard-hero p {
  max-width: 560px;
  color: var(--muted);
  line-height: 1.7;
}

.metrics-grid {
  grid-template-columns: repeat(4, 1fr);
}

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

.interactive-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 16px;
}

.value-panel {
  min-height: 178px;
}

.value-panel h3 {
  margin: 0 0 10px;
  font-size: 1.28rem;
  line-height: 1.2;
}

.value-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.compact-metrics .meter {
  min-height: 112px;
}

.checkin-panel h3,
.agreement-panel h3 {
  margin-bottom: 8px;
}

.checkin-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 18px 0;
}

.checkin-actions button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffaf1;
  color: var(--sage-dark);
  font-weight: 800;
  cursor: pointer;
}

.checkin-actions button.selected,
.checkin-actions button:hover {
  border-color: var(--sage);
  background: var(--sage-dark);
  color: #fff;
}

.checkin-result {
  padding: 14px;
  border-radius: var(--radius);
  background: rgba(238, 242, 232, 0.82);
  color: var(--sage-dark);
  font-weight: 750;
  line-height: 1.5;
}

.agreement-item {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: start;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  color: var(--text);
  line-height: 1.5;
  font-weight: 650;
}

.agreement-item input {
  width: 18px;
  height: 18px;
  accent-color: var(--sage-dark);
  margin-top: 2px;
}

.meter {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 250, 0.92);
  box-shadow: 0 10px 30px rgba(51, 43, 31, 0.05);
}

.meter-track {
  height: 9px;
  overflow: hidden;
  margin-top: 12px;
  border-radius: 999px;
  background: #eadfcd;
}

.meter-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sage), var(--blue));
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.panel {
  padding: 24px;
}

.panel h2,
.panel h3 {
  margin-top: 0;
}

.panel p {
  color: var(--muted);
  line-height: 1.65;
}

.list-row {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.smart-form,
.auth-card {
  display: grid;
  gap: 18px;
  max-width: 980px;
  padding: 24px;
}

.smart-form.compact {
  margin-top: 24px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffaf1;
  color: var(--text);
  padding: 13px 14px;
  outline: none;
}

input:focus,
textarea:focus {
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(109, 143, 120, 0.18);
}

.form-grid,
.range-grid {
  grid-template-columns: repeat(2, 1fr);
}

.notice {
  max-width: 980px;
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid #d8cba8;
  border-radius: var(--radius);
  background: #fff5d7;
  color: #6a5120;
}

.notice.error {
  border-color: #e3b5ab;
  background: #fff0ed;
  color: #8d3d2e;
}

.diagnostic {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: #f4efe5;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.diagnostic.error {
  background: #fff0ed;
  color: #8d3d2e;
}

.chat-layout {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 34px;
  align-items: start;
}

.coach-principles {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.coach-principles span {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffaf1;
  color: var(--sage-dark);
  font-weight: 750;
}

.chat-panel {
  display: grid;
  gap: 18px;
}

.messages {
  display: grid;
  gap: 12px;
  max-height: 520px;
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.message {
  max-width: 82%;
  padding: 14px 16px;
  border-radius: var(--radius);
}

.message span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.message p {
  margin: 0;
  line-height: 1.6;
}

.message.parent {
  justify-self: end;
  background: #e8f0f3;
}

.message.coach {
  background: #fff4df;
}

.chat-form {
  display: grid;
  gap: 12px;
}

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

.ritual-card {
  min-height: 188px;
  padding: 22px;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.ritual-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.ritual-card.suggested {
  background: #eef2e8;
}

.report-page {
  background: #ece8de;
}

.report-sheet {
  max-width: 1040px;
  margin: 0 auto;
  padding: 32px;
  background: #fffdf8;
}

.report-header {
  border-bottom: 1px solid var(--line);
  padding-bottom: 22px;
}

.report-header h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 4rem);
}

.report-grid {
  grid-template-columns: repeat(2, 1fr);
  margin-top: 24px;
}

.report-grid section {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffaf1;
}

blockquote {
  margin: 24px 0;
  padding: 22px;
  border-left: 5px solid var(--sage);
  background: #eef2e8;
  line-height: 1.7;
}

.price-grid,
.settings-grid {
  grid-template-columns: repeat(3, 1fr);
}

.price-card {
  padding: 26px;
}

.price-card strong {
  display: block;
  margin: 14px 0;
  font-size: 2rem;
}

.price-card.featured {
  background: #eef2e8;
  border-color: var(--sage);
}

.auth-page {
  min-height: 72vh;
  display: grid;
  place-items: center;
  padding: 48px 20px;
}

.auth-card {
  width: min(460px, 100%);
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 28px min(6vw, 72px);
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.site-footer div {
  display: grid;
  gap: 4px;
}

@media (max-width: 980px) {
  .menu-toggle {
    display: inline-grid;
    place-items: center;
  }

  .main-nav {
    position: absolute;
    top: 74px;
    left: 16px;
    right: 16px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
  }

  .main-nav.open {
    display: flex;
  }

  .hero,
  .split,
  .app-shell,
  .chat-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 48px;
  }

  .side-panel {
    position: static;
  }

  .module-grid,
  .metrics-grid,
  .focus-grid,
  .interactive-grid,
  .ritual-grid,
  .price-grid,
  .settings-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .app-shell {
    padding: 24px;
  }

  .dashboard-hero {
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .site-header,
  .section,
  .form-page,
  .report-page,
  .pricing-page,
  .chat-layout,
  .hero {
    padding-left: 18px;
    padding-right: 18px;
  }

  .preview-grid,
  .module-grid,
  .metrics-grid,
  .focus-grid,
  .interactive-grid,
  .two-col,
  .form-grid,
  .range-grid,
  .ritual-grid,
  .price-grid,
  .settings-grid,
  .report-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-hero,
  .report-header,
  .pricing-strip,
  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .score-ring.large {
    width: 160px;
    height: 160px;
  }

  body::before {
    display: none;
  }

  .site-header {
    padding: 12px 16px;
  }

  .brand {
    font-size: 1rem;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .app-shell {
    padding: 18px;
    gap: 16px;
  }

  .side-panel,
  .panel,
  .meter,
  .ritual-card,
  .smart-form,
  .auth-card,
  .report-sheet,
  .product-preview {
    padding: 18px;
  }

  .dashboard-hero h2 {
    font-size: clamp(2.1rem, 12vw, 3.35rem);
  }

  .score-ring,
  .score-ring.large {
    width: 144px;
    height: 144px;
    margin: 12px 0 0;
    box-shadow: inset 0 0 0 14px #fffaf4, 0 14px 32px rgba(102, 135, 116, 0.14);
  }

  .score-ring span {
    font-size: 2.65rem;
  }

  .score-ring small {
    margin-top: -18px;
  }

  .panel-kicker {
    font-size: 0.72rem;
  }

  .checkin-actions {
    grid-template-columns: repeat(2, 1fr);
  }

  .message {
    max-width: 100%;
  }
}

@media print {
  .site-header,
  .site-footer,
  .button {
    display: none;
  }

  body,
  .report-page {
    background: #fff;
  }

  .report-sheet {
    box-shadow: none;
    border: 0;
  }
}
