/* ==========================================================================
   OvaTriage - Modern Pastel Design System & Dark Mode Stylesheet
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  /* Light Theme Palette - Empathetic FemTech Pastel & Deep Burgundy */
  --bg-gradient: linear-gradient(180deg, #FFF5F7 0%, #FAFAFC 100%);
  --bg-page: #FFF5F7;
  --bg-card: #FFFFFF;
  --bg-card-glass: rgba(255, 255, 255, 0.9);
  --bg-card-hover: #FFF9FA;
  --bg-input: #FAF5F7;
  --bg-input-focus: #FFFFFF;
  --bg-subtle: #FDF0F4;
  
  --border-color: #F7D6E0;
  --border-focus: #FF6584;
  --border-subtle: #FCE8EF;
  
  --text-primary: #4A1525;       /* Deep warm burgundy */
  --text-secondary: #7A3B4D;     /* Soft burgundy mauve */
  --text-muted: #A06D7C;         /* Muted rose plum */
  --text-accent: #880E4F;        /* Rich burgundy emphasis */
  --text-inverse: #FFFFFF;
  
  --primary: #FF6584;            /* Soft pastel rose */
  --primary-hover: #E84D6F;
  --primary-light: #FFE4E8;      /* Blush pink */
  --primary-subtle: #FFF0F3;     /* Whisper pink */
  --primary-dark: #6B0E36;       /* Deep burgundy */
  
  /* Cycle Phase Colors */
  --phase-menstrual: #FF6584;
  --phase-menstrual-light: #FFE4E8;
  --phase-follicular: #B388FF;
  --phase-follicular-light: #F3E5F5;
  --phase-ovulatory: #FFA726;
  --phase-ovulatory-light: #FFF3E0;
  --phase-luteal: #EC407A;
  --phase-luteal-light: #FCE4EC;
  
  --accent-purple: #9C27B0;
  --accent-purple-light: #F3E5F5;
  --accent-teal: #26A69A;
  --accent-teal-light: #E0F2F1;
  --accent-amber: #FB8C00;
  --accent-amber-light: #FFF3E0;
  
  --emergency-bg: #FFF0F2;
  --emergency-border: #FF5252;
  --emergency-text: #C62828;
  --emergency-pulse: rgba(255, 82, 82, 0.35);
  
  --success-bg: #E8F5E9;
  --success-border: #81C784;
  --success-text: #2E7D32;
  
  --warning-bg: #FFF8E1;
  --warning-border: #FFE082;
  --warning-text: #B78103;
  
  --shadow-sm: 0 4px 12px rgba(136, 14, 79, 0.05);
  --shadow-md: 0 8px 24px rgba(136, 14, 79, 0.08);
  --shadow-lg: 0 16px 36px rgba(136, 14, 79, 0.12);
  --shadow-glow: 0 0 25px rgba(255, 101, 132, 0.3);
  
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-pill: 9999px;
  
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
  /* Dark Theme Palette (Deep Plum Velvet & Glowing Pastel Rose) */
  --bg-gradient: linear-gradient(180deg, #160D14 0%, #1F121C 100%);
  --bg-page: #160D14;
  --bg-card: #221420;
  --bg-card-glass: rgba(34, 20, 32, 0.9);
  --bg-card-hover: #2B1A28;
  --bg-input: #1A0F18;
  --bg-input-focus: #281726;
  --bg-subtle: #2E1B2A;
  
  --border-color: #44263D;
  --border-focus: #FF7597;
  --border-subtle: #331C2E;
  
  --text-primary: #FDE8EF;
  --text-secondary: #D4B0C2;
  --text-muted: #A37F93;
  --text-accent: #FF8DA9;
  --text-inverse: #160D14;
  
  --primary: #FF7597;
  --primary-hover: #FFA1B8;
  --primary-light: #42182B;
  --primary-subtle: #2E121E;
  --primary-dark: #FFC2D1;
  
  /* Cycle Phase Colors (Dark) */
  --phase-menstrual: #FF7597;
  --phase-menstrual-light: #3D1826;
  --phase-follicular: #CE93D8;
  --phase-follicular-light: #2D1A33;
  --phase-ovulatory: #FFB74D;
  --phase-ovulatory-light: #382410;
  --phase-luteal: #F48FB1;
  --phase-luteal-light: #381A28;
  
  --accent-purple: #CE93D8;
  --accent-purple-light: #2D1A33;
  --accent-teal: #80CBC4;
  --accent-teal-light: #162E2A;
  --accent-amber: #FFB74D;
  --accent-amber-light: #382410;
  
  --emergency-bg: #2E1216;
  --emergency-border: #FF5252;
  --emergency-text: #FF8A80;
  --emergency-pulse: rgba(255, 82, 82, 0.45);
  
  --success-bg: #14281A;
  --success-border: #4CAF50;
  --success-text: #81C784;
  
  --warning-bg: #2C2210;
  --warning-border: #FFB74D;
  --warning-text: #FFD54F;
  
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.65);
  --shadow-glow: 0 0 30px rgba(255, 117, 151, 0.35);
}

/* ==========================================================================
   Base & Reset
   ========================================================================== */

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-gradient);
  background-color: var(--bg-page);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

.app-wrapper {
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

/* ==========================================================================
   Header & Controls
   ========================================================================== */

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

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

.brand-icon {
  font-size: 2.4rem;
  line-height: 1;
  filter: drop-shadow(0 2px 6px rgba(255, 101, 132, 0.3));
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-4px); }
}

.brand-title {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-title span.accent {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent-purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-tagline {
  font-size: 0.92rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang-switch {
  display: inline-flex;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 4px;
  border-radius: var(--radius-pill);
}

.lang-btn {
  border: none;
  background: transparent;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.lang-btn.active {
  background: var(--bg-card);
  color: var(--primary-dark);
  box-shadow: var(--shadow-sm);
}

.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  font-size: 1.15rem;
}

.theme-toggle-btn:hover {
  transform: rotate(15deg) scale(1.05);
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}

/* ==========================================================================
   Plush Companion Warm Welcome Banner
   ========================================================================== */

.companion-banner {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-subtle) 100%);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: var(--shadow-md);
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.companion-banner::after {
  content: '';
  position: absolute;
  right: -30px;
  top: -30px;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
  opacity: 0.15;
  pointer-events: none;
}

.companion-avatar-wrap {
  position: relative;
}

.companion-avatar {
  font-size: 2.6rem;
  background: var(--bg-card);
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  border: 2px solid var(--border-subtle);
  animation: gentle-bob 4s ease-in-out infinite;
}

@keyframes gentle-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.companion-text-wrap {
  flex: 1;
}

.companion-msg {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 6px;
}

.privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--success-bg);
  color: var(--success-text);
  border: 1px solid var(--success-border);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 600;
}

/* ==========================================================================
   Navigation Tabs
   ========================================================================== */

.tabs-container {
  display: flex;
  gap: 10px;
  border-bottom: 2px solid var(--border-subtle);
  margin-bottom: 24px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.tabs-container::-webkit-scrollbar {
  height: 4px;
}
.tabs-container::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.tab-btn {
  background: transparent;
  border: none;
  padding: 12px 20px;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  position: relative;
  font-family: inherit;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.tab-btn.active {
  color: var(--primary-dark);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary);
  border-radius: 3px 3px 0 0;
}

.tab-content {
  display: none;
  animation: fadeIn 0.35s ease forwards;
}

.tab-content.active {
  display: block;
}

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

/* ==========================================================================
   Cards & Layout Components
   ========================================================================== */

.grid-assessment {
  display: grid;
  grid-template-columns: 1.15fr 1.35fr;
  gap: 24px;
  align-items: start;
}

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

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  transition: var(--transition);
  backdrop-filter: blur(8px);
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-focus);
}

.card-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 20px 0;
}

/* Emergency Alert */
.emergency-box {
  background: var(--emergency-bg);
  border: 2px solid var(--emergency-border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  color: var(--emergency-text);
  font-weight: 600;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  animation: emergency-pulse 2s infinite;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

@keyframes emergency-pulse {
  0% { box-shadow: 0 0 0 0 var(--emergency-pulse); }
  70% { box-shadow: 0 0 0 12px rgba(255, 77, 77, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 77, 77, 0); }
}

.emergency-checklist {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 20px;
}

/* ==========================================================================
   Form Controls, Inputs & Sliders
   ========================================================================== */

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-sublabel {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.input-row-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.input-row-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (max-width: 600px) {
  .input-row-3, .input-row-2 {
    grid-template-columns: 1fr;
  }
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  transition: var(--transition);
  outline: none;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  background: var(--bg-input-focus);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* Custom Checkbox */
.custom-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
  cursor: pointer;
  font-size: 0.92rem;
  color: var(--text-primary);
  user-select: none;
}

.custom-checkbox input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border-color);
  border-radius: 4px;
  background: var(--bg-input);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  margin-top: 3px;
  transition: var(--transition);
}

.custom-checkbox input[type="checkbox"]:checked {
  background: var(--primary);
  border-color: var(--primary);
}

.custom-checkbox input[type="checkbox"]:checked::after {
  content: '✔';
  position: absolute;
  color: #fff;
  font-size: 11px;
  font-weight: bold;
  left: 3px;
  top: -1px;
}

/* Radio Group */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.custom-radio {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.92rem;
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid transparent;
  transition: var(--transition);
}

.custom-radio:hover {
  border-color: var(--border-color);
}

.custom-radio input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border-color);
  border-radius: 50%;
  background: var(--bg-input);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: var(--transition);
}

.custom-radio input[type="radio"]:checked {
  border-color: var(--primary);
  background: var(--primary);
}

.custom-radio input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #FFF;
  top: 4.5px;
  left: 4.5px;
}

/* Range Slider with Pill Badge */
.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.slider-val-badge {
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 700;
}

input[type="range"] {
  width: 100%;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid var(--bg-card);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.15s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

/* Primary Action Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 0.96rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  width: 100%;
  box-shadow: var(--shadow-sm);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: #FFFFFF;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.btn-secondary {
  background: var(--bg-subtle);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary);
}

.btn-outline-primary {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

.btn-outline-primary:hover {
  background: var(--primary-light);
}

/* ==========================================================================
   Diagnostic Output Cards (Tab 1 Results)
   ========================================================================== */

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

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

.metric-box {
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  text-align: center;
  border: 1px solid var(--border-subtle);
}

.metric-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.metric-value {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
}

.metric-value.highlight {
  color: var(--primary);
}

/* Progress Bar */
.progress-track {
  width: 100%;
  height: 10px;
  background: var(--bg-subtle);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin: 12px 0 8px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent-purple) 100%);
  border-radius: var(--radius-pill);
  transition: width 0.5s ease-in-out;
}

/* Anomaly & Insight Badges */
.anomaly-item {
  background: var(--bg-subtle);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.anomaly-item.error {
  border-left-color: #E53935;
  background: var(--emergency-bg);
}

.anomaly-item.warning {
  border-left-color: #FB8C00;
  background: var(--warning-bg);
}

.anomaly-item.success {
  border-left-color: #43A047;
  background: var(--success-bg);
}

.anomaly-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.anomaly-detail {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.anomaly-guideline {
  font-size: 0.8rem;
  font-style: italic;
  color: var(--text-muted);
}

.anomaly-action {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--primary-dark);
  margin-top: 6px;
}

/* Action Plan Columns */
.action-plan-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 700px) {
  .action-plan-grid {
    grid-template-columns: 1fr;
  }
}

.plan-column {
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
}

.plan-column-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.plan-list {
  list-style: none;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.plan-list li {
  margin-bottom: 8px;
  padding-left: 18px;
  position: relative;
}

.plan-list li::before {
  content: '•';
  color: var(--primary);
  font-weight: bold;
  font-size: 1.2rem;
  position: absolute;
  left: 0;
  top: -2px;
}

/* Gemini Expander / Accordion */
.accordion {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-top: 18px;
  background: var(--bg-card);
}

.accordion-header {
  padding: 14px 18px;
  background: var(--bg-subtle);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  user-select: none;
}

.accordion-content {
  padding: 18px;
  display: none;
}

.accordion.open .accordion-content {
  display: block;
}

.bao-speech-bubble {
  background: var(--primary-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-top: 14px;
  font-size: 0.92rem;
  color: var(--primary-dark);
  font-weight: 500;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

/* ==========================================================================
   Interactive Phase Gauge & Circular Cycle Wheel Component
   ========================================================================== */

.cycle-wheel-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 10px 0 20px;
}

.cycle-wheel-wrapper {
  position: relative;
  width: 270px;
  height: 270px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cycle-wheel-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  overflow: visible;
}

.wheel-arc-bg {
  fill: none;
  stroke: var(--bg-subtle);
  stroke-width: 14;
}

.wheel-phase-arc {
  fill: none;
  stroke-width: 14;
  stroke-linecap: round;
  transition: stroke-width 0.25s ease, filter 0.25s ease, opacity 0.25s ease;
  cursor: pointer;
}

.wheel-phase-arc:hover {
  stroke-width: 18;
  filter: drop-shadow(0 0 6px currentColor);
}

.wheel-phase-arc.active {
  stroke-width: 17;
  filter: drop-shadow(0 0 8px currentColor);
}

/* Orbiting Indicator Orb */
.wheel-orb {
  fill: var(--primary);
  stroke: var(--bg-card);
  stroke-width: 3.5;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.25));
  transition: cx 0.5s cubic-bezier(0.16, 1, 0.3, 1), cy 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  animation: orb-pulse 2s infinite ease-in-out;
}

@keyframes orb-pulse {
  0%, 100% { r: 8; }
  50% { r: 9.5; }
}

.cycle-wheel-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: var(--bg-card);
  box-shadow: inset 0 2px 8px rgba(136, 14, 79, 0.04), var(--shadow-sm);
  border: 1.5px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
  pointer-events: none;
  transition: var(--transition);
}

.wheel-day-badge {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.wheel-day-number {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text-accent);
  margin-bottom: 4px;
}

.wheel-phase-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.wheel-countdown-badge {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: var(--primary-light);
  color: var(--primary-dark);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Phase Selector Legend Pills */
.phase-legend-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: 100%;
  margin-top: 8px;
}

@media (max-width: 580px) {
  .phase-legend-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.phase-pill-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.phase-pill-btn:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.phase-pill-btn.active {
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  border-width: 1.5px;
}

.phase-pill-btn.menstrual.active {
  border-color: var(--phase-menstrual);
  color: var(--phase-menstrual);
}

.phase-pill-btn.follicular.active {
  border-color: var(--phase-follicular);
  color: var(--phase-follicular);
}

.phase-pill-btn.ovulatory.active {
  border-color: var(--phase-ovulatory);
  color: var(--phase-ovulatory);
}

.phase-pill-btn.luteal.active {
  border-color: var(--phase-luteal);
  color: var(--phase-luteal);
}

.phase-pill-title {
  font-size: 0.78rem;
  font-weight: 700;
}

.phase-pill-days {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Dynamic Phase Detail Insight Box */
.phase-insight-card {
  width: 100%;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-top: 14px;
  font-size: 0.86rem;
  transition: var(--transition);
}

.phase-insight-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.phase-insight-title {
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.hormone-tag {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.phase-insight-desc {
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 6px;
}

.phase-insight-tip {
  font-weight: 600;
  color: var(--text-accent);
  display: flex;
  align-items: center;
  gap: 6px;
}

.nutrition-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

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

.produce-card, .movement-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 14px;
  transition: var(--transition);
}

.produce-card:hover, .movement-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.card-header-flex {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.card-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.card-headline {
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--text-primary);
}

.bio-tag {
  display: inline-block;
  background: var(--accent-purple-light);
  color: var(--accent-purple);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  margin-bottom: 6px;
}

.card-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ==========================================================================
   Tab 3: MMCH Specialists & Labs Directory
   ========================================================================== */

.directory-controls {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.directory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

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

.directory-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.directory-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.doc-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
}

.doc-title {
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 4px;
}

.doc-inst {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.doc-info-row {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 16px;
}

.tag-pill {
  background: var(--bg-subtle);
  color: var(--text-primary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
}

.contact-box {
  background: var(--bg-subtle);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* ==========================================================================
   Tab 4: Feedback & Admin Database Inspector Table
   ========================================================================== */

.rating-stars {
  display: flex;
  gap: 8px;
  margin: 8px 0 16px;
}

.star-btn {
  background: none;
  border: none;
  font-size: 1.6rem;
  color: var(--border-color);
  cursor: pointer;
  transition: transform 0.15s ease, color 0.15s ease;
}

.star-btn.active, .star-btn:hover {
  color: #FFB800;
  transform: scale(1.15);
}

.table-wrapper {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-top: 14px;
  background: var(--bg-card);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

th {
  background: var(--bg-subtle);
  color: var(--text-primary);
  font-weight: 700;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

tr:hover td {
  background: var(--bg-card-hover);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.success {
  border-left: 4px solid var(--success-border);
}

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

/* Footer */
footer {
  text-align: center;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ==========================================================================
   Multi-Cycle ML Timeline & Statistical Variance Engine Styles
   ========================================================================== */

.cycle-history-container {
  margin-top: 10px;
}

.history-mode-switcher {
  display: flex;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 14px;
  gap: 4px;
}

.mode-btn {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.mode-btn.active {
  background: var(--bg-card);
  color: var(--text-accent);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-subtle);
}

/* Visual Cycle History Timeline Flow */
.cycle-timeline-flow {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 10px 4px;
  margin: 10px 0 14px;
  scrollbar-width: thin;
}

.cycle-timeline-flow::-webkit-scrollbar {
  height: 4px;
}
.cycle-timeline-flow::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.date-chip {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 105px;
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: var(--transition);
  flex-shrink: 0;
}

.date-chip:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.date-chip.latest {
  border-color: var(--primary);
  background: var(--primary-subtle);
}

.date-chip-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.date-chip-val {
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--text-primary);
}

.date-chip-del {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--emergency-bg);
  color: var(--emergency-text);
  border: 1px solid var(--emergency-border);
  font-size: 10px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.date-chip:hover .date-chip-del {
  opacity: 1;
}

.interval-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.interval-arrow {
  color: var(--primary);
  font-size: 1rem;
  line-height: 1;
  font-weight: bold;
}

.interval-badge {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

/* Preset Quick Selectors */
.preset-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  align-items: center;
}

.preset-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-right: 2px;
}

.preset-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.preset-btn:hover {
  background: var(--bg-card);
  border-color: var(--primary);
  color: var(--primary-dark);
  transform: translateY(-1px);
}

/* Add Date Input Row */
.add-date-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  align-items: center;
}

.btn-sm-add {
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}

/* ML Confidence & Variance Output Banner in Card 1 */
.ml-stats-banner {
  background: linear-gradient(135deg, var(--bg-subtle) 0%, var(--primary-subtle) 100%);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin: 12px 0 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ml-banner-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.ml-model-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--accent-purple-light);
  color: var(--accent-purple);
  font-size: 0.75rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.02em;
}

.confidence-window-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--success-bg);
  color: var(--success-text);
  border: 1px solid var(--success-border);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
}

.confidence-window-pill.warning {
  background: var(--warning-bg);
  color: var(--warning-text);
  border-color: var(--warning-border);
}

.ml-metrics-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

@media (max-width: 540px) {
  .ml-metrics-row {
    grid-template-columns: 1fr;
  }
}

.ml-metric-chip {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  text-align: center;
}

.ml-chip-lbl {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

.ml-chip-val {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-accent);
}

/* ==========================================================================
   Condition-Specific Recommended MD Specialists Cards (Card 2 & 3)
   ========================================================================== */

.recommended-md-box {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-top: 10px;
  box-shadow: var(--shadow-sm);
}

.recommended-md-header {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-accent);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.mini-doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 10px;
}

.mini-doc-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition);
}

.mini-doc-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.mini-doc-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
}

.mini-doc-title {
  font-size: 0.78rem;
  color: var(--primary-dark);
  font-weight: 600;
  margin-bottom: 2px;
}

.mini-doc-inst {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.mini-doc-row {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 3px;
  display: flex;
  align-items: flex-start;
  gap: 5px;
}

.mini-doc-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.btn-mini-call {
  background: var(--primary-light);
  color: var(--primary-dark);
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition);
}

.btn-mini-call:hover {
  background: var(--primary);
  color: #fff;
}

.btn-mini-view {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-mini-view:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

/* Interactive Cycle Dates List Editor */
.cycle-dates-editor-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.cycle-date-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: var(--transition);
}

.cycle-date-item:hover {
  border-color: var(--primary);
}

.cycle-date-item.latest {
  border-color: var(--primary);
  background: var(--primary-subtle);
}

.cycle-item-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.cycle-item-badge {
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--primary-dark);
  background: var(--primary-light);
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.cycle-item-input {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-family: inherit;
}

.cycle-item-input:focus {
  border-color: var(--primary);
  background: #fff;
}

.btn-cycle-del {
  background: none;
  border: none;
  color: var(--emergency-text);
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.btn-cycle-del:hover {
  background: var(--emergency-bg);
}

/* ==========================================================================
   Clinical Consultation PDF Handout Document Styles
   ========================================================================== */

.clinical-pdf-doc {
  background: #ffffff !important;
  color: #2D0A14 !important;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  padding: 30px 36px;
  line-height: 1.45;
  width: 100%;
  box-sizing: border-box;
}

.pdf-header {
  border-bottom: 2px solid #E8B4C0;
  padding-bottom: 16px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.pdf-brand-title {
  font-size: 24px;
  font-weight: 800;
  color: #880E4F;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pdf-brand-sub {
  font-size: 11px;
  color: #7A4958;
  margin-top: 4px;
  font-weight: 600;
}

.pdf-meta-box {
  text-align: right;
  font-size: 11px;
  color: #7A4958;
}

.pdf-section-title {
  font-size: 14px;
  font-weight: 800;
  color: #880E4F;
  background: #FFF0F3;
  border-left: 4px solid #FF6584;
  padding: 6px 10px;
  margin: 16px 0 10px 0;
  border-radius: 0 4px 4px 0;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.pdf-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.pdf-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.pdf-card-box {
  background: #FAFAFB;
  border: 1px solid #EEDCE2;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 12px;
}

.pdf-lbl {
  font-size: 10px;
  font-weight: 700;
  color: #8C5363;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.pdf-val {
  font-size: 13px;
  font-weight: 800;
  color: #2D0A14;
}

.pdf-flag-card {
  border: 1px solid #F3C5CE;
  border-left: 4px solid #E53935;
  background: #FFF8F9;
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 10px;
  font-size: 11.5px;
}

.pdf-flag-card.warning {
  border-left-color: #FB8C00;
  background: #FFFBF5;
}

.pdf-flag-title {
  font-size: 13px;
  font-weight: 800;
  color: #C62828;
  margin-bottom: 4px;
}

.pdf-doc-item {
  background: #FDF4F6;
  border: 1px solid #EAC8D2;
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 8px;
  font-size: 11.5px;
}

.pdf-footer-disclaimer {
  border-top: 1px dashed #D99BAA;
  padding-top: 12px;
  margin-top: 24px;
  font-size: 9.5px;
  color: #8C5363;
  text-align: center;
  line-height: 1.4;
}
