:root {
  --bg:       #eef2f7;
  --card:     #ffffff;
  --accent:   #1a73e8;
  --text:     #1e2a3a;
  --muted:    #6b7c93;
  --border:   #dde3ec;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:       #1a1f2e;
    --card:     #25293a;
    --accent:   #4a9eff;
    --text:     #e8eef7;
    --muted:    #a0afc0;
    --border:   #3a3f4e;
  }
  .topbar-logo {
    filter: brightness(1.3) drop-shadow(0 0 2px rgba(74, 158, 255, 0.3));
  }
}

/* Manual Dark Mode Toggle (overrides prefers-color-scheme) */
html.dark-mode {
  --bg:       #1a1f2e;
  --card:     #25293a;
  --accent:   #4a9eff;
  --text:     #e8eef7;
  --muted:    #a0afc0;
  --border:   #3a3f4e;
}

html.dark-mode .topbar-logo {
  filter: brightness(1.3) drop-shadow(0 0 2px rgba(74, 158, 255, 0.3));
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 19px;
}

/* ── Topbar ── */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: .7rem 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 6px rgba(0,0,0,.07);
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
}
.topbar-logo {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}
.topbar-brand .title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: .01em;
  white-space: nowrap;
}
.topbar-brand .subtitle {
  font-size: .8rem;
  color: var(--muted);
  margin-top: 2px;
}

/* ── Cam ── */
.cam-wrap { background: #0a0e14; position: relative; }
.cam-wrap img {
  width: 100%;
  height: auto;
  display: block;
}

/* ── Carousel images ── */
.carousel-item img {
  width: 100%;
  height: auto;
  display: block;
}
.cam-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(10,14,20,.75));
  padding: 1.5rem .9rem .6rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}
.live-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .9rem;
  color: #fff;
  letter-spacing: .05em;
  font-weight: 600;
}
.live-dot {
  width: 9px; height: 9px;
  background: #34c759;
  border-radius: 50%;
  animation: blink 1.5s infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.2} }

/* ── Info strip ── */
.info-strip {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
}
.info-cell {
  flex: 1 1 22%;
  padding: .75rem .5rem;
  text-align: center;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.info-cell:nth-child(4n) { border-right: none; }
.info-cell:last-child { border-right: none; }

@media (min-width: 768px) {
  .info-strip { flex-wrap: nowrap; }
  .info-cell { flex: 1 1 auto; border-bottom: none; }
  .info-cell:nth-child(4n) { border-right: 1px solid var(--border); }
  .info-cell:last-child { border-right: none; }
}
.info-cell .val {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}
.info-cell .lbl {
  display: block;
  font-size: .75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-top: 3px;
  white-space: nowrap;
}

/* ── Section card ── */
.section-card {
  background: var(--card);
  margin: .6rem .6rem 0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
  border: 1px solid var(--border);
}
.section-header {
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  padding: .7rem 1rem .4rem;
  border-bottom: 1px solid var(--border);
}
.section-body {
  padding: .6rem 1rem .8rem;
  font-size: 1rem;
}

/* ── Carousel ── */
.carousel-caption {
  background: rgba(0,0,0,.5);
  border-radius: 4px;
  padding: .15rem .55rem;
  bottom: 10px; left: auto; right: 10px;
  width: auto;
}
.carousel-caption small { font-size: .82rem; }
.carousel-hint {
  text-align: center;
  font-size: .8rem;
  color: var(--muted);
  padding: .5rem;
  border-top: 1px solid var(--border);
}

/* ── Archiv Pfeil-Buttons ── */
.arc-arrow {
  background: none;
  border: none;
  outline: none;
  padding: 0 .2rem;
  color: var(--accent);
  font-size: 1.1rem;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  text-decoration: none;
  transition: background .15s;
  -webkit-tap-highlight-color: transparent;
}
.arc-arrow:hover { background: var(--bg); }
.arc-arrow-disabled { color: var(--border); cursor: default; }

/* ── Cam temperature chart ── */
.camtemp-wrap { padding: .6rem 1rem 1rem; }

details > summary { user-select: none; }
details[open] summary .bi-chevron-down { transform: rotate(180deg); }
details summary .bi-chevron-down { transition: transform .2s; }

/* ── Sun page ── */
#container-sun {
  margin: .6rem !important;
  height: 380px !important;
  border-radius: 10px;
  overflow: hidden;
}
.sun-table-wrap {
  margin: 0 .6rem .6rem;
  background: var(--card);
  border-radius: 10px;
  border: 1px solid var(--border);
  overflow: hidden;
}
.sun-table-wrap h3 {
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  padding: .7rem 1rem .4rem;
  border-bottom: 1px solid var(--border);
  margin: 0;
}
.sun-table-wrap .table { margin: 0; font-size: 1rem; }

/* ── Bottom nav ── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--card);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 200;
  box-shadow: 0 -2px 10px rgba(0,0,0,.07);
}
.bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: .65rem 0;
  color: var(--muted);
  text-decoration: none;
  font-size: .82rem;
  gap: 4px;
  letter-spacing: .02em;
  transition: color .15s;
}
.bottom-nav a i { font-size: 1.7rem; }
.bottom-nav a.active { color: var(--accent); font-weight: 600; }

/* ── Sprachumschalter ── */
.lang-switcher {
  display: flex;
  gap: .25rem;
  align-items: center;
}
.lang-switcher a {
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-decoration: none;
  color: var(--muted);
  border: 1.5px solid var(--border);
  border-radius: 5px;
  padding: .3rem .5rem;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .15s, border-color .15s, background .15s;
}
.lang-switcher a.active {
  color: var(--accent);
  border-color: var(--accent);
  background: #e8f0fd;
}
.lang-switcher a:hover:not(.active) {
  color: var(--text);
}

.theme-toggle {
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--muted);
  border: 1.5px solid var(--border);
  border-radius: 5px;
  padding: .3rem .5rem;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
  margin-left: .5rem;
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--text);
}

html.dark-mode .theme-toggle {
  color: var(--accent);
  border-color: var(--accent);
  background: #2d3a52;
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
  border-color: var(--text);
}

/* ── Modals ── */
.modal-body .btn { font-size: 1rem; padding: .6rem; }

.page-content { padding-bottom: 75px; }

/* ── Desktop ── */
@media (min-width: 768px) {
  .page-content {
    max-width: 960px;
    margin: 0 auto;
  }
  .topbar {
    padding-left: max(1rem, calc((100% - 960px) / 2 + 1rem));
    padding-right: max(1rem, calc((100% - 960px) / 2 + 1rem));
  }
  .cam-wrap img {
    max-height: 80vh;
    width: auto;
    margin: 0 auto;
  }
  .bottom-nav {
    max-width: 960px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }
}

/* ── Accessibility: Focus Styles ── */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* Keyboard navigation indicator */
*:focus-visible {
  box-shadow: inset 0 0 0 2px var(--accent);
}
