:root {
  --bg: #f6f4f0;
  --surface: #ffffff;
  --surface-2: #fbfaf7;
  --ink: #1d2126;
  --ink-2: #3b4148;
  --muted: #6d737b;
  --line: #e6e1d8;
  --line-strong: #d4cdc1;
  --warn: #c2410c;
  --warn-bg: #fff3eb;
  --danger: #b42318;
  --ok: #2e7d4f;
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.4;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  padding: 0 24px 40px;
}

button, input, select, textarea { font: inherit; color: inherit; }

button { cursor: pointer; }

[hidden] { display: none !important; }

.muted { color: var(--muted); }

.error { color: var(--danger); font-weight: 550; }

/* ---------- En-tête ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding: 16px 0 12px;
  background: var(--bg);
}

.brand { display: flex; align-items: center; gap: 10px; }

.brand h1 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }

.badge {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fde7c7;
  color: #8a4b08;
}

.period { display: flex; align-items: center; gap: 6px; }

.period h2 {
  margin: 0 4px;
  min-width: 170px;
  text-align: center;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 20px;
  line-height: 1;
  display: grid;
  place-items: center;
}

.icon:hover, .ghost:hover { border-color: var(--line-strong); background: var(--surface-2); }

.ghost {
  height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
}

.primary {
  height: 34px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  font-weight: 600;
}

.switch {
  display: inline-flex;
  padding: 3px;
  border-radius: 10px;
  background: #ebe7e0;
}

.switch button {
  border: 0;
  background: transparent;
  padding: 5px 12px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 550;
  color: var(--ink-2);
}

.switch button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.08);
}

.top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.sync { font-size: 12.5px; color: var(--muted); text-align: right; }

.sync .src { display: block; }

.sync .src.bad { color: var(--danger); font-weight: 550; }

.sync .dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: 1px;
  background: var(--ok);
}

.sync .bad .dot { background: var(--danger); }

.sync .off .dot { background: var(--line-strong); }

/* ---------- Palette ---------- */

.palette {
  position: sticky;
  top: var(--head-h, 60px);
  z-index: 15;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 10px 14px;
  margin-bottom: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.palette-label { font-weight: 650; font-size: 13px; }

.brushes { display: flex; flex-wrap: wrap; gap: 6px; }

.brush {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 11px 0 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 13px;
  font-weight: 560;
  white-space: nowrap;
}

.brush .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }

.brush kbd {
  font: 600 10.5px/1 var(--font);
  color: var(--muted);
  padding: 2px 4px;
  border-radius: 4px;
  background: #f1eee8;
}

.brush:hover { border-color: var(--c, var(--line-strong)); }

.brush[aria-pressed="true"] {
  background: var(--c);
  border-color: var(--c);
  color: #fff;
}

.brush[aria-pressed="true"] .dot { background: #fff; }

.brush[aria-pressed="true"] kbd { background: rgb(255 255 255 / 0.25); color: #fff; }

.brush.erase { --c: #5b6168; }

.brush.erase .dot { background: transparent; border: 1.5px dashed var(--muted); }

.hint { margin: 0; font-size: 12.5px; color: var(--muted); }

/* ---------- Bandeaux ---------- */

.setup {
  margin-bottom: 12px;
  padding: 14px 18px;
  border-radius: var(--radius);
  background: #fff8e8;
  border: 1px solid #f1dcaa;
}

.setup h3 { margin: 0 0 6px; font-size: 14px; }

.setup ol { margin: 0; padding-left: 20px; color: var(--ink-2); }

.setup li { margin: 3px 0; }

.setup code { font-size: 12.5px; background: #fff; padding: 1px 5px; border-radius: 4px; border: 1px solid #f1dcaa; }

.summary { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }

.stat {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-2);
}

.stat strong { font-size: 15px; color: var(--ink); font-variant-numeric: tabular-nums; }

.stat.warn { background: var(--warn-bg); border-color: #f6cfb4; }

.stat.warn strong { color: var(--warn); }

.stat.good strong { color: var(--ok); }

.link {
  border: 0;
  background: none;
  padding: 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------- Disposition ---------- */

.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }

.layout.with-panel { grid-template-columns: minmax(0, 1fr) 390px; }

.board { min-width: 0; }

/* ---------- Mois ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  user-select: none;
}

.dow {
  background: var(--surface-2);
  padding: 7px 10px;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.cell {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 118px;
  padding: 6px 7px 7px;
  background: var(--surface);
  cursor: pointer;
}

.cell:hover { background: #fdfcfa; }

.cell.weekend { background: var(--surface-2); }

.cell.out { background: #f9f7f3; }

.cell.out > * { opacity: 0.5; }

.cell.selected { box-shadow: inset 0 0 0 2px var(--ink); }

.cell-head { display: flex; align-items: center; justify-content: space-between; min-height: 24px; }

.daynum {
  border: 0;
  background: none;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
}

.daynum:hover { background: #efebe4; }

.today .daynum { background: var(--ink); color: #fff; }

.flag {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--warn);
  color: #fff;
  font-size: 11.5px;
  font-weight: 800;
}

.note-flag { font-size: 11px; color: var(--muted); font-weight: 600; }

.garde { display: flex; flex-direction: column; gap: 3px; }

.g {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 3px 7px;
  border-radius: 6px;
  border-left: 3px solid var(--c);
  background: color-mix(in srgb, var(--c) 15%, white);
  color: color-mix(in srgb, var(--c) 62%, black);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.g .slot { font-weight: 500; opacity: 0.8; margin-right: 4px; }

.g.empty {
  --c: transparent;
  border: 1px dashed var(--line-strong);
  background: transparent;
  color: var(--muted);
  font-weight: 500;
}

.g.conflict { box-shadow: 0 0 0 1.5px var(--warn); }

.evts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }

.evts li {
  font-size: 11.5px;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.evts time { color: var(--muted); font-variant-numeric: tabular-nums; margin-right: 4px; }

.evts .allday {
  background: #f0ece5;
  border-radius: 4px;
  padding: 0 5px;
}

.evts .busy-allday { background: #fbe2d3; color: #7a2e0b; }

.evts .more { color: var(--muted); font-weight: 600; }

.src-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 4px; vertical-align: 1px; background: var(--c); }

body.painting .day { cursor: cell; }

body.painting .grid, body.painting .list { touch-action: none; }

.out-of-range {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--muted);
}

/* ---------- Prochains mois ---------- */

.list {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: clip;
  user-select: none;
}

.list h3 {
  margin: 0;
  padding: 12px 16px 8px;
  font-size: 15px;
  font-weight: 700;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: var(--top-h, 64px);
  z-index: 2;
}

.row {
  display: grid;
  grid-template-columns: 76px minmax(170px, 270px) minmax(0, 1fr) 24px;
  gap: 12px;
  align-items: start;
  padding: 7px 16px;
  border-bottom: 1px solid #f0ece5;
  cursor: pointer;
}

.row:hover { background: #fdfcfa; }

.row.weekend { background: var(--surface-2); }

.row.quiet { padding-top: 3px; padding-bottom: 3px; }

.row.quiet .row-date { opacity: 0.55; }

.row.selected { box-shadow: inset 3px 0 0 var(--ink); background: #faf8f4; }

.row.week-start { border-top: 1px solid var(--line-strong); }

.row-date { display: flex; align-items: baseline; gap: 6px; font-variant-numeric: tabular-nums; }

.row-date .wd { width: 30px; color: var(--muted); font-size: 12.5px; }

.row-date .num { font-weight: 650; font-size: 14px; }

.row.today .row-date .num {
  background: var(--ink);
  color: #fff;
  border-radius: 999px;
  padding: 0 7px;
}

.row .evts { flex-direction: row; flex-wrap: wrap; gap: 4px 12px; padding-top: 2px; }

.row .evts li { font-size: 12.5px; max-width: 100%; }

/* ---------- Panneau du jour ---------- */

.panel {
  position: sticky;
  top: calc(var(--top-h, 64px) + 8px);
  max-height: calc(100vh - var(--top-h, 64px) - 24px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

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

.panel h3 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }

.panel h4 {
  margin: 18px 0 8px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.panel-tools { display: flex; align-items: center; gap: 4px; flex: none; }

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

.panel-tools .icon { width: 28px; height: 28px; font-size: 17px; }

.close { border: 0; background: none; font-size: 20px; line-height: 1; color: var(--muted); padding: 2px 4px; }

.mode { margin-bottom: 10px; }

.slot-row { margin-bottom: 10px; }

.slot-row > span { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }

.choices { display: flex; flex-wrap: wrap; gap: 5px; }

.choice {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 12.5px;
  font-weight: 560;
}

.choice .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }

.choice[aria-pressed="true"] { background: var(--c); border-color: var(--c); color: #fff; }

.choice[aria-pressed="true"] .dot { background: #fff; }

.choice.none { --c: #6d737b; }

.choice.none .dot { background: transparent; border: 1.5px dashed var(--muted); }

textarea {
  width: 100%;
  min-height: 64px;
  resize: vertical;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 13px;
}

textarea:focus, input:focus, select:focus { outline: 2px solid #9ab8f0; outline-offset: 0; border-color: transparent; }

.alerts { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }

.alert {
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--warn-bg);
  border: 1px solid #f6cfb4;
  color: #7a2e0b;
  font-size: 12.5px;
}

.agenda-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

.agenda-list li { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 8px; font-size: 13px; }

.agenda-list .when { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12.5px; }

.agenda-list .what { font-weight: 560; }

.agenda-list .where { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }

.agenda-list .free { font-weight: 400; color: var(--muted); font-size: 11.5px; margin-left: 4px; }

.empty-line { color: var(--muted); font-size: 13px; margin: 0; }

/* ---------- Dialogue personnes ---------- */

.dialog {
  width: min(560px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 20px 50px rgb(0 0 0 / 0.18);
}

.dialog::backdrop { background: rgb(20 22 25 / 0.35); }

.dialog h3 { margin: 0 0 4px; font-size: 16px; }

.dialog .muted { margin: 0 0 14px; font-size: 13px; }

.people-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }

.person-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) 150px 32px; gap: 8px; align-items: center; }

.person-row input[type="color"] { width: 36px; height: 32px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }

.person-row input[type="text"], .person-row select {
  height: 32px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  min-width: 0;
}

.person-row .remove { height: 32px; border: 0; background: none; color: var(--muted); font-size: 18px; }

.person-row .remove:hover { color: var(--danger); }

.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* ---------- Notification ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  padding: 9px 16px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 550;
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.2);
  z-index: 50;
}

.toast.bad { background: var(--danger); }

/* ---------- Palette : filles, personnes, demande ---------- */

.palette { flex-direction: column; align-items: stretch; gap: 6px; }

.palette-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }

.palette-label.sep { margin-left: 4px; padding-left: 14px; border-left: 1px solid var(--line); }

.ask {
  margin-left: auto;
  height: 30px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--ink);
  background: var(--surface);
  font-size: 13px;
  font-weight: 650;
}

.ask:hover { background: var(--surface-2); }

.ask[aria-pressed="true"] { background: var(--ink); color: #fff; }

.brush.copy { --c: #1d2126; border-style: dashed; }

.switch .count {
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--warn);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

/* ---------- Créneaux dans les cases ---------- */

.g .who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.g .kid {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
  margin-right: 5px;
  border-radius: 4px;
  background: var(--ink);
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
}

.g .kid + .kid { margin-left: -2px; }

.g .slot { flex: none; }

.g .st { flex: none; margin-left: auto; padding-left: 5px; font-weight: 800; }

.g.is-demande {
  border-left-style: dashed;
  background: repeating-linear-gradient(135deg,
    color-mix(in srgb, var(--c) 8%, white) 0 5px,
    color-mix(in srgb, var(--c) 20%, white) 5px 10px);
}

.g.is-accepte .st { color: var(--ok); }

.g.is-refuse { background: #f1eee9; color: var(--muted); border-left-color: #c9c2b6; }

.g.is-refuse .who { text-decoration: line-through; }

.g.is-refuse .st { color: var(--danger); }

.more-g { font-size: 11px; font-weight: 600; color: var(--muted); }

.cell.picked { background: #eef4ff; box-shadow: inset 0 0 0 2px #2f6fde; }

.row.picked { background: #eef4ff; box-shadow: inset 3px 0 0 #2f6fde; }

/* ---------- Panneau : nouvelle demande ---------- */

.rq-field { margin-top: 12px; }

.rq-field > span { display: block; margin-bottom: 5px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }

.rq-field .who-select { width: 100%; }

.rq-default { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }

.rq-times, .rq-slot { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }

.rq-day { padding: 10px 0; border-top: 1px solid #f0ece5; }

.rq-day-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }

.rq-day-head strong { flex: 1; font-size: 13.5px; }

.rq-day-head .link { font-size: 12px; }

.rq-existing { margin: 0 0 6px; font-size: 12px; color: var(--muted); }

.rq-slot { flex-wrap: wrap; margin-bottom: 6px; padding: 6px 8px; border: 1px dashed #e2b75d; border-radius: 9px; background: #fffaf0; }

.rq-whole { color: var(--ink-2); font-weight: 600; }

.rq-slot .remove { margin-left: auto; border: 0; background: none; color: var(--muted); font-size: 18px; line-height: 1; }

.rq-slot .remove:hover { color: var(--danger); }

.kid-toggles { display: inline-flex; gap: 4px; }

.kid-toggle {
  padding: 2px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
}

.kid-toggle[aria-pressed="true"] { background: var(--ink-2); border-color: var(--ink-2); color: #fff; }

.rq-warn .alert { margin-top: 6px; }

.rq-footer {
  position: sticky;
  bottom: -16px;
  margin: 8px -16px -16px;
  padding: 12px 16px 16px;
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.rq-footer .error { margin: 0 0 8px; font-size: 13px; }

.rq-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- Panneau : créneaux ---------- */

.garde-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 16px 0 4px; }

.garde-head h4 { margin: 0; }

.switch.small button { padding: 3px 9px; font-size: 12px; }

.group { padding: 10px 0 6px; }

.group + .group { border-top: 1px solid #f0ece5; }

.group h5 { margin: 0 0 6px; font-size: 13px; font-weight: 700; }

.group > .switch.small { margin-bottom: 8px; }

.statut-line { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }

.panel select, .panel input[type="time"] {
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  font-size: 13px;
}

.slot-line {
  margin-bottom: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
}

.slot-line.is-demande { border-style: dashed; border-color: #e2b75d; }

.slot-line.is-refuse { opacity: 0.7; }

.slot-times { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }

.slot-times .remove { margin-left: auto; border: 0; background: none; color: var(--muted); font-size: 18px; }

.slot-times .remove:hover { color: var(--danger); }

.slot-who { display: flex; gap: 6px; margin-top: 6px; }

.slot-who select { flex: 1; min-width: 0; }

.panel .who-select { border-left: 4px solid var(--c); }

input.invalid { outline: 2px solid var(--danger); }

.link.add { margin-top: 2px; }

.panel-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

.panel-actions .ghost { height: 30px; font-size: 12.5px; }

/* ---------- Semaine type ---------- */

.semaine { display: flex; flex-direction: column; gap: 14px; max-width: 1100px; }

.st-apply {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.st-apply h3 { margin: 0 0 4px; font-size: 15px; }

.st-apply .muted { margin: 0; font-size: 12.5px; max-width: 520px; }

.st-apply-row { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; }

.st-apply-row label { display: flex; align-items: center; gap: 6px; }

.semaine input[type="date"], .semaine input[type="time"], .semaine select {
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  font-size: 13px;
}

.st-grid {
  display: grid;
  grid-template-columns: 130px repeat(var(--kids), minmax(0, 1fr));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.st-head {
  padding: 8px 12px;
  background: #f1eee9;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.st-day, .st-cell { padding: 10px 12px; border-top: 1px solid var(--line); }

.st-cell { min-width: 0; border-left: 1px solid var(--line); }

.st-day { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }

.st-day strong { font-size: 14px; }

.st-day .link { font-size: 12px; text-align: left; }

.st-line { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; font-size: 12.5px; color: var(--muted); }

.st-line .who-select { flex: 1 1 130px; min-width: 120px; border-left: 4px solid var(--c); color: var(--ink); }

.st-whole { color: var(--ink-2); font-weight: 600; }

.st-line .remove { border: 0; background: none; color: var(--muted); font-size: 18px; line-height: 1; }

.st-line .remove:hover { color: var(--danger); }

.semaine > .link { align-self: flex-start; }

/* ---------- Frise horaire ---------- */

.tl { margin-top: 12px; display: flex; flex-direction: column; gap: 4px; }

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

.tl-label { font-size: 11.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tl-track { position: relative; height: 22px; border-radius: 6px; background: #f4f1ec; overflow: hidden; }

.tl-row.agenda .tl-track { height: 12px; }

.tl-row.scale .tl-track { height: 14px; background: none; overflow: visible; }

.tl-seg {
  position: absolute;
  top: 0;
  bottom: 0;
  padding: 0 4px;
  border-left: 2px solid var(--c);
  background: color-mix(in srgb, var(--c) 28%, white);
  color: color-mix(in srgb, var(--c) 60%, black);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 22px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tl-seg.whole { opacity: 0.75; }

.tl-seg.empty { background: repeating-linear-gradient(135deg, #eee9e1 0 4px, #e2dcd2 4px 8px); color: var(--muted); }

.tl-seg.is-demande {
  background: repeating-linear-gradient(135deg,
    color-mix(in srgb, var(--c) 12%, white) 0 4px,
    color-mix(in srgb, var(--c) 30%, white) 4px 8px);
}

.tl-seg.is-refuse { background: #ece8e2; color: var(--muted); border-left-color: #c9c2b6; text-decoration: line-through; }

.tl-ev { position: absolute; top: 2px; bottom: 2px; border-radius: 3px; background: #cfc9bf; }

.tl-ev.busy { background: #6d737b; }

.tl-ev.allday { opacity: 0.35; }

.tl-tick { position: absolute; transform: translateX(-50%); font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- Demandes ---------- */

.requests { display: flex; flex-direction: column; gap: 12px; max-width: 1000px; }

.section-title { margin: 6px 0 0; font-size: 14px; font-weight: 700; color: var(--ink-2); }

.req {
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--c);
  border-radius: var(--radius);
}

.req header { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; }

.req header .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }

.req h3 { margin: 0; font-size: 15px; }

.req header .muted { font-size: 12.5px; }

.tags { display: flex; gap: 6px; margin-left: auto; }

.tag { padding: 2px 8px; border-radius: 999px; background: #f0ece5; font-size: 11.5px; font-weight: 650; }

.tag.is-demande { background: #fff1d6; color: #8a5a00; }

.tag.is-accepte { background: #e3f3e8; color: var(--ok); }

.tag.is-refuse { background: #fde4e1; color: var(--danger); }

.req ul { list-style: none; margin: 10px 0; padding: 0; }

.req li {
  display: grid;
  grid-template-columns: 120px 110px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px solid #f3efe8;
  font-size: 13px;
}

.req li.past { opacity: 0.55; }

.req .when { text-align: left; }

.req .kids { color: var(--muted); }

.st-group { display: inline-flex; gap: 4px; }

.st-btn {
  height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
}

.st-btn.is-accepte[aria-pressed="true"] { background: var(--ok); border-color: var(--ok); color: #fff; }

.st-btn.is-refuse[aria-pressed="true"] { background: var(--danger); border-color: var(--danger); color: #fff; }

.st-btn.is-demande[aria-pressed="true"] { background: #f3b23a; border-color: #f3b23a; color: #3b2500; }

.req footer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.req footer .danger { margin-left: auto; color: var(--danger); }

.empty-state {
  max-width: 580px;
  padding: 26px 28px;
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}

.empty-state h3 { margin: 0 0 6px; }

.empty-state p { margin: 0; color: var(--ink-2); }

.stat.pending { background: #fff8e6; border-color: #f1dcaa; }

.stat.pending strong { color: #8a5a00; }

/* ---------- Message ---------- */

.dialog.wide { width: min(640px, calc(100vw - 32px)); }

.msg-tone { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 13px; font-weight: 600; }

#msg-text { min-height: 250px; background: var(--surface); font-size: 13.5px; line-height: 1.5; }

.btn-link { display: inline-flex; align-items: center; text-decoration: none; color: var(--ink); }

.dialog-actions { flex-wrap: wrap; }

/* ---------- Écrans étroits ---------- */

@media (max-width: 1100px) {
  .layout.with-panel { grid-template-columns: minmax(0, 1fr); }
  .panel { position: static; max-height: none; }
  .hint { margin-left: 0; width: 100%; }
}

@media (max-width: 760px) {
  body { padding: 0 10px 30px; }
  .cell { min-height: 92px; padding: 4px; }
  .evts { display: none; }
  .g { font-size: 11px; padding: 2px 4px; }
  .row { grid-template-columns: 64px minmax(0, 1fr); }
  .row .evts { display: flex; grid-column: 2; }
  .row > .flag-col { display: none; }
  .top-right { margin-left: 0; }
}

/* ---------- Connexion ---------- */

.login-page { display: grid; place-items: center; min-height: 100vh; padding: 24px; }

.login-card {
  width: min(380px, 100%);
  padding: 28px 24px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.06);
}

.login-card h1 { margin: 0 0 16px; font-size: 19px; font-weight: 700; }

.login-card .muted { font-size: 13px; }

.login-card .small { margin: 14px 0 0; font-size: 12px; }

.login-form { display: flex; flex-direction: column; gap: 12px; }

.login-form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--ink-2); }

.login-form input {
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
  font-size: 15px;
}

.login-form .primary { height: 40px; margin-top: 4px; }

.login-form .error { margin: 0; font-size: 13px; }

.login-card .lien {
  align-self: flex-start;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 550;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.login-form .muted { margin: 0; line-height: 1.45; }
