:root {
  --bg: #efece3;
  --paper: #fffdf8;
  --paper-2: #f7f3e9;
  --paper-3: #eee8db;
  --ink: #1d2a30;
  --ink-soft: #46585f;
  --muted: #748187;
  --line: #ded6c7;
  --line-strong: #c9beab;
  --accent: #c05a3e;
  --accent-dark: #9d442c;
  --teal: #1f6f8b;
  --dark: #162b2f;
  --cream: #f8f3e7;
  --shadow: 0 1px 2px rgba(29, 42, 48, 0.04), 0 8px 24px rgba(29, 42, 48, 0.035);
  --radius: 14px;
  --font-sans: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.modal-open {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
tr:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-height: 720px;
  overflow: hidden;
}

/* ------------------------------------------------------------------ */
/* Header                                                              */
/* ------------------------------------------------------------------ */

.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 16px 22px 15px;
  background:
    radial-gradient(circle at 88% -20%, rgba(224, 159, 62, 0.16), transparent 34%),
    linear-gradient(120deg, #12282c 0%, #173237 58%, #142c31 100%);
  color: var(--cream);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
  flex: 1 1 auto;
  min-width: 0;
}

.eyebrow,
.section-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow {
  color: #e0a458;
  margin-bottom: 3px;
}

.brand h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(24px, 2.25vw, 34px);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.06;
}

.brand-year {
  color: #e0a458;
  font-size: 0.68em;
  font-weight: 500;
  letter-spacing: 0.01em;
  vertical-align: 0.1em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.subtitle {
  margin: 5px 0 0;
  color: rgba(248, 243, 231, 0.68);
  font-size: 12px;
  letter-spacing: 0.01em;
}

.brand-meta {
  margin: 4px 0 0;
  color: rgba(248, 243, 231, 0.46);
  font-size: 10px;
  line-height: 1.35;
  letter-spacing: 0.01em;
}

.year-switcher-wrap {
  display: flex;
  flex: 0 0 auto;
  flex-direction: row;
  gap: 8px;
  align-items: center;
}

.year-switcher-label {
  color: rgba(248, 243, 231, 0.52);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.13em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.year-switcher {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid rgba(248, 243, 231, 0.16);
  border-radius: 10px;
  background: rgba(248, 243, 231, 0.07);
}

.year-btn {
  position: relative;
  min-width: 54px;
  padding: 6px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: rgba(248, 243, 231, 0.72);
  font-size: 12px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  transition: background-color 150ms ease, color 150ms ease, opacity 150ms ease;
}

.year-btn:hover:not(:disabled) {
  background: rgba(248, 243, 231, 0.1);
  color: var(--cream);
}

.year-btn.is-active {
  background: var(--accent);
  color: #fffaf1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.year-btn.is-duplicate::after {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  margin-left: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
  vertical-align: middle;
}

.year-btn.is-future {
  color: rgba(248, 243, 231, 0.52);
}

.year-btn.is-future::after {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  margin-left: 5px;
  border: 1px solid currentColor;
  border-radius: 50%;
  opacity: 0.72;
  vertical-align: middle;
}

.year-btn.is-future.is-active {
  color: #fffaf1;
}

.year-btn.is-future.is-active::after {
  background: currentColor;
}

.year-btn:disabled {
  cursor: wait;
  opacity: 0.5;
}

.year-btn.is-pending {
  outline: 1px dashed rgba(248, 243, 231, 0.55);
  outline-offset: -2px;
}

.year-notice {
  flex: 0 0 auto;
  padding: 7px 22px;
  border-bottom: 1px solid #e5cf9f;
  background: #fff4dc;
  color: #76561b;
  font-size: 11px;
  line-height: 1.4;
}

.year-notice strong {
  font-weight: 750;
}

.year-notice.is-loading {
  border-color: #c5ddd8;
  background: #eaf2f0;
  color: #2c5f5b;
}

.year-notice.is-loading::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 7px;
  border: 1.5px solid rgba(44, 95, 91, 0.3);
  border-top-color: #2c5f5b;
  border-radius: 50%;
  vertical-align: -1px;
  animation: year-spin 700ms linear infinite;
}

.year-notice.is-error {
  border-color: #e3b5c1;
  background: #fbeef2;
  color: #7d2743;
}

.year-notice.is-pending {
  border-color: #c5ddd8;
  background: #eaf2f0;
  color: #2c5f5b;
}

@keyframes year-spin {
  to {
    transform: rotate(360deg);
  }
}

.topbar-stats {
  display: flex;
  align-items: center;
  gap: 22px;
  flex: 0 0 auto;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 64px;
}

.stat span {
  font-size: 21px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.stat small {
  color: rgba(248, 243, 231, 0.58);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ------------------------------------------------------------------ */
/* Buttons and fields                                                  */
/* ------------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.01em;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  transform: none;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fffaf1;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.15) inset;
}

.btn-primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink-soft);
}

.btn-ghost:hover {
  background: var(--paper-2);
  border-color: var(--muted);
  color: var(--ink);
}

.btn-about {
  background: rgba(248, 243, 231, 0.055);
  border-color: rgba(248, 243, 231, 0.22);
  color: rgba(248, 243, 231, 0.82);
}

.btn-about:hover {
  background: rgba(248, 243, 231, 0.12);
  border-color: rgba(248, 243, 231, 0.38);
  color: var(--cream);
}

.btn-small {
  min-height: 31px;
  padding: 5px 10px;
  font-size: 11px;
}

.btn-share .share-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
}

.btn-share .share-icon svg {
  display: block;
}

.btn-share .share-label {
  white-space: nowrap;
}

@media (max-width: 1500px) {
  .btn-share {
    min-width: 31px;
    padding-left: 0;
    padding-right: 0;
  }

  .btn-share .share-label {
    display: none;
  }
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 24px;
  line-height: 1;
}

.icon-btn:hover {
  background: var(--paper-2);
  color: var(--ink);
}

.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--teal);
  font-size: 11px;
  font-weight: 650;
}

.link-btn:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

.search-field {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  margin-top: 11px;
}

.search-field .search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-52%);
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  pointer-events: none;
}

.search-field input {
  width: 100%;
  height: 36px;
  padding: 7px 10px 7px 31px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefa;
  color: var(--ink);
  font-size: 12px;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.search-field input::placeholder {
  color: #9aa3a6;
}

.search-field input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(31, 111, 139, 0.11);
}

.select {
  width: 100%;
  height: 36px;
  padding: 6px 28px 6px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefa;
  color: var(--ink);
  font-size: 12px;
  outline: none;
}

.select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(31, 111, 139, 0.11);
}

.select-small {
  width: auto;
  min-width: 72px;
}

.select-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 180px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.select-label .select {
  height: 36px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

/* ------------------------------------------------------------------ */
/* Main layout                                                         */
/* ------------------------------------------------------------------ */

.layout {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr) 342px;
  gap: 12px;
  padding: 12px 14px;
}

.panel {
  min-height: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.sidebar {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-head {
  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--line);
}

.section-kicker {
  color: var(--accent);
  margin-bottom: 4px;
}

.panel-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.panel-title-row h2,
.filter-block h3,
.detail-inner h2,
.detail-inner h3,
.modal-head h2 {
  margin: 0;
  color: var(--ink);
}

.panel-title-row h2 {
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.soft-count {
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.panel-copy {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11.5px;
}

.candidate-list {
  flex: 1 1 auto;
  min-height: 110px;
  padding: 6px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.candidate-row {
  width: 100%;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  padding: 7px 7px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  transition: background-color 130ms ease;
}

.candidate-row:hover {
  background: var(--paper-2);
}

.candidate-row.is-active {
  background: #e5efed;
  box-shadow: inset 3px 0 0 var(--teal);
}

.candidate-row--all {
  margin-bottom: 2px;
  border-bottom: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
}

.candidate-row--all .candidate-name {
  color: var(--teal);
}

.candidate-rank {
  color: #9aa3a6;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.candidate-main {
  min-width: 0;
}

.candidate-name {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.005em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.candidate-sub {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9.5px;
}

.candidate-bar {
  display: block;
  height: 3px;
  margin-top: 4px;
  overflow: hidden;
  border-radius: 3px;
  background: #e8e1d4;
}

.candidate-bar i {
  display: block;
  height: 100%;
  min-width: 2px;
  border-radius: 3px;
  background: var(--teal);
}

.candidate-row.is-under .candidate-bar i {
  background: #9a9f9b;
}

.candidate-row.is-qualified .candidate-rank {
  color: var(--accent);
  font-weight: 700;
}

.candidate-count {
  align-self: start;
  padding-top: 1px;
  color: var(--ink-soft);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.candidate-row.is-under .candidate-count {
  color: var(--muted);
}

.candidate-empty {
  padding: 12px 14px;
  color: var(--muted);
  font-size: 11.5px;
}

.sidebar-filters {
  flex: 0 0 auto;
  max-height: 43%;
  padding: 10px 14px 12px;
  overflow: auto;
  border-top: 1px solid var(--line);
  background: #fdfaf3;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.filter-block + .filter-block {
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.filter-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.filter-block h3 {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.family-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-top: 5px;
}

.family-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  color: var(--ink-soft);
  font-size: 11.5px;
  cursor: pointer;
}

.family-row:hover {
  color: var(--ink);
}

.family-row input {
  width: 13px;
  height: 13px;
  margin: 0;
  accent-color: var(--teal);
}

.family-dot {
  display: inline-block;
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.family-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.family-count {
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.filter-block .select + h3 {
  margin-top: 11px;
}

.filter-block .select {
  margin-top: 4px;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 11px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.35;
  cursor: pointer;
}

.check-row input {
  width: 13px;
  height: 13px;
  margin: 1px 0 0;
  flex: 0 0 auto;
  accent-color: var(--teal);
}

/* ------------------------------------------------------------------ */
/* Stage                                                               */
/* ------------------------------------------------------------------ */

.stage {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.stage-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 50px;
  padding: 9px 12px 9px 15px;
  border-bottom: 1px solid var(--line);
}

.breadcrumb {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
}

.crumb-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--teal);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.crumb-link:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

.crumb-sep,
.crumb-current {
  color: var(--muted);
  font-size: 11px;
}

.crumb-current {
  overflow: hidden;
  color: var(--ink-soft);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 auto;
  min-width: 0;
}

.view-switch {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-2);
}

.view-switch button {
  min-height: 27px;
  padding: 4px 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: background-color 140ms ease, color 140ms ease;
}

.view-switch button:hover {
  background: rgba(255, 253, 248, 0.7);
  color: var(--ink);
}

.view-switch button.is-active {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(29, 42, 48, 0.08);
}

.view-switch button:focus-visible {
  outline-offset: -1px;
}

.search-field--stage {
  width: 205px;
  margin-top: 0;
}

.search-field--stage input {
  height: 31px;
  font-size: 11px;
}

.stage-count {
  color: var(--muted);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.canvas-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 1px 1px, rgba(29, 42, 48, 0.085) 1px, transparent 0) 0 0 / 19px 19px,
    radial-gradient(circle at 50% 46%, rgba(224, 159, 62, 0.055), transparent 62%),
    #fcfaf4;
  touch-action: none;
}

.canvas-wrap.is-timeline {
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.96), rgba(250, 247, 239, 0.98)),
    #fcfaf4;
  touch-action: pan-y;
}

.canvas-wrap.is-departments {
  background: #fcfaf4;
  touch-action: pan-y;
}

.departments-view {
  position: absolute;
  inset: 0;
  overflow: auto;
  padding: 16px 18px 24px;
  background: #fcfaf4;
  touch-action: pan-y;
}

.departments-inner {
  max-width: 1180px;
  margin: 0 auto;
}

.departments-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.department-fact {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper-2);
}

.department-fact strong {
  display: block;
  color: var(--ink);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  white-space: normal;
}

.department-fact span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.3;
}

.departments-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.departments-search {
  width: 240px;
  margin-top: 0;
}

.departments-search input {
  height: 31px;
  font-size: 11px;
}

.departments-type {
  width: auto;
  min-width: 170px;
  height: 31px;
  font-size: 11px;
}

.departments-toolbar .stage-count {
  margin-left: auto;
}

.departments-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
}

.departments-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  color: var(--ink-soft);
  font-size: 11px;
}

.departments-table th,
.departments-table td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.departments-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--paper-2);
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.departments-table tbody tr:hover {
  background: #faf6ec;
}

.departments-table tbody tr.is-selected {
  background: #eaf2f0;
}

.departments-table tbody tr:last-child th,
.departments-table tbody tr:last-child td {
  border-bottom: 0;
}

.departments-table tbody th {
  min-width: 150px;
}

.departments-table .num {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.department-sort {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  font: inherit;
  letter-spacing: inherit;
  text-align: inherit;
  text-transform: inherit;
}

.department-sort:hover {
  color: var(--ink);
}

.department-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--teal);
  cursor: pointer;
  font: inherit;
  font-weight: 650;
  text-align: left;
}

.department-link:hover {
  text-decoration: underline;
}

.department-type {
  display: inline-block;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}

.department-cell-main {
  color: var(--ink);
  font-weight: 600;
}

.department-cell-main .family-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 5px;
  border-radius: 50%;
  vertical-align: 1px;
}

.department-cell-sub {
  color: var(--muted);
  font-size: 9.5px;
}

.department-empty {
  margin: 0;
  padding: 24px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.departments-map-card {
  position: relative;
  margin-bottom: 12px;
  padding: 14px 14px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}

.departments-map-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.departments-map-head h2 {
  margin: 2px 0 0;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.department-map-legend {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.2;
}

.department-map-legend-title {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.department-map-legend-scale {
  display: flex;
  align-items: center;
  gap: 4px;
}

.department-map-legend-swatches {
  display: inline-flex;
}

.department-map-legend-swatches i {
  display: block;
  width: 14px;
  height: 7px;
}

.department-map-legend-swatches i:first-child {
  border-radius: 2px 0 0 2px;
}

.department-map-legend-swatches i:last-child {
  border-radius: 0 2px 2px 0;
}

.department-map-legend-empty {
  display: flex;
  align-items: center;
  gap: 4px;
}

.department-map-legend-empty i {
  display: block;
  width: 10px;
  height: 7px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #eee8db;
}

.departments-map {
  position: relative;
  width: 100%;
  margin-top: 8px;
}

.departments-map svg {
  display: block;
  width: 100%;
  height: auto;
}

.department-map-path {
  stroke: var(--paper);
  stroke-width: 0.7;
  transition: opacity 120ms ease, stroke 120ms ease;
}

.department-map-path:hover {
  stroke: var(--ink);
  stroke-width: 1.2;
}

.department-map-path.is-selected {
  stroke: var(--accent);
  stroke-width: 1.6;
}

.department-map-inset {
  fill: var(--paper-2);
  stroke: var(--line);
  stroke-width: 1;
}

.department-map-inset-label {
  fill: var(--muted);
  font-family: var(--font-sans);
  font-size: 8.5px;
}

.department-map-group-label {
  fill: var(--muted);
  font-family: var(--font-sans);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.department-map-loading,
.department-map-error {
  margin: 0;
  padding: 30px 12px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.department-map-tooltip {
  position: absolute;
  z-index: 5;
  max-width: 230px;
  padding: 7px 9px;
  border: 1px solid rgba(248, 243, 231, 0.16);
  border-radius: 7px;
  background: var(--dark);
  color: var(--cream);
  box-shadow: var(--shadow);
  font-size: 10px;
  line-height: 1.3;
  pointer-events: none;
}

.department-map-tooltip strong {
  display: block;
  margin-bottom: 2px;
  font-size: 11px;
}

.department-map-tooltip span {
  display: block;
  color: rgba(248, 243, 231, 0.75);
}

.departments-map-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
}

@media (max-width: 900px) {
  .departments-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .departments-view {
    padding: 12px;
  }

  .departments-map-card {
    padding: 12px 10px 8px;
  }

  .departments-map-head {
    flex-direction: column;
  }

  .department-map-legend {
    align-items: flex-start;
  }

  .departments-search {
    width: 100%;
  }

  .departments-type {
    flex: 1 1 150px;
    min-width: 0;
    width: auto;
  }

  .departments-toolbar .stage-count {
    flex: 1 1 100%;
    margin-left: 0;
  }

  .departments-table {
    min-width: 640px;
  }
}

#graph {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}

#graph:active {
  cursor: grabbing;
}

#graph.is-timeline,
#graph.is-timeline:active {
  cursor: default;
}

.tooltip {
  position: absolute;
  z-index: 5;
  max-width: 285px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(20, 38, 42, 0.97);
  color: var(--cream);
  font-size: 11.5px;
  line-height: 1.35;
  pointer-events: none;
  box-shadow: 0 10px 30px rgba(20, 38, 42, 0.2);
}

.tooltip strong {
  color: #fffaf1;
  font-weight: 700;
}

.tooltip .tooltip-muted {
  color: rgba(248, 243, 231, 0.62);
}

.tooltip .tooltip-family {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  color: rgba(248, 243, 231, 0.78);
}

.tooltip .tooltip-family i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  pointer-events: none;
}

.canvas-hint {
  position: absolute;
  left: 12px;
  bottom: 10px;
  max-width: calc(100% - 24px);
  padding: 4px 8px;
  overflow: hidden;
  border: 1px solid rgba(201, 190, 171, 0.7);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.78);
  color: var(--muted);
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
  backdrop-filter: blur(4px);
}

/* ------------------------------------------------------------------ */
/* Année à venir (2027)                                                */
/* ------------------------------------------------------------------ */

.app.pending-year .layout {
  grid-template-columns: minmax(0, 1fr);
}

.app.pending-year .sidebar,
.app.pending-year .detail,
.app.pending-year .stage-head,
.app.pending-year .stage-footer,
.app.pending-year .topbar-stats {
  display: none;
}

.app.pending-year .canvas-wrap {
  background:
    radial-gradient(circle at 50% 0%, rgba(31, 111, 139, 0.06), transparent 55%),
    linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(250, 247, 239, 0.99));
  touch-action: auto;
}

.future-view {
  position: absolute;
  inset: 0;
  z-index: 3;
  overflow: auto;
  background:
    radial-gradient(circle at 50% 0%, rgba(31, 111, 139, 0.055), transparent 55%),
    linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(250, 247, 239, 0.99));
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.future-card {
  width: min(920px, 100%);
  margin: 0 auto;
  padding: 36px 40px 44px;
}

.future-hero h1 {
  margin: 7px 0 12px;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: clamp(28px, 3.2vw, 42px);
  font-weight: 550;
  letter-spacing: -0.03em;
  line-height: 1.04;
}

.future-lead {
  max-width: 760px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.65;
}

.future-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.timeline-countdown {
  display: inline-flex;
  align-items: center;
  margin-top: 4px;
  padding: 4px 11px;
  border: 1px solid #e5cf9f;
  border-radius: 999px;
  background: #fff4dc;
  color: #76561b;
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.timeline-countdown.is-past {
  border-color: var(--line-strong);
  background: var(--paper-2);
  color: var(--muted);
}

.future-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 24px;
}

.future-facts .timeline-fact strong {
  overflow: visible;
  line-height: 1.3;
  text-overflow: clip;
  white-space: normal;
}

.timeline-fact-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.timeline-fact-main strong {
  min-width: 0;
  margin-top: 0;
}

.timeline-fact-main .timeline-countdown {
  flex: 0 0 auto;
  margin-top: 0;
}

.future-section {
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.future-section h2 {
  margin: 0 0 10px;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 550;
  letter-spacing: -0.025em;
  line-height: 1.12;
}

.future-section p {
  margin: 8px 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.65;
}

.future-timeline {
  margin: 12px 0 0;
  padding-left: 21px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.65;
}

.future-timeline li {
  margin: 10px 0;
  padding-left: 2px;
}

.future-timeline strong {
  color: var(--ink);
}

.future-note {
  margin-top: 14px !important;
  padding: 10px 12px;
  border: 1px solid #e8ddca;
  border-radius: 9px;
  background: #fbf6ea;
  color: #7b6c55 !important;
  font-size: 11px !important;
  line-height: 1.55 !important;
}

.future-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.future-grid > div {
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-2);
}

.future-grid strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 12px;
}

.future-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}

.future-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}

.future-source {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.55;
}

.future-source a {
  color: var(--teal);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.future-source a:hover {
  color: var(--accent-dark);
}

.stage-footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 38px;
  padding: 6px 12px 6px 15px;
  border-top: 1px solid var(--line);
  background: #fdfaf3;
}

.view-hint {
  overflow: hidden;
  color: var(--muted);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 250px;
  padding: 3px 7px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--paper-3);
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1;
}

.chip button:hover {
  background: var(--accent);
  color: #fff;
}

/* ------------------------------------------------------------------ */
/* Detail panel                                                        */
/* ------------------------------------------------------------------ */

.detail {
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.detail-inner {
  padding: 17px 17px 20px;
}

.detail-hero {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.detail-hero h2 {
  margin-top: 5px;
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 550;
  letter-spacing: -0.03em;
  line-height: 1.04;
}

.detail-hero .detail-sub {
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.detail-hero .detail-count {
  margin: 9px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.detail-hero .detail-count strong {
  color: var(--ink);
  font-size: 21px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.detail-hero .detail-count span {
  color: var(--muted);
}

.detail-topline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.rank-badge,
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.rank-badge {
  background: var(--dark);
  color: var(--cream);
}

.badge {
  background: var(--paper-2);
  color: var(--ink-soft);
  border: 1px solid var(--line);
}

.badge-qualified {
  background: #e5f0ec;
  border-color: #c4ded5;
  color: #236b5c;
}

.badge-under {
  background: #f6eee6;
  border-color: #e7d4c3;
  color: #8b5e42;
}

.badge-family {
  background: var(--badge-tint, var(--paper-2));
  border-color: var(--badge-line, var(--line));
  color: var(--badge-ink, var(--ink-soft));
}

.detail-section {
  padding-top: 14px;
}

.detail-section + .detail-section {
  margin-top: 2px;
}

.detail-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.detail-section h3 {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detail-section-head span {
  color: var(--muted);
  font-size: 10px;
}

.detail-copy {
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}

.howto {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 14px;
}

.howto-step {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.howto-step > span {
  padding-top: 1px;
  color: var(--accent);
  font-family: var(--font-serif);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.howto-step strong {
  display: block;
  color: var(--ink);
  font-size: 11.5px;
}

.howto-step p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.bar-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 8px;
  align-items: center;
}

.bar-label {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-value {
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.bar-track {
  grid-column: 1 / -1;
  height: 4px;
  overflow: hidden;
  border-radius: 4px;
  background: #eee8dc;
}

.bar-track i {
  display: block;
  height: 100%;
  min-width: 2px;
  border-radius: 4px;
  background: var(--bar-color, var(--teal));
}

.data-list {
  display: grid;
  gap: 0;
  margin: 14px 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.data-list > div {
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr);
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.data-list dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.data-list dd {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11.5px;
  overflow-wrap: anywhere;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 16px;
}

.detail-note {
  margin-top: 16px;
  padding: 9px 10px;
  border: 1px solid #e8ddca;
  border-radius: 9px;
  background: #fbf6ea;
  color: #7b6c55;
  font-size: 10.5px;
  line-height: 1.45;
}

.mini-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-top: 3px;
}

.timeline-table-wrap {
  margin-top: 4px;
  overflow-x: auto;
}

.timeline-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--ink-soft);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}

.timeline-table th {
  padding: 5px 4px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.055em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.timeline-table th + th,
.timeline-table td + td {
  padding-left: 8px;
}

.timeline-table td {
  padding: 5px 4px;
  border-bottom: 1px solid #f0eadf;
  vertical-align: top;
}

.timeline-table tr:last-child td {
  border-bottom: 0;
}

.timeline-table .is-number {
  text-align: right;
  white-space: nowrap;
}

.timeline-table tr.is-threshold td {
  color: var(--accent-dark);
  font-weight: 650;
}

.timeline-table .timeline-table-name {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 4px;
}

.timeline-fact {
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-2);
}

.timeline-fact span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.timeline-fact strong {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-fact small {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 9.5px;
}

.mini-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid #f0eadf;
  color: var(--ink-soft);
  font-size: 11px;
}

.mini-row:last-child {
  border-bottom: 0;
}

.mini-row span:last-child {
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.family-list-detail {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.family-line {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 11px;
}

.family-line .family-dot {
  width: 8px;
  height: 8px;
}

.family-line .family-count {
  margin-left: auto;
}

/* ------------------------------------------------------------------ */
/* Table modal                                                         */
/* ------------------------------------------------------------------ */

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 30, 33, 0.58);
  backdrop-filter: blur(2px);
}

.modal-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(1320px, 96vw);
  height: min(880px, 92vh);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 0 30px 80px rgba(10, 24, 28, 0.28);
}

.modal-head {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--line);
}

.modal-head > div:first-child {
  min-width: 0;
}

.modal-head h2 {
  margin-top: 3px;
  font-family: var(--font-serif);
  font-size: 25px;
  font-weight: 550;
  letter-spacing: -0.025em;
}

.modal-head-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.modal-head-actions .btn {
  min-height: 38px;
  padding: 8px 12px;
  white-space: nowrap;
}

.table-warning {
  flex: 0 0 auto;
  margin: 0;
  padding: 7px 18px;
  border-bottom: 1px solid #e5cf9f;
  background: #fff4dc;
  color: #76561b;
  font-size: 10.5px;
  line-height: 1.4;
}

.modal-toolbar {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--line);
  background: #fdfaf3;
}

.search-field--table {
  flex: 1 1 300px;
  width: auto;
  margin-top: 0;
}

.search-field--table input {
  height: 36px;
}

.table-chips {
  flex: 0 0 auto;
  min-height: 0;
  padding: 0 18px;
  justify-content: flex-start;
}

.table-chips:not(:empty) {
  padding-top: 9px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
}

.table-wrap {
  flex: 1 1 0;
  min-height: 0;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

#sponsor-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}

#sponsor-table thead {
  position: sticky;
  top: 0;
  z-index: 3;
}

#sponsor-table th {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-strong);
  background: #f4eee2;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

#sponsor-table th:hover {
  color: var(--ink);
  background: #efe7d8;
}

#sponsor-table th .sort-icon {
  display: inline-block;
  width: 8px;
  margin-left: 3px;
  color: var(--accent);
  font-size: 9px;
}

#sponsor-table td {
  padding: 7px 10px;
  border-bottom: 1px solid #f0eadf;
  color: var(--ink-soft);
  vertical-align: top;
}

#sponsor-table tbody tr {
  cursor: pointer;
}

#sponsor-table tbody tr:hover {
  background: #f7f2e8;
}

#sponsor-table tbody tr.is-highlighted {
  background: #fbe8d9;
  box-shadow: inset 3px 0 0 var(--accent);
}

#sponsor-table td.cell-candidate {
  color: var(--ink);
  font-weight: 600;
}

#sponsor-table td.cell-muted {
  color: #99a1a2;
}

.family-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.family-badge .family-dot {
  width: 7px;
  height: 7px;
}

.table-empty {
  padding: 50px 20px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.modal-foot {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 49px;
  padding: 8px 18px;
  border-top: 1px solid var(--line);
  background: #fdfaf3;
}

.table-meta {
  color: var(--muted);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pagination button {
  min-width: 29px;
  height: 28px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 10.5px;
}

.pagination button:hover:not(:disabled) {
  border-color: var(--muted);
  color: var(--ink);
}

.pagination button:disabled {
  cursor: default;
  opacity: 0.38;
}

.pagination .page-label {
  padding: 0 5px;
  color: var(--muted);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------ */
/* À propos                                                            */
/* ------------------------------------------------------------------ */

.about-panel {
  width: min(920px, 96vw);
  height: min(880px, 92vh);
}

.about-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 22px 30px 36px;
  overflow: auto;
  color: var(--ink-soft);
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.about-body:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.about-body > :first-child {
  margin-top: 0;
}

.about-body h1,
.about-body h2,
.about-body h3 {
  color: var(--ink);
  font-family: var(--font-serif);
  font-weight: 550;
  letter-spacing: -0.02em;
}

.about-body h1 {
  margin: 0 0 14px;
  font-size: 28px;
  line-height: 1.1;
}

.about-body h2 {
  margin: 28px 0 10px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 22px;
  line-height: 1.15;
}

.about-body h3 {
  margin: 22px 0 7px;
  font-size: 17px;
  line-height: 1.2;
}

.about-body p {
  margin: 9px 0;
  font-size: 13px;
  line-height: 1.65;
}

.about-body ul,
.about-body ol {
  margin: 9px 0 14px;
  padding-left: 23px;
  font-size: 13px;
  line-height: 1.6;
}

.about-body li {
  margin: 5px 0;
}

.about-body strong {
  color: var(--ink);
  font-weight: 700;
}

.about-body em {
  color: var(--ink-soft);
}

.about-body a {
  color: var(--teal);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.about-body a:hover {
  color: var(--accent-dark);
}

.about-body a.about-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-left: 5px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper-2);
  color: var(--muted);
  text-decoration: none;
  vertical-align: -0.35em;
  transition: color 120ms ease, border-color 120ms ease, background-color 120ms ease;
}

.about-body a.about-social-link svg {
  display: block;
  width: 11px;
  height: 11px;
}

.about-body a.about-social-link:hover {
  border-color: var(--teal);
  background: var(--teal);
  color: var(--paper);
}

.about-body a.about-social-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.about-body code {
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--paper-3);
  color: var(--ink-soft);
  font-size: 0.9em;
  overflow-wrap: anywhere;
}

.about-body blockquote {
  margin: 16px 0;
  padding: 10px 13px;
  border-left: 3px solid var(--accent);
  border-radius: 0 7px 7px 0;
  background: var(--paper-2);
  color: var(--ink-soft);
}

.about-body blockquote p {
  margin: 0;
}

.about-body hr {
  margin: 24px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

/* ------------------------------------------------------------------ */
/* Intersections                                                       */
/* ------------------------------------------------------------------ */

.intersection-summary {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper-2);
}

.intersection-zero {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.intersection-zero strong {
  color: var(--teal);
  font-size: 28px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  line-height: 1;
}

.intersection-zero span {
  color: var(--ink-soft);
  font-size: 10.5px;
  line-height: 1.3;
}

.intersection-mini {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.intersection-summary .btn {
  margin-top: 8px;
}

.intersections-panel {
  width: min(1000px, 96vw);
  height: min(900px, 92vh);
}

.intersections-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 22px 28px 32px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.intersections-body:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.intersections-hero {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.intersections-big-zero {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 4px;
}

.intersections-big-zero strong {
  color: var(--teal);
  font-family: var(--font-serif);
  font-size: 56px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
  line-height: 1;
}

.intersections-big-zero span {
  max-width: 430px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.35;
}

.intersections-lead {
  max-width: 760px;
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.55;
}

.intersection-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.intersection-fact {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper-2);
}

.intersection-fact strong {
  display: block;
  color: var(--ink);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.intersection-fact span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.3;
}

.intersections-section {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.intersections-section h3 {
  margin: 0 0 6px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.intersections-table-wrap {
  margin-top: 10px;
  overflow-x: auto;
}

.intersections-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--ink-soft);
  font-size: 11px;
}

.intersections-table th {
  padding: 6px 5px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.intersections-table td {
  padding: 7px 5px;
  border-bottom: 1px solid #f0eadf;
  vertical-align: top;
}

.intersections-table tr:last-child td {
  border-bottom: 0;
}

.intersection-person {
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
}

.intersection-candidate {
  margin-bottom: 4px;
}

.intersection-candidate:last-child {
  margin-bottom: 0;
}

.intersection-candidate strong {
  display: block;
  color: var(--ink);
  font-size: 11px;
}

.intersection-candidate span {
  display: block;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.3;
}

.intersection-status {
  display: inline-block;
  padding: 3px 6px;
  border: 1px solid #e8ddca;
  border-radius: 999px;
  background: #fbf6ea;
  color: #7b6c55;
  font-size: 9px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.intersection-status.is-strict {
  border-color: #c4ded5;
  background: #e5f0ec;
  color: #236b5c;
}

.intersections-source {
  margin: 20px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.4;
}

/* ------------------------------------------------------------------ */
/* Error                                                               */
/* ------------------------------------------------------------------ */

.share-toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 120;
  max-width: calc(100vw - 32px);
  padding: 10px 16px;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: var(--dark);
  color: var(--cream);
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
  pointer-events: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.share-toast.is-error {
  border-color: #e3b5c1;
  background: #7d2743;
  color: #fff7f9;
}

.app-error {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 100;
  max-width: 520px;
  padding: 12px 14px;
  border: 1px solid #b25d7c;
  border-radius: 10px;
  background: #fbeef2;
  color: #7d2743;
  font-size: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */

@media (max-width: 1220px) {
  .layout {
    grid-template-columns: 258px minmax(0, 1fr) 306px;
  }

  .topbar {
    gap: 18px;
  }

  .topbar-stats {
    gap: 14px;
  }

  .search-field--stage {
    width: 170px;
  }

  .stage-actions {
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .stage-head {
    flex-wrap: wrap;
    row-gap: 6px;
  }

  .view-switch button {
    padding: 4px 7px;
  }
}

@media (max-width: 1500px) {
  .search-field--stage {
    width: 160px;
  }
}

@media (max-width: 1140px) {
  .app {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .topbar {
    flex-wrap: wrap;
    padding: 14px 16px;
  }

  .brand {
    flex-basis: calc(100% - 160px);
  }

  .year-switcher-wrap {
    order: 2;
  }

  .topbar-stats {
    order: 3;
    width: 100%;
    padding-top: 3px;
  }

  .layout {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 10px;
  }

  .stage {
    order: 1;
    min-height: 74vh;
  }

  .sidebar {
    order: 2;
    max-height: 640px;
  }

  .candidate-list {
    max-height: 320px;
  }

  .sidebar-filters {
    max-height: 185px;
  }

  .detail {
    order: 3;
    max-height: none;
  }

  .app.pending-year .stage {
    min-height: 0;
  }

  .app.pending-year .canvas-wrap {
    min-height: 0;
  }

  .app.pending-year .future-view {
    position: relative;
    inset: auto;
    overflow: visible;
  }

  .app.pending-year .future-card {
    padding: 28px 24px 36px;
  }
}

@media (max-width: 700px) {
  .topbar {
    gap: 12px;
  }

  .about-label,
  .versions-label {
    display: none;
  }

  .btn-about {
    padding: 8px 10px;
  }

  .topbar-actions {
    gap: 6px;
  }

  .modal-head-actions {
    gap: 6px;
  }

  .modal-head-actions .btn {
    padding: 8px 10px;
  }

  .year-switcher-wrap {
    order: 2;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .year-switcher {
    width: 100%;
  }

  .year-btn {
    flex: 1 1 0;
  }

  .year-notice {
    padding: 7px 14px;
    font-size: 10.5px;
  }

  .topbar-stats {
    gap: 20px;
  }

  .stat span {
    font-size: 18px;
  }

  .stage-head {
    flex-wrap: wrap;
    align-items: center;
  }

  .stage-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: space-between;
    row-gap: 6px;
  }

  .view-switch {
    order: 0;
  }

  .view-switch button {
    padding: 4px 9px;
  }

  .search-field--stage {
    flex: 1 1 160px;
    width: auto;
  }

  .stage-count {
    order: 3;
  }

  .stage-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .view-hint {
    white-space: normal;
  }

  .chips {
    justify-content: flex-start;
  }

  .modal {
    padding: 0;
  }

  .modal-panel {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    border: 0;
  }

  .about-body {
    padding: 18px 18px 30px;
  }

  .future-card {
    padding: 24px 18px 34px;
  }

  .future-hero h1 {
    font-size: 30px;
  }

  .timeline-countdown {
    font-size: 26px;
  }

  .future-facts,
  .future-grid {
    grid-template-columns: 1fr;
  }

  .future-actions .btn {
    flex: 1 1 100%;
  }

  .intersections-body {
    padding: 16px 18px 26px;
  }

  .intersection-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .intersections-big-zero strong {
    font-size: 44px;
  }

  .intersections-table {
    min-width: 720px;
  }

  .modal-toolbar {
    align-items: stretch;
  }

  .select-label {
    flex: 1 1 150px;
    min-width: 0;
  }

  .modal-foot {
    flex-direction: column;
    align-items: flex-start;
    min-height: 0;
    padding: 6px 12px;
  }

  .pagination {
    width: 100%;
    flex-wrap: wrap;
    justify-content: space-between;
  }

  #sponsor-table {
    min-width: 820px;
  }
}

.versions-panel {
  width: min(960px, 96vw);
  height: min(880px, 92vh);
}

@media (max-width: 700px) {
  .versions-panel {
    width: 100vw;
    height: 100vh;
    border: 0;
    border-radius: 0;
  }
}

.versions-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 22px 30px 36px;
  overflow: auto;
  color: var(--ink-soft);
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.versions-body:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.versions-body > :first-child {
  margin-top: 0;
}

.versions-lead {
  max-width: 680px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.6;
}

.versions-body code {
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--paper-3);
  color: var(--ink-soft);
  font-size: 0.9em;
}

.versions-current {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 12px;
}

.versions-current strong {
  color: var(--ink);
  font-size: 15px;
}

.versions-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
}

.version-card {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-2);
}

.version-card.is-current {
  border-color: #c4ded5;
  background: #f4f8f5;
}

.version-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.version-number {
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.version-date {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.version-summary {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.55;
}

.version-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.version-section h2 {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.version-section ul {
  margin: 0;
  padding-left: 16px;
  color: var(--ink-soft);
  font-size: 11.5px;
  line-height: 1.55;
}

.version-section li + li {
  margin-top: 3px;
}

.version-tag {
  display: inline-block;
  margin-top: 8px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9.5px;
}

.versions-footer {
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.5;
}

.versions-footer a {
  color: var(--teal);
}

@media (max-width: 760px) {
  .versions-body {
    padding: 18px 18px 28px;
  }

  .version-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .version-card {
    padding: 16px;
  }
}

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