/* Gemeinsame Grundlage für alle Seiten: Farben, Schrift und Kopfleiste.
   Es gibt bewusst nur eine helle Fassung (warmes Beige), unabhängig von der Geräteeinstellung.
   Schrift: nur Systemschriften des Geräts, es wird keine Schriftdatei geladen. */
:root {
  color-scheme: light;

  /* Markenfarben aus der Watten-App (AppTheme.swift) */
  --watten-primary: #00507F;
  --watten-primary-dark: #0081CB;
  --watten-primary-light: #2EB3FF;
  --watten-slate: #263238;

  --bg: #F6F1E7;
  --bg-alt: #EFE7D8;
  --surface: #FFFDF9;
  --text: #1F1B16;
  --text-muted: #6B6459;
  --line: rgba(70, 50, 20, 0.12);
  --fill: rgba(120, 95, 55, 0.12);
  --segment: #FFFDF9;
  --bar: rgba(255, 253, 249, 0.72);
  --accent: var(--watten-primary);
  --gold: #7A5718;
  --button: var(--watten-primary);
  --button-hover: #003A5C;
  --shadow-soft: 0 1px 2px rgba(70, 50, 20, 0.05), 0 12px 32px -14px rgba(70, 50, 20, 0.18);
  --shadow-lift: 0 2px 4px rgba(70, 50, 20, 0.05), 0 28px 56px -22px rgba(70, 50, 20, 0.34);

  --bar-h: 52px;
  --topbar-h: 76px; /* von der schwebenden Kopfleiste belegter Platz am oberen Rand */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: ui-serif, "New York", Georgia, "Noto Serif", "Times New Roman", serif;
  --ease: cubic-bezier(0.28, 0.11, 0.32, 1);
}

.topbar {
  position: fixed;
  top: 12px;
  left: 50%;
  translate: -50% 0;
  z-index: 50;
  width: min(1128px, calc(100% - 24px));
  height: var(--bar-h);
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bar);
  border-radius: 999px;
  box-shadow: 0 0 0 1px var(--line), var(--shadow-soft);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.4;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: -0.015em;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.topbar-suits { display: flex; gap: 2px; }
.topbar-suits img { display: block; width: 14px; height: 14px; }

.topbar-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 2px;
}

.topbar-nav a {
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s;
}

.topbar-nav a:hover,
.topbar-nav a.active,
.topbar-nav a[aria-current="page"] { color: var(--text); }

.topbar-nav a.active,
.topbar-nav a[aria-current="page"] { font-weight: 600; }

.topbar a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 8px;
}

.nav-sep {
  width: 1px;
  height: 16px;
  margin: 0 8px;
  background: var(--line);
}

/* „Apps“ ersetzt auf kleineren Bildschirmen die vier App-Links */
.nav-home { display: none; }

@media (max-width: 860px) {
  .topbar { padding: 0 14px; gap: 10px; }
  .topbar-nav .nav-app, .nav-sep { display: none; }
  .topbar-nav .nav-home { display: inline-block; }
  .topbar-nav a { padding: 6px 8px; }
}

@media (max-width: 400px) {
  .topbar { width: calc(100% - 16px); top: 8px; }
  .topbar-suits { display: none; }
}

@media (max-width: 350px) {
  .topbar { padding: 0 10px; gap: 4px; }
  .topbar-brand { font-size: 0.875rem; }
  .topbar-nav { gap: 0; }
  .topbar-nav a { padding: 6px 4px; font-size: 0.75rem; }
}

@media print {
  :root {
    --bg: #FFFFFF;
    --text: #000000;
    --text-muted: #444444;
    --line: rgba(0, 0, 0, 0.2);
    --accent: #000000;
  }
  .topbar { display: none; }
}
