/* ===== Liveproject — design system ===== */
:root { --radius: 13px; --brand: #2563eb; /* couleur du logo (favicon) */ }

html[data-theme="dark"] {
  --bg:#0e1015; --panel:#171a21; --panel2:#1e222b; --line:#272c37;
  --text:#e8ebf2; --muted:#8b93a3; --accent:#6ea8fe; --accent-soft:rgba(110,168,254,.14);
  --danger:#ef4444; --danger-soft:rgba(239,68,68,.13);
  --page-grad: radial-gradient(ellipse 90% 45% at 50% 0%, rgba(110,168,254,.07) 0%, transparent 65%);
  /* Accents par domaine — vidéo (bleu) · twitch (violet) · écriture (vert) */
  --video:#6ea8fe;    --video-soft:rgba(110,168,254,.16);
  --twitch:#a78bfa;   --twitch-soft:rgba(167,139,250,.18);
  --ecriture:#3fbf80; --ecriture-soft:rgba(63,191,128,.15);
}
html[data-theme="light"] {
  --bg:#f3f4f7; --panel:#ffffff; --panel2:#eef0f4; --line:#e2e5ea;
  --text:#1b1e25; --muted:#6c7480; --accent:#2563eb; --accent-soft:rgba(37,99,235,.10);
  --danger:#dc2626; --danger-soft:rgba(220,38,38,.10);
  --page-grad: radial-gradient(ellipse 90% 45% at 50% 0%, rgba(37,99,235,.06) 0%, transparent 65%);
  /* Accents par domaine — vidéo (bleu) · twitch (violet) · écriture (vert) */
  --video:#2563eb;    --video-soft:rgba(37,99,235,.10);
  --twitch:#7c3aed;   --twitch-soft:rgba(124,58,237,.10);
  --ecriture:#15803d; --ecriture-soft:rgba(21,128,61,.10);
}

/* Un conteneur marqué [data-domain] remappe l'accent générique sur la couleur
   de son domaine : tout le code existant qui utilise var(--accent) / var(--accent-soft)
   (icônes, jauges, %, survols, pastilles de domaine) se colore automatiquement. */
[data-domain="video"]    { --accent: var(--video);    --accent-soft: var(--video-soft); }
[data-domain="twitch"]   { --accent: var(--twitch);   --accent-soft: var(--twitch-soft); }
[data-domain="ecriture"] { --accent: var(--ecriture); --accent-soft: var(--ecriture-soft); }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; background-color: var(--bg); background-image: var(--page-grad); background-attachment: fixed; color: var(--text);
  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
  line-height: 1.5; -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column; min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: none; }
.muted { color: var(--muted); }
i[data-lucide] { display: inline-block; vertical-align: middle; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 9px; }
@keyframes lpfade { from { opacity: 0; } to { opacity: 1; } }
@keyframes lppop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }

/* ===== Boutons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  border-radius: 10px; padding: 9px 14px; font-size: 13px; font-weight: 700;
  font-family: inherit; cursor: pointer; white-space: nowrap; transition: filter .12s, border-color .12s;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.neutral { background: var(--panel2); border-color: transparent; }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.danger { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.btn.grow { flex: 2; }

/* ===== Topbar ===== */
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 14px 22px;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 30;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 16px; letter-spacing: -.02em; color: var(--text); }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; }
.brand-logo { width: 26px; height: 26px; border-radius: 7px; display: block; flex: none; }
.spacer { flex: 1; }
.search { display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 7px 11px; min-width: 180px; }
.search input { border: none; outline: none; background: transparent; color: var(--text); font-size: 13px; width: 100%; font-family: inherit; }
.theme-toggle { display: flex; align-items: center; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 99px; padding: 4px; }
.theme-toggle button { border: none; background: transparent; color: var(--muted); font-weight: 700; font-size: 12px; padding: 6px 13px; border-radius: 99px; cursor: pointer; font-family: inherit; }
.theme-toggle button.on { background: var(--accent); color: #fff; }
.logout { color: var(--muted); display: inline-flex; padding: 6px; }
.logout:hover { color: var(--text); }

/* ===== Nav desktop ===== */
.mainnav { display: flex; align-items: center; gap: 6px; padding: 11px 22px; border-bottom: 1px solid var(--line); }
.mainnav a { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-weight: 700; font-size: 13px; padding: 8px 13px; border-radius: 9px; }
.mainnav a.active { color: var(--accent); background: var(--accent-soft); }
.mainnav a:hover { color: var(--text); }
.nav-dropdown { position: relative; }
.nav-dropdown-trigger { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-weight: 700; font-size: 13px; padding: 8px 13px; border-radius: 9px; background: transparent; border: none; cursor: pointer; font-family: inherit; }
.nav-dropdown-trigger:hover, .nav-dropdown-trigger.active { color: var(--text); }
.nav-dropdown-trigger.active { color: var(--accent); background: var(--accent-soft); }
.nav-dropdown-menu { display: none; position: absolute; top: calc(100% + 6px); left: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 11px; padding: 6px; min-width: 160px; z-index: 50; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.nav-dropdown.open .nav-dropdown-menu { display: flex; flex-direction: column; gap: 2px; animation: lppop .12s ease; }
.nav-dropdown-menu a { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 700; font-size: 13px; padding: 8px 11px; border-radius: 7px; }
.nav-dropdown-menu a:hover { color: var(--text); background: var(--panel2); }
.nav-dropdown-menu a.active { color: var(--accent); background: var(--accent-soft); }

/* ===== Container ===== */
.container { flex: 1; width: 100%; max-width: 920px; margin: 0 auto; padding: 24px 28px 48px; animation: lpfade .3s ease; }
h1 { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -.03em; }
.section-title { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 14px; color: var(--muted); margin: 26px 0 12px; }
.section-title .ic-red { color: var(--danger); }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { flex: 1; }
.head-actions { display: flex; gap: 8px; align-items: center; }
.empty { padding: 2rem 0; }

/* ===== Dashboard ===== */
.greeting-date { font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.greeting { margin: 0 0 22px; }
.focus-list, .progress-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.focus-item { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; cursor: pointer; display: flex; align-items: center; gap: 13px; }
.focus-item:hover { border-color: var(--accent); }
.focus-ic { width: 34px; height: 34px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; flex: none; }
.focus-main { flex: 1; min-width: 0; }
.focus-titre { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.focus-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.focus-tags { display: flex; align-items: center; gap: 12px; flex: none; }

.progress-row { background: linear-gradient(150deg, var(--accent-soft), transparent 70%), var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 17px; cursor: pointer; display: block; transition: border-color .12s, box-shadow .12s; box-shadow: 0 6px 18px -10px var(--accent-soft); }
.progress-row:hover { border-color: var(--accent); box-shadow: 0 12px 26px -10px var(--accent-soft); }
.progress-top { display: flex; align-items: center; gap: 11px; margin-bottom: 11px; }
.dom-ic { width: 30px; height: 30px; border-radius: 8px; background: var(--panel2); color: var(--muted); display: flex; align-items: center; justify-content: center; flex: none; }
.progress-nom { font-weight: 700; font-size: 14px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.progress-bottom { display: flex; align-items: center; gap: 11px; }
.pct-num { font-weight: 800; font-size: 13px; width: 38px; text-align: right; }

/* Jauge */
.jauge { flex: 1; height: 8px; border-radius: 99px; background: var(--panel2); overflow: hidden; }
.card .jauge { flex: none; }
.jauge-fill { height: 100%; background: var(--accent); border-radius: 99px; transition: width .4s; }

/* Pastille statut / priorité */
.pastille { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.pastille .dot, .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
.prio { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; }

/* ===== Agenda paginé ===== */
.week-pager { margin-bottom: 30px; }
.week-pager-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.week-pager-btn { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--muted); flex: none; transition: border-color .12s, color .12s; }
.week-pager-btn:hover { border-color: var(--accent); color: var(--accent); }
.week-pager-btn:disabled { opacity: .35; cursor: default; pointer-events: none; }
.week-pager-label { flex: 1; font-size: 13px; font-weight: 700; color: var(--muted); }
.week-pager-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.week-card { background: var(--panel); border: 1px solid var(--line); border-radius: 13px; padding: 13px; cursor: pointer; transition: border-color .12s; display: flex; flex-direction: column; gap: 0; min-width: 0; }
.week-card:hover { border-color: var(--accent); }
.week-card[hidden] { display: none; }
.week-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; margin-bottom: 9px; }
.week-dow { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.week-day { font-size: 22px; font-weight: 800; line-height: 1; }
.week-mon { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.week-titre { font-size: 12px; font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.week-proj { font-size: 11px; color: var(--muted); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.week-tag { margin-top: 7px; display: inline-block; font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: 99px; border: 1px solid; }
@media (max-width: 760px) {
  .week-pager-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ===== Filtres (chips) ===== */
.filter-row { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 99px; padding: 8px 14px; font-size: 13px; font-weight: 700; cursor: pointer; border: 1px solid var(--line); background: var(--panel); color: var(--muted); }
.filter-chip:hover { border-color: var(--accent); }
.filter-chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

/* ===== Cartes projets ===== */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 13px; }
.card { background: linear-gradient(150deg, var(--accent-soft), transparent 62%), var(--panel); border: 1px solid var(--line); border-radius: 15px; padding: 18px; cursor: pointer; display: flex; flex-direction: column; gap: 13px; transition: border-color .12s, transform .12s, box-shadow .12s; color: var(--text); box-shadow: 0 6px 18px -10px var(--accent-soft); }
.card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 12px 26px -10px var(--accent-soft); }
.card-top { display: flex; align-items: center; gap: 11px; }
.card-ic { width: 38px; height: 38px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; flex: none; }
.card-nom { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-sub { font-size: 12px; color: var(--muted); }
.card-note { font-size: 13px; color: var(--muted); line-height: 1.45; min-height: 36px; margin: 0; }
.card-status { display: flex; align-items: center; gap: 6px; }
.card-status .pastille { flex: 1; }
.card.is-archived { border-style: dashed; opacity: .8; }

/* ===== Détail projet ===== */
.backlink { display: inline-flex; align-items: center; gap: 6px; background: transparent; border: none; color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; margin-bottom: 14px; padding: 0; font-family: inherit; }
.backlink:hover { color: var(--text); }
.detail-head { background: linear-gradient(150deg, var(--accent-soft), transparent 60%), var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 22px; margin-bottom: 22px; box-shadow: 0 8px 22px -12px var(--accent-soft); }
.detail-head.is-archived { border-style: dashed; }
.detail-head-row { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.detail-ic { width: 48px; height: 48px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; flex: none; }
.detail-main { flex: 1; min-width: 200px; }
.detail-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.status-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--text); background: var(--panel2); padding: 5px 10px; border-radius: 99px; }
.detail-note { font-size: 13px; color: var(--muted); margin-top: 7px; line-height: 1.5; }
.detail-pct { text-align: right; min-width: 110px; }
.detail-pct-num { font-size: 34px; font-weight: 800; letter-spacing: -.03em; color: var(--accent); line-height: 1; }
.detail-pct-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.detail-head .jauge { margin-top: 16px; height: 9px; }
.detail-actions { display: flex; gap: 8px; }

.detail-cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; align-items: start; }
.col-title { display: flex; align-items: center; gap: 10px; margin-bottom: 13px; min-height: 38px; }
.col-title > [data-lucide] { color: var(--muted); flex: none; }
.col-title h2 { margin: 0; font-weight: 800; font-size: 16px; flex: 1; }

/* Tâches */
.tasks { display: flex; flex-direction: column; gap: 9px; }
.task { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.task-row { display: flex; align-items: flex-start; gap: 11px; }
.task-check { width: 24px; height: 24px; border-radius: 7px; flex: none; cursor: pointer; display: flex; align-items: center; justify-content: center; border: 1.5px solid var(--line); background: transparent; color: transparent; padding: 0; }
.task-check:hover { border-color: var(--accent); }
.task.is-done .task-check { border-color: var(--accent); background: var(--accent); color: #fff; }
.task-body { flex: 1; min-width: 0; }
.task-titre { font-weight: 700; font-size: 14px; color: var(--text); cursor: pointer; }
.task.is-done .task-titre { text-decoration: line-through; color: var(--muted); }
.task-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.task-meta { display: flex; align-items: center; gap: 9px; margin-top: 9px; flex-wrap: wrap; font-size: 11px; }
.task-meta .pastille, .task-meta .prio { font-size: 11px; }
.task-eche { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--muted); }
.pipeline { display: flex; gap: 6px; margin-top: 11px; flex-wrap: wrap; }
.pl-form { display: contents; }
.pl-step { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 700; padding: 4px 8px; border-radius: 7px; border: 1px solid var(--line); color: var(--muted); background: transparent; cursor: pointer; font-family: inherit; }
.pl-step:hover { border-color: var(--accent); color: var(--accent); }
.pl-step.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.task-write { display: flex; align-items: center; gap: 8px; margin-top: 9px; font-size: 12px; }
.task-write .jauge { max-width: 120px; height: 6px; }

/* Planning */
.calendar { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.cal-month { font-weight: 700; font-size: 14px; text-transform: capitalize; }
.cal-year { font-size: 12px; color: var(--muted); }
.cal-dows, .cal-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dows { margin-bottom: 6px; }
.cal-dow { text-align: center; font-size: 10px; font-weight: 700; color: var(--muted); }
.cal-weeks { display: flex; flex-direction: column; gap: 4px; }
.cal-day { position: relative; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 500; border-radius: 8px; color: var(--text); }
.cal-day.has-task { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.cal-day.today { background: var(--accent); color: #fff; font-weight: 800; }
.cal-day .cal-dot { position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%); width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.cal-day.today .cal-dot { background: #fff; }
.timeline { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.tl-item { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 11px; padding: 11px 13px; }
.tl-date { text-align: center; flex: none; width: 38px; }
.tl-day { font-size: 17px; font-weight: 800; line-height: 1; }
.tl-mon { font-size: 10px; color: var(--muted); text-transform: uppercase; }
.tl-sep { width: 1px; height: 26px; background: var(--line); }
.tl-titre { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-empty { font-size: 13px; color: var(--muted); text-align: center; padding: 14px; }

/* ===== Bloc archives (details) ===== */
.archive-block { margin-top: 20px; }
.archive-block summary { cursor: pointer; color: var(--muted); font-weight: 700; font-size: 13px; padding: 6px 0; }
.archive-block summary:hover { color: var(--text); }
.archive-block .tasks { margin-top: 10px; }
.breadcrumb { margin-bottom: 14px; font-size: 13px; }
.result-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.result-list li { display: flex; gap: 8px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; }
.search-page { display: flex; gap: 8px; margin: 14px 0 20px; }
.search-page input[type=search] { flex: 1; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; color: var(--text); font-size: 14px; outline: none; font-family: inherit; }

/* ===== Nav mobile ===== */
.bottomnav { display: none; position: sticky; bottom: 0; border-top: 1px solid var(--line); background: var(--bg); z-index: 30; }
.bottomnav a, .bottomnav button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 11px 0; background: transparent; border: none; color: var(--muted); cursor: pointer; font-family: inherit; font-size: 10px; font-weight: 600; }
.bottomnav a.active { color: var(--accent); }
.bottomnav .create { color: var(--accent); font-weight: 700; }

/* ===== Modale ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; animation: lpfade .2s ease; }
.modal { background: var(--bg); border: 1px solid var(--line); border-radius: 18px; width: 100%; max-width: 520px; max-height: 92vh; overflow: auto; animation: lppop .28s ease; }
.modal-head { position: sticky; top: 0; background: var(--bg); display: flex; align-items: center; gap: 11px; padding: 18px 20px; border-bottom: 1px solid var(--line); z-index: 2; }
.modal-ic { width: 32px; height: 32px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.modal-title { font-weight: 800; font-size: 16px; flex: 1; }
.modal-x { background: var(--panel2); border: none; border-radius: 8px; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text); }
.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 18px; }
.modal-foot { position: sticky; bottom: 0; background: var(--bg); display: flex; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--line); align-items: center; }
.foot-left { display: flex; gap: 8px; margin-right: auto; }

/* Champs */
.field { display: block; }
.field-label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 9px; letter-spacing: .02em; }
.range-label { display: flex; justify-content: space-between; }
.range-val { color: var(--accent); }
.modal input[type=text], .modal input[type=date], .modal input[type=url], .modal input[type=search], .modal textarea {
  width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 13px; color: var(--text); font-size: 14px; outline: none; font-family: inherit;
}
.modal textarea { resize: vertical; }
.modal input:focus, .modal textarea:focus { border-color: var(--accent); }
.modal input[type=range] { width: 100%; accent-color: var(--accent); }
.proj-pill { display: flex; align-items: center; gap: 9px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; }
.proj-nom { font-weight: 700; font-size: 14px; }

/* Contrôles segmentés */
.seg-row { display: flex; gap: 8px; flex-wrap: wrap; }
.seg { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 10px; padding: 11px 8px; font-size: 13px; font-weight: 700; cursor: pointer; border: 1px solid var(--line); background: var(--panel); color: var(--muted); font-family: inherit; }
.seg.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.link-btn { margin-top: 10px; display: inline-flex; align-items: center; gap: 5px; background: transparent; border: none; color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer; padding: 0; font-family: inherit; }
.link-btn:hover { color: var(--text); }
.adv-row { display: flex; gap: 7px; margin-top: 10px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 99px; padding: 7px 12px; font-size: 12px; font-weight: 700; cursor: pointer; border: 1px solid var(--line); background: var(--panel); color: var(--muted); font-family: inherit; }
.chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

/* Pipeline (modale) */
.pipe-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pipe-toggle { display: inline-flex; align-items: center; gap: 8px; border-radius: 10px; padding: 11px 12px; font-size: 13px; font-weight: 700; cursor: pointer; border: 1px solid var(--line); background: var(--panel); color: var(--muted); }
.pipe-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.pipe-box { width: 18px; height: 18px; border-radius: 5px; display: flex; align-items: center; justify-content: center; border: 1.5px solid var(--line); background: transparent; color: transparent; flex: none; }
.pipe-toggle:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.pipe-toggle:has(input:checked) .pipe-box { border-color: var(--accent); background: var(--accent); color: #fff; }
/* ===== Zone vignette (drag & drop) ===== */
.vignette-zone { display: flex; flex-direction: column; gap: 8px; }
.vignette-drop { position: relative; border: 1.5px dashed var(--line); border-radius: 11px; min-height: 90px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: border-color .15s, background .15s; overflow: hidden; }
.vignette-drop:hover, .vignette-drop.drag-over { border-color: var(--accent); background: var(--accent-soft); }
.vignette-drop.has-file { border-style: solid; border-color: var(--accent); cursor: default; }
.vignette-file-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; z-index: 2; }
.vignette-drop-ui { display: flex; flex-direction: column; align-items: center; gap: 7px; color: var(--muted); padding: 18px 12px; text-align: center; pointer-events: none; font-size: 13px; line-height: 1.45; }
.vignette-hint { font-size: 11px; color: var(--muted); opacity: .75; }
.vignette-preview { position: relative; width: 100%; }
.vignette-preview img { width: 100%; height: 120px; object-fit: cover; display: block; }
.vignette-clear { position: absolute; top: 6px; right: 6px; background: rgba(0,0,0,.65); color: #fff; border: none; border-radius: 99px; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 15px; line-height: 1; z-index: 4; }
/* Bouton « Ouvrir l'éditeur de script » — pleine largeur, centré sous la description */
.script-modal-link { display: flex; width: 100%; padding: 13px 14px; font-size: 14px; }

/* Espacement homogène entre les champs groupés dans une section de type (modale tâche) */
[data-type-section] > * + * { margin-top: 18px; }

/* ===== Login ===== */
html[data-theme="dark"]  { --login-grad: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(110,168,254,.18) 0%, transparent 70%), linear-gradient(180deg,#0b0e14 0%,#0e1015 100%); }
html[data-theme="light"] { --login-grad: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(37,99,235,.12) 0%, transparent 70%), linear-gradient(180deg,#edf1fb 0%,#f3f4f7 100%); }
.login-page {
    display: grid; place-items: center;
    min-height: 100vh; padding: 1.5rem;
    background: var(--login-grad, var(--bg));
    margin: 0;
}
.login-card {
    background: var(--panel); border: 1px solid var(--line);
    border-radius: 18px; padding: 2.5rem 2rem;
    width: 100%; max-width: 380px;
    display: flex; flex-direction: column; gap: 1.1rem;
    box-shadow: 0 24px 60px rgba(0,0,0,.25);
}
.login-brand {
    display: flex; align-items: center; justify-content: center;
    gap: 10px; font-weight: 800; font-size: 17px;
    letter-spacing: -.02em; color: var(--text);
    margin-bottom: .3rem;
}
.login-app-name { color: var(--text); }
.login-fields { display: flex; flex-direction: column; gap: .6rem; }
.login-fields input {
    width: 100%; background: var(--panel2); border: 1px solid var(--line);
    border-radius: 11px; padding: 13px 14px; color: var(--text);
    font-size: 14px; outline: none; font-family: inherit;
    transition: border-color .15s;
    box-sizing: border-box;
}
.login-fields input:focus { border-color: var(--accent); }
.login-fields input::placeholder { color: var(--muted); }
.login-btn { width: 100%; padding: 13px; font-size: 14px; border-radius: 11px; }
.login-erreur {
    background: var(--danger-soft); border: 1px solid rgba(239,68,68,.25);
    color: var(--danger); border-radius: 9px;
    padding: .6rem .9rem; margin: 0; font-size: 13px; text-align: center;
}
.login-ok {
    background: var(--accent-soft); border: 1px solid var(--accent);
    color: var(--accent); border-radius: 9px;
    padding: .6rem .9rem; margin: 0; font-size: 13px; text-align: center;
}
.login-help { color: var(--muted); font-size: 13px; text-align: center; margin: 0; line-height: 1.5; }
.login-link { color: var(--muted); font-size: 13px; text-align: center; text-decoration: none; }
.login-link:hover { color: var(--accent); }

/* ===== Notes inline ===== */
/* ===== Onglets de vue ===== */
.view-tabs { display: flex; align-items: center; gap: 6px; margin-bottom: 18px; }
.view-tab { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 9px; font-size: 13px; font-weight: 700; color: var(--muted); border: 1px solid transparent; text-decoration: none; transition: color .12s, border-color .12s, background .12s; }
.view-tab:hover { color: var(--text); border-color: var(--line); }
.view-tab.on { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.view-tabs-spacer { flex: 1; }


/* ===== Kanban unifié (3 colonnes statut) ===== */
.kanban-uni { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.kanban-uni .kanban-col { flex: none; min-height: 120px; }
.kanban-uni [data-kanban-col].drag-over > .kanban-cards { outline: 2px dashed var(--accent); outline-offset: 4px; border-radius: 8px; }
.kanban-uni [data-kanban-card-id].dragging { opacity: .4; }
@media (max-width: 760px) {
  .kanban-uni { grid-template-columns: 1fr; }
}

.notes-block { margin-bottom: 18px; }
.notes-label { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.notes-area { width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 14px; color: var(--text); font-size: 14px; font-family: inherit; line-height: 1.6; resize: vertical; outline: none; transition: border-color .15s; min-height: 72px; box-sizing: border-box; }
.notes-area:focus { border-color: var(--accent); }
.notes-area::placeholder { color: var(--muted); }

/* ===== Module écriture — étapes ===== */
.etape-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.etape-btn { display: flex; flex-direction: column; align-items: center; gap: 5px; border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 6px; font-size: 11px; font-weight: 700; cursor: pointer; background: var(--panel); color: var(--muted); font-family: inherit; transition: border-color .15s, background .15s, color .15s; }
.etape-btn.on { border-color: var(--etape-color); background: color-mix(in srgb, var(--etape-color) 12%, transparent); color: var(--etape-color); }
.etape-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 99px; border: 1.5px solid; background: transparent; }

/* ===== Kanban écriture ===== */
.kanban-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.kanban-head h2 { margin: 0; font-weight: 800; font-size: 16px; flex: 1; }
.kanban { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 18px; }
.kanban-col { flex: 0 0 200px; display: flex; flex-direction: column; gap: 8px; }
.kanban-col-head { display: flex; align-items: center; gap: 7px; padding: 9px 12px; border-radius: 10px; font-size: 12px; font-weight: 800; color: var(--col-color); background: color-mix(in srgb, var(--col-color) 10%, transparent); border: 1.5px solid color-mix(in srgb, var(--col-color) 25%, transparent); }
.kanban-col-head span:first-of-type { flex: 1; }
.kanban-count { background: color-mix(in srgb, var(--col-color) 20%, transparent); border-radius: 99px; padding: 1px 7px; font-size: 11px; }
.kanban-cards { display: flex; flex-direction: column; gap: 7px; }
.kanban-card { background: var(--panel); border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px; cursor: pointer; transition: border-color .15s; }
.kanban-card:hover { border-color: var(--accent); }
.kanban-card.is-done { opacity: .5; }
.kanban-card-titre { font-size: 13px; font-weight: 700; line-height: 1.35; margin-bottom: 5px; }
.kanban-card.is-done .kanban-card-titre { text-decoration: line-through; color: var(--muted); }
.kanban-card-sub { font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.kanban-card-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kanban-card-meta .task-check { width: 20px; height: 20px; border-radius: 6px; }
.kanban-card-meta .task-check.is-done { border-color: var(--accent); background: var(--accent); color: #fff; }
.kanban-empty { color: var(--muted); font-size: 12px; text-align: center; padding: 18px 0; }
.ecriture-planning { max-width: 340px; margin-top: 18px; }

/* ===== Agenda Twitch ===== */
.agenda-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.agenda-head h2 { margin: 0; font-weight: 800; font-size: 16px; flex: 1; }
.agenda-section { margin-bottom: 20px; }
.agenda-section-title { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.agenda-list { display: flex; flex-direction: column; gap: 8px; }
.stream-row { display: flex; align-items: center; gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 14px; transition: border-color .15s; }
.stream-row:hover { border-color: var(--accent); }
.stream-row.is-past { opacity: .55; }
.stream-date { display: flex; flex-direction: column; align-items: center; min-width: 38px; flex: none; }
.stream-date--empty { opacity: .4; }
.stream-dow { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.stream-day { font-size: 22px; font-weight: 800; line-height: 1; color: var(--accent); }
.stream-mon { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.stream-body { flex: 1; min-width: 0; }
.stream-titre { font-size: 14px; font-weight: 700; cursor: pointer; margin-bottom: 5px; }
.stream-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.stream-heure, .stream-duree { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.stream-thema { display: inline-flex; align-items: center; gap: 4px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modal input[type=time], .modal input[type=number] { width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 13px; color: var(--text); font-size: 14px; outline: none; font-family: inherit; box-sizing: border-box; }
.modal input[type=time]:focus, .modal input[type=number]:focus { border-color: var(--accent); }

/* ===== Drag & drop tâches ===== */
.task-drag { cursor: grab; color: var(--muted); flex: none; display: flex; align-items: center; padding: 2px; border-radius: 6px; opacity: 0; transition: opacity .15s; touch-action: none; }
.task:hover .task-drag, .task:focus-within .task-drag { opacity: 1; }
.task.dragging { opacity: .35; border-style: dashed; }
.task.drag-over { border-color: var(--accent); background: var(--accent-soft); }
.tasks[data-sortable] { position: relative; }

/* ===== Import Notion ===== */
.import-wrap { max-width: 600px; margin: 0 auto; }
.import-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.import-card--json { border-color: var(--accent); }
.import-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.import-divider::before, .import-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.import-intro p { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.import-help { margin-bottom: 20px; font-size: 13px; color: var(--muted); }
.export-grid { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.export-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; text-decoration: none; color: var(--text); }
.export-item:hover { border-color: var(--accent); }
.export-item-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.export-item-info strong { font-size: 14px; font-weight: 700; }
.export-item-info span { font-size: 12px; color: var(--muted); font-weight: 500; }
.import-help summary { cursor: pointer; font-weight: 600; color: var(--text); }
.import-help ol { margin: 10px 0 0 16px; line-height: 1.7; }
.import-form .field { margin-bottom: 18px; }
.file-drop { position: relative; border: 2px dashed var(--line); border-radius: var(--radius); padding: 36px 20px; text-align: center; transition: border-color .2s, background .2s; cursor: pointer; background: var(--panel2); }
.file-drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; z-index: 2; }
.file-drop-ui { display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.file-drop-ui [data-lucide] { color: var(--muted); width: 32px; height: 32px; }
.file-drop-text { font-size: 13px; color: var(--muted); }
.file-drop-link { color: var(--accent); pointer-events: all; cursor: pointer; }
.file-drop-name { font-size: 12px; color: var(--accent); font-weight: 700; min-height: 18px; margin-top: 2px; }
.file-drop:hover, .file-drop.drag-active { border-color: var(--accent); background: var(--accent-soft); }
.file-drop:hover .file-drop-ui [data-lucide], .file-drop.drag-active .file-drop-ui [data-lucide] { color: var(--accent); }
.file-drop.has-file { border-color: var(--accent); border-style: solid; background: var(--accent-soft); }
.file-drop.has-file .file-drop-ui [data-lucide] { color: var(--accent); }
.import-mode-row { display: flex; gap: 10px; }
.import-mode-opt { flex: 1; cursor: pointer; display: flex; }
.import-mode-opt .import-mode-box { flex: 1; }
.import-mode-opt input { display: none; }
.import-mode-box { display: block; border: 1.5px solid var(--line); border-radius: var(--radius); padding: 12px 14px; transition: border-color .15s, background .15s; background: var(--panel2); }
.import-mode-box strong { display: block; font-size: 13px; margin-bottom: 2px; }
.import-mode-box small { display: block; font-size: 11px; color: var(--muted); }
.import-mode-opt input:checked + .import-mode-box { border-color: var(--accent); background: var(--accent-soft); }
.import-errors { margin-bottom: 16px; }
.import-error { background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.3); color: #ef4444; border-radius: 8px; padding: 10px 14px; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.import-preview { max-width: 680px; }
.import-summary { display: flex; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.import-stat { display: flex; align-items: center; gap: 6px; font-size: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 6px 14px; }
.import-stat.warn { border-color: rgba(245,158,11,.4); background: rgba(245,158,11,.06); color: #f59e0b; }
.import-proj-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.import-proj-row { display: flex; align-items: center; gap: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
.import-proj-info { flex: 1; min-width: 0; }
.import-proj-nom { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.import-proj-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.import-badge { background: var(--panel2); border-radius: 20px; padding: 2px 8px; font-size: 11px; }
.import-proj-dom { display: flex; flex-direction: column; gap: 2px; min-width: 120px; }
.import-dom-sel { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font-size: 13px; color: var(--text); width: 100%; font-family: inherit; }
.import-orphelines { margin-bottom: 20px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; font-size: 13px; }
.import-orphelines summary { cursor: pointer; color: #f59e0b; font-weight: 600; }
.import-orphelines ul { margin: 10px 0 0 16px; color: var(--muted); line-height: 1.7; }
.import-foot { display: flex; gap: 8px; align-items: center; margin-top: 8px; }

/* ===== Réglages ===== */
.settings-flash { display: flex; align-items: center; gap: 8px; border-radius: 10px; padding: 11px 16px; font-size: 13px; font-weight: 600; margin-bottom: 18px; }
.settings-flash.ok { background: rgba(34,197,94,.1); border: 1px solid rgba(34,197,94,.3); color: #22c55e; }
.settings-flash.err { background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.3); color: #ef4444; }
.settings-section { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; overflow: hidden; }
.settings-section-head { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.settings-section-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; flex: none; }
.settings-section-title { font-weight: 800; font-size: 15px; margin-bottom: 2px; }
.settings-section-sub { font-size: 12px; color: var(--muted); }
.settings-body { padding: 20px; }
.settings-form .field { margin-bottom: 14px; }
.settings-input { width: 100%; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; color: var(--text); font-size: 14px; font-family: inherit; outline: none; transition: border-color .15s; }
.settings-input:focus { border-color: var(--accent); }
.settings-field-row { display: flex; gap: 10px; align-items: center; }
.settings-field-row .settings-input { flex: 1; }
.theme-cards { display: flex; gap: 12px; }
.theme-card { background: none; border: 2px solid var(--line); border-radius: var(--radius); padding: 14px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: 130px; transition: border-color .15s; }
.theme-card:hover { border-color: var(--accent); }
.theme-card.active { border-color: var(--accent); background: var(--accent-soft); }
.theme-card-label { font-size: 13px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 6px; }
.theme-preview { width: 100px; height: 64px; border-radius: 8px; overflow: hidden; flex: none; }
.dark-preview { background: #0e1015; }
.dark-preview .tp-topbar { height: 14px; background: #171a21; border-bottom: 1px solid #272c37; }
.dark-preview .tp-body { padding: 6px 5px; display: flex; flex-direction: column; gap: 4px; }
.dark-preview .tp-card { height: 14px; background: #1e222b; border-radius: 4px; }
.light-preview { background: #f3f4f7; }
.light-preview .tp-topbar { height: 14px; background: #ffffff; border-bottom: 1px solid #e2e5ea; }
.light-preview .tp-body { padding: 6px 5px; display: flex; flex-direction: column; gap: 4px; }
.light-preview .tp-card { height: 14px; background: #eef0f4; border-radius: 4px; }
.auto-preview { background: linear-gradient(to right, #0e1015 50%, #f3f4f7 50%); }
.auto-preview .tp-topbar { height: 14px; background: linear-gradient(to right, #171a21 50%, #ffffff 50%); border-bottom: 1px solid #272c37; }
.auto-preview .tp-body { padding: 6px 5px; display: flex; flex-direction: column; gap: 4px; }
.auto-preview .tp-card { height: 14px; background: linear-gradient(to right, #1e222b 50%, #eef0f4 50%); border-radius: 4px; }
/* ===== Page Script ===== */
.btn-sm { padding: 4px 10px; font-size: 0.8em; }
.script-page { display: flex; flex-direction: column; gap: 12px; }
.script-page-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.script-page-header h1 { margin: 0; }
.script-page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.script-saved-badge { font-size: 0.82em; color: #22c55e; font-weight: 600; }
.script-titre-input { width: 100%; font-size: 1em; font-weight: 600;
    padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--panel); color: var(--text); outline: none; font-family: inherit; }
.script-titre-input:focus { border-color: var(--accent); }

/* Barre d'outils — sticky sous la barre de navigation pour rester accessible */
.script-toolbar { display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 6px 10px; position: sticky; top: 67px; z-index: 20; box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.stb-btn { background: transparent; border: 1px solid transparent; border-radius: 7px;
    color: var(--muted); font-size: 12px; font-weight: 700; padding: 5px 10px;
    cursor: pointer; font-family: inherit; transition: background .1s, color .1s; white-space: nowrap; }
.stb-btn:hover { background: var(--panel2); color: var(--text); }
.stb-btn.stb-active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.stb-sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }

/* Éditeur contenteditable */
.script-editor { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 32px 48px; min-height: calc(100vh - 300px); outline: none;
    font-family: 'Courier New', monospace; font-size: 14px; line-height: 1.8;
    color: var(--text); cursor: text; }
.script-editor:focus { border-color: var(--accent); }
.script-editor p { margin: 0; padding: 2px 0; }
.script-editor [data-type="titre"] { font-size: 1.4em; font-weight: bold; text-align: center; text-transform: uppercase; letter-spacing: .05em; margin: 12px 0; }
.script-editor [data-type="corps"] { line-height: 1.8; }
.script-editor [data-type="scene"] { font-weight: bold; text-transform: uppercase; letter-spacing: .1em;
    background: rgba(180,120,20,.12); border-left: 3px solid #b47814; color: #c8900a; padding: 4px 10px; margin: 18px 0 6px; font-size: 0.9em; }
.script-editor [data-type="personnage"] { text-align: center; text-transform: uppercase; font-weight: bold;
    font-size: 0.88em; letter-spacing: .08em; color: #4a90d9; margin: 14px 0 2px; }
.script-editor [data-type="dialogue"] { margin: 0 auto; width: 65%; text-align: left; line-height: 1.7; }
.script-editor [data-type="saut-page"] { border-top: 2px dashed var(--line); margin: 28px 0; height: 0;
    display: block; position: relative; pointer-events: none; }
.script-editor [data-type="saut-page"]::after { content: 'SAUT DE PAGE';
    position: absolute; left: 50%; top: -9px; transform: translateX(-50%);
    background: var(--panel); color: var(--muted); font-size: 10px; font-weight: 700;
    letter-spacing: .1em; padding: 0 8px; font-family: inherit; }

/* ===== Responsive ===== */
@media (max-width: 760px) {
  html[data-theme] { --radius: 13px; }
  .mainnav { display: none; }
  .bottomnav { display: flex; }
  .topbar { padding: 12px 16px; }
  .topbar .search, .topbar .btn.primary { display: none; }
  .container { padding: 18px 16px 84px; max-width: 100%; }
  h1 { font-size: 24px; }
  .cards { grid-template-columns: 1fr; }
  .detail-cols { grid-template-columns: 1fr; }
  .detail-pct { text-align: left; min-width: 0; }
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal { max-width: 100%; border-radius: 18px 18px 0 0; }
}
/* =====================================================================
   Liveproject — additions à coller à la FIN de public/css/style.css
   (3 évolutions : échéances en retard · compteur pipeline · quick-add
    + styles de la page tache_form.php redesignée)
   ===================================================================== */

/* ---- Échéance en retard (liste de tâches + focus) ---- */
.task-eche.is-late { color: var(--danger); font-weight: 700; }
.badge-late {
  display: inline-flex; align-items: center; font-size: 11px; font-weight: 800;
  padding: 3px 8px; border-radius: 99px; color: var(--danger); border: 1px solid var(--danger);
  flex: none;
}

/* ---- Compteur d'avancement pipeline (X/5) ---- */
.pipe-count {
  font-size: 10px; font-weight: 800; color: var(--muted);
  padding: 4px 7px; border-radius: 7px; background: var(--panel2);
  align-self: center;
}

/* ---- Quick-add : ajout d'une tâche en tête de liste ---- */
.quick-add {
  display: flex; align-items: center; gap: 9px;
  background: var(--panel); border: 1px dashed var(--line); border-radius: 11px;
  padding: 6px 8px 6px 13px; margin-bottom: 11px;
}
.quick-add > [data-lucide] { color: var(--muted); flex: none; }
.quick-add input {
  flex: 1; border: none; outline: none; background: transparent;
  color: var(--text); font-size: 13px; font-family: inherit;
}
.quick-add .btn { padding: 7px 13px; font-size: 12px; }

/* ---- Page formulaire tâche (tache_form.php) ---- */
.form-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 22px; display: flex; flex-direction: column; gap: 16px;
}
.form-card input[type=text], .form-card input[type=date], .form-card input[type=time],
.form-card input[type=number], .form-card input[type=url], .form-card textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 13px; color: var(--text); font-size: 14px; outline: none; font-family: inherit;
  box-sizing: border-box;
}
.form-card textarea { resize: vertical; }
.form-card input:focus, .form-card textarea:focus { border-color: var(--accent); }
.form-card .dropzone input { background: transparent; border: none; padding: 0; text-align: center; }
.form-card .field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 4px; }
.form-delete { margin-top: 16px; }
@media (max-width: 760px) { .form-card .field-row { grid-template-columns: 1fr; } }

/* ===== Page publique : présentation projet & script (lecture seule) ===== */
.pub-body { background-image: var(--page-grad); }
.pub-page { width: 100%; max-width: 860px; margin: 0 auto; padding: 18px 20px 60px; flex: 1; }
.pub-topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.pub-brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 14px; }
.pub-back { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; font-size: 14px; color: var(--text); }
.pub-back:hover { color: var(--accent); }
.pub-theme { width: 36px; height: 36px; border: 1px solid var(--line); background: var(--panel); color: var(--muted);
  border-radius: 99px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.pub-theme:hover { border-color: var(--accent); color: var(--accent); }
.pub-foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 30px;
  display: flex; align-items: center; justify-content: center; gap: 6px; }
.pub-empty { text-align: center; padding: 80px 20px; }
.script-readonly { min-height: 0; }

/* ===== Présentation (blocs épisodes) ===== */
.pres { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 28px 30px; }
.pres-dom { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; color: var(--accent); background: var(--accent-soft); padding: 6px 12px; border-radius: 99px; margin-bottom: 14px; }
.pres h1 { font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 6px;
  border-left: 4px solid var(--accent); padding-left: 14px; }
.pres-sub { color: var(--muted); font-size: 14px; margin: 0 0 4px 18px; }
.pres-note { color: var(--text); font-size: 14px; margin: 10px 0 4px 18px; }
.pres-ep { border-top: 1px solid var(--line); padding: 24px 0 8px; margin-top: 18px;
  display: grid; grid-template-columns: 220px 1fr; gap: 22px; }
.pres-vignette { aspect-ratio: 16 / 9; border-radius: 12px; border: 1px solid var(--line); overflow: hidden;
  background: var(--panel2); display: flex; align-items: center; justify-content: center; }
.pres-vignette img { width: 100%; height: 100%; object-fit: cover; }
.pres-vignette--empty { background: linear-gradient(135deg, var(--accent-soft), var(--panel2)); color: var(--accent); }
.pres-ep-body h2 { font-size: 19px; font-weight: 800; margin: 0 0 12px; }
.pres-films { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.pres-films li { display: flex; gap: 12px; font-size: 14px; padding: 8px 12px; background: var(--panel2); border-radius: 9px; }
.pres-film-date { flex: none; font-weight: 800; color: var(--accent); min-width: 118px; font-size: 13px; }
.pres-film-real { color: var(--muted); }
.pres-desc { font-size: 14px; color: var(--text); margin: 0 0 14px; white-space: pre-line; }
.pres-actions { display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 640px) {
  .pres { padding: 20px 18px; }
  .pres-ep { grid-template-columns: 1fr; }
  .pres-films li { flex-direction: column; gap: 2px; }
  .pres-film-date { min-width: 0; }
}

/* ===== Éditeur de films (formulaire tâche vidéo) ===== */
.films-editor { display: flex; flex-direction: column; gap: 8px; }
.film-row { display: grid; grid-template-columns: 150px 1fr 1fr 34px; gap: 8px; align-items: center; }
.film-row input { width: 100%; }
.film-del { width: 34px; height: 38px; border: 1px solid var(--line); background: var(--panel); color: var(--muted);
  border-radius: 9px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.film-del:hover { border-color: var(--danger); color: var(--danger); }
.film-add { width: 100%; margin-top: 12px; }
@media (max-width: 640px) {
  .film-row { grid-template-columns: 1fr 1fr; }
  .film-row .film-date-input { grid-column: 1 / -1; }
  .film-del { grid-column: 2; justify-self: end; }
}

/* Lien « vidéo / VOD publiée » sur les tâches terminées */
.task-link { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700;
  color: var(--accent); background: var(--accent-soft); padding: 3px 9px; border-radius: 99px; }
.task-link:hover { filter: brightness(1.08); }

/* Édition depuis la page publique (visiteur connecté) */
.pub-topbar-actions { display: flex; align-items: center; gap: 10px; }
.pub-edit { padding: 7px 12px; }
.pres-ep-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.pres-edit { color: var(--muted); flex: none; padding: 2px; }
.pres-edit:hover { color: var(--accent); }
