:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --ink: #1f2430;
  --muted: #6b7280;
  --line: #e5e7eb;
  --brand: #4f46e5;
  --brand-dark: #4338ca;
  --danger: #dc2626;
  --success: #16a34a;
  --radius: 10px;
}

* { box-sizing: border-box; }

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
}

.topbar {
  background: var(--ink);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.14);
}
.topbar-inner {
  max-width: 2200px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.brand {
  color: #fff;
  font-weight: 800;
  font-size: 1.25rem;
  text-decoration: none;
  letter-spacing: 0.5px;
}
.nav a {
  color: #cbd5e1;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.95rem;
}
.nav a:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.nav a.active { background: var(--brand); color: #fff; }
.nav a.nav-icon { display: inline-flex; align-items: center; vertical-align: middle; transform: translateY(-2px); }

.nav-auth {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-user {
  color: #cbd5e1;
  font-size: 0.95rem;
}
.account-menu { position: relative; }
.account-menu-trigger {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 6px;
  padding: 4px 7px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #cbd5e1;
  cursor: pointer;
  font: inherit;
}
.account-menu-trigger:hover,
.account-menu-trigger:focus-visible,
.account-menu-trigger[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  outline: none;
}
.account-menu-avatar {
  display: block;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  object-fit: cover;
}
.account-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 1100;
  min-width: 190px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.2);
}
.account-menu-panel a {
  display: block;
  padding: 9px 12px;
  color: var(--ink);
  font-size: 0.86rem;
  text-decoration: none;
}
.account-menu-panel a:hover,
.account-menu-panel a:focus-visible {
  background: #f1f3f7;
  outline: none;
}
.account-menu-panel a:last-child {
  border-top: 1px solid var(--line);
  color: var(--danger);
}

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
}
.login-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px 32px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}
.login-card h1 {
  text-align: center;
  margin-bottom: 0;
  color: var(--brand);
}
.login-sub {
  text-align: center;
  color: var(--muted);
  margin: 4px 0 20px;
  font-size: 0.95rem;
}
.login-form label {
  display: block;
  margin: 14px 0;
  font-weight: 600;
  font-size: 0.92rem;
}
.login-form input {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
}
.login-btn {
  width: 100%;
  margin-top: 8px;
  padding: 11px;
  font-size: 1rem;
}
.login-forgot {
  display: block;
  text-align: center;
  margin-top: 16px;
  color: var(--brand);
  font-size: 0.88rem;
  text-decoration: none;
}
.login-forgot:hover { text-decoration: underline; }

.container {
  max-width: 2200px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

h1 { font-size: 1.6rem; margin: 0 0 6px; }
.lead { color: var(--muted); margin-top: 0; }
.description { white-space: pre-wrap; color: var(--ink); }
.empty { color: var(--muted); text-align: center; padding: 40px 0; }

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.page-head h1 { margin: 0; }
.actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.actions form { margin: 0; display: inline; }

.btn {
  display: inline-block;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}
.btn:hover { background: #f0f1f3; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-small { padding: 5px 10px; font-size: 0.8rem; border-radius: 6px; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
  margin: 20px 0;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: transform 0.15s, box-shadow 0.15s;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); }
.card-num { font-size: 2rem; font-weight: 800; color: var(--brand); }
.card-title { font-weight: 600; font-size: 1.05rem; }
.card-desc { color: var(--muted); font-size: 0.88rem; }
.card-img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 4px;
}

.card-perso {
  padding: 0;
  overflow: hidden;
}
.card-img-full {
  width: 100%;
  display: block;
  object-fit: contain;
  background: #f8f9fb;
  max-height: 400px;
}
.card-img-placeholder {
  width: 100%;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: #f8f9fb;
  font-size: 0.85rem;
}
.card-perso .card-title,
.card-perso .card-desc {
  padding: 0 14px;
}
.card-perso .card-desc:last-child {
  padding-bottom: 14px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin: 18px 0;
}

.search {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}
.search input {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.95rem;
}
.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}
.search-input-wrap input {
  width: 100%;
  padding-right: 38px;
}
.search-input-wrap input[type="search"]::-webkit-search-cancel-button {
  appearance: none;
  -webkit-appearance: none;
}
.search-clear {
  position: absolute;
  top: 50%;
  right: 8px;
  width: 26px;
  height: 26px;
  padding: 0;
  transform: translateY(-50%);
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}
.search-clear:hover,
.search-clear:focus-visible {
  background: #e9ebf0;
  color: var(--ink);
  outline: none;
}
.search-clear[hidden] { display: none; }

.content-list-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.content-list-filters input,
.content-list-filters select {
  height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}
.content-list-filters .content-list-search {
  flex: 1 1 280px;
  min-width: 220px;
}
.content-list-filters select {
  flex: 0 1 190px;
  min-width: 180px;
}
.content-list-view-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.content-list-view-toolbar .view-toggle { margin-bottom: 18px; }

@media (max-width: 700px) {
  .content-list-filters > * {
    flex: 1 1 100% !important;
    width: 100%;
  }
}

.form label {
  display: block;
  margin: 14px 0;
  font-weight: 600;
  font-size: 0.92rem;
}
.form input[type="text"],
.form input[type="number"],
.form input[type="time"],
.form textarea,
.form select {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
}
.form input[type="file"] { margin-top: 5px; font-size: 0.9rem; }
.duration-field-row {
  display: grid;
  grid-template-columns: minmax(115px, 0.65fr) 1fr;
  gap: 8px;
}
.duration-field-row select,
.duration-field-row input { min-width: 0; }
.form #duration-help {
  display: block;
  margin-top: 5px;
  font-weight: 400;
}
.form fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 16px 0;
  padding: 12px 14px;
}
.form legend { font-weight: 700; padding: 0 6px; }
.form-actions { margin-top: 20px; }
.server-folder-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.server-folder-suggestions { display: flex; flex-wrap: wrap; gap: 6px; margin: 7px 0 0; }
.server-folder-suggestion { border: 1px solid var(--line); border-radius: 6px; padding: 6px 9px; background: #fff; color: inherit; cursor: pointer; font: inherit; }
.server-folder-suggestion:hover, .server-folder-suggestion:focus { background: #e9edf5; }
.server-folder-suggestion.selected { border-color: var(--brand); background: var(--brand); color: #fff; }
.server-folder-suggestion.selected:hover, .server-folder-suggestion.selected:focus { background: var(--brand-dark); }
.form .server-folder-full-path { display: block; width: 100%; margin-top: 8px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: #f8f9fb; font-family: monospace; }
.server-folder-picker { margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #f8f9fb; }
.server-folder-picker-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.server-folder-list { display: grid; gap: 4px; margin: 8px 0; max-height: 320px; overflow: auto; }
.server-folder-entry { border: 0; border-radius: 6px; padding: 8px 10px; background: white; text-align: left; cursor: pointer; font: inherit; }
.server-folder-entry:hover { background: #e9edf5; }
.server-folder-picker-actions { margin-top: 10px; }
.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 6px;
}
.check { font-weight: 500; }

.scenario-character-shortcuts {
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.scenario-character-shortcuts h4 { margin: 0 0 9px; }
.scenario-character-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 9px;
}
.scenario-character-card {
  min-width: 0;
  padding: 5px;
  border: 2px solid transparent;
  border-radius: 8px;
  background: #f8f9fb;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
}
.scenario-character-card:hover { border-color: #b9c5db; }
.scenario-character-card.selected {
  border-color: var(--brand);
  background: #eef2ff;
}
.scenario-character-card img,
.scenario-character-noimg {
  display: flex;
  width: 100%;
  aspect-ratio: 1;
  margin-bottom: 4px;
  border-radius: 5px;
  background: #eef0f4;
  object-fit: cover;
}
.scenario-character-noimg {
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 400;
}
.scenario-character-help { margin: 7px 0 0; font-size: 0.8rem; }

/* Casting view */
.casting-group { margin-bottom: 24px; }
.casting-episode-link { color:inherit; text-decoration:none; }
.casting-episode-link:hover, .casting-episode-link:focus-visible { color:var(--brand); text-decoration:underline; }
.casting-group-toggle { display:inline-flex; align-items:center; gap:8px; border:0; padding:0; background:none; color:inherit; font:inherit; text-transform:inherit; letter-spacing:inherit; cursor:pointer; }
.casting-group-chevron { display:inline-block; transform:rotate(90deg); }
.casting-group-toggle[aria-expanded="false"] .casting-group-chevron { transform:none; }
.casting-grid[hidden] { display:none; }
.casting-group-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 4px;
  letter-spacing: 0.3px;
}
.casting-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}
.casting-item {
  position: relative;
  display: grid;
  grid-template-columns: 128px 112px;
  grid-template-rows: auto 128px;
  justify-content: center;
  align-items: center;
  column-gap: 8px;
  row-gap: 4px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  min-height: 164px;
}
.casting-language-tools { display: flex; align-items: center; gap: 8px; }
.casting-language-tools .sort-select { margin: 0; }
.casting-challenge-dot {
  position: absolute;
  right: 9px;
  bottom: 9px;
  z-index: 3;
  width: 11.2px;
  height: 11.2px;
  padding: 0;
  border: 1px solid #d4d7de;
  border-radius: 50%;
  background: #fff;
}
button.casting-challenge-dot { cursor: pointer; }
.casting-recording-dot { right:31px; }
button.casting-challenge-dot:hover { transform: scale(1.12); }
.casting-challenge-dot.is-challenged {
  border-color: var(--danger);
  background: var(--danger);
}
.casting-challenge-dot.is-readonly { pointer-events: none; }
.casting-challenge-dot.is-recorded { background: #64cf6a; border-color: transparent; }
.casting-challenge-dot.is-to-do { background: #f2a33a; border-color: transparent; }
.sc-tag.sc-tag-missing { color: #d63331; text-decoration: underline dotted; }
.casting-actor-filters { display:flex; flex-wrap:wrap; gap:14px; }
[data-draft-category][hidden] { display:none; }
.casting-actor-filters label { display:flex; flex-direction:column; align-items:center; cursor:pointer; }
.casting-actor-filters input { position:absolute; opacity:0; width:1px; }
.casting-actor-filters span { width:44px; height:44px; border-radius:50%; background:#e5e7eb; display:grid; place-items:center; overflow:hidden; }
.casting-actor-filters img { width:100%; height:100%; object-fit:cover; }
.casting-actor-filters input:checked + span { outline:2px solid #2563eb; outline-offset:3px; }
.casting-actor-filters input:focus-visible + span { outline:2px dashed #2563eb; outline-offset:3px; }
.casting-episode-group .casting-grid { grid-template-columns:repeat(8,minmax(0,1fr)); }
.casting-episode-group .casting-item { grid-template-columns:repeat(2,minmax(0,1fr)); grid-template-rows:auto 1fr; align-items:start; min-height:0; gap:8px 6px; padding:8px 8px 24px; }
.casting-episode-group .casting-name, .casting-episode-group .casting-actor-name { grid-row:2; width:auto; min-width:0; text-align:center; font-size:0.75rem; overflow-wrap:anywhere; color:inherit; text-decoration:none; }
.casting-episode-group .casting-name { grid-column:1; }
.casting-episode-group .casting-actor-name { grid-column:2; }
.casting-episode-group .casting-thumb { grid-row:1; grid-column:1; width:100%; height:auto; aspect-ratio:1; }
.casting-episode-group .casting-avatar { grid-row:1; grid-column:2; width:100%; height:auto; aspect-ratio:1; }
.casting-episode-group .casting-speaking-list { right:2px; bottom:2px; }
.casting-episode-group .casting-speaking { width:20px; height:20px; }
.casting-episode-group .casting-speaking svg { width:12px; height:12px; }
@media (max-width:1100px) { .casting-episode-group .casting-grid { grid-template-columns:repeat(4,minmax(0,1fr)); } }
@media (max-width:600px) { .casting-episode-group .casting-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
.casting-filter-fields { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:14px; }
.sc-identification .sc-tag[data-tag-kind="perso"] { text-transform:none; }
.casting-thumb {
  position: relative;
  flex: 0 0 auto;
  width: 128px;
  height: 128px;
  border-radius: 4px;
  overflow: hidden;
  display: block;
}
.casting-speaking-list { position: absolute; right: 6px; bottom: 6px; display: flex; flex-direction: row-reverse; align-items: center; }
.casting-speaking { position: relative; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border: 1px solid #fff; border-radius: 50%; color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.28); }
.casting-speaking + .casting-speaking { margin-right: -10px; }
.casting-speaking:hover { z-index: 2; transform: translateY(-2px); }
.casting-speaking svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.casting-chapter-btn { border: 1px solid var(--chapter-color); color: var(--chapter-color); }
.casting-chapter-btn.selected { background: var(--chapter-color); border-color: var(--chapter-color); color: #fff; }
.casting-chapter-filters { align-items: flex-start; }
.casting-chapter-control { display: inline-flex; flex-direction: column; align-items: stretch; gap: 4px; }
.casting-episode-select { width: 100%; max-width: 125px; padding: 5px 7px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: inherit; font: inherit; font-size: 0.82rem; }
.casting-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.casting-noimg {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: #f8f9fb;
  color: var(--muted);
  font-size: 0.8rem;
}

.episode-cast-section {
  margin-top: 18px;
}
.episode-cast-section h2 {
  margin: 0 0 10px;
  font-size: 1rem;
}
.episode-cast-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 10px;
}
.episode-cast-card {
  min-width: 0;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
}
.episode-cast-card img,
.episode-cast-noimg {
  display: flex;
  width: 100%;
  aspect-ratio: 1;
  margin-bottom: 5px;
  border-radius: 6px;
  background: #f8f9fb;
  object-fit: cover;
}

.episode-audio-library { margin-top: 18px; }
.episode-audio-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.episode-audio-head h2 { margin: 0 0 4px; font-size: 1.15rem; }
.episode-audio-head p { margin: 0; }
.episode-audio-upload-form {
  display: grid;
  grid-template-columns: minmax(280px, 420px) auto;
  align-items: center;
  gap: 7px 10px;
}
.episode-audio-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 82px;
  padding: 12px 18px;
  border: 2px dashed #b9c2d0;
  border-radius: 8px;
  background: #f8f9fb;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}
.episode-audio-dropzone:hover,
.episode-audio-dropzone:focus,
.episode-audio-dropzone.dragover {
  border-color: var(--brand);
  background: #eef2ff;
  outline: none;
}
.episode-audio-dropzone span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
}
.episode-audio-dropzone input { display: none; }
.episode-audio-selection {
  min-width: 0;
  max-width: 420px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.episode-audio-upload { grid-column: 2; grid-row: 1; }
.episode-audio-actions label { cursor: pointer; }
.episode-audio-actions input { display: none; }
.episode-audio-list { display: grid; gap: 12px; margin-top: 18px; }
.episode-audio-item {
  display: grid;
  grid-template-columns: minmax(240px, 360px) minmax(280px, 1fr) auto;
  align-items: start;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f9fb;
}
.episode-audio-player { width: 100%; }
.episode-audio-edit { display: grid; gap: 8px; }
.episode-audio-edit label { margin: 0; }
.episode-audio-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  color: var(--muted);
  font-size: 0.78rem;
}
.episode-audio-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.episode-audio-empty { padding: 24px 0 8px; }
@media (max-width: 900px) {
  .episode-audio-item { grid-template-columns: 1fr; }
  .episode-audio-upload-form { grid-template-columns: 1fr; width: 100%; }
  .episode-audio-upload { grid-column: auto; grid-row: auto; }
}
.episode-cast-noimg {
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 400;
}
.casting-name {
  grid-column: 1 / -1;
  min-width: 0;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.casting-name:hover { color: var(--brand); }
.casting-avatar {
  flex: 0 0 auto;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.casting-avatar.is-envisaged {
  outline: 1px solid #f2a33a;
  outline-offset: 1px;
}
.casting-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.casting-avatar-fallback {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
}
.casting-avatar-empty {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  border: 2px dashed var(--line);
  background: transparent;
}
.casting-avatar-picker {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  border: 2px solid var(--brand);
  background: #eef2ff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.casting-inline-select {
  max-width: 100px;
  font-size: 0.78rem;
  border: 1px solid var(--brand);
  border-radius: 6px;
  padding: 2px 4px;
}
.check-taken { opacity: 0.45; }
.check-taken input { cursor: not-allowed; }
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 600px) {
  .grid-2 { grid-template-columns: 1fr; }
}
.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}
@media (max-width: 600px) {
  .grid-3 { grid-template-columns: 1fr; }
}
.type-group { margin-bottom: 14px; }
.type-group h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 6px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 4px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.table th, .table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.table th { background: #f8f9fb; font-size: 0.8rem; text-transform: uppercase; color: var(--muted); }
.table tr:last-child td { border-bottom: none; }
.user-name-link { color: inherit; text-decoration: none; }
.user-name-link:hover { color: var(--brand); }

.thumb {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: 6px;
  vertical-align: middle;
  margin-right: 8px;
}

.badge {
  display: inline-block;
  background: #eef2ff;
  color: var(--brand);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.78rem;
  font-weight: 600;
}
.badge-done { background: #dcfce7; color: var(--success); }
.badge-soft { background: #f3f4f6; color: var(--muted); }

.ep-statut-select {
  border: none;
  border-radius: 999px;
  padding: 2px 22px 2px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
  background: #3b82f6 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='16' viewBox='0 0 10 16'%3E%3Cpath d='M2 5l3-3 3 3' stroke='%23fff' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M2 11l3 3 3-3' stroke='%23fff' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 6px center;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.ep-statut-select option { color: var(--ink); background: #fff; }
.story-category {
  color: var(--ink);
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='16' viewBox='0 0 10 16'%3E%3Cpath d='M2 5l3-3 3 3' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M2 11l3 3 3-3' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  border: 1px solid var(--line);
}
.ep-statut-select.statut-done {
  background-color: var(--success);
  background-repeat: no-repeat;
  background-position: right 6px center;
}
.ep-statut-select.statut-stopped {
  background-color: var(--danger);
  background-repeat: no-repeat;
  background-position: right 6px center;
}

.progress {
  background: #eef0f3;
  border-radius: 999px;
  height: 8px;
  min-width: 120px;
  overflow: hidden;
}
.progress-bar {
  background: var(--brand);
  height: 100%;
  border-radius: 999px;
}
.progress-lg { height: 14px; }

.flash {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: 0.92rem;
}
.flash-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.flash-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

.detail {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin: 18px 0;
}
.detail-img img {
  max-width: 320px;
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
.no-img {
  width: 320px;
  max-width: 100%;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
}
.detail-info { flex: 1; min-width: 260px; }

small { color: var(--muted); }
.gallery {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding-bottom: 8px;
}
.gallery img {
  flex: 0 0 auto;
  width: 300px;
  height: 300px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  scroll-snap-align: start;
}
.gallery-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 8px;
}
.gallery-prev, .gallery-next {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 1.1rem;
  cursor: pointer;
}
.gallery-prev:hover, .gallery-next:hover { background: #f0f1f3; }
.gallery-count { color: var(--muted); font-size: 0.88rem; }

.gallery-edit {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 14px;
}
.gallery-item {
  position: relative;
  flex: 0 0 auto;
}
.gallery-item img {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.gallery-del {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(220, 38, 38, 0.9);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-del:hover { background: var(--danger); }

.detail-gallery { flex: 0 0 auto; max-width: 320px; width: 100%; }

.dropzone {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.dropzone:hover { border-color: var(--brand); background: #f8f8ff; }
.dropzone.dragover { border-color: var(--brand); background: #eef2ff; }
.dropzone p { margin: 0; font-size: 0.95rem; }

.drop-preview {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.drop-preview img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
}
.plan-image-editor { display: flex; align-items: flex-start; gap: 24px; flex-wrap: wrap; }
.plan-image-current { position: relative; flex: 0 0 320px; max-width: 100%; }
.plan-image-current img,
.plan-image-current video { display: block; width: 320px; max-width: 100%; height: 320px; object-fit: cover; border: 1px solid var(--line); border-radius: var(--radius); }
.plan-image-current .no-img { height: 320px; }
.plan-image-delete { z-index: 1; }
.plan-image-zoom {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  color: #fff;
  background: rgba(31, 41, 55, 0.72);
  cursor: zoom-in;
}
.plan-image-zoom:hover { background: rgba(31, 41, 55, 0.92); }
.plan-image-zoom:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.plan-image-zoom svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.plan-image-controls { flex: 1; min-width: 260px; }
.plan-image-controls .dropzone { min-height: 160px; display: flex; align-items: center; justify-content: center; }
.plan-lightbox { position: fixed; inset: 0; z-index: 3000; display: flex; align-items: center; justify-content: center; padding: 32px; background: rgba(0, 0, 0, 0.86); cursor: zoom-out; }
.plan-lightbox[hidden] { display: none; }
.plan-lightbox img,
.plan-lightbox video { max-width: 95vw; max-height: 92vh; object-fit: contain; border-radius: 6px; box-shadow: 0 12px 50px rgba(0, 0, 0, 0.5); }
.plan-lightbox img[hidden],
.plan-lightbox video[hidden] { display: none; }
.plan-thumbnail { cursor: zoom-in; }

.tag-link {
  display: inline-block;
  background: #eef2ff;
  color: var(--brand);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  margin: 2px;
}
.tag-link:hover { background: #e0e7ff; }

.type-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.view-toggle {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  margin-bottom: 14px;
}
.view-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 14px;
}
.view-toolbar .view-toggle {
  margin-bottom: 0;
}
.sort-select {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.88rem;
  font-family: inherit;
  background: var(--panel);
  cursor: pointer;
}
.view-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: transparent;
  text-decoration: none;
  transition: opacity 0.15s;
}
.view-btn img { width: 20px; height: 20px; opacity: 0.35; }
.view-btn.active img { opacity: 1; }
.view-btn:hover img { opacity: 0.6; }
.view-btn.active:hover img { opacity: 1; }

.inline-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.inline-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
}
.inline-thumb {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: block;
  text-decoration: none;
}
.inline-thumb img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
}
.inline-noimg {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: #f8f9fb;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.8rem;
}
.inline-name {
  flex: 1;
  min-width: 120px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.92rem;
  font-family: inherit;
}
.inline-type {
  flex: 0 0 auto;
  min-width: 130px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.88rem;
  font-family: inherit;
}
.inline-path {
  flex: 0 1 auto;
  min-width: 130px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.88rem;
  font-family: inherit;
}
.inline-blend { width: 150px; }
.inline-server-folder { width: 210px; }
.inline-heure {
  flex: 0 0 auto;
  width: 110px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.88rem;
  font-family: inherit;
}
.btn-inline-save {
  flex: 0 0 auto;
  min-width: 90px;
}
.inline-save-all-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}
.inline-row-dirty { border-color: #c7cbea; }
@media (max-width: 600px) {
  .inline-row { flex-wrap: wrap; }
  .inline-name { flex: 1 1 100%; }
}

.tag-preview {
  margin-top: 8px;
  min-height: 10px;
}

.card-tags { display: flex; flex-wrap: wrap; gap: 2px; }

.info-table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
}
.info-table th {
  text-align: left;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--muted);
  padding: 6px 12px 6px 0;
  width: 40%;
  vertical-align: top;
}
.info-table td {
  padding: 6px 0;
  font-size: 0.95rem;
}
.titre-inline {
  text-decoration: underline dotted #aaa;
  text-underline-offset: 3px;
}
.titre-input {
  font-size: inherit;
  font-family: inherit;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  width: auto;
}
.plans-table th, .plans-table td {
  font-size: 0.85rem;
  padding: 2px 8px;
}
.plans-table th { font-size: 0.66rem; }
.plans-table .thumb { width: 58px; height: 58px; object-fit: cover; border-radius: 4px; }
.inline-num { width: 56px; }
.inout-cell {
  vertical-align: middle;
}
.inout-inner {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.inline-num::-webkit-inner-spin-button,
.inline-num::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.inline-num { -moz-appearance: textfield; }
.inline-text {
  width: 100%;
  height: 58px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.3;
  resize: none;
  overflow: hidden;
  margin: 0;
}
.notes-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 72px;
}
.plan-note-feedback {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1200;
  max-width: 360px;
  margin: 0;
  padding: 10px 14px;
  border-radius: 8px;
  background: #334155;
  color: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .18);
}
.plan-note-feedback[hidden] { display: none; }
.plan-note-feedback.is-error { background: #9a3412; }
.inline-select { width: auto; font-size: 0.8rem; padding: 2px 4px; margin-right: 6px; }
.etape-select {
  border: none;
  border-radius: 6px;
  padding: 3px 22px 3px 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
  background-color: #9ca3af;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='16' viewBox='0 0 10 16'%3E%3Cpath d='M2 5l3-3 3 3' stroke='%23fff' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M2 11l3 3 3-3' stroke='%23fff' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.etape-select:disabled { opacity: 1; cursor: default; }
.etape-select option { color: var(--ink); background: #fff; }
.custom-stage-select { display: inline-flex; }
.custom-stage-trigger {
  min-width: 82px;
  height: 26px;
  padding: 3px 22px 3px 8px;
  border: 0;
  border-radius: 6px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='16' viewBox='0 0 10 16'%3E%3Cpath d='M2 5l3-3 3 3' stroke='%23fff' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M2 11l3 3 3-3' stroke='%23fff' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  color: #fff;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}
.custom-stage-trigger:focus-visible {
  outline: 2px solid rgba(79, 70, 229, 0.35);
  outline-offset: 2px;
}
.custom-stage-menu {
  position: fixed;
  z-index: 1200;
  max-height: 280px;
  overflow-y: auto;
  padding: 5px;
  border: 1px solid #59606c;
  border-radius: 7px;
  background: #343943;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.28);
}
.custom-stage-menu[hidden] { display: none; }
.custom-stage-option {
  display: block;
  width: 100%;
  padding: 6px 9px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.custom-stage-option:hover,
.custom-stage-option:focus-visible { background: rgba(255, 255, 255, 0.11); outline: none; }
.custom-stage-option[aria-selected="true"] { background: rgba(255, 255, 255, 0.08); }
.plans-table td { vertical-align: middle; }
.plans-table .col-actions .actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 100%;
}.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  text-decoration: none;
  vertical-align: middle;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.icon-btn:hover { background: #f0f1f3; color: var(--ink); }
.icon-btn:disabled,
.icon-btn:disabled:hover {
  border-color: var(--line);
  background: #f5f6f8;
  color: #c2c6ce;
  cursor: not-allowed;
}
.icon-btn-danger:hover { background: #fee2e2; color: var(--danger); border-color: #fecaca; }
.actions-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 72px;
}
.actions form { display: inline-flex; margin: 0; align-items: center; }
.server-folder-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1200;
  max-width: min(380px, calc(100vw - 40px));
  padding: 10px 14px;
  border-radius: 8px;
  background: #252a35;
  color: #fff;
  font-size: 0.84rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.15s, transform 0.15s;
}
.server-folder-toast.is-visible { opacity: 1; transform: translateY(0); }
.plans-table { table-layout: fixed; width: auto; }
.plans-table th, .plans-table td { box-sizing: content-box; }
.plans-table .plan-reorder-col {
  width: 25px;
  padding-left: 3px;
  padding-right: 3px;
  text-align: center;
}
.plan-reorder-handle {
  display: inline-flex;
  width: 24px;
  height: 34px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: #c7cbd3;
  font: inherit;
  font-size: 0.95rem;
  line-height: 1;
  cursor: grab;
  user-select: none;
}
.plan-reorder-handle:hover { color: var(--muted); }
.plan-reorder-handle:active { cursor: grabbing; }
.plan-reorder-handle:focus-visible {
  outline: 2px solid rgba(79, 70, 229, 0.35);
  outline-offset: 1px;
  border-radius: 4px;
}
.plans-table.plan-reorder-disabled .plan-reorder-handle {
  color: var(--line);
  cursor: not-allowed;
}
.plans-table tr.plan-dragging { opacity: 0.4; }
.plans-table tr.plan-drop-before > td {
  box-shadow: inset 0 3px 0 var(--brand);
}
.plans-table tr.plan-drop-after > td {
  box-shadow: inset 0 -3px 0 var(--brand);
}
.plans-table .col-n { width: 3ch; text-align: right; }
.plan-number.is-blocked {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}
.plans-table .col-thumb { width: 42px; }
.plans-table .thumb { margin-right: 0; }
.plans-table .col-frame { width: 42px; }
.plans-table td.col-frame { position: relative; }
.plan-frame-calculation {
  position: absolute;
  top: calc(50% + 13px);
  left: 8px;
  right: 8px;
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 500;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}
.plans-table .col-inout { width: 42px; }
.plans-table .col-etape { width: 92px; }
.plans-table .col-focale { width: 56px; }
.inline-focale {
  width: 48px;
  text-align: center;
  height: auto;
  min-height: 0;
  white-space: nowrap;
  resize: none;
  overflow: hidden;
}
.plans-table .col-abc { width: 40px; padding-left: 0; padding-right: 2px; }
.plans-table .col-notes { width: auto; }
.plans-table .col-sep { width: 36px; padding-left: 0; padding-right: 2px; }
.plans-table .col-actions { width: 72px; }
.plans-table .inline-separation { cursor: pointer; }
.plans-table .inline-num,
.plans-table .inline-text {
  padding: 3px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 0.8rem;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
}
.plans-table .inline-text {
  overflow-y: auto;
  scrollbar-gutter: stable;
}
.plan-thumb-drop {
  position: relative;
  width: 58px;
  height: 58px;
  overflow: hidden;
  border: 1px dashed #cbd5e1;
  border-radius: 5px;
  background: #f8fafc;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.plan-thumb-drop.has-image { border: 0; }
.plan-thumb-drop .thumb {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
}
.plan-thumb-drop-placeholder {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 1.15rem;
  font-weight: 600;
}
.plan-thumb-drop::after {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 3px;
  background: rgba(15, 23, 42, 0.78);
  color: #fff;
  content: attr(data-upload-status);
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
}
.plan-thumb-drop-active {
  border-color: var(--brand);
  background: #eef2ff;
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.18);
}
.plan-thumb-drop-active::after,
.plan-thumb-drop-uploading::after,
.plan-thumb-drop-error::after { display: flex; }
.plan-thumb-drop-error::after { background: rgba(220, 38, 38, 0.9); }

/* Notes columns (toggle) */
.plans-table .col-notes-td { display: none; width: 380px; }
.plans-table.show-notes-layout .notes-layout { display: table-cell; }
.plans-table.show-notes-animation .notes-animation { display: table-cell; }
.plans-table.show-notes-rendu .notes-rendu { display: table-cell; }
.plans-table.show-notes-compo .notes-compo { display: table-cell; }
.plans-table.show-notes-motion .notes-motion { display: table-cell; }
.plans-table.plan-focused-stages .col-notes-td {
  display: table-cell;
  width: 420px;
}
.plans-table.plan-focused-stages .col-notes-td .inline-text {
  height: calc(6.5em + 8px);
}
.plans-table .stage-column-hidden { display: none !important; }
.plans-table.plan-focused-stages .col-thumb { width: 116px; }
.plans-table.plan-focused-stages .plan-thumb-drop {
  width: 116px;
  height: 116px;
}
.plan-display-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: -8px 0 18px;
}
.plan-view-section { position: relative; }
.plan-view-section .plan-display-toolbar {
  position: sticky;
  top: var(--plan-sticky-top, 0px);
  z-index: 60;
  padding: 8px 0;
  background: var(--bg);
}
.plan-view-section .plans-table { overflow: visible; }
.plan-view-section .plans-table thead th {
  position: sticky;
  top: var(--plan-sticky-header-top, 0px);
  z-index: 50;
  box-shadow: inset 0 -1px var(--line);
}
.plan-stage-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}
.plan-stage-filters > span {
  margin-right: 3px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}
.plan-view-toolbar {
  flex: 0 0 auto;
  margin-bottom: 0;
}
.plan-stage-team-control {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.plan-stage-team-control .inline-select { margin-right: 0; }
.plan-team-summary {
  display: inline-flex;
  min-width: 30px;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  padding: 0 2px;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.plan-team-summary[hidden] { display: none; }
.plan-team-summary:focus-visible {
  border-radius: 16px;
  outline: 2px solid rgba(79, 70, 229, 0.4);
  outline-offset: 2px;
}
.plan-team-avatar-stack {
  display: inline-flex;
  align-items: center;
  padding-left: 6px;
}
.plan-team-avatar {
  position: relative;
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  margin-left: -6px;
  overflow: hidden;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #9ca3af;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  opacity: 0.5;
}
.plan-team-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.plan-team-avatar.is-active-now {
  z-index: 1;
  border-color: var(--brand);
  box-shadow: 0 0 0 1px #fff;
  opacity: 1;
}
.plan-team-avatar-add {
  border: 1px dashed #8b93a1;
  background: #fff;
  color: #697180;
  font-size: 1rem;
  opacity: 1;
}
.plan-team-avatar-more {
  background: #697180;
  opacity: 1;
}
.plan-team-popover {
  position: fixed;
  z-index: 1200;
  overflow-y: visible;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.24);
}
.plan-team-popover.is-scrollable { overflow-y: auto; }
.plan-team-popover[hidden] { display: none; }
.plan-team-popover-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.plan-team-popover-head > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.plan-team-popover-labels,
.plan-team-user-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 62px 96px;
  align-items: center;
  gap: 8px;
}
.plan-team-popover-labels {
  padding: 0 5px 6px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  text-align: center;
}
.plan-team-popover-labels span:first-child { text-align: left; }
.plan-team-user-row {
  min-height: 44px;
  padding: 5px;
  border-top: 1px solid #edf0f4;
}
.plan-team-user-row > input {
  width: 16px;
  height: 16px;
  justify-self: center;
  margin: 0;
}
.plan-team-user-identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
}
.plan-team-user-identity > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.plan-team-user-identity .plan-team-avatar {
  flex: 0 0 28px;
  margin-left: 0;
}
.plan-team-popover-status {
  min-height: 18px;
  margin: 8px 4px 0;
  color: var(--muted);
  font-size: 0.75rem;
  text-align: right;
}
.plan-team-popover-users > .empty { padding: 18px 0; }
.plan-thumbnail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}
.plan-thumbnail-card {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 8px;
  background: var(--bg);
}
.plan-thumbnail-number {
  position: absolute;
  top: 10px;
  left: 12px;
  z-index: 1;
  color: rgba(255, 255, 255, 0.3);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  pointer-events: none;
}
.plan-thumbnail-card img,
.plan-thumbnail-card video,
.plan-thumbnail-placeholder {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.plan-thumbnail-card img,
.plan-thumbnail-card video { cursor: zoom-in; }
.plan-ratio-169 .plan-thumbnail-card { aspect-ratio: 16 / 9; }
.plan-ratio-916 .plan-thumbnail-card { aspect-ratio: 9 / 16; }
.plan-ratio-169 .plans-table .col-thumb img,
.plan-ratio-169 .plans-table .col-thumb video {
  width: 80px;
  height: 45px;
}
.plan-ratio-169 .plans-table .plan-thumb-drop {
  width: 80px;
  height: 45px;
}
.plan-ratio-916 .plans-table .col-thumb img,
.plan-ratio-916 .plans-table .col-thumb video {
  width: 45px;
  height: 80px;
}
.plan-ratio-916 .plans-table .plan-thumb-drop {
  width: 45px;
  height: 80px;
}
.plan-ratio-169 .plans-table.plan-focused-stages .plan-thumb-drop {
  width: 160px;
  height: 90px;
}
.plan-ratio-916 .plans-table.plan-focused-stages .plan-thumb-drop {
  width: 90px;
  height: 160px;
}
.plan-ratio-169 .plans-table.plan-focused-stages .col-thumb { width: 160px; }
.plan-ratio-916 .plans-table.plan-focused-stages .col-thumb { width: 90px; }
.plan-ratio-169 .plans-table.plan-focused-stages .col-thumb img,
.plan-ratio-169 .plans-table.plan-focused-stages .col-thumb video {
  width: 160px;
  height: 90px;
}
.plan-ratio-916 .plans-table.plan-focused-stages .col-thumb img,
.plan-ratio-916 .plans-table.plan-focused-stages .col-thumb video {
  width: 90px;
  height: 160px;
}
.plan-ratio-169 #story-plans-table .shot-thumb {
  width: 80px;
  height: 45px;
  object-fit: cover;
}
.plan-ratio-916 #story-plans-table .shot-thumb {
  width: 45px;
  height: 80px;
  object-fit: cover;
}
@media (max-width: 1000px) {
  .plan-thumbnail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .plan-display-toolbar { align-items: flex-start; }
  .plan-thumbnail-grid { grid-template-columns: 1fr; }
}
.ep-header {
  cursor: pointer;
  user-select: none;
  position: relative;
}
.ep-header::after {
  content: "▾";
  font-size: 0.6rem;
  margin-left: 3px;
  opacity: 0.3;
}
.ep-header-active::after { opacity: 1; }
.ep-header-active {
  color: var(--brand);
}
.plans-table tr:target td {
  animation: plan-target-highlight 2.4s ease-out;
}
@keyframes plan-target-highlight {
  0%, 28% { background-color: #e8edff; }
  100% { background-color: transparent; }
}

/* Dashboard */
.dash-work-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 28px;
  align-items: start;
}
.dash-work-panel {
  width: 100%;
  min-width: 0;
  max-width: none;
  margin-top: 0;
}
.dash-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.dash-head h2 { margin: 0; font-size: 1.15rem; }
.dash-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}
.dash-work-filters {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin: 0 0 14px;
}
.dash-work-filters label {
  display: flex;
  min-width: 0;
  flex: 1 1 0;
  flex-direction: column;
  gap: 4px;
}
.dash-work-filters label > span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}
.dash-work-filters select {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 5px 28px 5px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.8rem;
}
.dash-work-filters .custom-stage-trigger { min-width: 150px; }
.dash-work-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.dash-work-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.dash-work-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid #d8dce7;
  background: #eaedf4;
  color: var(--ink);
  text-decoration: none;
}
.dash-work-group-head:hover { background: #e1e5ee; }
.dash-work-heading {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 1px;
}
.dash-work-heading strong {
  color: var(--brand-dark);
  font-size: 0.84rem;
}
.dash-work-heading > span {
  overflow: hidden;
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-work-plans {
  display: flex;
  flex-direction: column;
}
.dash-work-plan {
  display: grid;
  grid-template-columns: 48px minmax(100px, 1fr) auto;
  align-items: center;
  gap: 7px 12px;
  min-height: 58px;
  padding: 9px 12px;
  border-top: 1px solid var(--line);
}
.dash-work-plan:first-child { border-top: 0; }
.dash-work-plan[hidden],
.dash-work-group[hidden] { display: none; }
.dash-plan-thumbnail {
  grid-row: 1;
  align-self: center;
  width: 48px;
  height: 48px;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 6px;
  background: #e8eaf0;
  cursor: zoom-in;
  text-decoration: none;
}
.dash-plan-thumbnail-placeholder {
  display: block;
  grid-row: 1;
  width: 48px;
  height: 48px;
  visibility: hidden;
}
.dash-plan-thumbnail:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.dash-plan-thumbnail img {
  display: block;
  width: 100%;
  height: 100%;
  height: 48px;
  object-fit: cover;
}
.dash-plan-video-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: #667085;
  font-size: .7rem;
  letter-spacing: .04em;
}
.dash-work-plan:hover { background: #fafbff; }
.dash-work-plan-content {
  display: flex;
  grid-column: 2 / -1;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
  color: var(--ink);
  text-decoration: none;
}
.dash-work-plan-link,
.dash-work-plan-details {
  color: inherit;
  text-decoration: none;
}
.dash-work-plan-details { display: block; }
.dash-work-plan-link:focus-visible,
.dash-work-plan-details:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.dash-work-plan-title-row {
  display: flex;
  align-items: center;
  min-width: 0;
  justify-content: space-between;
  gap: 8px;
}
.dash-work-plan-title-row strong {
  flex: 0 0 auto;
  font-size: 0.9rem;
}
.dash-work-plan-description {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-work-stages {
  display: flex;
  min-width: 0;
  justify-content: flex-end;
  gap: 5px;
  flex-wrap: wrap;
}
.dash-stage-badges[hidden] { display: none; }
.dash-stage-badges { display: inline-flex; align-items: center; gap: 4px; }
.dash-stage-note {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.8rem;
  font-style: normal;
  line-height: 1.35;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-stage-note[hidden] { display: none; }
.dash-stage-pill,
.dash-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}
.dash-stage-pill {
  background: #e9edff;
  color: var(--brand-dark);
}
.dash-status-pill {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
}
.dash-status-pill[style] { border-color: transparent; color: #fff; }
.dash-status-select {
  max-width: 145px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding-right: 20px;
  font-family: inherit;
  text-align: left;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='m1 1 4 4 4-4' fill='none' stroke='%236b7280' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 7px center;
}
.dash-status-select[hidden] { display: none; }
.dash-status-select.has-color {
  border-color: transparent;
  color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='m1 1 4 4 4-4' fill='none' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E");
}
.dash-status-select option { color: var(--ink); background: #fff; }
.dash-status-select:disabled { opacity: .65; cursor: wait; }
.dash-status-select:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.dash-stage-badges .custom-stage-trigger {
  min-width: 0;
  height: 22px;
  padding: 2px 21px 2px 8px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
}
.dash-stage-badges .custom-stage-trigger:disabled { opacity: .65; cursor: wait; }
.dash-stage-update-error { color: #a82929; font-size: .8rem; }
@media (max-width: 520px) {
  .dash-work-group-head { align-items: flex-start; flex-wrap: wrap; }
  .dash-work-plan { grid-template-columns: 48px minmax(0, 1fr) auto; }
  .dash-work-filters { align-items: stretch; flex-direction: column; }
  .dash-work-plan-title-row { align-items: flex-start; }
  .dash-stage-note { white-space: normal; }
}
@media (max-width: 900px) {
  .dash-work-columns { grid-template-columns: 1fr; }
}

.personal-note-card {
  width: 100%;
  max-width: none;
  min-height: 340px;
  margin-top: 0;
}
.dashboard-tab-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px; }
.dashboard-tab { border: 0; padding: 0; background: none; color: var(--muted); font: inherit; cursor: pointer; }
.dashboard-tab.is-active { color: var(--ink); text-decoration: underline; text-underline-offset: 5px; }
.personal-note-head {
  display: flex;
  min-height: 28px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}
.personal-note-head h2 {
  margin: 0;
  font-size: 1.15rem;
}
.personal-note-status {
  min-height: 18px;
  color: var(--muted);
  font-size: 0.75rem;
}
.personal-note-status.is-error { color: var(--danger); }
.personal-note-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  min-height: 34px;
  margin-bottom: 7px;
  flex-wrap: nowrap;
}
.personal-note-tool,
.personal-note-color-tool,
.personal-note-size {
  height: 28px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.82rem;
}
.personal-note-tool {
  display: inline-flex;
  min-width: 25px;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  cursor: pointer;
}
.personal-note-tool:hover,
.personal-note-tool:focus-visible,
.personal-note-color-tool:hover,
.personal-note-color-tool:focus-within,
.personal-note-size:hover,
.personal-note-size:focus-visible {
  border-color: var(--line);
  background: #fff;
  outline: none;
}
.personal-note-tool-separator {
  width: 1px;
  height: 19px;
  margin: 0 2px;
  background: var(--line);
}
.personal-note-tool[aria-pressed="true"] {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.personal-note-color-tool {
  position: relative;
  display: inline-flex;
  width: 25px;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  cursor: pointer;
}
.personal-note-color-tool::after {
  position: absolute;
  right: 6px;
  bottom: 4px;
  left: 6px;
  height: 3px;
  border-radius: 2px;
  background: var(--personal-note-color, var(--ink));
  content: '';
}
.personal-note-color-tool input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
}
.personal-note-size {
  width: 92px;
  min-width: 0;
  padding: 0 18px 0 6px;
  border-color: var(--line);
  cursor: pointer;
}
.personal-note-check-tool { font-size: 1rem; }
.personal-note-editor {
  min-height: 280px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  line-height: 1.5;
  outline: none;
}
.personal-note-editor:focus {
  border-color: var(--line);
  box-shadow: none;
}
.personal-note-editor[data-empty="true"]::before {
  color: var(--muted);
  content: 'Cliquer pour écrire une note…';
  pointer-events: none;
}
.personal-note-editor div,
.personal-note-editor p,
.personal-note-editor ul,
.personal-note-editor ol {
  margin-top: 0;
  margin-bottom: 0.4em;
}
.personal-note-editor ul,
.personal-note-editor ol {
  padding-left: 24px;
}
.personal-note-editor font[size="2"] { font-size: 0.85em; }
.personal-note-editor font[size="3"] { font-size: 1em; }
.personal-note-editor font[size="5"] { font-size: 1.25em; }
.personal-note-check-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-height: 26px;
  margin-bottom: 3px;
  margin-left: 12px;
}
.personal-note-check-item input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 3px 0 0;
  accent-color: var(--brand);
  cursor: pointer;
}
.personal-note-check-text {
  min-width: 1ch;
  flex: 1;
}
.personal-note-check-item[data-checked="true"] .personal-note-check-text {
  color: var(--muted);
  text-decoration: line-through;
}
@media (max-width: 900px) {
  .personal-note-card {
    width: 100%;
    max-width: none;
  }
}

/* Scénario — éditeur WYSIWYG */
.scenario-editor-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.scenario-editor-head h2 { margin: 0; }
.scenario-editor-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.rte-toolbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 8px 16px;
  background: #f8f9fb;
  border-top: 1px solid var(--line);
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);
  flex-wrap: wrap;
  justify-content: center;
}
.rte-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.rte-btn:hover { background: #fff; border-color: var(--line); }
.rte-btn:active { background: #eef2ff; }
.rte-sep {
  width: 1px;
  height: 20px;
  background: var(--line);
  margin: 0 4px;
}
.rte-color-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 30px;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.rte-palette-wrap {
  position: relative;
  display: inline-flex;
}
.rte-palette {
  position: absolute;
  bottom: 44px;
  left: 0;
  z-index: 200;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  padding: 8px;
  min-width: 200px;
}
.rte-palette-swatches {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  margin-bottom: 8px;
}
.rte-swatch {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--line);
  cursor: pointer;
  padding: 0;
  transition: transform 0.1s;
}
.rte-swatch:hover { transform: scale(1.15); }
.rte-hex-row {
  display: flex;
  gap: 4px;
  align-items: center;
}
.rte-hex-input {
  flex: 1;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.82rem;
  font-family: monospace;
}
.rte-color-wrap:hover { background: #fff; border-color: var(--line); }
.rte-color-icon {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink);
  pointer-events: none;
}
.rte-hl-icon {
  font-size: 0.85rem;
  color: #facc15;
  text-shadow: 0 0 2px rgba(0,0,0,0.2);
  pointer-events: none;
}
.rte-color {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  border: none;
  padding: 0;
}
.rte-editor {
  width: 794px;
  min-height: 1123px;
  padding: 56px 48px 80px;
  border: none;
  border-radius: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.1rem;
  line-height: 1.4;
  box-sizing: border-box;
  outline: none;
  overflow-y: auto;
  background: #fff;
  box-shadow: 0 1px 8px rgba(0,0,0,0.12);
}
.rte-editor:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}
.rte-editor span, .rte-editor div, .rte-editor p {
  font-size: inherit !important;
  font-family: inherit !important;
  line-height: inherit !important;
}
.rte-editor h2 { font-size: 1.35rem; margin: 14px 0 6px; }
.rte-editor blockquote {
  border-left: 3px solid var(--brand);
  margin: 8px 0;
  padding: 4px 14px;
  color: var(--muted);
  font-style: italic;
}
.rte-editor ul, .rte-editor ol { margin: 8px 0; padding-left: 24px; }
.rte-editor li { margin: 2px 0; }
.scenario-layout {
  display: flex;
  gap: 20px;
  margin-top: 16px;
  align-items: flex-start;
  justify-content: center;
}
.scenario-editor {
  flex: 0 0 794px;
  max-width: 794px;
}
.scenario-side {
  width: 280px;
  flex-shrink: 0;
  position: sticky;
  top: 76px;
  max-height: calc(100vh - 96px);
  display: flex;
  flex-direction: column;
}
.scenario-side h2 { margin: 0 0 8px; }
.scenario-side-tabs {
  display: flex;
  flex-shrink: 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}
.scenario-side-tab {
  flex: 1;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 8px 6px;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}
.scenario-side-tab:hover { color: var(--ink); }
.scenario-side-tab.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}
.scenario-side-tab:focus-visible {
  outline: 2px solid rgba(79, 70, 229, 0.35);
  outline-offset: 2px;
}
.scenario-side-panel {
  min-height: 0;
  overflow-y: auto;
  padding: 1px 4px 8px 1px;
}
.scenario-side-panel[hidden] { display: none; }

.scenario-library-controls {
  display: grid;
  gap: 8px;
}
.scenario-library-search input {
  width: 100%;
  height: 34px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
}
.scenario-library-search input:focus {
  outline: 2px solid rgba(79, 70, 229, 0.18);
  border-color: var(--brand);
}
.scenario-library-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.scenario-library-filter {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  padding: 3px 8px;
  font: inherit;
  font-size: 0.73rem;
  cursor: pointer;
}
.scenario-library-filter:hover { color: var(--ink); }
.scenario-library-filter.active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}
.scenario-library-help {
  margin: 9px 0 3px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}
.scenario-library-feedback {
  min-height: 18px;
  margin: 0 0 5px;
  color: var(--brand-dark);
  font-size: 0.72rem;
  line-height: 1.3;
}
.scenario-library-feedback.error { color: var(--danger); }
.scenario-library-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}
.scenario-library-card {
  min-width: 0;
  padding: 3px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  cursor: grab;
  text-align: center;
}
.scenario-library-card[hidden] { display: none; }
.scenario-library-card:hover {
  border-color: #c7d2fe;
  background: #eef2ff;
}
.scenario-library-card:active { cursor: grabbing; }
.scenario-library-card:focus-visible {
  outline: 2px solid rgba(79, 70, 229, 0.35);
  outline-offset: 1px;
}
.scenario-library-card.dragging { opacity: 0.55; }
.scenario-library-thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 5px;
  background: #e5e7eb;
}
.scenario-library-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.scenario-library-placeholder {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 1.25rem;
  font-weight: 700;
}
.scenario-library-name {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.69rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.scenario-library-role {
  position: absolute;
  top: 3px;
  right: 3px;
  display: none;
  width: 21px;
  height: 21px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  color: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.22);
}
.scenario-library-role svg { width: 12px; height: 12px; }
.scenario-library-role-speaking,
.scenario-library-role-mute { display: none; }
.scenario-library-card.role-speaking .scenario-library-role {
  display: flex;
  background: var(--brand);
}
.scenario-library-card.role-speaking .scenario-library-role-speaking { display: block; }
.scenario-library-card.role-mute .scenario-library-role {
  display: flex;
  background: #737986;
}
.scenario-library-card.role-mute .scenario-library-role-mute { display: block; }
.scenario-library-empty,
.scenario-library-no-result {
  grid-column: 1 / -1;
  margin: 8px 0;
  font-size: 0.8rem;
}
.rte-editor .scenario-drop-target {
  outline: 2px solid rgba(79, 70, 229, 0.45);
  outline-offset: 3px;
  background: rgba(79, 70, 229, 0.06);
}
.rte-editor.scenario-drop-invalid { cursor: not-allowed; }

.scenario-print-row {
  margin-top: 16px;
  text-align: center;
}
.scenario-print-document {
  position: fixed;
  left: -10000px;
  top: 0;
  width: calc(210mm - 2.5in);
  visibility: hidden;
  pointer-events: none;
}
.scenario-print-page {
  width: 100%;
  /* Garde une petite marge de securite : sans elle, les arrondis de Safari/
     Chromium peuvent fragmenter la page d'un pixel et decaler tout le contenu
     de la page suivante. */
  height: calc(297mm - 2in - 2mm);
  overflow: hidden;
  break-after: page;
  page-break-after: always;
}
.scenario-print-page:last-child { break-after: auto; page-break-after: auto; }
.scenario-print-document .rte-editor {
  width: 100%; height: auto; min-height: 0; padding: 0; overflow: visible;
  box-shadow: none; border: 0; background: #fff; color: #000;
  font: 12pt/1 Courier, "Courier New", monospace;
}
.scenario-print-page > .rte-editor { height:100%; overflow:hidden; }
.scenario-print-document .rte-editor * {
  color:#000 !important;
  -webkit-text-fill-color:#000 !important;
  background:transparent !important;
  text-decoration-color:#000 !important;
  text-shadow:none !important;
  font:inherit;
  line-height:1;
}
.scenario-print-document .rte-editor div,
.scenario-print-document .rte-editor p { margin-top:0; margin-bottom:.42cm; }
.scenario-print-document .sc-print-speech { margin:0; }
.scenario-print-document .sc-nom { width:26ch; margin-left:calc(50% - 7ch); margin-right:0; font-weight:400; }
.scenario-print-document .sc-parenthese { width:32ch; margin-left:auto; margin-right:auto; }
.scenario-print-document .sc-dialogue { width:38ch; margin-left:auto; margin-right:auto; orphans:2; widows:2; }
.scenario-print-page-end { break-after:page; page-break-after:always; }
@page {
  size: A4;
  /* Adaptation A4 des marges usuelles d'un scénario : 1,5 po à
     gauche, 1 po sur les trois autres côtés. */
  margin: 1in 1in 1in 1.5in;
}
@media print {
  html, body {
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
  }
  .container {
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .topbar, .page-head, h1, .scenario-side,
  .scenario-editor-head, .scenario-print-row, .rte-toolbar, .flash { display: none !important; }
  .scenario-layout { display: block !important; margin: 0 !important; }
  body.scenario-print-active > *:not(.scenario-print-document) { display: none !important; }
  body.scenario-print-active .scenario-print-document {
    position: static;
    left: auto;
    width: auto;
    visibility: visible;
    pointer-events: auto;
  }
  .scenario-editor { max-width: none !important; width: 100% !important; }
  #rte-editor {
    width: 100%;
    height: auto !important;
    min-height: auto;
    overflow: visible !important;
    padding: 0;
    box-shadow: none;
    border: none;
    border-radius: 0;
    background: #fff;
    font-family: Courier, "Courier New", monospace !important;
    font-size: 12pt !important;
    line-height: 1.0 !important;
    color: #000 !important;
  }
  #rte-editor * {
    color: #000 !important;
    -webkit-text-fill-color: #000 !important;
    background: transparent !important;
    text-decoration-color: #000 !important;
    text-shadow: none !important;
    font-family: Courier, "Courier New", monospace !important;
    font-size: 12pt !important;
    line-height: 1.0 !important;
  }
  #rte-editor div, #rte-editor p {
    margin-top: 0;
    margin-bottom: 0.42cm;
  }
  .sc-action, #rte-editor > div:not([class]) { margin-left: 0; margin-right: 0; }
  .sc-nom {
    width: 26ch;
    max-width: calc(50% + 7ch);
    margin-left: calc(50% - 7ch) !important;
    margin-right: 0 !important;
    font-weight: 400 !important;
  }
  .sc-identification { margin-left: 0; margin-right: 0; font-weight: 400 !important; }
  .sc-parenthese {
    width: 32ch;
    max-width: 100%;
    margin-left: auto !important;
    margin-right: auto !important;
  }
  .sc-dialogue {
    width: 38ch;
    max-width: 100%;
    margin-left: auto !important;
    margin-right: auto !important;
    orphans: 2;
    widows: 2;
  }
  .print-hide { display: none !important; }
  .sc-tag {
    display: inline !important;
    background: none !important;
    color: #000 !important;
    font-weight: 400 !important;
    text-decoration: none !important;
    padding: 0 !important;
  }
}

.note-drawer-tab { position:fixed; right:0; top:50%; z-index:1001; writing-mode:vertical-rl; padding:16px 9px; border:1px solid var(--line); border-radius:8px 0 0 8px; background:var(--panel); color:var(--text); cursor:pointer; font:inherit; }
.note-drawer { position:fixed; right:0; top:70px; bottom:16px; width:min(440px,calc(100vw - 48px)); z-index:1000; background:var(--panel); border:1px solid var(--line); border-radius:10px 0 0 10px; box-shadow:-5px 4px 20px #0002; overflow:auto; animation:note-slide-in .18s ease-out; }
.note-drawer[hidden] { display:none; }
.note-drawer-open .note-drawer-tab { right:min(440px,calc(100vw - 48px)); }
.note-drawer-actions { display:flex; justify-content:flex-end; gap:8px; padding:8px 12px; }
#note-drawer-pin[aria-pressed="true"] { background:var(--brand); color:white; }
.note-drawer .personal-note-card { border:0; margin:0; box-shadow:none; }
.note-drawer .personal-note-editor { min-height:300px; }
@keyframes note-slide-in { from { transform:translateX(100%); } to { transform:translateX(0); } }
@media (prefers-reduced-motion:reduce) { .note-drawer { animation:none; } }
@media print { .note-drawer, .note-drawer-tab { display:none !important; } }

/* Demandes Discord : volet latéral indépendant de la note personnelle. */
.discord-drawer-tab { top:calc(50% + 74px); }
.discord-drawer-open .discord-drawer-tab { right:min(440px,calc(100vw - 48px)); }
.discord-drawer { padding:0; }
.discord-drawer-heading { display:flex; align-items:center; justify-content:space-between; padding:14px 18px 4px; }
.discord-drawer-heading h2 { margin:0; font-size:1.1rem; }
.discord-connection-notice { margin:8px 18px 14px; color:var(--muted); font-size:.84rem; line-height:1.4; }
.discord-drawer-tabs { display:flex; gap:6px; padding:0 18px 12px; border-bottom:1px solid var(--line); }
.discord-drawer-content { padding:16px 18px 24px; }
#discord-request-form { display:flex; flex-direction:column; gap:8px; }
#discord-request-form > label { font-weight:600; font-size:.9rem; }
#discord-user-search,
#discord-request-message { width:100%; box-sizing:border-box; font:inherit; border:1px solid var(--line); border-radius:8px; background:var(--panel); color:var(--ink); padding:9px 10px; }
#discord-request-message { resize:vertical; min-height:120px; }
.discord-user-list { display:flex; flex-direction:column; gap:2px; max-height:160px; overflow:auto; border:1px solid var(--line); border-radius:8px; padding:5px; }
.discord-user-choice { display:flex; align-items:center; gap:9px; padding:5px 7px; cursor:pointer; border-radius:5px; }
.discord-user-choice:hover { background:var(--surface, #f3f4f6); }
.discord-user-choice[hidden] { display:none; }
.discord-page-context { margin:2px 0 4px; color:var(--muted); font-size:.82rem; overflow-wrap:anywhere; }
.discord-drawer-feedback { min-height:1.4em; color:var(--muted); font-size:.85rem; }
.discord-drawer-feedback.is-error { color:var(--danger); }
.discord-request-card { border-bottom:1px solid var(--line); padding:12px 0; }
.discord-request-card:first-child { padding-top:0; }
.discord-request-meta { margin:0 0 5px; color:var(--muted); font-size:.8rem; }
.discord-request-text { margin:0 0 8px; white-space:pre-wrap; overflow-wrap:anywhere; }
.discord-request-link { display:block; overflow-wrap:anywhere; font-size:.82rem; margin-bottom:8px; }
.discord-status-label { display:flex; align-items:center; gap:8px; font-size:.85rem; }
.discord-status-select { border:1px solid var(--line); border-radius:6px; padding:5px 8px; background:var(--panel); color:var(--ink); }
.discord-recipient-statuses { margin:6px 0 0; padding-left:18px; font-size:.85rem; }
@media (max-width:600px) {
  .discord-drawer-tab { top:calc(50% + 70px); }
  .discord-drawer-tabs { flex-wrap:wrap; }
}
@media print { .discord-drawer, .discord-drawer-tab { display:none !important; } }
.sc-parenthese { font-style: italic; }
.sc-action {
  font-weight: 400;
  text-transform: none;
  margin-left: 0;
  margin-right: 0;
}
.sc-identification {
  font-weight: 700;
  text-transform: uppercase;
  margin-left: 0;
  margin-right: 0;
}
.sc-nom {
  font-weight: 700;
  text-transform: uppercase;
  margin-left: 270px;
  margin-right: 0;
}
.sc-parenthese {
  font-weight: 400;
  text-transform: none;
  margin-left: 203px;
  margin-right: 0;
}
.sc-dialogue {
  font-weight: 400;
  text-transform: none;
  margin-left: 157px;
  margin-right: 157px;
}
.sc-slugline { font-weight: 700; text-transform: uppercase; margin-left: 0; }
.sc-character { font-weight: 700; margin-left: 38%; }
.version-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.version-item {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
}
.version-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.version-date {
  font-size: 0.75rem;
  color: var(--muted);
}
.version-user {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 999px;
  color: #fff;
}
.version-actions {
  display: flex;
  gap: 4px;
}
.version-view.viewing {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.version-current {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.12);
}
.version-current-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1.5px solid;
  border-radius: 6px;
  padding: 4px 8px;
  margin: 4px 0;
}
.version-current-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.version-current-user {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink);
}
.version-modified {
  font-size: 0.7rem;
  color: var(--muted);
  font-style: italic;
  margin: 2px 0;
}

/* Avatar */
.avatar-pick {
  width: 61px;
  height: 61px;
  border-radius: 50%;
  cursor: pointer;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: box-shadow 0.15s;
}
.avatar-pick:hover { box-shadow: 0 0 0 2px var(--brand); }
.avatar-img {
  width: 61px;
  height: 61px;
  border-radius: 50%;
  object-fit: cover;
}
.avatar-fallback {
  width: 61px;
  height: 61px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 1.5rem;
}

.user-avatar-fieldset { margin: 0; }
.user-avatar-editor {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.user-avatar-preview-wrap {
  position: relative;
  width: 144px;
  height: 144px;
  flex: 0 0 144px;
}
.user-avatar-preview,
.user-avatar-fallback {
  width: 144px;
  height: 144px;
  border-radius: 50%;
  border: 1px solid var(--line);
}
.user-avatar-preview {
  display: block;
  object-fit: cover;
}
.user-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 3rem;
  font-weight: 700;
}
.user-avatar-preview[hidden],
.user-avatar-fallback[hidden],
.user-avatar-delete[hidden] { display: none; }
.user-avatar-delete {
  top: 4px;
  right: 4px;
}
.user-avatar-dropzone {
  display: flex;
  flex: 1 1 320px;
  min-height: 120px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.user-avatar-dropzone span,
.user-avatar-dropzone small { color: var(--muted); }
.user-avatar-dropzone:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* Statut de sauvegarde */
.save-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--muted);
}
.save-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}
.save-dot-saving {
  background: #f2a33a;
  animation: pulse 1.2s ease-in-out infinite;
}
.save-dot-saved {
  background: #64cf6a;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Diffusion */
.diffusion-list-toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.diffusion-list-toolbar .view-toggle { margin-bottom: 18px; }
.diff-reorder-disabled .diff-handle { cursor: default; opacity: 0.25; }
.diffusion-table .diff-handle-col { width: 32px; text-align: center; }
.diff-handle {
  cursor: grab;
  color: var(--line);
  font-size: 1rem;
  user-select: none;
  display: inline-block;
  padding: 0 4px;
  line-height: 1;
}
.diff-item:hover .diff-handle { color: var(--muted); }
.diff-item.diff-dragging { opacity: 0.4; }
.diff-item.diff-drop-before td { box-shadow: inset 0 3px 0 var(--brand); }
.diff-item.diff-drop-after td { box-shadow: inset 0 -3px 0 var(--brand); }
.diff-row[data-ready="1"] { background: #f0fdf4; }
.diff-row[data-ready="1"]:hover { background: #dcfce7; }
.diff-separator-row td {
  background: #f8f9fb;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--muted);
  padding: 8px 12px;
  border-bottom: 2px solid var(--line);
}
.diff-separator-row .diff-handle-col { padding-left: 8px; padding-right: 8px; }
.diff-type-story { background: #ede9fe; color: #6d28d9; }
.diff-export-cell { text-align: center; }
.diff-export-cb { width: 18px; height: 18px; cursor: pointer; }
.separator-rename-form {
  display: flex;
  align-items: center;
  gap: 8px;
}
.separator-rename-form input { max-width: 420px; }
.diffusion-config-table .chapter-config-handle-col {
  width: 38px;
  padding-left: 8px;
  padding-right: 8px;
  text-align: center;
}
.chapter-config-handle { color: var(--muted); }
.chapter-config-row:hover .chapter-config-handle { color: var(--ink); }
.chapter-config-saving .chapter-config-handle { cursor: wait; opacity: 0.35; }
.chapter-config-row.chapter-config-dragging { opacity: 0.4; }
.chapter-config-row.chapter-drop-before td { box-shadow: inset 0 3px 0 var(--brand); }
.chapter-config-row.chapter-drop-after td { box-shadow: inset 0 -3px 0 var(--brand); }
.separator-rename-form input[type="color"], .separator-add-form input[type="color"] { flex: 0 0 44px; width: 44px; height: 36px; padding: 2px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); cursor: pointer; }
.separator-add-form {
  display: flex;
  align-items: end;
  gap: 8px;
  margin-top: 14px;
}
.separator-add-form label { flex: 1; max-width: 520px; }

/* Diff modal */
.diff-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}
.diff-modal-content {
  background: var(--panel);
  border-radius: var(--radius);
  max-width: 800px;
  width: 90%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}
.diff-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}
.diff-modal-head h2 { margin: 0; font-size: 1.1rem; }
.diff-output {
  padding: 16px;
  overflow-y: auto;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  line-height: 1.8;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}
.checkbox-inline input { margin: 0; }

.asset-name-row {
  display: flex;
  align-items: flex-end;
  gap: 18px;
}
.form .asset-name-field {
  flex: 1 1 auto;
  min-width: 0;
}
.form .asset-todo-checkbox {
  flex: 0 0 auto;
  margin-bottom: 20px;
}

@media (max-width: 600px) {
  .asset-name-row {
    display: block;
  }
  .form .asset-todo-checkbox {
    margin-top: 0;
    margin-bottom: 14px;
  }
}

.sc-tag {
  display: inline-block;
  background: rgba(79, 70, 229, 0.1);
  color: var(--brand);
  border-radius: 4px;
  padding: 0 4px;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}
.sc-tag:hover { background: rgba(79, 70, 229, 0.2); }
.sc-tag.sc-tag-prop {
  background: rgba(107, 92, 128, 0.11);
  color: #6b5c80;
}
.sc-tag.sc-tag-prop:hover { background: rgba(107, 92, 128, 0.2); }
.sc-tag.sc-tag-secondary {
  color: #5f6f8f;
  background: rgba(95, 111, 143, 0.1);
}
.sc-tag.sc-tag-secondary:hover { background: rgba(95, 111, 143, 0.2); }

.autocomplete-box {
  position: fixed;
  z-index: 1000;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  max-height: 240px;
  overflow-y: auto;
  min-width: 200px;
  font-family: Georgia, "Times New Roman", serif;
}
.ac-item {
  padding: 6px 12px;
  cursor: pointer;
  font-size: 0.95rem;
}
.ac-item:hover { background: var(--bg); }
.ac-active { background: rgba(79, 70, 229, 0.08); color: var(--brand); }

.tag-popup {
  position: fixed;
  z-index: 1001;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  width: 220px;
  font-family: Georgia, "Times New Roman", serif;
}
.tag-popup input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: none;
  border-bottom: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
  font-size: 0.9rem;
  outline: none;
  font-family: inherit;
}
.tag-popup-results {
  max-height: 200px;
  overflow-y: auto;
}

.sb-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.sb-card {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  cursor: grab;
}
.sb-card:active { cursor: grabbing; }
.sb-card-img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 8px;
}
.sb-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}
.sb-card-text {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 0.85rem;
  resize: vertical;
  min-height: 80px;
  box-sizing: border-box;
  font-family: inherit;
  outline: none;
}
.sb-card-text:focus { border-color: var(--brand); }

.sb-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sb-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  cursor: grab;
}
.sb-row:active { cursor: grabbing; }
.sb-row-handle {
  display: flex;
  align-items: center;
  padding-top: 8px;
  color: var(--muted);
}
.sb-row-thumb {
  width: 130px;
  height: 130px;
  flex-shrink: 0;
  border-radius: 6px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.sb-row-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}
.sb-row-text {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  font-size: 0.9rem;
  min-height: 80px;
  box-sizing: border-box;
  font-family: inherit;
  outline: none;
  resize: none;
}
.sb-row-text:focus { border-color: var(--brand); }
.sb-row-delete {
  flex-shrink: 0;
  margin-top: 4px;
}

.sb-placeholder {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
}
.sb-drop-active {
  outline: 2px dashed var(--brand);
  outline-offset: -4px;
}
.sb-dragging { opacity: 0.4; }
.sb-drag-over { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(79,70,229,0.15); }

.sb-ratio-169 .sb-card-img { aspect-ratio: 16 / 9; }
.sb-ratio-169 .sb-row-thumb { width: 220px; height: auto; aspect-ratio: 16 / 9; }
.sb-ratio-916 .sb-card-img { aspect-ratio: 9 / 16; }
.sb-ratio-916 .sb-row-thumb { width: 80px; height: auto; aspect-ratio: 9 / 16; }
.assignment-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 0.45fr) minmax(260px, 1fr);
  gap: 16px;
  margin-bottom: 14px;
}

.assignment-stage-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.assignment-stage-button {
  min-width: 94px;
  justify-content: center;
}

.assignment-stage-list h4 {
  margin: 0 0 10px;
}

.assignment-users {
  grid-template-columns: repeat(auto-fill, minmax(136px, 1fr));
  gap: 12px;
}
.assignment-user-card {
  position: relative;
  display: flex;
  min-height: 126px;
  align-items: center;
  justify-content: flex-start;
  flex-direction: column;
  gap: 10px;
  padding: 10px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}
.form .assignment-user-card {
  display: flex;
  margin: 0;
}
.assignment-user-card > input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
}
.assignment-user-avatar,
.assignment-user-avatar-fallback {
  display: flex;
  width: 82px;
  height: 82px;
  flex: 0 0 82px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 50%;
}
.assignment-user-avatar {
  align-self: center;
  border: 3px solid #fff;
  box-shadow: 0 0 0 1px var(--line);
  transition: box-shadow 0.15s, transform 0.15s;
}
.assignment-user-card:hover .assignment-user-avatar {
  box-shadow: 0 0 0 2px #c8cdd6;
  transform: translateY(-1px);
}
.assignment-user-card > input:checked + .assignment-user-avatar {
  box-shadow: 0 0 0 3px var(--brand);
}
.assignment-user-card > input:focus-visible + .assignment-user-avatar {
  outline: 2px solid var(--ink);
  outline-offset: 5px;
}
.assignment-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.assignment-user-avatar-fallback {
  color: #fff;
  font-size: 1.65rem;
  font-weight: 700;
}
.assignment-user-name {
  display: block;
  width: 100%;
  margin-top: 2px;
  align-self: center;
  overflow-wrap: anywhere;
  font-size: 0.86rem;
  line-height: 1.25;
  text-align: center;
}
.owner-assignment-user {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
}
.owner-assignment-user .assignment-user-card {
  width: 100%;
  min-height: 122px;
  box-sizing: border-box;
}
.owner-activity-toggle {
  display: inline-flex;
  margin-top: -3px;
  cursor: pointer;
}
.owner-activity-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
}
.owner-activity-toggle span {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1;
}
.owner-activity-toggle input:checked + span {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}
.owner-activity-toggle input:focus-visible + span {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
.owner-activity-toggle input:disabled + span {
  opacity: 0.42;
  cursor: not-allowed;
}

.assignment-stage-list[hidden],
.assignment-user[hidden] {
  display: none !important;
}

.assignment-no-result {
  margin: 10px 0 0;
}

@media (max-width: 700px) {
  .assignment-toolbar {
    grid-template-columns: 1fr;
  }
}

/* Bibliothèque et lecteur vidéo Épisodes / Stories */
.content-video-column,
.content-video-cell { width: 92px; text-align: center; }
.content-video-thumbnail,
.content-video-placeholder {
  display: inline-flex;
  width: 56px;
  height: 56px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f6f7f9;
  color: var(--muted);
  text-decoration: none;
}
.content-video-thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.content-video-thumbnail:hover,
.content-video-placeholder:hover {
  border-color: var(--brand);
  color: var(--brand);
}
.content-video-placeholder {
  border-style: dashed;
  font-size: 1.45rem;
  font-weight: 400;
}
.content-video-thumbnail.dragover,
.content-video-placeholder.dragover,
.content-video-stage-empty.dragover {
  border-color: var(--brand);
  background: #eef2ff;
  color: var(--brand);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.14);
}
.content-video-thumbnail.uploading,
.content-video-placeholder.uploading,
.content-video-stage-empty.uploading {
  cursor: wait;
  border-color: var(--brand);
  color: var(--brand);
}
[data-content-video-drop].uploading { position: relative; }
[data-content-video-drop].uploading::after {
  content: attr(data-upload-progress);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  background: rgba(31, 36, 48, 0.78);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
}
.content-video-library { margin-top: 20px; }
.content-video-library-head h2,
.content-video-stage-card h3 { margin: 0; }
.content-video-library-head { margin-bottom: 16px; }
.content-video-library-head p { margin: 5px 0 0; }
.content-video-stage-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(210px, 1fr));
  gap: 14px;
}
.content-video-stage-card {
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}
.content-video-stage-card h3 { margin-bottom: 10px; font-size: 1rem; }
.content-video-stage-preview,
.content-video-stage-empty {
  position: relative;
  display: flex;
  width: 100%;
  aspect-ratio: 16 / 9;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f3f4f6;
  color: var(--muted);
  text-decoration: none;
}
.content-video-stage-preview img { width: 100%; height: 100%; object-fit: cover; }
.content-video-stage-empty {
  border-style: dashed;
  font: inherit;
  font-size: 2.2rem;
  cursor: pointer;
}
.content-video-stage-empty:hover { border-color: var(--brand); color: var(--brand); }
.content-video-play {
  position: absolute;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  padding-left: 3px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
}
.content-video-meta { display: grid; gap: 2px; margin: 9px 0; font-size: 0.78rem; }
.content-video-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.content-video-meta span { color: var(--muted); }
.content-video-card-actions { display: flex; align-items: center; gap: 7px; }
.content-video-card-actions form { margin: 0; }
.content-video-versions { margin-top: 10px; font-size: 0.8rem; }
.content-video-versions > summary { color: var(--brand); cursor: pointer; }
.content-video-version-list { display: grid; gap: 6px; margin-top: 8px; }
.content-video-version-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}
.content-video-version-row > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.content-video-version-row form { margin: 0; }
.content-video-empty-label { margin: 6px 0 9px; text-align: center; font-size: 0.8rem; }
.content-video-add { margin-top: 10px; font-size: 0.85rem; }
.content-video-add summary { cursor: pointer; color: var(--brand); }
.content-video-add form { display: grid; gap: 7px; margin-top: 9px; }
.content-video-upload-zone {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 7px;
  color: var(--muted);
  cursor: pointer;
}
.content-video-upload-zone.dragover { border-color: var(--brand); background: #eef2ff; }
.content-video-upload-zone input { max-width: 100%; }
.content-video-or { margin: 9px 0 0; color: var(--muted); text-align: center; }
.content-video-server-form input { width: 100%; box-sizing: border-box; }
.content-video-archives { margin-top: 16px; }
.content-video-archives > summary { cursor: pointer; font-weight: 600; }
.content-video-archive-list { display: grid; gap: 7px; margin-top: 10px; }
.content-video-archive-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
}
.content-video-browser {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.55);
}
.content-video-browser[hidden] { display: none; }
.content-video-browser-dialog {
  width: min(720px, 94vw);
  max-height: 84vh;
  overflow: auto;
  padding: 18px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.24);
}
.content-video-browser-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.content-video-browser-list { display: grid; gap: 5px; margin-top: 10px; }
.content-video-browser-entry {
  padding: 9px 11px;
  border: 0;
  border-radius: 6px;
  background: #f6f7f9;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.content-video-browser-entry:hover { background: #e9edf5; }
.content-video-browser-entry.file { color: var(--brand); }
.content-video-stage-modal {
  position: fixed;
  z-index: 1100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.55);
}
.content-video-stage-modal[hidden] { display: none; }
.content-video-stage-dialog {
  width: min(430px, 94vw);
  padding: 20px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.24);
}
.content-video-stage-dialog h2 { margin: 0 0 4px; font-size: 1.15rem; }
.content-video-stage-dialog p { margin: 0 0 15px; }
.content-video-stage-choices {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.content-video-stage-choices .btn { justify-content: center; }

.video-review-page { max-width: 1900px; margin: 0 auto; }
.video-review-page [hidden] { display: none !important; }
.plan-video-review-main { max-width: 1500px; margin: 0 auto; }
.video-review-head { display: flex; align-items: center; gap: 18px; margin-bottom: 14px; }
.video-review-scenario-link { margin-left: auto; flex-shrink: 0; }
@media (max-width: 700px) { .video-review-head { flex-wrap: wrap; } }
.video-review-head h1,
.video-review-head p { margin: 0; }
.video-review-stages { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.video-review-stage.is-primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}
.video-review-stage.is-secondary {
  border-color: #7357b5;
  background: #7357b5;
  color: #fff;
}
.video-review-stage.has-two-selections {
  border-color: #6756a8;
  background: linear-gradient(90deg, var(--brand) 0 50%, #7357b5 50% 100%);
  color: #fff;
}
.video-review-stage:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}
.video-review-versions {
  display: grid;
  gap: 7px;
  margin-bottom: 9px;
}
.video-review-version-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.video-review-version-group[hidden] { display: none; }
.video-review-version-label {
  min-width: 92px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}
.video-review-version-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.video-review-version.is-primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}
.video-review-version.is-secondary {
  border-color: #7357b5;
  background: #7357b5;
  color: #fff;
}
.video-review-selection-feedback {
  min-height: 18px;
  margin: 0 0 10px;
  font-size: 0.82rem;
}
.video-review-view-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 14px;
}
.video-review-view-modes .btn.active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}
.video-review-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 16px;
  align-items: start;
}
.video-review-main,
.video-review-comments {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}
.video-review-screen {
  display: flex;
  min-height: 420px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 9px 9px 0 0;
  background-color: #20242b;
  background-image:
    linear-gradient(45deg, #2d323a 25%, transparent 25%),
    linear-gradient(-45deg, #2d323a 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #2d323a 75%),
    linear-gradient(-45deg, transparent 75%, #2d323a 75%);
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
}
.video-review-viewport {
  --compare-position: 50%;
  position: relative;
  flex: 0 0 auto;
  max-width: 100%;
  overflow: hidden;
  background: #000;
}
.video-review-screen video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: transparent;
}
.video-review-screen[data-view-mode="16:9"] video,
.video-review-screen[data-view-mode="9:16"] video { object-fit: cover; }
.video-review-compare-layer {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: none;
  overflow: hidden;
  clip-path: inset(0 0 0 var(--compare-position));
  pointer-events: none;
}
.video-review-viewport.is-comparing .video-review-compare-layer { display: block; }
.video-review-compare-label {
  position: absolute;
  z-index: 5;
  top: 10px;
  display: none;
  padding: 4px 8px;
  border-radius: 5px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  pointer-events: none;
}
.video-review-compare-label-primary { left: 10px; }
.video-review-compare-label-secondary { right: 10px; }
.video-review-viewport.is-comparing .video-review-compare-label { display: block; }
.video-review-divider {
  position: absolute;
  z-index: 8;
  top: 0;
  bottom: 0;
  left: var(--compare-position);
  display: none;
  width: 34px;
  transform: translateX(-50%);
  cursor: ew-resize;
  touch-action: none;
  outline: none;
}
.video-review-viewport.is-comparing .video-review-divider { display: block; }
.video-review-divider-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: #fff;
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.7);
}
.video-review-divider-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  transform: translate(-50%, -50%);
  border: 1px solid #fff;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.78);
  color: #fff;
  font-size: 0.9rem;
}
.video-review-divider:focus-visible .video-review-divider-handle {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.38);
}
.video-review-guides {
  position: absolute;
  z-index: 6;
  inset: 0;
  display: none;
  pointer-events: none;
}
.video-review-screen[data-view-mode="guides"] .video-review-guides { display: block; }
.video-review-viewport #video-review-annotation-layer {
  position: absolute;
  z-index: 7;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.video-review-viewport #video-review-annotation-layer.is-editing {
  pointer-events: auto;
  cursor: crosshair;
  touch-action: none;
}
.video-review-viewport #video-review-annotation-layer[data-tool="select"] { cursor: move; }
.video-review-viewport #video-review-annotation-layer[data-tool="erase"] { cursor: not-allowed; }
#video-review-text-input {
  position: absolute;
  z-index: 9;
  width: min(250px, 40%);
  padding: 5px;
  border: 1px solid #fff;
  border-radius: 3px;
  background: #fff;
  color: #111;
}
.video-review-scrubber { position: relative; height: 24px; margin: 5px 12px 0; }
#video-review-seek { width: 100%; margin: 0; accent-color: var(--brand); }
#video-review-markers { position: absolute; inset: 0 8px; pointer-events: none; }
.video-review-marker {
  position: absolute;
  top: 3px;
  width: 8px;
  height: 14px;
  padding: 0;
  transform: translateX(-50%);
  border: 1px solid #fff;
  border-radius: 2px;
  background: #ef7f33;
  cursor: pointer;
  pointer-events: auto;
}
.video-review-marker:hover, .video-review-marker:focus-visible { height: 18px; top: 1px; }
.video-review-guide {
  position: absolute;
  top: 50%;
  left: 50%;
  box-sizing: border-box;
  transform: translate(-50%, -50%);
  border: 1px solid #fff;
}
.video-review-frame-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
}
.video-review-volume { display: inline-flex; align-items: center; gap: 5px; font-size: 0.76rem; }
.video-review-volume input { width: 78px; accent-color: var(--brand); }
.video-review-audio-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.video-review-audio-toggle[hidden] { display: none; }
.video-review-audio-toggle svg path:first-child { fill: currentColor; stroke: none; }
.video-review-audio-toggle[data-audio-enabled="true"] .video-audio-off,
.video-review-audio-toggle[data-audio-enabled="false"] .video-audio-on { display: none; }
.video-review-time { display: flex; gap: 12px; margin-left: auto; font-family: monospace; font-size: 0.85rem; }
.video-review-comments { min-height: 420px; padding: 16px; }
.video-review-comments h2 { margin-top: 0; }
.video-review-comment-context { font-size: 0.83rem; }
.video-review-annotation-toolbar { margin-bottom: 12px; }
.video-review-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.video-review-tools .active, .video-review-tools [aria-pressed="true"] {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}
.video-review-tools label { display: inline-flex; align-items: center; gap: 4px; font-size: 0.75rem; }
.video-review-tools input[type="color"] { width: 28px; height: 28px; padding: 0; border: 0; background: none; }
#video-review-annotation-frame { font-size: 0.78rem; margin: 7px 0 0; }
#video-review-comment-form textarea { width: 100%; min-height: 74px; resize: vertical; }
.video-review-comment-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
#video-review-comment-feedback { min-height: 1.2em; font-size: 0.8rem; }
.video-review-comment-list { display: grid; gap: 9px; max-height: 70vh; overflow: auto; }
.video-review-comment { padding: 10px; border: 1px solid var(--line); border-radius: 6px; }
.video-review-comment.is-linked { border-color: var(--brand); background: #f5f4ff; }
.video-review-comment p { margin: 7px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.video-review-comment-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px; }
.video-review-comment-heading strong { font-size: 0.83rem; }
.video-review-comment-jump {
  padding: 0;
  border: 0;
  background: none;
  color: var(--brand);
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}
.video-review-drawing-badge { color: var(--muted); font-size: 0.76rem; }
.video-review-comment-item-actions { display: flex; gap: 5px; margin-top: 7px; }
.video-review-warning { margin: 0 12px 12px; color: #9a5b00; }

.user-mention-input { position: relative; }
.user-mention-suggestions {
  position: absolute;
  z-index: 30;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: 0 8px 20px rgba(20, 24, 35, 0.16);
}
.user-mention-suggestions[hidden] { display: none !important; }
.user-mention-option {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.user-mention-option:hover,
.user-mention-option[aria-selected="true"] { background: #f1effb; }
@media (max-width: 1100px) {
  .content-video-stage-grid { grid-template-columns: repeat(2, minmax(210px, 1fr)); }
  .video-review-layout { grid-template-columns: 1fr; }
  .video-review-comments { min-height: 180px; }
}
@media (max-width: 650px) {
  .content-video-stage-grid { grid-template-columns: 1fr; }
  .content-video-archive-row { grid-template-columns: 1fr; }
  .content-video-version-row { grid-template-columns: 1fr auto auto; }
  .video-review-frame-controls { flex-wrap: wrap; }
  .video-review-time { width: 100%; margin-left: 0; justify-content: space-between; }
  .video-review-screen { min-height: 220px; }
}

/* Maquettes isolées — Épisodes / Équipe */
.mockup-notice {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 18px;
  padding: 10px 12px;
  border: 1px solid #c9d5f0;
  border-radius: 8px;
  background: #f4f7ff;
  color: #44516a;
  font-size: 0.88rem;
}
.mockup-badge {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 5px;
  background: var(--brand);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.mockup-page-head { align-items: flex-end; }
.mockup-page-head .lead { margin: 4px 0 0; }
.mockup-disabled,
.mockup-controls :disabled {
  cursor: default;
  opacity: 0.64;
  pointer-events: none;
}
.mockup-table-wrap { overflow-x: auto; }
.mockup-episodes-table { min-width: 1240px; }
.mockup-episodes-table td { vertical-align: middle; }
.mockup-episode-number { white-space: nowrap; }
.mockup-episode-title { min-width: 170px; font-weight: 600; }
.mockup-video-thumb {
  display: grid;
  width: 52px;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid #cbd2dd;
  border-radius: 7px;
  background: linear-gradient(145deg, #d8dde6, #f5f6f8 50%, #c6ceda);
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}
.mockup-pipeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(108px, 1fr));
  gap: 6px;
  min-width: 480px;
}
.mockup-pipeline-step {
  display: grid;
  gap: 5px;
  min-height: 50px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}
.mockup-stage-label { color: var(--brand); font-size: 0.79rem; font-weight: 700; }
.mockup-stage-status,
.mockup-assignment-status,
.mockup-team-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.72rem;
}
.mockup-stage-status i,
.mockup-assignment-status i,
.mockup-team-legend i {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #cbd0d8;
}
.status-en-cours i { background: #f2a33a; }
.status-a-valider i { background: #2563eb; }
.status-termine i { background: #64cf6a; }
.status-retake i { background: #d63331; }
.status-bloque i { background: #667d89; }
.mockup-global-status {
  display: inline-block;
  min-width: 76px;
  padding: 6px 9px;
  border-radius: 6px;
  background: #eef0f3;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
}
.mockup-global-status.status-en-cours { background: #f2a33a; color: #fff; }
.mockup-global-status.status-termine { background: #64cf6a; color: #fff; }
.mockup-progress-cell { min-width: 135px; }
.mockup-progress-cell small { display: block; margin-top: 5px; white-space: nowrap; color: var(--muted); }
.mockup-icon-disabled { cursor: default; opacity: 0.48; pointer-events: none; }
.mockup-explanation {
  display: flex;
  gap: 12px;
  align-items: baseline;
  color: var(--muted);
  font-size: 0.88rem;
}
.mockup-explanation strong { flex: 0 0 auto; color: var(--ink); }
.content-stage-tabs { display:flex; gap:6px; margin:-4px 0 14px; }
.content-stage-mockup-wrap { max-width:100%; overflow-x:auto; }
.content-stage-mockup-wrap[hidden] { display:none; }
.content-stage-mockup-table { min-width:1360px; }
.content-stage-mockup-table td { vertical-align:middle; }
.content-stage-list-wrap { max-width:100%; overflow-x:auto; }
.content-stage-list-table { min-width:1120px; }
.content-stage-list-table td { vertical-align:middle; }
.content-stage-list-table .content-video-cell { padding-top:8px; padding-bottom:8px; }
.content-stage-session, .content-stage-number { width:68px; text-align:center; white-space:nowrap; }
.content-stage-title { min-width:260px; font-weight:400; }
.content-stage-title .ep-titre-link { color:inherit; font-weight:400; text-decoration:none; }
.content-stage-title .ep-titre-link:hover { color:var(--brand); text-decoration:none; }
.content-row-stopped .content-stage-title .ep-titre-link,
.content-row-stopped .content-stage-title .ep-titre-link:hover {
  color:var(--muted);
  text-decoration:line-through;
  text-decoration-thickness:1.5px;
}
.content-stage-control { display:inline-flex; align-items:center; gap:5px; padding:4px 6px 4px 8px; border:1px solid #d7dbe2; border-radius:6px; background:#fff; white-space:nowrap; }
.content-stage-link { padding:0; border:0; background:transparent; color:#4f5663; cursor:pointer; font:inherit; font-size:.74rem; font-weight:650; text-decoration:none; }
.content-stage-link:hover { color:var(--brand); text-decoration:none; }
.content-stage-dot { width:8px; height:8px; flex:0 0 auto; padding:0; border:1px solid #c9ced6; border-radius:50%; background:#fff; cursor:pointer; }
.content-stage-dot:hover { transform:scale(1.18); }
.content-stage-dot:disabled { cursor:wait; opacity:.55; }
.content-stage-control[data-state="working"] .content-stage-dot { border-color:#f2a33a; background:#f2a33a; }
.content-stage-control[data-state="done"] .content-stage-dot { border-color:#64cf6a; background:#64cf6a; }
.content-stage-category,
.content-global-state {
  border: 0;
  border-radius: 999px;
  padding: 2px 22px 2px 10px;
  box-shadow: none;
  font: inherit;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-repeat: no-repeat;
  background-position: right 6px center;
}
.content-stage-category {
  min-width: 104px;
  color: var(--ink);
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='16' viewBox='0 0 10 16'%3E%3Cpath d='M2 5l3-3 3 3' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M2 11l3 3 3-3' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.content-global-state-cell { width:130px; min-width:130px; }
.content-global-state {
  width: 130px;
  padding-right: 26px;
  padding-left: 12px;
  font-size: .78rem;
  background-position: right 9px center;
  color: #4d5562;
  background-color: #eef0f3;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='16' viewBox='0 0 10 16'%3E%3Cpath d='M2 5l3-3 3 3' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M2 11l3 3 3-3' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.content-global-state[data-value="Terminé"] { background-color:#64cf6a; color:#fff; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='16' viewBox='0 0 10 16'%3E%3Cpath d='M2 5l3-3 3 3M2 11l3 3 3-3' stroke='%23fff' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.content-global-state[data-value="Arrêté"] { background-color:#d63331; color:#fff; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='16' viewBox='0 0 10 16'%3E%3Cpath d='M2 5l3-3 3 3M2 11l3 3 3-3' stroke='%23fff' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.content-stage-actions-cell { vertical-align:middle; }
.content-stage-row-actions { align-items:center; flex-wrap:nowrap; }
.content-stage-principle { margin-top:14px; }
.mockup-view-switch { display: flex; gap: 6px; }
.mockup-team-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: -4px 0 12px;
}
.mockup-team-table { min-width: 1510px; table-layout: fixed; }
.mockup-team-table th:first-child,
.mockup-team-table td:first-child { width: 205px; }
.mockup-team-table th:not(:first-child),
.mockup-team-table td:not(:first-child) { width: 180px; }
.mockup-team-table td { vertical-align: top; }
.mockup-sticky-column {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #fff;
  box-shadow: 1px 0 0 var(--line);
}
.mockup-team-table thead .mockup-sticky-column { z-index: 3; background: #f8f9fb; }
.mockup-content-row .mockup-sticky-column span,
.mockup-content-row .mockup-sticky-column small { display: block; }
.mockup-content-row .mockup-sticky-column span { margin-top: 3px; font-size: 0.8rem; }
.mockup-content-row .mockup-sticky-column small { margin-top: 8px; color: var(--brand); }
.mockup-assignment-cell { display: grid; gap: 8px; min-height: 51px; }
.mockup-avatar-stack { display: flex; padding-left: 1px; }
.mockup-avatar {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  margin-left: -5px;
  border: 1px solid #fff;
  border-radius: 50%;
  background: #5f6f96;
  color: #fff;
  font-size: 0.61rem;
  font-weight: 700;
}
.mockup-avatar:first-child { margin-left: 0; }
.mockup-avatar:nth-child(2n) { background: #876b9b; }
.mockup-avatar:nth-child(3n) { background: #4f7f84; }
.mockup-unassigned { color: #a0a5ae; font-size: 0.72rem; }
.mockup-plan-row td { background: #fafbfc; }
.mockup-plan-row .mockup-sticky-column { background: #fafbfc; }
.mockup-plan-indent { padding-left: 13px; color: #596170; font-size: 0.79rem; font-weight: 600; }
.mockup-plan-scope { color: var(--muted); font-size: 0.72rem; font-style: italic; }

@media (max-width: 900px) {
  .mockup-notice { align-items: flex-start; }
  .mockup-explanation { align-items: flex-start; flex-direction: column; gap: 4px; }
}

.mockup-simple-list { display: grid; gap: 12px; }
.mockup-simple-episode { margin: 0; padding: 0; overflow: hidden; }
.mockup-simple-episode-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #f8f9fb;
}
.mockup-simple-episode-head div { display: flex; align-items: baseline; gap: 10px; }
.mockup-simple-episode-head div > span { color: var(--muted); font-size: 0.86rem; }
.mockup-plan-note {
  padding: 4px 7px;
  border-radius: 5px;
  background: #fff3dd;
  color: #8b5b12;
  font-size: 0.72rem;
}
.mockup-simple-main-stages {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}
.mockup-simple-stage {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-right: 1px solid var(--line);
}
.mockup-simple-stage:last-child { border-right: 0; }
.mockup-simple-stage-head { display: grid; gap: 4px; }
.mockup-simple-stage-head strong { font-size: 0.84rem; }
.mockup-simple-stage-head span,
.mockup-simple-fabrication-title span,
.mockup-simple-trade small {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 0.7rem;
}
.mockup-simple-stage-head i,
.mockup-simple-fabrication-title i,
.mockup-simple-trade i {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #cbd0d8;
}
.mockup-simple-fabrication { padding: 13px 16px 15px; }
.mockup-simple-fabrication-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.mockup-simple-fabrication-title strong { font-size: 0.84rem; }
.mockup-simple-fabrication-stages {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.mockup-simple-trade {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfbfc;
}
.mockup-simple-trade > span:first-child { font-size: 0.76rem; font-weight: 650; }
.mockup-simple-trade small { grid-column: 1 / -1; }
.mockup-simple-stage.status-en-cours i,
.mockup-simple-fabrication-title.status-en-cours i,
.mockup-simple-trade.status-en-cours i { background: #f2a33a; }
.mockup-simple-stage.status-a-valider i,
.mockup-simple-fabrication-title.status-a-valider i,
.mockup-simple-trade.status-a-valider i { background: #2563eb; }
.mockup-simple-stage.status-termine i,
.mockup-simple-fabrication-title.status-termine i,
.mockup-simple-trade.status-termine i { background: #64cf6a; }
.mockup-simple-stage.status-retake i,
.mockup-simple-fabrication-title.status-retake i,
.mockup-simple-trade.status-retake i { background: #d63331; }
.mockup-simple-stage.status-bloque i,
.mockup-simple-fabrication-title.status-bloque i,
.mockup-simple-trade.status-bloque i { background: #667d89; }

@media (max-width: 850px) {
  .mockup-simple-main-stages,
  .mockup-simple-fabrication-stages { grid-template-columns: 1fr 1fr; }
  .mockup-simple-stage:nth-child(2) { border-right: 0; }
  .mockup-simple-stage:last-child { grid-column: 1 / -1; border-top: 1px solid var(--line); }
}
@media (max-width: 560px) {
  .mockup-simple-episode-head,
  .mockup-simple-episode-head div { align-items: flex-start; flex-direction: column; gap: 4px; }
  .mockup-simple-main-stages,
  .mockup-simple-fabrication-stages { grid-template-columns: 1fr; }
  .mockup-simple-stage { border-right: 0; border-bottom: 1px solid var(--line); }
  .mockup-simple-stage:last-child { grid-column: auto; border-top: 0; border-bottom: 0; }
}

/* Maquette isolée — Documentation */
.documentation-mockup-layout {
  display: grid;
  grid-template-columns: minmax(230px, 280px) minmax(0, 920px);
  gap: 18px;
  align-items: start;
  justify-content: center;
}
.documentation-mockup-sidebar {
  position: sticky;
  top: 82px;
  margin: 0;
  padding: 0;
  overflow: hidden;
}
.documentation-mockup-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
}
.documentation-mockup-tree { padding: 7px; }
.documentation-mockup-theme + .documentation-mockup-theme { margin-top: 4px; }
.documentation-mockup-theme-head {
  display: grid;
  grid-template-columns: 16px 20px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 3px;
  min-height: 36px;
  padding: 3px 4px;
}
.documentation-mockup-theme-head strong {
  overflow: hidden;
  font-size: 0.84rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.documentation-mockup-drag {
  color: #a5abb5;
  cursor: grab;
  font-size: 0.9rem;
}
.documentation-mockup-collapse,
.documentation-mockup-add {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: default;
  font: inherit;
}
.documentation-mockup-pages { padding: 0 0 4px 31px; }
.documentation-mockup-page {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 6px 8px;
  border-radius: 6px;
  color: #4b5563;
  font-size: 0.82rem;
  text-decoration: none;
}
.documentation-mockup-page:hover { background: #f3f4f6; }
.documentation-mockup-page.active {
  background: #eef2ff;
  color: var(--brand);
  font-weight: 650;
}
.documentation-mockup-article {
  min-height: 760px;
  margin: 0;
  padding: 30px 36px 42px;
}
.documentation-mockup-article-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.documentation-mockup-article-head h2 {
  margin: 3px 0 4px;
  font-size: 1.65rem;
}
.documentation-mockup-breadcrumb,
.documentation-mockup-meta,
.documentation-mockup-caption {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}
.documentation-mockup-body {
  max-width: 760px;
  padding-top: 14px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  line-height: 1.72;
}
.documentation-mockup-body h3 {
  margin: 28px 0 8px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 1.02rem;
}
.documentation-mockup-body a { color: var(--brand); }
.documentation-mockup-code {
  padding: 11px 13px;
  border: 1px solid #d8dde6;
  border-radius: 7px;
  background: #f6f7f9;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.86rem;
}
.documentation-mockup-media {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.documentation-mockup-image-placeholder {
  display: grid;
  min-height: 210px;
  place-items: center;
  border-radius: 6px;
  background:
    linear-gradient(135deg, transparent 49.5%, rgba(255,255,255,.65) 50%, transparent 50.5%),
    linear-gradient(45deg, #dce1e9, #f4f5f7 55%, #cdd4df);
  color: #6b7280;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.82rem;
}
.documentation-mockup-caption { padding-top: 7px; }
.documentation-mockup-video-placeholder {
  display: flex;
  min-height: 110px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 8px;
  background: #202532;
  color: #dbe1eb;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.82rem;
}
.documentation-mockup-play {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 50%;
  color: #fff;
}

@media (max-width: 800px) {
  .documentation-mockup-layout { grid-template-columns: 1fr; }
  .documentation-mockup-sidebar { position: static; }
  .documentation-mockup-article { min-height: 0; padding: 22px 20px 30px; }
}

/* Documentation */
.documentation-layout { display:grid; grid-template-columns:minmax(230px,280px) minmax(0,920px); gap:18px; align-items:start; justify-content:center; }
.documentation-sidebar { position:sticky; top:82px; margin:0; padding:0; overflow:hidden; }
.documentation-sidebar-head { display:flex; align-items:center; justify-content:space-between; padding:13px 14px; border-bottom:1px solid var(--line); }
.documentation-tree { padding:7px; }
.documentation-empty-tree { padding:8px; color:var(--muted); font-size:.84rem; }
.documentation-theme + .documentation-theme { margin-top:4px; }
.documentation-theme.dragging, .documentation-page-link.dragging { opacity:.4; }
.documentation-tree.saving { cursor:progress; }
.documentation-theme.documentation-drop-before { box-shadow:inset 0 2px var(--brand); }
.documentation-theme.documentation-drop-after { box-shadow:inset 0 -2px var(--brand); }
.documentation-page-link.documentation-drop-before { box-shadow:inset 0 2px var(--brand); }
.documentation-page-link.documentation-drop-after { box-shadow:inset 0 -2px var(--brand); }
.documentation-theme.documentation-page-drop-target > .documentation-theme-head { background:#eef2ff; border-radius:6px; }
.documentation-theme-head { display:grid; grid-template-columns:16px 20px minmax(0,1fr) 24px 24px 24px; align-items:center; gap:3px; min-height:36px; padding:3px 4px; }
.documentation-theme-head strong { overflow:hidden; font-size:.84rem; text-overflow:ellipsis; white-space:nowrap; }
.documentation-theme-head form { margin:0; }
.documentation-drag { color:#a5abb5; cursor:grab; font-size:.9rem; user-select:none; }
.documentation-drag:active { cursor:grabbing; }
.documentation-collapse, .documentation-action { width:24px; height:24px; padding:0; border:0; background:transparent; color:var(--muted); cursor:pointer; font:inherit; }
.documentation-action:hover, .documentation-collapse:hover { color:var(--ink); }
.documentation-delete:hover { color:#b91c1c; }
.documentation-pages { min-height:8px; padding:0 0 4px 31px; }
.documentation-theme.collapsed .documentation-pages { display:none; }
.documentation-page-link { display:grid; grid-template-columns:16px minmax(0,1fr); align-items:center; gap:5px; min-height:34px; padding:6px 8px; border-radius:6px; color:#4b5563; font-size:.82rem; text-decoration:none; }
.documentation-page-link:hover { background:#f3f4f6; }
.documentation-page-link.active { background:#eef2ff; color:var(--brand); font-weight:650; }
.documentation-article { min-height:700px; margin:0; padding:30px 36px 42px; }
.documentation-article-head { display:flex; align-items:flex-start; justify-content:space-between; gap:24px; padding-bottom:20px; border-bottom:1px solid var(--line); }
.documentation-article-head h2 { margin:3px 0 4px; font-size:1.65rem; }
.documentation-page-heading { cursor:text; }
.documentation-page-heading:hover { text-decoration:underline; text-decoration-color:#c7cbd3; text-underline-offset:4px; }
.documentation-title-editor { width:min(620px,70vw); margin:3px 0 4px; padding:0; border:0; border-radius:0; background:transparent; color:var(--ink); font:inherit; font-size:1.65rem; font-weight:700; line-height:1.2; outline:none; }
.documentation-breadcrumb, .documentation-meta { margin:0; color:var(--muted); font-size:.78rem; }
.documentation-head-actions { display:flex; gap:8px; }
.documentation-view, .documentation-editable { width:100%; max-width:none; padding-top:14px; font-family:inherit; font-size:1rem; line-height:1.45; }
.documentation-view h2, .documentation-editable h2 { margin:28px 0 8px; font-size:1.35rem; }
.documentation-view h3, .documentation-editable h3 { margin:24px 0 8px; font-size:1.12rem; }
.documentation-view p, .documentation-editable p,
.documentation-view div, .documentation-editable div { margin-top:0; margin-bottom:.72em; }
.documentation-align-left { text-align:left; }
.documentation-align-center { text-align:center; }
.documentation-align-right { text-align:right; }
.documentation-view img, .documentation-editable img, .documentation-view video, .documentation-editable video { display:block; max-width:100%; max-height:620px; margin:auto; border-radius:7px; }
.documentation-media { margin:22px 0; padding:0; border:0; border-radius:0; }
.documentation-caption { padding-top:7px; color:var(--muted); font-size:.82rem; text-align:center; }
.documentation-editor { padding-top:20px; padding-bottom:72px; }
.documentation-editing-workspace { width:100%; max-width:none; }
.documentation-toolbar { position:fixed; right:0; bottom:0; left:0; z-index:100; display:flex; align-items:center; justify-content:center; flex-direction:row; flex-wrap:wrap; gap:5px; margin:0; padding:8px 16px; border-top:1px solid var(--line); background:#f7f8fa; box-shadow:0 -2px 8px rgba(0,0,0,.06); }
.documentation-toolbar button { display:inline-grid; min-height:30px; padding:4px 9px; place-items:center; border:1px solid #d7dbe2; border-radius:5px; background:#fff; color:var(--ink); cursor:pointer; }
.documentation-toolbar button:hover { border-color:#9aa3b1; }
.documentation-toolbar button[aria-pressed="true"] { border-color:var(--brand); background:var(--brand); color:#fff; }
.documentation-toolbar-separator { width:1px; height:28px; min-height:28px; margin:1px 2px; background:#d7dbe2; }
.documentation-editable { width:100%; max-width:none; min-height:460px; padding:20px; border:1px solid #aeb5c0; border-radius:7px; background:#fff; outline:none; }
.documentation-editable:focus { border-color:var(--brand); box-shadow:0 0 0 2px rgba(79,70,229,.12); }
.documentation-editor-status { min-height:22px; padding-top:6px; color:var(--muted); font-size:.82rem; }
.documentation-delete-page { margin-left:auto; }
.documentation-welcome { display:grid; min-height:520px; place-content:center; justify-items:center; text-align:center; }
.documentation-welcome h2 { margin-bottom:4px; }
.documentation-welcome p { max-width:460px; color:var(--muted); }
@media (max-width:800px) {
  .documentation-layout { grid-template-columns:1fr; }
  .documentation-sidebar { position:static; }
  .documentation-article { min-height:0; padding:22px 20px 30px; }
  .documentation-article-head { flex-direction:column; }
}
@media (max-width:700px) {
  .documentation-editor { padding-bottom:132px; }
}
.character-appearances { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.character-appearances-column { min-width: 0; }
.character-appearances-column h3 { margin: 0 0 16px; }
.character-appearances-role + .character-appearances-role { margin-top: 20px; }
.character-appearances-role h4 { margin: 0 0 8px; }
.character-appearances-role ul { list-style: none; padding: 0; margin: 0; }
.character-appearances-role li { margin-top: 8px; overflow-wrap: anywhere; }
@media (max-width: 700px) {
  .character-appearances { grid-template-columns: 1fr; }
}
#print-roles-dialog { width: min(800px, 90vw); max-height: 85vh; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 24px; }
#print-roles-dialog::backdrop { background: #0006; }
#print-roles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin: 18px 0; }
.print-role-card { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 12px; background: white; border: 2px solid var(--line); border-radius: 8px; cursor: pointer; font: inherit; }
.print-role-card[aria-pressed="true"] { border-color: var(--brand); background: #eef2ff; }
.print-role-images { position: relative; display: block; width: 100px; height: 90px; }
.print-role-character { width: 80px; height: 80px; object-fit: cover; background: var(--bg); display: inline-grid; place-items: center; }
.print-role-actor { position: absolute; right: 0; bottom: 0; width: 42px; height: 42px; border-radius: 50%; object-fit: cover; background: var(--bg); border: 2px solid white; display: inline-grid; place-items: center; }
@media print { #print-roles-dialog { display: none !important; } }
#scenario-cast-tooltip { position: fixed; z-index: 1200; display: flex; align-items: center; gap: 10px; max-width: min(300px, calc(100vw - 16px)); padding: 10px 14px; background: white; color: var(--ink); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 3px 12px #0002; pointer-events: none; overflow-wrap: anywhere; }
#scenario-cast-tooltip[hidden] { display: none; }
.scenario-cast-avatar { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 50%; object-fit: cover; background: var(--bg); display: grid; place-items: center; }
@media print { #scenario-cast-tooltip { display: none !important; } }
.casting-item .casting-roles-plus { position:absolute; top:5px; right:7px; z-index:2; border:0; background:transparent; color:#b8bdc5; font-size:20px; cursor:pointer; padding:2px 6px; }
.casting-episode-group .casting-item .casting-roles-plus { top:3px; right:1px; width:16px; height:16px; padding:0; line-height:16px; font-size:16px; text-align:center; }
.casting-roles-plus:hover, .casting-roles-plus:focus-visible { color:#6b7280; }
.actor-roles-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(110px,1fr)); gap:16px; }
.actor-role-card { display:flex; flex-direction:column; align-items:center; gap:8px; text-align:center; }
.actor-role-card > :first-child { width:90px; height:90px; object-fit:cover; display:grid; place-items:center; background:#f4f5f7; }
