:root {
  --ink: #302a2f;
  --muted: #756c73;
  --paper: #f6f1ec;
  --card: #fffdfa;
  --line: #e7ddd6;
  --plum: #6f5968;
  --plum-soft: #eadfe5;
  --rose: #a84e60;
  --rose-soft: #f8dfe1;
  --peach: #f2c0b3;
  --sage: #627d6d;
  --sage-soft: #e2ece4;
  --amber: #a66c22;
  --amber-soft: #f7ead0;
  --red: #9b3537;
  --red-soft: #f9dddd;
  --shadow: 0 12px 38px rgba(75, 54, 65, 0.08);
  --shadow-soft: 0 5px 18px rgba(75, 54, 65, 0.06);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% -10%, rgba(242, 192, 179, 0.48), transparent 31rem),
    radial-gradient(circle at 92% 18%, rgba(226, 236, 228, 0.8), transparent 27rem),
    var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(168, 78, 96, 0.3);
  outline-offset: 3px;
}

a {
  color: var(--rose);
}

.skip-link {
  position: fixed;
  z-index: 999;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  color: white;
  background: var(--ink);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.loading-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--muted);
}

.loading-mark {
  color: var(--rose);
  font-size: 44px;
  animation: turn 1.8s linear infinite;
}

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

.app-shell {
  width: min(100%, 980px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 18px calc(104px + var(--safe-bottom));
}

.offline-banner {
  position: sticky;
  z-index: 25;
  top: 0;
  margin: 0 -18px;
  padding: 8px 18px;
  color: #744d19;
  background: var(--amber-soft);
  text-align: center;
  font-size: 12px;
}

.sync-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 -18px;
  padding: 8px 18px;
  color: #744d19;
  background: var(--amber-soft);
  text-align: center;
  font-size: 12px;
}

.sync-banner .text-button {
  color: var(--amber);
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 12px 2px;
  background: linear-gradient(var(--paper) 78%, transparent);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 14px;
  color: white;
  background: var(--plum);
  box-shadow: var(--shadow-soft);
  font-size: 20px;
}

.brand-copy strong {
  display: block;
  font-family: "Songti SC", "STSong", serif;
  font-size: 17px;
  letter-spacing: 0.04em;
}

.brand-copy span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button,
.role-pill {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 250, 0.8);
}

.icon-button {
  width: 40px;
  padding: 0;
  cursor: pointer;
  font-size: 17px;
}

.role-pill {
  gap: 7px;
  padding: 0 13px;
  cursor: pointer;
  color: var(--plum);
  font-size: 13px;
  font-weight: 650;
}

.role-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rose);
}

.role-dot.him {
  background: var(--sage);
}

main {
  animation: rise 0.35s ease both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero {
  display: grid;
  gap: 18px;
  padding: 26px;
  overflow: hidden;
  border: 1px solid rgba(231, 221, 214, 0.8);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, rgba(255, 253, 250, 0.97), rgba(255, 248, 245, 0.9)),
    var(--card);
  box-shadow: var(--shadow);
}

.hero.him {
  background:
    linear-gradient(135deg, rgba(255, 253, 250, 0.97), rgba(239, 246, 241, 0.92)),
    var(--card);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--rose);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.12em;
}

.hero.him .eyebrow {
  color: var(--sage);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
}

h1 {
  max-width: 630px;
  margin-bottom: 10px;
  font-size: clamp(28px, 7vw, 46px);
  line-height: 1.15;
  letter-spacing: -0.035em;
}

h2 {
  margin-bottom: 14px;
  font-size: 22px;
  letter-spacing: -0.02em;
}

h3 {
  margin-bottom: 9px;
  font-size: 17px;
}

.hero-copy {
  max-width: 620px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.65);
  font-size: 12px;
}

.pill.rose {
  border-color: #efcbd0;
  color: var(--rose);
  background: var(--rose-soft);
}

.pill.sage {
  border-color: #ceddd3;
  color: var(--sage);
  background: var(--sage-soft);
}

.pill.amber {
  border-color: #ead2a9;
  color: var(--amber);
  background: var(--amber-soft);
}

.demo-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  padding: 12px 15px;
  border: 1px dashed #d8c8bf;
  border-radius: var(--radius-md);
  color: var(--muted);
  background: rgba(255, 253, 250, 0.66);
  font-size: 12px;
  line-height: 1.5;
}

.demo-banner button {
  flex: 0 0 auto;
}

.section {
  margin-top: 18px;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 253, 250, 0.94);
  box-shadow: var(--shadow-soft);
}

.card-pad {
  padding: 20px;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 16px;
}

.card-head h2,
.card-head h3,
.card-head p {
  margin-bottom: 0;
}

.card-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.two-column {
  display: grid;
  gap: 18px;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 16px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  color: white;
  background: var(--plum);
  font-size: 14px;
  font-weight: 700;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    opacity 0.18s ease;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(111, 89, 104, 0.18);
}

.button:active {
  transform: translateY(0);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
  box-shadow: none;
}

.button.rose {
  background: var(--rose);
}

.button.sage {
  background: var(--sage);
}

.button.soft {
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
}

.button.ghost {
  border: 1px solid var(--line);
  color: var(--muted);
  background: transparent;
}

.button.small {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 12px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.symptom-list {
  display: grid;
  gap: 9px;
}

.symptom-row {
  display: grid;
  grid-template-columns: minmax(88px, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  transition: background 0.2s ease;
}

.symptom-row:has(.score.active) {
  border-color: #f0d9dc;
  background: #fff8f8;
}

.symptom-name {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 650;
}

.symptom-icon {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border-radius: 10px;
  color: var(--rose);
  background: var(--rose-soft);
  font-size: 14px;
}

.scores {
  display: flex;
  gap: 5px;
}

.score {
  width: 31px;
  height: 31px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  color: var(--muted);
  background: #fff;
  font-size: 12px;
  font-weight: 650;
  transition: 0.15s ease;
}

.score:hover {
  border-color: #d7b8bd;
}

.score.active {
  border-color: var(--rose);
  color: #fff;
  background: var(--rose);
}

.save-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.saved-note {
  color: var(--muted);
  font-size: 12px;
}

.suggestion-list {
  display: grid;
  gap: 10px;
}

.suggestion {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  background: #fbf7f3;
}

.suggestion.highlight {
  background: var(--rose-soft);
}

.suggestion-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 13px;
  background: #fff;
  font-size: 18px;
}

.suggestion strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.suggestion p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.notice {
  display: flex;
  gap: 12px;
  padding: 14px 15px;
  border-radius: 16px;
  color: var(--muted);
  background: #f4efe9;
  font-size: 13px;
  line-height: 1.65;
}

.notice.rose {
  color: #7d3d48;
  background: var(--rose-soft);
}

.notice.amber {
  color: #744d19;
  background: var(--amber-soft);
}

.notice.red {
  color: var(--red);
  background: var(--red-soft);
}

.notice.sage {
  color: #415b4b;
  background: var(--sage-soft);
}

.notice strong {
  display: block;
  margin-bottom: 3px;
}

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

.request-option {
  display: grid;
  min-height: 88px;
  place-items: center;
  gap: 8px;
  padding: 11px 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  cursor: pointer;
  color: var(--muted);
  background: #fff;
  text-align: center;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
}

.request-option .option-icon {
  font-size: 22px;
}

.request-option.selected {
  border-color: var(--rose);
  color: var(--rose);
  background: var(--rose-soft);
  box-shadow: inset 0 0 0 1px var(--rose);
}

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

.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

textarea,
input[type="text"],
input[type="date"],
input[type="number"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background: #fff;
}

textarea {
  min-height: 86px;
  resize: vertical;
  padding: 12px;
  line-height: 1.6;
}

input[type="text"],
input[type="date"],
input[type="number"] {
  min-height: 44px;
  padding: 9px 12px;
}

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

.request-card {
  position: relative;
  overflow: hidden;
}

.request-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--rose);
  content: "";
}

.request-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 13px;
}

.request-note {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.7;
}

.request-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.response-box {
  margin-top: 14px;
  padding: 14px;
  border-radius: 16px;
  background: var(--sage-soft);
}

.response-box strong {
  display: block;
  margin-bottom: 4px;
  color: #3e5948;
}

.response-box p {
  margin: 0;
  color: #4d6556;
  font-size: 13px;
  line-height: 1.6;
}

.response-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.response-option {
  min-height: 45px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 13px;
  cursor: pointer;
  color: var(--muted);
  background: white;
  font-size: 13px;
  font-weight: 650;
}

.response-option.selected {
  border-color: var(--sage);
  color: var(--sage);
  background: var(--sage-soft);
}

.empty-state {
  padding: 26px 16px;
  color: var(--muted);
  text-align: center;
}

.empty-icon {
  margin-bottom: 9px;
  color: #c4b4bd;
  font-size: 35px;
}

.empty-state p {
  max-width: 340px;
  margin: 0 auto;
  font-size: 13px;
  line-height: 1.65;
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline-item {
  position: relative;
  padding-left: 24px;
}

.timeline-item::before {
  position: absolute;
  top: 7px;
  left: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--peach);
  content: "";
}

.timeline-item::after {
  position: absolute;
  top: 18px;
  bottom: -12px;
  left: 7.5px;
  width: 1px;
  background: var(--line);
  content: "";
}

.timeline-item:last-child::after {
  display: none;
}

.timeline-item strong {
  display: block;
  margin-bottom: 3px;
  font-size: 13px;
}

.timeline-item span {
  color: var(--muted);
  font-size: 11px;
}

.segment {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: #eee7e1;
}

.segment button {
  flex: 1;
  min-height: 34px;
  padding: 6px 11px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 650;
}

.segment button.active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 2px 8px rgba(75, 54, 65, 0.08);
}

.cycle-hero {
  display: grid;
  gap: 20px;
  padding: 22px;
  border-radius: var(--radius-lg);
  color: white;
  background:
    radial-gradient(circle at 92% 10%, rgba(255, 255, 255, 0.18), transparent 8rem),
    var(--plum);
  box-shadow: var(--shadow);
}

.cycle-hero.him {
  background:
    radial-gradient(circle at 92% 10%, rgba(255, 255, 255, 0.15), transparent 8rem),
    #557061;
}

.cycle-hero h2 {
  margin-bottom: 7px;
}

.cycle-date {
  margin: 0;
  font-family: "Songti SC", "STSong", serif;
  font-size: clamp(25px, 8vw, 38px);
  line-height: 1.2;
}

.cycle-sub {
  margin: 7px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  line-height: 1.6;
}

.cycle-hero .button {
  width: fit-content;
  color: var(--ink);
  background: #fff;
}

.progress {
  display: flex;
  gap: 6px;
}

.progress-dot {
  width: 22px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
}

.progress-dot.active {
  background: #fff;
}

.history-list {
  display: grid;
  gap: 8px;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.history-item:last-child {
  border-bottom: 0;
}

.history-item strong {
  display: block;
  margin-bottom: 3px;
  font-size: 13px;
}

.history-item span {
  color: var(--muted);
  font-size: 11px;
}

.text-button {
  padding: 5px;
  border: 0;
  cursor: pointer;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.flow-grid {
  display: grid;
  gap: 8px;
}

.check-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  cursor: pointer;
  background: #fff;
  font-size: 13px;
}

.check-row input {
  width: 19px;
  height: 19px;
  accent-color: var(--rose);
}

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

.guide-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fff;
}

.guide-card .guide-icon {
  margin-bottom: 13px;
  font-size: 23px;
}

.guide-card h3 {
  font-size: 15px;
}

.guide-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.script-list {
  display: grid;
  gap: 10px;
}

.script-card {
  padding: 15px;
  border-left: 3px solid var(--peach);
  border-radius: 4px 14px 14px 4px;
  background: #fbf7f3;
}

.script-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
}

.script-card span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
}

.warning-list {
  display: grid;
  gap: 11px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.warning-list li {
  padding-left: 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.warning-list li::before {
  float: left;
  margin-left: -20px;
  color: var(--rose);
  content: "•";
  font-weight: 900;
}

.source-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.source-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: #fff;
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
}

.source-list a::after {
  color: var(--muted);
  content: "↗";
}

.disclaimer {
  padding: 15px;
  border: 1px dashed #d9cbc3;
  border-radius: 15px;
  color: var(--muted);
  background: rgba(255, 253, 250, 0.45);
  font-size: 11px;
  line-height: 1.7;
}

.bottom-nav {
  position: fixed;
  z-index: 30;
  right: 50%;
  bottom: max(12px, var(--safe-bottom));
  display: grid;
  width: min(calc(100% - 28px), 520px);
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 7px;
  border: 1px solid rgba(231, 221, 214, 0.92);
  border-radius: 23px;
  background: rgba(255, 253, 250, 0.93);
  box-shadow: 0 16px 45px rgba(75, 54, 65, 0.16);
  backdrop-filter: blur(18px);
  transform: translateX(50%);
}

.bottom-nav button {
  display: grid;
  min-height: 52px;
  place-items: center;
  gap: 2px;
  padding: 5px;
  border: 0;
  border-radius: 17px;
  cursor: pointer;
  color: var(--muted);
  background: transparent;
  font-size: 10px;
}

.bottom-nav button.active {
  color: var(--plum);
  background: var(--plum-soft);
}

.nav-icon {
  font-size: 18px;
  line-height: 1;
}

.sheet {
  width: min(calc(100% - 24px), 560px);
  max-height: min(86vh, 760px);
  margin: auto auto 12px;
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 28px;
  color: var(--ink);
  background: var(--card);
  box-shadow: 0 24px 80px rgba(52, 38, 46, 0.28);
}

.sheet::backdrop {
  background: rgba(41, 31, 37, 0.48);
  backdrop-filter: blur(3px);
}

.sheet-inner {
  padding: 22px;
}

.sheet-head {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 250, 0.96);
  backdrop-filter: blur(12px);
}

.sheet-head h2 {
  margin: 0;
  font-size: 21px;
}

.close-button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  color: var(--muted);
  background: #fff;
  font-size: 18px;
}

.role-choices {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.role-choice {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 13px;
  align-items: center;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 18px;
  cursor: pointer;
  background: #fff;
  text-align: left;
}

.role-choice.active {
  border-color: var(--plum);
  box-shadow: inset 0 0 0 1px var(--plum);
}

.role-avatar {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 16px;
  color: var(--rose);
  background: var(--rose-soft);
  font-size: 22px;
}

.role-choice.him .role-avatar {
  color: var(--sage);
  background: var(--sage-soft);
}

.role-choice strong {
  display: block;
  margin-bottom: 3px;
  font-size: 15px;
}

.role-choice span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.toggle-row:last-child {
  border-bottom: 0;
}

.toggle {
  position: relative;
  width: 48px;
  height: 28px;
  flex: 0 0 auto;
}

.toggle input {
  position: absolute;
  opacity: 0;
}

.toggle-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  cursor: pointer;
  background: #d6cdc7;
  transition: 0.2s;
}

.toggle-track::after {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  content: "";
  transition: 0.2s;
}

.toggle input:checked + .toggle-track {
  background: var(--rose);
}

.toggle input:checked + .toggle-track::after {
  transform: translateX(20px);
}

.sheet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 18px;
}

.toast {
  position: fixed;
  z-index: 100;
  right: 50%;
  bottom: calc(96px + var(--safe-bottom));
  max-width: min(calc(100% - 34px), 460px);
  padding: 11px 16px;
  border-radius: 999px;
  color: white;
  background: rgba(48, 42, 47, 0.94);
  box-shadow: var(--shadow);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translate(50%, 8px);
  transition: 0.22s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(50%, 0);
}

.muted {
  color: var(--muted);
}

.tiny {
  font-size: 11px;
  line-height: 1.6;
}

.mt-12 {
  margin-top: 12px;
}

.mt-16 {
  margin-top: 16px;
}

.hidden {
  display: none !important;
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  padding-bottom: 28px;
  place-items: center;
}

.auth-stage {
  display: grid;
  width: 100%;
  gap: 18px;
}

.auth-brand {
  padding: 28px 8px 8px;
}

.auth-brand h1 {
  margin-bottom: 14px;
}

.auth-logo {
  width: 54px;
  height: 54px;
  margin-bottom: 24px;
  border-radius: 18px;
  font-size: 27px;
}

.auth-card {
  width: 100%;
}

.auth-actions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.auth-actions .button {
  min-height: 50px;
}

.role-pill {
  cursor: default;
}

.role-dot.owner {
  background: var(--rose);
}

.invite-panel {
  padding: 18px;
  border: 1px solid #efcfd4;
  border-radius: 18px;
  background: #fff8f8;
}

.invite-code {
  margin: 8px 0;
  color: var(--rose);
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 0.18em;
  line-height: 1.2;
}

.code-input {
  font-size: 25px;
  font-weight: 750;
  letter-spacing: 0.22em;
  text-align: center;
}

select {
  width: 100%;
  min-height: 44px;
  padding: 9px 34px 9px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background: #fff;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.tag {
  min-height: 34px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  color: var(--muted);
  background: #fff;
  font-size: 12px;
}

.tag.active {
  border-color: var(--rose);
  color: var(--rose);
  background: var(--rose-soft);
}

.settings-list {
  display: grid;
  gap: 8px;
}

.toggle-setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 64px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
}

.toggle-setting > span:first-child {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.toggle-setting strong {
  color: var(--ink);
  font-size: 13px;
}

.danger-zone {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid #efd8d8;
}

.danger-zone h3 {
  color: var(--red);
}

.care-status {
  padding: 22px;
  border-radius: var(--radius-lg);
  color: white;
  background:
    radial-gradient(circle at 90% 8%, rgba(255, 255, 255, 0.16), transparent 8rem),
    var(--sage);
  box-shadow: var(--shadow);
}

.care-status .eyebrow,
.care-status .cycle-sub {
  color: rgba(255, 255, 255, 0.72);
}

.care-status .cycle-date {
  font-size: clamp(25px, 7vw, 37px);
}

.toggle-setting .toggle {
  position: relative;
}

@media (min-width: 680px) {
  .auth-stage {
    grid-template-columns: minmax(0, 1fr) minmax(330px, 0.8fr);
    align-items: center;
    gap: 44px;
  }

  .auth-brand {
    padding-bottom: 24px;
  }
}

@media (min-width: 760px) {
  .app-shell {
    padding-inline: 28px;
  }

  .hero {
    grid-template-columns: 1fr auto;
    align-items: end;
    padding: 34px;
  }

  .hero .hero-meta {
    justify-content: flex-end;
    padding-bottom: 6px;
  }

  .two-column {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .two-column.wide-left {
    grid-template-columns: 1.15fr 0.85fr;
  }

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

@media (max-width: 470px) {
  .app-shell {
    padding-inline: 14px;
  }

  .hero {
    padding: 22px;
    border-radius: 25px;
  }

  .card-pad {
    padding: 17px;
  }

  .symptom-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .scores {
    justify-content: stretch;
  }

  .score {
    width: auto;
    flex: 1;
  }

  .request-picker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .guide-grid {
    grid-template-columns: 1fr;
  }

  .save-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .save-row .button {
    width: 100%;
  }

  .demo-banner {
    align-items: flex-start;
    flex-direction: column;
  }
}

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

.subpage-hero {
  align-items: start;
}

.subpage-hero .text-button {
  display: inline-flex;
  margin-bottom: 15px;
  padding-left: 0;
}

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

.feature-links button {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 2px 10px;
  align-items: center;
  min-height: 82px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 17px;
  color: var(--ink);
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.feature-links button > span {
  display: grid;
  grid-row: span 2;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 12px;
  color: var(--rose);
  background: var(--rose-soft);
  font-size: 17px;
}

.feature-links strong {
  font-size: 13px;
}

.feature-links small {
  color: var(--muted);
  font-size: 11px;
}

.emotion-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 17px;
}

.emotion-option {
  display: grid;
  min-height: 86px;
  place-items: center;
  gap: 7px;
  padding: 10px 7px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--muted);
  background: #fff;
  cursor: pointer;
}

.emotion-option > span {
  color: var(--rose);
  font-size: 24px;
}

.emotion-option strong {
  font-size: 13px;
}

.emotion-option.selected {
  border-color: var(--rose);
  color: var(--rose);
  background: var(--rose-soft);
  box-shadow: inset 0 0 0 1px var(--rose);
}

.compact-scores {
  justify-content: flex-start;
}

.compact-scores .score {
  width: 42px;
  flex: none;
}

.suggestion-wide {
  grid-template-columns: 42px 1fr;
}

.relief-followup {
  border-color: #e9c8cc;
  background: linear-gradient(145deg, #fffdfa, #fff5f5);
}

.relief-result-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.relief-result {
  min-height: 46px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
}

.relief-result.caution {
  border-color: #e4c48e;
  color: var(--amber);
  background: var(--amber-soft);
}

.private-timeline {
  display: grid;
  gap: 9px;
}

.private-history-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
}

.private-history-card > div {
  display: grid;
  gap: 7px;
}

.private-history-card .request-items {
  margin: 0;
}

.private-history-card .pill {
  min-height: 24px;
  padding: 3px 8px;
  font-size: 10px;
}

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

.trend-card {
  display: grid;
  gap: 7px;
  align-content: start;
  min-height: 134px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.trend-card strong {
  font-size: 13px;
}

.trend-card p,
.trend-card > span {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.method-groups {
  display: grid;
  gap: 17px;
}

.method-group {
  display: grid;
  gap: 8px;
}

.method-group h3 {
  margin-bottom: 1px;
  color: var(--muted);
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 0.05em;
}

.method-card {
  display: grid;
  gap: 6px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
}

.method-card p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.source-links {
  display: grid;
  gap: 8px;
}

.source-links a {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: #fff;
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
}

.source-links a::after {
  float: right;
  color: var(--muted);
  content: "↗";
}

.breathing-orb {
  display: grid;
  width: 150px;
  height: 150px;
  margin: 18px auto 24px;
  place-items: center;
  border-radius: 50%;
  color: var(--rose);
  background:
    radial-gradient(circle at 40% 35%, #fff, transparent 32%),
    var(--rose-soft);
  box-shadow:
    0 0 0 18px rgba(248, 223, 225, 0.48),
    0 0 0 36px rgba(248, 223, 225, 0.22);
  font-size: 62px;
  animation: breathe 6s ease-in-out infinite;
}

@keyframes breathe {
  0%,
  100% {
    transform: scale(0.9);
  }
  40% {
    transform: scale(1.06);
  }
  55% {
    transform: scale(1.06);
  }
}

.breathing-copy {
  margin: 0 0 10px;
  font-family: "Songti SC", "STSong", serif;
  font-size: 20px;
  line-height: 1.65;
  text-align: center;
}

.partner-quick-card {
  background: linear-gradient(145deg, #fffdfa, #f1f7f3);
}

.partner-actions {
  display: grid;
  gap: 8px;
}

.partner-actions span {
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--muted);
  background: #fff;
  font-size: 13px;
}

.mutual-card {
  border-color: #d8e4da;
}

.mutual-card::before {
  background: var(--sage);
}

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

.mutual-entry {
  border-style: dashed;
  background: rgba(226, 236, 228, 0.4);
}

.care-kit-grid {
  display: grid;
  gap: 8px;
}

.care-kit-row {
  display: grid;
  grid-template-columns: 34px 1fr 22px;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--muted);
  background: #fff;
  cursor: pointer;
  font-size: 13px;
}

.care-kit-row.checked {
  border-color: #c8dbce;
  color: #425c4b;
  background: var(--sage-soft);
}

.care-kit-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 10px;
  color: var(--sage);
  background: #fff;
}

.care-kit-row input {
  width: 20px;
  height: 20px;
  accent-color: var(--sage);
}

.shared-status-card {
  border-color: #d7e3da;
  background: linear-gradient(145deg, #fffdfa, #f2f8f4);
}

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

.shared-status-grid button {
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--muted);
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
}

.shared-status-grid button.selected {
  border-color: var(--sage);
  color: #3f5848;
  background: var(--sage-soft);
  box-shadow: inset 0 0 0 1px var(--sage);
}

.shared-status-value {
  margin: 0 0 5px;
  color: var(--sage);
  font-family: "Songti SC", "STSong", serif;
  font-size: clamp(28px, 8vw, 40px);
  line-height: 1.25;
}

.data-tools-card {
  background:
    linear-gradient(145deg, rgba(255, 253, 250, 0.98), rgba(244, 249, 245, 0.9)),
    var(--card);
}

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

.data-tool-grid button {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 2px 10px;
  align-items: center;
  min-height: 78px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  text-align: left;
}

.data-tool-grid button > span {
  display: grid;
  grid-row: span 2;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  color: var(--sage);
  background: var(--sage-soft);
  font-size: 16px;
}

.data-tool-grid strong {
  font-size: 13px;
}

.data-tool-grid small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.backup-key-box {
  display: grid;
  gap: 8px;
  margin: 16px 0;
  padding: 15px;
  border: 1px dashed #d9bfc4;
  border-radius: 16px;
  color: var(--muted);
  background: #fff9f9;
  font-size: 11px;
}

.backup-key-box strong {
  color: var(--rose);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 18px;
  letter-spacing: 0.06em;
  overflow-wrap: anywhere;
}

input[type="file"] {
  width: 100%;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  font-size: 12px;
}

@media (max-width: 470px) {
  .feature-links,
  .trend-grid {
    grid-template-columns: 1fr;
  }

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

  .compact-scores {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
  }

  .compact-scores .score {
    width: auto;
  }

  .mutual-picker {
    grid-template-columns: 1fr;
  }

  .data-tool-grid {
    grid-template-columns: 1fr;
  }
}
