/* ==========================================================================
   Rahmen: Marke, Navigation (Landing + Portal), mobile Tableiste, Fusszeile.
   Eigentuemer: Kern.
   ========================================================================== */

/* -------------------------------------------------------------- Wortmarke */
.wm-marke { display: inline-flex; align-items: center; gap: var(--s2); }
.wm-marke__zeichen { display: flex; }
.wm-marke__wort {
  font-size: 1.125rem; font-weight: 800; letter-spacing: -.022em; white-space: nowrap;
}
.wm-marke__t1 { color: var(--text); }
.wm-marke__t2 { color: var(--forest); }

/* ------------------------------------------------------------- Kopfleiste */
.wm-kopfleiste {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255, 253, 248, .88);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
@supports (backdrop-filter: blur(8px)) {
  .wm-kopfleiste { backdrop-filter: saturate(1.4) blur(8px); }
}
.wm-kopfleiste.is-gescrollt { border-bottom-color: var(--border); box-shadow: var(--sh-1); }

.wm-kopfleiste__innen {
  display: flex; align-items: center; gap: var(--s5);
  min-height: 68px;
}
.wm-kopfleiste__mitte { flex: 1; display: flex; justify-content: center; }
.wm-kopfleiste__rechts { display: flex; align-items: center; gap: var(--s2); }

.wm-nav { display: flex; align-items: center; gap: var(--s1); }
.wm-nav__link {
  position: relative;
  display: inline-flex; align-items: center; gap: var(--s2);
  min-height: 40px; padding: 0 var(--s3);
  border-radius: var(--r-s);
  font-size: var(--t-basis); font-weight: 600; color: var(--text-muted);
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.wm-nav__link:hover { color: var(--text); background: var(--surface-muted); }
.wm-nav__link.is-aktiv { color: var(--text); font-weight: 700; }
.wm-nav__link.is-aktiv::after {
  content: ''; position: absolute; left: var(--s3); right: var(--s3); bottom: -14px; height: 2px;
  background: var(--forest); border-radius: 2px;
}
.wm-nav__zahl {
  min-width: 20px; height: 20px; padding: 0 5px; border-radius: var(--r-pill);
  background: var(--forest-soft); color: var(--forest-dark);
  font-size: 11px; font-weight: 800; display: grid; place-items: center;
}

/* Nutzerzeichen */
.wm-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  background: var(--forest-soft); color: var(--forest-dark);
  border: 1px solid var(--forest-line);
  display: grid; place-items: center;
  font-size: var(--t-klein); font-weight: 800; letter-spacing: .02em;
  cursor: pointer;
}
.wm-avatar:hover { background: var(--forest-line); }

/* Glocke mit Punkt */
.wm-glocke { position: relative; }
.wm-glocke__punkt {
  position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--clay); border: 2px solid var(--surface);
}

/* Menuknopf nur mobil */
.wm-kopfleiste__menue { display: none; }

/* --------------------------------------------------- Mobile Landing-Menue */
.wm-mmenue {
  position: fixed; inset: 68px 0 auto 0; z-index: 59;
  background: var(--surface); border-bottom: 1px solid var(--border);
  box-shadow: var(--sh-3);
  padding: var(--s4) var(--s4) var(--s5);
  display: none; flex-direction: column; gap: var(--s1);
}
.wm-mmenue.is-offen { display: flex; }
.wm-mmenue .wm-nav__link { min-height: 48px; font-size: var(--t-lauf); }
.wm-mmenue__aktionen { display: grid; gap: var(--s2); margin-top: var(--s3); }

/* ------------------------------------------------ Mobile Tableiste Portal */
.wm-tableiste {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
  display: none;
  background: var(--surface); border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.wm-tableiste__innen { display: grid; grid-template-columns: repeat(4, 1fr); }
.wm-tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 58px; padding: var(--s2) 0;
  background: none; border: 0; cursor: pointer;
  color: var(--text-muted); font-size: 11px; font-weight: 600;
}
.wm-tab.is-aktiv { color: var(--forest); font-weight: 700; }
.wm-tab__punkt {
  position: absolute; margin-left: 16px; margin-top: -14px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--clay);
}

/* --------------------------------------------------------------- Fusszeile */
.wm-fuss {
  background: var(--surface-muted);
  border-top: 1px solid var(--border);
  padding-block: var(--s8) var(--s6);
  margin-top: var(--s10);
}
.wm-fuss__oben {
  display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: var(--s7);
  padding-bottom: var(--s7); border-bottom: 1px solid var(--border);
}
.wm-fuss__wort { max-width: 34ch; margin-top: var(--s3); color: var(--text-muted); font-size: var(--t-klein); }
.wm-fuss__titel {
  font-size: var(--t-mikro); font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: var(--s3);
}
.wm-fuss__liste { display: grid; gap: var(--s2); }
.wm-fuss__liste a { font-size: var(--t-klein); color: var(--text); }
.wm-fuss__liste a:hover { color: var(--forest); text-decoration: underline; text-underline-offset: 3px; }
.wm-fuss__unten {
  display: flex; flex-wrap: wrap; gap: var(--s3) var(--s5); justify-content: space-between;
  padding-top: var(--s5); font-size: var(--t-mikro); color: var(--text-muted);
}
/* Sichtbar gekennzeichneter Platzhalter — diese Seiten existieren noch nicht */
.wm-platzhalter {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text-muted); cursor: not-allowed;
}
.wm-platzhalter::after {
  content: 'in Vorbereitung';
  font-size: 10px; font-weight: 700; letter-spacing: .04em;
  padding: 2px 6px; border-radius: 5px;
  background: var(--clay-soft); color: var(--clay-text);
}
.wm-fuss__hinweis {
  margin-top: var(--s5); padding: var(--s4);
  border: 1px dashed var(--border-strong); border-radius: var(--r-m);
  font-size: var(--t-mikro); color: var(--text-muted); line-height: 1.5;
}

/* ------------------------------------------------------ Prototyp-Hinweisband */
.wm-protoband {
  background: var(--forest-dark); color: #fff;
  font-size: var(--t-mikro); letter-spacing: .01em;
}
.wm-protoband__innen {
  display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap;
  min-height: 34px; padding-block: var(--s1);
}
.wm-protoband strong { font-weight: 800; }
.wm-protoband a { color: #fff; text-decoration: underline; text-underline-offset: 2px; opacity: .85; }
.wm-protoband a:hover { opacity: 1; }

/* ------------------------------------------------------- Ansichten, Meldung */
.wm-ansicht { display: block; }
.wm-ansicht[hidden] { display: none; }

.wm-meldung {
  position: fixed; left: 50%; bottom: var(--s6); z-index: 120;
  transform: translate(-50%, 12px);
  padding: var(--s3) var(--s5); border-radius: var(--r-m);
  background: var(--text); color: var(--surface);
  font-size: var(--t-klein); font-weight: 600;
  box-shadow: var(--sh-3);
  opacity: 0; pointer-events: none;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.wm-meldung.is-da { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 760px) {
  body.wm-portal .wm-meldung { bottom: calc(64px + var(--s4)); }
}

/* Notizdialog: mittig, auf kleinen Schirmen als Bogen von unten */
.wm-dialog--notiz {
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(520px, calc(100vw - 2 * var(--s4)));
  max-height: min(560px, calc(100vh - 2 * var(--s5)));
}
@media (max-width: 560px) {
  .wm-dialog--notiz {
    top: auto; bottom: 0; left: 0; transform: none;
    width: 100%; max-height: 84vh;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
  }
}

/* Ruhiges Auftauchen beim Scrollen (nur wenn Bewegung erlaubt ist) */
.wm-auftauchen { opacity: 0; transform: translateY(14px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.wm-auftauchen.is-da { opacity: 1; transform: none; }

/* ------------------------------------------------------------- Responsive */
@media (max-width: 1000px) {
  .wm-kopfleiste__mitte { display: none; }
  .wm-kopfleiste__menue { display: inline-flex; }
  .wm-fuss__oben { grid-template-columns: 1fr 1fr; gap: var(--s6); }
}
@media (max-width: 760px) {
  .wm-kopfleiste__innen { min-height: 60px; gap: var(--s3); }
  .wm-mmenue { inset-block-start: 60px; }
  .wm-fuss__oben { grid-template-columns: 1fr; gap: var(--s5); }
  .wm-fuss { margin-top: var(--s8); }

  /* Portal: obere Navigation raus, untere Tableiste rein */
  body.wm-portal .wm-tableiste { display: block; }
  body.wm-portal { padding-bottom: 64px; }
  body.wm-portal .wm-kopfleiste__menue { display: none; }
}

/* Auf der Detailansicht weicht die Tableiste der Ruecknavigation */
body.wm-portal.wm-detail-offen .wm-tableiste { display: none; }
body.wm-portal.wm-detail-offen { padding-bottom: 0; }

/* --------------------------------------------------------------------------
   Mobile Aufräumarbeiten nach der Sichtprüfung bei 390 px.
   -------------------------------------------------------------------------- */
@media (max-width: 760px) {
  /* "Karte öffnen" steht mobil bereits im Kopfbereich der Liste — im
     Seitenkopf ist es eine Dublette und drängt Logo und Konto zusammen. */
  body.wm-portal #knopf-karte { display: none; }

  /* Das Prototyp-Band braucht mobil drei Zeilen. Kurzfassung genügt. */
  .wm-protoband__innen { gap: var(--s2); }
  .wm-protoband span { display: none; }
  .wm-protoband a { font-size: var(--t-mikro); }
}

/* Berührungsziele: die Links im Prototyp-Band und in der Fußzeile waren mit
   17 px Höhe zu klein zum Treffen. Der sichtbare Text bleibt gleich groß,
   nur die anklickbare Fläche wächst. */
@media (max-width: 1024px) {
  .wm-protoband a { display: inline-flex; align-items: center; min-height: 32px; }
  .wm-fuss__liste a, .wm-fuss__liste .wm-platzhalter {
    display: inline-flex; align-items: center; min-height: 40px;
  }
  .wm-fuss__liste { gap: 0; }
}

/* Die Wortmarke ist ein Link zur Startseite und war nur 28 px hoch. */
.wm-marke { min-height: 44px; }

/* Auch die Links in der unteren Fußzeile brauchen mobil eine greifbare Fläche. */
@media (max-width: 1024px) {
  .wm-fuss__unten a, .wm-fuss__unten .wm-platzhalter {
    display: inline-flex; align-items: center; min-height: 40px;
  }
}

/* Das Prototyp-Band ist kein produktives Bauteil, seine Links sollen aber
   trotzdem greifbar sein — sonst rauscht jede Prüfung damit voll. */
.wm-protoband a { display: inline-flex; align-items: center; min-height: 32px; }

/* Fußzeilen-Links auch am Desktop mit greifbarer Fläche (32 px statt 20 px).
   Der Zeilenrhythmus bleibt praktisch gleich, weil dafür der Abstand entfällt. */
.wm-fuss__liste { gap: 0; }
.wm-fuss__liste a, .wm-fuss__liste .wm-platzhalter,
.wm-fuss__unten a, .wm-fuss__unten .wm-platzhalter {
  display: inline-flex; align-items: center; min-height: 32px;
}

/* Vor dem Anmelden gibt es nichts zu navigieren: Kopfleiste und Tableiste
   bleiben verborgen, bis echte Daten geladen sind. */
body.wm-nur-login .wm-kopfleiste__mitte,
body.wm-nur-login .wm-kopfleiste__rechts,
body.wm-nur-login .wm-tableiste { display: none; }
body.wm-nur-login { padding-bottom: 0; }

/* --------------------------------------------------------------------------
   Sehr schmale Schirme (unter ~520 px): Logo, „Anmelden", CTA und Menüknopf
   passen nicht mehr nebeneinander — die Zeile lief aus dem Bild und erzeugte
   Querscrollen. „Anmelden" steht im aufgeklappten Menü ohnehin, hier fliegt
   es raus. Das Referenzbild zeigt mobil ebenfalls nur Logo, Menü und CTA.
   -------------------------------------------------------------------------- */
@media (max-width: 520px) {
  .wm-kopfleiste__rechts > .wm-btn--still { display: none; }
  .wm-kopfleiste__rechts { gap: var(--s1); }
  .wm-kopfleiste__rechts > .wm-btn--primaer { padding-inline: var(--s3); font-size: var(--t-klein); }
}
@media (max-width: 380px) {
  /* Noch enger: auch der CTA weicht ins Menü, Logo und Menüknopf bleiben. */
  .wm-kopfleiste__rechts > .wm-btn--primaer { display: none; }
}
