:root {
  --bg: #f7f9fc;
  --bg2: #ffffff;
  --fg: #0c1222;
  --fg-dim: #4f5b78;
  --accent: #0f62fe;
  --muted: #dfe6f3;
  --chip: #eef2fb;
  --shadow: 0 4px 14px rgba(15,34,67,0.1);
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: var(--bg); color: var(--fg);
}
.site-header {
  padding: 16px 20px; border-bottom: 1px solid var(--muted); background: var(--bg2); position: sticky; top: 0; z-index: 60;
}
.site-header h1 { margin: 0 0 6px 0; font-size: 18px; }
.site-header .meta { color: var(--fg-dim); font-size: 12px; }
.nav a { color: var(--accent); margin-right: 14px; text-decoration: none; font-size: 13px; }
.container { max-width: 1200px; margin: 0 auto; padding: 16px; }
.controls { display: grid; gap: 10px; grid-template-columns: 1fr; margin-bottom: 12px; }
.controls { position: sticky; top: 0; z-index: 50; background: var(--bg); padding-top: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--muted); }
.filters-bar { display: flex; align-items: center; justify-content: space-between; }
.filters-bar .btn { margin-left: auto; }
.filters-panel { margin-top: 10px; }
.filters-panel.collapsed { display: none; }
.controls label span { display: block; color: var(--fg-dim); font-size: 12px; margin-bottom: 4px; }
.controls input[type="search"] { width: 100%; padding: 10px 12px; border-radius: 6px; border: 1px solid var(--muted); background: var(--bg2); color: var(--fg); }
.selects { display: flex; flex-wrap: wrap; gap: 16px; }
.ms { position: relative; display: inline-block; }
.ms-toggle { min-width: 140px; }
.ms-menu { position: absolute; top: 40px; left: 0; min-width: 240px; background: var(--bg2); border: 1px solid var(--muted); border-radius: 10px; box-shadow: var(--shadow); padding: 8px; display: none; z-index: 100; }
.ms.open .ms-menu { display: block; }
.ms-item { display: flex; align-items: center; gap: 8px; padding: 6px 4px; font-size: 13px; }
.ms-item input { width: 16px; height: 16px; }
.ms-actions { display: flex; gap: 8px; padding: 6px 4px 0; border-top: 1px dashed var(--muted); margin-top: 6px; }
.range-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.range-slider { width: 360px; position: relative; height: 36px; }
.range-slider input[type="range"] { position: absolute; left: 0; right: 0; pointer-events: none; -webkit-appearance: none; appearance: none; background: none; height: 36px; margin: 0; }
.range-slider input[type="range"]::-webkit-slider-thumb { pointer-events: auto; -webkit-appearance: none; appearance: none; height: 16px; width: 16px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(17,85,204,0.3); }
.range-slider input[type="range"]::-moz-range-thumb { pointer-events: auto; height: 16px; width: 16px; border: none; border-radius: 50%; background: var(--accent); }
.range-slider .track { position: absolute; top: 50%; left: 0; right: 0; height: 6px; transform: translateY(-50%); background: #e6ecfa; border-radius: 999px; }
.range-slider .range { position: absolute; top: 50%; height: 6px; transform: translateY(-50%); background: #a9c2fb; border-radius: 999px; }
.year-readout { color: var(--fg-dim); font-size: 12px; }
.hint { color: var(--fg-dim); font-size: 12px; margin-top: -6px; margin-bottom: 8px; }
.content { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.list-pane { background: var(--bg2); border: 1px solid var(--muted); border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); }
.summary-bar { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; border-bottom: 1px dashed var(--muted); gap: 10px; }
.summary-bar .pills { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.summary-pill { font-size: 12px; padding: 4px 8px; border-radius: 999px; border: 1px solid var(--muted); background: var(--chip); }
.summary-pill.fr { background: #e7eefc; border-color: #c6d8ff; color: #1a3f93; }
.summary-pill.uk { background: #fde8e8; border-color: #f8c9c9; color: #8a1f1f; }
.summary-pill.de { background: #e6f6ec; border-color: #c3ebd1; color: #155e2f; }
.active-filters { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; background: #f2f6ff; border: 1px solid var(--muted); border-radius: 999px; font-size: 12px; color: #2c3d67; }
.chip button { background: transparent; border: none; cursor: pointer; font-size: 14px; line-height: 1; color: #4f5b78; }
.list-meta { padding: 8px 10px; border-bottom: 1px solid var(--muted); display: flex; align-items: center; justify-content: space-between; color: var(--fg-dim); font-size: 12px; gap: 10px; }
.list-meta .actions { display: flex; gap: 8px; }
.btn { background: var(--chip); color: var(--fg); border: 1px solid var(--muted); padding: 6px 10px; border-radius: 6px; cursor: pointer; font-size: 12px; transition: all .15s ease; }
.btn:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.secondary { background: #f7fbff; border-color: #cfe2ff; color: #0b3d91; }
table.results { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
table.results thead { position: sticky; top: 110px; z-index: 10; background: #eef4ff; color: #2c3d67; box-shadow: 0 2px 0 rgba(0,0,0,0.02); }
table.results th, table.results td { padding: 10px 12px; border-bottom: 1px solid var(--muted); vertical-align: top; }
table.results th.sortable { cursor: pointer; user-select: none; }
table.results tbody tr { cursor: pointer; }
table.results tbody tr:nth-child(even) { background: #fbfdff; }
table.results tbody tr:hover { background: #f2f8ff; }
.td-ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { display: inline-block; padding: 2px 6px; font-size: 11px; border-radius: 999px; border: 1px solid var(--muted); background: var(--chip); }
.badge.corpus-fr { background: #e7eefc; border-color: #c6d8ff; color: #1a3f93; }
.badge.corpus-uk { background: #fde8e8; border-color: #f8c9c9; color: #8a1f1f; }
.badge.corpus-de { background: #e6f6ec; border-color: #c3ebd1; color: #155e2f; }
.badge.type { background: #fff7e5; border-color: #ffe2a8; color: #7a4a00; }
.empty { color: var(--fg-dim); padding: 12px; }
.detail-pane { background: var(--bg2); border: 1px solid var(--muted); border-radius: 10px; padding: 12px; min-height: 240px; box-shadow: var(--shadow); }
.detail-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.detail-title { font-weight: 600; font-size: 16px; color: #0c1222; }
.detail-actions { display: flex; gap: 8px; }
.btn-small { background: var(--chip); color: var(--fg); border: 1px solid var(--muted); padding: 4px 8px; border-radius: 6px; cursor: pointer; font-size: 12px; }
.placeholder { color: var(--fg-dim); padding: 10px; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; font-size: 13px; margin-bottom: 10px; }
.labels { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.label { font-size: 11px; padding: 2px 6px; border: 1px solid var(--muted); border-radius: 10px; background: var(--chip); }
.doc-text { white-space: pre-wrap; line-height: 1.5; border: 1px solid var(--muted); background: #f9fbff; padding: 10px; border-radius: 6px; max-height: 420px; overflow: auto; }
.site-footer { color: var(--fg-dim); font-size: 12px; border-top: 1px solid var(--muted); background: var(--bg2); padding: 12px 20px; margin-top: 16px; }
@media (max-width: 900px) { .content { grid-template-columns: 1fr; } }

/* Export dropdown */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu { position: absolute; right: 0; top: 36px; min-width: 160px; background: var(--bg2); border: 1px solid var(--muted); border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,0.08); display: none; z-index: 100; }
.dropdown-menu.open { display: block; }
.dropdown-menu button { display: block; width: 100%; text-align: left; background: transparent; border: none; padding: 8px 12px; cursor: pointer; }
.dropdown-menu button:hover { background: #f7fbff; }

/* Focus outline */
.btn:focus, input:focus, select:focus, button:focus { outline: 2px solid #8fb6ff; outline-offset: 2px; }

/* (visualization removed per request) */
