/* Wardrobe PWA — Tokens aus CLAUDE.md §1 (light/dark), Understated Luxury. */

@font-face { font-family: 'Outfit'; src: url('../fonts/Outfit-SemiBold.ttf'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Inter';  src: url('../fonts/Inter-Regular.ttf');  font-weight: 400; font-display: swap; }
@font-face { font-family: 'Inter';  src: url('../fonts/Inter-SemiBold.ttf'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Caveat'; src: url('../fonts/Caveat-Regular.ttf'); font-weight: 400; font-display: swap; }

:root {
  --canvas: #F5F1EA;
  --canvas-glow: #FBF8F3;
  --surface: #FFFFFF;
  --surface-glass: rgba(255, 255, 255, 0.78);
  --hairline: #E0D9CF;
  --ink: #2B2724;
  --ink-muted: #85786B;
  --gold: #B99A5B;
  --gold-deep: #A3854A;
  --gold-soft: rgba(185, 154, 91, 0.14);
  --on-gold: #FFFFFF;
  --photo-from: #D1C7B8;
  --photo-to: #9E9180;
  --shadow: 0 2px 14px rgba(43, 39, 36, 0.08);
  --shadow-lift: 0 10px 30px rgba(43, 39, 36, 0.14);
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #1A1714;
    --canvas-glow: #211D19;
    --surface: #241F1B;
    --surface-glass: rgba(36, 31, 27, 0.78);
    --hairline: #3A332C;
    --ink: #F0EBE3;
    --ink-muted: #A2968A;
    --gold: #C9AC72;
    --gold-deep: #B99A5B;
    --gold-soft: rgba(201, 172, 114, 0.16);
    --on-gold: #1A1714;
    --photo-from: #4A433A;
    --photo-to: #2A2621;
    --shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
    --shadow-lift: 0 10px 30px rgba(0, 0, 0, 0.5);
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }

body {
  background:
    radial-gradient(1100px 500px at 50% -150px, var(--canvas-glow), transparent),
    var(--canvas);
  color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
}

button { -webkit-touch-callout: none; user-select: none; }

.view {
  padding: calc(env(safe-area-inset-top) + 18px) 20px calc(env(safe-area-inset-bottom) + 104px);
  max-width: 560px;
  margin: 0 auto;
  animation: view-in 0.34s ease both;
  /* Höhe nie kollabieren lassen — sonst springt die Tab-Leiste beim Tab-Wechsel */
  min-height: 100dvh;
}
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* --- Typo-Rollen (§1.4) --- */
.app-title    { font-family: 'Outfit'; font-size: 24px; font-weight: 600; letter-spacing: 0.3px; }
.screen-title { font-family: 'Outfit'; font-size: 22px; font-weight: 600; letter-spacing: 0.2px; }
.greeting     { font-family: 'Caveat'; font-size: 27px; color: var(--gold); }
.section-label {
  font-size: 12px; font-weight: 600; letter-spacing: 2px;
  color: var(--gold); text-transform: uppercase;
  margin: 22px 0 10px;
  display: flex; align-items: center; gap: 10px;
}
.section-label::after { content: ''; flex: 1; height: 1px; background: linear-gradient(to right, var(--hairline), transparent); }
.body-muted { color: var(--ink-muted); }
.caption { font-size: 11px; color: var(--ink-muted); }

/* --- Kopfzeile mit goldener Linie --- */
.header { display: flex; align-items: center; justify-content: space-between; }
.header-rule {
  width: 44px; height: 2px; margin: 8px 0 2px;
  background: linear-gradient(to right, var(--gold), transparent);
  border-radius: 1px;
}

/* --- Wetter-Karte --- */
.weather-card {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  background: var(--surface-glass);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--gold);
  border-radius: 14px;
  padding: 10px 14px;
  margin: 10px 0 2px;
  animation: view-in 0.4s ease both;
}
.weather-now { font-family: 'Outfit'; font-size: 18px; font-weight: 600; }
.weather-range { font-size: 12.5px; color: var(--ink-muted); }

/* --- Suchfeld --- */
.search-field {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 12px 16px;
  font-family: inherit; font-size: 16px; /* 16px verhindert iOS-Auto-Zoom */
  color: var(--ink);
  margin: 12px 0;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none; appearance: none;
}
.search-field::placeholder { color: var(--ink-muted); }
.search-field:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }

/* --- Chips --- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--ink-muted);
  border-radius: 999px;
  padding: 7px 14px;
  font: inherit; font-size: 13px;
  cursor: pointer;
  transition: transform 0.15s, background 0.2s, color 0.2s, border-color 0.2s;
}
.chip:active { transform: scale(0.94); }
.chip.active {
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  border-color: transparent; color: var(--on-gold); font-weight: 600;
  box-shadow: 0 3px 10px rgba(185, 154, 91, 0.35);
}
.chip.chip-tag { border-style: dashed; }
.chip.chip-tag.active { border-style: solid; }

/* --- Grid & Kacheln --- */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.tile {
  background: var(--surface);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  border: 1px solid var(--hairline);
  padding: 0;
  text-align: left;
  font: inherit;
  color: var(--ink);
  position: relative;
  transition: transform 0.18s ease, box-shadow 0.25s ease;
  animation: tile-in 0.4s ease both;
}
.tile:nth-child(2n) { animation-delay: 0.05s; }
.tile:nth-child(3)  { animation-delay: 0.08s; }
.tile:nth-child(5)  { animation-delay: 0.12s; }
@keyframes tile-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.tile:active { transform: scale(0.97); box-shadow: var(--shadow-lift); }
.tile-photo { overflow: hidden; aspect-ratio: 4 / 5; }
.tile img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  background: linear-gradient(var(--photo-from), var(--photo-to));
  transition: transform 0.5s ease;
}
.tile:active img { transform: scale(1.05); }
.tile-label {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 38px 12px 11px;
  background: linear-gradient(to top, rgba(20, 16, 12, 0.66), transparent);
}
.tile-title { font-size: 13.5px; font-weight: 600; color: #fff; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-tags { font-size: 10.5px; color: var(--gold-deep); letter-spacing: 0.4px;
             overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.tile-heart {
  position: absolute; top: 8px; right: 8px;
  background: var(--surface-glass);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: var(--gold);
  border: none; border-radius: 999px; width: 30px; height: 30px;
  font-size: 15px; line-height: 30px; text-align: center; padding: 0;
  animation: heart-pop 0.35s ease;
}
@keyframes heart-pop { 0% { transform: scale(0); } 70% { transform: scale(1.25); } 100% { transform: scale(1); } }

/* --- Leerer Zustand --- */
.empty { text-align: center; padding: 56px 24px; color: var(--ink-muted); }
.empty .greeting { display: block; margin-bottom: 10px; }

/* --- Foto-Rahmen --- */
.photo-frame {
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(var(--photo-from), var(--photo-to));
  box-shadow: var(--shadow-lift);
  position: relative;
  border: 1px solid var(--hairline);
}
.photo-frame::after {
  content: ''; position: absolute; inset: 0;
  border-radius: 18px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
  pointer-events: none;
}
.photo-frame img { width: 100%; max-height: 58vh; object-fit: cover; display: block; }
.photo-frame .photo-label {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 64px 18px 16px; text-align: left;
  font-family: 'Caveat'; font-size: 28px; color: #fff;
  background: linear-gradient(to top, rgba(20, 16, 12, 0.62), transparent);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}
.suggest-badge {
  position: absolute; top: 12px; left: 12px;
  background: var(--surface-glass);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid var(--hairline);
  color: var(--gold-deep);
  font-size: 10.5px; font-weight: 600; letter-spacing: 1.6px; text-transform: uppercase;
  padding: 6px 12px; border-radius: 999px;
}

/* --- Buttons --- */
.btn {
  display: block; width: 100%;
  border: none; border-radius: 14px;
  padding: 14px 18px;
  font: inherit; font-weight: 600; font-size: 14px;
  cursor: pointer;
  margin-top: 12px;
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn-gold {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-deep) 100%);
  color: var(--on-gold);
  box-shadow: 0 4px 14px rgba(185, 154, 91, 0.4);
  position: relative; overflow: hidden;
}
.btn-gold::after {
  content: ''; position: absolute; top: 0; left: -80%;
  width: 50%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-20deg);
  animation: sheen 3.6s ease-in-out infinite;
}
@keyframes sheen { 0%, 65% { left: -80%; } 90%, 100% { left: 130%; } }
.btn-quiet { background: var(--surface); color: var(--ink); border: 1px solid var(--hairline); }
.btn-danger { background: none; color: #A0522D; border: none; font-weight: 400; font-size: 13px; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }

/* --- Formular --- */
.field-label { font-size: 13px; font-weight: 600; margin: 18px 0 6px; }
input[type="text"].text-input {
  width: 100%; background: var(--surface); border: 1px solid var(--hairline);
  border-radius: 14px; padding: 12px 16px;
  font-family: inherit; font-size: 16px; color: var(--ink); outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none; appearance: none;
}
input[type="text"].text-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }

.file-drop {
  border: 1.5px dashed var(--gold);
  border-radius: 18px;
  background: var(--gold-soft);
  padding: 46px 20px;
  text-align: center;
  color: var(--ink-muted);
  cursor: pointer;
  margin-top: 14px;
  transition: transform 0.15s;
}
.file-drop:active { transform: scale(0.98); }
.file-drop .greeting { display: block; }

/* --- Tag-Eingabe --- */
.tag-editor { display: flex; gap: 8px; }
.tag-editor .text-input { flex: 1; }
.tag-add-btn {
  border: none; border-radius: 14px; width: 48px;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: var(--on-gold); font-size: 20px; cursor: pointer; flex-shrink: 0;
}
.tag-suggest { margin-top: 8px; }
.chip .chip-x { margin-left: 6px; opacity: 0.75; }

/* --- Trage-Log --- */
.wear-list { list-style: none; margin-top: 8px; }
.wear-list li {
  background: var(--surface); border-radius: 12px;
  border: 1px solid var(--hairline);
  padding: 10px 14px; margin-bottom: 8px;
  display: flex; justify-content: space-between;
  font-size: 13px;
}

/* --- Modal / Detail --- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(26, 23, 20, 0.45);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center; z-index: 50;
  animation: fade-in 0.2s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal-sheet {
  background: var(--canvas);
  border-radius: 24px 24px 0 0;
  width: 100%; max-width: 560px;
  max-height: 92vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 20px 20px calc(env(safe-area-inset-bottom) + 24px);
  animation: sheet-up 0.28s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes sheet-up { from { transform: translateY(60px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-dialog {
  background: var(--canvas); border-radius: 20px;
  max-width: 340px; margin: auto; padding: 26px 20px; text-align: center;
  box-shadow: var(--shadow-lift);
  animation: dialog-in 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.3);
}
@keyframes dialog-in { from { transform: scale(0.85); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-backdrop.center { align-items: center; padding: 20px; }
.modal-dialog .greeting { display: block; margin-bottom: 8px; }
.sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--hairline); margin: 0 auto 16px; }

/* Detail-Sheet kompakt: kleines Foto, enge Chips — kein ewiges Scrollen */
.modal-sheet .photo-frame img { max-height: 34vh; }
.modal-sheet .chip { padding: 5px 11px; font-size: 12px; }
.modal-sheet .field-label { margin: 12px 0 5px; }
.modal-sheet .btn { padding: 12px 16px; }
.sheet-close {
  position: absolute; top: 14px; right: 16px;
  width: 30px; height: 30px; border-radius: 999px; border: none;
  background: var(--surface-glass);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: var(--ink-muted); font-size: 15px; line-height: 30px; cursor: pointer; z-index: 2;
}
.modal-sheet { position: relative; }

/* --- Tab-Leiste (Milchglas) --- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: space-around;
  background: var(--surface-glass);
  -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4);
  border-top: 1px solid var(--hairline);
  padding: 8px 12px calc(env(safe-area-inset-bottom) + 8px);
  z-index: 40;
}
.tab {
  background: none; border: none; font: inherit; font-size: 11px;
  color: var(--ink-muted); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 64px;
  transition: color 0.2s;
}
.tab.active { color: var(--gold); font-weight: 600; }
.tab-icon { display: block; }
.tab-add-circle {
  width: 54px; height: 54px; border-radius: 999px;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: var(--on-gold);
  display: flex; align-items: center; justify-content: center;
  margin-top: -28px;
  box-shadow: 0 6px 18px rgba(185, 154, 91, 0.5);
  transition: transform 0.15s;
}
.tab-add:active .tab-add-circle { transform: scale(0.92); }

/* --- Statistik --- */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: 14px; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 2px;
}
.stat-num { font-family: 'Outfit'; font-size: 20px; font-weight: 600; color: var(--gold-deep); }
.stat-row { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.stat-row-title { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-thumb { width: 34px; height: 34px; border-radius: 9px; object-fit: cover; flex-shrink: 0; }
.stat-row.packed .stat-row-title { text-decoration: line-through; color: var(--ink-muted); }
.pack-check {
  width: 22px; height: 22px; border-radius: 999px; flex-shrink: 0;
  border: 1.5px solid var(--gold); color: var(--gold-deep);
  font-size: 13px; line-height: 20px; text-align: center;
}

/* --- Kalender --- */
.cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-head { text-align: center; font-size: 10.5px; color: var(--ink-muted); padding: 4px 0; letter-spacing: 0.5px; }
.cal-day {
  position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--hairline);
  padding: 0; cursor: default; font: inherit; color: var(--ink);
}
.cal-day.has-wear { cursor: pointer; border-color: var(--gold); }
.cal-day.today { box-shadow: 0 0 0 2px var(--gold); }
.cal-day img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cal-num { position: absolute; top: 3px; left: 5px; font-size: 10.5px; color: var(--ink-muted); }
.cal-num.on-img { color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,0.7); }
.cal-more {
  position: absolute; bottom: 3px; right: 4px;
  background: var(--gold); color: var(--on-gold);
  font-size: 9px; font-weight: 600; border-radius: 999px; padding: 1px 5px;
}

/* --- Packlisten-Auswahl --- */
.pick-tile { opacity: 0.72; }
.pick-tile.picked {
  opacity: 1;
  box-shadow: 0 0 0 2.5px var(--gold), var(--shadow);
}
.pick-tile.picked::after {
  content: '✓'; position: absolute; top: 8px; right: 8px;
  width: 26px; height: 26px; border-radius: 999px;
  background: var(--gold); color: var(--on-gold);
  font-size: 14px; line-height: 26px; text-align: center;
}

/* --- Install-Banner --- */
.install-banner {
  position: fixed; left: 12px; right: 12px;
  bottom: calc(env(safe-area-inset-bottom) + 84px);
  z-index: 45;
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-glass);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid var(--gold);
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: var(--shadow-lift);
  animation: sheet-up 0.35s cubic-bezier(0.2, 0.9, 0.3, 1);
  max-width: 536px; margin: 0 auto;
}
.install-text { flex: 1; font-size: 13px; }
.install-banner .install-btn { width: auto; margin: 0; padding: 9px 16px; font-size: 13px; }
.install-close {
  background: none; border: none; color: var(--ink-muted);
  font-size: 14px; cursor: pointer; padding: 4px;
}

/* --- Vorschlag --- */
.suggest-meta { display: flex; justify-content: space-between; align-items: baseline; margin-top: 12px; }
.swipe-hint { text-align: center; margin-top: 10px; letter-spacing: 0.5px; }
.suggest-enter { animation: suggest-in 0.32s cubic-bezier(0.2, 0.9, 0.3, 1) both; }
@keyframes suggest-in { from { opacity: 0; transform: translateX(36px) rotate(1.2deg); } to { opacity: 1; transform: none; } }

/* --- Redesign 2026-08: Wetter-Pill, Scroll-Chips, Overlay-Kacheln, Heute-Hero --- */
.greet-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.weather-pill {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface-glass);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid var(--hairline); border-radius: 999px;
  padding: 7px 13px; white-space: nowrap; flex: none;
}
.weather-pill .weather-now { font-size: 14px; }
.weather-pill .weather-range { font-size: 11.5px; }
.chips.scroll {
  flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to right, #000 92%, transparent);
  mask-image: linear-gradient(to right, #000 92%, transparent);
  padding-right: 24px;
}
.weather-pill[hidden], .hero-chip[hidden] { display: none; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chips.scroll .chip { flex: none; white-space: nowrap; }
.tile-meta {
  font-size: 10.5px; color: rgba(255, 255, 255, 0.85); letter-spacing: 0.4px; margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hero-chip {
  position: absolute; top: 12px; right: 12px;
  display: flex; align-items: center; gap: 6px;
  background: var(--surface-glass);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid var(--hairline); border-radius: 999px;
  padding: 6px 12px;
  font-family: 'Outfit'; font-weight: 600; font-size: 12.5px; color: var(--ink);
}
.photo-sub {
  font-family: 'Inter'; font-size: 12px; color: rgba(255, 255, 255, 0.85);
  margin-top: 2px; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}
.dots { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 14px; min-height: 8px; }
.dot { width: 6px; height: 6px; border-radius: 999px; background: var(--hairline); transition: width 0.25s, background 0.25s; }
.dot.active { width: 18px; background: var(--gold); }
.btn-row .btn-arrow {
  flex: none; align-self: stretch; width: 52px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 14px;
  margin-top: 12px; color: var(--ink-muted); cursor: pointer; padding: 0;
  transition: transform 0.15s;
}
.btn-arrow:active { transform: scale(0.95); }

/* --- Vollbild-Viewer mit Zwei-Finger-Zoom --- */
.modal-backdrop.plain { background: #0E0C0A; -webkit-backdrop-filter: none; backdrop-filter: none; align-items: stretch; }
.viewer {
  position: relative; width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  animation: fade-in 0.22s ease;
}
.viewer-stage {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  touch-action: none;            /* Zoom-Gesten gehören uns, nicht dem Browser */
}
.viewer-img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  transform-origin: center center;
  will-change: transform;
  -webkit-user-select: none; user-select: none;
  -webkit-user-drag: none;
}
.viewer-top {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 12px;
  padding: calc(env(safe-area-inset-top) + 12px) 16px 28px;
  background: linear-gradient(to bottom, rgba(14, 12, 10, 0.72), transparent);
  pointer-events: none;
  transition: opacity 0.2s;
}
.viewer-top > * { pointer-events: auto; }
.viewer.zoomed .viewer-top, .viewer.zoomed .viewer-edit { opacity: 0; pointer-events: none; }
.viewer-close {
  width: 38px; height: 38px; border-radius: 999px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.16);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: none; color: #fff; cursor: pointer;
}
.viewer-title {
  font-family: 'Outfit'; font-weight: 600; font-size: 16px; color: #fff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.viewer-edit {
  position: absolute; right: 16px;
  bottom: calc(env(safe-area-inset-bottom) + 20px);
  display: flex; align-items: center; gap: 7px;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: #fff; border: none; border-radius: 999px;
  padding: 12px 20px;
  font: inherit; font-weight: 600; font-size: 14px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: transform 0.15s, opacity 0.2s;
}
.viewer-edit:active { transform: scale(0.95); }

/* --- Swipe-Karte (Heute) --- */
.photo-frame { touch-action: pan-y; }

/* --- Einstellungs-Schalter --- */
.setting-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: 14px; padding: 14px;
}
.setting-title { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.switch {
  width: 50px; height: 30px; border-radius: 999px; flex-shrink: 0;
  background: var(--hairline); border: none; cursor: pointer; padding: 3px;
  display: flex; justify-content: flex-start;
  transition: background 0.22s;
}
.switch.on { background: linear-gradient(135deg, var(--gold), var(--gold-deep)); justify-content: flex-end; }
.switch-knob {
  width: 24px; height: 24px; border-radius: 999px; background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  transition: transform 0.22s;
}
.stat-card-link { cursor: pointer; transition: transform 0.15s, border-color 0.2s; }
.stat-card-link:active { transform: scale(0.97); border-color: var(--gold); }
