:root {
  color-scheme: light;
  --ink: #332b30;
  --muted: #766b71;
  --paper: #fffdfa;
  --ground: #f8f4f1;
  --line: #e9dfdb;
  --rose: #914f67;
  --rose-dark: #71394e;
  --rose-soft: #f5e8ed;
  --sage: #476e5a;
  --sage-soft: #e9f0e9;
  --gold: #886839;
  --gold-soft: #f5efdf;
  --danger: #a33e4c;
  --shadow: 0 18px 60px #46343a12;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--ground);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--ground); }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
a { color: var(--rose-dark); }
.app-shell { width: min(100% - 32px, 760px); margin: 0 auto; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
.topbar { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; padding: 0; border: 0; background: transparent; text-decoration: none; color: var(--ink); font: 26px/1 "Playfair Display", Georgia, serif; letter-spacing: -.02em; cursor: pointer; }
.brand-mark { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 50%; background: var(--rose-soft); color: var(--rose); font-family: Georgia, serif; font-size: 25px; }
.prototype-label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.privacy-dot { width: 8px; height: 8px; border-radius: 50%; background: #bd8a50; }
.install-button { min-height: 40px; padding: 0 13px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); color: var(--rose-dark); font-size: 12px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.install-button:hover { background: var(--rose-soft); }
.journey-nav { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 20px 0 24px; }
.journey-tab { min-height: 54px; border: 1px solid transparent; border-radius: 16px; background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; font-weight: 500; transition: .18s ease; }
.journey-tab span { margin-right: 6px; font-size: 16px; }
.journey-tab:hover { background: #fff9; }
.journey-tab.is-active { background: var(--rose-soft); color: var(--rose-dark); border-color: #edd8e0; font-weight: 700; }
.view { outline: none; min-height: 560px; }
.page-heading { margin: 0 0 22px; }
.eyebrow { color: var(--rose); text-transform: uppercase; letter-spacing: .11em; font-size: 11px; font-weight: 700; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 7px; font: 500 clamp(28px, 6vw, 38px)/1.12 "Playfair Display", Georgia, serif; letter-spacing: -.025em; }
h2 { margin-bottom: 6px; font-size: 17px; font-weight: 700; letter-spacing: -.02em; }
h3 { margin-bottom: 6px; font-size: 14px; font-weight: 700; }
.subtitle { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 16px; align-items: stretch; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 22px; padding: 22px; box-shadow: var(--shadow); }
.panel + .panel, .stack > .panel + .panel { margin-top: 16px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.panel-kicker { color: var(--muted); font-size: 12px; }
.big-number { font: 500 46px/.98 "Playfair Display", Georgia, serif; letter-spacing: -.04em; }
.number-caption { color: var(--muted); margin-top: 7px; font-size: 12px; }
.cycle-overview { display: flex; align-items: center; gap: 20px; min-height: 200px; }
.cycle-ring { width: 132px; height: 132px; flex: 0 0 132px; border-radius: 50%; background: conic-gradient(var(--rose) 0 62%, var(--rose-soft) 62% 100%); display: grid; place-items: center; position: relative; }
.cycle-ring::before { content: ""; position: absolute; inset: 9px; border-radius: inherit; background: var(--paper); }
.ring-inner { position: relative; text-align: center; }
.ring-inner .big-number { display: block; font-size: 40px; }
.ring-inner small { color: var(--muted); font-size: 11px; }
.date-callout { padding: 13px 14px; border-radius: 14px; background: var(--rose-soft); color: var(--rose-dark); font-size: 13px; line-height: 1.5; }
.date-callout strong { display: block; margin-bottom: 3px; }
.note { color: var(--muted); font-size: 12px; line-height: 1.55; }
.callout { padding: 14px 16px; border-left: 3px solid #c18a4d; border-radius: 0 12px 12px 0; background: var(--gold-soft); color: #584a35; font-size: 12px; line-height: 1.55; }
.advice-panel { margin-top: 16px; background: linear-gradient(135deg, var(--paper), #fbf4f1); }
.advice-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.advice-context { display: inline-block; margin-top: 6px; padding: 4px 8px; border-radius: 99px; background: var(--rose-soft); color: var(--rose-dark); font-size: 11px; }
.advice-panel h2 { font: 500 21px/1.25 "Playfair Display", Georgia, serif; }
.advice-copy { max-width: 650px; color: #584d53; font-size: 14px; line-height: 1.65; margin: 0 0 13px; }
.advice-bottom { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.advice-source { margin-left: auto; color: var(--rose-dark); font-size: 11px; font-weight: 700; text-underline-offset: 3px; }
.advice-next { min-height: 40px; white-space: nowrap; }
.advice-library { margin-top: 15px; padding-top: 12px; border-top: 1px solid var(--line); }
.advice-library summary { color: var(--rose-dark); cursor: pointer; font-size: 12px; font-weight: 700; }
.advice-library ol { display: grid; gap: 6px; list-style: none; margin: 10px 0 0; padding: 0; }
.advice-library li button { display: grid; width: 100%; gap: 4px; padding: 10px; border: 0; border-radius: 12px; background: var(--ground); text-align: left; cursor: pointer; }
.advice-library li button:hover { background: var(--rose-soft); }
.advice-library li strong { color: var(--ink); font-size: 12px; }
.advice-library li span { color: var(--muted); font-size: 11px; line-height: 1.5; }
.advice-disclaimer { margin: 12px 0 0; color: var(--muted); font-size: 10px; }
.calendar-strip { display: grid; grid-template-columns: repeat(7,1fr); gap: 5px; margin-top: 17px; }
.calendar-day { text-align: center; padding: 8px 2px; border-radius: 12px; color: var(--muted); font-size: 10px; }
.calendar-day b { display: block; margin-top: 5px; color: var(--ink); font-size: 12px; font-weight: 500; }
.calendar-day.marked { background: var(--rose-soft); color: var(--rose-dark); }
.calendar-day.today { outline: 1px solid var(--rose); outline-offset: -1px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.section-title p { margin: 0; color: var(--muted); font-size: 12px; }
.entry-list { list-style: none; padding: 0; margin: 0; }
.entry { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; padding: 13px 0; border-top: 1px solid var(--line); }
.entry:first-child { border-top: 0; padding-top: 0; }
.entry:last-child { padding-bottom: 0; }
.entry strong { display: block; font-size: 13px; }
.entry small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.entry time { color: var(--muted); font-size: 11px; white-space: nowrap; }
.empty { padding: 14px 0 2px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 46px; padding: 0 17px; border: 0; border-radius: 14px; background: var(--rose); color: white; text-align: center; text-decoration: none; font-weight: 700; font-size: 13px; cursor: pointer; transition: .18s ease; }
.button:hover { background: var(--rose-dark); }
.button.secondary { color: var(--sage); background: var(--sage-soft); }
.button.secondary:hover { background: #dfe9df; }
.button.ghost { background: transparent; color: var(--rose-dark); border: 1px solid var(--line); }
.button.danger { background: var(--danger); }
.button.full { width: 100%; margin-top: 16px; }
.button:focus-visible, .journey-tab:focus-visible, .text-button:focus-visible, .icon-button:focus-visible { outline: 3px solid #c889a0; outline-offset: 2px; }
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field label, .field-label { font-size: 12px; font-weight: 700; }
.field input, .field textarea, .field select { width: 100%; min-height: 45px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; color: var(--ink); background: #fff; }
.field textarea { min-height: 84px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { outline: 3px solid #f0dce3; border-color: var(--rose); }
.field-help { color: var(--muted); font-size: 11px; line-height: 1.45; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.pill { display: inline-flex; align-items: center; padding: 6px 9px; border-radius: 100px; background: var(--sage-soft); color: var(--sage); font-size: 11px; font-weight: 700; }
.journey-hero { padding: 26px; border-radius: 22px; background: var(--sage-soft); margin-bottom: 16px; }
.journey-hero .big-number { color: var(--sage); margin: 8px 0; }
.journey-hero .progress { height: 6px; border-radius: 6px; margin: 18px 0 8px; background: #d6e3d8; overflow: hidden; }
.journey-hero .progress span { display: block; height: 100%; border-radius: inherit; background: var(--sage); }
.resource-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.resource-card { padding: 18px; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; }
.resource-card p { color: var(--muted); font-size: 12px; line-height: 1.5; margin-bottom: 10px; }
.resource-card a { font-size: 12px; font-weight: 700; text-underline-offset: 3px; }
.settings-list { display: grid; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 0; border-top: 1px solid var(--line); }
.setting-row:first-child { border-top: 0; }
.setting-row strong { display: block; font-size: 13px; }
.setting-row small { display: block; max-width: 490px; color: var(--muted); font-size: 11px; line-height: 1.5; margin-top: 3px; }
.notification-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; }
.notification-box p { margin: 0; }
.notification-box strong { font-size: 12px; }
.reminder-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; }
.imported-files { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 14px; }
.result-preview { max-height: 250px; overflow: auto; margin: 10px 0; border-radius: 10px; background: var(--ground); padding: 9px; }
.result-preview img { display: block; max-width: 100%; max-height: 220px; object-fit: contain; margin: 0 auto; }
.text-preview { white-space: pre-wrap; overflow-wrap: anywhere; font: 11px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ink); }
.table-wrap { max-width: 100%; overflow: auto; }
.table-wrap table { border-collapse: collapse; font-size: 10px; white-space: nowrap; }
.table-wrap th, .table-wrap td { border: 1px solid var(--line); padding: 5px; text-align: left; }
.table-wrap th { background: var(--rose-soft); }
.text-button { padding: 7px 0; background: transparent; border: 0; color: var(--rose-dark); font-size: 12px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.app-footer { border-top: 1px solid var(--line); margin-top: 25px; padding: 18px 0 26px; display: flex; align-items: center; gap: 20px; }
.footer-brand { margin-right: auto; font: 15px "Playfair Display", Georgia, serif; }
.footer-brand span { color: var(--rose); }
.toast { position: fixed; z-index: 5; left: 50%; bottom: 22px; transform: translate(-50%, 20px); opacity: 0; max-width: calc(100vw - 32px); padding: 12px 16px; border-radius: 12px; background: #332b30; color: white; font-size: 13px; pointer-events: none; transition: .2s ease; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.modal-backdrop { position: fixed; z-index: 10; inset: 0; display: grid; place-items: center; padding: 20px; background: #20181dcc; }
.modal { width: min(100%, 460px); max-height: min(90vh, 700px); overflow: auto; padding: 24px; border-radius: 22px; background: var(--paper); box-shadow: 0 20px 70px #0004; }
.modal-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 18px; }
.modal-head h2 { font: 500 25px "Playfair Display", Georgia, serif; }
.icon-button { border: 0; border-radius: 50%; width: 38px; height: 38px; background: var(--ground); font-size: 20px; cursor: pointer; }
.install-steps { display: grid; gap: 10px; padding-left: 22px; color: var(--ink); font-size: 13px; line-height: 1.55; }
.check-row { display: flex; gap: 9px; align-items: center; color: var(--muted); font-size: 12px; }
.check-row input { accent-color: var(--rose); width: 17px; height: 17px; }
[hidden] { display: none !important; }

@media (max-width: 620px) {
  .app-shell { width: min(100% - 24px, 500px); }
  .topbar { min-height: 66px; }
  .brand { font-size: 23px; gap: 7px; }
  .brand-mark { width: 33px; height: 33px; }
  .prototype-label { display: none; }
  .journey-nav { gap: 3px; padding: 14px 0 19px; }
  .journey-tab { min-height: 57px; padding: 5px 2px; font-size: 10px; line-height: 1.25; }
  .journey-tab span { display: block; margin: 0 0 3px; }
  .view { min-height: 0; }
  .grid { grid-template-columns: 1fr; }
  .cycle-overview { min-height: 0; }
  .panel { padding: 18px; }
  .resource-grid { grid-template-columns: 1fr; }
  .app-footer { flex-wrap: wrap; gap: 9px 15px; }
  .footer-brand { flex-basis: 100%; }
  .notification-box { align-items: flex-start; flex-direction: column; }
  .reminder-actions { justify-content: flex-start; }
  .advice-top { flex-direction: column; gap: 4px; }
  .advice-source { margin-left: 0; }
}
@media (max-width: 370px) {
  .prototype-label { font-size: 10px; }
  .cycle-overview { gap: 12px; }
  .cycle-ring { width: 112px; height: 112px; flex-basis: 112px; }
  .cycle-ring::before { inset: 7px; }
  .ring-inner .big-number { font-size: 34px; }
  .form-row { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; } }
