/* Reset, Grundtypografie und App-Grundgerüst. */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

body { min-height: 100vh; overflow-x: hidden; }

img, svg, video, canvas { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Sichtbarer Fokus für Tastaturnutzung — nie entfernen. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* ── Grundgerüst ─────────────────────────────────────────── */
.layout {
  display: grid;
  grid-template-rows: var(--topbar-h) 1fr;
  min-height: 100vh;
}

main {
  padding: var(--sp-8) var(--sp-6);
  max-width: var(--maxw);
  margin: 0 auto;
  width: 100%;
}

.section { display: none; }
.section.active { display: block; animation: fade-up var(--dur) var(--ease); }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* ── Topbar ──────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: 0 var(--sp-6);
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.logo {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.logo .grad-text { font-weight: 800; }

.status-dot {
  width: 7px; height: 7px;
  border-radius: var(--r-full);
  background: var(--green);
  box-shadow: 0 0 6px rgba(5,150,105,0.5);
  flex-shrink: 0;
}
.status-dot.offline { background: var(--red); box-shadow: 0 0 6px rgba(220,38,38,0.5); }

/* ── Seitenkopf ──────────────────────────────────────────── */
.page-header { margin-bottom: var(--sp-6); }
.page-header h1 {
  font-size: var(--text-2xl);
  font-weight: 800;
  letter-spacing: -0.025em;
}
.page-header p {
  color: var(--text-2);
  margin-top: var(--sp-1);
  font-size: var(--text-md);
}

/* ── Gradient-Text (Marke) ───────────────────────────────── */
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ── Hilfsklassen ────────────────────────────────────────── */
.row     { display: flex; align-items: center; gap: var(--sp-3); }
.row-wrap{ display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.col     { display: flex; flex-direction: column; gap: var(--sp-3); }
.grow    { flex: 1; min-width: 0; }
.ml-auto { margin-left: auto; }
.hidden  { display: none !important; }
.truncate{ white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.c-accent { color: var(--accent); }
.c-green  { color: var(--green); }
.c-yellow { color: var(--yellow); }
.c-red    { color: var(--red); }
.c-orange { color: var(--orange); }
.c-blue   { color: var(--blue); }
.c-muted  { color: var(--text-2); }

/* Nur für Screenreader — visuell versteckt, aber vorlesbar. */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ── Mobile ──────────────────────────────────────────────── */
@media (max-width: 780px) {
  .topbar { padding: 0 var(--sp-4); }
  main { padding: var(--sp-5) var(--sp-4) calc(var(--bottomnav-h) + var(--sp-6)); }
  .page-header { margin-bottom: var(--sp-5); }
}
