:root {
  color-scheme: light dark;
  --bg: #fdfdfc;
  --fg: #1d1d1f;
  --muted: #6b6b70;
  --accent: #0b5cad;
  --border: #e2e2e5;
  --chip: #f0f0f3;
  --panel-width: 28rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161618;
    --fg: #ececf0;
    --muted: #a0a0a8;
    --accent: #6fb1ff;
    --border: #2e2e33;
    --chip: #26262b;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
main, .site-header { max-width: 42rem; margin: 0 auto; padding: 0 16px; }
.site-header { padding-top: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.site-title { font-weight: 700; color: var(--fg); text-decoration: none; }
a { color: var(--accent); }
h1 { font-size: 1.7rem; line-height: 1.2; margin: 1.2rem 0 0.4rem; }
h2 { font-size: 1.15rem; margin-top: 2rem; }
h3 { font-size: 1rem; margin: 1rem 0 0.3rem; }
.lead, .aliases, .dates, .back, .no-fiche { color: var(--muted); }
.dates { font-size: 0.85rem; margin-top: 2rem; }
.acronym { font-size: 0.8em; font-weight: 600; color: var(--muted); text-decoration: none; }
.fiche-list { list-style: none; padding: 0; }
.fiche-list li { padding: 10px 0; border-bottom: 1px solid var(--border); }
.fiche-list a { font-weight: 600; text-decoration: none; }
.tags { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { background: var(--chip); border-radius: 999px; padding: 2px 10px; font-size: 0.85rem; }
.op { display: inline-block; min-width: 1.6em; text-align: center; font-family: ui-monospace, monospace; }
.relation-group ul { margin: 0; padding-left: 2rem; }
.body { overflow-wrap: anywhere; }
.body pre { overflow-x: auto; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
[hidden] { display: none !important; }
.search { margin: 1rem 0 0.5rem; }
.search input {
  width: 100%; font: inherit; color: var(--fg); background: var(--bg);
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
}
.search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.tag-filter { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag-filter button {
  font: inherit; font-size: 0.85rem; color: var(--fg); background: var(--chip);
  border: 1px solid transparent; border-radius: 999px; padding: 4px 12px; min-height: 32px; cursor: pointer;
}
.tag-filter button[aria-pressed="true"] { background: var(--accent); color: var(--bg); }
.tag-filter button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.empty { color: var(--muted); }
.fiche-panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: var(--panel-width); z-index: 20;
  background: var(--bg); border-left: 1px solid var(--border);
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.12);
  overflow-y: auto; padding: 0 20px 24px;
}
.panel-handle {
  position: absolute; top: 0; bottom: 0; left: -3px; width: 6px;
  cursor: col-resize; touch-action: none; border-radius: 3px;
}
.panel-handle:hover, .panel-handle:focus-visible { background: var(--accent); opacity: 0.4; outline: none; }
.panel-bar {
  position: sticky; top: 0; background: var(--bg); display: flex;
  justify-content: space-between; align-items: center; gap: 12px;
  padding: 14px 0; margin-bottom: 4px; border-bottom: 1px solid var(--border);
}
.panel-close {
  font: inherit; font-size: 1.1rem; line-height: 1; color: var(--fg); background: var(--chip);
  border: none; border-radius: 999px; width: 32px; height: 32px; cursor: pointer;
}
.panel-close:focus-visible, .panel-expand:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.panel-content:focus { outline: none; }
/* Pushes the list aside instead of the panel overlaying it (SPEC-006 AC1, AC2):
   body's own content box narrows by the panel's width, so the centered main
   column reflows into whatever room is left, with no separate layout needed. */
body.panel-open { padding-right: var(--panel-width); }
@media (max-width: 640px) {
  .fiche-panel { width: 100%; border-left: none; box-shadow: none; }
  .panel-handle { display: none; }
  body.panel-open { padding-right: 0; overflow: hidden; }
}
