/* Rédac — atelier d'articles de l'agence */
:root {
  --bg: #edf0f2;
  --surface: #ffffff;
  --surface-2: #f6f8f9;
  --ink: #16212b;
  --ink-2: #33414e;
  --muted: #5b6875;
  --line: #d9dfe4;
  --line-2: #e7ebee;
  --accent: #0b6e6a;
  --accent-hover: #085a57;
  --accent-soft: #dcefec;
  --accent-ink: #ffffff;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --warn: #9a4a06;
  --warn-soft: #fdf1e3;
  --ok: #2f7d32;
  --ok-soft: #e5f3e6;

  --st-idee: #6b5bd6;
  --st-a_relire: #b06d00;
  --st-valide: #0b6e6a;
  --st-programme: #2457c5;
  --st-publie: #2f7d32;
  --st-brouillon_wp: #6b7280;

  --ui: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --r-sm: 6px;
  --r: 10px;
  --shadow: 0 1px 2px rgba(22, 33, 43, 0.06), 0 4px 16px rgba(22, 33, 43, 0.05);
  --rail: 236px;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--ui);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Structure ───────────────────────────── */
.shell { display: grid; grid-template-columns: var(--rail) 1fr; min-height: 100vh; }
.rail {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--ink); color: #dfe6eb; padding: 20px 14px 24px;
  display: flex; flex-direction: column; gap: 22px;
}
.brand { display: flex; align-items: baseline; gap: 8px; padding: 0 8px; text-decoration: none; color: #fff; }
.brand b { font: 600 26px/1 var(--serif); letter-spacing: -0.01em; }
.brand span { font-size: 12px; color: #9fb0bd; }
.rail nav { display: flex; flex-direction: column; gap: 2px; }
.rail a.nav {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm);
  color: #dfe6eb; text-decoration: none; font-weight: 500;
}
.rail a.nav:hover { background: rgba(255, 255, 255, 0.07); }
.rail a.nav[aria-current="page"] { background: rgba(255, 255, 255, 0.12); color: #fff; }
.rail .group { font-size: 12px; color: #9fb0bd; padding: 0 10px; margin-bottom: 4px; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--c, #8aa); }
.rail .add { color: #9fd9d3; }
.rail .me { margin-top: auto; padding: 0 10px; font-size: 13px; color: #9fb0bd; }
.rail .me button { background: none; border: 0; color: #9fd9d3; padding: 0; cursor: pointer; text-decoration: underline; }
.main { min-width: 0; padding: 28px 36px 64px; }
.topbar-mobile { display: none; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: fixed; inset: 0 30% 0 0; z-index: 30; transform: translateX(-102%); transition: transform 0.2s; height: 100%; }
  .rail.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.35); }
  .topbar-mobile { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 20; }
  .topbar-mobile button { background: none; border: 0; color: #fff; font-size: 22px; padding: 2px 6px; }
  .topbar-mobile b { font: 600 20px var(--serif); }
  .main { padding: 18px 16px 48px; }
}

/* ── Titres et texte ─────────────────────── */
h1, h2, h3 { margin: 0; line-height: 1.2; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; margin-bottom: 22px; }
.page-head h1 { font: 600 30px/1.15 var(--serif); letter-spacing: -0.01em; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.page-head .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.page-head .actions select { width: auto; min-width: 180px; }
h2.section { font: 600 18px var(--ui); margin: 30px 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hint { font-size: 13px; color: var(--muted); margin: 4px 0 0; }

/* ── Boutons ─────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 14px; border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-weight: 600; font-size: 14px;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: #b9c3cb; background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--accent); }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); border-color: #f1b8b2; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn .spin, .spin {
  width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent;
  animation: spin 0.8s linear infinite; display: inline-block; flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2.5s; } }

/* ── Champs ──────────────────────────────── */
label.field { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 13px; color: var(--ink-2); }
label.field > span.lbl { display: flex; justify-content: space-between; gap: 8px; }
.count { font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.count.bad { color: var(--warn); }
input[type="text"], input[type="url"], input[type="password"], input[type="search"], input[type="number"], input[type="datetime-local"], input[type="time"], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); font-weight: 400; font-size: 14px;
}
textarea { resize: vertical; min-height: 70px; line-height: 1.45; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 700px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 4px 11px;
  font-size: 13px; font-weight: 500; cursor: pointer; color: var(--ink-2);
}
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip:hover { border-color: #b9c3cb; }

/* ── Panneaux ────────────────────────────── */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.panel + .panel { margin-top: 16px; }
.panel h3 { font-size: 15px; margin-bottom: 10px; }
.empty { text-align: center; padding: 42px 20px; color: var(--muted); }
.empty h3 { font: 600 20px var(--serif); color: var(--ink); margin-bottom: 6px; }
.empty .btn { margin-top: 14px; }
.notice { border-radius: var(--r-sm); padding: 10px 12px; font-size: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.notice.warn { background: var(--warn-soft); border-color: #f2c99a; color: #6b3404; }
.notice.ok { background: var(--ok-soft); border-color: #b6dbb8; color: #1d4f20; }
.notice.err { background: var(--danger-soft); border-color: #f1b8b2; color: #7a1a12; }

/* ── Pastilles de statut ─────────────────── */
.status {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600;
  color: var(--s); white-space: nowrap;
}
.status::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--s); }
.status[data-s="idee"] { --s: var(--st-idee); }
.status[data-s="a_relire"] { --s: var(--st-a_relire); }
.status[data-s="valide"] { --s: var(--st-valide); }
.status[data-s="programme"] { --s: var(--st-programme); }
.status[data-s="publie"] { --s: var(--st-publie); }
.status[data-s="brouillon_wp"] { --s: var(--st-brouillon_wp); }
.flag { font-size: 12px; font-weight: 600; color: var(--warn); background: var(--warn-soft); border-radius: 4px; padding: 1px 6px; }

/* ── Accueil ─────────────────────────────── */
.clients { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.client-card {
  display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px 16px 14px; text-decoration: none; color: inherit; position: relative; overflow: hidden;
}
.client-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c, var(--accent)); }
.client-card:hover { border-color: #b9c3cb; box-shadow: var(--shadow); }
.client-card h3 { font: 600 19px var(--serif); }
.client-card .host { font-size: 13px; color: var(--muted); }
.tally { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 14px 0 10px; }
.tally div { display: flex; flex-direction: column; }
.tally b { font: 600 20px var(--ui); font-variant-numeric: tabular-nums; }
.tally span { font-size: 11.5px; color: var(--muted); }
.next { font-size: 13px; color: var(--ink-2); border-top: 1px solid var(--line-2); padding-top: 9px; }

.agenda { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.agenda-day { display: grid; grid-template-columns: 112px minmax(0, 1fr); border-top: 1px solid var(--line-2); }
.agenda-day:first-child { border-top: 0; }
.agenda-day > .d { padding: 12px 14px; font-weight: 600; font-size: 13px; color: var(--ink-2); }
.agenda-day > .d small { display: block; font-weight: 500; color: var(--muted); }
.agenda-day ul { list-style: none; margin: 0; padding: 6px 0; }
.agenda-day li a { display: flex; align-items: center; gap: 10px; padding: 6px 14px; text-decoration: none; color: var(--ink); }
.agenda-day li a:hover { background: var(--surface-2); }
.agenda-day li a > * { min-width: 0; }
.agenda-day li .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 600px) { .agenda-day { grid-template-columns: minmax(0, 1fr); } .agenda-day > .d { padding-bottom: 0; } }

/* ── Fiche client ────────────────────────── */
.client-head { display: flex; align-items: center; gap: 12px; }
.client-head .dot { width: 14px; height: 14px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 0 0 20px; overflow-x: auto; }
.tabs a {
  padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14px;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.selbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: 10px;
  background: var(--ink); color: #fff; border-radius: var(--r-sm);
}
.selbar .btn { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.3); }
.selbar .btn:hover { background: rgba(255, 255, 255, 0.1); }
.selbar .btn.primary { background: #fff; color: var(--ink); border-color: #fff; }

table.list { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
table.list th { text-align: left; font-size: 12.5px; color: var(--muted); font-weight: 600; padding: 9px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
table.list td { padding: 10px 12px; border-top: 1px solid var(--line-2); vertical-align: middle; font-size: 14px; }
table.list tr:first-child td { border-top: 0; }
table.list tr:hover td { background: #fafbfc; }
table.list .ttl a { color: var(--ink); text-decoration: none; font-weight: 600; }
table.list .ttl a:hover { color: var(--accent); text-decoration: underline; }
table.list .kw { font-size: 12.5px; color: var(--muted); }
table.list .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
table.list .w-check { width: 36px; }
table.list input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); }
@media (max-width: 760px) {
  table.list thead { display: none; }
  table.list tr { display: grid; grid-template-columns: 36px 1fr; padding: 8px 0; border-top: 1px solid var(--line-2); }
  table.list td { border: 0; padding: 3px 10px; }
  table.list td.w-check { grid-row: span 4; }
}

.progress { margin: 10px 0 14px; }
.progress .bar { height: 6px; background: var(--line-2); border-radius: 3px; overflow: hidden; }
.progress .bar i { display: block; height: 100%; background: var(--accent); width: 0; transition: width 0.3s; }
.progress p { margin: 6px 0 0; font-size: 13px; color: var(--muted); }

/* Idées */
.ideas { display: grid; gap: 10px; }
.idea {
  display: grid; grid-template-columns: 26px 1fr auto; gap: 12px; align-items: start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px;
}
.idea.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.idea input[type="checkbox"] { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--accent); }
.idea h4 { font: 600 17px/1.3 var(--serif); margin: 0 0 4px; }
.idea .meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.idea .meta b { color: var(--ink-2); font-weight: 600; }
.idea p { margin: 2px 0; font-size: 14px; color: var(--ink-2); }
@media (max-width: 640px) { .idea { grid-template-columns: 26px 1fr; } .idea > .btn { grid-column: 2; justify-self: start; } }

/* Contenus du site */
.inv-item { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line-2); }
.inv-item:first-child { border-top: 0; }
.inv-item .t { font-weight: 600; }
.inv-item .u { font-size: 12.5px; color: var(--muted); word-break: break-all; }

/* ── Éditeur ─────────────────────────────── */
.editor-top {
  position: sticky; top: 0; z-index: 10; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  margin: -28px -36px 20px; padding: 12px 36px; background: rgba(237, 240, 242, 0.94); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.editor-top .crumb { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; }
.editor-top .crumb a { color: var(--muted); text-decoration: none; }
.editor-top .crumb a:hover { color: var(--ink); }
.editor-top .save-state { font-size: 13px; color: var(--muted); }
.editor-top .save-state.dirty { color: var(--warn); }
.editor-top .spacer { flex: 1; }
@media (max-width: 860px) { .editor-top { margin: -18px -16px 16px; padding: 10px 16px; top: 46px; } }

.editor { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
@media (max-width: 1180px) { .editor { grid-template-columns: 1fr; } }

.sheet {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 34px 48px 48px; box-shadow: var(--shadow); min-height: 70vh;
}
@media (max-width: 700px) { .sheet { padding: 22px 18px 30px; } }
.sheet .title-in {
  width: 100%; border: 0; padding: 0; margin: 0 0 6px; background: transparent; resize: none; overflow: hidden;
  font: 600 34px/1.18 var(--serif); letter-spacing: -0.012em; color: var(--ink); box-shadow: none;
}
.sheet .title-in:focus { box-shadow: none; }
.sheet .byline { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.fmt {
  position: sticky; top: 62px; z-index: 5; display: flex; flex-wrap: wrap; gap: 2px; padding: 5px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); margin-bottom: 18px;
}
.fmt button {
  border: 0; background: none; padding: 5px 9px; border-radius: 4px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-2);
}
.fmt button:hover { background: var(--surface-2); }
.fmt button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.fmt .sep { width: 1px; background: var(--line); margin: 3px 4px; }

.prose {
  font: 400 19px/1.65 var(--serif); color: #1d2a35; max-width: 70ch; outline: none; min-height: 300px;
}
.prose h2 { font: 600 26px/1.25 var(--serif); margin: 1.5em 0 0.5em; letter-spacing: -0.005em; }
.prose h3 { font: 600 21px/1.3 var(--serif); margin: 1.3em 0 0.4em; }
.prose p { margin: 0 0 1em; }
.prose ul, .prose ol { margin: 0 0 1em; padding-left: 1.3em; }
.prose li { margin: 0.25em 0; }
.prose a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose a.int { background: var(--accent-soft); border-radius: 3px; }
.prose blockquote { margin: 1em 0; padding: 0.2em 0 0.2em 1em; border-left: 3px solid var(--line); color: var(--ink-2); font-style: italic; }
.prose figure { margin: 1.2em 0; }
.prose img { max-width: 100%; height: auto; border-radius: 6px; display: block; }
.prose table { border-collapse: collapse; width: 100%; font: 15px/1.45 var(--ui); margin: 0 0 1em; }
.prose th, .prose td { border: 1px solid var(--line); padding: 6px 9px; text-align: left; }
.prose:empty::before { content: attr(data-placeholder); color: #98a3ad; font-style: italic; }
.prose.streaming { caret-color: transparent; }
.prose.streaming > :last-child::after { content: "▍"; color: var(--accent); animation: blink 1s steps(2) infinite; font-style: normal; }
@keyframes blink { 50% { opacity: 0; } }
.html-src { width: 100%; min-height: 60vh; font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }

.brief {
  border: 1px dashed #9fc9c4; background: #f3faf9; border-radius: var(--r); padding: 18px; margin-bottom: 22px;
}
.brief h3 { font: 600 18px var(--serif); margin-bottom: 4px; }
.steps { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.steps li { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.steps li.on { color: var(--ink); font-weight: 600; }
.steps li.done { color: var(--ok); }
.steps li .ic { width: 16px; display: inline-flex; justify-content: center; }

.side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 70px; max-height: calc(100vh - 86px); overflow-y: auto; padding-bottom: 20px; }
@media (max-width: 1180px) { .side { position: static; max-height: none; } }
.side details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.side summary {
  list-style: none; cursor: pointer; padding: 12px 14px; font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.side summary::-webkit-details-marker { display: none; }
.side summary::after { content: "+"; color: var(--muted); font-weight: 500; font-size: 18px; line-height: 1; }
.side details[open] summary::after { content: "–"; }
.side summary .sub { font-weight: 500; font-size: 12.5px; color: var(--muted); margin-left: auto; }
.side .body { padding: 2px 14px 14px; display: flex; flex-direction: column; gap: 12px; }

.serp { border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 10px 12px; font-family: Arial, sans-serif; background: #fff; }
.serp .u { font-size: 12px; color: #202124; }
.serp .t { font-size: 18px; color: #1a0dab; line-height: 1.3; margin: 2px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.serp .d { font-size: 13px; color: #4d5156; line-height: 1.45; }

.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; font-size: 13px; }
.checks li { display: flex; gap: 7px; align-items: baseline; }
.checks li::before { content: "●"; font-size: 9px; color: var(--ok); }
.checks li.no::before { color: var(--warn); }
.checks li.no { color: var(--ink-2); }

.img-main { border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.img-main img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.img-main .cap { font-size: 12px; color: var(--muted); padding: 6px 8px; }
.img-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.img-grid figure { margin: 0; position: relative; border-radius: 5px; overflow: hidden; background: var(--surface-2); }
.img-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; cursor: pointer; }
.img-grid figure.sel { outline: 3px solid var(--accent); outline-offset: -3px; }
.img-grid .acts {
  position: absolute; inset: auto 0 0 0; display: flex; gap: 2px; padding: 3px; background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
  opacity: 0; transition: opacity 0.15s;
}
.img-grid figure:hover .acts, .img-grid figure:focus-within .acts { opacity: 1; }
.img-grid .acts button { flex: 1; font-size: 11px; font-weight: 600; border: 0; border-radius: 3px; padding: 3px 2px; cursor: pointer; background: rgba(255, 255, 255, 0.92); }
@media (hover: none) { .img-grid .acts { opacity: 1; } }

.links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.links li { font-size: 13px; display: grid; grid-template-columns: 1fr auto; gap: 6px; align-items: start; padding: 7px 9px; border: 1px solid var(--line-2); border-radius: var(--r-sm); }
.links li .a { font-weight: 600; }
.links li .u { color: var(--muted); word-break: break-all; font-size: 12px; }
.links li.bad { border-color: #f2c99a; background: var(--warn-soft); }
.links li button { border: 0; background: none; color: var(--accent); font-weight: 600; cursor: pointer; font-size: 12.5px; padding: 0; }

/* ── Calendrier ──────────────────────────── */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--line); gap: 1px; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.cal .h { background: var(--surface-2); font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 8px; }
.cal .c { background: var(--surface); min-height: 112px; padding: 6px; display: flex; flex-direction: column; gap: 3px; }
.cal .c.out { background: #f7f9fa; }
.cal .c.out .n { color: #a9b3bb; }
.cal .c.today .n { background: var(--accent); color: #fff; border-radius: 4px; padding: 0 5px; }
.cal .n { font-size: 12.5px; font-weight: 600; align-self: flex-start; }
.cal a.ev {
  display: block; font-size: 12px; line-height: 1.3; padding: 3px 5px 3px 7px; border-radius: 4px; text-decoration: none; color: var(--ink);
  background: var(--surface-2); border-left: 3px solid var(--c, var(--accent)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cal a.ev:hover { background: var(--accent-soft); }
.cal a.ev.st-publie { opacity: 0.7; }
.cal a.ev.st-idee, .cal a.ev.st-a_relire { border-left-style: dashed; }
@media (max-width: 760px) {
  .cal { grid-template-columns: 1fr; }
  .cal .h, .cal .c.out:not(.has) { display: none; }
  .cal .c { min-height: 0; }
}

/* ── Dialogues ───────────────────────────── */
dialog {
  border: 0; border-radius: 12px; padding: 0; width: min(560px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25); color: var(--ink);
}
dialog::backdrop { background: rgba(22, 33, 43, 0.45); }
dialog .dlg-h { padding: 18px 22px 0; }
dialog .dlg-h h2 { font: 600 22px var(--serif); }
dialog .dlg-b { padding: 16px 22px; display: flex; flex-direction: column; gap: 14px; max-height: 70vh; overflow-y: auto; }
dialog .dlg-f { padding: 14px 22px 18px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line-2); }

.popover {
  position: absolute; z-index: 40; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm);
  box-shadow: var(--shadow); padding: 10px; width: 340px; display: flex; flex-direction: column; gap: 8px;
}

/* ── Connexion ───────────────────────────── */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--ink); }
.login form { width: min(400px, 100%); background: var(--surface); border-radius: 14px; padding: 30px 28px; display: flex; flex-direction: column; gap: 16px; }
.login h1 { font: 600 36px/1 var(--serif); }
.login p { margin: -6px 0 4px; color: var(--muted); }

/* ── Notifications ───────────────────────── */
#toasts { position: fixed; right: 16px; bottom: 16px; z-index: 100; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--ink); color: #fff; border-radius: var(--r-sm); padding: 11px 14px; font-size: 14px; box-shadow: var(--shadow); display: flex; gap: 10px; align-items: flex-start; }
.toast.err { background: #7a1a12; }
.toast.ok { background: #1f5a22; }
.toast button { margin-left: auto; background: none; border: 0; color: #fff; cursor: pointer; font-size: 16px; line-height: 1; padding: 0 2px; }

.kbd { font-size: 12px; border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; background: var(--surface-2); }
.loading { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 30px 0; }
