/* Kopfleiste – auf allen Seiten außerhalb der Verwaltung gleich (partials/topbar.php) */
:root { --top: 76px; --gutter: clamp(16px, 2vw, 28px); }
/* ---------------------------------------------------------------- Kopfzeile */
.top {
  position: fixed; inset: 0 0 auto; z-index: 8; height: var(--top);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem;
  padding: 0 var(--gutter);
}
.top-left { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.brand { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.mark {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  background: radial-gradient(circle, var(--accent) 0 24%, transparent 26%);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 55%, transparent);
}
.mark.big { width: 54px; height: 54px; }
.brand-name { font-family: var(--display); font-weight: 600; font-size: 1.02rem; letter-spacing: .06em; line-height: 1.1; white-space: nowrap; }
.brand-tag { font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tools { display: flex; justify-content: flex-end; align-items: center; gap: .2rem; }
.clock { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .9rem; margin-right: .5rem; }

.icon-btn {
  display: inline-grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: var(--r-m);
  background: transparent; border: 1px solid transparent; color: var(--muted); cursor: pointer;
  transition: color .2s, border-color .2s, background .2s; text-decoration: none;
}
.icon-btn:hover { color: var(--text); border-color: var(--line); }
.icon-btn.small { width: 34px; height: 34px; }
.icon-btn[aria-pressed=true], .icon-btn[aria-expanded=true] { color: var(--accent); }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }
/* ---------------------------------------------------------------- Benutzer */
.usermenu { position: relative; }
.user-btn { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; border: 1px solid transparent; background: none; cursor: pointer; padding: 0; }
.user-btn:hover, .user-btn[aria-expanded=true] { border-color: var(--line); }
.avatar-chip {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); font-size: .78rem; font-weight: 600; letter-spacing: .02em;
}
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; min-width: 240px; padding: .4rem; border-radius: var(--r-l);
  background: var(--glass-strong); border: 1px solid var(--line); box-shadow: 0 12px 32px var(--shadow);
}
.menu-head { display: grid; padding: .5rem .7rem .6rem; border-bottom: 1px solid var(--line-soft); margin-bottom: .3rem; }
.menu-head small { color: var(--muted); }
.menu-pop [role=menuitem] {
  display: flex; align-items: center; gap: .6rem; width: 100%; padding: .55rem .7rem; border-radius: var(--r-m); border: 0; background: none;
  color: var(--text); text-decoration: none; font-size: .92rem; cursor: pointer; text-align: left;
}
.menu-pop [role=menuitem]:hover, .menu-pop [role=menuitem]:focus-visible { background: color-mix(in srgb, var(--accent) 10%, transparent); outline: none; }
.menu-pop .icon { width: 17px; height: 17px; color: var(--muted); }
.login-btn { text-decoration: none; color: var(--text); margin-left: .3rem; }
.menu-foot { margin-top: .3rem; padding: .55rem .7rem .3rem; border-top: 1px solid var(--line-soft); }

.brand { color: var(--text); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-text { display: grid; min-width: 0; }
.icon-btn .icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.menu-pop .icon, .user-btn .icon { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.pill.login-btn { border: 1px solid var(--line); border-radius: 99px; padding: .45rem 1rem; font-weight: 600; font-size: .88rem; }

/* Seiten mit Inhalt: Leiste klebt oben, Inhalt scrollt darunter */
.top-page { inset: auto; position: sticky; top: 0; background: color-mix(in srgb, var(--ink) 82%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line-soft); }
.top-page .top-center { transform: none; }
.page-title { font-family: var(--display); font-weight: 600; font-size: 1rem; letter-spacing: .02em; color: var(--muted); white-space: nowrap; }

@media (max-width: 1100px) { .clock, .brand-tag { display: none; } }
@media (max-width: 820px) { .top-page { grid-template-columns: 1fr auto; } .top-page .top-center { display: none; } }
@media (max-width: 440px) {
  .top .icon-btn, .top .user-btn { width: 36px; height: 36px; }   /* Konto-Knopf gleich groß wie die übrigen */
  .dot-badge { top: 2px; right: 2px; }
  .brand { gap: .5rem; }
  .brand-name { font-size: .9rem; letter-spacing: .03em; }
}
@media (max-width: 360px) { .top-page .brand-name { display: none; } }

/* Imitieren: unübersehbarer Hinweis über allem */
.imp-banner {
  position: fixed; z-index: 50; top: calc(var(--top) + 6px); left: 0; right: 0; margin: 0 auto; width: fit-content; max-width: calc(100% - 24px);
  display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; justify-content: center;
  padding: .45rem .55rem .45rem 1rem; border-radius: 99px; font-size: .86rem;
  background: var(--signal); color: #1a1100; box-shadow: 0 10px 30px var(--shadow);
}
.imp-back { border: 0; border-radius: 99px; padding: .35rem .9rem; font: inherit; font-weight: 600; cursor: pointer; background: #1a1100; color: #fff; }
.user-btn { position: relative; }
.dot-badge { position: absolute; top: 5px; right: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 2px var(--ink); }
.menu-badge { margin-left: auto; min-width: 1.4em; padding: 0 .4em; border-radius: 99px; background: var(--signal); color: #1a1100; font-size: .75rem; font-weight: 700; text-align: center; }
.dot-badge.is-warn { background: var(--danger); }
/* Speicher fast voll */
.menu-pop .menu-warn { align-items: flex-start; color: var(--danger); }
.menu-warn > span:last-child { display: grid; gap: .1rem; }
.menu-warn small { color: var(--muted); font-size: .76rem; font-weight: 400; }
.menu-pop .menu-warn .icon { color: var(--danger); }

/* Hinweise der Verwaltung (Banner) – schmal, unaufdringlich, höchstens drei */
.banners { display: grid; gap: .35rem; width: min(680px, calc(100% - 2 * var(--gutter))); margin: .7rem auto 0; }
.banners-fixed {
  position: fixed; z-index: 7; top: calc(var(--top) + 4px); margin: 0;
  left: calc(50% + var(--shift, 0px)); transform: translateX(-50%); transition: left .35s var(--ease, ease);
  width: min(620px, calc(100% - var(--left, 0px) - var(--right, 0px) - 2 * var(--gutter)));
}
.banner {
  --b: var(--accent);
  display: flex; align-items: center; gap: .55rem; min-height: 34px; padding: .3rem .4rem .3rem .75rem; border-radius: var(--r-l);
  font-size: .84rem; line-height: 1.35; color: var(--text);
  background: color-mix(in srgb, var(--b) 9%, var(--raise)); border: 1px solid color-mix(in srgb, var(--b) 28%, transparent);
  box-shadow: 0 6px 18px -12px var(--shadow, rgb(0 0 0 / .3)); animation: banner-in .25s ease-out;
}
.banner-warning { --b: var(--signal, #c88a12); }
.banner-error { --b: var(--danger, #c0392b); }
.banner-success { --b: var(--ok, #2e8b57); }
.banner-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--b); }
.banner-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.banner-text a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.banner-close { flex: none; width: 26px; height: 26px; border: 0; border-radius: var(--r-m); background: none; color: var(--muted); font-size: 1.1rem; line-height: 1; cursor: pointer; }
.banner-close:hover { color: var(--text); background: color-mix(in srgb, var(--text) 8%, transparent); }
.banner-close:focus-visible { outline: 2px solid var(--accent); }
@keyframes banner-in { from { opacity: 0; transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .banner { animation: none; } }

/* Sprungziele (#abschnitt) und Fokus nicht unter der klebenden Kopfleiste bzw. Speicherleiste verstecken */
html:has(.top-page) { scroll-padding-top: calc(var(--top) + 12px); scroll-padding-bottom: 84px; }
