/* Social Story Manager — design system « Studio » (sombre par défaut, clair en option) */
:root {
    --bg: #0B0E14;
    --rail: #10141C;
    --surface: #151A23;
    --surface-2: #1A2029;
    --surface-3: #1E2430;
    --border: #222937;
    --border-strong: #2A3140;
    --text: #F4F1EA;
    --muted: #9AA3B5;
    --muted-2: #B8C0CF;
    --primary: #FF6B4A;          /* corail : l'action */
    --primary-ink: #0B0E14;
    --primary-soft: #2A1A18;
    --primary-line: #5A2E25;
    --primary-text: #FF8A6E;
    --lagoon: #2FD3C0;           /* lagon : la réussite */
    --lagoon-soft: #13302C;
    --lagoon-line: #1F5A52;
    --lagoon-text: #7BE8DC;
    --warning: #FFC24B;
    --warning-soft: #3A2F12;
    --danger: #FF8A9A;
    --danger-soft: #3A1A1F;
    --assist: #CDB6FF;
    --assist-soft: #2A1F3D;
    --info: #8FB3FF;
    --info-soft: #1B2744;
    --success: var(--lagoon);
    --success-soft: var(--lagoon-soft);
    --ig: #E1306C;
    --fb: #1877F2;
    --tt: #F4F1EA;
    --sc: #FFFC00;
    --radius: 22px;
    --radius-sm: 14px;
    --rail-w: 96px;
    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
    --shadow: 0 10px 30px rgba(0, 0, 0, .35);
    color-scheme: dark;
}

:root[data-theme="light"] {
    --bg: #F7F4EE; --rail: #FFFFFF; --surface: #FFFFFF; --surface-2: #F3EFE8; --surface-3: #ECE7DE;
    --border: #E6E0D5; --border-strong: #D6CEC0; --text: #16130F; --muted: #5E5850; --muted-2: #4A453E;
    --primary: #E8492A; --primary-ink: #FFFFFF; --primary-soft: #FDE9E3; --primary-line: #F5B9A9; --primary-text: #B8351B;
    --lagoon: #0E9C8C; --lagoon-soft: #DDF5F1; --lagoon-line: #9ADBD2; --lagoon-text: #0B6F64;
    --warning: #A86400; --warning-soft: #FCEFD5; --danger: #C2253A; --danger-soft: #FBE3E6;
    --assist: #6D3FD0; --assist-soft: #EEE6FD; --info: #2E5BC7; --info-soft: #E5ECFB; --tt: #16130F;
    --shadow: 0 10px 30px rgba(40, 30, 20, .12);
    color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); font-size: 15px; line-height: 1.5; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: var(--lagoon-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, .display { font-family: var(--display); letter-spacing: -0.015em; }
h1 { font-size: 36px; line-height: 1.08; font-weight: 800; margin: 0 0 6px; }
h2 { font-size: 22px; font-weight: 700; margin: 0 0 14px; }
h3 { font-size: 16px; font-weight: 700; margin: 0 0 8px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
.w-100 { width: 100%; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-danger { color: var(--danger); font-size: 13px; }
.validation-message { color: var(--danger); font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--lagoon); outline-offset: 2px; }

/* ── Shell : rail de navigation ─────────────────────────────── */
.shell { display: flex; min-height: 100vh; }
.rail { width: var(--rail-w); flex-shrink: 0; background: var(--rail); border-right: 1px solid var(--border); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 0; z-index: 40; }
.rail-logo { width: 46px; height: 46px; border-radius: 15px; background: var(--primary); color: var(--primary-ink); display: grid; place-items: center; margin-bottom: 16px; }
.rail-logo:hover { text-decoration: none; filter: brightness(1.08); }
.rail-link { width: 78px; padding: 10px 0 8px; border-radius: 16px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; position: relative; background: none; border: none; font-family: var(--font); cursor: pointer; }
.rail-link:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.rail-link.active { background: var(--surface-3); color: var(--text); }
.rail-link.active::before { content: ""; position: absolute; left: -9px; top: 12px; bottom: 12px; width: 4px; border-radius: 2px; background: var(--primary); }
.rail-badge { position: absolute; top: 4px; right: 14px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--warning); color: #0B0E14; font-size: 11px; font-weight: 800; display: grid; place-items: center; }
.rail-spacer { flex: 1; }
.rail-more { position: fixed; left: calc(var(--rail-w) + 8px); bottom: 16px; width: 300px; max-height: calc(100vh - 32px); overflow-y: auto; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px; z-index: 60; }
.rail-more h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 10px 10px 6px; font-family: var(--font); }
.rail-more a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--text); font-weight: 600; font-size: 14px; }
.rail-more a:hover, .rail-more a.active { background: var(--surface-2); text-decoration: none; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 10px; padding: 14px 36px; position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); }
.topbar form { margin: 0; }
.topbar-spacer { flex: 1; }
.content { padding: 12px 36px 56px; max-width: 1440px; width: 100%; }
.user-chip { width: 44px; height: 44px; border-radius: 22px; border: 2px solid var(--lagoon); background: var(--surface-3); color: var(--text); display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.user-chip:hover { text-decoration: none; }
.demo-flag { background: var(--warning-soft); color: var(--warning); font-weight: 800; font-size: 12px; padding: 6px 12px; border-radius: 999px; }
.only-mobile { display: none !important; }
.backdrop { display: none; }

@media (max-width: 860px) {
    .shell { flex-direction: column; }
    .rail { position: fixed; top: auto; bottom: 0; left: 0; right: 0; width: 100%; height: 72px; flex-direction: row; justify-content: space-around; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); border-right: none; border-top: 1px solid var(--border); }
    .rail-logo, .rail-spacer, .rail-desktop-only { display: none !important; }
    .rail-link { width: auto; flex: 1; padding: 8px 0; }
    .rail-link.active::before { left: 30%; right: 30%; top: -6px; bottom: auto; width: auto; height: 4px; }
    .rail-more { left: 8px; right: 8px; bottom: 84px; width: auto; }
    .content { padding: 8px 16px 100px; }
    .topbar { padding: 10px 16px; }
    h1 { font-size: 28px; }
}

/* ── En-têtes de page ───────────────────────────────────────── */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.eyebrow { color: var(--muted); font-size: 14px; font-weight: 500; margin: 0 0 6px; }

/* ── Cartes & grilles ───────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
.card.lagoon { background: var(--lagoon-soft); border-color: var(--lagoon-line); }
.card.coral { background: var(--primary-soft); border-color: var(--primary-line); }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.span-2 { grid-column: span 2; }
@media (max-width: 1100px) { .grid-3, .grid-main { grid-template-columns: minmax(0, 1fr); } .span-2 { grid-column: auto; } }
@media (max-width: 760px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 14px 16px; color: var(--text); }
a.kpi:hover { text-decoration: none; border-color: var(--border-strong); }
.kpi .label { color: var(--muted); font-size: 12px; font-weight: 600; }
.kpi .value { font-family: var(--display); font-size: 30px; font-weight: 800; margin-top: 2px; }
.kpi.warn .value { color: var(--warning); }
.kpi.bad .value { color: var(--danger); }
.kpi.good .value { color: var(--lagoon); }

/* ── Boutons & formulaires ──────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border: 1px solid var(--border-strong); background: transparent; color: var(--text); padding: 0 20px; border-radius: 999px; font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none !important; white-space: nowrap; transition: background .15s, transform .1s; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); font-weight: 800; }
.btn-primary:hover { background: var(--primary); filter: brightness(1.08); }
.btn-lagoon, .btn-success { background: var(--lagoon); border-color: var(--lagoon); color: #0B0E14; font-weight: 800; }
.btn-lagoon:hover, .btn-success:hover { background: var(--lagoon); filter: brightness(1.08); }
.btn-light { background: var(--text); border-color: var(--text); color: var(--bg); font-weight: 700; }
.btn-light:hover { background: var(--text); filter: brightness(.95); }
.btn-danger { border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-warn { border-color: var(--warning); color: var(--warning); }
.btn-warn:hover { background: var(--warning-soft); }
.btn-ghost { border-color: transparent; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 13px; }
.btn-lg { min-height: 56px; padding: 0 30px; font-size: 16px; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 22px; border: 1px solid var(--border-strong); background: transparent; color: var(--text); cursor: pointer; position: relative; }
.icon-btn:hover { background: var(--surface-2); }
.form-control, select, textarea, input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=datetime-local], input[type=search], input[type=url] {
    width: 100%; min-height: 48px; padding: 10px 16px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; }
textarea { min-height: 96px; resize: vertical; }
.form-control:focus, select:focus, textarea:focus, input:focus { border-color: var(--lagoon); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--lagoon) 30%, transparent); }
input[type=checkbox], input[type=radio] { accent-color: var(--lagoon); width: 18px; height: 18px; }
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.field .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
.check { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; cursor: pointer; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1 1 160px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.filters > * { flex: 0 1 220px; }
.form-floating { margin-bottom: 14px; }
.form-floating label, .form-label { font-size: 13px; color: var(--muted); }
.alert { padding: 12px 16px; border-radius: 16px; margin-bottom: 16px; border: 1px solid transparent; }
.alert-danger { background: var(--danger-soft); color: var(--danger); }
.alert-success { background: var(--lagoon-soft); color: var(--lagoon-text); }
.alert-warning { background: var(--warning-soft); color: var(--warning); }
.alert-info { background: var(--info-soft); color: var(--info); }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--border-strong); background: transparent; color: var(--text); font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; }
.chip:hover { background: var(--surface-2); text-decoration: none; }
.chip.on, .chip[aria-pressed="true"], .chip[aria-checked="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ── Tables & listes ────────────────────────────────────────── */
.table-wrap { overflow-x: auto; margin: 0 -24px; padding: 0 24px; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: var(--surface-2); }
.empty { text-align: center; color: var(--muted); padding: 32px 12px; }
.list { display: flex; flex-direction: column; gap: 8px; }
.list-item { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); min-width: 0; color: var(--text); }
a.list-item:hover { text-decoration: none; background: var(--surface-3); }
.list-item .grow { flex: 1; min-width: 0; }

/* ── Badges & statuts ───────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 10px; font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--surface-3); color: var(--muted-2); }
.st-draft { background: var(--surface-3); color: var(--muted-2); }
.st-pending { background: var(--warning-soft); color: var(--warning); }
.st-changes { background: var(--warning-soft); color: var(--warning); }
.st-rejected { background: var(--surface-3); color: var(--muted); text-decoration: line-through; }
.st-scheduled { background: var(--surface-3); color: var(--text); }
.st-running { background: var(--info-soft); color: var(--info); }
.st-published { background: var(--lagoon-soft); color: var(--lagoon-text); }
.st-failed { background: var(--danger-soft); color: var(--danger); }
.st-assisted { background: var(--assist-soft); color: var(--assist); }
.pf { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: 13px; }
.pf-dot { width: 11px; height: 11px; border-radius: 6px; display: inline-block; flex-shrink: 0; border: 2px solid var(--bg); }
.pf-instagram .pf-dot, .pf-dot.pf-instagram { background: var(--ig); }
.pf-facebook .pf-dot, .pf-dot.pf-facebook { background: var(--fb); }
.pf-tiktok .pf-dot, .pf-dot.pf-tiktok { background: var(--tt); }
.pf-snapchat .pf-dot, .pf-dot.pf-snapchat { background: var(--sc); }
.mode-chip { font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 7px; background: var(--assist-soft); color: var(--assist); }

/* ── Vignettes de Story (9:16) ──────────────────────────────── */
.thumb { width: 40px; height: 71px; border-radius: 10px; object-fit: cover; background: var(--surface-3); flex-shrink: 0; display: block; }
.thumb-sm { width: 30px; height: 53px; border-radius: 8px; }
.story-tile { position: relative; aspect-ratio: 9 / 16; border-radius: 18px; overflow: hidden; background: var(--surface-3); color: #fff; display: flex; flex-direction: column; justify-content: space-between; padding: 10px; cursor: pointer; border: none; font: inherit; text-align: left; width: 100%; }
.story-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.story-tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.45) 0%, rgba(0,0,0,0) 30%, rgba(0,0,0,0) 55%, rgba(0,0,0,.7) 100%); z-index: 1; }
.story-tile > * { position: relative; z-index: 2; }
.story-tile .t-time { align-self: flex-start; font-size: 12px; font-weight: 800; background: #0B0E14; color: #F4F1EA; padding: 3px 8px; border-radius: 8px; }
.story-tile .t-title { font-family: var(--display); font-weight: 800; font-size: 15px; line-height: 1.1; color: #fff; }
.story-tile .t-foot { display: flex; justify-content: space-between; align-items: center; gap: 4px; }
.story-tile.wait { outline: 3px dashed var(--warning); outline-offset: 3px; }
.story-tile.failed { outline: 3px solid var(--danger); outline-offset: 3px; }
.story-tile.done { opacity: .82; }
.story-tile.selected { outline: 3px solid var(--lagoon); outline-offset: 3px; }
.tile-dots { display: flex; gap: 3px; }
.slot-empty { aspect-ratio: 9 / 16; border-radius: 18px; border: 2px dashed var(--primary); color: var(--primary-text); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 10px; font-weight: 700; font-size: 13px; }
.slot-empty:hover { background: var(--primary-soft); text-decoration: none; }
.slot-add { min-height: 44px; border-radius: 14px; border: 1px dashed var(--border-strong); color: var(--muted-2); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; }
.slot-add:hover { text-decoration: none; background: var(--surface-2); }

/* ── Studio (accueil) ───────────────────────────────────────── */
.hello h1 { font-size: 42px; max-width: 900px; }
.streak { display: flex; align-items: center; gap: 18px; }
.streak-icon { width: 64px; height: 64px; border-radius: 20px; background: var(--primary); color: var(--primary-ink); display: grid; place-items: center; flex-shrink: 0; }
.streak-num { font-family: var(--display); font-size: 40px; font-weight: 800; line-height: 1; margin: 0; }
.streak-days { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 8px; }
.streak-day { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); font-weight: 700; }
.streak-cell { width: 100%; height: 36px; border-radius: 10px; background: var(--surface-3); }
.streak-cell.on { background: var(--lagoon); }
.streak-cell.planned { background: var(--lagoon-soft); border: 2px solid var(--lagoon); }
.streak-cell.today { box-shadow: 0 0 0 2px var(--text); }
.streak-cell.gap { background: transparent; border: 2px dashed var(--primary); }
.nudge { background: var(--primary-soft); border: 1px solid var(--primary-line); color: var(--primary-text); border-radius: 16px; padding: 12px 16px; font-size: 14px; line-height: 1.45; max-width: 420px; }
.nudge strong { color: var(--primary); }
.week-rail { display: grid; grid-template-columns: repeat(7, minmax(120px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 6px; }
.day-col { background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 14px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.day-col.today { border: 2px solid var(--lagoon); }
.day-col.drop { border: 2px dashed var(--primary); background: var(--primary-soft); }
.day-head { display: flex; justify-content: space-between; align-items: baseline; }
.day-head strong { font-size: 15px; }
.cover-bars { display: flex; gap: 4px; }
.cover-bars span { flex: 1; height: 5px; border-radius: 3px; background: var(--border); }
.todo-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 18px; flex-shrink: 0; }

/* ── Assistant de création ──────────────────────────────────── */
.wizard-steps { display: flex; gap: 8px; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.wizard-step { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px 0 6px; border-radius: 22px; border: 1px solid var(--border-strong); background: transparent; color: var(--muted-2); font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; }
.wizard-step .n { width: 32px; height: 32px; border-radius: 16px; display: grid; place-items: center; background: var(--surface-3); color: var(--text); }
.wizard-step.current { background: var(--text); color: var(--bg); border-color: var(--text); }
.wizard-step.current .n { background: var(--primary); color: var(--primary-ink); }
.wizard-step.done .n { background: var(--lagoon); color: #0B0E14; }
.wizard { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.wizard-main { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.wizard-main h1 { font-size: 38px; }
.wizard-side { flex: 1 1 300px; max-width: 330px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.wizard-foot { position: sticky; bottom: 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 18px 0; margin-top: 18px; border-top: 1px solid var(--border); background: var(--bg); z-index: 5; }
.coach { flex: 1 1 280px; max-width: 340px; background: var(--surface); border: 1px solid var(--border); border-radius: 24px; padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.coach-title { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.coach-icon { width: 36px; height: 36px; border-radius: 12px; background: var(--lagoon-soft); color: var(--lagoon); display: grid; place-items: center; }
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 14px; line-height: 1.4; }
.checks li { display: flex; gap: 10px; align-items: flex-start; }
.check-dot { width: 22px; height: 22px; border-radius: 11px; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #0B0E14; flex-shrink: 0; background: var(--lagoon); }
.check-dot.warn { background: var(--warning); }
.check-dot.bad { background: var(--danger); }
.net-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 760px) { .net-grid { grid-template-columns: minmax(0, 1fr); } }
.net-card { background: var(--surface); border: 2px solid var(--border); border-radius: 22px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.net-card.on { border-color: var(--net, var(--lagoon)); }
.net-card.off { opacity: .6; }
.net-toggle { display: flex; align-items: center; gap: 14px; width: 100%; background: none; border: none; color: var(--text); padding: 0; cursor: pointer; font: inherit; text-align: left; }
.net-logo { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-weight: 800; color: #0B0E14; flex-shrink: 0; }
.net-check { width: 30px; height: 30px; border-radius: 15px; display: grid; place-items: center; font-weight: 800; background: var(--surface-3); color: #0B0E14; }
.net-card.on .net-check { background: var(--lagoon); }
.mode-pill { font-size: 12px; font-weight: 700; padding: 6px 10px; border-radius: 10px; }
.mode-auto { background: var(--lagoon-soft); color: var(--lagoon-text); }
.mode-guided { background: var(--assist-soft); color: var(--assist); }
.mode-browser { background: var(--info-soft); color: var(--info); }
.seg { display: inline-flex; gap: 4px; background: var(--bg); border: 1px solid var(--border); border-radius: 14px; padding: 4px; }
.seg button { border: none; background: none; min-height: 34px; padding: 0 12px; border-radius: 10px; font: inherit; font-weight: 700; font-size: 13px; color: var(--muted-2); cursor: pointer; }
.seg button.active { background: var(--text); color: var(--bg); }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.slot { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; text-align: left; padding: 18px; border-radius: 20px; border: 2px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.slot strong { font-family: var(--display); font-size: 21px; font-weight: 800; }
.slot span { font-size: 13px; color: var(--muted-2); }
.slot.on { border-color: var(--lagoon); background: var(--lagoon-soft); }

/* ── Aperçu téléphone ───────────────────────────────────────── */
.phone { width: 300px; aspect-ratio: 9 / 16; max-height: 600px; border-radius: 40px; overflow: hidden; background: #000; position: relative; border: 8px solid var(--surface-3); flex-shrink: 0; }
.phone img, .phone video { width: 100%; height: 100%; object-fit: cover; display: block; }
.phone .safe { position: absolute; left: 10px; right: 10px; border: 1.5px dashed rgba(255,255,255,.6); border-radius: 12px; pointer-events: none; }
.phone .bars { position: absolute; top: 14px; left: 14px; right: 14px; display: flex; gap: 4px; z-index: 2; }
.phone .bars span { flex: 1; height: 3px; border-radius: 2px; background: rgba(255,255,255,.45); }
.phone .bars span.on { background: #fff; }
.phone .who { position: absolute; top: 26px; left: 14px; right: 14px; display: flex; align-items: center; gap: 8px; z-index: 2; color: #fff; font-size: 13px; font-weight: 700; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.phone .who i { width: 28px; height: 28px; border-radius: 14px; background: #fff; display: inline-block; }
.phone .empty-preview { position: absolute; inset: 0; display: grid; place-items: center; color: #9AA3B5; font-size: 14px; text-align: center; padding: 24px; }
.slides { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.slide-tile { position: relative; flex-shrink: 0; }
.slide-tile .thumb { width: 74px; height: 131px; border-radius: 12px; cursor: pointer; }
.slide-tile .tools { display: flex; gap: 2px; justify-content: center; margin-top: 4px; }
.slide-add { width: 74px; height: 131px; border: 2px dashed var(--border-strong); border-radius: 12px; display: grid; place-items: center; color: var(--muted-2); cursor: pointer; background: none; font: inherit; font-weight: 700; }

/* ── Validation immersive ───────────────────────────────────── */
.review { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; justify-content: center; }
.review-queue { flex: 0 1 112px; display: flex; flex-direction: column; gap: 12px; }
.review-queue button { width: 96px; aspect-ratio: 9 / 16; border-radius: 16px; overflow: hidden; border: 3px solid transparent; background: var(--surface-3); padding: 0; cursor: pointer; position: relative; }
.review-queue button img { width: 100%; height: 100%; object-fit: cover; display: block; }
.review-queue button.current { border-color: var(--text); }
.review-queue button.seen { opacity: .35; }
.review-queue .q-time { position: absolute; top: 6px; left: 6px; font-size: 11px; font-weight: 800; background: #0B0E14; color: #F4F1EA; padding: 2px 6px; border-radius: 6px; }
.review-stage { flex: 0 1 380px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.review-stage .phone { width: 380px; max-height: 676px; border: none; border-radius: 34px; cursor: pointer; }
.review-panel { flex: 1 1 340px; max-width: 440px; display: flex; flex-direction: column; gap: 16px; }
.review-progress { flex: 1; min-width: 160px; display: flex; gap: 6px; }
.review-progress span { flex: 1; height: 6px; border-radius: 3px; background: var(--border); }
.review-progress span.done { background: var(--lagoon); }
.review-progress span.current { background: var(--text); }
.kbd { display: inline-block; min-width: 22px; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--border-strong); font-size: 12px; font-weight: 700; text-align: center; }

/* ── Onglets ────────────────────────────────────────────────── */
.tabs { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 18px; flex-wrap: wrap; }
.tabs a, .tabs button { min-height: 40px; display: inline-flex; align-items: center; padding: 0 16px; border-radius: 999px; color: var(--muted-2); font-weight: 600; background: none; border: 1px solid var(--border-strong); cursor: pointer; font: inherit; }
.tabs a.active, .tabs button.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.tabs a:hover { text-decoration: none; }
.tabs.vertical { flex-direction: column; }

/* ── Fiche latérale ─────────────────────────────────────────── */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(4, 6, 10, .6); z-index: 70; }
.sheet { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); background: var(--surface); z-index: 71; box-shadow: var(--shadow); display: flex; flex-direction: column; border-left: 1px solid var(--border); }
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.sheet-body { padding: 20px; overflow-y: auto; flex: 1; }
.sheet-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ── Calendrier (mois / liste) ──────────────────────────────── */
.cal-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.cal-title { font-family: var(--display); font-weight: 800; font-size: 22px; min-width: 220px; }
.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.cal-month .dow { font-size: 12px; font-weight: 700; color: var(--muted); padding: 0 8px; }
.cal-day { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; min-height: 124px; padding: 8px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal-day.other { opacity: .45; }
.cal-day.today { border: 2px solid var(--lagoon); }
.cal-day.today .num { color: var(--lagoon-text); }
.cal-day.drop { border: 2px dashed var(--primary); background: var(--primary-soft); }
.cal-day.empty-day { box-shadow: inset 0 -3px 0 var(--primary); }
.cal-day .num { font-size: 13px; font-weight: 800; }
.ev { display: flex; align-items: center; gap: 6px; border-radius: 9px; padding: 3px 6px; font-size: 12px; cursor: pointer; background: var(--surface-3); color: var(--text); min-width: 0; user-select: none; border-left: 3px solid var(--text); }
.ev .t { font-weight: 800; flex-shrink: 0; }
.ev .ttl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.ev img { width: 16px; height: 28px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.ev.st-published { border-left-color: var(--lagoon); }
.ev.st-failed { border-left-color: var(--danger); }
.ev.st-running { border-left-color: var(--info); }
.ev.st-assisted { border-left-color: var(--assist); }
.ev.st-pending { border-left-color: var(--warning); }
.ev.st-rejected { opacity: .55; }
.ev.selected { outline: 2px solid var(--lagoon); }
.cal-more { font-size: 11px; color: var(--muted); }
.cal-week { display: grid; grid-template-columns: 56px repeat(7, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--radius); overflow: auto; max-height: 72vh; background: var(--surface); }
.cal-week.one-day { grid-template-columns: 56px minmax(0, 1fr); }
.cal-week .head { position: sticky; top: 0; background: var(--surface-2); z-index: 2; padding: 8px; font-size: 12px; font-weight: 700; border-bottom: 1px solid var(--border); text-align: center; }
.cal-week .hour { font-size: 11px; color: var(--muted); padding: 2px 6px; border-top: 1px solid var(--border); height: 56px; }
.cal-week .slot { border-top: 1px solid var(--border); border-left: 1px solid var(--border); height: 56px; padding: 2px; display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.cal-week .slot.drop { background: var(--primary-soft); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted-2); margin-top: 16px; align-items: center; }
@media (max-width: 760px) { .cal-day { min-height: 70px; } .cal-day .ev .ttl, .cal-day .ev img { display: none; } }

/* ── Graphiques ─────────────────────────────────────────────── */
.bars { display: flex; align-items: flex-end; gap: 4px; height: 160px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; height: 100%; justify-content: flex-end; }
.bar-stack { width: 100%; max-width: 26px; display: flex; flex-direction: column-reverse; border-radius: 6px 6px 0 0; overflow: hidden; background: var(--surface-3); }
.bar-stack .ok { background: var(--lagoon); }
.bar-stack .ko { background: var(--danger); }
.bar-stack .plan { background: var(--text); opacity: .35; }
.bar-col .lbl { font-size: 10px; color: var(--muted); }
.hbar { display: grid; grid-template-columns: 110px 1fr 40px; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; }
.hbar .track { height: 10px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.hbar .fill { height: 100%; background: var(--primary); border-radius: 999px; }

/* ── Médiathèque ────────────────────────────────────────────── */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.media-card { border: 2px solid transparent; border-radius: 18px; overflow: hidden; background: var(--surface); position: relative; cursor: pointer; padding: 0; color: var(--text); font: inherit; text-align: left; }
.media-card.selected { border-color: var(--lagoon); }
.media-card .ph { aspect-ratio: 9 / 16; background: var(--surface-3); display: block; width: 100%; object-fit: cover; }
.media-card .meta { padding: 6px 10px 8px; font-size: 12px; }
.media-card .kind { position: absolute; top: 8px; left: 8px; background: #0B0E14; color: #F4F1EA; font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: 6px; }
.dropzone { border: 2px dashed var(--border-strong); border-radius: 26px; padding: 34px; text-align: center; color: var(--muted-2); position: relative; background: var(--rail); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.dropzone strong { color: var(--text); font-size: 18px; }
.dropzone:hover, .dropzone.over { border-color: var(--lagoon); }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }

/* ── Éditeur ────────────────────────────────────────────────── */
.editor { display: grid; grid-template-columns: 240px minmax(0, 1fr) 290px; gap: 18px; align-items: start; }
.editor-stage { display: flex; justify-content: center; }
.editor canvas { width: min(360px, 100%); aspect-ratio: 9 / 16; border-radius: 18px; box-shadow: var(--shadow); background: #000; touch-action: none; }
@media (max-width: 1100px) { .editor { grid-template-columns: minmax(0, 1fr); } }

/* ── Notifications ──────────────────────────────────────────── */
.bell-count { position: absolute; top: 2px; right: 2px; background: var(--primary); color: var(--primary-ink); font-size: 10px; font-weight: 800; min-width: 17px; height: 17px; border-radius: 999px; display: grid; place-items: center; padding: 0 4px; }
.notif { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.notif.unread .notif-title { font-weight: 700; }
.notif .sev { width: 9px; height: 9px; border-radius: 50%; margin-top: 7px; flex-shrink: 0; background: var(--info); }
.notif .sev.Critical { background: var(--danger); }
.notif .sev.Warning { background: var(--warning); }
.notif .sev.Success { background: var(--lagoon); }
.dropdown { position: relative; }
.dropdown-panel { position: absolute; right: 0; top: 52px; width: min(400px, 92vw); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px 16px; z-index: 50; max-height: 70vh; overflow-y: auto; }

/* ── Frise (versions, commentaires) ─────────────────────────── */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 16px 20px; border-left: 2px solid var(--border); margin-left: 4px; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--lagoon); }
.timeline .when { font-size: 12px; color: var(--muted); }

/* ── Connexion ──────────────────────────────────────────────── */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--bg); }
.auth-card { width: min(440px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 28px; padding: 32px; }
.auth-brand { display: flex; align-items: center; gap: 12px; font-family: var(--display); font-weight: 800; font-size: 18px; margin-bottom: 22px; }
.brand-mark { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; color: var(--primary-ink); background: var(--primary); }

/* ── Blazor ─────────────────────────────────────────────────── */
#blazor-error-ui { background: var(--warning-soft); color: var(--warning); bottom: 0; display: none; left: 0; padding: .6rem 1.25rem .7rem; position: fixed; width: 100%; z-index: 1000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }
.blazor-error-boundary { background: var(--danger-soft); color: var(--danger); padding: 1rem; border-radius: 14px; }
.blazor-error-boundary::after { content: "Une erreur est survenue."; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Inside the Windows app (WebView2 host) */
.in-desktop .desktop-hide { display: none !important; }
.desktop-only { display: none !important; }
.in-desktop .desktop-only { display: revert !important; }

/* Mode B: one line per publication format */
.format-status { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.format-status li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
