/* Dilexit — Characters of the Bible
   Shared stylesheet: 3D tree, list, profiles.
   Designed to stay light and readable on old browsers:
   fonts already installed on the device (no download), no blur effect,
   no permanent animation, colors in classic rgba(). */

/* ---------- The two modes ----------
   Day mode is the default (:root), night mode is `html.dark` — the very class
   dilexit.com puts on <html> (next-themes, components/layout/ThemeProvider),
   so the tree follows the mode chosen on the site with no reload: the site
   only has to copy that class onto this document (js/theme-init.js).

   Every colour of the day mode is one of the site's own
   (web/app/globals.css), named in the comment beside it; no new colour is
   invented. The night mode keeps, to the byte, the colours validated on
   2026-11-17. Values read by the scripts (the lines, the dots, the names
   painted on the canvas) are variables too, so one theme change moves
   everything at once (js/tree.js, applyTheme). */
:root {
  --bg: hsl(44 95% 96%);                       /* site --main-bg (day) */
  --bg-fade: hsla(44, 95%, 96%, 0);            /* the same, see-through: for a fading edge */
  --page-glow:
    radial-gradient(1200px 800px at 50% 30%, rgba(217, 201, 184, 0.45), rgba(217, 201, 184, 0) 60%),
    radial-gradient(900px 600px at 10% 90%, rgba(46, 74, 115, 0.07), rgba(46, 74, 115, 0) 60%);
  --panel: rgba(255, 255, 255, 0.85);          /* site --rail-surface #ffffff */
  --panel-solid: #ffffff;                      /* site --rail-surface */
  --panel-solid-translucent: rgba(255, 255, 255, 0.94);
  --panel-solid-fade: rgba(255, 255, 255, 0);
  --panel-light: #f8f0de;                      /* site --menu-bg-alt */
  --border: rgba(0, 0, 0, 0.1);
  --border-strong: rgba(0, 0, 0, 0.18);
  --border-hover: rgba(0, 0, 0, 0.32);
  --text: hsl(0 0% 3.9%);                      /* site --foreground (day) */
  --text-soft: #374151;                        /* site rail labels, text-gray-700 */
  --text-faint: #7f7f7f;                       /* site --gray-2 (day) */
  --text-faintest: #9a9a9a;
  --accent: hsl(214 45% 33%);                  /* site --poem-title (day) */
  --accent-hover: hsl(214 45% 26%);
  --accent-underline: rgba(46, 74, 115, 0.35);
  --shadow: rgba(0, 0, 0, 0.18);
  --shadow-strong: rgba(0, 0, 0, 0.25);
  --backdrop: rgba(0, 0, 0, 0.28);             /* behind the phone drawer */
  --scroll-thumb: #d9c9b8;                     /* site --beige-dark (day) */
  --scroll-thumb-2: #d9c9b8;
  --chip-neutral: #4b5563;                     /* text-gray-600, as the site's grey chips */
  --chip-neutral-rgb: 75, 85, 99;
  --on-chip: #ffffff;                          /* what is written on a ticked grey chip */
  --badge-warning-text: #8a5a00;
  --focus-stroke: hsl(0 0% 3.9%);
  /* Read by the scripts */
  --line: #7f7f7f;                             /* the tree's lines, site --gray-2 */
  --line-rgb: 127, 127, 127;
  --line-highlight: #2e4a73;                   /* site --poem-title, as a colour */
  --on-line-highlight: #ffffff;
  /* Thin edge around every dot. Its job is to set the dot apart from what is
     behind it — the lines, and the background. By day the background is pale,
     so the edge is dark: without it Jesus's dot, a pale gold, would almost
     vanish into the cream (a contrast of 1.3 to 1). By night it is dark, for
     the same reason the other way round. */
  --dot-edge: rgba(10, 10, 10, 0.45);
  --dot-ring: hsl(0 0% 3.9%);                  /* ring of the dot pointed at or chosen */
  --name-halo: #ffffff;                        /* halo carrying a name over the background */
  --name-jesus: #b8632c;                       /* site --pericope-title (day) */
  --venn-off-1: #d48da2;                       /* the circles' colours, half mixed with the panel */
  --venn-off-2: #a290bd;
  --venn-off-both: #c08ec2;
  --search-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23374151' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
  --radius: 14px;
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
}

html.dark {
  --bg: #070915;
  --bg-fade: rgba(7, 9, 21, 0);
  --page-glow:
    radial-gradient(1200px 800px at 50% 30%, rgba(92, 52, 170, 0.24), rgba(92, 52, 170, 0) 60%),
    radial-gradient(900px 600px at 10% 90%, rgba(42, 168, 242, 0.08), rgba(42, 168, 242, 0) 60%);
  --panel: rgba(17, 19, 36, 0.85);
  --panel-solid: #141729;
  --panel-solid-translucent: rgba(20, 23, 41, 0.92);
  --panel-solid-fade: rgba(20, 23, 41, 0);
  --panel-light: #1c2036;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --border-hover: rgba(255, 255, 255, 0.3);
  --text: #eceef8;
  --text-soft: #a3a7c2;
  --text-faint: #7a7e9c;
  --text-faintest: #868aa8;
  --accent: #2aa8f2;
  --accent-hover: #4bb7f5;
  --accent-underline: rgba(42, 168, 242, 0.35);
  --shadow: rgba(0, 0, 0, 0.45);
  --shadow-strong: rgba(0, 0, 0, 0.55);
  --backdrop: rgba(0, 0, 0, 0.4);
  --scroll-thumb: #14286d;
  --scroll-thumb-2: #353b63;
  --chip-neutral: #a3a7c2;
  --chip-neutral-rgb: 163, 167, 194;
  --on-chip: #0b0d1a;
  --badge-warning-text: #f8d58f;
  --focus-stroke: #ffffff;
  --line: #a3a7c2;
  --line-rgb: 163, 167, 194;
  --line-highlight: #e6e8f3;
  --on-line-highlight: #0b0d1a;
  --dot-edge: rgba(7, 9, 21, 0.6);
  --dot-ring: #ffffff;
  --name-halo: #000000;
  --name-jesus: #fff6dc;
  --venn-off-1: #5e1734;
  --venn-off-2: #2b1a50;
  --venn-off-both: #491854;
  --search-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23a3a7c2' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  color: var(--text);
  background-color: var(--bg);
  background-image: var(--page-glow);
  background-repeat: no-repeat;
  min-height: 100vh;
  line-height: 1.5;
}

a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2 { font-family: var(--font); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* Elements that only make sense with JavaScript (filters, search) */
html:not(.js) .js-only { display: none !important; }
html.js .no-js { display: none; }

/* ---------- Top bar ---------- */

.top-bar {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  position: relative;
  z-index: 20;
}
.top-bar > * + * { margin-left: 16px; }

.page-tree .top-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  pointer-events: none;
}
.page-tree .top-bar > * { pointer-events: auto; }

.tabs {
  margin-right: auto;
  display: inline-flex;
  padding: 3px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 9px;
}
.tabs a {
  text-decoration: none;
  font-size: 14px;
  padding: 6px 16px;
  border-radius: 6px;
  color: var(--text-soft);
  white-space: nowrap;
}
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] {
  background: var(--panel-light);
  color: var(--text);
}

.button {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: var(--panel-light);
  cursor: pointer;
  text-decoration: none;
  font-size: 14px;
  text-align: center;
}
.button:hover { border-color: var(--border-hover); }
.button-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
.button-primary:hover { background: var(--accent-hover); }

/* ---------- Filters (shared by tree / list) ---------- */

.filter-group { margin-bottom: 18px; }

.filter-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin: 0 0 8px;
}

.chips { display: flex; flex-wrap: wrap; margin: -2px; }

/* Filter button: discreet background when unchecked,
   fully filled with its color when checked */
.chip {
  --c: var(--chip-neutral);
  display: inline-block;
  margin: 2px;
  padding: 3px 8px;
  border: 0;
  border-radius: 4px;
  background: var(--panel-light);
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
}
.chip:hover { color: var(--text); }
.chip[aria-pressed="true"] {
  background: var(--c);
  color: var(--on-chip);
}
.chip.tinted[aria-pressed="true"] { color: #fff; } /* zone colors are dark enough for white text */
.chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }


/* ---------- Tree page ---------- */

.page-tree { overflow: hidden; height: 100vh; }

#scene { position: fixed; top: 0; right: 0; bottom: 0; left: 0; }
#scene canvas { display: block; }

#labels {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 5;
}

/* The dots and the names of the characters, painted on one canvas (see js/tree.js) */
#labels canvas { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }

/* Loading / browser-too-old messages */
.status {
  position: fixed;
  left: 50%; top: 50%;
  width: 320px;
  max-width: calc(100% - 32px);
  margin: 0;
  -webkit-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
  padding: 20px;
  text-align: center;
  font-size: 15px;
  color: var(--text-soft);
  background: var(--panel-solid);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  z-index: 40;
}
.status a { color: var(--accent); font-weight: 600; }
.status-no-3d { display: none; }
.no-3d .status-no-3d { display: block; }
.no-3d .status-loading,
.no-3d .panel,
.no-3d .button-filters,
.no-3d .bottom-area,
.no-3d .help { display: none; }
html:not(.with-3d) .status-loading { display: none; }
.ready .status-loading { display: none; }

/* Filters panel (on the right) */
.panel {
  position: fixed;
  top: 76px;
  right: 16px;
  width: 290px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 92px);
  overflow-y: auto;
  scrollbar-color: var(--scroll-thumb) transparent;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  z-index: 17;
  transition: height 0.25s ease;
}
.panel:focus { outline: none; }
/* The block's top bar serves as a handle to move it */
.panel-header {
  display: flex;
  align-items: center;
  margin: -18px -18px 14px;
  padding: 14px 18px 10px;
  cursor: move;
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}
.panel.dragging { box-shadow: 0 12px 40px var(--shadow-strong); }
.panel.dragging .panel-header { cursor: grabbing; }
.panel-header h2 {
  display: flex;
  align-items: center;
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.grip {
  width: 8px;
  height: 14px;
  margin-right: 10px;
  background-image: radial-gradient(circle, var(--text-faint) 1.2px, rgba(0, 0, 0, 0) 1.6px);
  background-size: 4px 4px;
  opacity: 0.9;
}
.panel-header:hover .grip { background-image: radial-gradient(circle, var(--text) 1.2px, rgba(0, 0, 0, 0) 1.6px); }
/* Folds the block towards its top bar, like a window blind */
.fold-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin: -4px -6px -4px auto;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--text-soft);
  cursor: pointer;
}
.fold-panel:focus-visible { outline: 2px solid var(--accent); }
.fold-panel svg { transition: transform 0.25s ease; }
.panel.folded .fold-panel svg { transform: rotate(180deg); }
/* Computer layout: the exact opposite of the phone layout (at the end of this file) */
@media (min-width: 761px) and (min-height: 501px), (min-width: 761px) and (pointer: fine), (min-width: 761px) and (pointer: none) {
  .panel.folded { height: 50px; }
  /* While it slides, the block is smaller than its content: no scrollbar for that instant */
  .panel.folded, .panel.sliding { overflow: hidden; }
  .panel.folded .panel-header { padding-bottom: 14px; }
  /* Hidden once folded, so that the keyboard does not reach what can no longer be seen */
  .panel.folded > :not(.panel-header) { visibility: hidden; transition: visibility 0s 0.25s; }
}
.check-all { margin: 0 0 0 12px; width: 15px; height: 15px; cursor: pointer; accent-color: #d9542f; }
/* The filter chips wrap inside the width set by the rest of the panel */
.panel #filters { width: 0; min-width: 100%; }
.separator { height: 1px; background: var(--border); margin: 18px 0; }

.switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  color: var(--text-soft);
  padding: 5px 0;
  cursor: pointer;
}
.switch input {
  -webkit-appearance: none;
  appearance: none;
  width: 28px; height: 16px;
  margin: 0 0 0 14px;
  border-radius: 999px;
  background: var(--panel-light);
  border: 1px solid var(--border-strong);
  position: relative;
  cursor: pointer;
  flex: none;
}
.switch input::after {
  content: "";
  position: absolute;
  top: 1px; left: 1px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--text-soft);
}
.switch input:checked { background: #2545b3; border-color: #2545b3; }
.switch input:checked::after { left: 13px; background: #fff; }
.switch input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.button-wide { display: block; width: 100%; margin-top: 12px; }

/* The family of the selected character (under the buttons « Liens », while « Famille » is ticked), and the genealogy */
.family-notes { margin: -10px 0 18px; }
.family-note { margin: 8px 0 0; font-size: 12px; color: var(--text-soft); }
.family-known { color: var(--text); } /* the generations known of the selected character */
#genealogy[aria-pressed="true"] { background: var(--line-highlight); border-color: var(--line-highlight); color: var(--on-line-highlight); font-weight: 600; } /* the colour of its lines */
#genealogy[hidden] { display: none; }
.family-show { margin: 4px 0 0; color: var(--text); } /* « Les afficher »: the relatives hidden by the filters */

.counter {
  margin: 16px 0 0;
  font-size: 13px;
  color: var(--text-soft);
}

/* Phones only: the settings button, and the bottom strip and backdrop of the drawer */
.button-filters, .button-filters-label, .panel-footer, .panel-backdrop { display: none; }

/* Help (bottom left) */
.help {
  position: fixed;
  left: 20px;
  bottom: 20px;
  margin: 0;
  z-index: 10;
  font-size: 12px;
  color: var(--text-faint);
  line-height: 1.6;
  pointer-events: none;
}

/* Sound button: on the left of the search, as tall as it */
.search-row { display: flex; }
.search-row .search { flex: 1; min-width: 0; }
.button-sound {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  margin-right: 8px;
  padding: 0;
  border-radius: 12px;
  background: var(--panel);
  color: var(--text-soft);
}
.button-sound:hover { color: var(--text); }
.button-sound:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.button-sound[hidden],
.button-sound[aria-pressed="true"] .sound-off,
.button-sound[aria-pressed="false"] .sound-on { display: none; }

/* Search + selection card (bottom center) */
.bottom-area {
  position: fixed;
  left: 50%;
  bottom: 18px;
  width: 560px;
  max-width: calc(100% - 32px);
  -webkit-transform: translateX(-50%);
  transform: translateX(-50%);
  z-index: 16;
}
.search {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
}
.search input {
  display: block;
  width: 100%;
  height: 46px;
  padding: 0 14px 0 40px;
  background: transparent var(--search-icon) no-repeat 14px 50%;
  border: 0;
  outline: none;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  -webkit-appearance: none;
  appearance: none;
}
.search input::placeholder { color: var(--text-faint); }
.search:focus-within { border-color: var(--accent); }

.suggestions {
  position: absolute;
  left: 0; right: 0;
  bottom: 100%;
  margin: 0 0 6px; padding: 6px;
  list-style: none;
  background: var(--panel-solid);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  max-height: 300px;
  overflow-y: auto;
}
.suggestions[hidden] { display: none; }
.suggestions li {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}
.suggestions li small { color: var(--text-soft); margin-left: auto; padding-left: 10px; font-size: 12px; }
.suggestions li[aria-selected="true"], .suggestions li:hover { background: var(--panel-light); }

.selection-card {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  padding: 14px 16px;
  background: var(--panel-solid);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
}
.selection-card[hidden] { display: none; }
.selection-card > * + * { margin-left: 14px; }
.selection-card .info { flex: 1; min-width: 0; }
.selection-card .info strong { display: block; font-size: 16px; }
.selection-card .info span { display: block; font-size: 13px; color: var(--text-soft); }
.selection-card .close {
  background: none; border: 0; color: var(--text-soft); cursor: pointer;
  font-size: 22px; line-height: 1; padding: 4px;
}

/* Card of a character in the tree (hover, then click): plain, very slightly see-through,
   no border, a light shadow all around */
.tooltip {
  position: fixed;
  z-index: 30;
  pointer-events: none;
  width: 260px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--panel-solid-translucent);
  box-shadow: 0 0 16px var(--shadow);
}
.tooltip[hidden] { display: none; }
.tooltip .head { padding: 10px 14px; }
/* The lines of a long name close together (as on the list cards), a little space before the role */
.tooltip .head strong { display: block; font-size: 15px; line-height: 1.25; }
/* Small text in its own block: its lines are spaced for its own size, not for the page's */
.tooltip .head span { display: block; margin-top: 6px; font-size: 12px; color: var(--text-soft); }
.tooltip .body { padding: 10px 14px 12px; font-size: 12px; color: var(--text-soft); }
.tooltip .body .badges { margin-bottom: 6px; }
/* The padding widens the area that reacts to a finger; the negative margins keep the card's layout */
.tooltip .click-hint { color: var(--accent); font-size: 18px; font-weight: 700; line-height: 1.25; margin: -4px 0 -10px; padding: 10px 0; display: flex; align-items: center; text-decoration: none; }
.tooltip .click-hint .arrow { flex: none; margin-right: 10px; font-size: 34px; line-height: 1; }
/* After a click on a character, his card stays open and its link can be clicked.
   It passes under the tabs, the filters and the search (z-index 16 to 20), so as not to block them. */
.tooltip.pinned { pointer-events: auto; z-index: 12; }
.tooltip.pinned .click-hint:hover { text-decoration: underline; }
/* Its top (name and role) is a handle to move it, with the mouse or a finger */
.tooltip.pinned .head { cursor: grab; touch-action: none; user-select: none; }
.tooltip.moving .head { cursor: grabbing; }

/* Badges */
.badges { display: flex; flex-wrap: wrap; margin: -2px; }
.badge {
  --c-rgb: var(--chip-neutral-rgb);
  display: inline-block;
  margin: 2px;
  font-size: 11px;
  line-height: 1.4;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(var(--c-rgb), 0.15);
  color: var(--text);
  border: 1px solid rgba(var(--c-rgb), 0.45);
  white-space: nowrap;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
.badge-warning { --c-rgb: 245, 185, 66; color: var(--badge-warning-text); }
/* Zone, testament and sex badges (cards, profiles, tree tooltip) take the colors
   of the filter buttons */
.badges .badge { background: var(--c); color: #fff; border: 0; padding: 4px 9px; }
.badges .badge-sex { --c: #d9542f; }
.badges .badge-testament { --c: #b93529; }
.badges .badge-zone { --c: #9e0112; }

/* ---------- List page ---------- */

.content {
  max-width: 1180px;
  margin: 0 auto;
  padding: 8px 20px 60px;
}

.page-list .content { max-width: 1330px; }
.list-header { margin: 18px 0 22px; }
.list-header h1 {
  font-size: 36px;
  font-weight: 700;
  margin: 0;
  line-height: 1.15;
}

/* Filters, counter and search share one line, aligned on the chips */
.list-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 20px;
}
.list-filters { display: flex; flex-wrap: wrap; }
.list-filters .filter-group { margin: 0 24px 18px 0; }
.list-tools .counter { margin: 0 24px 21px 0; }
.list-tools .search { flex: 0 1 240px; margin: 0 0 10px auto; background: var(--panel-solid); }
.list-tools .search input { height: 40px; font-size: 14px; }

.group-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin: 52px 0 40px;
}

.grid {
  display: flex;
  flex-wrap: wrap;
  margin: -25px;
}
@supports (display: grid) {
  .grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    grid-gap: 50px;
    margin: 0;
  }
}

.card {
  --c: var(--chip-neutral);
  display: block;
  width: 260px;
  margin: 25px;
  padding: 16px;
  background: var(--panel-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
}
@supports (display: grid) {
  .card { width: auto; margin: 0; }
}
.card:hover { border-color: var(--border-strong); background: var(--panel-light); }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.card > span { display: block; }
.card .card-head { display: flex; align-items: center; margin-bottom: 4px; }
.card .card-head strong { font-size: 21px; line-height: 1.25; }
.card .role { font-size: 13px; color: var(--text-soft); margin-bottom: 10px; }
.card .badges { margin-bottom: 8px; }
.card .excerpt {
  font-size: 13px;
  color: var(--text-soft);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-height: 4.5em;
}

.empty {
  padding: 40px;
  text-align: center;
  color: var(--text-soft);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}
.empty[hidden] { display: none; }

/* ---------- Table page ---------- */

.page-table .content { max-width: 1330px; }
/* The filter buttons, group by group: on a computer or a tablet the groups go to the next line when space runs
   out, as on the list page (one line would need some 1 700 pixels); on a phone, one line that scrolls sideways
   within its frame (see « Small screens ») */
.filter-row { position: relative; }
.filter-line { display: flex; flex-wrap: wrap; }
/* Discreet scrollbars, in the colors of the page */
.filter-line, .table-frame { scrollbar-width: thin; scrollbar-color: var(--scroll-thumb-2) transparent; }
.filter-line::-webkit-scrollbar, .table-frame::-webkit-scrollbar { height: 8px; }
.filter-line::-webkit-scrollbar-thumb, .table-frame::-webkit-scrollbar-thumb { background: var(--scroll-thumb-2); border-radius: 4px; }
.filter-line::-webkit-scrollbar-track, .table-frame::-webkit-scrollbar-track { background: transparent; }
.filter-line .filter-group { flex: none; margin: 0 22px 14px 0; }
.filter-line .chips { flex-wrap: nowrap; }
.filter-line .chip { white-space: nowrap; }
/* A fading edge marks the side where more buttons are hidden */
.filter-row::before, .filter-row::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 10px;
  width: 32px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}
.filter-row::before { left: 0; background: linear-gradient(to right, var(--bg), var(--bg-fade)); }
.filter-row::after { right: 0; background: linear-gradient(to left, var(--bg), var(--bg-fade)); }
.filter-row.more-left::before, .filter-row.more-right::after { opacity: 1; }
.table-tools .counter { margin: 4px 0 16px; }
/* Counter and search share one line; on a phone the search takes the next one, full width */
.table-search-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0 12px; margin-bottom: 16px; }
.table-search-row .counter { margin: 0 auto 0 0; }
/* The title « Nom » turns the order over: two small arrows, the one of the order shown brighter */
.sort-button {
  display: inline-flex; align-items: center; gap: 6px; margin: -4px -6px; padding: 4px 6px;
  background: none; border: 0; border-radius: 6px; cursor: pointer; font: inherit; letter-spacing: inherit;
  text-transform: inherit; color: inherit;
}
.sort-button:hover, .sort-button:focus-visible { color: var(--text); }
.sort-button:focus-visible { outline: 2px solid var(--accent); }
.sort-arrows path { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: 0.45; }
[aria-sort="ascending"] .sort-arrows .up, [aria-sort="descending"] .sort-arrows .down { opacity: 1; }
.table-search-row .search { flex: 0 1 260px; background: var(--panel-solid); }
.table-search-row .search input { height: 40px; font-size: 14px; }
@media (max-width: 760px) {
  .table-search-row { gap: 10px 12px; margin-top: 10px; }
  .table-search-row .search { flex-basis: 100%; }
}

/* The table scrolls sideways within its frame; the name stays in sight */
.table-frame {
  overflow-x: auto;
  background: var(--panel-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.table-frame:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.characters-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.characters-table th, .characters-table td {
  padding: 9px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
  background: var(--panel-solid);
}
.characters-table thead th {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-soft);
}
.characters-table tbody tr:last-child > * { border-bottom: 0; }
.characters-table tbody tr:hover > * { background: var(--panel-light); }
/* Long names and long texts take two lines when the screen is narrow: the whole table fits on a computer or a tablet */
.characters-table tbody th { font-weight: 600; min-width: 140px; max-width: 260px; }
.characters-table td.links { min-width: 130px; }
.characters-table tbody th a { text-decoration: none; border-bottom: 1px solid var(--border-strong); }
.characters-table tbody th a:hover { border-color: var(--text); }
.characters-table td { color: var(--text-soft); }
.characters-table td.none { color: var(--text-faintest); } /* fainter than the other cells, still readable on a hovered row */
.characters-table tr > :first-child { position: -webkit-sticky; position: sticky; left: 0; z-index: 1; }
.characters-table tr[hidden] { display: none; }
/* On a large screen the whole table fits: its frame no longer scrolls sideways, so the column titles stay at the
   top of the screen while the rows go by (clip keeps the round corners without making a scrolling frame) */
@media (min-width: 900px) {
  .table-frame { overflow: visible; overflow: clip; }
  /* :first-child also named, so that « Nom » stays above the names sliding under it */
  .characters-table thead th, .characters-table thead th:first-child { position: -webkit-sticky; position: sticky; top: 0; z-index: 2; }
}

/* ---------- Profile page ---------- */

.profile-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.profile-title { flex: 1 1 300px; min-width: 0; }
.profile-header h1 {
  font-size: 44px;
  font-weight: 700;
  line-height: 1.1;
  margin: 0 0 6px;
  overflow-wrap: break-word; /* a word longer than the screen (« d'Alexandroscène » on 320 pixels) breaks instead of widening the page */
}
.profile-header .role { font-size: 17px; color: var(--text-soft); margin: 0 0 12px; }.muted { color: var(--text-faint); }
.profile-actions { display: flex; flex-direction: column; margin-left: 24px; }
.profile-actions .button + .button { margin-top: 8px; }

/* The profile reads in a single column, in the order of the profile template */
.page-profile .content { max-width: 920px; }

.block {
  background: var(--panel-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 18px;
}
.block h2 {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin: 0 0 12px;
}
.block p { margin: 0; line-height: 1.7; font-size: 16px; }
.block .note { margin-top: 12px; font-size: 13px; color: var(--text-soft); line-height: 1.5; }
.block .note.no-margin { margin-top: 0; }
.block summary { cursor: pointer; margin-top: 6px; }

/* "label: value" list (identity, physical appearance) */
.fields { margin: 0; }
.fields > div {
  display: flex;
  flex-wrap: wrap;
  padding: 9px 0;
  border-top: 1px solid var(--border);
}
.fields > div:first-child { border-top: 0; padding-top: 0; }
.fields > div.group-start { border-top-color: var(--border-strong); margin-top: 8px; padding-top: 15px; }
.fields dt { flex: 0 0 190px; padding-right: 12px; font-size: 14px; color: var(--text-soft); }
.fields dd { flex: 1 1 260px; min-width: 0; margin: 0; font-size: 15px; line-height: 1.6; }
.fields .badge-warning { margin-left: 6px; }
.fields a, .block p a, .places a {
  color: var(--accent);
  overflow-wrap: anywhere; /* a long address (« https://fr.mariavaltorta.wiki/… ») breaks instead of widening the page */
  word-break: break-word; /* the same for browsers older than overflow-wrap: anywhere */
  text-decoration: none;
  border-bottom: 1px solid var(--accent-underline);
}
.fields a:hover, .block p a:hover, .places a:hover { border-bottom-color: var(--accent); }
.detail { color: var(--text-soft); font-size: 13px; }
.unknown { color: var(--text-faint); font-style: italic; }

/* Clickable references (Bible, Poem) */
.occurrences { display: flex; flex-wrap: wrap; margin: 10px -2px 0; }
.occurrences a {
  margin: 2px;
  padding: 3px 7px;
  overflow-wrap: anywhere; /* long lists of verses (« Mt 26,1-2.4.6.10… ») break instead of widening the page */
  word-break: break-word; /* the same for browsers older than overflow-wrap: anywhere */
  font-size: 12px;
  border-radius: 6px;
  background: var(--panel-light);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
}
.occurrences a:hover { border-color: var(--accent); }

.link-list { list-style: none; margin: 0; padding: 0; }
.link-list li {
  display: flex;
  align-items: center;
  padding: 8px 0;
  font-size: 15px;
}
.link-list li + li { border-top: 1px solid var(--border); }
.link-list .line { width: 18px; height: 3px; border-radius: 2px; background: var(--c); flex: none; margin-right: 10px; }
.link-list .relation { color: var(--text-soft); }
.link-list a { font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--border-strong); }
.link-list a:hover { border-color: var(--text); }

.places { list-style: none; margin: 8px 0 0; padding: 0; }
.places li { font-size: 14px; padding: 5px 0; overflow: hidden; }
.places small { float: right; color: var(--text-soft); }
.places .bar { display: block; clear: both; height: 4px; margin-top: 4px; background: var(--panel-light); border-radius: 2px; overflow: hidden; }
.places .bar span { display: block; height: 100%; background: var(--accent); border-radius: 2px; }


.profile-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
}
/* Credit of the source of the Bible references, at the very bottom of the profile */
.credit { margin: 24px 0 0; font-size: 12px; line-height: 1.5; color: var(--text-faint); }
.credit a { color: inherit; }

/* ---------- Statistics page ---------- */

/* Chart colors, checked for color blindness and contrast on the night panel
   (#141729) and light enough on the day panel (#ffffff):
   --series-1 for one-color charts and first parts, --series-2 for second parts */
.page-stats, .venn { --series-1: #aa1b45; --series-2: #45227c; }
.intro { margin: 8px 0 0; font-size: 16px; color: var(--text-soft); }

.figures { display: flex; flex-wrap: wrap; margin: 0 -12px; }
.figure {
  flex: 1 1 150px;
  display: flex;
  flex-direction: column;
  margin: 0 12px 24px;
  padding: 18px 22px;
  background: var(--panel-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.figure-hero { flex: 2 1 300px; }
.figure strong { font-size: 40px; font-weight: 600; line-height: 1.1; }
.figure-hero strong { font-size: 64px; }
.figure span { font-size: 15px; margin-top: 4px; }
.figure small { font-size: 13px; color: var(--text-soft); margin-top: 2px; }

.stats-grid > * + * { margin-top: 24px; }
@supports (display: grid) {
  .stats-grid { display: grid; grid-template-columns: 1fr 1fr; grid-gap: 24px; }
  .stats-grid > * + * { margin-top: 0; }
  .chart-card.wide { grid-column: 1 / -1; }
}
.chart-card {
  min-width: 0;
  padding: 22px 24px 20px;
  background: var(--panel-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.chart-card h2 { font-size: 19px; font-weight: 600; line-height: 1.3; margin: 0; }
.chart-sub { margin: 6px 0 20px; font-size: 14px; line-height: 1.5; color: var(--text-soft); }
.chart-note { margin: 12px 0 0; font-size: 12px; color: var(--text-faint); }
.chart-card a { text-decoration: none; border-bottom: 1px solid var(--border-strong); }
.chart-card a:hover { border-bottom-color: var(--accent); }

/* Ranked bars: one color, value at the tip; the track keeps room for the value of the longest bar */
.bars, .split-rows { list-style: none; margin: 0; padding: 0; }
.bars li, .split-rows li { display: flex; align-items: center; padding: 4px 0; font-size: 14px; }
.bar-label { flex: 0 0 38%; padding-right: 12px; line-height: 1.35; }
.bar-track { flex: 1 1 auto; display: flex; align-items: center; min-width: 0; padding-right: 3.6em; }
.bar { flex: none; height: 14px; min-width: 2px; background: var(--series-1); border-radius: 0 4px 4px 0; }
.bar-value { flex: none; padding-left: 8px; font-size: 13px; color: var(--text-soft); white-space: nowrap; }

/* Bars split into two parts (2px gap between the parts) */
.legend { display: flex; flex-wrap: wrap; margin: -4px 0 12px; font-size: 13px; color: var(--text-soft); }
.legend span { display: inline-flex; align-items: center; margin: 4px 18px 4px 0; }
.key { width: 10px; height: 10px; border-radius: 3px; margin-right: 7px; }
.s1 { background: var(--series-1); }
.s2 { background: var(--series-2); }
.split { display: flex; }
.segment { flex: 1 1 0px; margin-left: 2px; }
.segment:first-child { margin-left: 0; }
.split-tall { height: 28px; margin-bottom: 22px; }
.split-tall .segment {
  border-radius: 4px;
  padding-left: 9px;
  font-size: 13px;
  font-weight: 600;
  line-height: 28px;
  color: #0b0d1a; /* both series colors are light enough for dark text */
  white-space: nowrap;
}
.split-rows .split { flex: 1 1 60%; height: 8px; } /* 60%: on small screens, goes below the label with its value */
.split-rows .segment:first-child { border-radius: 4px 0 0 4px; }
.split-rows .segment:last-child { border-radius: 0 4px 4px 0; }
.split-rows .segment:only-child { border-radius: 4px; }
.split-value { flex: 0 0 3.6em; text-align: right; font-size: 13px; color: var(--text-soft); }
.split:hover .segment { opacity: 0.55; }
.split .segment:hover { opacity: 1; }

/* Two overlapping circles (Bible, Poem); the shared part is a violet as vivid and light as them */
.venn { display: block; width: 100%; max-width: 280px; height: auto; margin: 0 auto 4px; }
.panel .venn-box { width: 0; min-width: 100%; margin-top: 14px; } /* like the filters: no say in the panel's width */
.panel .venn { max-width: 186px; margin: 0 auto; }
.venn-s1 { fill: var(--series-1); }
.venn-s2 { fill: var(--series-2); }
.venn-both { fill: #811d85; }
/* Tree: a click ticks or unticks a part (Bible only, both, Poem only). A part not ticked is dimmed:
   its colour half mixed with the panel's (an opaque colour, as the circles overlap), its count faded */
.venn [data-side] { cursor: pointer; outline: none; }
.venn [data-side]:focus-visible { stroke: var(--focus-stroke); stroke-width: 2; }
/* Tree: an eraser on a coloured part, its point at its bottom corner;
   a paint bucket on the others, its point at the bottom of the poured paint */
.venn-toggles [data-side] { cursor: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAYAAACN1PRVAAAFF0lEQVR42qWWa2xUVRDHZ865d193t1tgpVuKfYDBQoVCJcUuXVOkKqJBUQsJj0DkYSIxwUQTXx8Uv4iJCamJgh8ETOqHFgQh5ek2FgqY8rAJUmlpFxR2Swt0t3V3Ye/ee8YP7m2WultKneQmJ+dm8puZM+d/Bm12N4zREAAAEd1ERMl1n7EGABruwGWTfSwQA1RGRAuKCgsqw+GBfABQEPFGEoT/F2ZAEBHLiWhOdXVVycoVyyqys7NtHR1XVCGEizEWJKLEcODDwIZAAOAlopLFLzw3q7q6qiQSidwrLMx3FeQ/6uro7IrE4/FcxlgvEd1NBY4WZoAkInoGAKYuq1laXllZ8Xg0Go0zxjAeVxM5OROd04un5fr91wYikcgkxliIiAYN/9HADJCZiBbKsjxl1crlntmzZ+ZHItF7nDMGABpjyFRVTWQ5HNbS0pn5wWDP4J07/RMRMQoA/QCAD4KxZOUsRLTIZrMWrF613DNjRnFeNBqLGyCj+xhDpmmaLssyL5tT+lh4YEANBm+OR8TbABAeCcYAADjn2UKIlxSbzbV+/ZoFRUUFj6QBGUaIiEII1HWd5pXPnXIjEAz19d26wBj7W8oA4knQNF3XdZdrQtbGDWsX2xXFHIvF1AygIV8hSNjtiuXUqV+7urq6+5IBiHQwCQBAkqQnNE37ZO6Tc8b194fU3t4+bVzxNDmuqiLdHTJ8dV2Qw2G3trae727Ys/8sAFwGgEC6BpEAAGRZflrTtPe8Xs/Eo4d/nF9aOjN7y2dbg1nOLJw6tcgSi91NMIYcAESqrxCCsrIc1tbW8/76hn1nEbEDEVsAQAcAwhS5GgIlEonNNa+/kvftjtrZksSRMYaXLv0xuGjxa2e8lRWiqsqrhMMDMc4ZAkDCANlsNnNLy5nOAwcPtyHiZQA4mSpfRmYIACwVtGvnN2WMMQQA0HUd3O4cy6LnF+Z8/sW2QDyuQknJdEssdldFBE5EpCiKuanpRHvjoWNtiPg7AJwerpNos7sRAIAxtkQIsW5ZzdK8nd99XSaEoOS+ASTOOfb03LxX/ezLpyZPnqTX1Cy1hkKhmKIoJp+v+dKRoz9fZIy1EdG5dILMAAAZY7OIaN2mtzZMMUCIiAYo2ZmoaRrl5rotTb6DlYFAD9/9/Q8xp9Np9fma2w2QEOJsJuVHhzNP1nW92Ov1bD9yaK9H0zTinCcl8L9mZBgKhROr17x5/qr/WuOff12/AwDniOhcpucFAIBLsgKMMXdvb6/HYjZzj2feeF3XKTWr+276vzoo7HZFutV3O75334FGznmjEOLKSKCh1ieifk3TJV9Ts8vhcMgVFeXjNU1LC9Q0jUwmmdXWbu/+8OMt7ZIkdQohTichNJL2Gd0oEPGiJEm248ebxmUCJhIJIcsyq/1qh/+Djz5t55wfEELsTp4RPUjRU1sfiagtE9AA1dXVX9/8zvsXJUk6KITYRURiNFmlU5C0wHhcFSaTiTXs2R9Yv/Ht3zjnvwghdgzLCEf4Mj6e9wHtiiLNn//UhPqGfYE31m26kJSfbUQkENEYETLaaMYCJKI2RDT7mpon+K9ei23duq1TCHECAL5Mlu7hx7EMo9xQRIhYlSzXCgBQxjj2vQsANzO9Z6nncIJzrtjtytqWk0eXZDudMhFBpksPAJD6v2rBi8e6/VeBMcak0YSl67quqqqoq6v3W60W/jApDQwOqskACB8wERvhywDwKgCYxljGnwBg8B9YJ4jF48I14gAAAABJRU5ErkJggg==") 9 22, pointer; }
.venn-toggles [data-side].off { cursor: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAbCAYAAACJISRoAAADXElEQVR42r2WbUyTVxTHf1A0fXtgjaAIVrG0FItTpkV0BTbGMiMiKhXrpFnilAyMRJMFo5kvcck2J9nULybb9IPRmhFhGfjyZSxCghCNClpgKHGLxbUapyWrUN4G+9Juj6QgRfB8ubnn3nv+5/7PS06IXBnNVEvYBN9ZAbNoXwHYRrscOkGQjQcP7EnqeubI3b9vtwGwjHU5ZIJ0VXd7XGv8G4Uw+wKQO9k/CUpeC0gwgU8A1FMJshGwphiXqPR6nfKsrbxzsuiaCaQDZYB1d+lOXe2VS2kxMdHSyfhJPJAExM6bq16dkrIkevv2bZrUZUbVZMQkCjAB8uTkN41ppuUfaLXxik2WvDmCIIyH1hzfWgd4AoEIQKZaHRu5fl1OviAIMfGa+QqLJS92vN4WF23d8WN5ZYvb3ZUK7A8Uk3iV6g3lh5s2ZEil0rCsrHeiRgOQyWSSQHpBUM47c/q7j4DFQFYgkFnJyYvm+5UnTpz8fTSPU5ctVQEc/vrovb6+/qEvv/rmHkCCTqvMzMyIshZY1ECxj50X2or54y3WlZGRM8IBjpQdl5+znTKuzc2eHQhoc8HWG1XVl13AIBCm1+uUN67XvhsaGhri9fb+o9O/9Yvb3XUT2CeOiSQiIkIustNYWFgieS8zPSpQ0M/ZThlramqf3Gq63aXRxCk2mNfG/E+nVGI784MxOyd/wEfbr5Jp05UASRnpbyf5L15tuNYwMDCg7ei432cWGRCLRhOnMJmWzzAYEoWRZ3Fxc+UOx0PvHXvrLODnsYrxWFX1ZVdFZZVzIrVx8MCeRH/MxwJpBOqLinc1ezyewaALMEwSMt4ufMzr7X3+SdGu5mAAnj591r/eXHBtvCD9ftp82fRSqaur/2uBIaWmudneCRx6AWRoaHhIvI6grbGwsKTpZbQd+vxwe3ZOfmN3T08TsA24LwYZdjg6nwC0tLQ5gOER74929/Q831FSejuQcafzUe8K0/t1R8qOdwBnffXR6z/3p3Bka1u7u/1ux0O7vfUB8AcgzqpB4HHbb3cXLVxoCE/U6/5L24rKKufKVXkNLtcjJ7AXqB9rkAgX6f8ehZG9Mpk07dLF8ysSdFrlp6Wf2cvLf/rTZ/hbnzOvPK1MB74AxM3ze6B2KkaioORf1aIMen6qXjcAAAAASUVORK5CYII=") 3 22, pointer; }
.venn-toggles .venn-s1.off { fill: var(--venn-off-1); }
.venn-toggles .venn-s2.off { fill: var(--venn-off-2); }
.venn-toggles .venn-both.off { fill: var(--venn-off-both); }
.venn g.off, .venn-name.off { opacity: 0.5; }
.venn text { fill: #fff; text-anchor: middle; pointer-events: none; }
.venn-name { font-size: 15px; font-weight: 600; letter-spacing: 0.04em; }
.venn-count { font-size: 20px; font-weight: 700; dominant-baseline: central; }
.venn-word { font-size: 13px; }
.venn circle, .venn text, .venn g { transition: opacity 0.2s, fill 0.2s; }
.venn .venn-total, .show-1 .side1.venn-own, .show-2 .side2.venn-own, .show-1 .venn-shared, .show-2 .venn-shared { display: none; }
.show-1 .side1.venn-total, .show-2 .side2.venn-total { display: inline; }
.show-1 .side2, .show-2 .side1 { opacity: 0.25; }
.show-1 .venn-both { fill: var(--series-1); }
.show-2 .venn-both { fill: var(--series-2); }

/* Columns (distance to Jesus), with recessive gridlines */
.columns {
  position: relative;
  display: flex;
  align-items: flex-end;
  height: 220px;
  margin: 24px 0 0 34px;
  border-bottom: 1px solid var(--border-strong);
}
.grid-line { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--border); }
.grid-line span {
  position: absolute;
  right: 100%;
  top: -8px;
  margin-right: 8px;
  font-size: 11px;
  line-height: 16px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}
.col-slot { position: relative; flex: 1 1 0px; display: flex; align-items: flex-end; justify-content: center; height: 100%; }
.col { position: relative; width: 70%; max-width: 24px; min-height: 2px; background: var(--series-1); border-radius: 4px 4px 0 0; }
.cap { position: absolute; bottom: 100%; left: 50%; margin: 0 0 4px -2em; width: 4em; text-align: center; font-size: 12px; }
.columns:hover .col { opacity: 0.55; }
.columns .col-slot:hover .col { opacity: 1; }
.columns-axis { display: flex; margin-left: 34px; font-size: 11px; color: var(--text-faint); }
.columns-axis span { flex: 1 1 0px; padding-top: 6px; text-align: center; }
.axis-title { margin: 2px 0 0 34px; text-align: center; font-size: 12px; color: var(--text-soft); }

/* Figures of each chart as a table (folded) */
.chart-table { margin-top: 16px; font-size: 13px; color: var(--text-soft); }
.chart-table summary { cursor: pointer; }
.chart-table summary:hover { color: var(--text); }
.chart-table table { width: 100%; margin-top: 10px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.chart-table th, .chart-table td { padding: 5px 8px; text-align: right; border-bottom: 1px solid var(--border); }
.chart-table th:first-child, .chart-table td:first-child { padding-left: 0; text-align: left; }
.chart-table th { font-weight: 600; }
.chart-table td { color: var(--text); }

.chart-tip {
  position: fixed;
  z-index: 30;
  max-width: 280px;
  padding: 7px 11px;
  pointer-events: none;
  font-size: 13px;
  line-height: 1.4;
  background: var(--panel-light);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  box-shadow: 0 8px 24px var(--shadow);
}
.chart-tip[hidden] { display: none; }
/* Bubble over the circles of the tree, with a point towards the mouse (js/venn.js) */
.venn-tip {
  position: fixed;
  z-index: 33; /* above the options, even in the phone layout's drawer */
  max-width: 240px;
  padding: 9px 13px;
  pointer-events: none;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-soft);
  background: var(--panel-solid);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  box-shadow: 0 8px 24px var(--shadow);
  animation: venn-tip-in 0.15s ease;
}
.venn-tip[hidden] { display: none; }
.venn-tip strong { font-weight: 600; color: var(--text); }
.venn-tip::after {
  content: "";
  position: absolute;
  left: var(--point-x);
  bottom: -6px;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  background: var(--panel-solid);
  border: solid var(--border-strong);
  border-width: 0 1px 1px 0;
  transform: rotate(45deg);
}
.venn-tip-below::after { bottom: auto; top: -6px; transform: rotate(225deg); }
@keyframes venn-tip-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .venn-tip { animation: none; } }
.page-stats .credit { margin-top: 32px; }

@media (max-width: 860px) {
  @supports (display: grid) { .stats-grid { grid-template-columns: 1fr; } }
}
@media (max-width: 480px) {
  .bars li, .split-rows li { flex-wrap: wrap; }
  .bar-label { flex-basis: 100%; padding: 0 0 4px; }
  .figures { margin: 0 -6px; }
  .figure { flex-basis: 80px; margin: 0 6px 12px; padding: 12px 14px; }
  .figure-hero { flex-basis: 100%; }
  .figure strong { font-size: 30px; }
  .figure-hero strong { font-size: 52px; }
  .figure span { font-size: 13px; }
  .figure-hero span { font-size: 15px; }
  .chart-card { padding: 18px 16px; }
}

/* ---------- Small screens ---------- */

@media (max-width: 760px) {
  .fields dt { flex-basis: 100%; padding: 0 0 2px; }
  .top-bar { flex-wrap: wrap; padding: 12px 16px; }
  /* Four tabs: they share the width, as in the tree */
  .tabs { display: flex; width: 100%; max-width: 420px; }
  .tabs a { flex: 1 1 auto; padding: 6px 4px; text-align: center; }
  /* On a phone the filter buttons stay on one line, which scrolls sideways within its frame */
  .filter-line { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 10px; overscroll-behavior-x: contain; }
  .filter-line .filter-group { margin-bottom: 0; }
  /* On a phone the table slides sideways instead: short cells on one line, a narrower name column,
     so that the other columns appear beside it, and a line along it, under which they slide */
  .characters-table td, .characters-table thead th { white-space: nowrap; }
  .characters-table td.links { white-space: normal; }
  .characters-table tbody th { min-width: 120px; max-width: 160px; }
  .characters-table tr > :first-child { box-shadow: 1px 0 0 var(--border-strong); }
  .profile-header h1 { font-size: 32px; }
  .profile-actions { flex-direction: row; flex-wrap: wrap; margin: 16px 0 0; width: 100%; }
  .profile-actions .button + .button { margin: 0 0 0 8px; }
  .list-header h1 { font-size: 30px; }
  .list-tools .search { flex-basis: 100%; margin-left: 0; }
  .content { padding: 8px 16px 48px; }
  .block { padding: 18px 16px; }
}

/* ---------- Tree page on a phone, held upright or sideways ---------- */

@media (max-width: 760px), (max-height: 500px) and (pointer: coarse) {
  /* The settings button at the top left, the tabs next to it */
  .page-tree .top-bar { flex-wrap: nowrap; padding: 12px 16px; }
  .page-tree .top-bar .spacer { order: -1; margin: 0 8px 0 0; }
  .page-tree .tabs { display: flex; flex: 1 1 auto; max-width: 360px; margin: 0; }
  .page-tree .tabs a { flex: 1 1 auto; padding: 6px 4px; text-align: center; }
  .button-filters {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 41px; /* as tall as the tabs */
    height: 41px;
    padding: 0;
    background: var(--panel);
  }
  .page-tree { --drawer-width: 75vw; }
  /* Held sideways, the drawer only takes a part of the screen, and stays wide enough for its options */
  @media (orientation: landscape) {
    .page-tree { --drawer-width: 35vw; }
  }
  @media (orientation: landscape) and (max-width: 742px) {
    .page-tree { --drawer-width: 260px; }
  }
  /* The options: a drawer sliding in from the left and pushing the rest of the page to the right */
  .page-tree .panel {
    display: flex;
    flex-direction: column;
    top: 0; bottom: 0;
    left: 0; right: auto;
    width: var(--drawer-width);
    max-width: none;
    max-height: none;
    height: auto !important; /* the drawer does not fold */
    padding-bottom: 0; /* the bottom strip goes down to the edge of the screen */
    background: var(--panel-solid);
    border-width: 0 1px 0 0;
    border-radius: 0;
    z-index: 32;
    overscroll-behavior: contain; /* scrolling it does not reload the page */
    scrollbar-width: none; /* it still scrolls under the finger, without a visible bar */
    visibility: hidden;
    transform: translateX(-100%);
    transition: transform 0.25s ease, visibility 0s 0.25s;
  }
  .page-tree .panel::-webkit-scrollbar { display: none; } /* the same for browsers without scrollbar-width */
  .drawer-open .panel {
    visibility: visible;
    transform: none;
    transition: transform 0.25s ease;
  }
  .page-tree .top-bar, .page-tree #scene, .page-tree #labels, .page-tree .tooltip, .page-tree .bottom-area {
    transition: transform 0.25s ease;
  }
  .drawer-open .top-bar, .drawer-open #scene, .drawer-open #labels, .drawer-open .tooltip {
    transform: translateX(var(--drawer-width));
  }
  .drawer-open .bottom-area { transform: translateX(calc(var(--drawer-width) - 50%)); } /* it is centred by its own shift */
  .page-tree .panel > * { flex: none; }
  .page-tree .panel .venn-box { margin-top: 0; } /* the margin of the filters no longer merges with its own */
  /* The rest of the screen: a touch closes the drawer, without reaching the tree */
  .panel-backdrop {
    display: block;
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: 31;
    background: var(--backdrop);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0s 0.25s;
  }
  .drawer-open .panel-backdrop {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.25s ease;
  }
  /* "Valider" on a strip held at the bottom of the screen, whether the options are scrolled or not */
  .panel-footer {
    display: block;
    position: sticky;
    bottom: 0;
    margin: auto -18px 0;
    padding: 12px 18px 18px;
    background: var(--panel-solid);
  }
  /* Above the strip, the options fade out; a touch goes through to them */
  .panel-footer::before {
    content: "";
    position: absolute;
    left: 0; right: 0;
    bottom: 100%;
    height: 24px;
    background: linear-gradient(to bottom, var(--panel-solid-fade), var(--panel-solid));
    pointer-events: none;
  }
  .page-tree #recenter { margin-bottom: 24px; } /* at the end of the options, clear of the fade */
  .button-validate {
    margin: 0;
    background: #2545b3;
    border-color: #2545b3;
    color: #fff;
    font-weight: 600;
  }
  .fold-panel, .help { display: none; }
  .page-tree .panel-header { cursor: default; touch-action: auto; }
  .page-tree .grip { display: none; }
  .bottom-area { bottom: 16px; }
  /* Held sideways, height is scarce: a smaller search, and the settings button and tabs as one list on the left */
  @media (orientation: landscape) {
    .page-tree .top-bar {
      flex-direction: column;
      align-items: stretch;
      right: auto;
      top: 12px; left: 16px;
      padding: 3px;
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 9px;
    }
    .page-tree .top-bar .spacer { margin: 0; }
    .page-tree .tabs { flex-direction: column; flex: none; max-width: none; padding: 0; background: none; border: 0; }
    .page-tree .tabs a, .button-filters { flex: none; padding: 3px 10px; font-size: 13px; line-height: 20px; text-align: left; }
    .button-filters {
      justify-content: flex-start;
      width: 100%;
      height: auto;
      background: none;
      border: 0;
      border-radius: 6px;
      color: var(--text-soft);
    }
    .button-filters svg { width: 16px; height: 16px; }
    .button-filters-label { display: inline; margin-left: 6px; }
    /* The area stays wide for the selection card; beside the search, a touch reaches the tree */
    .page-tree .bottom-area { pointer-events: none; }
    .page-tree .bottom-area > * { pointer-events: auto; }
    .page-tree .search-row { width: 348px; max-width: 100%; margin: 0 auto; } /* the search keeps its 300 pixels */
    .page-tree .search input { height: 38px; font-size: 14px; }
    .button-sound { width: 40px; }
  }
  @media (prefers-reduced-motion: reduce) {
    .page-tree .panel, .drawer-open .panel, .panel-backdrop, .drawer-open .panel-backdrop,
    .page-tree .top-bar, .page-tree #scene, .page-tree #labels, .page-tree .tooltip, .page-tree .bottom-area { transition: none; }
  }
}

/* Very narrow phones (320 pixels): the four tabs still fit, in the tree as on the other pages; the long names of
   the fiches' titles too; and « Rechercher un personnage… » beside the sound button */
@media (max-width: 359px) {
  .tabs a, .page-tree .tabs a { padding: 6px 2px; font-size: 13px; }
  .profile-header h1 { font-size: 28px; }
  .button-sound { width: 42px; margin-right: 6px; }
  .page-tree .search input { padding: 0 6px 0 32px; background-position: 9px 50%; }
  .page-tree .search input::placeholder { font-size: 13px; }
}
