* { box-sizing: border-box; margin: 0; }

/* The `hidden` attribute must win even over class rules that set `display`
 * (e.g. `.gate { display: flex }`). Without this, setting `.hidden = true`
 * on a flex/grid element does nothing and it stays on screen. */
[hidden] { display: none !important; }

:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #1c2733;
  --muted: #67737f;
  --border: #dde3e9;
  --accent: #1d4ed8;
}

body {
  font: 15px/1.5 -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

.muted { color: var(--muted); font-size: 0.85rem; }
.err { color: #b91c1c; font-size: 0.85rem; }

/* Document room */
#room { max-width: 760px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.room-sub { margin: -0.6rem 0 1.2rem; }

.demo-banner {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  padding: 0.5rem 0.8rem;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  text-align: center;
}
@media (prefers-color-scheme: dark) {
  .demo-banner { background: #3a2e12; color: #fcd34d; border-color: #6b5320; }
}
header { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: center; margin-bottom: 1.2rem; }
header h1 { font-size: 1.25rem; flex: 1 1 auto; }
#search {
  flex: 1 1 260px;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
}

section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.2rem;
  margin-bottom: 1rem;
}
section h2 {
  font-size: 1.05rem;
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}
.count { color: var(--muted); font-size: 0.8rem; font-weight: normal; }

.group-label {
  font-size: 0.82rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 1rem 0 0.3rem;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}
.group-label:first-of-type { margin-top: 0.4rem; }
.group-label .count { text-transform: none; letter-spacing: 0; }

/* Placeholder year (in scope, no documents yet) */
.empty-year { opacity: 0.65; border-style: dashed; }
.empty-note { margin-top: 0.4rem; }

section ul { list-style: none; }
section li { padding: 0.55rem 0; border-top: 1px solid var(--border); }
section li:first-child { border-top: none; }
section a { color: var(--accent); text-decoration: none; font-weight: 500; }
section a:hover { text-decoration: underline; }

.doc-meta {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 0.15rem;
}
.badge {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 0.5rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

footer { margin-top: 1.5rem; }
