:root {
  --bg: #0c0c12;
  --panel: #14141c;
  --panel-2: #1b1b26;
  --panel-3: #232332;
  --border: #2a2a3a;
  --text: #ecebf4;
  --muted: #9b99b1;
  --faint: #6c6a82;
  --accent: #7c5cff;
  --accent-2: #9d85ff;
  --accent-soft: rgba(124, 92, 255, .16);
  --green: #22c55e;
  --orange: #f59e0b;
  --red: #ef4444;
  --gray: #8b8aa0;
  --radius: 12px;
  --hour: 56px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--accent-2); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
svg.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- boutons et champs */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--panel-2); cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, opacity .15s;
}
.btn:hover { background: var(--panel-3); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.primary:hover { background: #8d70ff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--panel-2); color: var(--text); }
.btn.danger { color: #ff8a8a; }
.btn.danger:hover { background: rgba(239, 68, 68, .14); border-color: rgba(239, 68, 68, .4); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn.icon-only { width: 38px; padding: 0; }
.btn.sm.icon-only { width: 30px; }
.btn.wide { width: 100%; }
.seg { display: inline-flex; background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 0 12px; height: 30px; border-radius: 7px; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--panel-3); color: var(--text); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
input[type=text], input[type=password], input[type=date], input[type=time], textarea, select {
  width: 100%; background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 9px 11px; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; min-height: 90px; }
.form-error { color: #ff8a8a; margin: 0; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--panel-2); font-size: 13px; cursor: pointer;
}
.chip:hover { border-color: var(--accent); }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-2); }

/* ---------- statuts */
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.s-draft { --c: var(--gray); }
.s-scheduled { --c: var(--accent); }
.s-publishing { --c: var(--orange); }
.s-published { --c: var(--green); }
.s-error { --c: var(--red); }
.dot { background: var(--c); }
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent);
}

/* ---------- connexion */
.login { min-height: 100%; display: grid; place-items: center; padding: 16px; background: radial-gradient(1200px 600px at 50% -10%, rgba(124, 92, 255, .25), transparent), var(--bg); }
.login-card { width: min(380px, 100%); background: var(--panel); border: 1px solid var(--border); border-radius: 18px; padding: 28px; display: flex; flex-direction: column; gap: 16px; }
.login-card p { margin: 0; }

/* ---------- structure */
.app { display: flex; height: 100%; }
.sidebar { width: 236px; flex: none; background: var(--panel); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 18px 12px; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 15px; padding: 0 8px; }
.brand.big { font-size: 20px; padding: 0; }
.brand-mark { width: 26px; height: 20px; position: relative; flex: none; background: var(--accent); border-radius: 5px; margin-top: 5px; }
.brand-mark::before, .brand-mark::after { content: ""; position: absolute; top: -6px; width: 8px; height: 8px; border-radius: 3px; background: var(--accent); }
.brand-mark::before { left: 3px; } .brand-mark::after { right: 3px; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav button { display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 12px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); cursor: pointer; text-align: left; }
.nav button:hover { background: var(--panel-2); color: var(--text); }
.nav button.on { background: var(--accent-soft); color: var(--text); }
.nav button.on svg { color: var(--accent-2); }
.nav .count { margin-left: auto; font-size: 12px; background: var(--panel-3); color: var(--muted); border-radius: 999px; padding: 1px 8px; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.account { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--border); }
.avatar { width: 34px; height: 34px; border-radius: 50%; flex: none; background: linear-gradient(135deg, #f58529, #dd2a7b 50%, #8134af); display: grid; place-items: center; color: #fff; font-weight: 700; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.account .who { min-width: 0; }
.account .who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 14px 22px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.topbar h1 { font-size: 18px; margin: 0 8px 0 0; font-weight: 650; }
.topbar .spacer { flex: 1; }
.content { flex: 1; min-height: 0; overflow: auto; }
.page { padding: 22px; max-width: 1100px; }

/* ---------- calendrier semaine */
.week { display: grid; grid-template-columns: 58px repeat(7, minmax(110px, 1fr)); min-width: 860px; }
.week-head { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--border); padding: 10px 6px; text-align: center; }
.week-head .dname { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.week-head .dnum { font-size: 20px; font-weight: 650; }
.week-head.today .dnum { color: #fff; background: var(--accent); border-radius: 50%; width: 34px; height: 34px; display: inline-grid; place-items: center; }
.hours { position: relative; }
.hours div { height: var(--hour); font-size: 11px; color: var(--faint); text-align: right; padding-right: 8px; transform: translateY(-7px); }
.day-col { position: relative; height: calc(var(--hour) * 24); border-left: 1px solid var(--border); background-image: repeating-linear-gradient(to bottom, var(--border) 0 1px, transparent 1px var(--hour)); cursor: copy; }
.day-col.past { background-color: rgba(255, 255, 255, .015); }
.day-col.drop { background-color: var(--accent-soft); }
.now-line { position: absolute; left: 0; right: 0; height: 2px; background: var(--red); z-index: 3; pointer-events: none; }
.now-line::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); }
.drop-hint { position: absolute; left: 4px; right: 4px; height: 3px; background: var(--accent); border-radius: 3px; z-index: 4; pointer-events: none; }
.drop-hint span { position: absolute; left: 0; top: -22px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 6px; }
.slot-ghost { position: absolute; left: 6px; right: 6px; height: 26px; border: 1px dashed var(--border); border-radius: 8px; color: var(--faint); font-size: 12px; display: flex; align-items: center; gap: 6px; padding: 0 8px; cursor: pointer; z-index: 1; transform: translateY(-13px); }
.slot-ghost:hover { border-color: var(--accent); color: var(--accent-2); background: var(--accent-soft); }
.slot-ghost svg { width: 14px; height: 14px; }
.post-card {
  position: absolute; z-index: 2; display: flex; gap: 7px; padding: 5px; border-radius: 9px; cursor: pointer; overflow: hidden;
  background: var(--panel-2); border: 1px solid var(--border); border-left: 3px solid var(--c); box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
  transform: translateY(-4px); min-height: 50px;
}
.post-card:hover { border-color: var(--c); }
.post-card[draggable=true] { cursor: grab; }
.post-card .thumb { width: 30px; height: 40px; border-radius: 5px; background: var(--panel-3) center/cover; flex: none; }
.post-card .meta { min-width: 0; font-size: 12px; line-height: 1.3; }
.post-card .meta b { display: flex; align-items: center; gap: 5px; }
.post-card .meta .cap { color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- calendrier mois */
.month { display: grid; grid-template-columns: repeat(7, minmax(110px, 1fr)); min-width: 780px; }
.month .mh { padding: 10px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--border); }
.mcell { min-height: 124px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 6px; display: flex; flex-direction: column; gap: 4px; cursor: copy; }
.mcell.other { background: rgba(255, 255, 255, .015); color: var(--faint); }
.mcell.drop { background: var(--accent-soft); }
.mcell .num { font-size: 13px; font-weight: 600; }
.mcell.today .num { color: #fff; background: var(--accent); border-radius: 999px; padding: 0 7px; align-self: flex-start; }
.mchip { display: flex; align-items: center; gap: 6px; font-size: 12px; padding: 3px 6px; border-radius: 6px; background: var(--panel-2); border-left: 3px solid var(--c); cursor: pointer; overflow: hidden; white-space: nowrap; }
.mchip:hover { background: var(--panel-3); }
.mchip span:last-child { overflow: hidden; text-overflow: ellipsis; color: var(--muted); }

/* ---------- liste */
.list-day { margin: 0 0 18px; }
.list-day h3 { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 0 0 8px; }
.row { display: flex; align-items: center; gap: 14px; padding: 10px; border-radius: 12px; background: var(--panel); border: 1px solid var(--border); margin-bottom: 8px; cursor: pointer; }
.row:hover { border-color: var(--accent); }
.row .thumb { width: 44px; height: 58px; border-radius: 7px; background: var(--panel-3) center/cover; flex: none; }
.row .time { font-weight: 650; width: 52px; flex: none; }
.row .cap { flex: 1; min-width: 0; }
.row .cap b, .row .cap div { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .cap div { color: var(--muted); font-size: 13px; }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty svg { width: 40px; height: 40px; color: var(--faint); }

/* ---------- cartes / réglages / médias */
.cards { display: grid; gap: 16px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 18px; }
.card h2 { margin: 0 0 4px; font-size: 16px; }
.card > p { margin: 0 0 14px; }
.card .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.steps { margin: 10px 0 0; padding-left: 20px; color: var(--muted); }
.steps li { margin: 4px 0; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 6px 12px; }
.kv span:nth-child(odd) { color: var(--muted); }
.bar { height: 8px; background: var(--panel-3); border-radius: 999px; overflow: hidden; }
.bar > div { height: 100%; background: var(--accent); border-radius: 999px; transition: width .2s; }
.logs { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; max-height: 300px; overflow: auto; display: flex; flex-direction: column; gap: 4px; }
.logs div { display: flex; gap: 10px; }
.logs .t { color: var(--faint); flex: none; }
.logs .error { color: #ff8a8a; } .logs .warn { color: #fbbf24; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.media-item { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.media-item .pv { aspect-ratio: 9 / 16; background: var(--panel-3) center/cover; position: relative; }
.media-item .pv video { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-item .pv .tag { position: absolute; top: 8px; left: 8px; }
.media-item .info { padding: 10px; display: flex; flex-direction: column; gap: 6px; font-size: 12px; }
.media-item .info b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropzone { border: 2px dashed var(--border); border-radius: 16px; padding: 22px; text-align: center; color: var(--muted); cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.dropzone svg { width: 28px; height: 28px; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: rgba(245, 158, 11, .1); border: 1px solid rgba(245, 158, 11, .35); color: #fcd38a; }
.notice.info { background: var(--accent-soft); border-color: rgba(124, 92, 255, .4); color: #cfc3ff; }
.notice.err { background: rgba(239, 68, 68, .1); border-color: rgba(239, 68, 68, .4); color: #ffb3b3; }

/* ---------- réseaux (Instagram / YouTube) */
.nets { display: inline-flex; gap: 3px; margin-left: auto; }
.post-card .meta b { width: 100%; }
.net { --c: var(--gray); font-size: 9px; font-weight: 800; letter-spacing: .03em; line-height: 1; padding: 3px 4px; border-radius: 4px;
  color: var(--c); background: color-mix(in srgb, var(--c) 18%, transparent); }
.row .nets { margin-left: 0; }
.net-state { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel-2); }
.net-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.net-row a { margin-left: auto; font-size: 13px; display: inline-flex; gap: 4px; align-items: center; }
.net-row a svg { width: 14px; height: 14px; }
.yt-fields { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 12px; border: 1px solid rgba(196, 48, 43, .45); background: rgba(196, 48, 43, .07); }
.yt-fields[hidden] { display: none !important; }
.chip svg { width: 15px; height: 15px; }
.btn.disabled { opacity: .45; }
a.btn { text-decoration: none; color: inherit; }
a.btn.primary { color: #fff; }
.card h2 svg { vertical-align: -3px; margin-right: 4px; }
.login-links { text-align: center; font-size: 12px; color: var(--faint); }
.login-links a { color: var(--muted); }

/* ---------- statistiques */
.stats-page { max-width: 1180px; display: flex; flex-direction: column; gap: 16px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.kpi { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.kpi span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.kpi b { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi small { color: var(--muted); font-size: 12px; }
.chart-card { position: relative; }
.chart { position: relative; margin-top: 8px; }
.chart svg { display: block; overflow: visible; }
.chart svg text { fill: var(--faint); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .bar { fill: var(--accent); transition: fill .1s; }
.chart .bar.on { fill: var(--accent-2); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .cross { stroke: var(--faint); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .dot-mark { fill: var(--accent); stroke: var(--panel); stroke-width: 2; }
.chart .hit { fill: transparent; cursor: pointer; }
.tip { position: absolute; z-index: 5; pointer-events: none; display: flex; gap: 10px; align-items: center; max-width: 280px; padding: 8px 10px; border-radius: 10px;
  background: var(--panel-3); border: 1px solid var(--border); box-shadow: 0 10px 30px rgba(0, 0, 0, .45); font-size: 12px; line-height: 1.35; }
.tip img { width: 36px; height: 48px; object-fit: cover; border-radius: 6px; flex: none; }
.tip b { font-size: 13px; }
.table-wrap { overflow-x: auto; margin-top: 8px; }
.stats-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 13px; }
.stats-table th { text-align: right; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--border); cursor: pointer; white-space: nowrap; user-select: none; }
.stats-table th.on { color: var(--text); }
.stats-table td { text-align: right; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.stats-table .l { text-align: left; }
.stats-table tbody tr { cursor: pointer; }
.stats-table tbody tr:hover { background: var(--panel-2); }
.stats-table .reel { display: flex; align-items: center; gap: 10px; max-width: 360px; }
.stats-table .reel span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats-table .th { width: 30px; height: 40px; border-radius: 5px; background: var(--panel-3) center/cover; flex: none; }

/* ---------- fenêtres */
.overlay { position: fixed; inset: 0; background: rgba(5, 5, 10, .72); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(1080px, 100%); max-height: calc(100vh - 32px); background: var(--panel); border: 1px solid var(--border); border-radius: 18px; display: flex; flex-direction: column; overflow: hidden; }
.modal.small { width: min(440px, 100%); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-head h2 { margin: 0; font-size: 17px; flex: 1; }
.modal-body { overflow: auto; flex: 1; }
.modal-foot { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.modal-foot .spacer { flex: 1; }
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 340px; }
.editor-form { padding: 18px; display: flex; flex-direction: column; gap: 16px; border-right: 1px solid var(--border); }
.editor-side { padding: 18px; background: var(--panel-2); display: flex; flex-direction: column; gap: 12px; align-items: center; }
.media-pick { display: grid; grid-template-columns: 1fr 120px; gap: 12px; }
.vid-box { border: 1px solid var(--border); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--panel-2); min-height: 120px; justify-content: center; }
.vid-box .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cover-box { aspect-ratio: 9 / 16; border-radius: 12px; border: 1px solid var(--border); background: var(--panel-3) center/cover; display: flex; align-items: flex-end; justify-content: center; padding: 6px; }
.counters { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); gap: 10px; flex-wrap: wrap; }
.counters .over { color: #ff8a8a; font-weight: 700; }
.when { display: grid; grid-template-columns: 1fr 120px; gap: 10px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.frame-picker video { width: 100%; max-height: 52vh; border-radius: 12px; background: #000; display: block; }
.frame-picker input[type=range] { width: 100%; accent-color: var(--accent); margin: 12px 0 0; }
.warn-list { display: flex; flex-direction: column; gap: 6px; }

/* ---------- aperçu Instagram */
.phone { width: 270px; aspect-ratio: 9 / 16; border-radius: 26px; background: #000; position: relative; overflow: hidden; border: 6px solid #22222e; box-shadow: 0 20px 50px rgba(0, 0, 0, .5); }
.phone video, .phone .poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #111 center/cover; }
.phone .top { position: absolute; top: 10px; left: 12px; right: 12px; display: flex; justify-content: space-between; color: #fff; font-weight: 700; font-size: 15px; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); z-index: 2; }
.phone .side { position: absolute; right: 8px; bottom: 70px; display: flex; flex-direction: column; gap: 16px; color: #fff; z-index: 2; align-items: center; font-size: 10px; }
.phone .side svg { width: 22px; height: 22px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .6)); }
.phone .bottom { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 48px 12px 12px; color: #fff; z-index: 2; background: linear-gradient(transparent, rgba(0, 0, 0, .65)); font-size: 12px; }
.phone .bottom .user { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 6px; }
.phone .bottom .user .avatar { width: 24px; height: 24px; font-size: 10px; }
.phone .bottom .user .follow { border: 1px solid rgba(255, 255, 255, .7); border-radius: 6px; padding: 1px 7px; font-size: 11px; }
.phone .bottom .text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.phone .empty-pv { position: absolute; inset: 0; display: grid; place-items: center; color: var(--faint); text-align: center; padding: 20px; }
.grid-pv { width: 270px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; background: #000; border-radius: 12px; overflow: hidden; border: 6px solid #22222e; }
.grid-pv div { aspect-ratio: 3 / 4; background: #1a1a22 center/cover; position: relative; }
.grid-pv div.me { outline: 2px solid var(--accent); outline-offset: -2px; }
.pv-note { font-size: 12px; color: var(--muted); text-align: center; max-width: 270px; }

/* ---------- notifications */
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 80; }
.toast { background: var(--panel-3); border: 1px solid var(--border); border-left: 3px solid var(--accent); padding: 10px 14px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); max-width: 360px; animation: fade .2s; }
.toast.err { border-left-color: var(--red); }
.toast.ok { border-left-color: var(--green); }
.progress { height: 6px; background: var(--panel-3); border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; width: 0; background: var(--accent); transition: width .2s; }

/* ---------- téléphone */
@media (max-width: 860px) {
  .app { flex-direction: column-reverse; }
  .sidebar { width: auto; flex-direction: row; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--border); gap: 0; }
  .sidebar .brand, .sidebar-foot { display: none; }
  .nav { flex-direction: row; flex: 1; justify-content: space-around; }
  .nav button { flex-direction: column; height: auto; padding: 6px 4px; gap: 2px; font-size: 11px; flex: 1; align-items: center; }
  .nav .count { display: none; }
  .topbar { padding: 12px 16px; }
  .topbar h1 { font-size: 16px; width: 100%; }
  .page { padding: 16px; }
  .editor { grid-template-columns: 1fr; }
  .editor-form { border-right: 0; border-bottom: 1px solid var(--border); }
  .overlay { padding: 0; }
  .modal { max-height: 100vh; height: 100%; border-radius: 0; }
  .modal.small { height: auto; border-radius: 18px; margin: 16px; }
  .kv { grid-template-columns: 1fr; }
  .media-pick { grid-template-columns: 1fr 96px; }
}
