:root {
  --rose-gold: #cc2f6a;
  --rose-deep: #a81957;
  --blush: #f8c4d7;
  --mist: #fff3f8;
  --ink: #3f1730;
  --ink-soft: #6f2e4f;
  --glass: rgba(255, 255, 255, 0.44);
  --glass-border: rgba(255, 255, 255, 0.65);
  --bg-start: #fff5fa;
  --bg-mid: #fbe0eb;
  --bg-end: #f7ccd9;
  --orb-a: rgba(204, 47, 106, 0.45);
  --orb-b: rgba(248, 196, 215, 0.9);
  --orb-c: rgba(248, 196, 215, 0.9);
  --orb-d: rgba(204, 47, 106, 0.3);
}

* {
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: "Poppins", "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 20% 10%, var(--bg-start) 0%, var(--bg-mid) 42%, var(--bg-end) 100%);
  min-height: 100vh;
}

body[data-theme="rose"] {
  --rose-gold: #cc2f6a;
  --rose-deep: #a81957;
  --blush: #f8c4d7;
  --ink: #3f1730;
  --ink-soft: #6f2e4f;
  --bg-start: #fff5fa;
  --bg-mid: #fbe0eb;
  --bg-end: #f7ccd9;
  --orb-a: rgba(204, 47, 106, 0.45);
  --orb-b: rgba(248, 196, 215, 0.9);
  --orb-c: rgba(248, 196, 215, 0.9);
  --orb-d: rgba(204, 47, 106, 0.3);
}

body[data-theme="blush"] {
  --rose-gold: #d94f8a;
  --rose-deep: #b83473;
  --blush: #ffdbe9;
  --ink: #421a34;
  --ink-soft: #7b3f63;
  --bg-start: #fff7fb;
  --bg-mid: #ffe7f1;
  --bg-end: #f6d2e2;
  --orb-a: rgba(217, 79, 138, 0.4);
  --orb-b: rgba(255, 219, 233, 0.92);
  --orb-c: rgba(255, 236, 244, 0.9);
  --orb-d: rgba(184, 52, 115, 0.28);
}

body[data-theme="lavender"] {
  --rose-gold: #a95fb5;
  --rose-deep: #8a4299;
  --blush: #edd9ff;
  --ink: #322047;
  --ink-soft: #5f4378;
  --bg-start: #faf5ff;
  --bg-mid: #efe3ff;
  --bg-end: #e6d2f7;
  --orb-a: rgba(169, 95, 181, 0.42);
  --orb-b: rgba(237, 217, 255, 0.92);
  --orb-c: rgba(237, 217, 255, 0.9);
  --orb-d: rgba(138, 66, 153, 0.28);
}

body[data-theme="peach"] {
  --rose-gold: #e29578;
  --rose-deep: #cc6f55;
  --blush: #ffd9cc;
  --ink: #40231b;
  --ink-soft: #7a4b3e;
  --bg-start: #fff8f4;
  --bg-mid: #ffe8de;
  --bg-end: #f8d6c8;
  --orb-a: rgba(226, 149, 120, 0.42);
  --orb-b: rgba(255, 217, 204, 0.92);
  --orb-c: rgba(255, 230, 221, 0.9);
  --orb-d: rgba(204, 111, 85, 0.26);
}

.site-nav {
  position: fixed;
  left: 50%;
  bottom: 0.75rem;
  transform: translateX(-50%);
  width: 94%;
  max-width: 42rem;
  z-index: 20;
}

.bg-orbs::before,
.bg-orbs::after {
  content: "";
  position: fixed;
  border-radius: 9999px;
  filter: blur(10px);
  z-index: -1;
}

.bg-orbs::before {
  width: 220px;
  height: 220px;
  top: -40px;
  right: -40px;
  background: linear-gradient(120deg, var(--orb-a), var(--orb-b));
}

.bg-orbs::after {
  width: 180px;
  height: 180px;
  bottom: 90px;
  left: -30px;
  background: linear-gradient(120deg, var(--orb-c), var(--orb-d));
}

.glass-card {
  background: var(--glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 30px rgba(165, 103, 118, 0.18);
}

.pill-btn {
  border-radius: 9999px;
  background: linear-gradient(120deg, var(--rose-gold), var(--rose-deep));
  color: #fff;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 8px 20px rgba(204, 47, 106, 0.35);
}

.pill-btn:active,
.nav-chip:active {
  transform: scale(0.97);
}

.pill-btn:hover {
  box-shadow: 0 10px 25px rgba(168, 25, 87, 0.42);
}

.nav-chip {
  border-radius: 9999px;
  padding: 0.55rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.75);
}

.nav-chip.active {
  color: #fff;
  background: linear-gradient(120deg, var(--rose-gold), var(--rose-deep));
}

.theme-select {
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.6);
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.52rem 0.75rem;
  min-width: 6rem;
}

.profile-icon-btn {
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.6);
  color: var(--ink-soft);
  width: 2.2rem;
  height: 2.2rem;
  font-size: 1rem;
  display: grid;
  place-items: center;
}

.profile-icon-btn:hover,
.profile-icon-btn[aria-expanded="true"] {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(120deg, var(--rose-gold), var(--rose-deep));
}

.profile-panel {
  scroll-margin-top: 6rem;
}

.profile-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.profile-close-btn {
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink-soft);
  font-size: 1.25rem;
  line-height: 1;
}

.profile-avatar-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.profile-avatar-preview {
  width: 4rem;
  height: 4rem;
  border-radius: 9999px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  object-fit: cover;
  background: linear-gradient(120deg, #f6d6e4, #f0bdd3);
  flex-shrink: 0;
}

.theme-icon-btn {
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink-soft);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.profile-theme-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
}

.profile-theme-swatch {
  width: 100%;
  min-height: 2rem;
  border-radius: 9999px;
  border: 2px solid rgba(255, 255, 255, 0.75);
}

.profile-theme-swatch.active {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink-soft);
}

.theme-rose {
  background: linear-gradient(120deg, #cc2f6a, #a81957);
}

.theme-blush {
  background: linear-gradient(120deg, #d94f8a, #b83473);
}

.theme-lavender {
  background: linear-gradient(120deg, #a95fb5, #8a4299);
}

.theme-peach {
  background: linear-gradient(120deg, #e29578, #cc6f55);
}

.high-contrast {
  color: #2c1022;
}

.brand-logo {
  height: 120px;
  width: auto;
  object-fit: contain;
}

@media (min-width: 1024px) {
  .brand-logo {
    height: 144px;
  }
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-logo {
  height: 48px;
  width: auto;
  object-fit: contain;
  background: transparent;
  margin-right: 0.25rem;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-links::-webkit-scrollbar {
  display: none;
}

.nav-links li {
  flex: 0 0 auto;
}

.holo-ring {
  width: 170px;
  height: 170px;
  border-radius: 9999px;
  position: relative;
  margin: 0 auto;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.9) 40%, transparent 42%),
    conic-gradient(from 60deg, var(--rose-gold), var(--blush), #ffffff, var(--rose-gold));
  animation: spin 7s linear infinite;
  box-shadow: 0 0 25px rgba(204, 47, 106, 0.28);
}

.holo-ring::after {
  content: "";
  position: absolute;
  width: 130px;
  height: 130px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(6px);
}

.holo-ring-content {
  position: relative;
  z-index: 2;
  text-align: center;
}

.list-pill {
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.sti-item {
  border-radius: 1rem;
}

.sti-item summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.sti-item summary::-webkit-details-marker {
  display: none;
}

.sti-item summary::after {
  content: "+";
  font-weight: 700;
  color: #6f2e4f;
}

.sti-item[open] summary::after {
  content: "-";
}

.accordion-masonry {
  display: grid;
  gap: 0.5rem;
}

@media (min-width: 768px) {
  .accordion-masonry {
    display: block;
    column-count: 2;
    column-gap: 0.5rem;
  }

  .accordion-masonry .sti-item {
    display: inline-block;
    width: 100%;
    break-inside: avoid;
    margin-bottom: 0.5rem;
  }
}

.phase-chip {
  border: none;
  width: 100%;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.phase-chip.active {
  color: #fff;
  background: linear-gradient(120deg, var(--rose-gold), var(--rose-deep));
  box-shadow: 0 8px 18px rgba(168, 25, 87, 0.35);
  border-color: transparent;
}

.mini-month {
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.55);
  padding: 0.65rem;
}

.mini-month-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #5a2440;
  margin-bottom: 0.35rem;
}

.mini-dow-grid,
.mini-day-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.2rem;
}

.mini-dow {
  text-align: center;
  font-size: 0.62rem;
  color: #7a4a60;
}

.mini-day {
  border-radius: 0.35rem;
  text-align: center;
  font-size: 0.7rem;
  min-height: 2rem;
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.08rem;
  color: #4b2337;
}

.mini-cycle-num {
  font-size: 0.52rem;
  line-height: 1;
  opacity: 0.8;
}

.mini-date-num {
  font-size: 0.76rem;
  line-height: 1;
}

.mini-day.empty {
  opacity: 0;
}

.mini-day.today {
  outline: 1.5px dashed #cc2f6a;
  outline-offset: -1px;
}

.mini-day.selected {
  box-shadow: inset 0 0 0 2px #2c1022;
}

.mini-day.period-start {
  background: #c7d9ff;
  color: #1f3a70;
  font-weight: 700;
}

.mini-day.fertile {
  background: #ffe3b3;
  color: #6a3d00;
  font-weight: 700;
}

.mini-day.ovulation {
  background: #e83e8c;
  color: #fff;
  font-weight: 700;
}

.mini-day.next-period {
  background: #c7d9ff;
  color: #1f3a70;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px #5d73a8;
}

.chance-pill {
  display: inline-block;
  border-radius: 9999px;
  padding: 0.15rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 700;
}

.chance-pill.low {
  background: #d8e8ff;
  color: #16407a;
}

.chance-pill.medium {
  background: #ffe3b3;
  color: #6a3d00;
}

.chance-pill.high {
  background: #ffd1ea;
  color: #7a1748;
}

.sanctuary-tab {
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.55);
  color: #5a2440;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.5rem 0.9rem;
}

.sanctuary-tab.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(120deg, var(--rose-gold), var(--rose-deep));
  box-shadow: 0 8px 18px rgba(168, 25, 87, 0.28);
}

.fade-in {
  opacity: 0;
  transform: translateY(12px);
  animation: fadeUp 0.55s ease forwards;
}

.fade-in:nth-child(2) {
  animation-delay: 0.08s;
}

.fade-in:nth-child(3) {
  animation-delay: 0.16s;
}

@keyframes spin {
  from {
    transform: rotate(0);
  }
  to {
    transform: rotate(360deg);
  }
}

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

@media (min-width: 1024px) {
  .site-main {
    padding-top: 0;
  }

  .site-nav {
    position: sticky;
    top: 1rem;
    left: auto;
    margin: 0 auto 1rem auto;
    bottom: auto;
    transform: none;
    width: min(1400px, calc(100% - 2rem));
    max-width: none;
  }

  .nav-logo {
    height: 64px;
  }

  .nav-links {
    justify-content: space-evenly;
    overflow-x: visible;
    gap: 0.35rem;
  }

  .nav-chip {
    padding: 0.5rem 0.75rem;
    font-size: 0.78rem;
  }

  .bg-orbs::before {
    width: 320px;
    height: 320px;
    top: -80px;
    right: -60px;
  }

  .bg-orbs::after {
    width: 280px;
    height: 280px;
    left: -70px;
    bottom: 40px;
  }
}

@media (max-width: 640px) {
  .profile-avatar-row {
    flex-direction: column;
    align-items: flex-start;
  }
}
