/* ShareMyDemo — application sheet. Colours, type, space and shape come from tokens.css (loaded
   first); no raw brand colour here. Order: base, shell, page, surfaces, controls, data, feedback,
   then one block per space or page further down. */

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--smd-bg);
  color: var(--smd-navy);
  font-family: var(--smd-sans);
  font-size: var(--smd-text-md);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: var(--smd-accent); text-decoration: none; }
a:hover { color: var(--smd-accent-dark); text-decoration: underline; text-underline-offset: 3px; }
p a, li a:not(.button), dd a, .doc a { text-decoration: underline; text-decoration-color: rgba(132, 36, 212, 0.35); text-underline-offset: 3px; }

:focus-visible { outline: 3px solid rgba(132, 36, 212, 0.45); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3, h4 { color: var(--smd-navy); font-weight: 800; letter-spacing: -0.02em; }
h1 { font-size: var(--smd-text-2xl); line-height: 1.15; letter-spacing: -0.03em; margin: 0 0 var(--smd-space-4); }
h2 { font-size: var(--smd-text-xl); line-height: 1.25; margin: var(--smd-space-8) 0 var(--smd-space-3); }
h3 { font-size: var(--smd-text-lg); line-height: 1.3; font-weight: 700; margin: var(--smd-space-5) 0 var(--smd-space-2); }
h4 { font-size: var(--smd-text-md); font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0 0 var(--smd-space-3); }
p:last-child { margin-bottom: 0; }
code { font-family: var(--smd-mono); font-size: 0.88em; }

.muted { color: var(--smd-muted); }
.hint { font-size: var(--smd-text-sm); }

/* ---------- Shell: the signed-in shell is shell.css; here the signed-out page and footer ---------- */
.signout { margin: 0; }

.link-button {
  background: none;
  border: 0;
  padding: 0;
  color: var(--smd-accent);
  font: 600 var(--smd-text-sm) var(--smd-sans);
  cursor: pointer;
}
.link-button:hover { color: var(--smd-accent-dark); text-decoration: underline; text-underline-offset: 3px; }

/* A ShareMyDemo administrator signed in as a member: always visible, « Leave » always at hand */
.impersonation-banner {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  min-height: 40px;
  padding: 6px max(16px, calc((100% - var(--smd-wrap)) / 2));
  background: #B45309;
  color: #FFFFFF;
  font-size: var(--smd-text-sm);
  font-weight: 600;
}
.impersonation-banner span { overflow-wrap: anywhere; }
.impersonation-banner form { margin: 0; }
.impersonation-banner button {
  background: none;
  border: 1px solid #FFFFFF;
  border-radius: var(--smd-radius-control);
  padding: 4px 14px;
  color: #FFFFFF;
  font: 700 var(--smd-text-sm) var(--smd-sans);
  cursor: pointer;
}
.impersonation-banner button:hover { background: rgba(255, 255, 255, 0.15); }

/* Signed-out pages: the logo stands above the form, on the public site's soft hero light */
.auth-brand { display: flex; justify-content: center; padding: 56px 16px 0; }
.auth-brand + .page { padding-top: 8px; }
.auth-brand .logo-word { color: var(--smd-navy); }
/* Le logo : le pictogramme (mark.svg) et le mot en Manrope 800, chargé par la page (un SVG en
   <img> n'aurait pas la police). */
.logo { display: inline-flex; align-items: center; gap: 10px; }
.logo img { display: block; width: 46px; height: auto; }
.logo-word { font-family: var(--smd-sans); font-weight: 800; font-size: 1.3rem; letter-spacing: -0.01em; line-height: 1; }
.logo-lg { gap: 12px; }
.logo-lg img { width: 62px; }
.logo-lg .logo-word { font-size: 1.85rem; }
body:has(> .auth-brand) {
  background:
    radial-gradient(ellipse 60% 50% at 100% 0%, rgba(173, 68, 248, 0.10), transparent 70%),
    radial-gradient(ellipse 50% 50% at 0% 100%, rgba(132, 36, 212, 0.06), transparent 70%),
    var(--smd-bg);
}

.page { max-width: calc(var(--smd-wrap) + 32px); margin: 0 auto; padding: var(--smd-space-8) 16px 72px; }
body > .page { flex: 1 0 auto; width: 100%; }

/* Page header: context line, title, lead, actions on the right */
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--smd-space-3) var(--smd-space-6);
  margin-bottom: var(--smd-space-6);
}
.page-head > div { min-width: 0; }
.page-head h1, .page-head h2, .page-title { margin: 0; }
.page-head p { margin: 0 0 6px; }
.page-head p.muted:last-child, .page-head h1 + p { margin: 6px 0 0; max-width: 72ch; }
.page-head .muted a { color: var(--smd-muted); font-weight: 600; text-decoration: none; }
.page-head .muted a:hover { color: var(--smd-accent); }
.page-title { font-size: var(--smd-text-2xl); letter-spacing: -0.03em; line-height: 1.15; }
.page-actions { display: flex; flex-wrap: wrap; gap: var(--smd-space-2); }
.actions-menu { position: relative; }
.actions-menu summary { list-style: none; cursor: pointer; }
.actions-menu summary::-webkit-details-marker { display: none; }
.actions-menu ul { position: absolute; z-index: 20; right: 0; top: calc(100% + 4px); min-width: 210px; margin: 0; padding: 6px; list-style: none; background: var(--smd-paper); border: 1px solid var(--smd-border); border-radius: var(--smd-radius-control); box-shadow: var(--smd-shadow-raised); }
.actions-menu li a { display: block; padding: 8px 10px; border-radius: 6px; color: var(--smd-navy); font-size: var(--smd-text-sm); text-decoration: none; }
.actions-menu li a:hover { background: var(--smd-subtle); text-decoration: none; }

/* Section title outside a card: same rhythm everywhere */
.page > h2, .page > section:not(.card):not(.panel) > h2:first-child { margin-top: var(--smd-space-10); }

/* ---------- Surfaces ---------- */
.card, .panel {
  background: var(--smd-paper);
  border: 1px solid var(--smd-border);
  border-radius: var(--smd-radius);
  padding: var(--smd-space-6);
  margin-bottom: var(--smd-space-5);
  box-shadow: var(--smd-shadow);
}
.card > h2:first-child, .panel > h2:first-child { margin-top: 0; font-size: var(--smd-text-lg); }
.card > h2:first-child + p.muted, .panel > h2:first-child + p.muted { margin-top: -4px; }
.card.narrow { max-width: 420px; margin: 24px auto; padding: var(--smd-space-8); box-shadow: var(--smd-shadow-raised); border-radius: 16px; }
.card.narrow h1 { font-size: 1.5rem; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: var(--smd-space-4); }
.panel-head h2 { margin: 0; font-size: var(--smd-text-lg); }
.panel-head .muted { font-size: var(--smd-text-sm); }
.panel > h3 { font-size: var(--smd-text-md); margin-top: var(--smd-space-6); padding-top: var(--smd-space-5); border-top: 1px solid var(--smd-border); }
.panel-alert { border-color: var(--smd-bad-line); background: var(--smd-bad-soft); color: var(--smd-bad-text); box-shadow: none; }

/* ---------- Controls ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--smd-space-4); min-width: 0; }
.field label { font-weight: 700; font-size: var(--smd-text-sm); }
.field .hint { font-size: 0.82rem; color: var(--smd-muted); line-height: 1.45; }

/* Every text control, wherever it sits (fields, tables, inline forms) */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not([type="submit"]),
textarea,
select {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--smd-border-strong);
  border-radius: var(--smd-radius-control);
  background: var(--smd-paper);
  color: var(--smd-navy);
  font: inherit;
  font-size: var(--smd-text-md);
  line-height: 1.4;
  box-shadow: var(--smd-shadow-sm);
  transition: border-color 0.12s, box-shadow 0.12s;
}
input::placeholder, textarea::placeholder { color: var(--smd-faint); }
textarea { min-height: 104px; resize: vertical; }
select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%235B6675' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}
input:not([type="checkbox"]):not([type="radio"]):hover, textarea:hover, select:hover { border-color: #BBA9C5; }
input:focus, textarea:focus, select:focus { border-color: var(--smd-accent); outline: none; box-shadow: var(--smd-focus); }
input[type="checkbox"], input[type="radio"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--smd-accent);
  cursor: pointer;
  flex: 0 0 auto;
}
input[type="file"] { font: inherit; font-size: var(--smd-text-sm); color: var(--smd-muted); }
input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 8px 14px;
  border: 1px solid var(--smd-border-strong);
  border-radius: var(--smd-radius-control);
  background: var(--smd-paper);
  color: var(--smd-navy);
  font: 700 var(--smd-text-sm) var(--smd-sans);
  cursor: pointer;
}
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.field.check { flex-direction: row; align-items: center; }
.field.check label { font-weight: 600; }

/* Compact controls inside tables and row actions */
.table input:not([type="checkbox"]):not([type="radio"]),
.table select,
.row-actions select,
.team-role select,
.team-country { width: 190px; max-width: 100%; }
.table select, .row-actions select { min-width: 170px; }
.table input[type="url"], .table input[type="text"] { min-width: 220px; }

/* Buttons: primary (blue), quiet (outline), danger, small, link */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid var(--smd-accent);
  border-radius: var(--smd-radius-control);
  background: var(--smd-accent);
  color: #FFFFFF;
  font: 700 var(--smd-text-md)/1 var(--smd-sans);
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 6px 16px -8px rgba(132, 36, 212, 0.65);
  transition: background-color 0.12s, border-color 0.12s, color 0.12s;
}
.button:hover { background: var(--smd-accent-dark); border-color: var(--smd-accent-dark); color: #FFFFFF; text-decoration: none; }
a.button { color: #FFFFFF; }
.button-quiet, a.button-quiet { background: var(--smd-paper); color: var(--smd-navy); border-color: var(--smd-border-strong); box-shadow: var(--smd-shadow-sm); }
.button-quiet:hover { background: var(--smd-subtle); color: var(--smd-accent-dark); border-color: var(--smd-accent); }
.button-danger, a.button-danger { background: var(--smd-paper); color: var(--smd-bad); border-color: var(--smd-bad-line); box-shadow: none; }
.button-danger:hover { background: var(--smd-bad-soft); color: var(--smd-bad-text); border-color: var(--smd-bad-line); }
.button-small { min-height: 32px; padding: 0 12px; font-size: var(--smd-text-sm); box-shadow: none; }
.button:disabled { opacity: 0.55; cursor: default; }
.card.narrow .button { width: 100%; min-height: 44px; }

/* ---------- Data ---------- */
.table-wrap {
  overflow-x: auto;
  background: var(--smd-paper);
  border: 1px solid var(--smd-border);
  border-radius: var(--smd-radius);
  margin-bottom: var(--smd-space-5);
}
.table { width: 100%; border-collapse: collapse; font-size: var(--smd-text-sm); }
.table th, .table td {
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid var(--smd-border);
  white-space: nowrap;
  vertical-align: middle;
}
.table th {
  padding-top: 9px;
  padding-bottom: 9px;
  background: var(--smd-subtle);
  color: var(--smd-muted);
  font-size: var(--smd-text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: #FCFAFD; }
.table td a { font-weight: 600; text-decoration: none; }
.table td a:hover { text-decoration: underline; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.cell-sub { display: block; color: var(--smd-muted); font-size: 0.82rem; font-weight: 500; }
.mono-cell { font-family: var(--smd-mono); font-size: 0.82rem; overflow-wrap: anywhere; }

/* Below 640px a .table-stack table turns into one card per row; each td carries data-label */
@media (max-width: 640px) {
  .table-stack thead { display: none; }
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack tr { padding: 12px 16px; border-bottom: 1px solid var(--smd-border); }
  .table-stack tbody tr:last-child { border-bottom: none; }
  .table-stack td { padding: 3px 0; border: 0; white-space: normal; display: flex; justify-content: space-between; gap: 12px; }
  .table-stack td[data-label]::before { content: attr(data-label); flex: none; color: var(--smd-muted); font: 600 0.82rem var(--smd-sans); }
  .table-stack td > * { min-width: 0; overflow-wrap: anywhere; }
  .table-stack td.cell-main { display: block; font-size: var(--smd-text-md); padding-bottom: 6px; }
  .table-stack tbody tr:hover td { background: none; }
}

/* Lists and empty states */
.list {
  list-style: none;
  margin: 0 0 var(--smd-space-5);
  padding: 0;
  background: var(--smd-paper);
  border: 1px solid var(--smd-border);
  border-radius: var(--smd-radius);
}
.list li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 4px 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--smd-border);
}
.list li:last-child { border-bottom: none; }

.empty {
  background: var(--smd-subtle);
  border: 1px dashed var(--smd-border-strong);
  border-radius: var(--smd-radius);
  padding: 20px;
  color: var(--smd-muted);
  font-size: var(--smd-text-sm);
  text-align: center;
}

/* Key / value lists */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 28px; margin: 0 0 var(--smd-space-4); font-size: var(--smd-text-sm); }
.kv dt { color: var(--smd-muted); font-weight: 600; }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* Figures: a number and its label */
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--smd-space-4); margin: 0; }
.figure {
  padding: 18px 20px;
  background: var(--smd-paper);
  border: 1px solid var(--smd-border);
  border-radius: var(--smd-radius);
  box-shadow: var(--smd-shadow-sm);
}
.figure dt {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--smd-muted);
  font-size: var(--smd-text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.figure dt::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--smd-gradient); }
.figure dt a { color: inherit; text-decoration: none; }
.figure dt a:hover { color: var(--smd-accent); }
.figure dd { margin: 8px 0 0; }
.figure dd a { text-decoration: none; }
.figure strong { font-size: 1.875rem; line-height: 1.1; font-weight: 800; letter-spacing: -0.03em; color: var(--smd-navy); font-variant-numeric: tabular-nums; }

/* Status: dots and badges. A badge may carry data-status (a DemoStatus) or data-stage (a stage of
   web/workspace.py, as My Deals, the deal page and the run sheet show it) to take its tone. */
.dot { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; vertical-align: middle; background: var(--smd-border-strong); }
.dot-ok { background: var(--smd-ok); }
.dot-warn { background: var(--smd-warn); }
.dot-bad { background: var(--smd-bad); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--smd-radius-pill);
  background: var(--smd-neutral-soft);
  color: var(--smd-muted);
  font-size: var(--smd-text-xs);
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}
.badge-ok, .badge[data-status="ok"] { background: var(--smd-ok-soft); color: var(--smd-ok-text); }
.badge-info { background: var(--smd-accent-soft); color: var(--smd-accent-dark); }
.badge-warn { background: var(--smd-warn-soft); color: var(--smd-warn-text); }
.badge-bad { background: var(--smd-bad-soft); color: var(--smd-bad-text); }
.badge[data-status]::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.8; }
.badge-lg { padding: 5px 12px; font-size: var(--smd-text-sm); }
/* The vendor product module of a flow (P2P, CLM...): a label, not a state, so neither a pill nor
   a status tone; it sits next to the flow's title. */
.badge-module { background: var(--smd-paper); color: var(--smd-navy); border: 1px solid var(--smd-border-strong); border-radius: 6px; padding: 2px 8px; letter-spacing: 0.01em; }
/* In a title the space before it separates it from the name, so a badge that wraps starts flush. */
h1 .badge-module, h2 .badge-module, h3 .badge-module { vertical-align: 0.15em; }
.bp-flow-title h3 .badge-module { margin-left: 6px; }  /* a flex title: no space between items */

/* ---------- Feedback ---------- */
.form-error {
  background: var(--smd-bad-soft);
  color: var(--smd-bad-text);
  border-radius: var(--smd-radius-control);
  padding: 10px 12px;
  margin-bottom: var(--smd-space-4);
  font-size: var(--smd-text-sm);
  font-weight: 600;
}
.field .form-error { margin: 0; padding: 0; background: none; color: var(--smd-bad); font-size: 0.85rem; }

.messages { list-style: none; margin: 0 0 var(--smd-space-5); padding: 0; display: grid; gap: 8px; }
.message {
  background: var(--smd-accent-soft);
  border: 1px solid #E2D0EC;
  border-radius: var(--smd-radius-control);
  padding: 12px 16px;
  color: var(--smd-navy);
  font-size: var(--smd-text-sm);
  font-weight: 600;
}
.message-success { background: var(--smd-ok-soft); border-color: #B5ECE6; color: var(--smd-ok-text); }
.message-warning, .message-error { background: var(--smd-warn-soft); border-color: #EBD49A; color: var(--smd-warn-text); }
.message-error { background: var(--smd-bad-soft); border-color: var(--smd-bad-line); color: var(--smd-bad-text); }
.message-info { background: var(--smd-accent-soft); border-color: #E2D0EC; color: var(--smd-accent-dark); }

/* ---------- Navigation inside a page ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: var(--smd-space-4) 0 var(--smd-space-6); border-bottom: 1px solid var(--smd-border); }
.tabs a {
  padding: 10px 14px;
  margin-bottom: -1px;
  color: var(--smd-muted);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.tabs a:hover { color: var(--smd-navy); text-decoration: none; }
.tabs a[aria-current="page"] { color: var(--smd-navy); font-weight: 700; border-bottom-color: var(--smd-accent); }

.inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--smd-space-3); }
.inline-form .field { margin-bottom: 0; flex: 1 1 180px; }
.table .inline-form { flex-wrap: nowrap; align-items: center; gap: 8px; }
.row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.row-actions form { margin: 0; }
form.row-actions { margin: 0; }
.table form.row-actions { flex-wrap: nowrap; gap: 8px; }
.table td .row-actions { flex-wrap: nowrap; white-space: nowrap; }
.table td:last-child form.row-actions { display: inline-flex; margin-left: 8px; }

@media (max-width: 640px) {
  .page { padding-top: var(--smd-space-6); }
  h1, .page-title { font-size: 1.5rem; }
  .card, .panel { padding: 18px 16px; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 10px; }
  .page-head .button { width: 100%; }
}

/* Footer on every page (components/_footer.html) */
.site-footer { border-top: 1px solid var(--smd-border); background: var(--smd-paper); }
.site-footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  max-width: calc(var(--smd-wrap) + 32px);
  margin: 0 auto;
  padding: 18px 16px;
  color: var(--smd-muted);
  font-size: 0.84rem;
}
.site-footer-owner { display: flex; gap: 10px; margin: 0; }
.site-footer-name { color: var(--smd-navy); font-weight: 700; }
.site-footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.site-footer-links a { color: var(--smd-muted); text-decoration: none; }
.site-footer-links a:hover { color: var(--smd-accent); text-decoration: underline; }

/* Print: the page, not the shell (the run sheet has its own print sheet) */
@media print {
  .shell-sidebar, .shell-topbar, .site-footer, .impersonation-banner { display: none; }
  body { background: #FFFFFF; }
  .card, .panel, .table-wrap { box-shadow: none; }
}


/* ShareMyDemo : enrôlement de la double authentification */
.qr { width: fit-content; margin: 0 auto var(--smd-space-4); padding: var(--smd-space-3); background: #FFFFFF; border: 1px solid var(--smd-border); border-radius: var(--smd-radius-control); }
.backup-codes { columns: 2; list-style: none; padding: 0; margin: var(--smd-space-4) 0; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Console : Demo Spaces ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: var(--smd-space-5); align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 0 var(--smd-space-5); }
.section-head { margin-top: var(--smd-space-8); }
.section-head h2 { font-size: var(--smd-text-xl); }
.panel + .panel, .grid-2 + .panel, .grid-2 + .button, .panel + .button { margin-top: var(--smd-space-5); }
.grid-2 > .panel { margin-top: 0; }
.panel-quiet { background: var(--smd-accent-soft); border-color: transparent; box-shadow: none; }
.checklist { margin: 0; padding-left: 1.2em; }
.subject h3 { margin: 0; font-size: var(--smd-text-lg); }
.theme { padding: var(--smd-space-4) 0; border-top: 1px solid var(--smd-border); }
.theme-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--smd-space-3); }
.theme-title { margin: 0; font-weight: 700; display: flex; align-items: baseline; gap: 10px; }
.theme-hidden .theme-title { color: var(--smd-faint); }
.theme-number {
  flex: none; display: inline-grid; place-items: center; min-width: 28px; height: 24px; padding: 0 6px;
  border-radius: var(--smd-radius-pill); background: var(--smd-accent-soft); color: var(--smd-accent-dark);
  font-size: var(--smd-text-xs); font-weight: 800; font-variant-numeric: tabular-nums;
}
.theme-text { margin: 6px 0 0 38px; font-size: var(--smd-text-sm); }
.theme .list { margin: 8px 0 0 38px; }
.video-row > span:first-child { display: inline-flex; align-items: center; gap: 8px; }
.video-icon { width: 18px; height: 18px; color: var(--smd-accent); flex: none; }
.avatar-thumb { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; display: block; }
.preview { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: var(--smd-space-5); align-items: start; }
.preview-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: calc(var(--smd-topbar) + 16px); max-height: calc(100vh - var(--smd-topbar) - 32px); overflow: auto; }
.preview-nav a { display: flex; gap: 8px; align-items: baseline; padding: 8px 10px; border-radius: var(--smd-radius-control); color: var(--smd-navy); text-decoration: none; font-size: var(--smd-text-sm); }
.preview-nav a:hover { background: var(--smd-neutral-soft); }
.preview-nav a[aria-current="page"] { background: var(--smd-accent-soft); font-weight: 700; }
.preview-subject { margin: var(--smd-space-4) 0 4px; padding: 0 10px; color: var(--smd-muted); font-size: var(--smd-text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.player { margin: var(--smd-space-4) 0 0; }
.player video { display: block; width: 100%; aspect-ratio: 16 / 9; background: var(--smd-night); border-radius: var(--smd-radius-control); }
.player figcaption { margin-top: 6px; color: var(--smd-muted); font-size: var(--smd-text-sm); }
progress { width: 100%; accent-color: var(--smd-accent); margin-bottom: var(--smd-space-2); }
@media (max-width: 760px) {
  .preview { grid-template-columns: 1fr; }
  .preview-nav { position: static; max-height: none; }
  .preview-main { order: -1; }  /* la thématique choisie d'abord, la liste ensuite */
  .theme-text, .theme .list { margin-left: 0; }
}

/* ---------- Console : suivi ---------- */
.filters { margin-bottom: var(--smd-space-5); }
.filters .field { flex: 0 1 220px; }
.figures + .panel { margin-top: var(--smd-space-5); }
.meter { display: inline-block; width: 64px; height: 6px; border-radius: 6px; background: var(--smd-neutral-soft); vertical-align: middle; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--smd-gradient); }

/* ---------- Œil des champs mot de passe (password-toggle.js) ---------- */
.reveal-wrap { position: relative; display: block; }
.reveal-wrap > input { width: 100%; padding-right: 48px; }
.reveal-btn {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  display: grid; place-items: center; width: 36px; height: 36px; padding: 0;
  border: 0; border-radius: 8px; background: transparent; color: var(--smd-muted); cursor: pointer;
}
.reveal-btn:hover { color: var(--smd-navy); background: var(--smd-neutral-soft); }
.reveal-btn svg { width: 20px; height: 20px; }

/* ---------- Réglages : images en vignettes, couleurs compactes ---------- */
.status-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 var(--smd-space-4); font-size: var(--smd-text-sm); }
.image-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: var(--smd-space-5); }
.image-grid .field { margin-bottom: 0; }
.image-field { display: grid; gap: 10px; }
.image-thumb {
  display: grid; place-items: center; aspect-ratio: 16 / 9; padding: 12px; overflow: hidden;
  border: 1px solid var(--smd-border); border-radius: var(--smd-radius-control);
  background: repeating-conic-gradient(var(--smd-neutral-soft) 0% 25%, var(--smd-paper) 0% 50%) 0 0 / 16px 16px;
}
.image-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.image-thumb.is-empty { background: var(--smd-subtle); border-style: dashed; }
.image-placeholder { color: var(--smd-faint); font-size: var(--smd-text-sm); }
.image-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.image-pick { position: relative; overflow: hidden; cursor: pointer; }
.image-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.image-pick:focus-within { box-shadow: var(--smd-focus); }
.image-clear { display: inline-flex; align-items: center; gap: 6px; font-size: var(--smd-text-sm); font-weight: 600; color: var(--smd-muted); cursor: pointer; }
.image-chosen { margin: 0; color: var(--smd-accent-dark); }
.color-row { display: flex; flex-wrap: wrap; gap: var(--smd-space-5); }
.color-row .field { flex: 0 1 180px; margin-bottom: 0; }
.field input[type="color"], .color-row input[type="color"] {
  -webkit-appearance: none; appearance: none; width: 48px; min-width: 48px; height: 40px; padding: 3px;
  border: 1px solid var(--smd-border-strong); border-radius: var(--smd-radius-control); background: var(--smd-paper); cursor: pointer;
}
.field input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.field input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 5px; }
.field input[type="color"]::-moz-color-swatch { border: 0; border-radius: 5px; }
.color-row .field { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 10px; }
.color-row .field > label, .color-row .field > .hint, .color-row .field > .form-error { grid-column: 1 / -1; }
.color-code { font-family: var(--smd-mono); font-size: var(--smd-text-sm); color: var(--smd-muted); }
.color-row input[type="number"] { max-width: 120px; }
.save-bar { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; margin-top: var(--smd-space-5); padding: 14px 0; background: linear-gradient(to top, var(--smd-bg) 70%, transparent); }

/* ---------- Interrupteur (administrateurs : notifications) ---------- */
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: var(--smd-text-sm); cursor: pointer; white-space: nowrap; }
.toggle input { appearance: none; -webkit-appearance: none; width: 34px; height: 20px; margin: 0; border-radius: 999px; background: var(--smd-border-strong); position: relative; cursor: pointer; transition: background 150ms ease; }
.toggle input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 150ms ease; }
.toggle input:checked { background: var(--smd-accent); }
.toggle input:checked::after { transform: translateX(14px); }
.toggle input:focus-visible { box-shadow: var(--smd-focus); }

/* ---------- Lien à transmettre (en-tête d'un Demo Space) ---------- */
.share-link { margin: 4px 0 var(--smd-space-4); padding: 14px 16px; border: 1px solid var(--smd-border); border-radius: var(--smd-radius); background: var(--smd-paper); }
.share-link label { display: block; margin-bottom: 8px; font-size: var(--smd-text-xs); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--smd-muted); }
.share-link-row { display: flex; gap: 10px; align-items: center; }
.share-link-row input { flex: 1 1 auto; min-width: 0; font-family: var(--smd-mono); font-size: var(--smd-text-sm); color: var(--smd-navy); background: var(--smd-subtle); }
.share-link .hint { margin: 8px 0 0; }
.share-link .is-copied { color: var(--smd-ok-text); font-weight: 600; }
@media (max-width: 600px) { .share-link-row { flex-direction: column; align-items: stretch; } }
