/* LutealShield Design System & Adaptive Color System */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Playfair+Display:ital,wght@0,600;1,400&display=swap');

:root {
  /* Default: Green Zone (Steady Baseline) */
  --bg: #FAF7F2;
  --primary: #2D1B4E;
  --accent: #4A8C6E;
  --accent-soft: rgba(74, 140, 110, 0.15);
  --card: #FFFFFF;
  --text: #1A1A2E;
  --text-muted: #6B6882;
  --border: rgba(45, 27, 78, 0.08);
  --border-focus: rgba(45, 27, 78, 0.25);
  --input-bg: #F4EFEA;
  --nav-bg: rgba(250, 247, 242, 0.92);
  --shadow-sm: 0 2px 8px rgba(45, 27, 78, 0.04);
  --shadow-md: 0 8px 24px rgba(45, 27, 78, 0.08);
  --chip-bg: #F4EFEA;
  --chip-selected: #2D1B4E;
  --chip-selected-text: #FFFFFF;
  --amber-glow: transparent;
  --font-base: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;
}

/* Amber Zone (72h Early Warning / Pre-Luteal) */
[data-zone="amber"] {
  --bg: #FAF7F2;
  --primary: #2D1B4E;
  --accent: #C47A3A;
  --accent-soft: rgba(196, 122, 58, 0.16);
  --card: #FFF8F0;
  --text: #1A1A2E;
  --text-muted: #73645A;
  --border: rgba(196, 122, 58, 0.18);
  --border-focus: rgba(196, 122, 58, 0.35);
  --input-bg: #F7EFE6;
  --nav-bg: rgba(255, 248, 240, 0.94);
  --shadow-sm: 0 2px 8px rgba(196, 122, 58, 0.06);
  --shadow-md: 0 8px 24px rgba(196, 122, 58, 0.12);
  --chip-bg: #F5EAE0;
  --chip-selected: #2D1B4E;
  --chip-selected-text: #FFFFFF;
}

/* Red Zone (Crisis Shield / Late Luteal Storm) */
[data-zone="red"] {
  --bg: #0D0A12;
  --primary: #D4B8E0;
  --accent: #8B2A2A;
  --accent-soft: rgba(139, 42, 42, 0.28);
  --card: #1A1025;
  --text: #F0EBF8;
  --text-muted: #A396B8;
  --border: rgba(212, 184, 224, 0.14);
  --border-focus: rgba(212, 184, 224, 0.35);
  --input-bg: #140C1E;
  --nav-bg: rgba(13, 10, 18, 0.94);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.6);
  --chip-bg: #251836;
  --chip-selected: #D4B8E0;
  --chip-selected-text: #1A1025;
}

/* Rose Amber Glow Filter */
body.rose-amber-glow::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 30%, rgba(230, 140, 90, 0.08), rgba(240, 110, 110, 0.04));
  pointer-events: none;
  z-index: 9999;
}

/* PMDD Neuro-Accessibility */
body.larger-text-mode {
  font-size: 110%;
}
body.larger-text-mode h1 { font-size: 1.85rem !important; }
body.larger-text-mode h2 { font-size: 1.55rem !important; }
body.larger-text-mode p, body.larger-text-mode button, body.larger-text-mode input { font-size: 1.05rem !important; }

body.reduce-motion-mode * {
  animation: none !important;
  transition: none !important;
}

/* Reset and Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-base);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

/* Mobile Frame Container */
.app-container {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  background-color: var(--bg);
  padding-bottom: 84px; /* Space for bottom nav */
}

/* Header */
.app-header {
  padding: 16px 20px 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg);
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

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

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-text-col {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.15;
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

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

/* Safe Space Badge */
.safe-space-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(225, 190, 231, 0.22);
  color: var(--primary);
  border: 1px solid rgba(142, 68, 173, 0.2);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

[data-zone="red"] .safe-space-badge {
  background: rgba(212, 184, 224, 0.16);
  color: #D4B8E0;
  border-color: rgba(212, 184, 224, 0.25);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #8E44AD;
  box-shadow: 0 0 6px #8E44AD;
  animation: pulseAnim 2s infinite ease-in-out;
}

[data-zone="red"] .pulse-dot {
  background-color: #D4B8E0;
  box-shadow: 0 0 8px #D4B8E0;
}

@keyframes pulseAnim {
  0%, 100% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease;
}

.icon-btn:hover {
  transform: translateY(-1px);
  background: var(--input-bg);
}

.bloomy-avatar-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  padding: 2px;
  border: 2px solid #8F62C7;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #E8DDF5;
  cursor: pointer;
  text-decoration: none;
}

.bloomy-avatar-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* Banner for Amber Zone (Rose Amber Glow) */
.amber-banner {
  background: linear-gradient(135deg, #FFF3E6 0%, #FFE8D6 100%);
  border-bottom: 1px solid rgba(196, 122, 58, 0.3);
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #7D4212;
  font-size: 0.82rem;
  font-weight: 500;
}

.amber-banner-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Main Content Area */
.app-content {
  flex: 1;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Headings */
.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.page-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Cards */
.card {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

/* Simulator / Hackathon Switcher */
.simulator-card {
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: 18px;
  padding: 14px 16px;
}

.simulator-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.simulator-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.badge-tag {
  background: rgba(74, 140, 110, 0.15);
  color: #4A8C6E;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
}

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

.zone-btn {
  padding: 10px 8px;
  border-radius: 12px;
  border: 1.5px solid transparent;
  background: var(--input-bg);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  transition: all 0.2s ease;
}

.zone-btn .zone-btn-title {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text);
}

.zone-btn .zone-btn-desc {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.zone-btn.active-green {
  background: #E8F5E9;
  border-color: #4A8C6E;
}
.zone-btn.active-green .zone-btn-title { color: #2E7D32; }

.zone-btn.active-amber {
  background: #FFF3E0;
  border-color: #C47A3A;
}
.zone-btn.active-amber .zone-btn-title { color: #C47A3A; }

.zone-btn.active-red {
  background: #2D141E;
  border-color: #8B2A2A;
}
.zone-btn.active-red .zone-btn-title { color: #FF8A80; }

/* Radar & Cycle Circle */
.radar-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  padding: 24px 20px 20px 20px;
}

.radar-circle-wrap {
  width: 200px;
  height: 200px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px 0 16px 0;
}

.radar-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.radar-center-info {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.radar-day-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 700;
}

.radar-day-number {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  margin: 2px 0;
}

.radar-phase-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  margin-top: 2px;
}

.badge-green { background: #E8F5E9; color: #2E7D32; }
.badge-amber { background: #FFF3E0; color: #E65100; }
.badge-red { background: rgba(139, 42, 42, 0.3); color: #FF8A80; }

.radar-countdown-box {
  background: var(--input-bg);
  border-radius: 12px;
  padding: 10px 14px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text);
  font-weight: 500;
}

/* Daily Check-in */
.checkin-card {
  padding: 18px;
}

.checkin-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.mood-buttons-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.mood-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 4px;
  border-radius: 14px;
  background: var(--input-bg);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mood-btn:hover {
  transform: translateY(-2px);
}

.mood-btn.selected {
  background: var(--card);
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(45, 27, 78, 0.12);
}

[data-zone="red"] .mood-btn.selected {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(212, 184, 224, 0.2);
}

.mood-emoji {
  font-size: 1.35rem;
  margin-bottom: 4px;
}

.mood-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  line-height: 1.1;
}

.checkin-feedback {
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--text-muted);
  background: rgba(74, 140, 110, 0.1);
  padding: 8px 12px;
  border-radius: 10px;
  display: none;
}

/* Bloomy Card */
.bloomy-card {
  background: linear-gradient(135deg, rgba(230, 215, 250, 0.35) 0%, rgba(245, 235, 255, 0.15) 100%);
  border: 1.5px solid rgba(143, 98, 199, 0.25);
  border-radius: 20px;
  padding: 16px 18px;
  display: flex;
  gap: 14px;
  align-items: center;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

[data-zone="red"] .bloomy-card {
  background: linear-gradient(135deg, rgba(45, 20, 65, 0.7) 0%, rgba(25, 12, 38, 0.9) 100%);
  border-color: rgba(212, 184, 224, 0.25);
}

.bloomy-card:hover {
  transform: translateY(-2px);
  border-color: #8F62C7;
}

.bloomy-card-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  background: #E8DDF5;
  border: 2px solid #8F62C7;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bloomy-card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bloomy-card-content {
  flex: 1;
}

.bloomy-card-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.bloomy-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.bloomy-status-badge {
  font-size: 0.68rem;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(143, 98, 199, 0.2);
  color: var(--primary);
  font-weight: 600;
}

.bloomy-message-preview {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.35;
}

/* 2x2 Action Grid */
.action-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.action-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 110px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.action-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.action-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.action-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--input-bg);
  color: var(--primary);
}

.action-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.action-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Bottom Navigation Bar */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: var(--nav-bg);
  border-top: 1px solid var(--border);
  padding: 8px 12px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 50;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 12px;
  transition: color 0.15s ease, transform 0.15s ease;
  position: relative;
}

.nav-item:hover {
  color: var(--text);
}

.nav-item.active {
  color: var(--primary);
  font-weight: 700;
}

[data-zone="red"] .nav-item.active {
  color: #D4B8E0;
}

.nav-icon {
  width: 22px;
  height: 22px;
}

/* Accordions */
.accordion-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  margin-bottom: 12px;
  overflow: hidden;
  transition: all 0.25s ease;
}

.accordion-header {
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.accordion-title-col {
  display: flex;
  align-items: center;
  gap: 12px;
}

.accordion-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--input-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
}

.accordion-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.accordion-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.accordion-arrow {
  width: 20px;
  height: 20px;
  transition: transform 0.25s ease;
  color: var(--text-muted);
}

.accordion-item.open .accordion-arrow {
  transform: rotate(180deg);
}

.accordion-content {
  padding: 0 18px 18px 18px;
  display: none;
  font-size: 0.86rem;
  color: var(--text);
  border-top: 1px solid var(--border);
  margin-top: 4px;
  padding-top: 14px;
}

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

/* List Items / Protocols */
.protocol-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--input-bg);
  margin-bottom: 8px;
  font-size: 0.82rem;
}

.bullet-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8F62C7;
  flex-shrink: 0;
  margin-top: 6px;
}

/* Form Controls & Inputs */
.form-group {
  margin-bottom: 16px;
}

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

.form-sublabel {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: block;
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(45, 27, 78, 0.1);
}

.btn-primary {
  width: 100%;
  padding: 14px 20px;
  border-radius: 16px;
  background: var(--primary);
  color: #FFFFFF;
  border: none;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.15s ease, opacity 0.15s ease;
  text-decoration: none;
}

[data-zone="red"] .btn-primary {
  background: #D4B8E0;
  color: #1A1025;
}

.btn-primary:hover {
  opacity: 0.94;
  transform: translateY(-1px);
}

.btn-secondary {
  width: 100%;
  padding: 13px 18px;
  border-radius: 16px;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s ease;
  text-decoration: none;
}

.btn-secondary:hover {
  background: var(--input-bg);
}

/* Symptom Chips */
.symptom-group-title {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 16px 0 10px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

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

.symptom-chip {
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--text);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  user-select: none;
  transition: all 0.2s ease;
}

.symptom-chip:hover {
  transform: translateY(-1px);
}

.symptom-chip.selected {
  background: #2D1B4E;
  color: #FFFFFF;
  border-color: #2D1B4E;
}

[data-zone="red"] .symptom-chip.selected {
  background: #D4B8E0;
  color: #1A1025;
  border-color: #D4B8E0;
}

/* Toggle Switch */
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.switch-label-col {
  flex: 1;
  padding-right: 14px;
}

.switch-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
}

.switch-desc {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 34px;
  transition: 0.25s;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text);
  border-radius: 50%;
  transition: 0.25s;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--primary);
}

[data-zone="red"] .toggle-switch input:checked + .toggle-slider {
  background-color: #D4B8E0;
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(20px);
  background-color: #FFFFFF;
}

[data-zone="red"] .toggle-switch input:checked + .toggle-slider:before {
  background-color: #1A1025;
}

/* Chat Styles (Bloomy Chat) */
.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 150px);
  justify-content: flex-start;
  padding: 0 16px;
  overflow-y: auto;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chat-suggestions-scroll {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 0;
  flex-shrink: 0;
  background: var(--bg);
  position: relative;
  z-index: 5;
}

.chat-suggestion-chip {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.78rem;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}

.message {
  display: flex;
  flex-direction: column;
  max-width: 86%;
  animation: fadeInMsg 0.25s ease;
}

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

.message.user {
  align-self: flex-end;
}

.message.bot {
  align-self: flex-start;
}

.msg-bubble {
  padding: 13px 16px;
  border-radius: 18px;
  font-size: 0.88rem;
  line-height: 1.42;
}

.message.user .msg-bubble {
  background: var(--primary);
  color: #FFFFFF;
  border-bottom-right-radius: 4px;
}

[data-zone="red"] .message.user .msg-bubble {
  background: #2D1438;
  color: #F0EBF8;
  border: 1px solid rgba(212, 184, 224, 0.25);
}

.message.bot .msg-bubble {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow-sm);
}

.msg-timestamp {
  font-size: 0.66rem;
  color: var(--text-muted);
  margin-top: 4px;
  align-self: flex-end;
}

.chat-input-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow-md);
}

.chat-input-bar input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.9rem;
  color: var(--text);
  padding: 6px 4px;
}

.chat-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary);
  color: #FFFFFF;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

[data-zone="red"] .chat-send-btn {
  background: #D4B8E0;
  color: #1A1025;
}

.chat-send-btn:hover {
  transform: scale(1.05);
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-sheet {
  width: 100%;
  max-width: 480px;
  background: var(--card);
  border-top-left-radius: 26px;
  border-top-right-radius: 26px;
  padding: 22px 20px 32px 20px;
  max-height: 85vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.25s ease;
}

.modal-overlay.open .modal-sheet {
  transform: translateY(0);
}

.modal-handle {
  width: 42px;
  height: 4px;
  border-radius: 2px;
  background: var(--text-muted);
  opacity: 0.3;
  margin: 0 auto 16px auto;
}

/* PWA Install Banner */
.pwa-banner {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.feedback-btn {
  position: fixed;
  bottom: 90px;
  right: 16px;
  background: linear-gradient(135deg, #c9921a, #e6b84a);
  color: #1a1033;
  font-weight: 700;
  font-size: 12px;
  padding: 10px 14px;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(201,146,26,0.4);
  z-index: 9999;
  text-decoration: none;
  white-space: nowrap;
}