@font-face {
  font-family: "Inter Variable";
  src: url("fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #f2f2f7;
  --surface: #ffffff;
  --fill: #e9e9ee;
  --press: #e5e5ea;
  --text: #000000;
  --muted: #6c6c70;
  --line: #e0e0e5;
  --period: #e0234e;
  --on-period: #ffffff;
  --period-text: #c81a42;
  --period-soft: #ffe2e9;
  --peak: #1c7c33;
  --peak-soft: #dcf6e2;
  --peak-solid: #2fb350;
  --ovulation: #0071e3;
  --fert-soft: #dcebff;
  --switch: #34c759;
  --seg-on: #ffffff;
  --hud: #101014;
  --glass: rgb(255 255 255 / .72);
  --glass-edge: rgb(255 255 255 / .75);
  --glass-shadow: 0 10px 30px rgb(0 0 0 / .13), 0 1px 3px rgb(0 0 0 / .08);

  --gap: 16px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter Variable", "Segoe UI", Roboto, system-ui, sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #000000;
    --surface: #1c1c1e;
    --fill: #2c2c2e;
    --press: #38383a;
    --text: #ffffff;
    --muted: #98989f;
    --line: #2f2f32;
    --period-text: #ff6b8a;
    --period-soft: #3d1320;
    --peak: #32d74b;
    --peak-soft: #0f3318;
    --peak-solid: #30d158;
    --ovulation: #409cff;
    --fert-soft: #10304f;
    --switch: #30d158;
    --seg-on: #636366;
    --hud: #ffffff;
    --glass: rgb(44 44 46 / .66);
    --glass-edge: rgb(255 255 255 / .13);
    --glass-shadow: 0 10px 30px rgb(0 0 0 / .6);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --surface: #1c1c1e;
  --fill: #2c2c2e;
  --press: #38383a;
  --text: #ffffff;
  --muted: #98989f;
  --line: #2f2f32;
  --period-text: #ff6b8a;
  --period-soft: #3d1320;
  --peak: #32d74b;
  --peak-soft: #0f3318;
  --peak-solid: #30d158;
  --ovulation: #409cff;
  --fert-soft: #10304f;
  --switch: #30d158;
  --seg-on: #636366;
  --hud: #ffffff;
  --glass: rgb(44 44 46 / .66);
  --glass-edge: rgb(255 255 255 / .13);
  --glass-shadow: 0 10px 30px rgb(0 0 0 / .6);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--fill) transparent; overflow-x: clip; background: var(--bg); }
body {
  margin: 0;
  overflow-x: clip;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.35 var(--font);
  letter-spacing: -.008em;
  font-variant-numeric: tabular-nums;
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
::selection { background: var(--period); color: var(--on-period); }
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }
h1 { font-size: 2.125rem; line-height: 1.12; font-weight: 700; letter-spacing: -.024em; }
h2 { font-size: 1.0625rem; line-height: 1.3; font-weight: 600; }
h3 { font-size: .8125rem; font-weight: 500; color: var(--muted); }
button, textarea, input { font: inherit; color: inherit; letter-spacing: inherit; }
button { touch-action: manipulation; cursor: pointer; background: none; border: 0; padding: 0; -webkit-user-select: none; user-select: none; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--ovulation); outline-offset: 2px; }
svg { display: block; }
.sprite { position: absolute; }
.icon { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Rahmen */
.main { padding: max(14px, env(safe-area-inset-top)) 16px calc(112px + env(safe-area-inset-bottom)); max-width: 1040px; margin-inline: auto; overflow-x: clip; }
.page { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.split, .home-month, .home-day { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-content: start; }
.head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-top: 6px; }
.head p { font-size: .9375rem; color: var(--muted); }

/* Schwebende Leiste */
.dock {
  position: fixed; z-index: 5; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 10px;
  width: min(calc(100% - 28px), 440px); transform: translateX(-50%);
  transition: transform 320ms var(--spring, var(--ease)), opacity 160ms;
}
.nav, .fab, .glass-group, .edit-action, .toast {
  background: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
  box-shadow: var(--glass-shadow), inset 0 .5px 0 var(--glass-edge);
}
.nav { flex: 1; min-width: 0; border-radius: 32px; padding: 4px; }
.brand { display: none; }
.nav-items { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.nav-items::before {
  content: ''; position: absolute; inset: 0 auto 0 0; width: calc(100% / 3);
  background: var(--fill); border-radius: 28px; pointer-events: none; will-change: transform;
  transform: translateX(calc(var(--tab-position, 0) * 100%)) scaleX(var(--tab-stretch, 1));
}
.nav-item {
  position: relative; display: grid; justify-items: center; align-content: center; gap: 1px; min-height: 54px; padding: 2px 4px; border-radius: 28px;
  color: var(--muted); font-size: .65rem; font-weight: 600; letter-spacing: 0;
  transition: color 120ms, transform var(--spring-ms, 200ms) var(--spring-bounce, var(--ease));
}
.nav-item:active { transform: scale(.92); transition-duration: 40ms; }
.nav-item[aria-current="page"] { color: var(--period-text); }
.fab {
  flex: none; width: 62px; height: 62px; display: grid; place-items: center; border-radius: 50%;
  background: var(--period); color: var(--on-period); -webkit-backdrop-filter: none; backdrop-filter: none;
  transition: transform var(--spring-ms, 200ms) var(--spring-bounce, var(--ease));
}
.fab:active { transform: scale(.9); transition-duration: 40ms; }
.fab .icon { width: 28px; height: 28px; stroke-width: 2.2; }

.edit-dock {
  position: fixed; z-index: 6; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom));
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: min(calc(100% - 28px), 440px);
  transform: translate(-50%, 140%); opacity: 0; pointer-events: none;
  transition: transform 320ms var(--spring, var(--ease)), opacity 160ms;
}
.edit-action { min-height: 56px; border-radius: 28px; font-weight: 600; transition: transform var(--spring-ms, 200ms) var(--spring-bounce, var(--ease)); }
.edit-action:active { transform: scale(.96); transition-duration: 40ms; }
.edit-action.is-primary { background: var(--period); color: var(--on-period); -webkit-backdrop-filter: none; backdrop-filter: none; }
.editing .dock { transform: translate(-50%, 140%); opacity: 0; pointer-events: none; }
.editing .edit-dock { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }

/* Bausteine */
.card { background: var(--surface); border-radius: 18px; padding: 14px var(--gap); display: grid; gap: 10px; align-content: start; }
.group-section { display: grid; gap: 7px; }
.group-section > h2 { font-size: .8125rem; font-weight: 500; color: var(--muted); padding-inline: var(--gap); }
.card:has(> .seg:only-child) { background: none; padding: 0; }
.group-section > .note { padding-inline: var(--gap); font-size: .8125rem; }
.btn {
  min-height: 50px; padding: 0 14px; border-radius: 14px; white-space: nowrap; width: 100%;
  font-weight: 600; transition: transform var(--spring-ms, 200ms) var(--spring-bounce, var(--ease)), opacity 100ms;
}
.btn:active:not(:disabled) { transform: scale(.97); transition-duration: 40ms; }
.btn:disabled { opacity: .4; }
.btn-primary { background: var(--period); color: var(--on-period); }
.btn-quiet { background: var(--fill); }
.btn-danger { background: var(--surface); color: var(--period-text); }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; transition: background-color 100ms, transform var(--spring-ms, 200ms) var(--spring-bounce, var(--ease)); }
.icon-btn .icon { width: 21px; height: 21px; stroke-width: 2.1; }
.icon-btn:active { transform: scale(.88); transition-duration: 40ms; }
.icon-btn.small { width: 32px; height: 32px; color: var(--muted); }
.icon-btn.small .icon { width: 18px; height: 18px; }
.icon-btn[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.pill { min-height: 34px; padding: 0 14px; border-radius: 17px; background: var(--fill); font-size: .875rem; font-weight: 600; white-space: nowrap; transition: transform var(--spring-ms, 200ms) var(--spring-bounce, var(--ease)); }
.pill:active { transform: scale(.94); transition-duration: 40ms; }
.chip {
  min-height: 38px; padding: 0 14px; border-radius: 19px; background: var(--fill);
  font-size: .9375rem; white-space: nowrap;
  transition: transform var(--spring-ms, 200ms) var(--spring-bounce, var(--ease)), background-color 60ms, color 60ms;
}
.chip:active:not(:disabled) { transform: scale(.94); transition-duration: 40ms; }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; padding: 2px; border-radius: 10px; background: var(--fill); }
.seg button { min-height: 36px; padding-inline: 6px; border-radius: 8px; font-size: .875rem; font-weight: 500; white-space: nowrap; transition: background-color 120ms; }
.seg button[aria-pressed="true"] { background: var(--seg-on); font-weight: 600; box-shadow: 0 1px 3px rgb(0 0 0 / .14); }
.note { font-size: .875rem; color: var(--muted); }
.link { color: var(--period-text); min-height: 40px; padding-inline: 8px; font-weight: 500; }
.message { background: var(--period-soft); border-radius: 14px; padding: 12px 14px; font-size: .9375rem; }

@media (hover: hover) {
  .nav-item:hover { color: var(--text); }
  .nav-item[aria-current="page"]:hover { color: var(--period-text); }
  .icon-btn:hover:not([aria-pressed="true"]) { background: var(--fill); }
  .chip:hover:not(:disabled):not([aria-pressed="true"]) { background: var(--press); }
  .btn-primary:hover, .fab:hover { filter: brightness(1.08); }
  .tile:hover, .mini:hover, .action:hover { filter: brightness(.98); }
}

/* Planet */
.world { display: none; position: relative; height: 244px; margin: max(8px, env(safe-area-inset-top)) 8px 0; border-radius: 28px; overflow: hidden; background: var(--surface); isolation: isolate; }
.has-world .world { display: block; }
.has-world .main { padding-top: 6px; }
#world-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; cursor: grab; }
#world-canvas:active { cursor: grabbing; }
.hud { position: absolute; z-index: 1; inset: 14px 16px auto; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; pointer-events: none; color: var(--hud); }
.hud h1 { font-size: 1.875rem; line-height: 1.1; }
.hud p { font-size: .875rem; opacity: .75; font-weight: 500; }
.hud-energy { display: grid; justify-items: end; gap: 4px; font-size: .875rem; font-weight: 600; text-align: right; }
.hud-energy[hidden] { display: none; }
.hud-training { font-size: .75rem; font-weight: 500; opacity: .75; white-space: nowrap; }
.pips { display: flex; gap: 3px; }
.pips i { width: 13px; height: 7px; border-radius: 3px; background: rgb(127 127 135 / .35); transition: background-color 180ms; }
.pips i.on { background: currentColor; }
.world-bubble {
  position: absolute; z-index: 1; left: 50%; bottom: 98px; transform: translateX(-50%); width: min(calc(100% - 40px), 280px);
  padding: 8px 12px; border-radius: 16px; background: var(--surface); color: var(--text); font-size: .8125rem; line-height: 1.3; text-align: center;
  box-shadow: 0 4px 14px rgb(0 0 0 / .16); pointer-events: none; animation: pop var(--spring-ms, 200ms) var(--spring-bounce, var(--ease)) both;
}

/* Kalender */
.cal-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px; margin-bottom: 4px; }
.cal-bar h1 { font-size: 1.375rem; letter-spacing: -.016em; }
.cal-bar h1 { min-width: 0; }
@media (max-width: 430px) { .cal-bar:has(.pill) .month-title span { display: none; } }
.month-title { white-space: nowrap; display: inline-flex; align-items: baseline; gap: 8px; font: inherit; letter-spacing: inherit; }
.month-title span { font-size: 1rem; font-weight: 400; color: var(--muted); letter-spacing: -.01em; }
.cal-nav { display: flex; align-items: center; gap: 8px; flex: none; }
.glass-group { display: flex; border-radius: 22px; padding: 2px; background: var(--surface); box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.cal-clip { overflow: hidden; margin-inline: -4px; padding-inline: 4px; }
.cal-strip { position: relative; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.cal-strip .ghost { position: absolute; top: 0; width: 100%; pointer-events: none; }
.cal-grid { position: relative; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); row-gap: 1px; }
.cal-grid .wd { font-size: .75rem; font-weight: 500; color: var(--muted); text-align: center; padding-bottom: 6px; }
.day { position: relative; height: 39px; display: grid; place-items: center; font-size: 1.0625rem; font-weight: 400; transition: opacity 120ms; }
.day::before { content: ''; position: absolute; z-index: 0; inset: 2px 2px; border-radius: 18px; transition: background-color 160ms; }
.day.join-l::before { left: -1px; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.day.join-r::before { right: -1px; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.day .num { position: relative; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; transition: color 120ms; }
.day.band-period::before { background: var(--period); }
.day.band-period .num { color: var(--on-period); font-weight: 600; }
.day.band-pred::before { background: var(--period-soft); }
.day.band-pred .num { color: var(--period-text); font-weight: 500; }
.day.band-fert::before { background: var(--fert-soft); }
.day.band-fert .num { color: var(--ovulation); font-weight: 600; }
.day.ov .num { background: var(--ovulation); color: #fff; font-weight: 700; }
.day.band-peak::before { background: var(--peak-soft); }
.day.band-peak .num { color: var(--peak); font-weight: 600; }
.day.out .num { opacity: .32; }
.day.today .num { font-weight: 700; color: var(--period-text); }
.day.today.band-period .num { color: var(--on-period); box-shadow: inset 0 0 0 1.5px var(--on-period); }
.day.today.band-peak .num { color: var(--peak); }
.cal-grid:not(.drafting) .day[aria-pressed="true"] .num { color: var(--bg); font-weight: 600; opacity: 1; box-shadow: none; }
.day:active .num { transform: scale(.9); }
.puck {
  position: absolute; z-index: 1; top: 0; left: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--text);
  opacity: 0; pointer-events: none; will-change: transform; transition: opacity 120ms;
}
.puck.shown { opacity: 1; }
.day .num, .day .mark, .day .zt { z-index: 2; }
.day .zt { position: absolute; top: 0; right: 2px; font-size: .625rem; line-height: 1.3; color: var(--muted); }
.day .mark { position: absolute; bottom: 1px; left: 50%; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--muted); }
.day .mark.spot { background: var(--period); }
.day .mark.peak { background: var(--peak-solid); }
.day.band-period .mark:not(.ovulation) { background: var(--on-period); }
.day.match::before { background: var(--text); }
.day.match .num { color: var(--bg); font-weight: 600; }
.dimmed .day:not(.match) { opacity: .28; }

.drafting .day.band-peak::before, .drafting .day.band-pred::before, .drafting .day.band-fert::before { background: none; }
.drafting .day.band-peak .num, .drafting .day.band-pred .num, .drafting .day.band-fert .num { color: var(--text); font-weight: 400; background: none; }
.drafting .day:not(.band-period):not(:disabled) .num { box-shadow: inset 0 0 0 1px var(--line); }
.drafting .day:disabled { opacity: .3; }
.drafting .day .mark { display: none; }
.edit-panel { display: grid; gap: 12px; padding-top: 4px; }
.edit-hint { font-size: .9375rem; color: var(--muted); }

.legend-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 32px; padding-inline: 2px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .8125rem; color: var(--muted); }
.legend li { display: flex; align-items: center; gap: 6px; }
.swatch { width: 10px; height: 10px; border-radius: 50%; }
.swatch.period { background: var(--period); }
.swatch.pred { background: var(--period-soft); box-shadow: inset 0 0 0 1px var(--period); }
.swatch.peak { background: var(--peak-solid); }
.swatch.fert { background: var(--fert-soft); box-shadow: inset 0 0 0 1px var(--ovulation); }
.swatch.ov { background: var(--ovulation); }
.search-panel { display: grid; gap: 8px; }
.filter-row { display: flex; gap: 8px; overflow-x: auto; margin-inline: -16px; padding-inline: 16px; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }

/* Termine */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tiles.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tiles.three .tile { padding: 10px 8px 10px 10px; }
.tiles.three .tile strong { font-size: 1.0625rem; }
.tiles.three .tile-sub { font-size: clamp(.625rem, 2.9vw, .6875rem); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile { display: grid; gap: 1px; padding: 12px 14px; border-radius: 18px; background: var(--surface); text-align: left; transition: transform var(--spring-ms, 200ms) var(--spring-bounce, var(--ease)); }
.tile:active { transform: scale(.97); transition-duration: 40ms; }
.tile-label { display: flex; align-items: center; gap: 6px; font-size: .8125rem; color: var(--muted); white-space: nowrap; }
.tile strong { font-size: 1.3125rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.25; }
.tile strong.is-alert { color: var(--period-text); }
.tile-sub { font-size: .8125rem; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot.period { background: var(--period); }
.dot.peak { background: var(--peak-solid); }
.dot.fert { background: var(--ovulation); }
.welcome { text-align: left; }
.welcome .link { justify-self: center; }
.test-exit { justify-self: center; font-size: .875rem; }

/* Ausgewählter Tag */
.day-card { background: var(--surface); border-radius: 18px; padding: 14px var(--gap) var(--gap); display: grid; gap: 14px; }
.day-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.day-head h2 { font-size: 1.25rem; font-weight: 700; letter-spacing: -.016em; }
.day-head p { font-size: .875rem; color: var(--muted); }
.energy { display: grid; gap: 8px; }
.energy-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: .9375rem; color: var(--muted); }
.energy-top strong { font-weight: 600; color: var(--text); }
.meter { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.meter i { height: 7px; border-radius: 4px; background: var(--fill); transition: background-color 180ms; }
.meter i.on { background: var(--peak-solid); }
.meter i:nth-child(2) { transition-delay: 25ms; }
.meter i:nth-child(3) { transition-delay: 50ms; }
.meter i:nth-child(4) { transition-delay: 75ms; }
.meter i:nth-child(5) { transition-delay: 100ms; }
.energy-foot { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: .875rem; }
.energy-foot span:last-child { flex: none; color: var(--muted); font-size: .75rem; }
.fertility { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: .9375rem; color: var(--muted); }
.fertility strong { font-weight: 600; color: var(--text); }
.fertility strong.on { color: var(--ovulation); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { padding: 4px 10px; border-radius: 12px; background: var(--fill); font-size: .8125rem; }
.day-note { font-size: .9375rem; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }

/* Jahresansicht */
.year-head { align-items: center; }
.year { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mini { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; width: 100%; padding: 12px; border-radius: 18px; background: var(--surface); text-align: left; font-weight: 600; font-size: .9375rem; transition: transform var(--spring-ms, 200ms) var(--spring-bounce, var(--ease)); }
.mini:active { transform: scale(.97); transition-duration: 40ms; }
.mini-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.mini-grid i { aspect-ratio: 1; border-radius: 50%; background: var(--fill); }
.mini-grid i.blank { background: none; }
.mini-grid i.period { background: var(--period); }
.mini-grid i.pred { background: var(--period-soft); box-shadow: inset 0 0 0 1px var(--period); }
.mini-grid i.fert { background: var(--ovulation); opacity: .7; }
.mini-grid i.peak { background: var(--peak-solid); }
.mini-grid i.today { outline: 1.5px solid var(--text); outline-offset: 0; }

/* Verlauf */
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.facts dt { font-size: .8125rem; color: var(--muted); }
.facts dd { font-size: 1.25rem; font-weight: 700; letter-spacing: -.016em; }
.table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.table th { text-align: left; font-size: .8125rem; font-weight: 400; color: var(--muted); padding-bottom: 4px; }
.table td { padding: 8px 0; border-top: .5px solid var(--line); }
.table td:last-child, .table th:last-child { text-align: right; }
.card ul { display: grid; gap: 8px; }
.stat { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 12px; width: 100%; min-height: 44px; text-align: left; }
.stat b { font-weight: 600; }
.bar { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: var(--fill); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--period); }
.cycle { display: grid; gap: 6px; padding-block: 10px; border-top: .5px solid var(--line); }
.cycle:first-child { border-top: 0; padding-top: 0; }
.cycle-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cycle-top span { flex: 1; }
.cycle-top b { font-weight: 500; }
.cycle-top .link { min-height: 32px; font-size: .8125rem; padding-inline: 0; }
.cycle-bar { height: 8px; width: calc(var(--len) / var(--max) * 100%); border-radius: 4px; overflow: hidden; background: var(--fill); }
.cycle-bar i { display: block; height: 100%; width: calc(var(--days) / var(--len) * 100%); background: var(--period); }
.cycle.off .cycle-bar { opacity: .4; }
.cycle.off .cycle-top { color: var(--muted); }

/* Einstellungen */
.row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 40px; cursor: pointer; }
.card > .row + .row { border-top: .5px solid var(--line); padding-top: 10px; }
.row-text { display: grid; }
.row small { font-size: .8125rem; color: var(--muted); line-height: 1.35; }
.row.off { cursor: not-allowed; }
.row.fixed { cursor: default; }
.row.fixed .note { font-size: 1rem; }
.late-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; margin-bottom: 8px; padding: 12px 12px 12px var(--gap); border-radius: 18px; background: var(--period-soft); color: var(--period-text); text-align: left; transition: transform var(--spring-ms, 200ms) var(--spring-bounce, var(--ease)); }
.late-banner:active { transform: scale(.98); transition-duration: 40ms; }
.late-banner > span:first-child { display: grid; min-width: 0; }
.late-banner strong { font-weight: 600; line-height: 1.25; }
.late-banner small { font-size: .8125rem; opacity: .85; }
.late-banner .pill { flex: none; display: grid; place-items: center; background: var(--period); color: var(--on-period); }
.switch { appearance: none; flex: none; margin: 0; width: 51px; height: 31px; border-radius: 16px; background: var(--fill); position: relative; cursor: inherit; transition: background-color 180ms; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgb(0 0 0 / .25); transition: transform var(--spring-ms, 200ms) var(--spring-bounce, var(--ease)); }
.switch:checked { background: var(--switch); }
.switch:checked::after { transform: translateX(20px); }
.switch:disabled { opacity: .5; }
textarea {
  display: block; width: 100%; min-height: 84px; padding: 10px 12px; resize: vertical; font-size: 1rem;
  border: 0; border-radius: 12px; background: var(--fill); caret-color: var(--period);
}
textarea::placeholder { color: var(--muted); }

:root:has(.embedded), .embedded { height: 100%; overflow: hidden; overscroll-behavior: auto; scrollbar-width: none; }
.embedded .test-exit { display: none; }
.update-notes { display: grid; gap: 6px; padding: 0; font-size: .9375rem; }
.update-progress { height: 8px; border-radius: 4px; background: var(--fill); overflow: hidden; }
.update-progress i { display: block; height: 100%; background: var(--period); border-radius: 4px; transition: width 160ms linear; }
.update-safe { text-align: center; }
button.row { width: 100%; text-align: left; }

.lock { position: fixed; z-index: 20; inset: 0; display: grid; align-content: center; justify-items: center; gap: 28px; padding: 24px; background: var(--bg); }
.lock[hidden] { display: none; }
.lock h1 { font-size: 1.375rem; }
.pin-dots { display: flex; gap: 16px; }
.pin-dots i { width: 13px; height: 13px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--muted); transition: background-color 100ms; }
.pin-dots i.on { background: var(--text); box-shadow: none; }
.keypad { display: grid; grid-template-columns: repeat(3, 76px); gap: 14px; justify-items: center; }
.keypad button { display: grid; place-items: center; width: 76px; height: 76px; border-radius: 50%; background: var(--surface); font-size: 1.75rem; font-weight: 400; transition: transform var(--spring-ms, 200ms) var(--spring-bounce, var(--ease)); }
.keypad button:active { transform: scale(.9); transition-duration: 40ms; }
.keypad button:last-child, .keypad .key-plain { background: none; }
.keypad .key-plain .icon { width: 34px; height: 34px; stroke-width: 1.6; }

.back { display: flex; align-items: center; gap: 2px; min-height: 36px; margin-left: -6px; color: var(--period-text); font-weight: 500; }
.menu { padding: 0; gap: 0; overflow: hidden; }
.menu-row { position: relative; display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 14px; width: 100%; min-height: 52px; padding: 0 14px; text-align: left; transition: background-color 80ms; }
.app-icon { display: block; width: 100%; aspect-ratio: 1; border-radius: 23%; }
.app-icon-stage { display: grid; place-items: center; padding: 8px 0 4px; }
.app-icon-stage .app-icon { width: 104px; box-shadow: 0 8px 24px rgb(0 0 0 / .16); }
.icon-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(38px, 1fr)); gap: 10px; justify-items: center; }
.icon-option { max-width: 60px; width: 100%; border-radius: 28%; outline: 2px solid transparent; outline-offset: 2px; transition: transform var(--spring-ms, 200ms) var(--spring-bounce, var(--ease)), outline-color 120ms; }
.icon-apply { position: sticky; z-index: 1; bottom: calc(86px + env(safe-area-inset-bottom)); box-shadow: 0 6px 20px rgb(0 0 0 / .28); }
.icon-option:active { transform: scale(.92); transition-duration: 40ms; }
.icon-option[aria-pressed="true"] { outline-color: var(--period); }
.menu-row + .menu-row::before { content: ""; position: absolute; top: 0; left: 58px; right: 0; border-top: .5px solid var(--line); }
.menu-row .note { font-size: .9375rem; }
.menu-row:active { background: var(--press); }
.menu-row > .icon:last-child { width: 16px; height: 16px; color: var(--muted); }
.menu-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--tile, var(--fill)); color: #fff; }
.menu-icon .icon { width: 19px; height: 19px; stroke-width: 2.1; }
.settings-page { gap: 18px; }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button { width: 34px; height: 34px; border-radius: 50%; background: var(--fill); font-size: 1.125rem; }
.stepper output { min-width: 66px; text-align: center; font-weight: 500; }
.action-row { display: block; width: 100%; min-height: 40px; line-height: 40px; color: var(--period-text); font-weight: 500; text-align: left; cursor: pointer; }
.card > .action-row + .action-row { border-top: .5px solid var(--line); padding-top: 4px; }
.action-row.danger { color: var(--period); text-align: center; }
.disclaimer { padding-inline: var(--gap); font-size: .8125rem; }
.date-row input[type="time"] { border: 0; background: var(--fill); border-radius: 10px; padding: 6px 10px; }

/* Eintragen */
.sheet {
  position: fixed; inset: auto 0 0 0; width: 100%; max-width: 560px; max-height: 88dvh; margin: 0 auto;
  border: 0; border-radius: 24px 24px 0 0; padding: 0;
  background: var(--bg); color: var(--text);
  overflow-y: auto; overscroll-behavior: contain; will-change: transform;
}
.sheet:focus { outline: none; }
.sheet::backdrop { background: rgb(0 0 0 / .42); opacity: var(--p, 1); }
.sheet-head { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding: 20px var(--gap) 10px; background: var(--bg); touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }
.sheet-head h2 { font-size: 1.25rem; font-weight: 700; letter-spacing: -.016em; }
.sheet-head p { font-size: .875rem; color: var(--muted); }
.grabber { position: absolute; top: 7px; left: 50%; width: 36px; height: 5px; margin-left: -18px; border-radius: 3px; background: var(--muted); opacity: .4; }
.done { flex: none; min-height: 36px; padding: 0 2px; color: var(--period-text); font-weight: 600; }
.sheet-body { display: grid; gap: 18px; padding: 4px var(--gap) calc(20px + env(safe-area-inset-bottom)); }
.group { display: grid; gap: 8px; }
.action-list { padding: 0; gap: 0; overflow: hidden; }
.action { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 0 var(--gap); text-align: left; font-weight: 500; transition: background-color 80ms; }
.action + .action { border-top: .5px solid var(--line); }
.action:active { background: var(--press); }
.action-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; }
.action-icon .icon { width: 18px; height: 18px; stroke-width: 2; }
.action-icon.period { background: var(--period); color: var(--on-period); }
.action-icon.neutral { background: var(--fill); }
.date-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 40px; }
.date-row + .date-row { border-top: .5px solid var(--line); padding-top: 10px; }
.date-row input { border: 0; background: var(--fill); border-radius: 10px; padding: 6px 10px; min-height: 36px; }
.entry-form .note:empty { display: none; }

.toast {
  position: fixed; z-index: 10; left: 50%; top: calc(14px + env(safe-area-inset-top)); transform: translateX(-50%);
  max-width: min(calc(100% - 32px), 380px); display: none; align-items: center; gap: 12px; white-space: nowrap;
  padding: 7px 8px 7px 18px; min-height: 46px; border-radius: 23px; font-size: .9375rem; font-weight: 500;
}
.toast.show { display: flex; animation: drop var(--spring-ms, 200ms) var(--spring-bounce, var(--ease)) both; }
.toast button { min-height: 32px; padding: 0 12px; border-radius: 16px; background: var(--fill); font-size: .875rem; font-weight: 600; }

@keyframes pop { from { opacity: 0; transform: translateX(-50%) scale(.85); } }
@keyframes drop { from { opacity: 0; transform: translate(-50%, -24px) scale(.9); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (prefers-reduced-transparency: reduce) {
  .nav, .edit-action, .toast { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

@media (max-width: 359px) {
  .nav-item { font-size: .6rem; }
  .month-title span { display: none; }
  .legend { gap: 4px 10px; font-size: .75rem; }
  .fab { width: 54px; height: 54px; }
  .tile strong { font-size: 1.125rem; }
}

@media (min-width: 600px) {
  .year { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sheet { bottom: 24px; border-radius: 24px; }
}

@media (min-width: 900px) {
  .dock { left: 0; top: 0; bottom: 0; width: 220px; transform: none; flex-direction: column; align-items: stretch; justify-content: space-between; padding: 24px 12px; background: var(--surface); }
  .nav { flex: none; background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; border-radius: 0; padding: 0; }
  .brand { display: block; font-weight: 700; padding: 0 12px 14px; }
  .nav-items { grid-template-columns: 1fr; }
  .nav-items::before { width: 100%; height: calc(100% / 3); inset: 0 0 auto 0; border-radius: 12px; transform: translateY(calc(var(--tab-position, 0) * 100%)) scaleY(var(--tab-stretch, 1)); }
  .nav-item { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; font-size: .9375rem; border-radius: 12px; }
  .fab { width: 100%; height: 48px; border-radius: 14px; box-shadow: none; }
  .fab::after { content: 'Eintragen'; font-size: 1rem; font-weight: 600; }
  .fab { display: flex; justify-content: center; align-items: center; gap: 6px; }
  .fab .icon { width: 20px; height: 20px; }
  .editing .dock { transform: none; opacity: 1; pointer-events: auto; }
  .edit-dock { left: calc(50% + 110px); }
  .world { margin: 24px 40px 0 260px; height: 280px; }
  .main { margin-left: 220px; padding: 28px 40px 120px; max-width: none; }
  .page { max-width: 1040px; margin-inline: auto; }
  .split { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 24px; align-items: start; }
  .even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .year { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .day { height: 52px; }
  .day::before { inset: 6px 2px; }
  .filter-row { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
}

/* Android zeigt wegen scrollbar-color sonst einen festen Balken am Rand. */
@media (pointer: coarse) { html { scrollbar-width: none; } }
@media (max-width: 340px) {
  .cal-bar h1 { font-size: 1.1875rem; }
  .cal-bar .pill { padding-inline: 10px; }
  .cal-nav { gap: 4px; }
  .stepper { gap: 4px; }
  .stepper output { min-width: 52px; }
}
/* Inter macht Bindestriche sonst so breit wie Ziffern. */
.menu-row, .row, .head h1, .back { font-variant-numeric: normal; }

/* Partner */
:root[data-role="man"] { --period: #0a84ff; --period-text: #0062c4; --period-soft: #dcebff; --on-period: #fff; }
@media (prefers-color-scheme: dark) { :root[data-role="man"]:not([data-theme="light"]) { --period-text: #64b5ff; --period-soft: #10304f; } }
:root[data-role="man"][data-theme="dark"] { --period-text: #64b5ff; --period-soft: #10304f; }
:root[data-role="man"] .fab { display: none; }
.welcome .dock { display: none; }
.welcome-page { display: grid; gap: 14px; min-height: calc(100dvh - 120px); align-content: center; }
.role-card { display: grid; gap: 2px; padding: 18px var(--gap); border-radius: 18px; background: var(--surface); text-align: left; transition: transform var(--spring-ms, 200ms) var(--spring-bounce, var(--ease)); }
.role-card:active { transform: scale(.98); transition-duration: 40ms; }
.role-card strong { font-size: 1.125rem; font-weight: 600; }
.role-card small { font-size: .875rem; color: var(--muted); line-height: 1.35; }
.sos-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 54px; margin-top: 8px; border-radius: 18px; background: var(--period); color: var(--on-period); font-size: 1.0625rem; font-weight: 700; letter-spacing: .04em; transition: transform var(--spring-ms, 200ms) var(--spring-bounce, var(--ease)); }
.sos-btn:active { transform: scale(.98); transition-duration: 40ms; }
.field { display: grid; gap: 4px; font-size: .875rem; color: var(--muted); }
.field input { width: 100%; min-height: 46px; box-sizing: border-box; padding: 0 12px; border: 0; border-radius: 12px; background: var(--fill); color: var(--text); font: inherit; font-size: 1rem; }
.field input:focus-visible { outline: 2px solid var(--period); outline-offset: 1px; }
.field-error { min-height: 0; font-size: .875rem; color: var(--period-text); }
.field-error:empty { display: none; }
.link-box { padding: 10px 12px; border-radius: 12px; background: var(--fill); font-size: .8125rem; overflow-wrap: anywhere; }
.account-mail { overflow-wrap: anywhere; }
.file-button { display: grid; place-items: center; cursor: pointer; box-sizing: border-box; }
.catalog-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.catalog-card { display: grid; gap: 6px; padding: 6px 6px 8px; border-radius: 16px; background: var(--surface); text-align: center; font-size: .8125rem; line-height: 1.2; outline: 2px solid transparent; outline-offset: -2px; transition: transform var(--spring-ms, 200ms) var(--spring-bounce, var(--ease)), outline-color 120ms; }
.catalog-card:active:not(:disabled) { transform: scale(.96); transition-duration: 40ms; }
.catalog-card[aria-pressed="true"] { outline-color: var(--period); }
.catalog-card span:empty { display: none; }
.catalog-card img, .catalog-card .thumb-empty { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 11px; background: var(--fill); }
.thumb-empty { display: grid; place-items: center; color: var(--muted); }
.wish-list { list-style: none; display: grid; gap: 10px; }
.wish { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 12px; }
.wish img, .wish .thumb-empty, .catalog-row img, .catalog-row .thumb-empty { width: 44px; height: 44px; object-fit: cover; border-radius: 10px; background: var(--fill); }
.wish > span:not(.thumb-empty) { display: grid; min-width: 0; overflow-wrap: anywhere; }
.wish strong { font-weight: 600; }
.wish small { font-size: .875rem; color: var(--muted); }
.wish.is-new strong { color: var(--period-text); }
.catalog-row { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 12px; padding: 8px 14px; list-style: none; }
.catalog-row span:not(.thumb-empty) { min-width: 0; overflow-wrap: anywhere; }
.field span, .file-button { font-variant-numeric: normal; }
