/* Flycase : feuille de style unique pour tous les modules (admin, espace client, révision, partage, lecteur).
   Thème par défaut : sombre, vert. Thème clair disponible (bouton en haut). Toute couleur passe par un token. */

/* ── Tokens ── */
:root {
  color-scheme: light;
  --bg: #f4f7f4; --card: #ffffff; --soft: #eef4ef; --line: #d9e3dc;
  --ink: #0f1d15; --muted: #5b6f63;
  --accent: #1a8a4f; --accent-ink: #ffffff;
  --ok: #1a8a4f; --warn: #8a6100; --bad: #c0392b;
  --radius: 12px; --radius-sm: 9px;
  --shadow: 0 10px 30px rgba(15, 29, 21, .10);
  --mono: ui-monospace, Menlo, Consolas, monospace;
}
:root[data-theme="night"] {
  color-scheme: dark;
  --bg: #07100b; --card: #0d1812; --soft: #13211a; --line: #1e3328;
  --ink: #e6f4ea; --muted: #7f9c8a;
  --accent: #3ddc84; --accent-ink: #04140b;
  --ok: #3ddc84; --warn: #e8b84a; --bad: #ff6b6b;
  --shadow: 0 12px 34px rgba(0, 0, 0, .45);
}

/* ── Base ── */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink);
  font: 15.5px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
:root[data-theme="night"] body {
  background:
    radial-gradient(1100px 520px at 12% -12%, rgba(61, 220, 132, .13), transparent 60%),
    radial-gradient(800px 420px at 100% 0%, rgba(61, 220, 132, .06), transparent 55%),
    var(--bg);
  background-attachment: fixed;
}
a { color: inherit; }
h1 { font-size: 1.5rem; line-height: 1.2; margin: 0 0 .4rem; font-weight: 700; letter-spacing: -.02em; text-wrap: balance; }
h2 { font-size: 1.02rem; font-weight: 600; margin: 1.5rem 0 .6rem; letter-spacing: -.01em; }
p { margin: .4rem 0; }
.card > h2:first-child { margin-top: 0; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.hidden, [hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── En-tête : barre translucide, navigation en pastilles ── */
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .75rem;
  max-width: 880px; margin: 0 auto; padding: .7rem 1.1rem; flex-wrap: wrap;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; font-size: 1.1rem; letter-spacing: -.02em; text-decoration: none; margin-right: auto; display: flex; align-items: center; gap: .5rem; }
.brand .logo { display: block; height: 1.75rem; width: auto; max-width: 60vw; }
.brand .logo.logo-night { display: none; }
:root[data-theme="night"] .brand .logo.logo-night { display: block; }
:root[data-theme="night"] .brand .logo.logo-day { display: none; }
.top nav { display: flex; gap: .2rem; flex-wrap: wrap; }
.top nav a, .linkbtn {
  text-decoration: none; padding: .38rem .75rem; border-radius: 999px; font-size: .88rem; font-family: inherit;
  color: var(--muted); background: none; border: 0; cursor: pointer;
}
.nav-ico { width: 1.05rem; height: 1.05rem; flex: none; opacity: .85; margin-right: .45rem; vertical-align: -.2em; }
.top nav a.on .nav-ico { opacity: 1; }
.top nav a:not(.on) .nav-ico { color: inherit; }
.top nav a:hover, .linkbtn:hover { color: var(--ink); background: var(--soft); }
.top nav a.on { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); font-weight: 600; }
.top .acct { display: flex; align-items: center; gap: .3rem; min-width: 0; }
.top .me-chip { display: inline-flex; align-items: center; gap: .4rem; text-decoration: none; color: var(--ink); padding: .15rem .55rem .15rem .15rem; border-radius: 999px; font-size: .85rem; white-space: nowrap; }
.top .me-chip:hover, .top .me-chip.on { background: var(--soft); }
.avatar {
  width: 1.8rem; height: 1.8rem; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font-size: .72rem; font-weight: 700; letter-spacing: .02em;
}
.top .linkbtn.logout { color: var(--bad); font-weight: 600; }
.top .linkbtn.logout:hover { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
.theme-toggle {
  background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: .28rem .75rem;
  color: var(--ink); cursor: pointer; font: inherit; font-size: .82rem; font-weight: 600; white-space: nowrap;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* ── Mise en page ── */
main { max-width: 880px; margin: 0 auto; padding: .5rem 1.1rem 4rem; }
main.narrow { max-width: 560px; }
main.wide { max-width: 1560px; }
body:has(main.wide) .top { max-width: 1560px; }
footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 0 1rem 2rem; }
.crumbs { margin: 1rem 0 0; overflow-wrap: anywhere; color: var(--muted); font-size: .88rem; }
.crumbs b { color: var(--ink); font-weight: 600; }
.center { text-align: center; }
.big { font-size: 2.4rem; line-height: 1; margin-bottom: .6rem; }
.headrow { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.headrow h1 { margin: 0 auto 0 0; }
.headrow select { width: auto; min-width: 12rem; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
@media (max-width: 520px) { .row { grid-template-columns: 1fr; } }
.page-top { margin: .5rem 0 1rem; }
.page-top .modes { margin: 0; }
.narrow-col { display: grid; gap: 1rem; max-width: 640px; align-content: start; min-width: 0; max-width: 100%; }

/* ── Cartes et panneaux (surface commune à tous les modules) ── */
.card, .win, .fx-app {
  background: var(--card); color: var(--ink); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.3rem; margin: 1rem 0;
}
.card > progress { display: block; margin: .3rem 0 .6rem; }
.brand-welcome {
  max-width: 880px; margin: .6rem auto 0; padding: .7rem 1.1rem; white-space: pre-line;
  border-left: 3px solid var(--accent); background: var(--soft); border-radius: var(--radius-sm);
}

/* ── Formulaires ── */
label { display: block; font-size: .875rem; font-weight: 600; margin: 1rem 0 .3rem; }
input[type=text], input[type=password], textarea, select {
  width: 100%; padding: .65rem .8rem; font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: var(--radius-sm); transition: border-color .15s, box-shadow .15s;
}
input[type=text]:focus, input[type=password]:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
textarea { min-height: 5rem; resize: vertical; }
input[type=file] {
  width: 100%; padding: .6rem; background: var(--bg); border: 1px dashed var(--line);
  border-radius: var(--radius-sm); color: var(--muted); font: inherit;
}
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
label input[type=checkbox] { margin-right: .3rem; }
.hint { color: var(--muted); font-size: .8rem; margin: .4rem 0 0; }
.error { color: var(--bad); font-weight: 600; margin-top: .8rem; }
.error:empty { display: none; }
.msg { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--soft); border-radius: var(--radius-sm); padding: .8rem 1rem; margin: .8rem 0; }
.linkbox { display: flex; gap: .5rem; margin-top: .8rem; }
.linkbox input { font-family: var(--mono); font-size: .85rem; }
form.linkbox { margin-top: 1.2rem; }
.cmt form.linkbox { margin-top: .5rem; }
.fsvc { display: inline-flex; flex-wrap: wrap; gap: .3rem .9rem; font-size: .85rem; }
.fsvc label, fieldset.svc label { display: inline-flex; align-items: center; gap: .3rem; font-weight: 500; margin: 0; }
fieldset.svc { border: 0; padding: 0; margin: .8rem 0; }
fieldset.svc legend { font-weight: 600; font-size: .9rem; padding: 0; margin-bottom: .3rem; }
fieldset.svc label { margin: 0 .9rem .3rem 0; }
.card > select { margin-top: .6rem; }
.rename { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.rename input[type=text] { flex: 1 1 10rem; min-width: 0; }

/* ── Boutons : un seul style, trois variantes ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .6rem 1.1rem;
  border-radius: var(--radius-sm); border: 1px solid var(--line); background: transparent; color: var(--ink);
  font: inherit; font-size: .92rem; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: border-color .15s, background .15s, color .15s, filter .15s;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { color: var(--accent-ink); filter: brightness(1.08); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: var(--bad); color: var(--bad); }
.btn.sm { padding: .32rem .7rem; font-size: .83rem; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn[disabled]:hover { border-color: var(--line); color: var(--ink); }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1.2rem; }
.actions:not(:has(> :not(.hidden))) { display: none; }
.linkbtn { font-size: .85rem; }

/* Pastilles de bascule (Lecture / Révisions, catégories) */
.modes { display: inline-flex; gap: .2rem; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--card); margin-bottom: .8rem; }
.modes a { padding: .3rem .85rem; border-radius: 999px; text-decoration: none; color: var(--muted); font-size: .85rem; font-weight: 600; }
.modes a:hover { color: var(--ink); }
.modes a.on { background: var(--accent); color: var(--accent-ink); }
.lp-catalog .modes { margin-bottom: 0; justify-self: start; }
.fx-clients { display: flex; gap: .4rem; flex-wrap: wrap; margin: 0 0 .8rem; }
.fx-clients a { padding: .33rem .8rem; border-radius: 999px; border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: .85rem; }
.fx-clients a:hover { border-color: var(--accent); }
.fx-clients a.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* ── Étiquettes et indicateurs ── */
.tag {
  display: inline-block; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  padding: .12rem .5rem; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); vertical-align: middle;
}
.tag.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 50%, transparent); background: color-mix(in srgb, var(--ok) 10%, transparent); }
.tag.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 50%, transparent); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.live-dot { width: .55rem; height: .55rem; border-radius: 50%; background: var(--ok); display: inline-block; animation: livepulse 1.6s infinite; }
@keyframes livepulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); }
  70% { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .7rem; margin-top: 1rem; }
.tile { background: var(--soft); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .8rem .9rem; display: flex; flex-direction: column; }
.tile strong { font-size: 1.5rem; line-height: 1.2; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

progress { display: block; width: 100%; height: 6px; appearance: none; border: 0; border-radius: 3px; overflow: hidden; background: var(--line); }
progress::-webkit-progress-bar { background: var(--line); }
progress::-webkit-progress-value { background: var(--accent); }
progress::-moz-progress-bar { background: var(--accent); }

/* ── Zone de dépôt ── */
.drop {
  display: block; position: relative; border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 1.6rem 1rem;
  text-align: center; cursor: pointer; margin: 1rem 0 0; font-size: 1rem; background: var(--soft); transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--card)); }
.drop:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.drop strong { display: block; }
.drop input, .drop input[type=file] { position: absolute; width: 1px; height: 1px; max-width: 1px; opacity: 0; padding: 0; border: 0; }

/* ── Listes de fichiers ── */
.files { list-style: none; margin: .8rem 0 0; padding: 0; }
.files li { display: grid; grid-template-columns: 1fr auto; gap: .2rem .8rem; align-items: center; padding: .65rem 0; border-top: 1px solid var(--line); }
.files li:first-child { border-top: 0; }
.fname { overflow-wrap: anywhere; font-weight: 500; }
.fmeta { grid-column: 1; font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.fact { grid-row: 1 / span 2; grid-column: 2; display: flex; gap: .4rem; align-items: center; }
.files li > .edit-panel { grid-column: 1 / -1; margin-top: .5rem; padding: .8rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--soft); }
.files li > progress { grid-column: 1 / -1; }
.files li.entry { grid-template-columns: auto minmax(0, 1fr); gap: .3rem .7rem; padding-left: .5rem; padding-right: .5rem; border-radius: var(--radius-sm); transition: background .12s, opacity .12s; }
.files li.entry:hover { background: var(--soft); }
.files li.entry.sel { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.files li.entry.dragging { opacity: .45; }
.files li.entry.over, .crumbs a.over { outline: 2px dashed var(--accent); outline-offset: 2px; background: var(--soft); }
.files li > .pick { grid-column: 1; grid-row: 1; width: 1.05rem; height: 1.05rem; margin: 0; accent-color: var(--accent); cursor: pointer; }
.files li > .nm { grid-column: 1; min-width: 0; }
.files li.entry > .nm { grid-column: 2; grid-row: 1; }
.files li.entry > .fact { grid-row: 2; grid-column: 2; flex-wrap: wrap; justify-content: flex-start; gap: .35rem; }
.files li > .nm + .fact { grid-row: auto; }
.files li.entry[draggable="true"] .fname { cursor: grab; }
.files li.entry > .fact .btn { padding: .3rem .7rem; }
.files li.entry .nm .fmeta { display: block; margin-top: .1rem; }
.drw-pane .files li { padding: .55rem 0; }
.total { margin-top: 1rem; font-variant-numeric: tabular-nums; }

/* ── Listes génériques ── */
.list { list-style: none; margin: 0; padding: 0; }
.list li a { display: grid; grid-template-columns: 1fr auto; gap: .1rem 1rem; padding: .85rem 0; border-top: 1px solid var(--line); text-decoration: none; }
.list li:first-child a { border-top: 0; }
.list .t { font-weight: 600; overflow-wrap: anywhere; }
.list .m { grid-column: 1; font-size: .82rem; color: var(--muted); }
.list .r { grid-row: 1 / span 2; grid-column: 2; text-align: right; font-size: .82rem; color: var(--muted); align-self: center; font-variant-numeric: tabular-nums; }
.list li a:hover .t { color: var(--accent); }
ul.activity li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .1rem 1rem; padding: .6rem 0; border-top: 1px solid var(--line); }
ul.activity li:first-child { border-top: 0; }
ul.activity .t { font-weight: 500; overflow-wrap: anywhere; }
ul.activity .m { font-size: .82rem; color: var(--muted); white-space: nowrap; }

/* ── Choix (accueil des espaces) ── */
.choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .8rem; }
@media (max-width: 520px) { .choice { grid-template-columns: 1fr; } }
.choice a { display: block; text-decoration: none; padding: 1.2rem 1.25rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); transition: border-color .15s, background .15s; }
.choice a:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 5%, var(--card)); }
.choice strong { display: block; font-size: 1rem; font-weight: 600; line-height: 1.3; }
.choice a > span { display: block; margin-top: .4rem; font-size: .88rem; line-height: 1.45; }

/* ── Accueil ── */
.welcome { padding-bottom: .9rem; }
.welcome h1 { margin: 0 0 .2rem; font-size: 1.5rem; }
.welcome p { margin: .15rem 0; }
.home { display: grid; gap: 1rem; margin-top: .5rem; align-items: start; }
.home-main, .home-live { min-width: 0; display: grid; gap: 1rem; align-content: start; }
.home-main .card, .home-live .card { margin: 0; }
.home-main > p.small.center { text-align: left; margin: .2rem .2rem 0; }
.live-card h2 { display: flex; align-items: center; gap: .5rem; }
/* Activité en direct : lignes lisibles (texte courant, horodatage et détail en mono), sans double encadrement */
.live-card .live-log { height: 60vh; min-height: 22rem; margin: .6rem 0 0; padding: 0; border: 0; background: transparent; font: .86rem/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.live-card .live-log .ll { padding: .6rem 0; }
.live-card .live-log .lt { font: .76rem var(--mono); }
.live-card .live-log .ld { font: .8rem var(--mono); padding-left: 0; margin-top: .2rem; overflow-wrap: anywhere; }
.live-card .files { margin-top: .4rem; }
@media (min-width: 1100px) {
  .home { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); }
  .home-live { position: sticky; top: 4.5rem; }
  .live-log { height: calc(100vh - 14rem); min-height: 28rem; }
}

/* ── Tableau de bord : une colonne sur téléphone, trois sur grand écran ── */
.dash { display: grid; gap: 1rem; margin-top: 1rem; }
.dash .card { margin: 0; min-width: 0; }
.d-head .tiles { margin-top: 0; }
.d-head .tiles { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.dash .tile strong { font-size: 1.35rem; }
svg.map { display: block; width: 100%; height: auto; margin: .4rem 0; }
.map .sea { fill: var(--soft); }
.map .land { fill: var(--line); stroke: var(--card); stroke-width: .2; }
.map .dot { fill: var(--accent); fill-opacity: .8; stroke: var(--card); stroke-width: .5; cursor: pointer; }
.map .dot:focus-visible { outline: none; stroke: var(--ink); stroke-width: 1.2; }
.grid { stroke: var(--line); stroke-width: .6; }
@media (min-width: 1100px) {
  .dash { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 1.25fr); grid-template-areas: "head head head" "server server server" "live map log" "traffic map log"; grid-template-rows: auto auto auto 1fr; align-items: start; }
  .d-head { grid-area: head; } .d-server { grid-area: server; } .d-live { grid-area: live; } .d-traffic { grid-area: traffic; } .d-map { grid-area: map; } .d-log { grid-area: log; }
  .d-head .tiles, .d-server .tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .d-log .logwin { height: 38rem; }
}

/* ── Cartes du tableau de bord : arrondies, halo vert discret ── */
.panel { position: relative; overflow: hidden; margin: 0; min-width: 0; padding: 1.1rem 1.2rem 1.2rem; border-radius: 18px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.panel::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(420px 180px at 100% 0%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%); }
.panel > * { position: relative; }
.p-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .85rem; min-height: 1.5rem; }
.p-title { margin: 0; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.p-aside { margin-left: auto; display: inline-flex; align-items: center; gap: .4rem; font-size: .78rem; color: var(--muted); }
.caret { display: inline-block; width: .5rem; height: 1em; background: var(--accent); vertical-align: -.15em; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* Bandeau d'accueil : titre large, halo plus marqué, chiffres en vert */
.d-head { background: radial-gradient(760px 300px at 0% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%), var(--card); }
.d-head::before { display: none; }
.d-head h1 { font-size: 2rem; letter-spacing: -.03em; margin-bottom: .15rem; }
.d-head .headrow { gap: 1rem; }
.d-head .tiles { margin-top: 1.2rem; }
.d-head .tile { background: color-mix(in srgb, var(--card) 60%, transparent); border-color: color-mix(in srgb, var(--accent) 18%, var(--line)); border-radius: 14px; }
.d-head .tile strong { color: var(--accent); }

/* Tuiles serveur vivantes : barre de niveau, mini-historique, clignotement au changement */
.srv { position: relative; overflow: hidden; border-radius: 14px; background: color-mix(in srgb, var(--card) 60%, transparent); border-color: color-mix(in srgb, var(--accent) 16%, var(--line)); }
.srv strong { transition: color .3s; }
.srv.flash { animation: srvflash .9s ease-out; }
.srv.flash strong { color: var(--ok); }
@keyframes srvflash { 0% { box-shadow: inset 0 0 0 2px var(--accent), 0 0 18px color-mix(in srgb, var(--accent) 35%, transparent); } 100% { box-shadow: inset 0 0 0 0 transparent, 0 0 0 0 transparent; } }
.meter { display: block; height: 5px; margin: .45rem 0 .1rem; border-radius: 99px; background: var(--line); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--ok)); transition: width .8s cubic-bezier(.2, .8, .2, 1); }
.spark { display: flex; align-items: flex-end; gap: 2px; height: 26px; margin: .35rem 0 .15rem; }
.spark:empty { display: none; }
.spark i { flex: 1; min-width: 2px; border-radius: 2px; background: color-mix(in srgb, var(--accent) 45%, transparent); transition: height .6s ease; }
.spark i:last-child { background: var(--accent); }

/* Listes en vue détails, lignes arrondies */
.finder { list-style: none; margin: 0; padding: 0; }
.finder li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: .6rem; align-items: center; padding: .55rem .6rem; margin: 0 -.6rem; border-radius: 10px; font-size: .9rem; font-variant-numeric: tabular-nums; }
.finder li + li { box-shadow: inset 0 1px 0 var(--line); }
.finder li:hover { background: var(--soft); }
.finder .finder-head { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); box-shadow: none; }
.finder .finder-head:hover { background: none; }
.finder .num { text-align: right; min-width: 4.8rem; }
.finder .fname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Journal façon terminal : fond sombre fixe, quel que soit le thème */
.panel.term { background: #06110a; border-color: #173423; color: #bff5cf; }
.panel.term::before { background: radial-gradient(420px 180px at 100% 0%, rgba(61, 220, 132, .12), transparent 70%); }
.term .p-title { color: #7fd6a0; font-family: var(--mono); font-size: .86rem; font-weight: 600; letter-spacing: .02em; text-transform: none; }
.term .p-aside { color: #5f8a6a; font-family: var(--mono); }
.term .term-cmd { margin: 0 0 .5rem; color: #3ddc84; font-family: var(--mono); font-size: .85rem; }
.term .logwin { background: #030604; color: #bff5cf; border-color: #173423; border-radius: 12px; }
.term .ll { border-top-color: #112018; }
.term .ll::before { content: '$ '; color: #3ddc84; }
.term .lt, .term .ld, .term .muted { color: #587d66; }
.term .lw { color: #eafff0; }
.term .lk { color: #7dffa8; }
.term .lk.down, .term .lk.warn { color: #ffd166; }
.term .lk.bad { color: #ff7a7a; }
.term select, .term input { background: #030604; color: #bff5cf; border-color: #173423; }
.term input::placeholder { color: #587d66; }
.term .btn { background: #030604; color: #bff5cf; border-color: #173423; }

/* Journal et logs */
.logwin {
  background: var(--soft); color: var(--ink); border: 1px solid var(--line); font: 12.5px/1.5 var(--mono);
  border-radius: var(--radius-sm); padding: .7rem .8rem; height: 26rem; overflow: auto; margin-top: .8rem; overflow-wrap: anywhere;
}
.ll { padding: .3rem 0; border-top: 1px solid var(--line); } .ll:first-child { border-top: 0; }
.lt, .ld { color: var(--muted); } .ld { padding-left: 1rem; }
.lw { color: var(--ink); font-weight: 600; }
.lk { color: var(--accent); font-weight: 600; }
.lk.down, .lk.warn { color: var(--warn); } .lk.up { color: var(--ok); } .lk.bad { color: var(--bad); }

/* ── Révision vidéo : lecteur à gauche, commentaires à droite ── */
.review { display: grid; gap: 1rem; margin-top: .5rem; }
.review .card { margin: 0 0 1rem; }
@media (min-width: 1000px) {
  .review { grid-template-columns: minmax(0, 1fr) 400px; align-items: start; }
  .rv-side { position: sticky; top: 4.5rem; }
  .rv-side .cmts { max-height: calc(100vh - 16rem); overflow: auto; }
}
.player { position: relative; margin-top: 1rem; background: #000; border-radius: var(--radius-sm); overflow: hidden; line-height: 0; }
.player video { width: 100%; height: auto; max-height: 72vh; display: block; }
.pins { position: absolute; inset: 0; pointer-events: none; }
.pins.picking { pointer-events: auto; cursor: crosshair; background: color-mix(in srgb, var(--accent) 12%, transparent); outline: 2px dashed var(--accent); outline-offset: -2px; }
.pin {
  position: absolute; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); font: 700 13px/24px system-ui, sans-serif; text-align: center; border: 2px solid #fff;
}
.pin.mine { background: var(--card); color: var(--ink); border-color: var(--accent); }
.marks { position: relative; height: 22px; margin: .5rem 12px 0; border-top: 2px solid var(--line); }
.tmark { position: absolute; top: -6px; width: 14px; height: 14px; margin-left: -7px; padding: 0; border-radius: 50%; border: 2px solid var(--card); background: var(--accent); cursor: pointer; box-shadow: 0 0 0 1px var(--line); }
.tmark.done { background: var(--muted); }
.tmark:hover, .tmark:focus-visible { transform: scale(1.25); }
.tc { font: 600 .85rem var(--mono); font-variant-numeric: tabular-nums; }
button.tc { background: var(--soft); color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: .15rem .45rem; cursor: pointer; }
button.tc:hover { border-color: var(--accent); }
.composer textarea { min-height: 4.5rem; margin-top: .5rem; }
.composer .actions { margin-top: .6rem; }
.cmts { list-style: none; margin: .4rem 0 0; padding: 0; }
.cmt { padding: .8rem .7rem; border-top: 1px solid var(--line); border-radius: var(--radius-sm); }
.cmt.sel { background: var(--soft); }
.cmt.done .ctext { color: var(--muted); }
.chead { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.ctext { margin: .35rem 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.reply { margin: .6rem 0 0 1rem; padding-left: .8rem; border-left: 2px solid var(--line); }
.cact { display: flex; gap: .2rem; flex-wrap: wrap; margin: .3rem 0 0 -.6rem; }
.cact .linkbtn { font-size: .8rem; padding: .25rem .6rem; }

/* ── Lecteur vidéo de l'équipe (player.js) : vitrine, lecteur et panneau latéral ── */
.lp-host { margin-top: .5rem; }
.lp-layout { display: grid; gap: 1rem; align-items: start; }
.lp-main { min-width: 0; }
.lp-vp { position: relative; background: #000; color: #fff; border-radius: var(--radius); overflow: hidden; user-select: none; }
.lp-vp.idle { cursor: none; }
.lp-vp.idle .lp-ctrl { opacity: 0; pointer-events: none; }
.lp-vp:fullscreen { border-radius: 0; display: flex; flex-direction: column; justify-content: center; }
.lp-vp :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lp-stage { position: relative; aspect-ratio: 16 / 9; display: grid; grid-template-columns: minmax(0, 1fr); background: #000; cursor: pointer; }
.lp-stage.lp-cmp { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); aspect-ratio: auto; }
.lp-cell { position: relative; aspect-ratio: 16 / 9; min-width: 0; overflow: hidden; }
.lp-stage.lp-cmp .lp-cell + .lp-cell { box-shadow: -2px 0 0 var(--accent); }
.lp-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.lp-chip { position: absolute; top: .6rem; left: .6rem; font-size: .75rem; font-weight: 700; background: rgba(0, 0, 0, .6); padding: .12rem .5rem; border-radius: 999px; pointer-events: none; }
.lp-big {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 4.4rem; height: 4.4rem; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .25); background: rgba(4, 20, 11, .55); color: #fff; display: grid; place-items: center; cursor: pointer;
  transition: opacity .2s, background .2s, border-color .2s;
}
.lp-big:hover { background: color-mix(in srgb, var(--accent) 35%, rgba(4, 20, 11, .55)); border-color: var(--accent); }
.lp-big svg { width: 26px; height: 26px; margin-left: 4px; }
.lp-vp.playing .lp-big { opacity: 0; pointer-events: none; }
.lp-msg { position: absolute; left: 1rem; right: 1rem; top: 1rem; margin: 0; background: rgba(0, 0, 0, .75); color: #fff; padding: .6rem .8rem; border-radius: var(--radius-sm); font-size: .9rem; }
.lp-ctrl { position: absolute; left: 0; right: 0; bottom: 0; padding: 2.5rem .8rem .5rem; background: linear-gradient(transparent, rgba(0, 0, 0, .85)); transition: opacity .25s; }
.lp-prog { position: relative; height: 18px; cursor: pointer; touch-action: none; }
.lp-prog::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 4px; transform: translateY(-50%); background: rgba(255, 255, 255, .3); border-radius: 2px; transition: height .15s; }
.lp-played { position: absolute; left: 0; top: 50%; height: 4px; transform: translateY(-50%); background: var(--accent); border-radius: 2px; width: 0; pointer-events: none; transition: height .15s; }
.lp-prog:hover::before, .lp-prog:hover .lp-played { height: 6px; }
.lp-knob { position: absolute; top: 50%; left: 0; width: 13px; height: 13px; margin-left: -6.5px; transform: translateY(-50%); border-radius: 50%; background: var(--accent); opacity: 0; transition: opacity .15s; pointer-events: none; }
.lp-prog:hover .lp-knob, .lp-prog:focus-visible .lp-knob { opacity: 1; }
.lp-marks { position: absolute; inset: 0; pointer-events: none; }
.lp-mk { position: absolute; top: 50%; width: 8px; height: 14px; margin-left: -4px; transform: translateY(-50%); border: 0; border-radius: 2px; background: var(--accent); cursor: pointer; pointer-events: auto; padding: 0; }
.lp-mk.ok { background: var(--ok); }
.lp-hover { position: absolute; bottom: 100%; margin-bottom: 8px; transform: translateX(-50%); background: rgba(0, 0, 0, .85); padding: .15rem .45rem; border-radius: 6px; font: 600 .75rem var(--mono); white-space: nowrap; pointer-events: none; }
.lp-row { display: flex; align-items: center; gap: .25rem; margin-top: .2rem; flex-wrap: wrap; }
.lp-grow { flex: 1; }
.lp-ib { background: none; border: 0; color: #fff; padding: .35rem .55rem; border-radius: 8px; cursor: pointer; font: inherit; font-size: .82rem; font-weight: 600; white-space: nowrap; display: inline-flex; align-items: center; gap: .3rem; }
.lp-ib:hover { background: rgba(255, 255, 255, .14); }
.lp-ib[aria-pressed="true"] { color: var(--accent); }
.lp-time { font: .8rem var(--mono); font-variant-numeric: tabular-nums; margin: 0 .4rem; opacity: .9; white-space: nowrap; }
.lp-vol { width: 84px; accent-color: var(--accent); }
.lp-sel { background: rgba(0, 0, 0, .55); color: #fff; border: 1px solid rgba(255, 255, 255, .25); border-radius: 8px; padding: .25rem .35rem; font: inherit; font-size: .8rem; }
.lp-sel option { color: #111; }
.lp-hint { color: var(--muted); font-size: .85rem; margin: .5rem 0 0; }
.lp-side { padding: 0; overflow: hidden; margin: 0; }
.lp-tabs { display: flex; border-bottom: 1px solid var(--line); }
.lp-tabs button { flex: 1; background: none; border: 0; padding: .75rem; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.lp-tabs button:hover { color: var(--ink); }
.lp-tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.lp-pad { padding: .8rem 1rem 0; }
.lp-side .msg { margin: .4rem 0; }
.lp-cmts, .lp-vlist { list-style: none; margin: 0; padding: 0; }
.lp-cmt { padding: .8rem 1rem; border-top: 1px solid var(--line); min-width: 0; }
.lp-cmt.done { opacity: .6; }
.lp-cmt.sel { background: var(--soft); }
.lp-chead { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.lp-text { margin: .3rem 0 0; overflow-wrap: anywhere; }
.lp-reply { margin: .5rem 0 0 1.2rem; padding-left: .7rem; border-left: 2px solid var(--line); }
.lp-reply p { margin: .2rem 0 0; }
.lp-cact { margin-top: .5rem; }
.lp-vlist li { border-top: 1px solid var(--line); }
.lp-vlist li:first-child { border-top: 0; }
.lp-vrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .15rem .6rem; width: 100%; background: none; border: 0; padding: .8rem 1rem; text-align: left; cursor: pointer; color: inherit; font: inherit; }
.lp-vrow:hover { background: var(--soft); }
.lp-vrow .t { font-weight: 600; overflow-wrap: anywhere; }
.lp-vrow .m { color: var(--muted); font-size: .8rem; grid-column: 1; }
.lp-tags { grid-column: 2; grid-row: 1 / span 2; display: flex; flex-direction: column; align-items: flex-end; gap: .3rem; }
.lp-vlist li.on .lp-vrow { box-shadow: inset 3px 0 0 var(--accent); }
@media (min-width: 1000px) {
  .lp-layout { grid-template-columns: minmax(0, 1fr) 360px; }
  .lp-side { position: sticky; top: 4.5rem; }
}
.lp-catalog { display: grid; gap: 1.2rem; margin-top: .5rem; grid-template-columns: minmax(0, 1fr); min-width: 0; max-width: 100%; }
.lp-hero {
  position: relative; border-radius: var(--radius); min-height: 16rem; display: flex; align-items: flex-end; padding: 1.6rem;
  overflow: hidden; color: #fff; background: linear-gradient(135deg, #0d2a1a, #07100b);
  border: 1px solid var(--line);
}
.lp-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0, 0, 0, .75), rgba(0, 0, 0, 0) 60%); }
.lp-hero-body { position: relative; z-index: 1; max-width: 40rem; }
.lp-hero h1 { color: #fff; margin: .2rem 0 .3rem; font-size: clamp(1.5rem, 3vw, 2.2rem); }
.lp-hero p { margin: 0 0 .9rem; opacity: .9; }
.lp-hero .actions { margin: 0; }
.lp-kicker { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; opacity: .85; font-weight: 700; color: var(--accent); }
.lp-rows { display: grid; gap: 1.6rem; grid-template-columns: minmax(0, 1fr); min-width: 0; }
.lp-row { min-width: 0; max-width: 100%; }
.lp-row h2 { font-size: 1.1rem; margin: 0 0 .6rem; }
.lp-strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(13rem, 17rem); gap: .9rem; overflow-x: auto; scroll-snap-type: x proximity; padding: .2rem .1rem .8rem; scrollbar-width: thin; min-width: 0; max-width: 100%; }
.lp-strip.lp-stack { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: minmax(0, 1fr); overflow: visible; scroll-snap-type: none; max-width: 36rem; padding: 0; gap: 1.2rem; }
.tile-card { display: grid; gap: .3rem; text-decoration: none; color: var(--ink); scroll-snap-align: start; min-width: 0; }
.tile-card .poster { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius-sm); border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; transition: transform .15s ease, border-color .15s ease; }
.tile-card:hover .poster, .tile-card:focus-visible .poster { transform: scale(1.02); border-color: var(--accent); }
.tile-card .play { width: 2.6rem; height: 2.6rem; border-radius: 50%; background: rgba(0, 0, 0, .45); color: #fff; display: grid; place-items: center; font-size: 1rem; padding-left: .15rem; opacity: .9; }
.tile-card .badge { position: absolute; top: .45rem; left: .45rem; background: var(--accent); color: var(--accent-ink); font-size: .72rem; font-weight: 700; padding: .15rem .5rem; border-radius: 999px; }
.tile-card .badge.warn { background: var(--warn); color: #111; }
.tile-card .tt { overflow-wrap: anywhere; font-weight: 600; }
.tile-card .desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile-card .dates { overflow-wrap: anywhere; }
/* Barre de recherche : pilule avec loupe */
.lp-search {
  display: block; width: 100%; max-width: 28rem; box-sizing: border-box; padding: .65rem 1.1rem .65rem 2.7rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237f9c8a' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat .95rem center / 1.1rem;
  color: var(--ink); font: inherit; font-size: 1rem; transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
.lp-search::placeholder { color: var(--muted); opacity: .85; }
.lp-search:hover { border-color: var(--accent); }
.lp-search:focus, .lp-search:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.lp-search::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; height: 1rem; width: 1rem; border-radius: 50%; background: var(--muted) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' stroke='%23fff' stroke-width='1.6'%3E%3Cpath d='M2 2l6 6M8 2l-6 6'/%3E%3C/svg%3E") center / .55rem no-repeat; cursor: pointer; }
.lp-search { min-width: 0; max-width: 100%; }
@media (max-width: 860px) {
  .lp-hero { min-height: 13rem; padding: 1.1rem; }
  .lp-strip { grid-auto-columns: minmax(11rem, 14rem); }
}
@media (max-width: 600px) {
  .lp-m-hide { display: none !important; }
  .lp-ctrl { padding: 1.8rem .5rem .35rem; }
  .lp-row { gap: .1rem; }
  .lp-ib { padding: .3rem .35rem; font-size: .75rem; }
  .lp-time { font-size: .7rem; margin: 0 .2rem; }
  .lp-sel { font-size: .72rem; padding: .2rem .25rem; max-width: 9.5rem; }
  .lp-big { width: 3.2rem; height: 3.2rem; }
  .lp-big svg { width: 20px; height: 20px; }
  .lp-chip { font-size: .65rem; top: .4rem; left: .4rem; }
}

/* Repères sur la ligne de temps */
.marks { margin-top: .4rem; }

/* ── Espace équipe : sélection, renommer, déplacer ── */
.bulkbar { display: flex; align-items: center; gap: .6rem .9rem; flex-wrap: wrap; margin: .8rem 0 0; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--soft); font-size: .9rem; }
.bulk-all { display: inline-flex; align-items: center; gap: .45rem; cursor: pointer; font-weight: 600; }
.bulk-all input { width: 1.05rem; height: 1.05rem; margin: 0; accent-color: var(--accent); cursor: pointer; }
.bulk-count { flex: 1 1 auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.bulk-acts { display: flex; gap: .4rem; flex-wrap: wrap; }
.bulk-acts .btn[disabled] { opacity: .45; }

/* Fenêtres modales et sélecteur de dossier */
.modal-bg { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 1rem; background: rgba(0, 0, 0, .55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.modal {
  width: 100%; max-width: 380px; background: var(--card); color: var(--ink); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow);
}
.modal.wide { max-width: 480px; }
.modal p { margin: 0 0 1.2rem; line-height: 1.45; }
.modal-actions { display: flex; gap: .6rem; justify-content: flex-end; flex-wrap: wrap; }
.picker-title { display: block; font-size: 1.05rem; margin-bottom: .5rem; }
.picker-where { margin: 0 0 .4rem; }
.picker-list { list-style: none; margin: .6rem 0; padding: 0; max-height: 45vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.picker-list li + li { border-top: 1px solid var(--line); }
.picker-list li.muted { padding: .7rem .8rem; }
.picker-item { display: block; width: 100%; text-align: left; background: none; border: 0; padding: .65rem .8rem; font: inherit; color: var(--ink); cursor: pointer; }
.picker-item:hover:not([disabled]) { background: var(--soft); color: var(--accent); }
.picker-item[disabled] { opacity: .4; cursor: not-allowed; }

/* ── Explorateur de fichiers (admin) : barre d'outils, liste, grille, colonnes ── */
.fx-app { padding: 0; margin: 1rem 0; overflow: hidden; outline: none; }
.fx-app:focus-visible { border-color: var(--accent); }
.fx-top { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; padding: .8rem 1rem .3rem; }
.fx-top h1 { margin: 0; font-size: 1.2rem; }
.fx-toolbar { display: flex; align-items: center; gap: .4rem; padding: .45rem 1rem; border-bottom: 1px solid var(--line); background: var(--soft); flex-wrap: wrap; }
.fx-btn {
  display: inline-flex; align-items: center; justify-content: center; min-width: 1.9rem; height: 1.9rem; padding: 0 .5rem;
  border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-size: .85rem; text-decoration: none; cursor: pointer;
  transition: border-color .15s, color .15s;
}
.fx-btn:hover { border-color: var(--accent); color: var(--accent); }
.fx-btn[aria-disabled="true"], .fx-btn:disabled { opacity: .4; pointer-events: none; cursor: not-allowed; }
.fx-view { font-size: .95rem; min-width: 1.9rem; }
.fx-view[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.fx-sep { width: 1px; height: 1.2rem; background: var(--line); margin: 0 .2rem; }
.fx-txt { min-width: 0; padding: 0 .6rem; font-size: .8rem; }
.fx-note { margin-left: auto; font-size: .78rem; color: var(--muted); }
.fx-note:empty { display: none; }
.fx-crumbs { flex: 1 1 14rem; min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: .2rem; font-size: .84rem; overflow-wrap: anywhere; }
.fx-crumbs a { color: var(--ink); text-decoration: none; padding: .2rem .35rem; border-radius: 6px; }
.fx-crumbs a:hover { background: var(--card); color: var(--accent); }
.fx-crumbs .sep { color: var(--muted); }
.fx-search { flex: 0 1 12rem; min-width: 8rem; padding: .3rem .65rem; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-size: .8rem; }
.fx-input { width: 100%; margin-top: .6rem; padding: .5rem .75rem; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; font-size: .9rem; }
.fx-head, .fx-row { display: grid; grid-template-columns: minmax(0, 1fr) 8.5rem 6rem 8rem; gap: .5rem; align-items: center; padding: 0 1rem; }
.fx-head { height: 1.8rem; border-bottom: 1px solid var(--line); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.fx-sort { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.fx-sort:hover { color: var(--accent); }
.fx-head .fx-c-size, .fx-head .fx-c-size .fx-sort, .fx-row .fx-c-size { text-align: right; justify-self: end; }
.fx-rows { list-style: none; margin: 0; padding: .15rem 0; max-height: 70vh; overflow: auto; }
.fx-row { min-height: 1.85rem; font-size: .85rem; cursor: default; user-select: none; font-variant-numeric: tabular-nums; }
.fx-row:hover { background: var(--soft); }
.fx-row.sel { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.fx-row.sel a { color: var(--accent); }
.fx-row .fx-c-date, .fx-row .fx-c-size, .fx-row .fx-c-items { color: var(--muted); font-size: .76rem; }
.fx-name { display: flex; align-items: center; gap: .55rem; min-width: 0; overflow-wrap: anywhere; font-weight: 500; }
.fx-name a { color: inherit; text-decoration: none; }
.fx-name a:hover { color: var(--accent); text-decoration: underline; }
.fx-ico { width: 1rem; text-align: center; color: var(--accent); flex: 0 0 auto; }
.fx-row:not(.dir) .fx-ico { color: var(--muted); }
.fx-empty { padding: 1rem; color: var(--muted); }
.fx-foot { display: flex; flex-direction: column; gap: .2rem; padding: .45rem 1rem; border-top: 1px solid var(--line); background: var(--soft); font-size: .76rem; }
.fx-status { color: var(--muted); font-variant-numeric: tabular-nums; }
.fx-detail { display: flex; flex-wrap: wrap; gap: .2rem 1rem; min-height: 1.4rem; color: var(--ink); }
.fx-detail strong { font-weight: 600; overflow-wrap: anywhere; }
.fx-detail span, .fx-detail code { color: var(--muted); }
.fx-detail code { font-family: var(--mono); font-size: .8rem; overflow-wrap: anywhere; }
.fx-actions { border-top: 0; padding-top: .3rem; }
.fx-rows.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: .4rem; padding: .6rem; }
.fx-rows.grid .fx-row { display: flex; flex-direction: column; align-items: flex-start; gap: .25rem; min-height: 0; padding: .6rem; border-radius: var(--radius-sm); border: 1px solid transparent; }
.fx-rows.grid .fx-row:hover { border-color: var(--line); }
.fx-rows.grid .fx-name { flex-direction: column; align-items: flex-start; gap: .2rem; font-size: .85rem; }
.fx-rows.grid .fx-ico { font-size: 1.4rem; line-height: 1; width: auto; }
.fx-rows.grid .fx-c-date, .fx-rows.grid .fx-c-size, .fx-rows.grid .fx-c-items { font-size: .72rem; }
.fx-rows.grid .fx-row.sel { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Vue colonnes (Finder) */
.fx-cols { display: flex; align-items: stretch; height: 62vh; min-height: 16rem; overflow-x: auto; overflow-y: hidden; border-top: 1px solid var(--line); }
.fx-cols.hidden { display: none; }
.fx-col { list-style: none; margin: 0; padding: .3rem 0; flex: 0 0 13.5rem; width: 13.5rem; overflow-y: auto; border-right: 1px solid var(--line); }
.fx-col-item { display: flex; align-items: center; gap: .45rem; padding: .32rem .7rem; font-size: .84rem; cursor: default; user-select: none; color: var(--ink); }
.fx-col-item:hover { background: var(--soft); }
.fx-col-item.path { background: var(--soft); font-weight: 600; }
.fx-col-item.sel { background: var(--accent); color: var(--accent-ink); }
.fx-col-item.sel .fx-ico, .fx-col-item.sel .fx-chev { color: var(--accent-ink); }
.fx-col-item .fx-col-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.fx-col-item .fx-ico { width: .9rem; text-align: center; color: var(--accent); flex: 0 0 auto; }
.fx-col-item:not(.dir) .fx-ico { color: var(--muted); }
.fx-chev { color: var(--muted); }
@media (max-width: 720px) {
  .fx-head, .fx-row { grid-template-columns: minmax(0, 1fr) 5rem; }
  .fx-head .fx-c-date, .fx-head .fx-c-items, .fx-row .fx-c-items, .fx-row .fx-c-date { display: none; }
  .fx-row .fx-c-size { font-size: .8rem; }
  .fx-search { flex-basis: 100%; order: 3; }
}

/* Menu contextuel */
.ctx { position: fixed; z-index: 1100; min-width: 12rem; padding: .3rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.ctx-item { display: block; width: 100%; text-align: left; background: none; border: 0; padding: .5rem .75rem; border-radius: 8px; font: inherit; font-size: .9rem; color: var(--ink); cursor: pointer; }
.ctx-item:hover:not([disabled]) { background: var(--accent); color: var(--accent-ink); }
.ctx-item[disabled] { opacity: .4; cursor: not-allowed; }
.ctx-item.danger { color: var(--bad); }
.ctx-item.danger:hover:not([disabled]) { background: var(--bad); color: #fff; }
.ctx-sep { height: 1px; margin: .3rem .4rem; background: var(--line); }

/* Volet latéral (paramètres du client, SFTP) */
.drw-bg { position: fixed; inset: 0; z-index: 1000; display: flex; justify-content: flex-end; background: rgba(0, 0, 0, .5); }
.drw { width: min(680px, 100%); height: 100%; display: flex; flex-direction: column; background: var(--card); color: var(--ink); border-left: 1px solid var(--line); box-shadow: var(--shadow); }
.drw-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 1.1rem; border-bottom: 1px solid var(--line); }
.drw-head > div { display: flex; flex-direction: column; min-width: 0; }
.drw-head strong { font-size: 1.05rem; overflow-wrap: anywhere; }
.drw-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); }
.drw-side { display: flex; flex-direction: column; gap: .2rem; padding: .7rem; border-right: 1px solid var(--line); background: var(--soft); }
.drw-nav { text-align: left; background: none; border: 0; padding: .5rem .7rem; border-radius: 8px; font: inherit; font-size: .9rem; color: var(--muted); cursor: pointer; }
.drw-nav:hover { background: var(--card); color: var(--ink); }
.drw-nav.on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.drw-pane { overflow: auto; padding: 1rem 1.2rem 1.4rem; min-width: 0; }
.drw-title { font-size: 1.05rem; margin: 0 0 .6rem; }
.drw-h { font-size: .95rem; margin: 1.2rem 0 .4rem; }
.drw-row { display: flex; gap: .5rem; align-items: center; margin-top: .6rem; }
.drw-row input { flex: 1; min-width: 0; }
.drw-stack { display: flex; flex-direction: column; gap: .4rem; margin-top: .6rem; }
.drw-stack input[type=color] { width: 3rem; height: 2rem; padding: 0; border: 0; background: none; }
@media (max-width: 620px) {
  .drw-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .drw-side { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .drw-nav { white-space: nowrap; }
}

/* Services (page Équipe) */
.tech { margin-top: 1rem; }
.tech summary { cursor: pointer; font-weight: 600; }
.tech-grid { display: grid; grid-template-columns: minmax(8rem, max-content) minmax(0, 1fr); gap: .35rem 1rem; margin: .8rem 0 0; font-size: .92rem; }
.tech-grid dt { color: var(--muted); }
.tech-grid dd { margin: 0; overflow-wrap: anywhere; }

/* ── Navigation latérale (grand écran). Sur téléphone, la barre du haut reste utilisée. ── */
@media (min-width: 861px) {
  body:has(.top.side) { padding-left: 15rem; }
  .top.side {
    position: fixed; top: 0; left: 0; bottom: 0; width: 15rem; height: 100vh; overflow-y: auto; display: flex; flex-direction: column;
    align-items: stretch; gap: .2rem; margin: 0; padding: .3rem .8rem 1rem; background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none;
    border-bottom: 0; border-right: 1px solid var(--line); z-index: 20;
  }
  .top.side .brand { margin: 0 .4rem .9rem; }
  .top.side .brand .logo { height: 4.2rem; }
  .top.side nav { flex-direction: column; flex-wrap: nowrap; gap: .15rem; overflow: visible; justify-content: flex-start; justify-self: stretch; }
  .top.side nav a, .top.side .linkbtn { display: flex; align-items: center; gap: .65rem; width: 100%; text-align: left; padding: .5rem .75rem; font-size: .92rem; border-radius: var(--radius-sm); white-space: normal; overflow-wrap: anywhere; }
  .top.side nav a.on { box-shadow: inset 3px 0 0 var(--accent); }
  .top.side .nav-ico { margin-right: 0; }
  .top.side .theme-toggle { margin-top: auto; justify-self: stretch; text-align: center; }
  body:has(.top.side .acct) { padding-top: 3.2rem; }
  body:has(.top.side .acct) .top.side { top: 3.2rem; height: calc(100vh - 3.2rem); }
  .top.side .acct {
    position: fixed; top: 0; left: 0; right: 0; z-index: 21; height: 3.2rem; display: flex; flex-direction: row; align-items: center;
    justify-content: flex-end; gap: .6rem; padding: 0 1.2rem; background: var(--bg); border-bottom: 1px solid var(--line);
  }
  .top.side .me-chip { display: flex; align-items: center; gap: .5rem; margin: 0; padding: .15rem .55rem .15rem .15rem; font-size: .92rem; border-radius: 999px; }
  .top.side .linkbtn.logout { margin: 0; width: auto; padding: .4rem 1.2rem; text-align: center; }
}

/* ── Téléphone : barre du haut sur une ligne, menu défilant ── */
@media (max-width: 860px) {
  .top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: .3rem .5rem; padding: .4rem .6rem; }
  .top .brand { grid-column: 1; grid-row: 1; margin-right: 0; }
  .top .brand .logo { height: 1.3rem; }
  .top .acct { grid-column: 3; grid-row: 1; }
  .top .acct .me-chip .name { display: none; }
  .top .acct .me-chip { padding: 0; }
  .top .acct .linkbtn.logout { padding: .2rem .55rem; font-size: .75rem; }
  .top .theme-toggle { grid-column: 4; grid-row: 1; padding: .2rem .55rem; font-size: .75rem; }
  .top nav { grid-column: 1 / -1; grid-row: 2; flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; min-width: 0; }
  .top nav a, .top .linkbtn { padding: .2rem .45rem; font-size: .8rem; white-space: nowrap; }
}

/* Petits écrans : cartes et marges resserrées */
@media (max-width: 520px) {
  .card, .win, .fx-app { padding: 1.05rem; }
  .actions .btn { flex: 1 1 auto; }
}

/* Mouvement réduit respecté */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ── Lecteur média (SFTP) ── */
.mv-bg { position: fixed; inset: 0; z-index: 1200; display: flex; flex-direction: column; background: rgba(8, 10, 14, .92); color: #f2f4f8; }
.mv-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 1rem; }
.mv-name { display: flex; flex-direction: column; min-width: 0; }
.mv-title { overflow-wrap: anywhere; font-size: .95rem; }
.mv-name .muted { color: #aab3c2; }
.mv-ctl { display: flex; gap: .4rem; flex: 0 0 auto; }
.mv-ctl .fx-btn { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .18); color: #f2f4f8; font-size: 1.1rem; min-width: 2.2rem; height: 2.2rem; }
.mv-ctl .fx-btn:disabled { opacity: .35; }
.mv-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 0 1rem 1rem; }
.mv-stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.mv-stage video { max-width: 100%; max-height: 100%; background: #000; border-radius: 8px; }
.mv-audio { display: flex; flex-direction: column; align-items: center; gap: 1.5rem; width: min(560px, 100%); }
.mv-glyph { width: 9rem; height: 9rem; border-radius: 22px; display: grid; place-items: center; font-size: 4rem; background: linear-gradient(135deg, var(--accent), #1d2a44); color: #fff; }
.mv-audio audio { width: 100%; }
