:root {
  --ink: #3e2830;
  --muted: #7f6971;
  --soft-muted: #a38d95;
  --purple: #d66f8b;
  --purple-deep: #b84f6d;
  --purple-light: #fbe7ed;
  --rose: #e27d98;
  --rose-deep: #c85373;
  --rose-light: #fde8ee;
  --green: #72a18f;
  --green-light: #e5f1ec;
  --blue: #397bbf;
  --blue-deep: #28639f;
  --blue-light: #e8f2fc;
  --cream: #fff8fa;
  --surface: rgba(255, 255, 255, 0.88);
  --border: #f0dfe5;
  --shadow: 0 18px 48px rgba(128, 63, 82, 0.08);
  --radius-lg: 26px;
  --radius-md: 18px;
  --radius-sm: 12px;
  font-family:
    "Noto Sans SC", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: var(--ink);
  background: var(--cream);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 5%, rgba(250, 204, 217, 0.62), transparent 24rem),
    radial-gradient(circle at 92% 18%, rgba(255, 224, 230, 0.65), transparent 22rem),
    var(--cream);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.page-shell {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 94px;
}

.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  color: white;
  border-radius: 16px;
  background: linear-gradient(145deg, #e89ab0, #c95d7b);
  box-shadow: 0 9px 22px rgba(193, 79, 111, 0.22);
}

.brand-mark svg {
  width: 32px;
  height: 32px;
  fill: currentColor;
  stroke: none;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-family: "STSong", "SimSun", serif;
  font-size: 1.45rem;
  letter-spacing: 0.08em;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.74rem;
}

.privacy-pill {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  padding: 9px 13px;
  color: var(--purple-deep);
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.privacy-pill svg {
  width: 15px;
  height: 15px;
}

.topbar-actions {
  display: flex;
  gap: 9px;
  align-items: center;
}

.sync-status {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  min-height: 35px;
  padding: 0 11px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 650;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.sync-status i {
  width: 7px;
  height: 7px;
  background: #aaa0a4;
  border-radius: 50%;
}

.sync-status.syncing i {
  background: #d6a64c;
  box-shadow: 0 0 0 4px rgba(214, 166, 76, 0.12);
}

.sync-status.synced i {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(114, 161, 143, 0.12);
}

.sync-status.offline i,
.sync-status.error i {
  background: var(--rose);
}

.settings-gear-button {
  display: grid;
  width: 37px;
  height: 37px;
  place-items: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--border);
  border-radius: 50%;
  transition:
    color 180ms ease,
    background 180ms ease,
    transform 180ms ease;
}

.settings-gear-button:hover {
  color: var(--purple-deep);
  background: var(--purple-light);
  transform: rotate(30deg);
}

.settings-gear-button svg {
  width: 18px;
  height: 18px;
}

.account-button {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  min-height: 37px;
  max-width: 190px;
  padding: 0 13px;
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  background: linear-gradient(135deg, #df7e99, #bd526f);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 7px 16px rgba(177, 69, 101, 0.16);
}

.account-button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-button svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.cloud-setup-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 14px 18px;
  color: #745c23;
  background: #fff8df;
  border: 1px solid #ead89b;
  border-radius: 14px;
}

.cloud-setup-banner strong,
.cloud-setup-banner p {
  display: block;
  margin: 0;
}

.cloud-setup-banner strong {
  font-size: 0.78rem;
}

.cloud-setup-banner p,
.cloud-setup-banner > span {
  margin-top: 3px;
  font-size: 0.66rem;
  line-height: 1.5;
}

.cloud-setup-banner > span {
  flex: 0 0 auto;
  margin-top: 0;
  font-weight: 700;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.8fr);
  gap: 22px;
}

.prediction-card {
  position: relative;
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  min-height: 330px;
  padding: 44px 48px;
  overflow: hidden;
  color: white;
  background:
    linear-gradient(120deg, rgba(119, 39, 64, 0.12), transparent 55%),
    linear-gradient(135deg, #ee9bb1 0%, #d96f8d 55%, #bc5574 100%);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(177, 69, 101, 0.23);
}

.prediction-card::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background: radial-gradient(circle at 78% 50%, rgba(255, 255, 255, 0.13), transparent 34%);
}

.prediction-copy {
  position: relative;
  z-index: 2;
}

.eyebrow {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  opacity: 0.86;
}

.status-dot {
  width: 7px;
  height: 7px;
  background: #f7c7d3;
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.1);
}

.prediction-card h1 {
  margin: 24px 0 7px;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  opacity: 0.8;
}

.prediction-date {
  display: flex;
  gap: 12px;
  align-items: baseline;
}

.date-number {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.8rem, 7vw, 5.9rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.06em;
}

.date-unit {
  font-size: 1.4rem;
  letter-spacing: 0.08em;
}

.prediction-copy > p {
  max-width: 470px;
  min-height: 2.9em;
  margin: 18px 0 25px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.88rem;
  line-height: 1.75;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 45px;
  padding: 0 20px;
  color: var(--purple-deep);
  font-weight: 650;
  background: white;
  border: 0;
  border-radius: 13px;
  box-shadow: 0 8px 18px rgba(37, 18, 57, 0.12);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease;
}

.primary-button:hover,
.secondary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 11px 22px rgba(37, 18, 57, 0.17);
}

.primary-button:active,
.secondary-button:active {
  transform: translateY(0);
}

.primary-button svg {
  width: 17px;
  height: 17px;
}

.cycle-visual {
  position: relative;
  min-width: 250px;
  min-height: 250px;
  align-self: center;
}

.orbit {
  position: absolute;
  inset: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.orbit-outer {
  width: 255px;
  height: 255px;
}

.orbit-inner {
  width: 186px;
  height: 186px;
}

.cycle-moon {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: 120px;
  height: 120px;
  place-items: center;
  color: #fff0f4;
  background: rgba(255, 241, 245, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  box-shadow:
    0 0 50px rgba(255, 255, 255, 0.08),
    inset 0 0 25px rgba(255, 255, 255, 0.05);
  transform: translate(-50%, -50%);
}

.cycle-moon svg {
  width: 82px;
  height: 82px;
  fill: currentColor;
  stroke: none;
}

.spark {
  position: absolute;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.75);
  border-radius: 50%;
  box-shadow: 0 0 12px white;
}

.spark-one {
  top: 19%;
  right: 12%;
}

.spark-two {
  right: 7%;
  bottom: 29%;
  width: 3px;
  height: 3px;
}

.spark-three {
  bottom: 18%;
  left: 12%;
  width: 4px;
  height: 4px;
}

.stats-card,
.panel {
  background: var(--surface);
  border: 1px solid rgba(241, 221, 228, 0.92);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.stats-card {
  padding: 30px;
}

.section-heading,
.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.eyebrow-text {
  color: var(--purple);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.section-heading h2,
.panel-header h2,
.insight-panel h2 {
  margin: 7px 0 0;
  font-family: "STSong", "SimSun", serif;
  font-size: 1.24rem;
  font-weight: 700;
}

.confidence-badge {
  padding: 6px 9px;
  color: var(--soft-muted);
  font-size: 0.7rem;
  font-weight: 650;
  background: #faf0f3;
  border-radius: 999px;
}

.confidence-badge.medium {
  color: #8a6f35;
  background: #f9f0d9;
}

.confidence-badge.high {
  color: #4e806e;
  background: var(--green-light);
}

.stat-list {
  display: grid;
  gap: 14px;
  margin-top: 25px;
}

.stat-item {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 13px 14px;
  background: rgba(255, 247, 249, 0.8);
  border-radius: 15px;
}

.stat-icon {
  display: grid;
  width: 39px;
  height: 39px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
}

.stat-icon svg {
  width: 19px;
  height: 19px;
}

.stat-icon-purple {
  color: var(--purple);
  background: var(--purple-light);
}

.stat-icon-rose {
  color: var(--rose);
  background: var(--rose-light);
}

.stat-icon-green {
  color: var(--green);
  background: var(--green-light);
}

.stat-item > div > span {
  display: block;
  margin-bottom: 1px;
  color: var(--muted);
  font-size: 0.73rem;
}

.stat-item strong {
  font-family: -apple-system, "SF Pro Display", "SF Pro Text", "PingFang SC", "Helvetica Neue", system-ui, sans-serif;
  font-size: 1.45rem;
  font-weight: 600;
}

.stat-item strong small {
  margin-left: 4px;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.68rem;
}

.stats-note {
  margin: 19px 2px 0;
  color: var(--soft-muted);
  font-size: 0.7rem;
  line-height: 1.6;
}

.today-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin-top: 22px;
}

.today-card {
  display: flex;
  gap: 16px;
  min-height: 205px;
  padding: 26px;
  background: var(--surface);
  border: 1px solid rgba(241, 221, 228, 0.92);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.today-card-icon {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 14px;
}

.today-card-icon svg {
  width: 21px;
  height: 21px;
}

.hormone-icon {
  color: var(--rose-deep);
  background: var(--rose-light);
}

.tips-icon {
  color: #a9713f;
  background: #f8eadb;
}

.reminder-icon {
  color: var(--blue);
  background: var(--blue-light);
}

.today-card-content {
  min-width: 0;
}

.today-card h2 {
  margin: 7px 0 0;
  font-family: "STSong", "SimSun", serif;
  font-size: 1.05rem;
}

.today-card p,
.tip-list {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.75;
}

.phase-badge {
  display: inline-block;
  margin-top: 14px;
  padding: 6px 9px;
  color: var(--rose-deep);
  font-size: 0.65rem;
  font-weight: 650;
  background: var(--rose-light);
  border-radius: 999px;
}

.tip-list {
  display: grid;
  gap: 5px;
  padding-left: 1.1rem;
}

.tip-list li::marker {
  color: var(--rose);
}

.reminder-card .eyebrow-text {
  color: var(--blue);
}

.reminder-list {
  display: grid;
  gap: 7px;
  margin-top: 9px;
}

.reminder-list p {
  margin: 0;
}

.reminder-item {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  color: var(--blue-deep);
  font-size: 0.7rem;
  background: var(--blue-light);
  border-radius: 10px;
}

.reminder-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reminder-item span {
  margin-left: auto;
  color: #6285aa;
  white-space: nowrap;
}

.inline-button {
  margin-top: 13px;
  padding: 0;
  color: var(--blue);
  font-size: 0.69rem;
  font-weight: 700;
  background: transparent;
  border: 0;
}

.inline-button:hover {
  color: var(--blue-deep);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  margin-top: 22px;
}

.main-column,
.side-column {
  display: grid;
  align-content: start;
  gap: 22px;
}

.panel {
  padding: 30px;
}

.calendar-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.event-shortcut {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  min-height: 46px;
  padding: 0 18px;
  color: var(--blue);
  font-size: 0.88rem;
  font-weight: 650;
  background: var(--blue-light);
  border: 0;
  border-radius: 10px;
}

.event-shortcut:hover {
  color: white;
  background: var(--blue);
}

.event-shortcut svg {
  width: 18px;
  height: 18px;
}

.icon-button,
.today-button,
.text-button,
.history-action {
  color: var(--muted);
  background: transparent;
  border: 0;
}

.icon-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
}

.icon-button:hover {
  color: var(--purple-deep);
  background: var(--purple-light);
}

.icon-button svg {
  width: 17px;
  height: 17px;
}

.today-button {
  padding: 7px 10px;
  font-size: 0.75rem;
  border-radius: 9px;
}

.today-button:hover {
  color: var(--purple-deep);
  background: var(--purple-light);
}

.calendar-prediction {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding: 14px 18px;
  background: linear-gradient(135deg, #fdf2f5, #fff7f9);
  border: 1px solid #f0d7e0;
  border-radius: 14px;
}

.prediction-main {
  display: flex;
  gap: 10px;
  align-items: baseline;
  min-width: 0;
}

.prediction-label {
  color: #2d1a23;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.prediction-date-inline {
  color: #1f0f16;
  font-family: -apple-system, "SF Pro Display", "SF Pro Text", "PingFang SC", "Helvetica Neue", system-ui, sans-serif;
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.prediction-stats {
  display: flex;
  gap: 18px;
  flex-shrink: 0;
  color: var(--muted);
  font-size: 0.68rem;
}

.prediction-stats strong {
  color: #1f0f16;
  font-family: -apple-system, "SF Pro Display", "SF Pro Text", "PingFang SC", "Helvetica Neue", system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays {
  margin-top: 14px;
  padding-bottom: 8px;
  color: var(--soft-muted);
  font-size: 0.78rem;
  font-weight: 650;
  text-align: center;
}

@media (max-width: 720px) {
  .calendar-prediction {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

.calendar-grid {
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
}

.calendar-day {
  position: relative;
  min-height: 76px;
  padding: 9px;
  color: var(--muted);
  font: inherit;
  text-align: left;
  background: rgba(255, 251, 252, 0.5);
  border: 0;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.calendar-day:hover {
  z-index: 1;
  background: #fff4f7;
  box-shadow: inset 0 0 0 1px rgba(214, 111, 139, 0.35);
}

.calendar-day:focus-visible {
  z-index: 2;
  outline: 2px solid var(--purple);
  outline-offset: -2px;
}

.calendar-day.outside {
  color: #c6bdc9;
  background: rgba(252, 246, 248, 0.65);
}

.calendar-day.today .day-number {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  color: white;
  background: var(--purple);
  border-radius: 50%;
}

.calendar-day.actual {
  background: linear-gradient(145deg, #fbe5eb, #fff4f6);
}

.calendar-day.predicted {
  background: repeating-linear-gradient(
    -45deg,
    rgba(214, 111, 139, 0.14),
    rgba(214, 111, 139, 0.14) 5px,
    rgba(214, 111, 139, 0.22) 5px,
    rgba(214, 111, 139, 0.22) 7px
  );
}

.calendar-day.fertile {
  background: var(--green-light);
}

.calendar-day.ovulation::after {
  position: absolute;
  right: 9px;
  bottom: 9px;
  width: 7px;
  height: 7px;
  content: "";
  background: var(--green);
  border: 2px solid white;
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--green);
}

.calendar-day.has-event {
  box-shadow: inset 0 -3px 0 rgba(57, 123, 191, 0.34);
}

.day-number {
  display: inline-grid;
  width: 29px;
  height: 29px;
  place-items: center;
  font-family: -apple-system, "SF Pro Display", "SF Pro Text", "PingFang SC", "Helvetica Neue", system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.day-label {
  display: block;
  margin-top: 12px;
  overflow: hidden;
  color: var(--rose-deep);
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day-labels {
  display: grid;
  gap: 2px;
  margin-top: 8px;
}

.day-labels .day-label {
  margin-top: 0;
}

.calendar-day.fertile .day-label {
  color: #4f806f;
}

.calendar-day.predicted .day-label {
  color: #8b3550;
  font-weight: 650;
}

.calendar-day.has-holiday {
  box-shadow: inset 0 -3px 0 rgba(220, 80, 60, 0.35);
}

.holiday-label {
  color: #c0392b;
  font-weight: 700;
  font-size: 0.7rem;
}

.calendar-day .day-label.event-label {
  width: 100%;
  padding: 0;
  color: var(--blue);
  font-weight: 700;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 3px;
  cursor: pointer;
}

.calendar-day .day-label.event-label:hover {
  color: white;
  background: var(--blue);
}

.calendar-day .day-label.event-label:focus-visible {
  color: white;
  background: var(--blue);
  outline: 2px solid rgba(57, 123, 191, 0.3);
  outline-offset: 1px;
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.74rem;
}

.calendar-legend span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.legend-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 3px;
}

.legend-dot.actual {
  background: var(--rose);
}

.legend-dot.predicted {
  background: transparent;
  border: 1px dashed var(--rose);
}

.legend-dot.fertile {
  background: var(--green-light);
  border: 1px solid #a6c7bb;
}

.legend-dot.ovulation {
  background: var(--green);
  border-radius: 50%;
}

.legend-dot.event {
  background: var(--blue);
}

.legend-dot.holiday {
  background: #c0392b;
  border-radius: 2px;
  height: 3px;
  width: 12px;
  align-self: center;
}

.history-list {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.empty-state {
  padding: 36px 20px;
  color: var(--muted);
  text-align: center;
  background: #fff9fb;
  border: 1px dashed #e7cbd4;
  border-radius: 16px;
}

.empty-state svg {
  width: 31px;
  height: 31px;
  color: #d28ba0;
}

.empty-state strong,
.empty-state span {
  display: block;
}

.empty-state strong {
  margin-top: 10px;
  color: var(--ink);
  font-family: "STSong", "SimSun", serif;
}

.empty-state span {
  margin-top: 7px;
  font-size: 0.75rem;
}

.history-item {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 15px;
  background: #fff9fb;
  border: 1px solid var(--border);
  border-radius: 16px;
}

.history-date-badge {
  display: grid;
  min-height: 56px;
  place-content: center;
  color: var(--rose-deep);
  text-align: center;
  background: var(--rose-light);
  border-radius: 13px;
}

.history-date-badge strong {
  font-family: -apple-system, "SF Pro Display", "SF Pro Text", "PingFang SC", "Helvetica Neue", system-ui, sans-serif;
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1;
}

.history-date-badge span {
  margin-top: 4px;
  font-size: 0.63rem;
}

.history-info strong {
  display: block;
  font-size: 0.83rem;
}

.history-info p {
  margin: 5px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-actions {
  display: flex;
  gap: 4px;
}

.history-action {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 9px;
}

.history-action:hover {
  color: var(--purple-deep);
  background: var(--purple-light);
}

.history-action.delete:hover {
  color: var(--rose-deep);
  background: var(--rose-light);
}

.history-action svg {
  width: 15px;
  height: 15px;
}

.text-button {
  padding: 5px;
  font-size: 0.72rem;
}

.record-panel form,
.settings-panel form {
  display: grid;
  gap: 19px;
  margin-top: 25px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

label,
legend {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 620;
}

label small,
legend small {
  color: var(--soft-muted);
  font-size: 0.64rem;
  font-weight: 400;
}

input[type="date"],
input[type="number"],
input[type="text"],
textarea {
  width: 100%;
  margin-top: 8px;
  color: var(--ink);
  background: #fff9fb;
  border: 1px solid var(--border);
  border-radius: 11px;
  outline: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

input[type="date"],
input[type="number"],
input[type="text"] {
  min-height: 43px;
  padding: 0 11px;
}

textarea {
  min-height: 80px;
  padding: 11px;
  line-height: 1.5;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: rgba(214, 111, 139, 0.7);
  box-shadow: 0 0 0 3px rgba(214, 111, 139, 0.12);
}

.font-size-setting {
  display: grid;
  gap: 10px;
  padding: 15px;
  background: #fff9fb;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.setting-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 620;
}

.setting-label-row output {
  color: var(--purple-deep);
  font-size: 0.68rem;
  font-weight: 700;
}

.font-slider-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 30px;
  gap: 10px;
  align-items: center;
}

.font-sample {
  color: var(--ink);
  font-family: Georgia, serif;
  line-height: 1;
  text-align: center;
}

.font-sample-small {
  font-size: 0.78rem;
}

.font-sample-large {
  font-size: 1.35rem;
  font-weight: 600;
}

.font-slider-wrap {
  position: relative;
  padding-bottom: 13px;
}

input[type="range"] {
  width: 100%;
  height: 26px;
  margin: 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
  outline: none;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 5px;
  background:
    linear-gradient(
      to right,
      var(--purple) 0,
      var(--purple) var(--range-progress, 30%),
      #eadde2 var(--range-progress, 30%),
      #eadde2 100%
    );
  border-radius: 999px;
}

input[type="range"]::-webkit-slider-thumb {
  width: 23px;
  height: 23px;
  margin-top: -9px;
  appearance: none;
  background: white;
  border: 2px solid var(--purple);
  border-radius: 50%;
  box-shadow: 0 3px 9px rgba(154, 67, 92, 0.2);
}

input[type="range"]::-moz-range-track {
  height: 5px;
  background: #eadde2;
  border-radius: 999px;
}

input[type="range"]::-moz-range-progress {
  height: 5px;
  background: var(--purple);
  border-radius: 999px;
}

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: white;
  border: 2px solid var(--purple);
  border-radius: 50%;
  box-shadow: 0 3px 9px rgba(154, 67, 92, 0.2);
}

input[type="range"]:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 4px rgba(214, 111, 139, 0.16);
}

.font-slider-ticks {
  position: absolute;
  right: 1px;
  bottom: 3px;
  left: 1px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.font-slider-ticks i {
  width: 2px;
  height: 4px;
  background: #d7c3ca;
  border-radius: 2px;
}

.font-preview {
  margin: 0;
  color: var(--soft-muted);
  font-size: 0.68rem;
  line-height: 1.5;
  text-align: center;
}

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

legend {
  margin-bottom: 9px;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 4px;
  background: #fbedf1;
  border-radius: 12px;
}

.segmented-control label,
.symptom-grid label {
  position: relative;
  cursor: pointer;
}

.segmented-control input,
.symptom-grid input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.segmented-control span {
  display: grid;
  min-height: 34px;
  place-items: center;
  border-radius: 9px;
}

.segmented-control input:checked + span {
  color: var(--purple-deep);
  background: white;
  box-shadow: 0 3px 10px rgba(112, 52, 70, 0.08);
}

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

.symptom-grid span {
  display: grid;
  min-height: 36px;
  place-items: center;
  color: var(--muted);
  background: #fff9fb;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.symptom-grid input:checked + span {
  color: var(--purple-deep);
  background: var(--purple-light);
  border-color: #edb8c7;
}

.segmented-control input:focus-visible + span,
.symptom-grid input:focus-visible + span {
  outline: 2px solid var(--purple);
  outline-offset: 2px;
}

.form-error {
  display: none;
  margin: -7px 0 0;
  padding: 9px 11px;
  color: #a13c57;
  font-size: 0.7rem;
  background: var(--rose-light);
  border-radius: 9px;
}

.form-error.visible {
  display: block;
}

.submit-button {
  width: 100%;
  color: white;
  background: linear-gradient(135deg, #df7e99, #bd526f);
}

.event-panel {
  border-color: #dceaf7;
}

.event-eyebrow {
  color: var(--blue);
}

.event-panel form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.field-hint {
  margin: -6px 0 0;
  color: var(--soft-muted);
  font-size: 0.65rem;
  line-height: 1.55;
}

.event-submit-button {
  min-height: 43px;
  color: white;
  font-weight: 700;
  background: linear-gradient(135deg, #5794d1, #3374b7);
  border: 0;
  border-radius: 11px;
  box-shadow: 0 8px 18px rgba(48, 112, 177, 0.18);
}

.event-submit-button:hover {
  background: linear-gradient(135deg, #4b89c7, #2868a8);
}

.event-list {
  display: grid;
  gap: 9px;
  margin-top: 20px;
}

.event-empty {
  padding: 17px;
  color: var(--soft-muted);
  font-size: 0.7rem;
  text-align: center;
  background: #f7fbff;
  border: 1px dashed #c9dff3;
  border-radius: 12px;
}

.event-list-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 11px;
  background: #f7fbff;
  border: 1px solid #dceaf7;
  border-radius: 13px;
}

.event-date-badge {
  display: grid;
  height: 42px;
  place-content: center;
  color: var(--blue-deep);
  text-align: center;
  background: var(--blue-light);
  border-radius: 10px;
}

.event-date-badge strong {
  font-family: -apple-system, "SF Pro Display", "SF Pro Text", "PingFang SC", "Helvetica Neue", system-ui, sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1;
}

.event-date-badge span {
  margin-top: 2px;
  font-size: 0.55rem;
}

.event-list-info {
  min-width: 0;
}

.event-list-info strong,
.event-list-info span {
  display: block;
}

.event-list-info strong {
  overflow: hidden;
  color: var(--blue-deep);
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-list-info span {
  margin-top: 4px;
  color: var(--soft-muted);
  font-size: 0.62rem;
}

.event-list-actions {
  display: flex;
  gap: 2px;
}

.event-action {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  color: #6f8ba8;
  background: transparent;
  border: 0;
  border-radius: 8px;
}

.event-action:hover {
  color: var(--blue-deep);
  background: var(--blue-light);
}

.event-action.delete:hover {
  color: var(--rose-deep);
  background: var(--rose-light);
}

.event-action svg {
  width: 14px;
  height: 14px;
}

.insight-panel {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  color: #5d3c48;
  background: linear-gradient(140deg, #fff8fa, #ffedf2);
  border-color: #f2d7e0;
}

.insight-icon {
  display: grid;
  width: 43px;
  height: 43px;
  flex: 0 0 auto;
  place-items: center;
  color: #c65e7a;
  background: #f8dce4;
  border-radius: 13px;
}

.insight-icon svg {
  width: 21px;
  height: 21px;
}

.insight-panel .eyebrow-text {
  color: #bd5874;
}

.insight-panel h2 {
  font-size: 1.02rem;
}

.insight-panel p {
  margin: 9px 0 0;
  color: #8d6d78;
  font-size: 0.73rem;
  line-height: 1.7;
}

.settings-panel {
  padding: 0;
  overflow: hidden;
}

.settings-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 25px;
  cursor: pointer;
  list-style: none;
}

.settings-panel summary::-webkit-details-marker {
  display: none;
}

.settings-panel summary strong {
  display: block;
  margin-top: 4px;
  font-family: "STSong", "SimSun", serif;
  font-size: 1rem;
}

.settings-panel summary svg {
  width: 18px;
  height: 18px;
  color: var(--muted);
  transition: transform 180ms ease;
}

.settings-panel[open] summary svg {
  transform: rotate(180deg);
}

.settings-panel form {
  margin: 0;
  padding: 0 25px 25px;
}

.number-input {
  position: relative;
  display: block;
}

.number-input input {
  padding-right: 32px;
}

.number-input small {
  position: absolute;
  right: 11px;
  bottom: 14px;
}

.secondary-button {
  min-height: 40px;
  color: white;
  background: var(--purple);
  border-radius: 11px;
  box-shadow: none;
}

.disclaimer {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 22px;
  padding: 18px 22px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--border);
  border-radius: 15px;
}

.disclaimer svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--purple);
}

.disclaimer p {
  margin: 0;
  font-size: 0.68rem;
  line-height: 1.7;
}

footer {
  display: flex;
  justify-content: space-between;
  padding: 30px 4px 38px;
  color: var(--soft-muted);
  font-size: 0.65rem;
}

.event-dialog {
  width: min(560px, calc(100% - 32px));
  max-height: min(78vh, 660px);
  padding: 0;
  color: var(--ink);
  background: #fffafb;
  border: 1px solid #eadce2;
  border-radius: 22px;
  box-shadow: 0 26px 80px rgba(74, 42, 55, 0.24);
}

.event-dialog::backdrop {
  background: rgba(61, 39, 48, 0.38);
  backdrop-filter: blur(3px);
}

.event-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 24px 25px 18px;
  border-bottom: 1px solid var(--border);
}

.event-dialog-header h2 {
  margin: 6px 0 0;
  font-family: "STSong", "SimSun", serif;
  font-size: 1.2rem;
}

.dialog-close-button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: var(--muted);
  background: #f8eef1;
  border: 0;
  border-radius: 50%;
}

.dialog-close-button:hover {
  color: white;
  background: var(--rose);
}

.dialog-close-button svg {
  width: 17px;
  height: 17px;
}

.event-dialog-list {
  display: grid;
  gap: 12px;
  max-height: calc(78vh - 90px);
  padding: 20px 25px 25px;
  overflow-y: auto;
}

.event-dialog-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 15px;
  background: #f4f9ff;
  border: 1px solid #d7e7f6;
  border-radius: 15px;
}

.dialog-event-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--blue);
  background: var(--blue-light);
  border-radius: 12px;
}

.dialog-event-icon svg {
  width: 19px;
  height: 19px;
}

.dialog-event-copy {
  min-width: 0;
}

.dialog-event-copy strong,
.dialog-event-copy span {
  display: block;
}

.dialog-event-copy strong {
  overflow: hidden;
  color: var(--blue-deep);
  font-size: 0.88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dialog-event-copy span {
  margin-top: 5px;
  color: var(--soft-muted);
  font-size: 0.66rem;
  line-height: 1.45;
}

.dialog-edit-button {
  padding: 8px 10px;
  color: var(--blue);
  font-size: 0.68rem;
  font-weight: 700;
  background: white;
  border: 1px solid #c9dff3;
  border-radius: 9px;
}

.dialog-edit-button:hover {
  color: white;
  background: var(--blue);
  border-color: var(--blue);
}

.auth-dialog,
.migration-dialog {
  width: min(460px, calc(100% - 28px));
  padding: 0;
  color: var(--ink);
  background: #fffafb;
  border: 1px solid #eadce2;
  border-radius: 24px;
  box-shadow: 0 28px 90px rgba(74, 42, 55, 0.28);
}

.auth-dialog::backdrop,
.migration-dialog::backdrop {
  background: rgba(58, 36, 45, 0.48);
  backdrop-filter: blur(5px);
}

.auth-dialog-shell {
  position: relative;
  padding: 30px;
}

.auth-close {
  position: absolute;
  top: 18px;
  right: 18px;
}

.auth-brand {
  display: flex;
  gap: 13px;
  align-items: center;
  padding-right: 40px;
}

.auth-brand .brand-mark {
  width: 45px;
  height: 45px;
  border-radius: 14px;
}

.auth-brand .brand-mark svg {
  width: 29px;
  height: 29px;
}

.auth-brand h2 {
  margin: 4px 0 0;
  font-family: "STSong", "SimSun", serif;
  font-size: 1.35rem;
  font-weight: 700;
}

.auth-description {
  margin: 22px 0 0;
  color: #8d737f;
  font-size: 0.76rem;
  line-height: 1.75;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-top: 22px;
  padding: 5px;
  background: #f8edf1;
  border-radius: 14px;
}

.auth-tabs button {
  min-height: 40px;
  color: #a88893;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: transparent;
  border: 0;
  border-radius: 10px;
  transition:
    color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.auth-tabs button:hover {
  color: var(--purple-deep);
}

.auth-tabs button.active {
  color: var(--purple-deep);
  background: white;
  box-shadow: 0 3px 12px rgba(112, 52, 70, 0.1);
}

#auth-form {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

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

.auth-field label {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 650;
}

.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-icon {
  position: absolute;
  left: 14px;
  z-index: 1;
  width: 18px;
  height: 18px;
  color: #c9a8b4;
  pointer-events: none;
  transition: color 200ms ease;
}

.auth-input-wrap:focus-within .auth-input-icon {
  color: var(--purple);
}

#auth-form input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px 0 42px;
  color: var(--ink);
  font-size: 0.88rem;
  background: #fff;
  border: 1.5px solid #e8d5dd;
  border-radius: 13px;
  outline: none;
  transition:
    border-color 200ms ease,
    box-shadow 200ms ease,
    background 200ms ease;
}

#auth-form input::placeholder {
  color: #c9b8bf;
  font-size: 0.82rem;
}

#auth-form input:hover {
  border-color: #d9bcc7;
  background: #fffcfd;
}

#auth-form input:focus {
  border-color: var(--purple);
  background: #fff;
  box-shadow:
    0 0 0 4px rgba(214, 111, 139, 0.1),
    0 2px 8px rgba(177, 69, 101, 0.06);
}

.auth-message {
  display: none;
  margin: -2px 0 0;
  padding: 10px 13px;
  color: #a13c57;
  font-size: 0.72rem;
  line-height: 1.55;
  background: var(--rose-light);
  border-radius: 10px;
}

.auth-message.visible {
  display: block;
}

.auth-message.success {
  color: #397563;
  background: var(--green-light);
}

.auth-submit-button {
  min-height: 48px;
  padding: 0 17px;
  color: white;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: linear-gradient(135deg, #df7e99, #bd526f);
  border: 0;
  border-radius: 13px;
  box-shadow: 0 8px 22px rgba(177, 69, 101, 0.2);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease;
}

.auth-submit-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(177, 69, 101, 0.26);
}

.auth-submit-button:active {
  transform: translateY(0);
  box-shadow: 0 6px 14px rgba(177, 69, 101, 0.16);
}

.auth-submit-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.forgot-password-button,
.logout-button,
.secondary-choice-button {
  min-height: 38px;
  color: #a88893;
  font-size: 0.72rem;
  font-weight: 600;
  background: transparent;
  border: 0;
  border-radius: 10px;
  transition: color 180ms ease;
}

.forgot-password-button:hover {
  color: var(--purple-deep);
}

.account-view {
  display: grid;
  justify-items: center;
  margin-top: 28px;
  text-align: center;
}

.account-avatar {
  display: grid;
  width: 68px;
  height: 68px;
  place-items: center;
  color: var(--purple-deep);
  background: var(--purple-light);
  border-radius: 50%;
}

.account-avatar svg {
  width: 30px;
  height: 30px;
}

.account-view > strong {
  max-width: 100%;
  margin-top: 14px;
  overflow: hidden;
  font-size: 0.9rem;
  text-overflow: ellipsis;
}

.account-view > span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.68rem;
}

.account-view .auth-submit-button {
  width: 100%;
  margin-top: 24px;
}

.logout-button {
  width: 100%;
  margin-top: 5px;
  color: var(--rose-deep);
}

.migration-dialog {
  padding: 30px;
  text-align: center;
}

.settings-dialog {
  width: min(480px, calc(100% - 28px));
  max-height: min(85vh, 700px);
  padding: 0;
  color: var(--ink);
  background: #fffafb;
  border: 1px solid #eadce2;
  border-radius: 24px;
  box-shadow: 0 28px 90px rgba(74, 42, 55, 0.28);
  overflow: visible;
}

.settings-dialog::backdrop {
  background: rgba(58, 36, 45, 0.48);
  backdrop-filter: blur(5px);
}

.settings-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 26px 28px 18px;
  border-bottom: 1px solid var(--border);
}

.settings-dialog-header h2 {
  margin: 6px 0 0;
  font-family: "STSong", "SimSun", serif;
  font-size: 1.25rem;
}

.settings-dialog form {
  display: grid;
  gap: 19px;
  padding: 24px 28px 28px;
  overflow-y: auto;
  max-height: calc(85vh - 110px);
}

@media (max-width: 430px) {
  .settings-dialog-header {
    padding: 20px 18px 15px;
  }

  .settings-dialog form {
    padding: 18px 18px 22px;
  }
}

.fab-menu {
  position: fixed;
  right: 24px;
  bottom: 28px;
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 13px;
}

.fab-button {
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  color: white;
  border: 0;
  border-radius: 50%;
  box-shadow: 0 8px 28px rgba(177, 69, 101, 0.36);
  transition:
    transform 200ms ease,
    box-shadow 200ms ease;
}

.fab-main {
  background: linear-gradient(135deg, #df7e99, #bd526f);
}

.fab-main:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 14px 36px rgba(177, 69, 101, 0.44);
}

.fab-main:active {
  transform: translateY(0) scale(0.97);
}

.fab-main svg {
  width: 26px;
  height: 26px;
}

.fab-menu.expanded .fab-main {
  background: var(--muted);
  transform: rotate(45deg);
}

.fab-menu.expanded .fab-main:hover {
  background: var(--rose);
}

.fab-options {
  display: flex;
  flex-direction: column;
  gap: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition:
    opacity 200ms ease,
    transform 200ms ease;
}

.fab-menu.expanded .fab-options {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.fab-option {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  min-height: 44px;
  padding: 0 17px;
  color: white;
  font-size: 0.78rem;
  font-weight: 650;
  border: 0;
  border-radius: 22px;
  box-shadow: 0 6px 20px rgba(74, 42, 55, 0.2);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease;
}

.fab-option:hover {
  transform: translateX(-2px);
  box-shadow: 0 9px 26px rgba(74, 42, 55, 0.28);
}

.fab-option svg {
  width: 20px;
  height: 20px;
}

.fab-option-period {
  background: linear-gradient(135deg, #df7e99, #bd526f);
}

.fab-option-event {
  background: linear-gradient(135deg, #5794d1, #3374b7);
}

.fab-backdrop {
  position: fixed;
  inset: 0;
  z-index: 14;
  background: rgba(58, 36, 45, 0.32);
  backdrop-filter: blur(2px);
}

.record-dialog {
  width: min(520px, calc(100% - 28px));
  max-height: min(90vh, 720px);
  padding: 0;
  color: var(--ink);
  background: #fffafb;
  border: 1px solid #eadce2;
  border-radius: 24px;
  box-shadow: 0 28px 90px rgba(74, 42, 55, 0.28);
  overflow: visible;
}

.record-dialog::backdrop {
  background: rgba(58, 36, 45, 0.48);
  backdrop-filter: blur(5px);
}

.record-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 26px 28px 18px;
  border-bottom: 1px solid var(--border);
}

.record-dialog-header h2 {
  margin: 6px 0 0;
  font-family: "STSong", "SimSun", serif;
  font-size: 1.25rem;
}

.record-dialog-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.record-dialog form {
  display: grid;
  gap: 19px;
  padding: 24px 28px 28px;
  overflow-y: auto;
  max-height: calc(90vh - 120px);
}

#event-dialog-form .event-list {
  padding: 0 28px 24px;
}

#history-dialog .history-list {
  padding: 20px 28px 28px;
  max-height: calc(90vh - 130px);
  overflow-y: auto;
}

@media (max-width: 430px) {
  .fab-menu {
    right: 16px;
    bottom: 20px;
  }

  .fab-button {
    width: 50px;
    height: 50px;
  }

  .fab-main svg {
    width: 24px;
    height: 24px;
  }

  .record-dialog-header {
    padding: 20px 18px 15px;
  }

  .record-dialog form {
    padding: 18px 18px 22px;
  }

  #event-dialog-form .event-list {
    padding: 0 18px 22px;
  }

  #history-dialog .history-list {
    padding: 16px 18px 22px;
  }
}

.migration-icon {
  display: grid;
  width: 58px;
  height: 58px;
  margin: 0 auto;
  place-items: center;
  color: var(--blue);
  background: var(--blue-light);
  border-radius: 18px;
}

.migration-icon svg {
  width: 27px;
  height: 27px;
}

.migration-dialog h2 {
  margin: 17px 0 0;
  font-family: "STSong", "SimSun", serif;
  font-size: 1.3rem;
}

.migration-dialog > p {
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.7;
}

.migration-summary {
  margin-top: 17px;
  padding: 12px;
  color: var(--blue-deep);
  font-size: 0.69rem;
  background: #f2f8fe;
  border: 1px solid #d7e7f6;
  border-radius: 11px;
}

.migration-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 21px;
}

.secondary-choice-button {
  min-height: 44px;
  padding: 0 12px;
  background: #f7eef1;
  border-radius: 11px;
}

body.auth-locked main,
body.auth-locked footer,
body.auth-locked .cloud-setup-banner {
  pointer-events: none;
  user-select: none;
  filter: blur(5px);
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  padding: 12px 17px;
  color: white;
  font-size: 0.76rem;
  background: #8d3f57;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(95, 35, 53, 0.22);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.hidden {
  display: none !important;
}

@media (max-width: 980px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

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

  .reminder-card {
    grid-column: 1 / -1;
  }

  .stats-card {
    display: grid;
    grid-template-columns: 0.7fr 1.3fr;
    column-gap: 25px;
  }

  .stat-list {
    grid-template-columns: repeat(3, 1fr);
    margin-top: 0;
  }

  .stats-note {
    grid-column: 2;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 24px, 620px);
  }

  .topbar {
    min-height: 78px;
  }

  .privacy-pill {
    padding: 8px;
  }

  .privacy-pill span {
    display: none;
  }

  .sync-status {
    display: none;
  }

  .account-button {
    max-width: 120px;
    padding: 0 10px;
  }

  .cloud-setup-banner {
    align-items: flex-start;
  }

  .cloud-setup-banner > span {
    display: none;
  }

  .prediction-card {
    grid-template-columns: 1fr;
    min-height: 405px;
    padding: 32px 28px;
  }

  .cycle-visual {
    position: absolute;
    right: -60px;
    bottom: -90px;
    opacity: 0.55;
  }

  .prediction-copy > p {
    max-width: 75%;
  }

  .stats-card {
    display: block;
    padding: 25px;
  }

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

  .reminder-card {
    grid-column: auto;
  }

  .stat-list {
    grid-template-columns: 1fr;
    margin-top: 20px;
  }

  .panel {
    padding: 23px 18px;
  }

  .calendar-day {
    min-height: 64px;
    padding: 5px;
  }

  .day-label {
    margin-top: 5px;
    font-size: 0.66rem;
  }

  .calendar-day.ovulation::after {
    right: 6px;
    bottom: 6px;
  }

  .calendar-legend {
    gap: 11px;
  }

  footer {
    display: grid;
    gap: 6px;
    text-align: center;
  }
}

@media (max-width: 430px) {
  .brand small {
    display: none;
  }

  .topbar {
    gap: 8px;
  }

  .brand {
    gap: 8px;
  }

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

  .account-button {
    width: 38px;
    padding: 0;
    justify-content: center;
  }

  .account-button span {
    display: none;
  }

  .prediction-date {
    display: block;
  }

  .date-unit {
    display: block;
    margin-top: 4px;
    font-size: 1.1rem;
  }

  .prediction-copy > p {
    max-width: 100%;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .calendar-panel {
    padding-right: 10px;
    padding-left: 10px;
  }

  .calendar-panel .panel-header {
    padding: 0 8px;
  }

  .calendar-day {
    min-height: 51px;
  }

  .calendar-day .day-label {
    display: none;
  }

  .calendar-day .day-label.event-label,
  .calendar-day .day-label.holiday-label {
    display: block;
    max-width: 100%;
    font-size: 0.64rem;
  }

  .calendar-day .day-labels {
    margin-top: 2px;
  }

  .calendar-actions {
    gap: 1px;
  }

  .event-shortcut {
    width: 38px;
    padding: 0;
    justify-content: center;
    font-size: 0;
  }

  .history-item {
    grid-template-columns: 50px minmax(0, 1fr);
  }

  .history-actions {
    grid-column: 2;
  }

  .event-dialog-header {
    padding: 20px 18px 15px;
  }

  .event-dialog-list {
    padding: 16px 18px 20px;
  }

  .event-dialog-item {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .dialog-edit-button {
    grid-column: 2;
    justify-self: start;
  }

  .auth-dialog-shell,
  .migration-dialog {
    padding: 24px 20px;
  }

  .migration-actions {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
