:root {
  --primary: #FF4D6D;
  --primary-hover: #ff2a55;
  --bg-color: #f8fafc;
  --surface-color: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  
  --period-color: #ffe4e6;
  --period-text: #e11d48;
  --ovulation-color: #dbeafe;
  --ovulation-text: #2563eb;
  --fertile-color: #dcfce7;
  --fertile-text: #16a34a;

  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --border-radius: 12px;
  --spacing: 1.5rem;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

[data-theme="dark"] {
  --primary: #fb7185;
  --primary-hover: #f43f5e;
  --bg-color: #0f172a;
  --surface-color: #1e293b;
  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --border-color: #334155;

  --period-color: #4c1d95; /* Subtle dark red mapping could be: #4c1d25 */
  --period-color: rgba(225, 29, 72, 0.2);
  --period-text: #fda4af;
  --ovulation-color: rgba(37, 99, 235, 0.2);
  --ovulation-text: #93c5fd;
  --fertile-color: rgba(22, 163, 74, 0.2);
  --fertile-text: #86efac;
  
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.5), 0 2px 4px -2px rgb(0 0 0 / 0.5);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  overflow-x: hidden;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  transition: background-color 0.3s, color 0.3s;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Modern Header */
header.modern-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3rem;
  padding: 0.5rem 0;
}

.header-logo a {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  text-decoration: none;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

.header-nav {
  display: none;
}

@media (min-width: 768px) {
  .header-nav {
    display: flex;
    align-items: center;
    background-color: var(--surface-color);
    padding: 0.6rem 2rem;
    border-radius: 9999px;
    gap: 1.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
  }
}

[data-theme="dark"] .header-nav {
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.header-nav a {
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s;
}

.header-nav a:hover {
  color: var(--primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-gradient {
  background: linear-gradient(135deg, #ff8da1, #ff4d6d);
  color: white;
  padding: 0.5rem 1.25rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-gradient:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(255, 77, 109, 0.3);
  color: white;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.5rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  transition: all 0.2s;
}
.theme-toggle:hover {
  background-color: var(--border-color);
}

.calculator-card {
  background-color: var(--surface-color);
  border-radius: var(--border-radius);
  padding: var(--spacing);
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
  transition: background-color 0.3s, box-shadow 0.3s;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-weight: 600;
  font-size: 0.95rem;
}

.form-group input {
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 77, 109, 0.2);
}

.btn {
  background: linear-gradient(135deg, #ff8da1, #ff4d6d);
  color: white;
  border: none;
  padding: 1rem 1.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  width: 100%;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(255, 77, 109, 0.3);
}
.btn:active {
  transform: translateY(1px);
}

.btn-secondary {
  background: var(--bg-color);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  margin-top: 1rem;
  box-shadow: none;
}
.btn-secondary:hover {
  background: var(--border-color);
  box-shadow: none;
  transform: translateY(0);
}

/* Results Display */
.results-section {
  display: none;
  margin-top: 2rem;
}

.results-section.active {
  display: block;
  animation: fadeIn 0.4s ease-out;
}

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

.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.summary-card {
  padding: 1rem;
  border-radius: var(--border-radius);
  text-align: center;
}

.summary-card.period {
  background-color: var(--period-color);
  color: var(--period-text);
}
.summary-card.ovulation {
  background-color: var(--ovulation-color);
  color: var(--ovulation-text);
}
.summary-card.fertile {
  background-color: var(--fertile-color);
  color: var(--fertile-text);
}

.summary-card h3 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
  opacity: 0.9;
}
.summary-card p {
  font-size: 1.25rem;
  font-weight: 700;
}

/* Calendar styling */
.calendar-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.month-view {
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1rem;
}

.month-header {
  text-align: center;
  font-weight: 700;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

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

.day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  border-radius: 50%;
  margin: 2px;
  cursor: default;
}

.day.empty {
  visibility: hidden;
}

.day.period {
  background-color: var(--period-color);
  color: var(--period-text);
  font-weight: 600;
}
.day.ovulation {
  background-color: var(--ovulation-color);
  color: var(--ovulation-text);
  font-weight: 700;
  border: 2px dashed var(--ovulation-text);
}
.day.fertile {
  background-color: var(--fertile-color);
  color: var(--fertile-text);
  font-weight: 600;
}
.day.today {
  border: 2px solid var(--text-main);
  font-weight: 700;
}

.legend {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.legend-color {
  width: 16px;
  height: 16px;
  border-radius: 50%;
}

.legend-color.period { background-color: var(--period-color); border: 1px solid var(--period-text); }
.legend-color.ovulation { background-color: var(--ovulation-color); border: 1px solid var(--ovulation-text); }
.legend-color.fertile { background-color: var(--fertile-color); border: 1px solid var(--fertile-text); }

/* Educational Section */
.modern-content-section {
  margin: 5rem auto;
  max-width: 850px;
}

.modern-content-title {
  text-align: center;
  font-size: 2.25rem;
  font-weight: 800;
  margin-bottom: 3rem;
  color: var(--text-main);
  background: linear-gradient(135deg, var(--text-main), var(--text-muted));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="dark"] .modern-content-title {
  background: linear-gradient(135deg, #ffffff, #94a3b8);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.modern-faq-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.modern-faq-item {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-left: 5px solid var(--primary);
  border-radius: var(--border-radius);
  padding: 2.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}

[data-theme="dark"] .modern-faq-item {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.modern-faq-item:hover {
  transform: translateX(8px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .modern-faq-item:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.modern-faq-item-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.modern-faq-icon {
  width: 50px;
  height: 50px;
  background: rgba(255, 77, 109, 0.1);
  color: var(--primary);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.3s ease, background 0.3s ease;
}

[data-theme="dark"] .modern-faq-icon {
  background: rgba(251, 113, 133, 0.15);
}

.modern-faq-item:hover .modern-faq-icon {
  transform: scale(1.1) rotate(5deg);
  background: rgba(255, 77, 109, 0.2);
}

[data-theme="dark"] .modern-faq-item:hover .modern-faq-icon {
  background: rgba(251, 113, 133, 0.25);
}

.modern-faq-icon svg {
  width: 26px;
  height: 26px;
  stroke-width: 2.2;
}

.modern-faq-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

.modern-faq-text {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.8;
}

.disclaimer {
  margin-top: 3rem;
  padding: 1rem;
  background-color: rgba(226, 232, 240, 0.5);
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}

[data-theme="dark"] .disclaimer {
  background-color: rgba(51, 65, 85, 0.5);
}

/* Print Styles */
@media print {
  body {
    background-color: white;
    color: black;
  }
  .theme-toggle, .btn, header > p, .modern-content-section, .disclaimer {
    display: none !important;
  }
  .calculator-card, .month-view {
    box-shadow: none;
    border: 1px solid #ccc;
  }
  .legend-color {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .day.period, .day.ovulation, .day.fertile, .summary-card {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* Premium Footer Styling */
.big-footer {
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 4rem 3rem 2rem;
  margin-top: 5rem;
  box-shadow: 0 10px 40px rgba(0,0,0,0.02);
}

[data-theme="dark"] .big-footer {
  background-color: #162032; /* slightly darker for premium feel */
  border-color: rgba(255,255,255,0.05);
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 3rem;
  margin-bottom: 4rem;
  justify-content: space-between;
}

.fg-brand {
  flex: 1 1 240px;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.fg-logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  text-decoration: none;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.fg-logo i {
  color: var(--primary);
}

.fg-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 250px;
}

.fg-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 1.5rem;
}

.fg-links {
  flex: 1 1 120px;
}

.fg-links nav {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.fg-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.fg-links a:hover {
  color: var(--primary);
}

.fg-links a i {
  font-size: 0.7rem;
  opacity: 0.7;
}

.fg-newsletter {
  flex: 1 1 260px;
  max-width: 360px;
}

.fg-newsletter p {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.fn-form {
  position: relative;
  display: flex;
  align-items: center;
}

.fn-input-wrap {
  position: relative;
  width: 100%;
}

.fn-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  opacity: 0.6;
}

.fn-input-wrap input {
  width: 100%;
  padding: 1rem 3.5rem 1rem 2.5rem;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  outline: none;
}

.fn-input-wrap input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 77, 109, 0.1);
}

.fn-input-wrap button {
  position: absolute;
  right: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--text-main);
  color: var(--surface-color);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fn-input-wrap button:hover {
  background-color: var(--primary);
  transform: translateY(-50%) scale(1.05);
}

.footer-bottom {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  align-items: center;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 1.5rem;
}

.fb-social {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.fb-social span {
  font-weight: 600;
  margin-right: 0.5rem;
  color: var(--text-main);
}

.fb-social a {
  color: var(--text-muted);
  font-size: 1.2rem;
  transition: color 0.2s;
}

.fb-social a:hover {
  color: var(--primary);
}

@media(max-width: 768px) {
  .big-footer {
    padding: 3rem 1.5rem;
  }
  .fg-brand {
    max-width: 100%;
  }
}

@media(max-width: 600px) {
  .footer-grid {
    flex-direction: column;
    gap: 2.5rem;
  }
  .footer-bottom {
    flex-direction: column;
    justify-content: center;
    text-align: center;
  }
}

/* Blog Styling */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 1rem;
}

.blog-card {
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

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

.blog-card-img {
  width: 100%;
  height: 180px;
  background-color: var(--border-color);
  object-fit: cover;
}

.blog-card-content {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.blog-card-date {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.blog-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text-main);
  line-height: 1.4;
}

.blog-card-excerpt {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.blog-card-link {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.blog-card-link:hover {
  text-decoration: underline;
}

/* How to Use Section */
.how-to-section {
  margin: 4rem 0 2rem;
}

.how-to-title {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 3rem;
  color: var(--text-main);
}

.how-to-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
}

.step-card {
  position: relative;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 2.5rem 1.5rem;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
  text-align: center;
  z-index: 1;
}

.step-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .step-card:hover {
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
}

.step-number-bg {
  position: absolute;
  top: -15px;
  right: -5px;
  font-size: 8rem;
  font-weight: 800;
  color: var(--primary);
  opacity: 0.05;
  line-height: 1;
  z-index: -1;
  user-select: none;
}

[data-theme="dark"] .step-number-bg {
  opacity: 0.1;
}

.step-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  background: linear-gradient(135deg, #ff8da1, var(--primary));
  color: white;
  border-radius: 50%;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 10px rgba(255, 77, 109, 0.3);
}

.step-icon svg {
  width: 24px;
  height: 24px;
  stroke-width: 2;
}

.step-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.75rem;
}

.step-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Tool Results Universal Styling */
.result-box {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  margin-top: 2rem;
  display: none;
  box-shadow: var(--shadow);
}
.result-box.show {
  display: block;
  animation: fadeUp 0.4s ease forwards;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}
.result-title {
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1.5rem;
  font-size: 1.25rem;
  font-family: 'Merriweather', serif;
}
.cycle-list { display: flex; flex-direction: column; gap: 0.75rem; }
.cycle-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background: var(--bg-color);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  font-size: 0.95rem;
  flex-wrap: wrap;
  gap: 0.5rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.cycle-item:hover {
  transform: translateX(4px);
  border-color: var(--primary);
}
.cycle-item .cn { font-size: 0.85rem; font-weight: 700; color: var(--text-muted); }
.cycle-item .cd { font-weight: 700; color: var(--text-main); font-size: 1.05rem; }
.cbadge { font-size: 0.75rem; padding: 0.25rem 0.8rem; border-radius: 999px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.cb-p { background: rgba(225,29,72,0.1); color: #e11d48; }
.cb-f { background: rgba(22,163,74,0.1); color: #16a34a; }
.cb-o { background: rgba(37,99,235,0.1); color: #2563eb; }
.cb-s { background: rgba(168,85,247,0.1); color: #a855f7; }

/* Mini Calendar */
.mini-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 1.5rem; }
.cal-month-title { grid-column: 1 / -1; text-align: center; font-weight: 800; font-size: 1.1rem; padding: 1rem 0 0.5rem; color: var(--text-main); }
.cal-head { text-align: center; font-size: 0.75rem; font-weight: 800; color: var(--text-muted); padding: 0.5rem 0; text-transform: uppercase; }
.cal-day { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: 0.9rem; border-radius: 50%; font-weight: 500; color: var(--text-main); transition: transform 0.2s; }
.cal-day:hover:not(.empty) { transform: scale(1.1); font-weight: 700; cursor: pointer; }
.cal-day.today { border: 2px solid var(--primary); }
.cal-day.period { background: rgba(225,29,72,0.15); color: #e11d48; font-weight: 700; }
.cal-day.ovulation { background: rgba(37,99,235,0.25); color: #2563eb; font-weight: 800; box-shadow: 0 0 10px rgba(37,99,235,0.3); }
.cal-day.fertile { background: rgba(22,163,74,0.15); color: #16a34a; font-weight: 700; }
.cal-day.safe { background: rgba(168,85,247,0.15); color: #a855f7; font-weight: 700; }
.cal-day.empty { visibility: hidden; }
.legend { display: flex; gap: 1.25rem; flex-wrap: wrap; margin-top: 1.25rem; justify-content: center; }
.legend-item, .cal-legend-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }
.l-dot, .cl-dot { width: 12px; height: 12px; border-radius: 50%; }

/* Related Tools */
.related-tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.25rem; margin-top: 1.5rem; }
.related-card {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s;
  display: flex;
  gap: 1rem;
  align-items: center;
}
.related-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}
.rc-icon { font-size: 1.75rem; flex-shrink: 0; }
.rc-name { font-weight: 800; font-size: 1rem; color: var(--text-main); margin-bottom: 0.25rem; }
.rc-desc { font-size: 0.85rem; color: var(--text-muted); line-height: 1.4; }

/* Timeline (Ovulation Calculator) */
.timeline { display: flex; gap: 2px; border-radius: 8px; overflow: hidden; height: 32px; margin: 1rem 0; }
.tl-seg { display: flex; align-items: center; justify-content: center; font-size: 0.6rem; font-weight: 700; color: #fff; }
.tl-seg.period { background: #e11d48; }
.tl-seg.normal { background: var(--border-color); }
.tl-seg.fertile { background: #16a34a; }
.tl-seg.ovulation { background: #a855f7; }
.tl-legend { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 0.5rem; }
.tl-legend-item { display: flex; align-items: center; gap: 0.35rem; font-size: 0.78rem; color: var(--text-muted); }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; }

/* Compare Table & Pills */
.day-grid{display:flex;flex-wrap:wrap;gap:.4rem;margin-bottom:1rem}
.d-pill{padding:.4rem .75rem;border-radius:8px;font-size:.78rem;font-weight:700;text-align:center;min-width:60px}
.d-safe{background:rgba(13,148,136,.12);color:#0d9488}
.d-fertile{background:rgba(22,163,74,.1);color:#16a34a}
.d-ovulation{background:rgba(37,99,235,.12);color:#2563eb}
.d-period{background:rgba(225,29,72,.1);color:#e11d48}
.d-neutral{background:var(--border-color);color:var(--text-muted)}
.disc-box{background:rgba(245,158,11,.08);border:1px solid rgba(245,158,11,.3);border-radius:12px;padding:1.1rem 1.25rem;font-size:.875rem;color:var(--text-muted);line-height:1.7}
.disc-box strong{color:#d97706}
.compare-table, .range-table{width:100%;border-collapse:collapse;margin:1rem 0;font-size:.88rem}
.compare-table th, .range-table th{background:var(--surface-color);padding:.7rem 1rem;text-align:left;font-weight:700;color:var(--text-main);border-bottom:1px solid var(--border-color)}
.compare-table td, .range-table td{padding:.65rem 1rem;border-bottom:1px solid var(--border-color);color:var(--text-muted)}
.compare-table tr:last-child td, .range-table tr:last-child td{border-bottom:none}

/* Cycle Tracker */
[data-theme=dark] .sl-label{font-size:.75rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--text-muted);margin-bottom:.75rem}
.log-list{display:flex;flex-direction:column;gap:.45rem;max-height:240px;overflow-y:auto;margin-bottom:1rem}
.log-item{display:flex;justify-content:space-between;align-items:center;padding:.6rem 1rem;background:var(--bg-color);border-radius:8px;border:1px solid var(--border-color);font-size:.875rem}
.log-item .li-date{font-weight:600;color:var(--text-main)}
.log-item .li-len{color:#2563eb;font-weight:700}
.li-rm{background:none;border:none;color:var(--text-muted);cursor:pointer;font-size:1rem;padding:.1rem .3rem;border-radius:4px}
.li-rm:hover{color:#e11d48}
.stats-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:.85rem;margin:1rem 0}
.stat-card{background:var(--bg-color);border:1px solid var(--border-color);border-radius:12px;padding:1rem;text-align:center}
.stat-val{font-size:1.65rem;font-weight:800;color:#2563eb}
.stat-lbl{font-size:.78rem;color:var(--text-muted);margin-top:.2rem}
.chart-wrap{position:relative;height:220px;margin-top:1rem}
.empty-state{text-align:center;padding:2rem;color:var(--text-muted);font-size:.875rem}

/* PMS Tracker */
.symptom-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:.65rem;margin-bottom:1.25rem}
.chip{padding:.6rem .9rem;border:1px solid var(--border-color);border-radius:10px;font-size:.84rem;font-weight:500;cursor:pointer;text-align:center;transition:all .2s;background:var(--surface-color);color:var(--text-muted);user-select:none}
.chip.sel{border-color:#ea580c;background:rgba(234,88,12,.1);color:#ea580c;font-weight:700}
.chip:hover{border-color:#ea580c;color:#ea580c}
.hist-item{padding:.85rem 1rem;background:var(--bg-color);border-radius:9px;border:1px solid var(--border-color);margin-bottom:.5rem}
.hi-top{display:flex;justify-content:space-between;align-items:center;margin-bottom:.4rem;flex-wrap:wrap;gap:.4rem}
.hi-date{font-weight:600;font-size:.9rem;color:var(--text-main)}
.hi-sev{font-size:.72rem;padding:.2rem .65rem;border-radius:999px;font-weight:700}
.sev-mild{background:rgba(22,163,74,.1);color:#16a34a}
.sev-moderate{background:rgba(234,88,12,.1);color:#ea580c}
.sev-severe{background:rgba(220,38,38,.1);color:#dc2626}
.hi-syms{font-size:.78rem;color:var(--text-muted);line-height:1.5}
.freq-item{display:flex;justify-content:space-between;align-items:center;padding:.6rem 1rem;background:var(--bg-color);border-radius:8px;border:1px solid var(--border-color);margin-bottom:.4rem;font-size:.875rem}
.sym-info-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:.85rem;margin:1rem 0}
.sym-card{background:var(--surface-color);border:1px solid var(--border-color);border-radius:12px;padding:1.1rem}
.sym-card h4{font-size:.88rem;font-weight:700;color:var(--text-main);margin-bottom:.25rem}
.sym-card p{font-size:.8rem;color:var(--text-muted);line-height:1.5;margin:0}

/* Tool Pages Global Icon Color Override */
.tool-page i.fa-solid,
.tool-page i.fa-regular {
  color: var(--primary);
}
/* Exempt social link icons */
.tool-page .fb-social i {
  color: inherit;
}

/* Global Mobile Fixes */
@media (max-width: 600px) {
  .modern-content-section {
    margin: 3rem auto;
  }
  .modern-content-title {
    font-size: 1.75rem;
    margin-bottom: 2rem;
  }
  .modern-faq-item {
    padding: 1.25rem 1rem;
    border-left-width: 4px;
  }
  .modern-faq-item-header {
    margin-bottom: 0.75rem;
    gap: 0.8rem;
  }
  .modern-faq-icon {
    width: 40px;
    height: 40px;
  }
  .modern-faq-icon svg {
    width: 20px;
    height: 20px;
  }
  .modern-faq-title {
    font-size: 1.05rem;
  }
  .modern-faq-text {
    font-size: 0.95rem;
  }
  .calculator-card {
    padding: 1.25rem;
  }
  .container {
    padding: 1rem 0.75rem;
  }
}
