:root {
  color-scheme: light dark;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bg: #f5f8fb;
  --bg-elev: rgba(255, 255, 255, 0.84);
  --bg-soft: #ffffff;
  --text: #13203a;
  --muted: #4b5563;
  --border: #d8e1ef;
  --accent: #165dcc;
  --accent-strong: #0f4eb0;
  --focus: #f59e0b;
  --shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
  --line: 1.6;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220;
    --bg-elev: rgba(15, 23, 42, 0.78);
    --bg-soft: #111b2d;
    --text: #e5edf8;
    --muted: #b7c4d8;
    --border: #2a3952;
    --accent: #7fb3ff;
    --accent-strong: #9bc3ff;
    --focus: #fbbf24;
    --shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  }
}

* { box-sizing: border-box; }
html, body { max-width: 100%; overflow-x: hidden; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: var(--line);
}

.hero,
header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
}
@supports not ((backdrop-filter: blur(8px))) {
  .hero,
  header { background: var(--bg-soft); }
}

.hero p,
p,
.card p,
.archive-card,
.page {
  max-width: 70ch;
}

.cards,
.actions {
  gap: 14px;
}

.card,
.archive,
.archive-card,
.panel {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.button,
.download-btn,
.tab-btn,
button,
input[type="search"],
input[type="text"],
a.button {
  min-height: 44px;
  font: inherit;
}

.button,
.download-btn,
.tab-btn,
a {
  color: var(--accent);
}

.button.primary,
.download-btn,
.tab-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.button.primary:hover,
.download-btn:hover,
.tab-btn:hover {
  background: var(--accent-strong);
  color: #fff;
}

label {
  display: inline-block;
  font-weight: 600;
  margin: 10px 0 6px;
}
#bulletin-search {
  width: 100%;
  max-width: 28rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
  background: var(--bg-soft);
}
label[for="bulletin-search"] {
  display: block;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.pdf-viewer {
  height: auto;
  min-height: min(88vh, 950px);
}
.pdf-viewer iframe {
  min-height: min(88vh, 950px);
}

@media (max-width: 767px) {
  .cards { grid-template-columns: 1fr; }
  .tabs { flex-wrap: wrap; }
  .tab-btn,
  .download-btn,
  .button { width: 100%; }
  .pdf-viewer,
  .pdf-viewer iframe {
    min-height: 74vh;
    height: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
