:root {
  --rail: #10242b;
  --rail-ink: #e7f1ef;
  --board: #e4eeef;
  --cell: #f7fbfa;
  --ink: #1c2b31;
  --muted: #4e6368;
  --line: #c5d4d6;
  --brass: #8a6a2f;
  --closed: #9f1239;
  --phosphor: #0e7c72;
  --focus: #1d4e89;
  --shadow: 0 18px 40px rgba(16, 36, 43, 0.12);
  font-family: "Atkinson Hyperlegible", "Avenir Next", sans-serif;
  color: var(--ink);
  background: var(--board);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--focus); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: white;
  padding: 8px 12px;
}
.skip:focus { top: 12px; z-index: 5; }

.rail {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 14px 22px;
  background: var(--rail);
  color: var(--rail-ink);
}
.mark-word {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: Syne, sans-serif;
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -0.04em;
  color: white;
  text-decoration: none;
}
.mark-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: block;
}
.rail-nav { display: flex; gap: 4px 14px; flex: 1; flex-wrap: wrap; align-items: center; }
.rail-nav a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--rail-ink);
  text-decoration: none;
  font-size: 14px;
  padding: 4px 0;
}
.rail-nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--phosphor); }
.nav-ico {
  width: 15px;
  height: 15px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.who { font-size: 13px; color: var(--rail-ink); }
.menu-toggle {
  display: none;
  margin-left: auto;
  background: transparent;
  color: white;
  border: 1px solid rgba(231, 241, 239, 0.45);
  padding: 6px 12px;
}
.rail-drawer { display: contents; }
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.iconbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 8px 22px 0;
}
.iconbar-group { display: flex; gap: 6px; }
.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 36px;
  min-height: 34px;
  justify-content: center;
  padding: 6px 8px;
  background: white;
  text-decoration: none;
  color: var(--ink);
}
.icon-btn svg { width: 18px; height: 18px; fill: currentColor; }
.icon-btn svg.stroke { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.icon-btn.is-on, .icon-btn[aria-pressed="true"] { background: var(--rail); color: white; }
.icon-btn em { font-style: normal; font-family: "IBM Plex Mono", monospace; font-size: 12px; }
#show-calls em {
  background: #dc3545;
  color: white;
  border-radius: 999px;
  min-width: 1.5em;
  padding: 0 5px;
  line-height: 16px;
  text-align: center;
}
.icon-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-left: auto; }
.icon-filter { display: flex; align-items: center; gap: 8px; margin-left: auto; font-size: 14px; }
.icon-filters .icon-filter { margin-left: 0; }
.icon-filter select { padding: 6px 8px; }
.check-filter { cursor: pointer; }
.mine-link { white-space: nowrap; }
.edit-hint { display: none; margin: 4px 22px 0; color: var(--muted); font-size: 13px; }
body[data-editing="1"] .edit-hint { display: block; }
.side-panel { padding: 8px 22px 16px; }
.side-panel ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.side-panel button { text-align: left; }
.pile .cell.is-dim { opacity: 0.18; }
.pile .cell.is-hole-off { visibility: hidden; }
.pile th.is-col-off, .pile td.is-col-off { display: none; }
.pile .cell.is-jump { outline: 3px solid var(--focus); outline-offset: -3px; }
body[data-editing="1"] .pile button.cell { cursor: pointer; }
body[data-editing="1"] .pile button.cell.is-filled:not(.is-pending):not(.is-rempla) { cursor: grab; }
body[data-editing="1"] .pile button.cell.is-filled:not(.is-pending):not(.is-rempla):hover { box-shadow: 0 2px 8px rgba(16, 36, 43, 0.28); }
body[data-editing="1"] .pile button.cell.is-ghost { cursor: grabbing; opacity: 0.45; }
.pile button.cell.is-drop { outline: 2px solid #0e7c72; outline-offset: -2px; }
.pile .cell:focus { outline: 2px solid #0e7c72; outline-offset: -2px; }
.pile button.cell { cursor: default; }
.drag-ghost {
  position: fixed;
  top: -200px;
  width: 76px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(16, 36, 43, 0.35);
  pointer-events: none;
}

.rail-out button, .quiet {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  color: var(--rail-ink);
  border: 0;
  cursor: pointer;
  text-decoration: none;
}
.toolbar .quiet { color: var(--focus); }

.flash {
  margin: 0;
  padding: 10px 22px;
  background: #d7efe8;
  color: #123f38;
}

.gate {
  max-width: 440px;
  margin: 10vh auto;
  padding: 36px;
  background: var(--cell);
  box-shadow: var(--shadow);
}
.eyebrow {
  margin: 0 0 8px;
  font-family: "Barlow Condensed", sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
h1 { font-family: Syne, sans-serif; font-size: 40px; line-height: 1; margin: 0 0 18px; }
.gate-form, .stack { display: grid; gap: 14px; }
label { display: grid; gap: 6px; font-size: 14px; }
input, select {
  border: 1px solid var(--line);
  background: white;
  padding: 10px 12px;
  border-radius: 0;
}
button, .primary {
  cursor: pointer;
  border: 1px solid var(--rail);
  background: white;
  padding: 10px 14px;
}
.primary { background: var(--rail); color: white; }
a.primary { text-decoration: none; display: inline-block; }

.toolbar, .month-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 22px 0;
}
.toolbar h1, .month-switch h1 { font-size: 32px; }
.toolbar-actions { display: flex; align-items: center; gap: 16px; padding-right: 22px; }
.step { font-size: 14px; }
.hint { margin: 8px 22px 0; color: var(--muted); max-width: 78rem; }
.empty { padding: 48px 22px; }
.legend {
  display: flex;
  gap: 18px;
  list-style: none;
  padding: 8px 22px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.legend li { display: flex; align-items: center; gap: 8px; }
.grid-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin: 8px 22px 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 13px;
}
.grid-legend li { display: flex; align-items: center; gap: 6px; }
.legend-people { display: flex; flex-wrap: wrap; gap: 4px; }
.legend-chip { display: inline-block; min-width: 28px; padding: 2px 5px; text-align: center; font-weight: 700; color: var(--ink); }
.mark {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 20px;
  background: white;
  border: 1px solid #dcdcdc;
}
.mark.is-closed { background: #f8fafc; }
.mark.is-closed .x { color: #cbd5e1; font-weight: 400; font-size: 12px; }
.mark.is-open { background: #fff7ed; outline: 1px dashed #e09a3e; outline-offset: -3px; }
.mark.is-open .picto { width: 14px; height: 14px; fill: #c2410c; }
.mark.is-locked::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 12px;
  height: 12px;
  background: #ffe14a;
  clip-path: polygon(40% 0, 100% 0, 100% 60%);
}
.mark.has-note::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #1d4e89;
}
.mark.has-history::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #b45309;
}

.board-scroll {
  overflow: auto;
  max-height: calc(100vh - 250px);
  margin: 0 12px 12px;
  border: 1px solid var(--line);
  background: white;
}
.board { border-collapse: separate; border-spacing: 0; }
.board th, .board td { padding: 0; }
.post-col {
  position: sticky;
  left: 0;
  z-index: 3;
  min-width: 168px;
  max-width: 190px;
  background: #f3f7f7;
  text-align: left;
  padding: 6px 10px !important;
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.01em;
  box-shadow: inset -1px 0 0 var(--line), inset 3px 0 0 var(--fam, var(--line));
}
.fam-mut { --fam: #1d4e89; }
.fam-m3 { --fam: #0e7c72; }
.fam-tele { --fam: #6b3fa0; }
.fam-gcs { --fam: #8a6a2f; }
.fam-garde { --fam: #9f1239; }
.post-col em {
  display: block;
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--closed);
}
.board thead th {
  position: sticky;
  background: #edf3f3;
  z-index: 2;
  font-weight: 500;
}
.board thead tr:first-child th { top: 0; height: 36px; }
.board thead tr:nth-child(2) th { top: 36px; height: 22px; }
.board thead .post-col { z-index: 4; }
.day-h { border-left: 2px solid var(--line); text-align: left; padding-left: 6px !important; }
.day-h.band { background: #e3eeea; }
.day-h.is-off, .shift-h.is-off { background: #efe4d4; }
.dow { display: block; font-family: "Barlow Condensed", sans-serif; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-size: 12px; }
.dom { font-family: "IBM Plex Mono", monospace; font-size: 14px; }
.shift-h {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  color: var(--muted);
  min-width: 36px;
}
.shift-m { border-left: 2px solid #b7c9ce; }

.cell {
  width: 36px;
  height: 32px;
  border: 0;
  background: var(--cell);
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.cell:hover { background: #e5f3f0; }
.cell.is-empty { background: #fbfefe; }
.cell.is-open { background: #fff6d8; }
.cell.is-hidden { background: transparent; border-color: transparent; }
.refused { text-decoration: line-through; color: var(--closed); }
body.is-abs .grid-legend, body.is-abs .edit-hint, body.is-abs .icon-filters { display: none; }
.abs-sheet { max-width: 980px; margin: 0 auto; }
.sheet.abs-sheet.is-admin { max-width: 1180px; }
.abs-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; }
.abs-sheet.is-admin .abs-layout { grid-template-columns: 220px minmax(0, 1fr); }
.abs-months {
  position: sticky;
  top: 12px;
  background: white;
  border: 1px solid #1c2b31;
  max-height: calc(100vh - 96px);
  display: flex;
  flex-direction: column;
}
.abs-months h2 {
  margin: 0;
  padding: 10px 12px;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 18px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid #1c2b31;
}
.abs-months ul { list-style: none; margin: 0; padding: 6px; overflow: auto; }
.abs-months a {
  display: block;
  padding: 7px 10px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.abs-months a[aria-current="page"] { background: #0d6efd; color: white; }
.abs-months a:hover { background: #e7f1ff; }
.abs-months a[aria-current="page"]:hover { background: #0b5ed7; color: white; }
.abs-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 36px; }
.abs-title { display: flex; align-items: center; justify-content: center; gap: 18px; }
.abs-title h1 { margin: 0; }
.abs-title .step { font-size: 28px; text-decoration: none; }
.abs-filters { display: flex; flex-wrap: wrap; justify-content: center; margin: 8px 0 12px; }
.abs-filters button {
  margin-left: -1px;
  border: 1px solid #c5d0d6;
  background: #f8fafc;
  color: var(--ink);
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 700;
}
.abs-filters button:first-child { margin-left: 0; border-radius: 4px 0 0 4px; }
.abs-filters button:last-child { border-radius: 0 4px 4px 0; }
.abs-filters button.is-on { background: #0d6efd; color: white; border-color: #0d6efd; position: relative; }
.abs-switches { display: flex; flex-wrap: wrap; gap: 14px 18px; align-items: center; }
.abs-switch { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.abs-switch input {
  -webkit-appearance: none;
  appearance: none;
  width: 38px;
  height: 22px;
  margin: 0;
  border-radius: 99px;
  background: #cbd5e1;
  position: relative;
  cursor: pointer;
}
.abs-switch input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
}
.abs-switch input:checked { background: #0d6efd; }
.abs-switch input:checked::after { left: 19px; }
.abs-deadline { display: flex; align-items: center; gap: 6px; margin: 0; color: #dc3545; font-weight: 700; }
.abs-deadline input { color: #dc3545; font-weight: 700; border-color: #dc3545; }
.abs-add-btn {
  border: 1px solid #0dcaf0;
  background: white;
  color: #087990;
  font-weight: 700;
  padding: 4px 12px;
}
.abs-hit {
  width: 100%;
  height: 100%;
  min-height: 28px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.abs-chip.is-off { display: none; }
.abs-dialog {
  border: 0;
  padding: 16px 18px;
  max-width: 420px;
  background: white;
  box-shadow: var(--shadow);
}
.abs-dialog::backdrop { background: rgba(16, 36, 43, 0.45); }
.abs-dialog h2 { font-size: 22px; margin: 0 0 12px; }
.abs-dialog label { margin-bottom: 10px; }
.abs-meta { margin: 0; font-weight: 700; }
.abs-meta span { color: var(--closed); }
.abs-scroll { overflow-x: auto; }
.abs-table { width: 100%; border-collapse: collapse; background: white; }
.abs-table th, .abs-table td { border: 1px solid #1c2b31; vertical-align: middle; }
.abs-week { text-align: center; font-weight: 700; background: #f8d7da; letter-spacing: 0.04em; text-transform: uppercase; border-top: 1px solid #000; border-bottom: 1px solid #000; }
.abs-day { width: 64px; background: #cfe2ff; text-align: center; }
.abs-last > th, .abs-last > td { border-bottom: 1px solid #000; }
.abs-shift { width: 36px; text-align: center; font-weight: 700; }
.abs-people { padding: 2px; }
.abs-count { width: 58px; text-align: center; font-weight: 700; background: #d1e7dd; }
.chip-form { display: inline; }
.abs-chip {
  display: inline-block;
  min-width: 28px;
  margin: 2px;
  padding: 4px 5px;
  border: 1px solid white;
  font-weight: 700;
  color: #1c2b31;
  text-align: center;
  cursor: default;
}
button.abs-chip { cursor: pointer; }
.abs-chip.is-fixed {
  background-image: repeating-linear-gradient(45deg, transparent, transparent 2px, rgba(0, 0, 0, 0.45) 2px, rgba(0, 0, 0, 0.45) 4px);
}
.abs-chip.is-dim { opacity: 0.18; }
.abs-chip.is-declined {
  background-image:
    linear-gradient(135deg, transparent calc(50% - 1px), #c1121f 50%, transparent calc(50% + 1px)),
    linear-gradient(45deg, transparent calc(50% - 1px), #c1121f 50%, transparent calc(50% + 1px));
}
.abs-chip.is-fixed.is-declined {
  background-image:
    repeating-linear-gradient(45deg, transparent, transparent 2px, rgba(0, 0, 0, 0.45) 2px, rgba(0, 0, 0, 0.45) 4px),
    linear-gradient(135deg, transparent calc(50% - 1px), #c1121f 50%, transparent calc(50% + 1px)),
    linear-gradient(45deg, transparent calc(50% - 1px), #c1121f 50%, transparent calc(50% + 1px));
}
.abs-add { margin-top: 18px; }
.abs-add summary { cursor: pointer; font-weight: 700; }
.cell.is-voluntary { background: repeating-linear-gradient(-45deg, #f7fbfa, #f7fbfa 4px, #eef4f3 4px, #eef4f3 5px); }
.cell.is-closed { background: #f6f1f1; }
.mark {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 22px;
  padding: 0 3px;
  background: var(--mark);
  color: white;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.04em;
}
.is-locked .mark { box-shadow: inset 0 -3px 0 var(--brass); }
.sample { pointer-events: none; }
.x, .free { font-family: "IBM Plex Mono", monospace; }
.x { color: var(--closed); font-size: 16px; }
.free { color: #1c2b31; }
.cell .picto { width: 16px; height: 16px; fill: currentColor; display: block; }
.sample-x { font-size: 16px; }

.editor-back[hidden] { display: none; }
.editor-back {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(16, 36, 43, 0.45);
}
.editor {
  width: min(920px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  background: white;
  padding: 16px 18px 18px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
}
.chooser-head { text-align: center; background: #eef6f6; border: 1px solid var(--line); padding: 8px 8px 4px; }
.chooser-head h2 { margin: 0; color: var(--closed); text-transform: uppercase; font-size: 22px; }
.chooser-head p { margin: 4px 0 8px; font-weight: 700; }
.chooser-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.chooser-actions button { font-size: 13px; font-weight: 700; }
.chooser { width: 100%; border-collapse: collapse; }
.chooser th, .chooser td { border: 1px solid var(--line); vertical-align: top; padding: 6px; width: 33%; }
.chooser th { text-align: center; font-size: 12px; text-transform: uppercase; }
.chooser th.parfaits, .chooser td.parfaits { background: #d1e7dd; }
.chooser th.dispos, .chooser td.dispos { background: #cff4fc; }
.chooser th.postes, .chooser td.postes { background: #fff3cd; }
.chooser th.postes_incompat, .chooser td.postes_incompat { background: #cfe2ff; }
.chooser th.autres, .chooser td.autres { background: #e9ecef; }
.chooser th.absents, .chooser td.absents { background: #f8d7da; }
.chip {
  display: inline-block;
  margin: 4px;
  padding: 4px 6px;
  font-weight: 700;
  color: #1c2b31;
  cursor: pointer;
  border: 0;
  box-shadow: 0 1px 3px rgba(16, 36, 43, 0.25);
}
.chip.is-current { outline: 2px solid #1c2b31; }
.chooser-ask { text-align: center; display: grid; gap: 12px; justify-items: center; }
.chooser-ask p { margin: 0; font-size: 18px; }
.editor .quiet { color: var(--focus); padding-left: 0; justify-self: start; }
.editor textarea { width: 100%; }

.sheet { padding: 22px; max-width: 960px; }
.sheet-stats { max-width: none; }
.sheet-stats h1 { margin-top: 0; }
.stat-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.stat-filters label { min-width: 10rem; }
.stat-period { font-weight: 700; }
.stat-chart { display: grid; gap: 8px; margin: 12px 0 20px; }
.stat-line {
  display: grid;
  grid-template-columns: minmax(12rem, 22rem) minmax(8rem, 1fr) 3.2rem;
  gap: 8px 12px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}
a.stat-line { grid-template-columns: minmax(12rem, 22rem) minmax(8rem, 14rem) minmax(8rem, 1fr) 3.2rem; }
.stat-who { font-weight: 700; }
.stat-note { color: var(--muted); font-size: 13px; }
.stat-track {
  position: relative;
  height: 18px;
  background: rgba(28, 43, 49, 0.06);
}
.stat-track::before {
  content: "";
  position: absolute;
  top: -3px;
  bottom: -3px;
  left: var(--mark);
  border-left: 2px dashed rgba(28, 43, 49, 0.35);
}
.stat-fill {
  display: block;
  height: 100%;
  background: rgba(255, 99, 132, 0.7);
}
.stat-fill.is-ok { background: rgba(75, 192, 192, 0.75); }
.stat-pct { font-weight: 700; }
.stat-wrap { overflow-x: auto; margin-top: 8px; }
.stats { width: max-content; min-width: 100%; border-collapse: collapse; background: white; font-size: 12px; }
.stats th, .stats td { border: 1px solid var(--line); padding: 4px 6px; text-align: center; white-space: nowrap; }
.stats th { background: #eef6f6; }
.badge-init { display: inline-block; padding: 2px 6px; font-weight: 700; color: #1c2b31; text-decoration: none; }
.is-low { color: #9f1239; font-weight: 700; }
.is-ok { color: #0e7c72; font-weight: 700; }
.sheet-stats h2 { display: flex; gap: 10px; align-items: center; }
.plain { width: 100%; border-collapse: collapse; background: white; margin: 16px 0 28px; }
.plain th, .plain td { border-bottom: 1px solid var(--line); text-align: left; padding: 8px 10px; vertical-align: middle; }
.inline { display: flex; gap: 10px; align-items: center; }
.check { display: flex; gap: 6px; align-items: center; }

.pile { font-size: 12px; --cell-w: 76px; --cell-h: 28px; }
.board.pile { table-layout: fixed; }
.board.pile thead tr:first-child th {
  top: 0;
  height: auto;
  min-height: 52px;
  white-space: normal;
}
.board.pile thead th.head-corner { background: #cfe2ff; z-index: 8; }
.pile thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  height: auto;
  padding: 6px 4px !important;
  font-size: 11px;
  line-height: 1.15;
  font-weight: 700;
  text-align: center;
  vertical-align: bottom;
  border: 1px solid #1c2b31;
}
.pile thead th.post-h {
  width: var(--cell-w);
  min-width: var(--cell-w);
  max-width: var(--cell-w);
  overflow-wrap: anywhere;
}
.pile thead th.post-h.is-priority { box-shadow: inset 0 -4px 0 #0b6bcb; }
.prio-form { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin: 0 0 16px; }
.prio-form .primary { margin-left: auto; }
.pile .head-corner { position: sticky; top: 0; left: 0; z-index: 8; min-width: 88px; background: #cfe2ff; }
.pile .day-sticky, .pile .shift-sticky {
  position: sticky;
  z-index: 4;
  border: 1px solid #1c2b31;
  text-align: center;
  font-weight: 700;
}
.pile tbody .day-sticky { border-bottom: 2px solid #1c2b31; }
.pile .day-sticky { left: 0; min-width: 54px; background: #cfe2ff; }
.pile .day-sticky.is-off { background: #f3e6c8; }
.pile .day-sticky.is-today,
.pile tr.is-today > .shift-sticky { background: #f9ff9e; box-shadow: inset 4px 0 0 #b45309; }
.pile tr.is-today > td { background: #fff8d6; }
.pile tr.is-today.shift-m > td { box-shadow: inset 0 2px 0 #e8c84a; }
.pile tr.is-today.day-end > td { box-shadow: inset 0 -2px 0 #e8c84a; }
.pile tr.day-end > th,
.pile tr.day-end > td { border-bottom: 2px solid #1c2b31; }
.pile .day-gap td {
  height: 10px;
  padding: 0;
  border: 0;
  background: var(--board);
}
.pile .shift-sticky { left: 54px; width: 34px; min-width: 34px; background: #fff3cd; }
.pile td { border: 1px solid #dcdcdc; padding: 0; background: white; }
.pile tr.shift-m > td,
.pile tr.shift-am > td,
.pile tr.shift-s > td {
  width: var(--cell-w);
  min-width: var(--cell-w);
  max-width: var(--cell-w);
  height: var(--cell-h);
  vertical-align: middle;
}
.pile .week-cut td {
  text-align: center;
  font-weight: 700;
  color: #1d4e89;
  background: white;
  border: 0;
  padding: 8px 0 2px;
  letter-spacing: 0.04em;
}
.pile .cell {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: var(--cell-h);
  margin: 0;
  padding: 0;
  border: 0;
  line-height: 1;
  position: relative;
  color: #1c2b31;
}
.pile .who-init { font-weight: 700; font-size: 12px; }
.pile .cell.is-closed { background: #f8fafc; }
.pile .cell.is-closed .x { color: #cbd5e1; font-size: 13px; font-weight: 400; }
.pile .cell.is-open {
  background: #fff7ed;
  box-shadow: inset 0 0 0 1.5px #e09a3e;
  background-image: linear-gradient(#fff7ed, #fff7ed);
}
.pile td:has(> .cell.is-open) { outline: 1px dashed #e09a3e; outline-offset: -2px; }
.pile .cell.is-open .picto { color: #c2410c; }
.pile .cell .clash {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  min-width: 12px;
  padding: 0 2px;
  background: #9f1239;
  color: white;
  font-size: 10px;
  font-weight: 700;
  line-height: 12px;
}
.mark.is-clash { color: #9f1239; font-weight: 700; background: white; }
.pile .cell.has-note::before {
  content: "";
  position: absolute;
  left: 3px;
  bottom: 3px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #1d4e89;
  pointer-events: none;
}
.pile .cell .hist {
  position: absolute;
  right: 2px;
  bottom: 2px;
  z-index: 2;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b45309;
  cursor: pointer;
}
.editor-history {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid #e5e7eb;
}
.editor-history h3 { margin: 0 0 6px; font-size: 14px; }
.editor-history ul { margin: 0; padding-left: 18px; max-height: 140px; overflow: auto; font-size: 13px; }
#history { width: min(640px, 94vw); }
#history .plain { font-size: 13px; }
.hover-tip {
  position: fixed;
  z-index: 30;
  max-width: 280px;
  background: #1c2b31;
  color: white;
  padding: 6px 8px;
  font-size: 12px;
  line-height: 1.35;
  white-space: pre-line;
  pointer-events: none;
}
.hover-tip[hidden] { display: none; }
@keyframes rempla-flash {
  0%, 100% { box-shadow: inset 0 0 0 0 rgba(255, 170, 0, 0); }
  50% { box-shadow: inset 0 0 0 100px rgba(255, 176, 0, 0.88); }
}
.pile .cell.is-pending { animation: rempla-flash 2.6s ease-in-out infinite; }
.pile button.cell.is-claim,
.pile button.cell.is-pending { cursor: pointer; }
@keyframes ap-beat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.22); }
}
#ap-admin.is-beat { color: #0dcaf0; }
#ap-admin.is-beat svg { animation: ap-beat 1s ease-in-out infinite; transform-origin: center; }
.ap-panel {
  width: min(860px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  background: white;
  padding: 12px 14px 16px;
  box-shadow: var(--shadow);
}
.ap-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ap-head h2 { margin: 0; text-transform: uppercase; font-size: 20px; letter-spacing: 0.04em; }
.ap-tabs { display: flex; gap: 0; margin: 12px 0; border-bottom: 1px solid var(--line); }
.ap-filter[hidden] { display: none; }
.ap-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 8px 12px;
  font-weight: 700;
  color: #6c757d;
}
.ap-filter.is-on { color: #1c2b31; border-bottom-color: #1c2b31; }
.ap-filter em {
  font-style: normal;
  background: #dc3545;
  color: white;
  border-radius: 999px;
  min-width: 18px;
  padding: 0 6px;
  font-size: 11px;
  line-height: 16px;
  text-align: center;
}
.ap-table { width: 100%; border-collapse: collapse; }
.ap-table th, .ap-table td { border: 1px solid #dee2e6; text-align: center; padding: 6px 8px; font-weight: 700; }
.ap-table thead th { background: #e9ecef; text-transform: uppercase; font-size: 12px; }
.ap-table tr[hidden] { display: none; }
.ap-people { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; }
.ap-person { display: inline-flex; align-items: center; gap: 4px; }
.ap-chip { display: inline-block; padding: 3px; margin: 2px; font-size: 12px; color: black; }
.rempla-jump, .rempla-valid { padding: 2px 8px; font-size: 12px; }
.pile .cell.is-locked::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 16px;
  height: 16px;
  background: #ffe14a;
  clip-path: polygon(40% 0, 100% 0, 100% 60%);
  pointer-events: none;
}
.pile .cell.sample { width: 36px; height: 22px; display: inline-grid; }

.mine { max-width: 640px; margin: 0 auto; padding: 8px 16px 48px; }
.mine-month { margin: 0 0 8px; font-family: Syne, sans-serif; font-size: 28px; }
.mine-who, .mine-pick label { display: flex; align-items: center; gap: 8px; }
.mine-pick select { padding: 6px 8px; }
.mine-list { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 8px; }
.mine-list li {
  display: grid;
  grid-template-columns: 72px 92px 1fr auto;
  gap: 8px;
  align-items: center;
  background: white;
  padding: 10px 12px;
  border-left: 4px solid transparent;
}
.mine-list li.is-today { border-left-color: #b45309; background: #fff8d6; }
.mine-when { font-family: "IBM Plex Mono", monospace; font-weight: 600; }
.mine-shift { color: var(--muted); font-size: 13px; }
.mine-post { padding: 6px 8px; font-weight: 700; }
.mine-flag { font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 560px) {
  .mine-list li { grid-template-columns: 72px 1fr; }
  .mine-post, .mine-flag { grid-column: 1 / -1; }
}
.tte { max-width: 760px; margin: 0 auto; padding: 12px 16px 32px; }
.tte h1 { text-align: center; text-transform: uppercase; font-size: 26px; }
.tte-switch { display: flex; justify-content: center; align-items: center; gap: 0; margin-bottom: 16px; }
.tte-switch a, .tte-switch span {
  border: 1px solid #1c2b31;
  background: #f8f9fa;
  color: #1c2b31;
  text-decoration: none;
  padding: 6px 14px;
  font-weight: 700;
  text-transform: uppercase;
}
.tte-table { width: 100%; border-collapse: collapse; background: white; }
.tte-table th, .tte-table td { border: 1px solid #1c2b31; text-align: center; padding: 7px 8px; }
.tte-table thead th { background: #f8f9fa; text-transform: uppercase; font-size: 13px; }
.tte-init { display: inline-block; min-width: 34px; padding: 3px 6px; font-weight: 700; }
.tte-table a { color: inherit; font-weight: 700; }
.delta-up { color: #157347; }
.delta-down { color: #9f1239; }
.clock { display: inline-flex; align-items: center; gap: 6px; justify-content: center; }
.clock form { margin: 0; }
.clock button { padding: 2px 8px; }

.model-page { padding: 22px 22px 48px; }
.model-head h1 { max-width: 18ch; }
.post-add { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-top: 12px; }
.post-add label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.post-add input[type="text"] { min-width: 16rem; }
.model-tabs, .dossier-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0 22px;
  border-bottom: 1px solid var(--line);
  margin: 8px 0 18px;
}
.model-tabs button, .dossier-tabs button {
  border: 0;
  background: transparent;
  padding: 10px 0 12px;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 18px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.model-tabs button[aria-selected="true"], .dossier-tabs button[aria-pressed="true"] {
  color: var(--ink);
  box-shadow: inset 0 -3px 0 var(--phosphor);
}
.model-pane[hidden], .dossier[hidden] { display: none; }
.model-lead { margin: 0 0 16px; max-width: 68rem; color: var(--muted); }
.ledger { display: grid; gap: 0; background: white; border: 1px solid var(--line); }
.ledger-head, .ledger-row {
  display: grid;
  gap: 10px 14px;
  align-items: center;
  padding: 8px 12px;
}
.ledger-head {
  font-family: "Barlow Condensed", sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 14px;
  color: var(--muted);
  background: #edf3f3;
  position: sticky;
  top: 0;
}
.ledger-row { border-top: 1px solid var(--line); }
.ledger-row:hover { background: #f7fbfa; }
.ledger-head.vac, .ledger-row.vac { grid-template-columns: minmax(11rem, 1.5fr) .7fr .45fr .8fr .9fr .7fr .7fr; min-width: 860px; }
.ledger-head.users, .ledger-row.users { grid-template-columns: minmax(11rem, 1.1fr) 1.3fr 1.3fr 1fr .8fr; min-width: 920px; }
.ledger-head.links, .ledger-row.links { grid-template-columns: minmax(11rem, 1fr) 1.15fr 1.15fr 1.15fr 1.15fr; min-width: 980px; }
.post-open {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  font-weight: 700;
}
.post-open i { width: 12px; height: 22px; flex: none; }
.mono { font-family: "IBM Plex Mono", monospace; font-size: 13px; }
.mono small { color: var(--muted); }
.pond { font-weight: 700; }
.cats, .tags, .initials { display: flex; flex-wrap: wrap; gap: 4px; }
.cats em, .tag {
  font-style: normal;
  font-size: 12px;
  padding: 2px 6px;
  background: #edf3f3;
}
.tag.is-stop { box-shadow: inset 3px 0 0 var(--closed); }
.tag.is-go { box-shadow: inset 3px 0 0 var(--phosphor); }
.initials b {
  min-width: 28px;
  padding: 2px 5px;
  text-align: center;
  font-size: 12px;
  color: var(--ink);
}
.bench { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.bench-col {
  padding: 14px;
  background: white;
  border: 1px solid var(--line);
}
.bench-col.is-first { box-shadow: inset 4px 0 0 var(--phosphor); }
.bench-col h2 {
  margin: 0 0 12px;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 22px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.bench-slot { display: grid; gap: 8px; }
.bench-empty { margin: 0 0 8px; color: var(--muted); }
.bench-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 10px;
  align-items: center;
  padding: 8px;
  background: var(--cell);
  border: 1px solid var(--line);
}
.bench-note { grid-column: 2; color: var(--muted); font-size: 13px; }
label.switch { display: block; position: relative; width: 44px; height: 22px; }
.switch input { position: absolute; opacity: 0; inset: 0; width: 44px; height: 22px; margin: 0; padding: 0; border: 0; }
.switch span { display: block; width: 44px; height: 22px; background: #d5e0e2; box-shadow: inset 0 0 0 1px #b7c6c9; }
.switch span::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 3px;
  left: 3px;
  background: white;
  box-shadow: 0 0 0 1px rgba(16, 36, 43, 0.18);
}
.switch input:checked + span { background: var(--phosphor); box-shadow: none; }
.switch input:checked + span::after { left: 25px; }
.switch input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.bench-form .primary { margin-top: 16px; }
.dossier {
  margin-top: 18px;
  padding: 16px 18px 20px;
  background: white;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  scroll-margin-top: 76px;
}
.dossier header { display: flex; align-items: center; gap: 16px; }
.dossier header .eyebrow { margin: 0; }
.dossier h2 {
  margin: 0;
  font-family: Syne, sans-serif;
  font-size: 28px;
  border-left: 8px solid var(--line);
  padding-left: 10px;
}
.dossier header button { margin-left: auto; }
.identity-page { max-width: 720px; }
.identity-hero { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; }
.identity-badge {
  display: grid;
  place-items: center;
  min-width: 76px;
  height: 76px;
  padding: 0 8px;
  border: 1px solid #1c2b31;
  font-family: Syne, sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: #1c2b31;
}
.identity-hero h1 { margin: 0; font-size: 36px; }
.identity-hero p { margin: 4px 0 0; color: var(--muted); }
.identity-form h2 { margin: 22px 0 10px; font-size: 22px; }
.identity-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.identity-span { grid-column: 1 / -1; }
.identity-note { margin: 0 0 8px; color: var(--muted); }
.identity-page > form > .check { margin-top: 12px; }
.color-pick { display: flex; align-items: center; gap: 8px; }
.color-pick input[type="color"] {
  width: 56px;
  height: 40px;
  padding: 3px;
  background: white;
  border: 1px solid var(--line);
  cursor: pointer;
}
.color-pick input[type="text"],
#color-hex {
  width: 7.5rem;
  font-family: "IBM Plex Mono", monospace;
}
.identity-form small { color: var(--muted); }
.identity-flags { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 14px; }
.identity-flags .check { display: flex; }
.fix-table { width: 100%; border-collapse: collapse; background: white; margin-top: 4px; }
.fix-table th, .fix-table td { border: 1px solid var(--line); text-align: center; padding: 6px 8px; }
.fix-table thead th { background: #eef6f6; }
.fix-table tbody th { background: white; font-weight: 700; }
.identity-actions { margin-top: 18px; }
.identity-side { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.fiche { display: grid; gap: 10px; margin: 0; }
.fiche div { display: grid; grid-template-columns: minmax(12rem, 18rem) 1fr; gap: 12px; }
.fiche dt { color: var(--muted); }
.fiche dd { margin: 0; }
.dossier-prio { font-size: 18px; margin: 0 0 12px; }
.poste-dialog {
  width: min(920px, calc(100vw - 24px));
  max-height: 90vh;
  padding: 0;
  border: 0;
  background: white;
  color: var(--ink);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.poste-dialog form { display: flex; flex-direction: column; max-height: 90vh; }
.poste-dialog::backdrop { background: rgba(16, 36, 43, 0.48); }
.poste-head, .poste-foot { display: flex; align-items: center; gap: 12px; padding: 12px 18px; }
.poste-head { background: var(--rail); color: white; }
.poste-head h2 { margin: 0; color: white; font-size: 26px; }
.poste-head button { margin-left: auto; color: white; background: transparent; border: 0; font-size: 32px; line-height: 1; padding: 0 4px; }
.poste-foot { justify-content: flex-end; background: #edf3f3; flex: none; }
.poste-body { overflow: auto; flex: 1 1 auto; min-height: 0; padding: 16px 18px 8px; }
.poste-block { margin: 0 0 18px; }
.poste-block h3, .role-head h4, .link-grid h4 {
  margin: 0;
  font-family: "Barlow Condensed", sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.poste-block h3 { padding: 8px; text-align: center; background: #e4eef2; font-size: 16px; }
.poste-grid { display: grid; grid-template-columns: 11rem 1fr; border: 1px solid var(--line); border-top: 0; }
.poste-grid > * { padding: 8px 10px; border-bottom: 1px solid var(--line); }
.poste-grid .k { background: #f7fbfa; }
.poste-grid input[type="text"], .poste-grid input[type="number"], .poste-grid select { padding: 6px 8px; width: auto; }
.poste-grid input[type="color"] { width: 48px; height: 32px; padding: 2px; }
.clock-line, .line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cats { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.role-head { display: flex; justify-content: space-between; align-items: center; margin: 12px 0 6px; }
.role-head button, .link-grid { font-size: 14px; }
.person-list { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; max-height: 240px; overflow: auto; padding: 4px 0 8px; }
.person-list b, .link-grid i { display: inline-block; min-width: 28px; padding: 2px 5px; text-align: center; font-style: normal; }
.link-grid i { width: 12px; min-width: 12px; height: 16px; padding: 0; }
.link-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.link-grid ul { list-style: none; margin: 0; padding: 8px; max-height: 220px; overflow: auto; border: 1px solid var(--line); }
.link-grid h4 { margin-bottom: 6px; font-size: 15px; }
.week-type { margin-top: 36px; }
.week-type h2 { font-family: Syne, sans-serif; font-size: 28px; }
.week-type .board td, .week-type .board th { padding: 6px 8px; white-space: nowrap; font-size: 13px; }

@media (max-width: 720px) {
  .rail { position: sticky; top: 0; z-index: 20; flex-wrap: nowrap; }
  .menu-toggle { display: inline-flex; }
  .rail-drawer {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 22px 16px;
    background: var(--rail);
  }
  .rail-drawer.is-open { display: flex; }
  .rail-nav { flex-direction: column; align-items: flex-start; }
  .toolbar, .month-switch { flex-direction: column; align-items: flex-start; }
  h1, .toolbar h1, .month-switch h1 { font-size: 28px; }
  .icon-filters { margin-left: 0; width: 100%; }
  .icon-filter { margin-left: 0; width: 100%; }
  .stat-filters { display: grid; grid-template-columns: 1fr 1fr; align-items: end; }
  .stat-filters label:first-child, .stat-filters button { grid-column: 1 / -1; }
  .stat-line, a.stat-line { grid-template-columns: 1fr auto; }
  .stat-note { grid-column: 1 / -1; }
  .stat-track { grid-column: 1 / -1; }
  .bench, .fiche div, .person-list, .link-grid, .poste-grid, .identity-grid { grid-template-columns: 1fr; }
  .abs-sheet.is-admin .abs-layout { grid-template-columns: 1fr; }
  .abs-months { position: static; max-height: 220px; }
  .identity-span { grid-column: auto; }
  .identity-hero h1 { font-size: 28px; }
  .ledger { overflow-x: auto; }
  .dossier header { align-items: flex-start; }
}

@media print {
  .rail, .iconbar, .legend, .hint, .editor, .editor-back, .flash, .side-panel, .rempla-desk { display: none !important; }
  .board-scroll { max-height: none; overflow: visible; border: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
  .pile .cell.is-pending { animation: none; box-shadow: inset 0 0 0 100px rgba(255, 176, 0, 0.72); }
  #ap-admin.is-beat svg { animation: none; }
}
