/**
 * aimy.bio — Main Stylesheet (nowa odsłona, v2)
 * Język wizualny 1:1 z oryginałem (main.css v3.0.0): zieleń wellness,
 * Caveat + Roboto, radius 24, miękkie cienie, jasna kolumna 500px.
 * Fonty self-hostowane (zero zewnętrznych żądań — spójnie z sekcją RODO).
 */

/* ── Fonty (woff2 z Google Fonts, hostowane lokalnie) ── */
@font-face {
  font-family: 'Caveat';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/caveat-700-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Caveat';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/caveat-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/roboto-var-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/roboto-var-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── Tokeny (oryginalna paleta wellness) ── */
:root {
  --color-text: #202D25; --color-text-secondary: #5A7163; --color-background: #F0F5F2;
  --color-surface: #FFFFFF; --color-primary: #00875A; --color-accent: #00C48C;
  --color-border: #DCE5E0; --color-danger: #EF4444; --color-info: #3B82F6;
  --color-physical: #38BDF8; --color-emotional: #F9A825; --color-intellectual: #A78BFA;
  --sym-high: var(--color-primary); --sym-low: var(--color-text-secondary);
  --sym-critical: var(--color-danger); --sym-zero: var(--color-info);
  --match-sync: var(--color-primary); --match-mixed: #9A6B00; /* ciemniejszy amber niz --color-emotional: tekst .match-type zda WCAG AA na jasnym tle */
  --match-complement: var(--color-info); --color-heart: #EC4899;
  --chart-grid: #DCE5E0; --chart-text: #5A7163;
  --font-primary: 'Roboto', sans-serif; --font-display: 'Caveat', cursive;
  --border-radius: 24px; --shadow: 0 4px 16px rgba(32, 45, 37, 0.08);
  --max-width: 500px; --transition-speed: 0.3s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 15px; } /* gęstszy, aplikacyjny rytm na mobile */

/* mikro-etykiety (meta-teksty wtopione w GUI) i liczby tabelaryczne */
#profile-counter, #days-alive, .cal-dow, .rings-sub, .cal-legend, .match-type {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--color-text-secondary);
}
.num, .cal-num, .kd-when strong, .match-bar-row strong, .ring-chip strong, .rings-day {
  font-variant-numeric: tabular-nums;
}

/* Widoczny fokus klawiatury (WCAG 2.4.7) */
:where(button, a, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}
body {
  font-family: var(--font-primary);
  background-color: var(--color-background);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

main, .site-header, .site-footer {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Header (logo jak w oryginale) ── */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}
.logo { position: relative; }
.logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 3.5rem;
  line-height: 1;
  background: linear-gradient(45deg, var(--color-primary), var(--color-accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  padding-right: 5px;
}
.tagline {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--color-text-secondary);
  position: absolute;
  bottom: -10px;
  left: 2.5em;
  white-space: nowrap;
  z-index: -1; /* jak w oryginale: tagline schowany za logo */
}

/* Przełącznik języka — dropdown z flagami (wspólny z lang-switch.js) */
.lang-switch { position: relative; }
.lang-current {
  display: flex; align-items: center; gap: 6px;
  background: var(--color-surface); border: 1px solid var(--color-border);
  color: var(--color-text); border-radius: 50px; padding: 0.4rem 0.7rem;
  font-family: var(--font-primary); font-size: 0.85rem; font-weight: 700; cursor: pointer;
}
.lang-current img, .lang-menu img { width: 22px; height: 16px; border-radius: 2px; display: block; flex: none; box-shadow: 0 0 0 1px rgba(32,45,37,.06); }
.lang-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 70;
  margin: 0; padding: 6px; list-style: none; min-width: 170px;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: 16px; box-shadow: var(--shadow);
}
.lang-menu li { margin: 0; }
.lang-menu a {
  display: flex; align-items: center; gap: 10px; padding: 0.5rem 0.6rem;
  border-radius: 10px; text-decoration: none; color: var(--color-text); font-size: 0.92rem;
}
.lang-menu a:hover { background: var(--color-background); }
.lang-menu a[aria-current="page"] { font-weight: 700; color: var(--color-primary); }

/* Przełącznik profilu — dropdown w sticky-nav (aktywny profil + lista + dodaj/edytuj) */
.profile-switch { position: relative; }
.profile-current {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--color-primary); color: #fff; border: none;
  border-radius: 50px; padding: 0.45rem 0.8rem;
  font-family: var(--font-primary); font-size: 0.85rem; font-weight: 700; cursor: pointer;
  max-width: 11rem;
}
.profile-current #profile-active-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-current .ico { width: 16px; height: 16px; flex: none; }
.profile-current .chev { width: 13px; height: 13px; opacity: .85; flex: none; }
.profile-menu {
  position: fixed; z-index: 80; /* fixed — nie obcina go overflow scrollowanego nav (pozycja z JS) */
  display: flex; flex-direction: column; gap: 2px;
  margin: 0; padding: 6px; min-width: 190px;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: 16px; box-shadow: var(--shadow);
}
.profile-menu[hidden] { display: none; }  /* [hidden] musi wygrać z display:flex */
.profile-opt {
  text-align: left; background: none; border: none; cursor: pointer;
  padding: 0.5rem 0.7rem; border-radius: 10px;
  font-family: var(--font-primary); font-size: 0.92rem; color: var(--color-text);
}
.profile-opt:hover { background: var(--color-background); }
.profile-opt.active { font-weight: 700; color: var(--color-primary); }
.profile-opt.edit { color: var(--color-text-secondary); border-top: 1px solid var(--color-border); border-radius: 0; margin-top: 2px; padding-top: 0.6rem; }
.profile-opt.add { color: var(--color-primary); font-weight: 600; }

/* Box „Co ciekawe" — insight + analogie */
.insights {
  margin-top: 1rem; padding: 1rem 1.1rem;
  background: color-mix(in srgb, var(--color-accent) 9%, var(--color-surface));
  border: 1px solid color-mix(in srgb, var(--color-accent) 22%, var(--color-border));
  border-radius: var(--border-radius);
}
.insights-title {
  display: flex; align-items: center; gap: 8px; margin: 0 0 0.5rem;
  font-family: var(--font-display); color: var(--color-primary); font-size: 1.25rem;
}
.insights-title svg { width: 20px; height: 20px; flex: none; }
.insight-item { margin: 0.45rem 0; color: var(--color-text); line-height: 1.6; }
.insight-item:last-child { margin-bottom: 0; }

/* ── Nawigacja sekcji (sticky, jak tab-bar aplikacji) ── */
.section-nav {
  position: sticky;
  top: 0;
  z-index: 60;
  background-color: color-mix(in srgb, var(--color-background) 84%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  padding: 0.55rem 1rem 0.65rem;
  display: flex;
  flex-wrap: nowrap; /* mobile: 1 wiersz, poziomy scroll zamiast 2 rzędów */
  overflow-x: auto;
  justify-content: flex-start;
  gap: 0.35rem;
  scrollbar-width: none; /* Firefox */
}
.section-nav::-webkit-scrollbar { display: none; } /* WebKit — ukryj pasek */
.section-nav > * { flex: none; } /* elementy nie kurczą się — pełna szerokość, scroll */
section[id] { scroll-margin-top: 5.5rem; } /* sticky nav (1 rząd; zapas na zawinięcie przy bardzo wąskich ekranach) */
.section-nav a {
  flex: none;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  border-radius: 50px;
  padding: 0.42rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  transition: all var(--transition-speed);
}
.section-nav a:hover { color: var(--color-primary); border-color: var(--color-primary); }

/* ── Karty ── */
.card {
  background-color: var(--color-surface);
  padding: 1.4rem 1.25rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}
.card h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.8rem;
  line-height: 1.2;
  color: var(--color-primary);
  text-align: center;
  margin-bottom: 0.75rem;
}
.section-head { text-align: center; margin-bottom: 0.5rem; }
.section-head h2 { margin-bottom: 0.25rem; }
.muted { color: var(--color-text-secondary); font-size: 0.85rem; }
.section-head .muted { display: block; }
.hint {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  text-align: center;
  margin: 0.5rem auto 1rem;
  max-width: 40ch;
}

/* ── Profile ── */
.btn-link {
  display: block;
  margin: 0 auto;
  background: none;
  border: none;
  padding: 0;
  color: var(--color-primary);
  font-family: var(--font-primary);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
}

.profile-form { display: flex; flex-direction: column; gap: 1rem; margin-top: 1rem; }
.match-selects label,
.profile-form label { font-weight: 700; font-size: 0.9rem; color: var(--color-text-secondary); display: block; }
.match-selects label span,
.profile-form label span { display: block; margin-bottom: 0.4rem; }
.match-selects select,
.profile-form input, .profile-form select {
  width: 100%;
  padding: 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  font-family: var(--font-primary);
  font-size: max(16px, 1rem); /* <16px = auto-zoom na iOS */
  color: var(--color-text);
  background-color: var(--color-surface);
}
.match-selects select:focus,
.profile-form input:focus, .profile-form select:focus {
  border-color: var(--color-primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 135, 90, 0.2);
}
#form-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--color-primary);
  text-align: center;
  margin-top: 1rem;
}
.form-actions { display: flex; flex-direction: column; gap: 0.75rem; }

/* Segmented control (radio-pigułki — np. pora urodzenia) */
.field .field-label { display: block; font-weight: 700; font-size: 0.9rem; color: var(--color-text-secondary); margin-bottom: 0.4rem; }
.segmented { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  display: inline-block;
  background-color: var(--color-surface);
  border: 2px solid var(--color-border);
  color: var(--color-text);
  border-radius: 50px;
  padding: 0.65rem 1.1rem;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-speed);
}
.seg:hover span { border-color: var(--color-accent); background-color: #f8fbf9; }
.seg:has(input:checked) span {
  border-color: var(--color-primary);
  background-color: #f0f5f2;
  color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0, 135, 90, 0.2);
}
.seg input:focus-visible + span { outline: 3px solid var(--color-primary); outline-offset: 2px; }

.btn {
  background-color: var(--color-primary);
  color: #fff;
  border: none;
  padding: 0.85rem 1.5rem;
  border-radius: var(--border-radius);
  font-family: var(--font-primary);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-speed);
  text-transform: lowercase;
  width: 100%;
}
.btn:hover { background-color: #006A4B; transform: translateY(-2px); box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); }
.btn.ghost { background-color: var(--color-surface); color: var(--color-text-secondary); border: 1px solid var(--color-border); }
.btn.ghost:hover { background-color: var(--color-background); box-shadow: none; }
.btn.danger { background-color: var(--color-danger); }
.btn.danger:hover { background-color: #d03a3a; }

/* ── Komunikaty statusu (aria-live) ── */
.status-msg { min-height: 1.3em; font-size: 0.9rem; font-weight: 700; margin-top: 0.5rem; text-align: center; }
.status-msg.ok { color: var(--color-primary); }
.status-msg.bad { color: var(--color-danger); }

/* ── Dziś — karty cykli (kompaktowe wiersze-widgety) ── */
.today-grid { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 0.75rem; }
.cycle-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 0.7rem 0.9rem;
}
.cycle-info { flex: 1; min-width: 0; }
.cycle-name { font-size: 0.95rem; font-weight: 700; line-height: 1.3; }
.cycle-name::before, .keyday-card h3::before, .chart-block h3::before {
  content: '';
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  background-color: var(--cycle-color);
  margin-right: 0.45rem;
}
.cycle-meta { display: block; font-size: 0.8rem; color: var(--color-text-secondary); line-height: 1.4; }
.cycle-phase { color: var(--sym-color-text, var(--sym-color)); }

/* ── Dymki info (popover) + details „czytaj więcej" ── */
.tip-anchor { position: relative; display: inline-flex; vertical-align: middle; }
.info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 50%;
  color: var(--color-text-secondary);
  opacity: 0.65;
  cursor: pointer;
  transition: all var(--transition-speed);
}
.info-btn:hover { opacity: 1; color: var(--color-primary); }
.info-btn::before { content: ''; position: absolute; inset: -8px; } /* hit-area 44px bez zmiany wyglądu */
.info-btn { position: relative; }
.info-btn svg { width: 20px; height: 20px; }
.card h2 .info-btn svg { width: 22px; height: 22px; }
.tip-pop {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: min(300px, 78vw);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(32, 45, 37, 0.16);
  padding: 0.7rem 0.9rem;
  font-family: var(--font-primary);
  font-size: 0.85rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--color-text);
  text-align: left;
  text-transform: none;
  z-index: 50;
}
.cycle-card .tip-pop { left: auto; right: 0; transform: none; }

details.more { margin-top: 0.25rem; }
details.more summary {
  cursor: pointer;
  list-style: none;
  display: inline-block;
  color: var(--color-primary);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: underline;
}
details.more summary::-webkit-details-marker { display: none; }
details.more[open] summary { margin-bottom: 0.6rem; }

.symbol-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px; height: 46px;
  border-radius: 50%;
  font-size: 1.35rem;
  font-weight: 700;
  flex: none;
  color: var(--sym-color);
  background-color: color-mix(in srgb, var(--sym-color) 12%, var(--color-surface));
  border: 2px solid color-mix(in srgb, var(--sym-color) 35%, var(--color-surface));
}
.sym-high { --sym-color: var(--sym-high); --sym-color-text: var(--color-primary); }
.sym-low { --sym-color: var(--sym-low); --sym-color-text: var(--color-text-secondary); }
.sym-critical { --sym-color: var(--sym-critical); --sym-color-text: #B91C1C; }
.sym-zero { --sym-color: var(--sym-zero); --sym-color-text: #2563EB; }

/* ── Okręgi 3-w-1 (hero dnia) ── */
.rings-wrap { position: relative; width: min(230px, 64vw); margin: 0.75rem auto 0; }
.rings-wrap svg { display: block; width: 100%; height: auto; }
.ring-track { fill: none; stroke: var(--color-background); stroke-width: 13; }
.ring-bar { fill: none; stroke-width: 13; stroke-linecap: round; }
.rings-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
}
.rings-day {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.6rem;
  line-height: 1;
  color: var(--color-primary);
}
.rings-legend {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 0.4rem 1.1rem;
  margin: 0.85rem 0 0.5rem;
}
.ring-chip { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; font-weight: 500; }
.ring-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.ring-chip strong { color: var(--color-text); }

/* ── Dni kluczowe ── */
.keydays-grid { display: flex; flex-direction: column; gap: 1rem; margin-top: 1rem; }
.keyday-card { border: 1px solid var(--color-border); border-radius: 18px; padding: 1rem 1.25rem; }
.keyday-card h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.6rem; }
.keyday-card ul { list-style: none; display: flex; flex-direction: column; gap: 0.55rem; }
.keyday-card li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.6rem;
}
.kd-label { font-size: 0.85rem; color: var(--color-text); }
.kd-when { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; }
.kd-when strong { color: var(--color-primary); font-size: 0.9rem; white-space: nowrap; }
.kd-when em { color: var(--color-text-secondary); font-style: normal; font-size: 0.72rem; white-space: nowrap; }
.symbol-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  flex: none;
  color: var(--sym-color);
  background-color: color-mix(in srgb, var(--sym-color) 14%, var(--color-surface));
  border: 1.5px solid color-mix(in srgb, var(--sym-color) 40%, var(--color-surface));
}

/* ── Dopasowanie partnerskie (BioMatch) ── */
.match-selects {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  align-items: end;
  margin: 0.75rem 0 1.25rem;
}
.match-heart {
  text-align: center;
  color: var(--color-heart);
  line-height: 1;
  padding-bottom: 0.35rem;
}
.match-heart svg { width: 1.7rem; height: 1.7rem; }

.match-result { display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.match-ring-wrap { position: relative; width: 170px; flex: none; }
.match-ring-wrap svg { display: block; width: 100%; height: auto; }
.match-overall { font-size: 2.2rem; } /* nadpisuje .rings-day */
.match-type { margin-top: 2px; }

.match-detail { width: 100%; }
.match-bars { display: flex; flex-direction: column; gap: 0.6rem; }
.match-bar-row {
  display: grid;
  grid-template-columns: 6.5rem 1fr 3rem;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
}
.match-bar-label { font-weight: 700; }
.match-bar-track { height: 8px; background-color: var(--color-background); border-radius: 50px; overflow: hidden; }
.match-bar-fill { display: block; height: 100%; background-color: var(--cycle-color); border-radius: 50px; }
.match-bar-row strong { text-align: right; }
.match-advice {
  margin-top: 1rem;
  background-color: var(--color-background);
  border-radius: 14px;
  padding: 0.85rem 1.1rem;
  text-align: center;
  font-size: 0.95rem;
}

/* ── Rodzina — wspólne biorytmy ── */
.family-grid { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.75rem; }
.family-row {
  display: grid;
  grid-template-columns: 1.1fr repeat(3, 1fr);
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: 14px;
}
.family-row.family-head { border: none; padding-top: 0; padding-bottom: 0; font-size: 0.8rem; font-weight: 700; color: var(--color-text-secondary); }
.family-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.family-col { display: inline-flex; align-items: center; gap: 0.4rem; }
.family-col em { font-style: normal; color: var(--color-text-secondary); font-size: 0.85rem; }
.family-common {
  display: block;
  width: fit-content;
  margin: 0.9rem auto 0;
  padding: 0.45rem 1.1rem;
  background-color: color-mix(in srgb, var(--color-primary) 8%, var(--color-surface));
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-primary);
  text-align: center;
}

/* ── Kalendarz miesiąca ── */
.calendar { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--color-border); }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
.cal-head h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--color-primary);
  text-transform: capitalize;
}
.cal-nav {
  width: 44px; height: 44px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  border-radius: 50%;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  transition: all var(--transition-speed);
}
.cal-nav:hover { color: var(--color-primary); border-color: var(--color-primary); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { text-align: center; padding-bottom: 2px; }
.cal-day {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  aspect-ratio: 1;
  border-radius: 12px;
  font-size: 0.85rem;
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-primary);
  color: var(--color-text);
  cursor: pointer;
  transition: background-color var(--transition-speed);
}
.cal-day:hover { background-color: var(--color-background); }
.cal-day.selected {
  background-color: color-mix(in srgb, var(--color-accent) 12%, var(--color-surface));
  box-shadow: inset 0 0 0 2px var(--color-accent);
}
.cal-day.has-note::after {
  content: '';
  width: 14px; height: 3px;
  border-radius: 2px;
  background-color: var(--color-primary);
}
.cal-note-mark { display: inline-block; width: 14px; height: 3px; border-radius: 2px; background-color: var(--color-text-secondary); }
.cal-day.today {
  background-color: color-mix(in srgb, var(--color-primary) 10%, var(--color-surface));
  box-shadow: inset 0 0 0 2px var(--color-primary);
  font-weight: 700;
}
.cal-day.today .cal-num { color: var(--color-primary); }
.cal-marks { display: flex; gap: 3px; height: 9px; }
.cal-mark {
  width: 9px; height: 9px;
  border-radius: 50%;
  background-color: var(--cycle-color);
}
.cal-mark.zero { background-color: var(--color-surface); box-shadow: inset 0 0 0 2px var(--cycle-color); }
.cal-legend { display: flex; justify-content: center; gap: 1.5rem; margin-top: 0.75rem; }
.cal-legend span { display: inline-flex; align-items: center; gap: 0.4rem; }
.cal-mark.sample { --cycle-color: var(--color-text-secondary); }

/* ── Panel dnia + dzienniczek samopoczucia ── */
.day-detail { margin-top: 1.25rem; border-top: 1px dashed var(--color-border); padding-top: 1rem; }
.day-detail-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 0.75rem; }
.day-detail-head h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--color-primary);
}
.day-detail-head h3::first-letter { text-transform: uppercase; }
.journal { margin-top: 1.25rem; }
.journal h4 { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.6rem; }
.journal .segmented { margin-bottom: 0.75rem; }
.journal textarea {
  width: 100%;
  padding: 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  font-family: var(--font-primary);
  font-size: max(16px, 0.95rem); /* iOS auto-zoom */
  color: var(--color-text);
  resize: vertical;
  min-height: 70px;
}
.journal textarea:focus { border-color: var(--color-primary); outline: none; box-shadow: 0 0 0 3px rgba(0, 135, 90, 0.2); }
.journal-actions { display: flex; gap: 0.5rem; margin-top: 0.75rem; }
.journal-actions .btn { width: auto; padding: 0.7rem 1.4rem; }

/* ── Wykresy ── */
.chart-block { margin-top: 1.25rem; }
.chart-block h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.4rem; }
.chart-block canvas { width: 100%; display: block; }

/* ── Metoda / hołd ── */
.method p { font-size: 0.92rem; margin-bottom: 0.85rem; }
.tribute {
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1.3;
  color: var(--color-primary);
  text-align: center;
  margin: 1rem 0;
}
.phase-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.phase-table th, .phase-table td { border: 1px solid var(--color-border); padding: 0.5rem 0.4rem; text-align: center; }
.phase-table thead th { background-color: var(--color-background); color: var(--color-text-secondary); }
.phase-table tbody th { text-align: left; font-weight: 700; }

/* ── Prywatność ── */
#privacy p { font-size: 0.92rem; margin-bottom: 0.85rem; }

/* ── Footer ── */
.site-footer { text-align: center; padding-bottom: 2.5rem; color: var(--color-text-secondary); font-size: 0.78rem; }
.site-footer .muted { display: block; margin-bottom: 0.75rem; }
.site-footer a { color: var(--color-primary); text-decoration: none; font-weight: 700; }
.site-footer a:hover { text-decoration: underline; }

/* ── Desktop (≥960px): szeroki łam, okręgi obok kart, siatki wielokolumnowe ── */
@media (min-width: 960px) {
  html { font-size: 16px; }
  main, .site-header, .site-footer { max-width: 1080px; }
  .card { padding: 2rem 2.5rem; margin-bottom: 1.25rem; }
  .card h2 { font-size: 2rem; }
  .today-grid { gap: 0.75rem; margin-top: 0; }

  .today-layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 2.5rem;
    align-items: center;
    margin-top: 0.5rem;
  }
  .rings-wrap { width: 280px; }

  .keydays-grid { display: grid; grid-template-columns: repeat(3, 1fr); }
  .calendar { max-width: 680px; margin-left: auto; margin-right: auto; }
  .day-detail { max-width: 680px; margin-left: auto; margin-right: auto; }

  .family-row { grid-template-columns: 1.4fr repeat(3, 1fr); max-width: 760px; margin: 0 auto; width: 100%; }
  .family-row.family-head { margin-bottom: -0.25rem; }

  .section-nav { flex-wrap: nowrap; gap: 0.4rem; padding-bottom: 1.25rem; }
  .section-nav a { padding: 0.45rem 1rem; font-size: 0.85rem; }
  section[id] { scroll-margin-top: 64px; }

  .match-selects { grid-template-columns: 1fr auto 1fr; gap: 1rem; max-width: 720px; margin-left: auto; margin-right: auto; }
  .match-heart { padding-bottom: 0.6rem; }
  .match-heart svg { width: 2.1rem; height: 2.1rem; }
  .match-result {
    flex-direction: row;
    gap: 2.5rem;
    max-width: 760px;
    margin: 0 auto;
  }
  .match-ring-wrap { width: 190px; }

  .method p, #privacy p { max-width: 72ch; margin-left: auto; margin-right: auto; }
  .method details.more, #privacy details.more { max-width: 72ch; margin-left: auto; margin-right: auto; }
  .phase-table { max-width: 640px; margin: 0.75rem auto 0; }
  .hint { max-width: 64ch; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
