/* ── nav.css – gemeinsame Kopfleiste (Wappen · Titel · 🏠 zur Startseite) und Sheet-Grundstil (Teilen)
   für alle Nutzerseiten. Nutzt die Farb-Tokens der jeweiligen Seite und hat eigene Rückfallwerte,
   damit es auch auf Seiten ohne diese Tokens (Wrapped, Datenschutz) funktioniert. */

/* no double-tap zoom detection – taps fire immediately on iOS */
html { touch-action: manipulation; }
a, button, [role="button"] { touch-action: manipulation; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
  /* solid background – iOS Safari sometimes swallows taps on sticky bars with backdrop-filter */
  background: var(--bg, #f3efe6);
  border-bottom: 1px solid var(--line, #e4ddce);
  color: var(--ink, #1c2a20);
  font-family: var(--font-body, 'Open Sans', system-ui, sans-serif);
  text-align: left;
}
.topbar-home { display: flex; flex-shrink: 0; }
.topbar-crest { width: 34px; height: 34px; object-fit: contain; }
.topbar-title { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar-kicker {
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  color: var(--muted, #647067);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-name {
  font-family: var(--font-head, 'Montserrat', system-ui, sans-serif);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;          /* narrow phones: "…" instead of running under the buttons */
  text-overflow: ellipsis;
}

/* pages without a global [hidden] rule (Wrapped, Dashboard, Datenschutz) */
.icon-btn[hidden] { display: none !important; }
.icon-btn {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border: 1px solid var(--line, #e4ddce);
  border-radius: 14px;
  background: var(--surface, #fff);
  color: var(--ink, #1c2a20);
  display: grid;
  place-items: center;
  text-decoration: none;
  font-size: 1.1rem;
  cursor: pointer;
}

/* floating home button on pages without a top bar (Wrapped – stays visible on the slides, too) */
.nav-float {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  right: 12px;
  z-index: 150; /* above the Wrapped start screen (100), below login overlays */
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

/* ── Sheets (share) ── */
body.no-scroll { overflow: hidden; }
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(10, 18, 13, 0);
  transition: background 0.2s ease;
}
.sheet-backdrop[hidden] { display: none !important; }
.sheet-backdrop.open { background: rgba(10, 18, 13, 0.5); }
.sheet {
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 10px 14px calc(18px + env(safe-area-inset-bottom));
  border-radius: 24px 24px 0 0;
  background: var(--surface, #fff);
  color: var(--ink, #1c2a20);
  font-family: var(--font-body, 'Open Sans', system-ui, sans-serif);
  text-align: left;
  transform: translateY(100%);
  transition: transform 0.22s ease;
}
.sheet-backdrop.open .sheet { transform: translateY(0); }
.sheet-grip { width: 42px; height: 5px; margin: 0 auto 10px; border-radius: 3px; background: var(--line, #e4ddce); }
.sheet-title { font-family: var(--font-head, 'Montserrat', system-ui, sans-serif); font-size: 1.05rem; margin: 0 0 10px; }


@media (min-width: 600px) {
  .sheet-backdrop { align-items: center; }
  .sheet { border-radius: 24px; }
}

/* fullscreen sheet with close button (share) */
.sheet-backdrop.fullscreen { align-items: stretch; }
.sheet-backdrop.fullscreen .sheet {
  max-width: none;
  max-height: none;
  height: 100%;
  border-radius: 0;
  padding: calc(8px + env(safe-area-inset-top)) max(14px, calc((100% - 560px) / 2)) calc(18px + env(safe-area-inset-bottom));
}
.sheet-head {
  position: sticky;
  top: calc(-8px - env(safe-area-inset-top));
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 8px;
  padding: 8px 0;
  background: var(--surface, #fff);
}
.sheet-head .sheet-title { margin: 0; }
.sheet-close {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border: 1px solid var(--line, #e4ddce);
  border-radius: 50%;
  background: var(--surface-2, #f8f5ee);
  color: var(--ink, #1c2a20);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

@media print {
  .topbar .icon-btn, .nav-float { display: none; }
  .topbar { position: static; }
}
