:root {
  --bg: #111318;
  --surface: #1b1e26;
  --surface2: #242833;
  --border: #323746;
  --text: #e8eaf0;
  --muted: #9aa1b2;
  --accent: #6c8cff;
  --accent-text: #0b0f1d;
  --ok: #3ecf8e;
  --warn: #f5b942;
  --err: #ff6b6b;
  --radius: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}
.hidden { display: none !important; }
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: rgba(17, 19, 24, .92);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 20px; margin: 0; letter-spacing: .3px; }
main { max-width: 720px; margin: 0 auto; padding: 12px 12px 40px; }
h2 { font-size: 18px; margin: 0 0 10px; }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin: 12px 0;
}
.muted { color: var(--muted); margin-top: 0; }
.error { color: var(--err); min-height: 0; margin: 8px 0 0; white-space: pre-wrap; }
.error:empty { display: none; }

label, .label { display: block; font-weight: 600; margin: 0 0 6px; }
.field { margin-bottom: 18px; }
.help { color: var(--muted); font-size: 14px; margin: 6px 0 0; overflow-wrap: anywhere; }
input[type=text], input[type=password], input[type=number], textarea, select {
  width: 100%; font-size: 16px; /* 16px évite le zoom automatique d'iOS */
  color: var(--text); background: var(--surface2);
  border: 1px solid var(--border); border-radius: 10px; padding: 12px;
  -webkit-appearance: none; appearance: none;
}
select {
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px;
}
textarea { min-height: 110px; resize: vertical; line-height: 1.4; font-family: inherit; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface2); color: var(--text);
  min-height: 48px; padding: 10px 16px;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
button:active, .button:active { transform: scale(.98); }
button:disabled { opacity: .55; cursor: default; }
.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.ghost { background: transparent; }
.small { min-height: 38px; padding: 6px 12px; font-size: 14px; }
.big { width: 100%; min-height: 58px; font-size: 19px; margin-top: 6px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1 1 140px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.row-between h2 { margin: 0; }

/* cartes de workflows */
.wf-cards { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 6px; scroll-snap-type: x mandatory; }
.wf-card {
  flex: 0 0 auto; min-width: 200px; max-width: 280px; text-align: left; display: block;
  scroll-snap-align: start; padding: 14px; min-height: 0;
}
.wf-card .t { display: block; font-size: 16px; }
.wf-card .d { display: block; font-weight: 400; color: var(--muted); font-size: 13px; margin-top: 4px; }
.wf-card.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }

/* image */
.image-pick .row { margin-bottom: 8px; }
.picked { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.remove-img { min-height: 48px; min-width: 120px; margin-top: 8px; }
.preview { display: block; max-width: 100%; max-height: 300px; border-radius: 10px; margin-top: 8px; border: 1px solid var(--border); }
.file-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* curseur */
.slider-head { display: flex; justify-content: space-between; align-items: baseline; }
.slider-val { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--accent); font-size: 18px; }
input[type=range] { width: 100%; height: 44px; accent-color: var(--accent); background: transparent; }

/* case à cocher */
.check { display: flex; align-items: center; gap: 12px; font-weight: 600; min-height: 48px; cursor: pointer; }
.check input { width: 26px; height: 26px; accent-color: var(--accent); flex: none; }

/* repliable */
details { border: 1px solid var(--border); border-radius: 10px; padding: 0 12px; background: var(--surface2); }
details[open] { padding-bottom: 12px; }
summary { min-height: 48px; display: flex; align-items: center; font-weight: 600; cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::before { content: "▸"; margin-right: 8px; transition: transform .15s; }
details[open] summary::before { transform: rotate(90deg); }

/* interrupteur on/off (champs IN_<NOM> booléens) */
.toggle { display: inline-flex; align-items: center; gap: 12px; min-height: 48px; cursor: pointer; font-weight: 600; margin: 0; -webkit-tap-highlight-color: transparent; }
.toggle-input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.toggle-track { position: relative; flex: none; width: 58px; height: 34px; border-radius: 999px; background: var(--surface2); border: 1px solid var(--border); transition: background .18s, border-color .18s; }
.toggle-thumb { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: var(--muted); transition: transform .18s, background .18s; }
.toggle-input:checked + .toggle-track { background: var(--accent); border-color: var(--accent); }
.toggle-input:checked + .toggle-track .toggle-thumb { transform: translateX(24px); background: #fff; }
.toggle-input:focus-visible + .toggle-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.toggle-state { color: var(--muted); font-weight: 600; }
.toggle-input:checked ~ .toggle-state { color: var(--text); }

/* seed */
.seed-row { display: flex; gap: 10px; align-items: center; }
.seed-row input[type=number] { flex: 1; }

/* état */
.status-line { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 17px; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.queued { background: var(--warn); }
.dot.running { background: var(--accent); animation: pulse 1s infinite alternate; }
.dot.done { background: var(--ok); }
.dot.error { background: var(--err); }
@keyframes pulse { from { opacity: 1; } to { opacity: .35; } }
.progress { height: 6px; background: var(--surface2); border-radius: 3px; overflow: hidden; margin-top: 10px; }
.progress div { height: 100%; width: 0; background: var(--accent); transition: width .4s; }
.progress.indeterminate div { width: 35%; animation: slide 1.2s infinite ease-in-out; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(300%); } }

/* suivi en direct */
.live { margin-top: 12px; font-size: 14px; }
.live-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-top: 8px; }
.live-node { font-weight: 600; word-break: break-word; }
.live-label { color: var(--muted); }
.live-num { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--accent); }
.progress.steps { margin-top: 6px; height: 8px; }
.progress.steps div { background: var(--ok); }
.live-preview { display: block; width: 100%; max-height: 420px; object-fit: contain; margin-top: 12px; border-radius: 10px; background: #000; }
.result img, .result video { width: 100%; height: auto; border-radius: 10px; margin-top: 12px; display: block; background: #000; }
.result audio { width: 100%; margin-top: 12px; }

/* fichiers refusés dans workflows\ */
.rejected { margin-top: 8px; border-color: var(--warn); }
.rejected summary { color: var(--warn); }
.rejected ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 14px; }
.rejected li { margin: 6px 0; word-break: break-word; }

/* vignette vidéo / audio */
.g-thumbs .media-tile { position: relative; height: 200px; padding: 0; border: 0; border-radius: 0; background: #0b0d12; overflow: hidden; }
.media-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .75; }
.media-tile .play { position: relative; background: rgba(0, 0, 0, .55); color: #fff; padding: 8px 14px; border-radius: 999px; font-weight: 700; }
.result .button { width: 100%; margin-top: 10px; }

/* galerie */
.gallery { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 560px) { .gallery { grid-template-columns: 1fr 1fr; } }
.g-item { background: var(--surface2); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.g-thumbs { display: flex; gap: 2px; background: #000; }
.g-thumbs img { flex: 1; min-width: 0; height: 200px; object-fit: cover; display: block; cursor: zoom-in; }
.g-thumbs .ph { flex: 1; height: 120px; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.g-body { padding: 10px 12px 12px; font-size: 14px; }
.g-title { font-weight: 700; }
.g-meta { color: var(--muted); font-size: 13px; margin: 2px 0 6px; }
.g-params { color: var(--muted); font-size: 13px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; margin-bottom: 8px; word-break: break-word; }
.g-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.g-actions button { flex: 1 1 auto; }
.empty { color: var(--muted); text-align: center; padding: 20px 0; }
.danger { background: transparent; color: var(--err); border-color: var(--err); }
.button.danger, .sel-bar .danger { background: var(--err); color: #1b0b0b; border-color: var(--err); }
button:disabled.danger { opacity: .45; }

/* gestion de la galerie */
.gallery-tools { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 4px; }
.notice { color: var(--ok); white-space: pre-wrap; margin: 6px 0; font-size: 14px; }
.notice:empty { display: none; }
.g-thumbs { position: relative; }
.g-check { position: absolute; top: 8px; left: 8px; z-index: 2; display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; margin: 0; border-radius: 10px; background: rgba(0, 0, 0, .6); cursor: pointer; }
.g-check input { width: 26px; height: 26px; accent-color: var(--accent); }
.selecting .g-thumbs img, .selecting .g-thumbs .media-tile { cursor: pointer; }
.g-item.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.g-item.selected .g-thumbs { opacity: .85; }
.sel-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: rgba(27, 30, 38, .97); border-top: 1px solid var(--border);
}
.sel-bar #selCount { flex: 1 1 100%; font-weight: 700; }
.sel-bar button { flex: 1 1 0; }
@media (min-width: 560px) { .sel-bar #selCount { flex: 1 1 auto; } .sel-bar button { flex: 0 0 auto; } }
.selecting main { padding-bottom: 140px; }

/* boîte de confirmation */
.modal { position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, .7); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-box { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.modal-box p { margin: 0 0 12px; line-height: 1.5; }
.modal-box .check { font-weight: 500; align-items: flex-start; }
.modal-actions { display: flex; gap: 10px; margin-top: 8px; }
.modal-actions > * { flex: 1; }

/* visionneuse */
.lightbox {
  position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, .94);
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 12px;
  padding-top: calc(12px + env(safe-area-inset-top)); padding-bottom: calc(12px + env(safe-area-inset-bottom));
}
.lightbox img, .lightbox video { max-width: 100%; max-height: calc(100% - 150px); object-fit: contain; }
.lightbox video { width: 100%; background: #000; }
.lightbox-actions { display: flex; gap: 10px; margin-top: 12px; width: 100%; max-width: 480px; }
.lightbox-actions > * { flex: 1; }

/* ------------------------------------------------------------------ écran « Séries » */
.tabs { display: flex; gap: 6px; margin: 4px 0 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 4px; }
.tab { flex: 1; min-height: 42px; border: 0; background: transparent; color: var(--muted); }
.tab.active { background: var(--surface2); color: var(--text); box-shadow: 0 0 0 1px var(--accent) inset; }
.series-mode .sel-bar { display: none !important; }
.s-head { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.s-head h2 { margin: 0; word-break: break-word; }
.subtabs { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 4px; }
.subtab { flex: 1 1 auto; min-width: 0; min-height: 40px; font-size: 15px; padding-left: 8px; padding-right: 8px; }
.subtab.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.s-list { display: flex; flex-direction: column; gap: 8px; }
.s-item { display: block; width: 100%; text-align: left; padding: 12px 14px; margin-bottom: 8px; min-height: 0; }
.s-item .t { display: block; font-size: 17px; }
.s-item .d { display: block; font-weight: 400; color: var(--muted); font-size: 13px; margin-top: 3px; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--surface2); border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
.badge.ok { color: var(--ok); border-color: var(--ok); }
.badge.warn { color: var(--warn); border-color: var(--warn); }
.badge.err { color: var(--err); border-color: var(--err); }
.badge.run { color: var(--accent); border-color: var(--accent); }
.consent { font-size: 13px; color: var(--muted); border-left: 3px solid var(--warn); padding: 6px 10px; margin: 8px 0; background: var(--surface); border-radius: 0 8px 8px 0; }
.warnbox { border-color: var(--warn); }
.warnbox ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); font-size: 14px; }
.refs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.ref { margin: 0; width: 104px; display: flex; flex-direction: column; gap: 4px; }
.ref img, .ref .ph { width: 104px; height: 104px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); background: #000; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; }
.refs.small .ref { width: 76px; }
.refs.small .ref img, .refs.small .ref .ph { width: 76px; height: 76px; }
.ref figcaption { font-size: 11px; color: var(--muted); word-break: break-word; }
.voice { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.voice audio { width: 100%; }
.capture { margin-top: 10px; padding: 12px; border: 1px dashed var(--border); border-radius: 12px; }
.capture video, .plan-video video, .result video { width: 100%; border-radius: 10px; background: #000; display: block; margin: 8px 0; }
.capture .row > div { display: flex; flex-direction: column; gap: 6px; }
.loc-img { width: 100%; max-height: 320px; object-fit: contain; border-radius: 10px; background: #000; display: block; margin-bottom: 6px; }
.danger-zone { margin-top: 14px; }
.danger-zone[open] button { margin-top: 4px; }
.modal-box.wide { max-width: 640px; max-height: 90vh; overflow: auto; }
.pick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pick { padding: 0; min-height: 0; border-radius: 8px; overflow: hidden; aspect-ratio: 1; }
.pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.seg { display: flex; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.seg button { flex: 1; border: 0; border-radius: 0; background: var(--surface2); color: var(--muted); }
.seg button.active { background: var(--accent); color: var(--accent-text); }
textarea.script { font-family: ui-monospace, SFMono-Regular, Consolas, Menlo, monospace; font-size: 14px; line-height: 1.45; min-height: 360px; white-space: pre-wrap; }
.verify ul { margin: 6px 0; padding-left: 18px; font-size: 14px; }
.verify .errs li { color: var(--err); }
.verify .warns li { color: var(--warn); }
.verify details { margin-top: 8px; }
.prompt-text { white-space: pre-wrap; word-break: break-word; font-size: 12.5px; background: #0d0f14; border-radius: 8px; padding: 10px; margin: 6px 0 0; max-height: 420px; overflow: auto; }
.plan-checks { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.chip { min-height: 40px; padding: 0 10px; border: 1px solid var(--border); border-radius: 999px; font-weight: 500; }
.chip input { width: 20px; height: 20px; }
.plan-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 560px) { .plan-grid { grid-template-columns: 1fr 1fr; } }
.plan-card { background: var(--surface2); border: 1px solid var(--border); border-radius: 12px; padding: 10px; font-size: 14px; }
.plan-card .ph { height: 140px; display: flex; align-items: center; justify-content: center; color: var(--muted); background: #0b0d12; border-radius: 10px; margin: 8px 0; }
.plan-card details { background: var(--surface); margin: 6px 0; }
.takes { display: flex; flex-direction: column; gap: 6px; }
.take { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px; border-radius: 8px; }
.take.sel { background: rgba(108, 140, 255, .12); }
.take > span:first-child { flex: 1 1 120px; }
.small-text { font-size: 12px; }
.redo { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.redo select { flex: 1 1 140px; width: auto; min-width: 0; max-width: 100%; padding-top: 8px; padding-bottom: 8px; }
.redo input { flex: 0 1 120px; width: auto; padding: 8px; }
.help.warn { color: var(--warn); }
.tr-row { border-top: 1px solid var(--border); padding: 10px 0; }
.tr-row .fr { margin: 4px 0 6px; color: var(--muted); }
.versions { margin: 0; padding-left: 18px; font-size: 14px; }
.versions a { color: var(--accent); word-break: break-all; }
.worker { border-color: var(--accent); }
.worker .muted { margin: 6px 0 0; font-size: 14px; }
.worker .row { margin-top: 10px; }
.worker .live-preview { max-height: 220px; }
.events { margin-top: 10px; }
.log { margin: 0; padding-left: 16px; font-size: 13px; color: var(--muted); max-height: 200px; overflow: auto; }
.result .button { margin-top: 8px; }

/* bouton Annuler (carte de statut) */
.cancel-btn { width: 100%; margin-top: 12px; }

/* ------------------------------------------------------------------ mode Auto, Catalogue, Réglages */
.topbar-actions { display: flex; gap: 6px; }
.tabs .tab { padding-left: 4px; padding-right: 4px; font-size: 15px; min-width: 0; }
.auto-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.auto-info { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 12px; margin: 0 0 12px; font-size: 14px; }
.auto-info dt { color: var(--muted); }
.auto-info dd { margin: 0; word-break: break-word; min-width: 0; }
.auto-info dd.redo { margin-top: 0; }
.auto-notes { margin: 6px 0 10px; padding-left: 18px; font-size: 14px; color: var(--warn); }
.auto-notes.errs { color: var(--err); }
.auto-feedback { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
#autoCard details { margin-bottom: 12px; }
#autoCard textarea { margin-top: 4px; }
.res-item { margin-bottom: 8px; background: var(--surface); }
.res-item summary { align-items: flex-start; padding: 8px 0; }
.res-title { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.res-title .t { font-size: 16px; word-break: break-word; }
.res-title .d { font-weight: 400; color: var(--muted); font-size: 12px; word-break: break-all; }
.res-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.res-form { padding-top: 6px; }
.res-form a { color: var(--accent); word-break: break-all; }
.res-quick { display: flex; gap: 8px; align-items: flex-start; }
.res-quick > details { flex: 1; min-width: 0; }
.res-quick > button { flex: none; margin-top: 4px; }
.prof-card.inactive { opacity: .8; }
.prof-card h2 { word-break: break-word; }
.prof-field .check { margin-bottom: 4px; }
.prof-formats .row .field { margin-bottom: 8px; }
.prof-test { margin: 8px 0; }
.prof-test input { flex: 1 1 200px; }
#catalogView .card h2 + .help { margin-top: 0; }
#catalogView section.card > h2 { margin-top: 14px; }
#catalogView section.card > h2:first-child, #catalogView .row-between h2 { margin-top: 0; }
#settingsModal .toggle { font-weight: 600; }

/* « Générer le script » (écran Épisode) */
.sgen { margin-bottom: 12px; }
.sgen-box textarea { width: 100%; }
.sgen-status { font-size: 14px; color: var(--muted); margin: 8px 0 0; overflow-wrap: anywhere; }
.sgen-status:empty { display: none; }
.sgen-confirm { border: 1px solid var(--accent); border-radius: 10px; padding: 12px; margin-top: 10px; background: var(--surface2); }
.sgen-confirm p { margin: 0 0 10px; line-height: 1.45; }
.sgen-undo { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.sgen-undo .help { margin: 0; flex: 1 1 200px; }

/* État de ComfyUI dans l'en-tête */
.topbar-actions { flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.comfy-state { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.comfy-state.on .dot { background: var(--ok); }
.comfy-state.off .dot { background: var(--err); }
.comfy-state.starting .dot { background: var(--warn); animation: pulse 1s infinite alternate; }
.sys-box { margin: 12px 0; }
.sys-box .help { margin-bottom: 10px; }

/* mode Auto avec image (édition) */
.auto-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; max-height: 320px; overflow: auto; margin-top: 8px; padding: 6px; border: 1px solid var(--border); border-radius: 10px; }
.auto-picker button { padding: 0; min-height: 0; border-radius: 8px; overflow: hidden; border: 2px solid transparent; background: var(--surface2); }
.auto-picker button:focus-visible, .auto-picker button:hover { border-color: var(--accent); }
.auto-picker img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.auto-denoise { display: flex; align-items: center; gap: 10px; }
.auto-denoise input[type=range] { flex: 1; min-width: 0; }
.auto-denoise output { font-variant-numeric: tabular-nums; min-width: 3em; text-align: right; font-weight: 700; }
.auto-thumb { max-width: 120px; max-height: 90px; border-radius: 8px; border: 1px solid var(--border); display: block; }
/* Réglages > Sécurité */
.sec-list textarea { width: 100%; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.sec-socle { font-size: 13px; color: var(--muted); background: var(--surface2); border: 1px dashed var(--border); border-radius: 8px; padding: 6px 8px; margin: 4px 0 0; }

/* Comptes (multi-utilisateur) */
body:not(.is-admin) .admin-only { display: none !important; }
#accountBtn { max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-list { display: flex; flex-direction: column; gap: 10px; }
.acc-item { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--surface2); }
.acc-item.off { opacity: .65; }
.acc-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.acc-head strong { font-size: 16px; margin-right: 4px; }
.acc-meta { font-size: 13px; color: var(--muted); margin: 4px 0 8px; }
.acc-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.acc-actions select { width: auto; }
.acc-secret { font-family: ui-monospace, Consolas, monospace; font-size: 16px; font-weight: 700; background: var(--surface); border: 1px dashed var(--accent); border-radius: 8px; padding: 8px 10px; word-break: break-all; user-select: all; }
.journal-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin-bottom: 10px; }
.journal { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.journal li { border-bottom: 1px solid var(--border); padding: 6px 0; overflow-wrap: anywhere; }
.journal .j-type { font-weight: 700; }
.journal .j-date { color: var(--muted); font-variant-numeric: tabular-nums; }
.s-filter { margin-bottom: 10px; }
.g-owner { font-size: 12px; color: var(--accent); }
