:root {
  --bg: #f6f6fb;
  --surface: #ffffff;
  --surface-2: #f1f1f7;
  --text: #1b1b2b;
  --muted: #6b6d85;
  --border: #e3e3ee;
  --accent: #5b4cf0;
  --accent-hover: #4a3be0;
  --accent-soft: #eeecff;
  --draft: #6b7280;
  --scheduled: #2563eb;
  --published: #15803d;
  --partial: #b45309;
  --failed: #dc2626;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 20, 40, 0.05), 0 4px 16px rgba(20, 20, 40, 0.05);
  /* Graphiques (couleur validée contre le fond clair) */
  --viz-series: #2a78d6;
  --viz-grid: #e1e0d9;
  --viz-axis: #c3c2b7;
  --viz-up: #006300;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12121b;
    --surface: #1b1b28;
    --surface-2: #242434;
    --text: #ececf5;
    --muted: #9a9cb5;
    --border: #2e2e42;
    --accent: #8b7fff;
    --accent-hover: #9d93ff;
    --accent-soft: #2a2650;
    --draft: #9ca3af;
    --scheduled: #60a5fa;
    --published: #4ade80;
    --partial: #fbbf24;
    --failed: #f87171;
    --shadow: none;
    /* Graphiques : teinte choisie pour le fond sombre (validée), pas une simple inversion */
    --viz-series: #3987e5;
    --viz-grid: #2c2c3a;
    --viz-axis: #44445a;
    --viz-up: #0ca30c;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
h1 { font-size: 1.6rem; letter-spacing: -0.02em; }
h2 { font-size: 1.15rem; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

/* ---------- Boutons et champs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 9px 16px; border-radius: 10px; font: inherit; font-weight: 600;
  cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-sm { padding: 5px 11px; font-size: .85rem; }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; border-color: transparent; }
.link-danger { background: none; border: 0; color: var(--failed); font: inherit; cursor: pointer; padding: 0; }
.link-danger:hover { text-decoration: underline; }

.label { display: block; font-weight: 600; font-size: .9rem; margin: 18px 0 6px; }
.label:first-child { margin-top: 0; }
input[type="text"], input[type="email"], input[type="password"], input[type="datetime-local"], textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px;
}
textarea { resize: vertical; min-height: 160px; }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px;
}

/* ---------- Statuts ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  font-size: .78rem; font-weight: 600; padding: 3px 10px; border-radius: 999px;
  background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--c);
}
.st-draft { --c: var(--draft); }
.st-scheduled { --c: var(--scheduled); }
.st-published { --c: var(--published); }
.st-partial { --c: var(--partial); }
.st-failed { --c: var(--failed); }

.net-dot {
  display: inline-grid; place-items: center; flex: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--net); color: #fff; font-size: .7rem; font-weight: 700;
}
.net-dot.lg { width: 38px; height: 38px; font-size: 1rem; border-radius: 10px; }

/* ---------- Mise en page de l'application ---------- */
.layout { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 22px 16px; display: flex; flex-direction: column; gap: 18px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-logo {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, #7b6cff, #5b4cf0); color: #fff;
}
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px;
  color: var(--muted); font-weight: 600;
}
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.nav svg { width: 18px; height: 18px; }
.me { margin-top: auto; border-top: 1px solid var(--border); padding-top: 14px; font-size: .88rem; }
.me strong { display: block; }
.me .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }

main { padding: 32px 36px; max-width: 1200px; width: 100%; min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head p { margin: 4px 0 0; }

/* ---------- Statistiques ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { padding: 16px 18px; }
.stat-value { font-size: 1.7rem; font-weight: 800; letter-spacing: -0.02em; }
.stat-label { color: var(--muted); font-size: .85rem; }

.stat-delta { margin-top: 4px; font-size: .82rem; font-weight: 600; color: var(--muted); }
.stat-delta.up { color: var(--viz-up); }

/* ---------- Statistiques ---------- */
.stats-filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; padding: 3px; background: var(--surface); }
.segmented button { border: 0; background: none; font: inherit; font-size: .85rem; font-weight: 600; color: var(--muted); padding: 5px 12px; border-radius: 7px; cursor: pointer; }
.segmented button.active { background: var(--accent-soft); color: var(--accent); }
#stats-body > * + * { margin-top: 20px; }
#stats-body .stats { margin-bottom: 0; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.stats-grid > .card, .viz-card { min-width: 0; }
.card h2 { margin-bottom: 14px; }
.viz { position: relative; }
.viz svg { display: block; overflow: visible; }
.viz-grid { stroke: var(--viz-grid); stroke-width: 1; }
.viz-base { stroke: var(--viz-axis); stroke-width: 1; }
.viz-bar { fill: var(--viz-series); }
.viz-tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.viz-value { fill: var(--text); font-size: 12px; font-weight: 600; }
.viz-hit { fill: transparent; cursor: default; outline: none; }
.viz-hit:hover, .viz-hit:focus-visible { fill: color-mix(in srgb, var(--viz-series) 8%, transparent); }
.viz-tooltip {
  position: absolute; transform: translate(-50%, -100%); pointer-events: none; z-index: 5;
  background: var(--text); color: var(--surface); padding: 7px 10px; border-radius: 8px;
  font-size: .8rem; line-height: 1.4; white-space: nowrap; box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
}
.viz-table { margin-top: 10px; font-size: .85rem; }
.viz-table summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.viz-table table, .data-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.viz-table th, .viz-table td, .data-table th, .data-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.data-table th, .viz-table th { font-size: .78rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
.data-table td .net-dot { width: 18px; height: 18px; font-size: .6rem; vertical-align: -4px; margin-right: 4px; }
.hbars { display: flex; flex-direction: column; gap: 10px; }
.hbar-row { display: grid; grid-template-columns: 120px minmax(0, 1fr); align-items: center; gap: 10px; border-radius: 6px; outline: none; }
.hbar-row:hover, .hbar-row:focus-visible { background: color-mix(in srgb, var(--viz-series) 6%, transparent); }
.hbar-label { display: flex; align-items: center; gap: 6px; font-size: .88rem; font-weight: 600; min-width: 0; }
.hbar-label .net-dot { width: 18px; height: 18px; font-size: .6rem; }
.hbar-track { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hbar { display: block; height: 16px; background: var(--viz-series); border-radius: 0 4px 4px 0; max-width: calc(100% - 52px); }
.hbar-value { font-size: .85rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.top-posts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.top-posts li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.top-posts li:last-child { border-bottom: 0; }
.top-post { flex: 1; min-width: 0; display: flex; flex-direction: column; color: var(--text); }
.top-post:hover { text-decoration: none; }
.top-post:hover .top-text { text-decoration: underline; }
.top-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-total { display: flex; flex-direction: column; align-items: flex-end; }
.top-total strong { font-size: 1.1rem; }

.banner {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-radius: var(--radius); padding: 14px 18px; margin-bottom: 20px;
}

/* ---------- Calendrier ---------- */
.month-nav { display: flex; align-items: center; gap: 6px; }
.month-nav strong { min-width: 150px; text-align: center; text-transform: capitalize; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--border); gap: 1px; }
.cal-head { background: var(--surface-2); padding: 8px; text-align: center; font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.cal-cell { background: var(--surface); min-height: 112px; padding: 6px; display: flex; flex-direction: column; gap: 4px; cursor: pointer; min-width: 0; }
.cal-cell:hover { background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface)); }
.cal-cell.other { background: var(--surface-2); }
.cal-cell.other .cal-num { opacity: .45; }
.cal-num { font-size: .82rem; font-weight: 600; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.cal-cell.today .cal-num { background: var(--accent); color: #fff; }
.chip {
  display: block; font-size: .75rem; padding: 3px 7px; border-radius: 6px; color: var(--text);
  background: color-mix(in srgb, var(--c) 13%, var(--surface)); border-left: 3px solid var(--c);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chip:hover { text-decoration: none; filter: brightness(.97); }
.chip b { font-weight: 700; margin-right: 4px; }
.more { font-size: .75rem; color: var(--muted); padding-left: 4px; }

/* ---------- Éditeur ---------- */
.compose-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.counters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; font-size: .8rem; }
.counter { padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.counter.over { background: color-mix(in srgb, var(--failed) 15%, transparent); color: var(--failed); font-weight: 700; }
.targets { display: flex; flex-wrap: wrap; gap: 8px; }
.target {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px 7px 8px; border-radius: 999px;
  border: 1px solid var(--border); cursor: pointer; user-select: none; font-weight: 600; font-size: .9rem;
}
.target input { position: absolute; opacity: 0; pointer-events: none; }
.target:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.target:has(input:focus-visible) { outline: 2px solid var(--accent); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.actions .btn-primary { margin-left: auto; }
/* ---------- Images ---------- */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.media-item { position: relative; margin: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface-2); display: flex; flex-direction: column; }
.media-item img, .media-item video { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: #000; }
.media-item video { pointer-events: none; }
.media-badge {
  position: absolute; top: 6px; left: 6px; padding: 2px 8px; border-radius: 999px;
  background: rgba(0, 0, 0, .7); color: #fff; font-size: .75rem; font-weight: 700;
}
.media-loading { gap: 6px; padding: 12px; text-align: center; }
.progress { width: 80%; height: 6px; border-radius: 999px; background: var(--border); overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); transition: width .2s; }
.thumb-editor { margin-top: 12px; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border)); border-radius: 12px; padding: 14px; background: var(--surface-2); }
.thumb-editor p { margin: 6px 0 12px; }
.thumb-head { display: flex; justify-content: space-between; align-items: center; }
.thumb-close { position: static; }
.thumb-body { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.thumb-body video { width: 100%; max-height: 300px; border-radius: 8px; background: #000; display: block; }
.thumb-controls { display: flex; flex-direction: column; gap: 10px; }
.thumb-controls input[type="range"] { width: 100%; accent-color: var(--accent); }
.thumb-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.thumb-current { display: flex; flex-direction: column; gap: 4px; }
.thumb-current img { width: 120px; border-radius: 6px; border: 1px solid var(--border); }
@media (max-width: 640px) { .thumb-body { grid-template-columns: 1fr; } }
.preview-media.is-video { grid-template-columns: 1fr; }
.preview-media video { width: 100%; max-height: 360px; display: block; background: #000; }
.media-view.is-video { grid-template-columns: minmax(0, 520px); }
.media-view video { width: 100%; border-radius: 10px; display: block; background: #000; max-height: 480px; }
.media-remove {
  position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%; border: 0;
  background: rgba(0, 0, 0, .65); color: #fff; font-size: 18px; line-height: 1; cursor: pointer;
}
.media-remove:hover { background: rgba(0, 0, 0, .85); }
textarea.media-alt { border: 0; border-top: 1px solid var(--border); border-radius: 0; font-size: .8rem; min-height: 0; resize: none; padding: 8px; background: var(--surface); }
.link-ai { background: var(--surface); border: 0; border-top: 1px solid var(--border); color: var(--accent); font: inherit; font-size: .78rem; font-weight: 600; padding: 7px; cursor: pointer; }
.link-ai:disabled { color: var(--muted); cursor: wait; }
.media-add {
  border: 2px dashed var(--border); border-radius: 10px; background: transparent; color: var(--muted);
  font: inherit; font-weight: 600; font-size: .88rem; min-height: 130px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.media-add span { font-size: 1.7rem; line-height: 1; }
.media-add:hover { border-color: var(--accent); color: var(--accent); }
.media-loading { min-height: 130px; align-items: center; justify-content: center; }
.dropping { outline: 2px dashed var(--accent); outline-offset: 4px; }
.preview-media { display: grid; grid-template-columns: repeat(2, 1fr); gap: 3px; margin-top: 8px; border-radius: 12px; overflow: hidden; }
.preview-media:empty { display: none; }
.preview-media.n1 { grid-template-columns: 1fr; }
.preview-media img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.preview-media.n1 img { aspect-ratio: auto; max-height: 320px; }
.preview-media.n3 img:first-child { grid-row: span 2; height: 100%; }
.media-view { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; margin-top: 12px; }
.media-view img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; display: block; }
.pic-count { font-size: .78rem; font-weight: 600; color: var(--muted); background: var(--surface-2); border-radius: 6px; padding: 1px 6px; margin-right: 8px; }

.side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

/* ---------- Assistant IA ---------- */
.ai { border-color: color-mix(in srgb, var(--accent) 30%, var(--border)); }
.ai-head { display: flex; align-items: center; gap: 10px; }
.ai-head h2 { font-size: 1.05rem; }
.ai-badge { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #7b6cff, #c04cf0); font-size: .9rem; }
textarea.ai-topic { min-height: 70px; font-size: .9rem; }
.ai-row { display: flex; gap: 8px; margin-top: 8px; align-items: center; }
.ai-row.wrap { flex-wrap: wrap; margin-top: 0; }
.ai-row select { flex: 1; min-width: 0; }
select {
  font: inherit; font-size: .88rem; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; padding: 6px 10px;
}
.ai-results { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.ai-results:empty { display: none; }
.ai-suggestion { border: 1px solid var(--border); border-radius: 10px; padding: 12px; background: var(--surface-2); }
.ai-suggestion p { margin: 0 0 10px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .9rem; }
.ai-suggestion-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .8rem; }
.ai-loading { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .9rem; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
code { background: var(--surface-2); padding: 1px 5px; border-radius: 5px; font-size: .85em; }

.preview-post { display: flex; gap: 12px; margin-top: 10px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 800; flex: none; }
.preview-text { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.preview-text a { pointer-events: none; }
.results { margin-top: 22px; border-top: 1px solid var(--border); padding-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.result { display: flex; align-items: flex-start; gap: 10px; }
.result-body { flex: 1; min-width: 0; }
.result-error { color: var(--failed); font-size: .85rem; overflow-wrap: anywhere; }
.readonly-text { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-2); border-radius: 10px; padding: 14px; margin: 0; }

/* ---------- Liste des publications ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tab { border: 1px solid var(--border); background: var(--surface); color: var(--muted); padding: 6px 14px; border-radius: 999px; font: inherit; font-weight: 600; font-size: .88rem; cursor: pointer; }
.tab.active { background: var(--text); color: var(--surface); border-color: var(--text); }
.list { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.post-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto auto; gap: 16px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.post-row:last-child { border-bottom: 0; }
.post-date { font-size: .85rem; color: var(--muted); }
.post-snippet { margin: 0 0 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; color: var(--muted); }
.badge .net-dot { width: 16px; height: 16px; font-size: .55rem; }
.badge.failed { color: var(--failed); }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty h2 { color: var(--text); margin-bottom: 6px; }

/* ---------- Réseaux ---------- */
.account-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.account-row:last-child { border-bottom: 0; }
.account-row .grow { flex: 1; min-width: 0; }
.net-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-top: 12px; }
.net-card { display: flex; flex-direction: column; gap: 10px; }
.net-card header { display: flex; align-items: center; gap: 12px; }
.help { white-space: pre-line; font-size: .85rem; color: var(--muted); background: var(--surface-2); padding: 10px 12px; border-radius: 10px; margin: 0; }
.soon { margin-top: 18px; }
.meta-card { grid-column: 1 / -1; }
.meta-dots { display: flex; }
.meta-dots .net-dot + .net-dot { margin-left: -10px; box-shadow: 0 0 0 3px var(--surface); }
.btn-x { background: #000; border-color: #000; color: #fff; align-self: flex-start; }
.btn-x:hover { background: #333; }
@media (prefers-color-scheme: dark) { .btn-x { border-color: #555; } }
.counter.warn { background: color-mix(in srgb, var(--partial) 14%, transparent); color: var(--partial); font-weight: 600; }
.btn-threads { background: #101010; border-color: #101010; color: #fff; align-self: flex-start; }
.btn-threads:hover { background: #333; }
@media (prefers-color-scheme: dark) { .btn-threads { border-color: #555; } }
.btn-mastodon { background: #6364ff; border-color: #6364ff; color: #fff; flex: none; }
.btn-mastodon:hover { background: #563acc; }
.btn-linkedin { background: #0a66c2; border-color: #0a66c2; color: #fff; align-self: flex-start; }
.btn-linkedin:hover { background: #004182; }
.expiry { display: inline-block; margin-top: 4px; font-size: .8rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.expiry.soon { color: var(--partial); background: color-mix(in srgb, var(--partial) 14%, transparent); }
.expiry.expired { color: var(--failed); background: color-mix(in srgb, var(--failed) 14%, transparent); }
.banner.warn { background: color-mix(in srgb, var(--partial) 12%, var(--surface)); border-color: color-mix(in srgb, var(--partial) 35%, transparent); }
.account-row { flex-wrap: wrap; }
.btn-facebook { background: #1877f2; border-color: #1877f2; color: #fff; align-self: flex-start; }
.btn-facebook:hover { background: #166fe5; }
.meta-notes { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 2px; }
.pending-card { margin-bottom: 20px; border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.pending-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.pending-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.pending-item:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.pending-item input { width: 18px; height: 18px; accent-color: var(--accent); }

/* ---------- Connexion / inscription ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { margin: 22px 0 6px; }
.auth-card form { margin-top: 18px; }
.auth-card .btn-primary { width: 100%; margin-top: 22px; }
.auth-switch { text-align: center; margin-top: 16px; font-size: .9rem; }
.form-error { color: var(--failed); font-size: .88rem; margin: 12px 0 0; }

/* ---------- Notifications ---------- */
.toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.toast { background: var(--text); color: var(--surface); padding: 11px 16px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.18); font-weight: 600; font-size: .9rem; max-width: 360px; animation: pop .2s ease-out; }
.toast.error { background: var(--failed); color: #fff; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }

/* ---------- Mobile ---------- */
@media (max-width: 900px) {
  .compose-grid { grid-template-columns: 1fr; }
  .post-row { grid-template-columns: minmax(0, 1fr) auto; }
  .post-date { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { min-width: 0; position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px 16px; gap: 10px; }
  .sidebar > .btn { order: 3; width: 100%; }
  .nav { flex-direction: row; order: 4; width: 100%; overflow-x: auto; }
  .nav a { white-space: nowrap; }
  .me { margin: 0 0 0 auto; border: 0; padding: 0; display: flex; align-items: center; gap: 10px; }
  .me strong, .me .muted { display: none; }
  main { padding: 20px 16px; }
  .cal-cell { min-height: 70px; padding: 3px; }
  .chip { font-size: .65rem; padding: 2px 4px; }
  .chip b { display: none; }
  .cal-head { font-size: .65rem; padding: 6px 2px; }
  .media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .actions .btn { flex: 1; }
  .actions .btn-primary { margin-left: 0; }
}
