:root {
  --plum: #6f4e7d;
  --plum-dark: #4f3759;
  --pink: #f0c8d2;
  --fertile: #cfe8d8;
  --predicted: #f5e3a8;
  --bg: #fdfbfd;
  --text: #2a2430;
  --muted: #7a7180;
  --danger: #b3453e;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-bottom: 72px;
}

.appheader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: var(--plum);
  color: white;
}
.appheader h1 { font-size: 1.2rem; margin: 0; }
.lang-toggle {
  background: rgba(255,255,255,0.15);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.85rem;
}

.disclaimer {
  font-size: 0.78rem;
  color: var(--muted);
  padding: 10px 16px;
  margin: 0;
  background: #f4eef6;
  border-bottom: 1px solid #e7dbeb;
}

main { padding: 12px 16px 24px; max-width: 480px; margin: 0 auto; }

.view { display: none; }
.view.active { display: block; }

.cal-nav { display: flex; justify-content: space-between; margin-bottom: 8px; }
.cal-nav button { font-size: 1.4rem; background: none; border: none; color: var(--plum); padding: 4px 16px; }

.cal-header { text-align: center; font-weight: 600; margin-bottom: 8px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-weekday { text-align: center; font-size: 0.75rem; color: var(--muted); padding: 4px 0; }
.cal-day {
  aspect-ratio: 1;
  border: none;
  background: #f1edf3;
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--text);
}
.cal-day-empty { background: transparent; }
.cal-day-period { background: var(--pink); font-weight: 600; }
.cal-day-predicted { background: var(--predicted); font-weight: 600; }
.cal-day-fertile { background: var(--fertile); }
.cal-day-today { outline: 2px solid var(--plum); outline-offset: -2px; }

.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 0.72rem; color: var(--muted); margin: 10px 0; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.dot-period { background: var(--pink); }
.dot-predicted { background: var(--predicted); }
.dot-fertile { background: var(--fertile); }

.card { background: white; border: 1px solid #ecdff0; border-radius: 10px; padding: 12px 14px; margin-top: 8px; }
.card p { margin: 6px 0; font-size: 0.9rem; }
.muted { color: var(--muted); font-size: 0.82rem; }

form label { display: block; margin-bottom: 10px; font-size: 0.85rem; }
form input, form select, form textarea {
  width: 100%;
  padding: 8px;
  margin-top: 4px;
  border: 1px solid #d9cfdd;
  border-radius: 8px;
  font-size: 1rem;
  background: white;
  color: var(--text);
}
fieldset { border: none; padding: 0; margin: 0 0 10px; }
fieldset legend { font-size: 0.85rem; padding: 0; margin-bottom: 6px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: #f1edf3; border-radius: 16px; padding: 6px 10px; font-size: 0.8rem; width: auto; margin: 0; }
.chip input { width: auto; margin: 0; }

.btn-primary, .btn-secondary, .btn-danger {
  display: inline-block;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 0.95rem;
  margin-top: 6px;
  cursor: pointer;
  text-align: center;
}
.btn-primary { background: var(--plum); color: white; width: 100%; }
.btn-secondary { background: #ece4ef; color: var(--plum-dark); }
.btn-danger { background: #fbe9e8; color: var(--danger); margin-top: 16px; }

.entry-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #eee2ee;
  font-size: 0.88rem;
}
.entry-symptoms, .entry-notes { color: var(--muted); font-size: 0.8rem; margin-top: 2px; }
.btn-delete { background: none; border: none; color: var(--danger); font-size: 0.8rem; white-space: nowrap; }

.bottomnav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  display: flex;
  background: white;
  border-top: 1px solid #e7dbeb;
}
.navbtn {
  flex: 1;
  background: none;
  border: none;
  padding: 12px 4px;
  font-size: 0.82rem;
  color: var(--muted);
}
.navbtn.active { color: var(--plum); font-weight: 600; }

.toast {
  position: fixed;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--plum-dark);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.82rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
