/* Wir — design system.
   Mobile-first. Everything is sized for a 375px phone first and only
   widened from there; the app never relies on hover. Colors are tokens on
   :root so light/dark and the user's accent choice are pure variable swaps. */

:root {
  --accent: #6d5bff;
  --accent-2: #ff6b9d;
  --accent-grad: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);

  --bg: #f6f3ef;
  --bg-2: #efeae4;
  --surface: #ffffff;
  --surface-2: #f8f6f3;
  --surface-glass: rgba(255, 255, 255, 0.72);
  --text: #17141f;
  --text-2: #5d5868;
  --text-3: #8f8a99;
  --line: rgba(23, 20, 31, 0.08);
  --line-2: rgba(23, 20, 31, 0.14);
  --danger: #e5484d;
  --ok: #16a34a;
  --shadow-sm: 0 1px 2px rgba(23, 20, 31, 0.06), 0 2px 8px rgba(23, 20, 31, 0.04);
  --shadow: 0 2px 6px rgba(23, 20, 31, 0.05), 0 12px 32px rgba(23, 20, 31, 0.08);
  --shadow-lg: 0 24px 64px rgba(23, 20, 31, 0.22);

  --r-sm: 12px;
  --r: 20px;
  --r-lg: 28px;
  --tap: 44px;

  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Fraunces", "Iowan Old Style", Georgia, serif;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --tabbar-h: 64px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #06050b;
  --bg-2: rgba(255, 255, 255, 0.06);
  --surface: rgba(22, 20, 34, 0.62);
  --surface-2: rgba(255, 255, 255, 0.06);
  --surface-glass: rgba(14, 12, 24, 0.62);
  --text: #f4f2f8;
  --text-2: #b2adbd;
  --text-3: #7c7788;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.13);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 2px 6px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #06050b;
    --bg-2: rgba(255, 255, 255, 0.06);
    --surface: rgba(22, 20, 34, 0.62);
    --surface-2: rgba(255, 255, 255, 0.06);
    --surface-glass: rgba(14, 12, 24, 0.62);
    --text: #f4f2f8;
    --text-2: #b2adbd;
    --text-3: #7c7788;
    --line: rgba(255, 255, 255, 0.07);
    --line-2: rgba(255, 255, 255, 0.13);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 2px 6px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100dvh;
  background: transparent;
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
body.sheet-open { overflow: hidden; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Background: aurora sky (js/bg.js) ---------- */
.bg-sky { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; background: var(--bg); contain: strict; }
.bg-aurora { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.bg-stars { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: .9; animation: twinkle 7s ease-in-out infinite alternate; will-change: opacity; }
.bg-grain { position: absolute; inset: -50%; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
@keyframes twinkle { from { opacity: .55; } to { opacity: 1; } }
.bg-sky.still .bg-stars { animation: none; }
@media (prefers-reduced-motion: reduce) { .bg-stars { animation: none; } }

/* ---------- Boot splash ---------- */
.splash {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center;
  background: var(--bg); transition: opacity .35s var(--ease), visibility .35s;
}
.splash.hide { opacity: 0; visibility: hidden; }
.splash-mark { width: 72px; height: 72px; border-radius: 24px; background: var(--accent-grad); display: grid; place-items: center; color: #fff; font: 600 italic 34px/1 var(--display); box-shadow: 0 16px 40px color-mix(in srgb, var(--accent) 40%, transparent); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.06); } }

/* ---------- App shell ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  padding: calc(var(--safe-top) + 10px) calc(16px + var(--safe-right)) 10px calc(16px + var(--safe-left));
  display: flex; align-items: center; gap: 10px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar-title { flex: 1; min-width: 0; font: 600 20px/1.2 var(--display); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .topbar-back { display: none; }
.topbar.has-back .topbar-back { display: inline-grid; }

.icon-btn {
  width: var(--tap); height: var(--tap); flex: none; display: inline-grid; place-items: center;
  border: 0; border-radius: 14px; background: transparent; color: var(--text);
  transition: background .15s, transform .15s var(--spring);
}
.icon-btn:active { transform: scale(.92); background: var(--line); }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn.solid { background: var(--surface); box-shadow: var(--shadow-sm); border: 1px solid var(--line); }

.views {
  padding: 4px calc(16px + var(--safe-right)) calc(var(--tabbar-h) + var(--safe-bottom) + 32px) calc(16px + var(--safe-left));
  max-width: 760px; margin: 0 auto;
}
.view { display: none; }
.view.active { display: block; animation: viewIn .38s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .view.active { animation: none; } }

/* ---------- Tab bar ---------- */
.tabbar {
  position: fixed; z-index: 50; left: 0; right: 0; bottom: 0;
  padding: 6px calc(8px + var(--safe-right)) calc(6px + var(--safe-bottom)) calc(8px + var(--safe-left));
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--surface-glass);
  -webkit-backdrop-filter: saturate(1.8) blur(22px); backdrop-filter: saturate(1.8) blur(22px);
  border-top: 1px solid var(--line);
}
.tab {
  position: relative; min-height: 52px; border: 0; background: none; padding: 4px 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--text-3); font-size: 11px; font-weight: 600; letter-spacing: .01em;
  transition: color .2s;
}
.tab svg { width: 24px; height: 24px; transition: transform .3s var(--spring); }
.tab.active { color: var(--text); }
.tab.active svg { transform: translateY(-1px) scale(1.08); color: var(--accent); }
.tab::before {
  content: ""; position: absolute; top: 4px; width: 56px; height: 32px; border-radius: 16px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  transform: scale(.4); opacity: 0; transition: transform .35s var(--spring), opacity .2s;
}
.tab.active::before { transform: scale(1); opacity: 1; }
.tab-badge {
  position: absolute; top: 4px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 700;
  display: grid; place-items: center; box-shadow: 0 0 0 2px var(--surface);
}

@media (min-width: 900px) {
  .tabbar { left: 50%; right: auto; bottom: 18px; transform: translateX(-50%); width: 520px; border-radius: 26px; border: 1px solid var(--line); box-shadow: var(--shadow); padding: 6px; }
}

/* ---------- Typography helpers ---------- */
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.h-display { font: 600 34px/1.05 var(--display); letter-spacing: -.02em; margin: 0; }
.h-display em { font-style: italic; background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: .06em; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 13px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 26px 2px 10px; }
.section-head h2 { margin: 0; font: 600 20px/1.2 var(--display); letter-spacing: -.01em; }
.section-head .link { font-size: 14px; font-weight: 600; color: var(--accent); background: none; border: 0; padding: 8px 0; min-height: var(--tap); }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-sm); padding: 16px;
}
.card + .card { margin-top: 12px; }
.card-title { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 16px; font-weight: 700; }
.card-title .emoji { font-size: 20px; }
.stack { display: grid; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

/* ---------- Buttons ---------- */
.btn {
  min-height: var(--tap); padding: 0 18px; border-radius: 14px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--text); font-weight: 650; font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
  transition: transform .15s var(--spring), background .15s, box-shadow .2s, opacity .2s; user-select: none; -webkit-user-select: none;
}
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .5; }
.btn.primary { background: var(--accent-grad); color: #fff; border-color: transparent; box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn.soft { background: color-mix(in srgb, var(--accent) 12%, transparent); border-color: transparent; color: var(--accent); }
:root[data-theme="dark"] .btn.soft { color: color-mix(in srgb, var(--accent) 60%, white); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.danger { color: var(--danger); }
.btn.block { width: 100%; }
.btn svg { width: 18px; height: 18px; }

.fab {
  position: fixed; z-index: 45; right: calc(18px + var(--safe-right)); bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 18px);
  width: 58px; height: 58px; border-radius: 20px; border: 0; background: var(--accent-grad); color: #fff;
  display: grid; place-items: center; box-shadow: 0 14px 34px color-mix(in srgb, var(--accent) 45%, transparent);
  transition: transform .2s var(--spring);
}
.fab:active { transform: scale(.9) rotate(-8deg); }
.fab svg { width: 26px; height: 26px; }
@media (min-width: 900px) { .fab { bottom: 110px; right: calc(50% - 360px); } }

/* ---------- Form controls ---------- */
.field { display: grid; gap: 6px; }
.field > label, .label { font-size: 13px; font-weight: 650; color: var(--text-2); }
.input, .select, .textarea {
  width: 100%; min-height: var(--tap); padding: 10px 14px; border-radius: 14px;
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text);
  font-size: 16px; /* ≥16px so iOS doesn't zoom on focus */
  transition: border-color .15s, box-shadow .15s, background .15s; -webkit-appearance: none; appearance: none;
}
.textarea { resize: vertical; min-height: 88px; line-height: 1.45; }
.select { padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%238f8a99' stroke-width='2'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); background: var(--surface); }
input[type="date"].input, input[type="datetime-local"].input { min-width: 0; display: block; }
input[type="color"] { -webkit-appearance: none; appearance: none; border: 0; padding: 0; width: var(--tap); height: var(--tap); border-radius: 14px; background: none; cursor: pointer; }
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: 2px solid var(--line-2); border-radius: 14px; }
input[type="color"]::-moz-color-swatch { border: 2px solid var(--line-2); border-radius: 14px; }

.add-bar { display: flex; gap: 8px; align-items: center; }
.add-bar .input { flex: 1; min-width: 0; }
.add-bar .btn { flex: none; width: var(--tap); padding: 0; }

.switch { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: var(--tap); font-weight: 600; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 50px; height: 30px; border-radius: 15px; background: var(--line-2); position: relative; flex: none; transition: background .2s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2); transition: transform .25s var(--spring); }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Segmented control + chips */
.segmented { display: flex; padding: 4px; gap: 4px; border-radius: 16px; background: var(--bg-2); border: 1px solid var(--line); }
.segmented button { flex: 1; min-height: 38px; border: 0; border-radius: 12px; background: none; font-weight: 650; font-size: 14px; color: var(--text-2); transition: background .2s, color .2s, box-shadow .2s; white-space: nowrap; }
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 16px 6px; margin: 0 -16px; scrollbar-width: none; scroll-snap-type: x proximity; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; min-height: 38px; padding: 0 14px; border-radius: 19px; border: 1px solid var(--line-2);
  background: var(--surface); font-size: 14px; font-weight: 600; color: var(--text-2);
  display: inline-flex; align-items: center; gap: 6px; scroll-snap-align: start; transition: all .2s;
}
.chip.active { background: var(--text); color: var(--bg); border-color: transparent; }
.chip .x { margin-left: 2px; width: 22px; height: 22px; display: inline-grid; place-items: center; border-radius: 50%; font-size: 12px; opacity: .7; }
.chip .x:active { background: var(--line-2); }

.empty { text-align: center; padding: 28px 12px; color: var(--text-3); }
.empty .big { font-size: 40px; display: block; margin-bottom: 8px; }

/* ---------- Home ---------- */
.hero { padding: 10px 2px 4px; }
.hero .date { margin-bottom: 8px; }
.hero-name { display: block; }

.anniv {
  margin-top: 18px; position: relative; overflow: hidden; border-radius: var(--r-lg); padding: 20px;
  background: var(--accent-grad); color: #fff; box-shadow: 0 18px 44px color-mix(in srgb, var(--accent) 30%, transparent);
}
.anniv::after { content: ""; position: absolute; right: -40px; top: -40px; width: 180px; height: 180px; border-radius: 50%; background: rgba(255,255,255,.12); }
.anniv .num { font: 600 56px/1 var(--display); letter-spacing: -.03em; }
.anniv .lbl { font-weight: 600; opacity: .92; }
.anniv .sub { font-size: 13px; opacity: .8; margin-top: 6px; }
.anniv .heart { position: absolute; right: 18px; bottom: 12px; font-size: 44px; animation: beat 1.6s ease-in-out infinite; }
@keyframes beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.15); } 30% { transform: scale(1); } 45% { transform: scale(1.1); } }

.moods { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mood-card { text-align: center; padding: 16px 10px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); position: relative; }
.mood-card .face { font-size: 44px; line-height: 1.1; display: block; height: 52px; }
.mood-card .who { font-weight: 700; font-size: 14px; margin-top: 6px; }
.mood-card .hint { font-size: 12px; color: var(--text-3); }
.mood-card.me { border: 0; background: color-mix(in srgb, var(--accent) 10%, var(--surface)); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 45%, transparent); }
.mood-card button.face-btn { all: unset; cursor: pointer; display: block; width: 100%; }
.mood-pop { animation: pop .45s var(--spring); }
@keyframes pop { from { transform: scale(.4); } to { transform: scale(1); } }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat {
  display: flex; flex-direction: column; gap: 6px; text-align: left; padding: 16px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); text-decoration: none; color: inherit;
  transition: transform .15s var(--spring);
}
.stat:active { transform: scale(.97); }
.stat .ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; background: var(--bg-2); }
.stat .val { font: 600 26px/1 var(--display); }
.stat .cap { font-size: 13px; color: var(--text-2); font-weight: 600; }

.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.quick button { border: 0; background: none; display: grid; justify-items: center; gap: 6px; padding: 4px 0; font-size: 12px; font-weight: 600; color: var(--text-2); }
.quick .q-ico { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; font-size: 24px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); transition: transform .2s var(--spring); }
.quick button:active .q-ico { transform: scale(.9); }

/* ---------- Event rows (home, agenda, day list) ---------- */
.ev-list { display: grid; gap: 8px; }
.ev {
  display: flex; align-items: stretch; gap: 12px; width: 100%; text-align: left;
  padding: 12px 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface);
  box-shadow: var(--shadow-sm); transition: transform .15s var(--spring);
}
.ev:active { transform: scale(.98); }
.ev .bar { width: 4px; border-radius: 2px; flex: none; background: var(--c, var(--accent)); }
.ev .when { flex: none; width: 52px; font-size: 13px; font-weight: 700; color: var(--text-2); padding-top: 1px; }
.ev .when small { display: block; font-weight: 500; color: var(--text-3); }
.ev .what { flex: 1; min-width: 0; }
.ev .ttl { font-weight: 650; overflow-wrap: anywhere; }
.ev .meta { font-size: 13px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.agenda-day { margin-top: 18px; }
.agenda-day:first-child { margin-top: 4px; }
.agenda-day h3 { margin: 0 2px 8px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); display: flex; gap: 8px; align-items: baseline; }
.agenda-day h3 .today-pill { background: var(--accent); color: #fff; border-radius: 8px; padding: 2px 7px; letter-spacing: .04em; font-size: 11px; }

/* ---------- Calendar ---------- */
.cal-head { display: flex; align-items: center; gap: 6px; margin: 4px 0 12px; }
.cal-month { flex: 1; min-width: 0; font: 600 26px/1.1 var(--display); letter-spacing: -.02em; }
.cal-month span { color: var(--text-3); font-weight: 400; }
.cal-card { padding: 10px 8px 12px; overflow: hidden; touch-action: pan-y; }
.cal-dow { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); padding-bottom: 6px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-grid.slide-l { animation: slideL .32s var(--ease); }
.cal-grid.slide-r { animation: slideR .32s var(--ease); }
@keyframes slideL { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes slideR { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
.cal-day {
  position: relative; min-width: 0; min-height: 54px; border: 0; background: none; border-radius: 14px;
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0 4px; transition: background .15s;
}
.cal-day .n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 650; font-size: 15px; transition: all .2s var(--spring); }
.cal-day.out .n { color: var(--text-3); opacity: .55; }
.cal-day.today .n { color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }
.cal-day.sel .n { background: var(--text); color: var(--bg); box-shadow: none; transform: scale(1.06); }
.cal-day.today.sel .n { background: var(--accent-grad); color: #fff; }
.cal-day:active { background: var(--line); }
.cal-dots { display: flex; gap: 3px; height: 6px; align-items: center; }
.cal-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.cal-dots b { font-size: 9px; line-height: 6px; color: var(--text-3); font-weight: 700; }
.cal-grid.bars .cal-day { min-height: 76px; justify-content: flex-start; }
.cal-bars { display: grid; gap: 2px; width: 100%; padding: 0 2px; }
.cal-bars i { display: block; font-style: normal; font-size: 10px; font-weight: 650; line-height: 15px; height: 15px; padding: 0 3px; border-radius: 4px; background: color-mix(in srgb, var(--c) 22%, transparent); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: clip; border-left: 2px solid var(--c); text-align: left; }
.cal-bars b { font-size: 10px; color: var(--text-3); font-weight: 700; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 14px 4px 0; font-size: 12px; color: var(--text-2); font-weight: 600; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }

.color-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.color-chip {
  min-height: 38px; padding: 0 12px 0 8px; border-radius: 19px; border: 1.5px solid var(--line-2); background: var(--surface);
  display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 650; transition: all .2s var(--spring);
}
.color-chip i { width: 20px; height: 20px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 2px rgba(255,255,255,.35); }
.color-chip.sel { border-color: var(--c); background: color-mix(in srgb, var(--c) 14%, var(--surface)); transform: scale(1.03); }
.custom-color { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 650; color: var(--text-2); }

.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.two > * { min-width: 0; }

/* ---------- Sheets (bottom-sheet modals) ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 200; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(8, 6, 14, .45); opacity: 0; transition: opacity .3s var(--ease); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.sheet {
  position: relative; width: 100%; max-width: 620px; max-height: calc(100dvh - var(--safe-top) - 24px);
  background: var(--surface); border-radius: 28px 28px 0 0; box-shadow: var(--shadow-lg);
  padding: 8px calc(18px + var(--safe-right)) calc(18px + var(--safe-bottom)) calc(18px + var(--safe-left));
  overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  transform: translateY(100%); transition: transform .38s var(--ease);
}
.sheet-wrap.open .sheet-backdrop { opacity: 1; }
.sheet-wrap.open .sheet { transform: none; }
.sheet.full { height: calc(100dvh - var(--safe-top) - 12px); display: flex; flex-direction: column; }
.sheet-grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 2px auto 10px; }
.sheet-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.sheet-head h2 { flex: 1; min-width: 0; margin: 0; font: 600 22px/1.2 var(--display); letter-spacing: -.01em; overflow-wrap: anywhere; }
.sheet-actions { display: flex; gap: 10px; margin-top: 18px; }
.sheet-actions .btn { flex: 1; }
@media (min-width: 700px) {
  .sheet-wrap { align-items: center; }
  .sheet { border-radius: 28px; transform: translateY(24px) scale(.97); opacity: 0; transition: transform .3s var(--ease), opacity .25s; }
  .sheet-wrap.open .sheet { opacity: 1; }
  .sheet.full { height: min(860px, calc(100dvh - 48px)); }
}

/* Event quick view */
.qv-color { width: 14px; height: 14px; border-radius: 5px; background: var(--c); flex: none; margin-top: 8px; align-self: flex-start; }
.qv-time { font-weight: 650; color: var(--text-2); margin: -6px 0 14px; }
.qv-rows { display: grid; gap: 10px; }
.qv-row { display: flex; gap: 12px; align-items: flex-start; }
.qv-row .k { width: 26px; text-align: center; flex: none; }
.qv-notes { white-space: pre-wrap; background: var(--surface-2); border-radius: 14px; padding: 12px 14px; overflow-wrap: anywhere; }
.cat-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 10px; background: color-mix(in srgb, var(--c) 16%, transparent); }

/* ---------- Lists (shopping, ideas) ---------- */
.group-title { font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); margin: 18px 4px 8px; display: flex; justify-content: space-between; }
.items { display: grid; gap: 6px; }
.item {
  display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 6px 6px 6px 14px;
  border-radius: 16px; background: var(--surface); border: 1px solid var(--line);
  transition: opacity .25s, transform .2s var(--spring);
}
.item .check {
  width: 28px; height: 28px; flex: none; border-radius: 50%; border: 2px solid var(--line-2); background: none;
  display: grid; place-items: center; color: #fff; transition: all .25s var(--spring); padding: 0;
}
.item .check svg { width: 16px; height: 16px; opacity: 0; transform: scale(.4); transition: all .25s var(--spring); }
.item.done .check { background: var(--accent); border-color: var(--accent); }
.item.done .check svg { opacity: 1; transform: none; }
.item .txt { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 550; padding: 6px 0; }
.item.done .txt { color: var(--text-3); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.item .del { width: var(--tap); height: var(--tap); flex: none; border: 0; background: none; color: var(--text-3); border-radius: 12px; display: grid; place-items: center; }
.item .del:active { background: var(--line); color: var(--danger); }
.item .del svg { width: 18px; height: 18px; }
.item .sub { display: block; font-size: 12px; color: var(--text-3); font-weight: 500; text-decoration: none; }
.hit { position: absolute; inset: 0; }
.item-hit { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; border: 0; background: none; text-align: left; padding: 0; min-height: var(--tap); }

.cat-picker { display: flex; gap: 6px; overflow-x: auto; margin: 10px -16px 0; padding: 0 16px 4px; scrollbar-width: none; }
.cat-picker::-webkit-scrollbar { display: none; }

/* ---------- Notes ---------- */
.notes-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.note-card {
  text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 18px; padding: 14px;
  min-height: 118px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow-sm); min-width: 0;
  transition: transform .15s var(--spring);
}
.note-card:active { transform: scale(.97); }
.note-card .t { font-weight: 750; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.note-card .p { font-size: 13px; color: var(--text-2); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; flex: 1; }
.note-card .d { font-size: 11.5px; color: var(--text-3); font-weight: 600; }
@media (min-width: 640px) { .notes-grid { grid-template-columns: repeat(3, 1fr); } }

.note-title-input { border: 0; background: none; font: 600 26px/1.2 var(--display); padding: 4px 0; width: 100%; color: var(--text); }
.note-title-input:focus { outline: none; }
.fmt-bar { display: flex; gap: 4px; padding: 6px; border-radius: 14px; background: var(--bg-2); margin: 8px 0 10px; overflow-x: auto; }
.fmt-bar button { min-width: 40px; height: 38px; border: 0; background: none; border-radius: 10px; font-size: 15px; }
.fmt-bar button:active, .fmt-bar button.on { background: var(--surface); box-shadow: var(--shadow-sm); }
.note-body { flex: 1; min-height: 220px; outline: none; overflow-y: auto; font-size: 16px; line-height: 1.6; padding: 4px 2px 20px; overflow-wrap: anywhere; }
.note-body:empty::before { content: attr(data-placeholder); color: var(--text-3); }
.note-body ul, .note-body ol, .rich ul, .rich ol { padding-left: 22px; margin: 6px 0; }
.note-body h3, .rich h3 { font: 600 19px/1.3 var(--display); margin: 12px 0 4px; }
.note-status { font-size: 12px; color: var(--text-3); font-weight: 600; min-height: 16px; }

/* ---------- Wir beide ---------- */
.mood-picker { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mood-picker button { height: 58px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--surface-2); font-size: 30px; transition: transform .2s var(--spring), border-color .2s, background .2s; }
.mood-picker button:active { transform: scale(.88); }
.mood-picker button.sel { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--surface)); transform: scale(1.04); }

.checkin-nav { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; }
.checkin-nav .m { flex: 1; text-align: center; font-weight: 750; }
.qa { padding: 12px 14px; border-radius: 14px; background: var(--surface-2); }
.qa + .qa { margin-top: 8px; }
.qa .q { font-size: 12.5px; font-weight: 750; color: var(--text-2); margin-bottom: 4px; }
.qa .a { white-space: pre-wrap; overflow-wrap: anywhere; }
.answers { display: grid; gap: 14px; }
.answers h4 { margin: 0 0 8px; font-size: 15px; }
.lock { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 16px; background: color-mix(in srgb, var(--accent) 10%, transparent); font-weight: 600; }
.lock .i { font-size: 28px; }

.jar-result {
  margin-top: 12px; padding: 18px; border-radius: 18px; text-align: center; font: 600 20px/1.3 var(--display);
  background: var(--accent-grad); color: #fff; animation: pop .5s var(--spring); overflow-wrap: anywhere;
}
.jar-result small { display: block; font: 600 12px/1 var(--font); letter-spacing: .1em; text-transform: uppercase; opacity: .8; margin-bottom: 8px; }
.shake { animation: shake .5s; }
@keyframes shake { 20% { transform: rotate(-8deg); } 40% { transform: rotate(8deg); } 60% { transform: rotate(-5deg); } 80% { transform: rotate(4deg); } }

.counter { display: flex; align-items: center; gap: 10px; padding: 12px 8px 12px 14px; border-radius: 16px; background: var(--surface-2); }
.counter + .counter { margin-top: 8px; }
.counter .info { flex: 1; min-width: 0; }
.counter .info b { display: block; overflow-wrap: anywhere; }
.counter .info span { font-size: 12px; color: var(--text-3); font-weight: 600; }
.counter .val { font: 600 28px/1 var(--display); min-width: 40px; text-align: center; }
.counter .val.bump { animation: pop .4s var(--spring); }
.round { width: var(--tap); height: var(--tap); border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface); font-size: 20px; font-weight: 600; display: grid; place-items: center; flex: none; transition: transform .15s var(--spring); }
.round:active { transform: scale(.88); }
.round.plus { background: var(--accent); color: #fff; border-color: transparent; }

/* ---------- More / menu ---------- */
.menu { display: grid; gap: 10px; }
.menu-item {
  display: flex; align-items: center; gap: 14px; padding: 14px; min-height: 64px; border-radius: 18px; border: 1px solid var(--line);
  background: var(--surface); text-decoration: none; color: inherit; text-align: left; width: 100%; box-shadow: var(--shadow-sm);
  transition: transform .15s var(--spring);
}
.menu-item:active { transform: scale(.98); }
.menu-item .mi { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; font-size: 21px; flex: none; background: var(--bg-2); }
.menu-item .mt { flex: 1; min-width: 0; }
.menu-item .mt b { display: block; }
.menu-item .mt span { font-size: 13px; color: var(--text-3); }
.menu-item .chev { color: var(--text-3); }
.menu-item .chev svg { width: 18px; height: 18px; }

/* ---------- Files ---------- */
.crumbs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin: 4px 0 10px; font-weight: 700; }
.crumbs button { border: 0; background: none; padding: 8px 6px; min-height: var(--tap); color: var(--text-2); font-weight: 700; border-radius: 10px; }
.crumbs .cur { color: var(--text); padding: 8px 6px; overflow-wrap: anywhere; }
.drive { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 560px) { .drive { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tile { position: relative; border: 1px solid var(--line); background: var(--surface); border-radius: 18px; overflow: hidden; text-align: left; padding: 0; box-shadow: var(--shadow-sm); transition: transform .15s var(--spring); min-width: 0; }
.tile:active { transform: scale(.97); }
.tile .pv { aspect-ratio: 4 / 3; display: grid; place-items: center; font-size: 38px; background: var(--bg-2); overflow: hidden; }
.tile .pv img { width: 100%; height: 100%; object-fit: cover; }
.tile.folder .pv { background: color-mix(in srgb, var(--accent) 12%, var(--bg-2)); }
.tile .nm { padding: 10px 12px 2px; font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .mt { padding: 0 12px 10px; font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .more { position: absolute; top: 6px; right: 6px; width: 36px; height: 36px; border-radius: 12px; border: 0; background: rgba(0,0,0,.45); color: #fff; display: grid; place-items: center; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.tile .more svg { width: 18px; height: 18px; }
.dropzone { border: 2px dashed var(--line-2); border-radius: 18px; padding: 18px; text-align: center; color: var(--text-2); transition: all .2s; }
.dropzone.drag { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.upload-progress { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: 10px; }
.upload-progress i { display: block; height: 100%; width: 0; background: var(--accent-grad); transition: width .2s; }
.preview-body { display: grid; place-items: center; min-height: 200px; }
.preview-body img, .preview-body video { max-width: 100%; max-height: 70dvh; border-radius: 14px; }
.preview-body iframe { width: 100%; height: 70dvh; border: 0; border-radius: 14px; background: #fff; }
.preview-body audio { width: 100%; }
.action-list { display: grid; gap: 6px; }
.action-list .btn { justify-content: flex-start; }

/* ---------- Games ---------- */
.games-frame { width: calc(100% + 32px); margin: 0 -16px; height: calc(100dvh - var(--tabbar-h) - var(--safe-bottom) - var(--safe-top) - 64px); border: 0; display: block; background: var(--bg); }

/* ---------- Settings ---------- */
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1.5px var(--line-2); transition: transform .2s var(--spring), box-shadow .2s; }
.swatch.sel { box-shadow: 0 0 0 2.5px var(--text); transform: scale(1.08); }
.set-group { display: grid; gap: 12px; }
.set-group + .set-group { margin-top: 12px; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; z-index: 400; left: 0; right: 0; top: calc(var(--safe-top) + 10px); display: grid; justify-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast {
  pointer-events: auto; max-width: 480px; width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 12px 12px 12px 16px; border-radius: 18px; background: var(--text); color: var(--bg); box-shadow: var(--shadow-lg);
  font-weight: 600; font-size: 14.5px; animation: toastIn .4s var(--spring);
}
.toast.out { animation: toastOut .25s var(--ease) forwards; }
.toast .tt { flex: 1; min-width: 0; }
.toast .tt small { display: block; font-weight: 500; opacity: .75; }
.toast .btn { min-height: 38px; padding: 0 14px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-16px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-12px); } }

/* ---------- Login ---------- */
.login-page { min-height: 100dvh; display: grid; place-items: center; padding: calc(var(--safe-top) + 24px) 20px calc(var(--safe-bottom) + 24px); }
.login-box { width: 100%; max-width: 380px; }
.login-mark { width: 84px; height: 84px; border-radius: 28px; background: var(--accent-grad); display: grid; place-items: center; color: #fff; font: 600 italic 42px/1 var(--display); box-shadow: 0 20px 50px color-mix(in srgb, var(--accent) 45%, transparent); margin-bottom: 26px; transform: rotate(-6deg); }
.login-box h1 { font: 600 44px/1 var(--display); letter-spacing: -.03em; margin: 0 0 8px; }
.login-box h1 em { font-style: italic; background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-box p.lead { color: var(--text-2); margin: 0 0 28px; }
.login-box form { display: grid; gap: 14px; }
.login-err { color: var(--danger); font-weight: 600; font-size: 14px; min-height: 20px; margin: 0; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Guide pages ---------- */
.guide { max-width: 680px; margin: 0 auto; padding: calc(var(--safe-top) + 18px) calc(16px + var(--safe-right)) calc(var(--safe-bottom) + 40px) calc(16px + var(--safe-left)); }
.guide .card h2 { margin: 0 0 10px; font: 600 20px/1.25 var(--display); }
.guide ol { padding-left: 20px; margin: 0; line-height: 1.7; }
.guide code { background: var(--bg-2); padding: 2px 7px; border-radius: 7px; font-size: .9em; overflow-wrap: anywhere; }
.guide .kv { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.guide .kv:last-child { border-bottom: 0; }

/* Rich text rendering (sanitized note HTML) */
.rich p, .rich div { margin: 0; }
.rich a { color: var(--accent); }
.ev .ttl, .ev .meta { display: block; }
.anniv .lbl, .anniv .sub { padding-right: 58px; }

/* Glass cards on the night sky (dark only; light keeps solid surfaces). */
:root[data-theme="dark"] .card, :root[data-theme="dark"] .w, :root[data-theme="dark"] .menu-item, :root[data-theme="dark"] .ev,
:root[data-theme="dark"] .mood-card, :root[data-theme="dark"] .more-tile, :root[data-theme="dark"] .item, :root[data-theme="dark"] .counter {
  -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3);
}
:root[data-theme="dark"] .sheet { background: #120f1d; }
:root[data-theme="dark"] .splash { background: #06050b; }

/* ---------- Home pager ---------- */
.pager-pills {
  position: relative; display: grid; grid-template-columns: 1fr 1fr; width: min(260px, 100%); margin: 2px auto 6px;
  padding: 4px; border-radius: 999px; background: var(--surface-glass); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.pager-pills button { position: relative; z-index: 1; min-height: 36px; border: 0; background: none; border-radius: 999px; font-size: 14px; font-weight: 700; color: var(--text-3); transition: color .25s; }
.pager-pills button.active { color: #fff; }
.pill-ind { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 999px; background: var(--accent-grad); box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 40%, transparent); transition: transform .42s var(--ease); }
.pager { margin: 0 calc(-16px - var(--safe-right)) 0 calc(-16px - var(--safe-left)); overflow: hidden; overflow: clip; touch-action: pan-y; transition: height .3s var(--ease); }
.pager.dragging { transition: none; user-select: none; -webkit-user-select: none; }
.pager-track { display: flex; align-items: flex-start; will-change: transform; }
.pager-page { flex: 0 0 100%; min-width: 0; padding: 0 calc(16px + var(--safe-right)) 8px calc(16px + var(--safe-left)); }
.pager .hero { padding: 10px 2px 14px; }
.pager .h-display { font-size: 30px; }
.h-display .amp { font-style: italic; color: var(--text-3); font-size: .8em; }
@media (prefers-reduced-motion: reduce) { .pill-ind, .pager { transition: none; } }

/* First-run swipe hint */
.swipe-hint {
  position: fixed; z-index: 44; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 16px); transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap); padding: 0 16px 0 18px; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--surface-glass); color: var(--text); font-weight: 700; font-size: 14px; white-space: nowrap;
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); box-shadow: var(--shadow);
  animation: hintIn .5s var(--spring) both;
}
.swipe-hint.out { opacity: 0; transform: translate(-50%, 12px); transition: opacity .3s, transform .3s; }
.sh-arrows { display: inline-flex; color: var(--accent); }
.sh-arrows svg { width: 18px; height: 18px; margin-left: -8px; animation: nudge 1.3s var(--ease) infinite; }
.sh-arrows svg:last-child { animation-delay: .15s; opacity: .6; }
@keyframes nudge { 0%, 100% { transform: translateX(-3px); opacity: .3; } 50% { transform: translateX(5px); opacity: 1; } }
@keyframes hintIn { from { opacity: 0; transform: translate(-50%, 16px); } }
@media (prefers-reduced-motion: reduce) { .sh-arrows svg, .swipe-hint { animation: none; } }

/* ---------- Widgets ---------- */
.wgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.w {
  position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 104px;
  padding: 12px 14px; border-radius: 22px; text-align: left; color: inherit; font: inherit;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  transition: transform .18s var(--spring); cursor: pointer;
}
div.w:not([role]) { cursor: default; }
.w:active { transform: scale(.97); }
div.w:not([role]):active { transform: none; }
.w.span2 { grid-column: span 2; }
.w-head { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 26px; }
.w-headlink { justify-content: flex-start; text-align: left; border: 0; background: none; padding: 0; color: inherit; font: inherit; min-height: var(--tap); margin: -8px 0 -4px; cursor: pointer; }
.w-ico { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; font-size: 15px; background: var(--bg-2); flex: none; }
.w-lbl { font-size: 12.5px; font-weight: 700; color: var(--text-2); letter-spacing: .01em; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-chev { color: var(--text-3); display: inline-grid; margin-left: auto; }
.w-chev svg { width: 18px; height: 18px; }
.w > .w-chev { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); }
.w-big { font: 600 30px/1 var(--display); letter-spacing: -.02em; margin-top: auto; }
.w-big.sm { font-size: 20px; }
.w-big.xl { font-size: 46px; }
.w-mid { font-weight: 700; font-size: 15px; line-height: 1.25; margin-top: auto; }
.w-sub { font-size: 12.5px; color: var(--text-2); line-height: 1.3; }
.w-row { display: flex; align-items: baseline; gap: 10px; margin-top: auto; }
.w-faces { display: flex; gap: 6px; font-size: 32px; line-height: 1.1; margin-top: auto; }
.w-foot { font-size: 12.5px; font-weight: 600; opacity: .9; margin-top: 6px; }
.w-anniv, .w-together { background: var(--accent-grad) !important; color: #fff; border-color: transparent; box-shadow: 0 14px 36px color-mix(in srgb, var(--accent) 32%, transparent); min-height: 92px; }
.w-anniv .w-sub, .w-together .w-sub, .w-anniv .w-lbl, .w-together .w-lbl { color: rgba(255,255,255,.88); }
.w-anniv .w-ico, .w-together .w-ico { background: rgba(255,255,255,.18); }
.w-anniv::after, .w-together::after { content: ""; position: absolute; right: -50px; top: -60px; width: 170px; height: 170px; border-radius: 50%; background: rgba(255,255,255,.12); }
.w-together { min-height: 150px; }
.w .heart { position: absolute; right: 16px; bottom: 10px; font-size: 34px; animation: beat 1.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .w .heart, .anniv .heart { animation: none; } }
.w-events { min-height: 0; gap: 8px; }
.ev-list.compact { width: 100%; gap: 6px; }
.ev-list.compact .ev { padding: 8px 10px; border-radius: 14px; box-shadow: none; background: var(--surface-2); }
.w-quick { flex-direction: row; justify-content: space-around; min-height: 0; padding: 12px 6px; }
.w-quick button { border: 0; background: none; display: grid; justify-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-2); min-width: var(--tap); }
.w-quick .q-ico { width: 50px; height: 50px; border-radius: 16px; display: grid; place-items: center; font-size: 22px; background: var(--surface-2); border: 1px solid var(--line); transition: transform .2s var(--spring); }
.w-quick button:active .q-ico { transform: scale(.9); }
.w-moodpair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 10px; min-height: 0; }
.w-moodpair .mood-card { font: inherit; color: inherit; display: flex; flex-direction: column; align-items: center; cursor: pointer; }
.w-msg { flex-direction: row; align-items: center; gap: 12px; min-height: 76px; padding-right: 40px; }
.w-env { font-size: 30px; animation: float 3.5s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-4px) rotate(-6deg); } }
@media (prefers-reduced-motion: reduce) { .w-env { animation: none; } }
.w-msgtxt { display: grid; gap: 2px; min-width: 0; }
.w-mini { position: absolute; right: 10px; top: 10px; width: var(--tap); height: var(--tap); border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface-2); font-size: 20px; }
.w-mini:active { transform: scale(.9); }
.w-pick { font-size: 12.5px; font-weight: 600; line-height: 1.3; color: var(--text); }
.w-pick:empty { display: none; }
.w-pick.in { animation: pop .4s var(--spring); }
.w-counters { display: grid; gap: 2px; margin-top: auto; font-size: 13px; color: var(--text-2); width: 100%; }
.w-counters span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-counters b { font: 600 17px/1.1 var(--display); color: var(--text); }

/* ---------- Mehr: tiles ---------- */
.more-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.more-tile {
  display: grid; justify-items: center; align-content: center; gap: 6px; min-height: 92px; padding: 10px 6px; border-radius: 20px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); color: inherit; font: inherit; text-align: center;
  transition: transform .18s var(--spring);
}
.more-tile:active { transform: scale(.95); }
.more-tile .mi { font-size: 26px; }
.more-tile b { font-size: 12.5px; line-height: 1.2; }
.ev-list.compact .ev .when { font-size: 13px; }
.ev-list.compact .ev .ttl { font-size: 15px; }
/* Single-feature pages: the top bar already names the page. */
:is([data-view="stimmung"], [data-view="checkin"], [data-view="ideen"], [data-view="zaehler"], [data-view="nachricht"]) > .card > .card-title:first-child { display: none; }
:is([data-view="stimmung"], [data-view="checkin"], [data-view="ideen"], [data-view="zaehler"], [data-view="nachricht"]) > .card { margin-top: 6px; }
.bg-sky[data-style="grain"] .bg-grain { opacity: .14; }
.bg-sky[data-style="black"] .bg-grain { display: none; }
.bg-sky[data-style="mesh"] .bg-grain { opacity: .05; }

/* ================= Calm pass: fewer decorations, one accent, 8px rhythm ================= */
:root[data-theme="dark"], :root:not([data-theme="light"]) { --accent-grad: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #fff)); }
:root[data-theme="dark"] {
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.06);
  --surface-glass: rgba(10, 9, 16, 0.66);
  --line: rgba(255, 255, 255, 0.07);
  --text-2: #a9a5b3;
  --text-3: #6f6b7a;
}
.card, .w, .menu-item, .mood-card, .ev, .stat { box-shadow: none; }
.card { border-radius: 24px; padding: 16px; }
.card + .card { margin-top: 16px; }
.card-title .emoji { display: none; }
.card-title { font: 600 18px/1.2 var(--display); letter-spacing: -.01em; margin-bottom: 16px; }
.section-head { margin: 32px 4px 12px; }
.section-head h2 { font-size: 22px; }
.h-display { font-weight: 500; }
.pager .h-display { font-size: 32px; }
.h-display em { background: none; color: var(--accent); -webkit-text-fill-color: currentColor; }
:root[data-theme="dark"] .h-display em { color: color-mix(in srgb, var(--accent) 55%, #fff); }
.eyebrow { letter-spacing: .08em; font-size: 11.5px; }

/* Pager pills: quiet segmented control */
.pager-pills { background: var(--surface); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); margin-bottom: 8px; }
.pager-pills button.active { color: var(--text); }
.pill-ind { background: rgba(255, 255, 255, 0.1); box-shadow: none; }
:root[data-theme="light"] .pill-ind { background: #fff; box-shadow: var(--shadow-sm); }

/* Widgets: one number/info each */
.wgrid { gap: 8px; }
.w { border-radius: 24px; padding: 16px; min-height: 120px; gap: 4px; }
.w-ico { width: auto; height: auto; background: none; color: var(--text-3); }
.w-ico svg { width: 18px; height: 18px; }
.w-ico.lg svg { width: 24px; height: 24px; color: var(--accent); }
.w-lbl { font-size: 13px; font-weight: 600; color: var(--text-3); }
.w-big { font-size: 36px; font-weight: 500; }
.w-big.xl { font-size: 52px; }
.w-anniv, .w-together { background: var(--surface) !important; color: var(--text); border-color: var(--line); box-shadow: none; }
.w-anniv::after, .w-together::after { display: none; }
.w-anniv .w-big, .w-together .w-big { color: color-mix(in srgb, var(--accent) 60%, #fff); }
:root[data-theme="light"] .w-anniv .w-big, :root[data-theme="light"] .w-together .w-big { color: var(--accent); }
.w-anniv .w-sub, .w-together .w-sub, .w-anniv .w-lbl, .w-together .w-lbl { color: var(--text-3); }
.w-anniv .w-ico, .w-together .w-ico { background: none; }
.w-foot { color: var(--text-2); }
.w-events { min-height: 0; }
.ev-list.compact .ev { background: none !important; border: 0; padding: 8px 0; border-radius: 0; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
.ev-list.compact .ev + .ev { border-top: 1px solid var(--line); }
.w-moodpair { background: none !important; border: 0; padding: 0; gap: 8px; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
.w-moodpair .mood-card { border-radius: 24px; padding: 20px 12px; }
.mood-card.me { box-shadow: none; background: var(--surface); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); }
.w-mini { width: 40px; height: 40px; border: 0; background: var(--surface-2); color: var(--text-2); display: grid; place-items: center; }
.w-mini svg { width: 18px; height: 18px; }
.w-msg { min-height: 88px; }

/* Lists: grouped, iOS-style */
.menu.group { gap: 0; border-radius: 24px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.menu.group .menu-item { border: 0; border-radius: 0; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; min-height: 56px; padding: 8px 16px; }
.menu.group .menu-item + .menu-item { border-top: 1px solid var(--line); }
.menu-item .mi { width: 32px; height: 32px; background: none; color: var(--accent); }
:root[data-theme="dark"] .menu-item .mi { color: color-mix(in srgb, var(--accent) 60%, #fff); }
.menu-item .mi svg { width: 22px; height: 22px; }
.menu-item .mt b { font-weight: 600; }

/* Buttons: single calm accent */
.btn.primary { background: var(--accent); box-shadow: none; }
.fab { background: var(--accent); box-shadow: 0 10px 28px rgba(0,0,0,.35); border-radius: 22px; }
.tab::before { background: rgba(255,255,255,.08); }
:root[data-theme="light"] .tab::before { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.tabbar { border-top-color: var(--line); }
.swipe-hint { box-shadow: none; }

/* Background picker */
.bg-picker { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.bg-tile { border: 0; background: none; padding: 0; display: grid; gap: 8px; justify-items: center; font-size: 12px; font-weight: 600; color: var(--text-3); min-height: var(--tap); }
.bg-prev { width: 100%; aspect-ratio: 3 / 4; border-radius: 14px; border: 1px solid var(--line-2); display: block; transition: transform .2s var(--spring); }
.bg-tile.sel { color: var(--text); }
.bg-tile.sel .bg-prev { outline: 2px solid var(--accent); outline-offset: 2px; }
.bg-tile:active .bg-prev { transform: scale(.94); }
.bp-aurora { background: radial-gradient(60% 40% at 30% 25%, color-mix(in srgb, var(--accent) 60%, transparent), transparent), radial-gradient(50% 35% at 75% 70%, color-mix(in srgb, var(--accent-2) 45%, transparent), transparent), linear-gradient(170deg, transparent 30%, rgba(40,230,180,.22) 38%, transparent 46%), #07060b; }
.bp-mesh { background: radial-gradient(80% 60% at 20% 20%, color-mix(in srgb, var(--accent) 35%, transparent), transparent), radial-gradient(80% 60% at 90% 90%, rgba(40,32,120,.6), transparent), #07060b; }
.bp-stars { background: radial-gradient(1px 1px at 20% 30%, #fff, transparent), radial-gradient(1px 1px at 70% 20%, #fff, transparent), radial-gradient(1.5px 1.5px at 50% 60%, #fff, transparent), radial-gradient(1px 1px at 80% 75%, #cfe0ff, transparent), radial-gradient(1px 1px at 30% 85%, #fff, transparent), #07060b; }
.bp-grain { background: radial-gradient(70% 50% at 50% 30%, color-mix(in srgb, var(--accent) 22%, transparent), transparent), #0b0a10; }
.bp-black { background: #000; }

/* ================= v4: waves bg, bottom pager switch, calendar + counters on Home ================= */
.bg-sky[data-style="waves"] .bg-grain { opacity: .06; }
.bg-sky[data-style="waves"] .bg-aurora { transform: scale(1.08); }
.bg-sky[data-style="waves"]:not(.still) .bg-aurora { animation: drift 80s ease-in-out infinite alternate; will-change: transform; }
@keyframes drift { from { transform: scale(1.08) translate3d(0, 0, 0); } to { transform: scale(1.14) translate3d(-2.5%, 1.5%, 0); } }
@media (prefers-reduced-motion: reduce) { .bg-sky .bg-aurora { animation: none !important; } }
.bp-waves { background: repeating-radial-gradient(ellipse 140% 70% at 0% 120%, #0a2433 0 6px, #1b4b62 7px 9px, #06131d 10px 15px), #06131d; }
.bg-picker { grid-template-columns: repeat(3, 1fr); }

/* Pager switch at the bottom, above the tab bar */
body:not(.on-home) .pager-pills, body:not(.on-home) .swipe-hint { display: none !important; }
.pager-pills {
  position: fixed; z-index: 46; left: 50%; transform: translateX(-50%); margin: 0; width: 220px;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 12px);
  background: var(--surface-glass); -webkit-backdrop-filter: blur(20px) saturate(1.4); backdrop-filter: blur(20px) saturate(1.4);
}
.pager-pills button { min-height: 40px; }
.swipe-hint { bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 72px); }
body.on-home .views { padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 88px); }
@media (min-width: 900px) { .pager-pills { bottom: 100px; } }

/* Month calendar widget */
.w-cal { min-height: 0; padding: 8px 12px 12px; margin-bottom: 8px; cursor: default; }
.w-cal:active, .w-count:active { transform: none; }
.mc-head { display: flex; align-items: center; width: 100%; }
.mc-title { flex: 1; text-align: left; border: 0; background: none; color: inherit; padding: 0 4px; min-height: var(--tap); font: 600 20px/1.2 var(--display); }
.mc-title span { color: var(--text-3); font-weight: 500; }
.mc-dow, .mc-grid { display: grid; grid-template-columns: repeat(7, 1fr); width: 100%; }
.mc-dow span { text-align: center; font-size: 11px; font-weight: 700; color: var(--text-3); padding: 4px 0; }
.mc-day { border: 0; background: none; color: var(--text); min-height: 44px; display: grid; justify-items: center; align-content: center; gap: 3px; border-radius: 12px; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.mc-day.out { color: var(--text-3); opacity: .5; }
.mc-day.today span { background: var(--accent); color: #fff; border-radius: 50%; width: 28px; height: 28px; display: grid; place-items: center; }
.mc-day:active { background: var(--surface-2); }
.mc-day i { display: flex; gap: 3px; height: 5px; }
.mc-day i b { width: 5px; height: 5px; border-radius: 50%; background: var(--c, var(--accent)); }

/* Counters widget */
.w-count { min-height: 0; margin-bottom: 8px; cursor: default; gap: 0; }
.hc-row { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 52px; }
.hc-row + .hc-row { border-top: 1px solid var(--line); }
.hc-t { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hc-v { min-width: 36px; text-align: center; font: 500 24px/1 var(--display); font-variant-numeric: tabular-nums; }
.hc-v.bump { animation: pop .35s var(--spring); }
.w-count .round { width: var(--tap); height: var(--tap); border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); font-size: 22px; display: grid; place-items: center; }
.w-count .round.plus { background: var(--accent); color: #fff; border-color: transparent; }
.w-count .round:active { transform: scale(.9); }

/* Umzug & Kosten */
.sum-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sum { display: grid; gap: 4px; padding: 16px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); }
.sum .lbl { font-size: 13px; color: var(--text-3); font-weight: 600; }
.sum b { font: 500 26px/1.1 var(--display); }
.sum .sub { font-size: 12px; color: var(--text-2); }
.menu-item.cost { text-align: left; font: inherit; color: inherit; width: 100%; }
.menu-item .amt, .item .amt { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.menu-item.cost.paid .amt { color: var(--text-3); text-decoration: line-through; }
.progress { display: flex; align-items: center; gap: 12px; font-size: 13px; font-weight: 700; color: var(--text-2); }
.progress .bar { flex: 1; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.progress .bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .4s var(--ease); }
.who-chip { flex: none; min-height: 32px; padding: 0 10px; border-radius: 16px; border: 1px solid var(--line-2); background: none; color: var(--text-2); font-size: 12px; font-weight: 700; }
.wish-total { margin: 0 4px 12px; font-size: 13px; color: var(--text-2); }
.wish-total b { color: var(--text); }
input[type="range"] { width: 100%; accent-color: var(--accent); min-height: var(--tap); }

/* Admin */
.set-list { padding: 4px 16px; }
.row-switch { min-height: 52px; }
.row-switch + .row-switch { border-top: 1px solid var(--line); }
