:root {
  /* Galerie monochrome : noir, blanc, gris doux ; le rose est l'unique accent. */
  --bg: #ffffff; --panel: #ffffff; --side: #f4f4f5; --ink: #0a0a0a; --muted: #71717a; --line: #ececec;
  --rose: #e2477e; --rose-soft: #fdecf2; --rose-ink: #b4235a;
  --ok: #16a34a; --ok-soft: #eaf7ee; --warn: #b45309; --warn-soft: #fdf3e2; --bad: #dc2626; --bad-soft: #fdecec;
  --shadow: none;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Helvetica Neue", Arial, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Helvetica Neue", Arial, sans-serif;
  --serif: var(--display);
  --radius-lg: 20px;
  color-scheme: light;
}
:root[data-theme="light"] { color-scheme: light; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #0b0b0c; --panel: #141416; --side: #1c1c1f; --ink: #f5f5f5; --muted: #a1a1aa; --line: #26262b;
    --rose: #ff5c97; --rose-soft: #3a1a28; --rose-ink: #ff8fb8;
    --ok: #4ade80; --ok-soft: #12291b; --warn: #fbbf24; --warn-soft: #2e2410; --bad: #f87171; --bad-soft: #321616;
    color-scheme: dark; }
}
:root[data-theme="dark"] { --bg: #0b0b0c; --panel: #141416; --side: #1c1c1f; --ink: #f5f5f5; --muted: #a1a1aa; --line: #26262b;
    --rose: #ff5c97; --rose-soft: #3a1a28; --rose-ink: #ff8fb8;
    --ok: #4ade80; --ok-soft: #12291b; --warn: #fbbf24; --warn-soft: #2e2410; --bad: #f87171; --bad-soft: #321616;
    color-scheme: dark; }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--ink); }
button, input, select, textarea { font: inherit; color: inherit; }

/* Barre du haut */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 20px; padding: 12px 28px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); flex: none; }
.brand img { border-radius: 8px; display: block; }
.wordmark { font-family: var(--display); font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.wordmark em { font-style: normal; color: var(--rose); }
.wordmark span { font-weight: 500; color: var(--muted); }
.tabs { display: flex; gap: 2px; background: var(--side); border-radius: 999px; padding: 4px; }
.tabs a { text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14px; padding: 6px 14px; border-radius: 999px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a.active { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 0 0 1px var(--line); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500; color: var(--muted);
  text-decoration: none; padding: 6px 12px; border-radius: 999px; white-space: nowrap; }
.status-pill:hover, .status-pill.active { background: var(--side); color: var(--ink); }
.status-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.status-pill.ok .dot { background: var(--ok); }
.status-pill.warn .dot { background: #f59e0b; }
.status-pill.bad .dot { background: var(--bad); }
.icon-link { display: inline-flex; padding: 8px; border-radius: 999px; color: var(--muted); }
.icon-link:hover, .icon-link.active { background: var(--side); color: var(--ink); }
#view { padding: 34px 28px 90px; max-width: 1240px; margin: 0 auto; }
h1 { font-family: var(--display); font-weight: 700; font-size: 34px; margin: 0 0 6px; letter-spacing: -.03em; line-height: 1.1; }
h2 { font-family: var(--display); font-weight: 700; font-size: 21px; margin: 30px 0 12px; letter-spacing: -.02em; }
h3 { font-size: 16px; margin: 0; }
.lead { color: var(--muted); margin: 0 0 20px; }
.btn { border: 1px solid var(--line); background: var(--panel); padding: 7px 14px; border-radius: 999px; cursor: pointer; font-size: 13.5px;
  font-weight: 550; white-space: nowrap; }
.btn:hover { border-color: var(--ink); }
a.btn { text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.on { background: var(--rose-soft); border-color: var(--rose); color: var(--rose-ink); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.small { padding: 3px 9px; font-size: 12.5px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.grid { display: grid; gap: 14px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px 22px; }
.card.topic { padding: 20px 22px; }
.card .meta { font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 4px 0 10px; }
.card .title { font-family: var(--serif); font-size: 19px; font-weight: 600; line-height: 1.3; margin: 2px 0; }
.card .title a { color: inherit; text-decoration: none; }
.card .title a:hover { color: var(--rose-ink); }
.card p { margin: 6px 0; }
.why { background: var(--side); border-radius: 14px; padding: 12px 14px; margin: 12px 0; font-size: 14px; }
.why b { color: var(--ink); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 6px 16px; font-size: 13px; margin: 10px 0; }
.facts div span { color: var(--muted); display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; }
.nv { color: var(--muted); font-style: italic; }
.chip { display: inline-block; font-size: 11.5px; padding: 1px 8px; border-radius: 99px; background: var(--side); border: 1px solid var(--line);
  color: var(--muted); font-weight: 550; }
.chip.cat { background: var(--rose-soft); border-color: transparent; color: var(--rose-ink); }
.chip.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.chip.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.note { font-size: 12.5px; color: var(--muted); }
.banner { border-radius: 12px; padding: 12px 16px; margin: 0 0 16px; font-size: 14px; }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner.bad { background: var(--bad-soft); color: var(--bad); }
.banner.info { background: var(--rose-soft); color: var(--rose-ink); }
.banner.ok { background: var(--ok-soft); color: var(--ok); }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 22px; position: sticky; top: 59px; background: var(--bg); padding: 10px 0; z-index: 4; }
.filters input[type=search] { flex: 1 1 220px; }
input[type=text], input[type=search], input[type=url], input[type=password], input[type=number], input[type=time], select, textarea {
  border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 7px 14px; min-width: 0; }
textarea { border-radius: 14px; }
input:focus, select:focus { border-color: var(--ink); }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
textarea { width: 100%; min-height: 70px; }
label.field { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
label.field > :not(span) { color: var(--ink); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.empty { text-align: center; color: var(--muted); padding: 40px 20px; border: 1px dashed var(--line); border-radius: 14px; }
.date-badge { min-width: 64px; text-align: center; border-radius: 10px; background: var(--rose-soft); color: var(--rose-ink); padding: 8px 6px;
  font-weight: 650; line-height: 1.1; }
.date-badge small { display: block; font-weight: 500; font-size: 11px; }
.event { display: grid; grid-template-columns: auto 1fr; gap: 16px; }
details summary { cursor: pointer; color: var(--muted); font-size: 13px; }
dialog { border: 1px solid var(--line); border-radius: 24px; padding: 22px 24px; max-width: 620px; width: calc(100% - 32px);
  background: var(--panel); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(20,15,18,.45); }
#toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 18px;
  border-radius: 10px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: 90vw; z-index: 50; }
#toast.show { opacity: 1; }
.kpis { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; min-width: 130px; }
.kpi b { display: block; font-size: 22px; font-family: var(--serif); }
.kpi span { font-size: 12px; color: var(--muted); }
.check-list { margin: 6px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--muted); }
/* Vignettes */
.card.with-media { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 20px; align-items: start; }
.card.lead-topic { grid-template-columns: 1fr; }
.media { position: relative; border-radius: 11px; overflow: hidden; aspect-ratio: 16 / 10; background: var(--side); }
.media.hero { aspect-ratio: 21 / 9; }
.media.hero:has(.ph) { aspect-ratio: auto; height: 64px; }
.media.hero .ph { flex-direction: row; align-items: center; gap: 12px; justify-content: flex-start; }
.media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media .play { position: absolute; inset: auto auto 10px 10px; z-index: 1; background: rgba(20,15,18,.72); color: #fff; font-size: 12px;
  border-radius: 99px; padding: 3px 10px; }
.ph { width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: space-between; padding: 12px 14px; }
.ph-icon { font-size: 26px; line-height: 1; opacity: .75; }
.ph-label { font-family: var(--display); font-size: 15px; font-weight: 700; letter-spacing: -.01em; opacity: .85; }
.ph.c0 { background: linear-gradient(135deg, #fde8ef, #f6d3e0); color: #a8285a; }
.ph.c1 { background: linear-gradient(135deg, #fbe9df, #f5d5c4); color: #9a4a22; }
.ph.c2 { background: linear-gradient(135deg, #ece7fb, #dcd3f4); color: #5b3fa0; }
.ph.c3 { background: linear-gradient(135deg, #f4efe2, #e9dfc6); color: #7a6224; }
.ph.c4 { background: linear-gradient(135deg, #f9e3ea, #e9c9e6); color: #8e2d6e; }
.ph.c5 { background: linear-gradient(135deg, #e3f0f4, #cfe3ea); color: #2b6577; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ph.c0, :root:not([data-theme="light"]) .ph.c1, :root:not([data-theme="light"]) .ph.c2, :root:not([data-theme="light"]) .ph.c3, :root:not([data-theme="light"]) .ph.c4, :root:not([data-theme="light"]) .ph.c5 { background: linear-gradient(135deg, #3a2230, #2a1d26); color: var(--rose-ink); }
}
:root[data-theme="dark"] .ph.c0, :root[data-theme="dark"] .ph.c1, :root[data-theme="dark"] .ph.c2, :root[data-theme="dark"] .ph.c3, :root[data-theme="dark"] .ph.c4, :root[data-theme="dark"] .ph.c5 { background: linear-gradient(135deg, #3a2230, #2a1d26); color: var(--rose-ink); }
.meta .fresh { color: var(--rose-ink); font-weight: 600; }
.chip.ai { background: var(--rose); color: #fff; border-color: transparent; }
.chip.video { background: #1f1b1d; color: #fff; border-color: transparent; }
.channel-list { max-height: 50vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; }
.channel { padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
/* ---------- Aujourd'hui : direction magazine ---------- */
.today-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.today-date { font-size: 13px; color: var(--muted); }
.today-date::first-letter { text-transform: uppercase; }
.today-title { font-size: 44px; line-height: 1.02; margin: 4px 0 0; letter-spacing: -.035em; }
.today-status { font-size: 12.5px; color: var(--ok); white-space: nowrap; }
.today-status::before { content: "● "; }
.kicker { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.tmeta { font-size: 12.5px; color: var(--muted); }
.tile { cursor: pointer; display: flex; flex-direction: column; border-radius: var(--radius-lg); outline: none; }
.tile .media { position: relative; border-radius: var(--radius-lg); aspect-ratio: 4 / 3; background: var(--side);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.04); transition: transform .2s ease; }
.tile:hover .media { transform: translateY(-2px); }
.tile:focus-visible .media { outline: 2px solid var(--ink); outline-offset: 3px; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px 24px; margin-bottom: 26px; }
.tiles.gallery { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 34px 22px; }
.more-row { display: flex; justify-content: center; margin: 10px 0 30px; }
.drawer-tools { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.drawer-tools .row { margin-top: 8px; }
@media (max-width: 1000px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .tiles { grid-template-columns: 1fr; } }
.tile-body { padding: 12px 2px 0; display: flex; flex-direction: column; flex: 1; }
.tile-title { font-family: var(--display); font-size: 17px; line-height: 1.3; font-weight: 650; letter-spacing: -.01em; margin: 0 0 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile-lead { font-size: 13.5px; line-height: 1.5; color: var(--muted); margin: 0 0 10px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile-src { display: flex; align-items: center; gap: 8px; margin-top: auto; }
.src-avatar { width: 22px; height: 22px; border-radius: 7px; flex: none; display: grid; place-items: center; font-size: 11px; font-weight: 700;
  color: hsl(var(--h) 45% 32%); background: hsl(var(--h) 60% 92%); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .src-avatar { color: hsl(var(--h) 70% 80%); background: hsl(var(--h) 30% 22%); }
}
:root[data-theme="dark"] .src-avatar { color: hsl(var(--h) 70% 80%); background: hsl(var(--h) 30% 22%); }
.overlay-actions { position: absolute; top: 10px; right: 10px; opacity: 0; transform: translateY(-4px); transition: opacity .15s, transform .15s; }
.overlay-actions .icon-actions { background: color-mix(in srgb, var(--panel) 92%, transparent); border-radius: 999px; padding: 3px;
  box-shadow: 0 2px 10px rgba(0,0,0,.12); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.tile:hover .overlay-actions, .tile:focus-within .overlay-actions { opacity: 1; transform: none; }
.overlay-actions .icon-btn { padding: 6px; border-radius: 999px; }
.flag-status { position: absolute; bottom: 10px; right: 10px; background: var(--ink); color: var(--bg); font-size: 11.5px; font-weight: 600;
  padding: 3px 10px; border-radius: 999px; }
.flag-ia { position: absolute; top: 10px; left: 10px; background: var(--rose); color: #fff; font-size: 11.5px; font-weight: 700;
  padding: 4px 11px; border-radius: 999px; letter-spacing: .01em; }
.ev-visual, .tile .media.ev-visual { display: flex; align-items: center; justify-content: center; background: #e9f1f4; }
.ev-visual.idf, .tile .media.ev-visual.idf { background: var(--rose-soft); }
.ev-visual.idf .ev-date { color: var(--rose-ink); }
.ev-visual.online, .tile .media.ev-visual.online { background: #efedfb; }
.ev-visual.online .ev-date { color: #5b3fa0; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tile .media.ev-visual { background: #16252b; }
  :root:not([data-theme="light"]) .tile .media.ev-visual.idf { background: var(--rose-soft); }
  :root:not([data-theme="light"]) .tile .media.ev-visual.online { background: #211c33; }
  :root:not([data-theme="light"]) .ev-visual.online .ev-date { color: #c4b5fd; }
  :root:not([data-theme="light"]) .ev-date { color: #9fd3e3; }
}
:root[data-theme="dark"] .tile .media.ev-visual { background: #16252b; }
:root[data-theme="dark"] .tile .media.ev-visual.idf { background: var(--rose-soft); }
:root[data-theme="dark"] .tile .media.ev-visual.online { background: #211c33; }
:root[data-theme="dark"] .ev-visual.online .ev-date { color: #c4b5fd; }
:root[data-theme="dark"] .ev-date { color: #9fd3e3; }
.ev-wd { display: block; font-size: 13px !important; font-weight: 600; margin-bottom: 2px; }
.ev-date b { font-family: var(--display); font-size: 64px !important; font-weight: 800; letter-spacing: -.04em; }
.ev-flags { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.ev-flag { background: var(--panel); color: var(--ink); font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.ev-flag.ok { color: var(--ok); } .ev-flag.warn { color: var(--warn); } .ev-flag.bad { color: var(--bad); }
.flag-ia.warn { background: #f59e0b; left: auto; right: 10px; top: auto; bottom: 10px; }
.tile.is-hidden { opacity: .55; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.segmented { display: inline-flex; background: var(--side); border-radius: 999px; padding: 4px; gap: 2px; margin: 4px 0 8px; }
.segmented button { border: 0; background: transparent; color: var(--muted); font-weight: 600; font-size: 13.5px; padding: 6px 14px; border-radius: 999px; cursor: pointer; }
.segmented button.active { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 0 0 1px var(--line); }
h2.month { text-transform: capitalize; margin-top: 34px; }
h2.month span { color: var(--muted); font-weight: 500; font-size: 16px; }
.ev-date { text-align: center; color: #2b6577; line-height: 1; }
.ev-date b { display: block; font-family: var(--serif); font-size: 44px; }
.ev-date span { font-size: 14px; text-transform: uppercase; letter-spacing: .08em; }
/* Boutons-icônes */
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon-actions { display: flex; gap: 2px; }
.icon-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--muted);
  border-radius: 8px; padding: 6px; cursor: pointer; font-size: 13px; }
.icon-btn:hover { background: var(--side); color: var(--ink); }
.icon-btn.on { background: var(--rose-soft); color: var(--rose-ink); }
.icon-btn:focus-visible { outline: 2px solid var(--rose); }
.icon-actions.labelled { flex-wrap: wrap; gap: 6px; }
.icon-actions.labelled .icon-btn { border: 1px solid var(--line); padding: 6px 10px; }
.btn .ico { width: 16px; height: 16px; vertical-align: -3px; }
/* Panneau de détail */
dialog.drawer { margin: 0 0 0 auto; height: 100vh; max-height: 100vh; width: min(560px, 100vw); max-width: 100vw; border-radius: 0;
  border: 0; border-left: 1px solid var(--line); padding: 0; box-shadow: -12px 0 40px rgba(0,0,0,.12); }
dialog.drawer[open] { animation: drawer-in .22s ease-out; }
@keyframes drawer-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { dialog.drawer[open] { animation: none; } .une, .tile { transition: none; } }
.drawer-inner { padding: 18px 24px 32px; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.drawer-head .kicker { margin: 0; }
.drawer .media { border-radius: 12px; aspect-ratio: 16 / 9; margin-bottom: 16px; }
.drawer .media.hero:has(.ph) { height: auto; aspect-ratio: 16 / 5; }
.drawer-title { font-family: var(--display); font-size: 27px; font-weight: 700; letter-spacing: -.025em; line-height: 1.15; margin: 0 0 6px; }
.drawer-text { font-size: 16px; line-height: 1.6; }
.drawer-facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 13.5px; margin: 16px 0; }
.drawer-facts dt { color: var(--muted); }
.drawer-facts dd { margin: 0; }
.drawer-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.drawer-actions .btn.primary { align-self: flex-start; padding: 8px 16px; font-size: 14px; }
@media (max-width: 980px) {
  .topbar { flex-wrap: wrap; padding: 10px 16px; gap: 10px; }
  .tabs { order: 3; width: 100%; overflow-x: auto; }
  #view { padding: 22px 16px 60px; }
  .filters { top: 104px; }
}
@media (max-width: 820px) {
  .today-title { font-size: 34px; }
  .card.with-media { grid-template-columns: 1fr; }
  .wordmark span { display: none; }
  .status-pill { padding: 6px 8px; }
}

.kicker.one-line, .tmeta.two-lines { overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; }
.kicker.one-line { -webkit-line-clamp: 1; }
.tmeta.two-lines { -webkit-line-clamp: 2; }

/* ---------- Sources ---------- */
.src-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.src-card { border: 1px solid var(--line); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--panel); transition: border-color .15s; }
.src-card:hover { border-color: var(--muted); }
.src-card.off { opacity: .55; }
.src-top { display: flex; align-items: center; gap: 10px; }
.src-top .src-avatar { width: 34px; height: 34px; border-radius: 10px; font-size: 15px; }
.src-id { flex: 1; min-width: 0; }
.src-name { font-weight: 650; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.src-state { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); }
.src-state .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.src-state.ok .dot { background: var(--ok); } .src-state.bad { color: var(--bad); } .src-state.bad .dot { background: var(--bad); }
.src-count { margin-left: auto; font-size: 12px; background: var(--side); color: var(--ink); border-radius: 999px; padding: 2px 9px; }
.src-note { margin: 0; font-size: 12.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.src-note.bad { color: var(--bad); }
.src-actions { display: flex; gap: 6px; margin-top: auto; }
.src-actions .ghost { margin-left: auto; padding: 4px 8px; }
.seg-count { color: var(--muted); font-weight: 500; }
.filters .segmented { margin: 0; }
/* Interrupteur */
input.switch { appearance: none; -webkit-appearance: none; width: 38px; height: 22px; border-radius: 999px; background: var(--line); position: relative;
  cursor: pointer; flex: none; transition: background .15s; margin: 0; }
input.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
input.switch:checked { background: var(--ink); }
input.switch:checked::after { transform: translateX(16px); background: var(--bg); }
input.switch:focus-visible { outline: 2px solid var(--rose); outline-offset: 2px; }
/* ---------- Réglages ---------- */
.settings { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 36px; align-items: start; margin-top: 18px; }
.set-nav { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 2px; }
.set-link { display: flex; align-items: center; gap: 10px; border: 0; background: transparent; text-align: left; padding: 8px 12px;
  border-radius: 12px; color: var(--muted); font-weight: 600; font-size: 14px; cursor: pointer; }
.set-link:hover { background: var(--side); color: var(--ink); }
.set-section { scroll-margin-top: 84px; margin-bottom: 34px; }
.set-section > h2 { margin: 0 0 12px; font-size: 19px; }
.set-section .card { border-radius: 18px; padding: 20px 22px; }
.set-section .card > .note:first-child { margin-top: 0; }
.set-section .kpis .kpi { border-radius: 14px; background: var(--side); border: 0; }
.set-section .banner { border-radius: 14px; }
.set-section label.field { font-weight: 500; }
@media (max-width: 900px) { .settings { grid-template-columns: 1fr; } .set-nav { position: static; flex-direction: row; flex-wrap: wrap; } }
.set-section .card > .row > input[type=text]:first-child { flex: 1 1 320px; }
.set-section .form-grid input, .set-section .form-grid select { width: 100%; }

/* Mode sombre : dates de l'agenda lisibles (spécificité supérieure aux couleurs claires) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tile .media.ev-visual .ev-date { color: #9fd3e3; }
  :root:not([data-theme="light"]) .tile .media.ev-visual.idf .ev-date { color: var(--rose-ink); }
  :root:not([data-theme="light"]) .tile .media.ev-visual.online .ev-date { color: #c4b5fd; }
}
:root[data-theme="dark"] .tile .media.ev-visual .ev-date { color: #9fd3e3; }
:root[data-theme="dark"] .tile .media.ev-visual.idf .ev-date { color: var(--rose-ink); }
:root[data-theme="dark"] .tile .media.ev-visual.online .ev-date { color: #c4b5fd; }
button.icon-link { border: 0; background: transparent; cursor: pointer; }
/* Fenêtres très étroites : barre du haut sur deux lignes au maximum */
.tabs { scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
@media (max-width: 560px) {
  .topbar { gap: 8px; }
  .status-pill { font-size: 0; gap: 0; padding: 9px; }
  .status-pill .dot { width: 10px; height: 10px; }
  .top-actions { gap: 0; }
  .icon-link { padding: 7px; }
  #refresh-btn { padding: 6px 12px; font-size: 13px; }
  .tabs a { padding: 6px 11px; font-size: 13.5px; }
  .today-title { font-size: 30px; }
  h1 { font-size: 28px; }
  dialog.drawer { width: 100vw; }
  .drawer-inner { padding: 16px 18px 28px; }
}

/* Page de connexion (accès Tailscale) */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-box { width: min(380px, 100%); text-align: center; }
.login-box img { border-radius: 14px; }
.login-box h1 { margin: 14px 0 4px; }
.login-box h1 em { font-style: normal; color: var(--rose); }
.login-box form { display: grid; gap: 12px; text-align: left; margin: 18px 0; }
.login-box input { width: 100%; }
.login-box .btn { justify-self: stretch; padding: 10px; font-size: 15px; }
.checklist { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.checklist li { display: flex; align-items: center; gap: 9px; }
.checklist .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.checklist li.ok { color: var(--ink); }
.checklist li.ok .dot { background: var(--ok); }
.set-section .card > .row > input[type=password]:first-child { flex: 1 1 320px; }

/* Formula One : accent turquoise façon Mercedes, uniquement sur cette page */
:root { --f1: #00a19c; }
.tabs a.tab-f1.active { color: var(--f1); }
.f1-kicker { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.f1-accent { color: var(--f1); }
.flag-f1 { position: absolute; top: 10px; left: 10px; background: var(--f1); color: #fff; font-size: 11.5px; font-weight: 700;
  padding: 4px 11px; border-radius: 999px; }
h2.month.plain { text-transform: none; }
.ph.f1 { background: linear-gradient(135deg, #dff4f3, #c4ebe9); color: #00736f; }
:root[data-theme="dark"] .ph.f1 { background: linear-gradient(135deg, #0f2a29, #0b201f); color: #5fd4cf; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ph.f1 { background: linear-gradient(135deg, #0f2a29, #0b201f); color: #5fd4cf; } }
