/* Opsis — système de thèmes.
   Mode : html[data-mode="light|dark"] (sans attribut : suit Windows).
   Accent : html[data-accent="blue|teal|green|orange|pink|red|graphite"].
   Les composants ne lisent que les variables ci-dessous. */

:root {
  color-scheme: light;
  --bg: #f3f4f7;
  --bg-grad: radial-gradient(1200px 600px at 100% -10%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 60%);
  --surface: #ffffff;
  --surface-2: #f6f7f9;
  --fill: rgba(15, 23, 42, .055);
  --fill-2: rgba(15, 23, 42, .1);
  --sep: rgba(15, 23, 42, .08);
  --border: rgba(15, 23, 42, .07);
  --label: #10131a;
  --label-2: #4d5665;
  --label-3: #7b8494;
  --green: #15803d;
  --orange: #c2410c;
  --red: #dc2626;
  --ring-cpu: #f59e0b;
  --ring-mem: #3b82f6;
  --ring-disk: #10b981;
  --green-soft: rgba(22, 163, 74, .12);
  --orange-soft: rgba(234, 88, 12, .12);
  --red-soft: rgba(220, 38, 38, .1);
  --bar-bg: rgba(255, 255, 255, .72);
  --side-bg: #fbfbfc;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 2px 8px rgba(15, 23, 42, .04);
  --shadow-hover: 0 2px 4px rgba(15, 23, 42, .05), 0 10px 24px rgba(15, 23, 42, .08);
  --shadow-pop: 0 16px 48px rgba(15, 23, 42, .18), 0 0 0 1px rgba(15, 23, 42, .06);
  --r: 16px;
  --r-s: 10px;
  --font: "Segoe UI Variable Text", "Segoe UI Variable", "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-d: "Segoe UI Variable Display", "Segoe UI Variable", "Segoe UI", -apple-system, system-ui, sans-serif;
  --mono: "Cascadia Mono", Consolas, ui-monospace, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  /* accent par défaut : bleu */
  --accent: #2563eb; --accent-press: #1d4ed8; --on-accent: #fff;
}
:root { --blue-soft: color-mix(in srgb, var(--accent) 12%, transparent); --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent); }

/* ---- mode sombre : graphite profond ---- */
@media (prefers-color-scheme: dark) { :root:not([data-mode="light"]) { --is-dark: 1; } }
:root[data-mode="dark"] { --is-dark: 1; }
@media (prefers-color-scheme: dark) {
  :root:not([data-mode="light"]) {
    color-scheme: dark;
    --bg: #0a0c10; --surface: #12151b; --surface-2: #191d24;
    --fill: rgba(255, 255, 255, .06); --fill-2: rgba(255, 255, 255, .11); --sep: rgba(255, 255, 255, .07); --border: rgba(255, 255, 255, .07);
    --label: #eceef3; --label-2: #a7afbd; --label-3: #747d8c;
    --green: #34d399; --orange: #fb923c; --red: #f87171;
    --ring-cpu: #fbbf24; --ring-mem: #60a5fa; --ring-disk: #34d399;
    --green-soft: rgba(52, 211, 153, .14); --orange-soft: rgba(251, 146, 60, .15); --red-soft: rgba(248, 113, 113, .14);
    --bar-bg: rgba(10, 12, 16, .72); --side-bg: #0e1015;
    --shadow: 0 0 0 1px rgba(255, 255, 255, .04); --shadow-hover: 0 0 0 1px rgba(255, 255, 255, .08), 0 12px 32px rgba(0, 0, 0, .4);
    --shadow-pop: 0 20px 60px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .08);
    --accent: #5b9dff; --accent-press: #7cb1ff; --on-accent: #06101f;
  }
}
:root[data-mode="dark"] {
  color-scheme: dark;
  --bg: #0a0c10; --surface: #12151b; --surface-2: #191d24;
  --fill: rgba(255, 255, 255, .06); --fill-2: rgba(255, 255, 255, .11); --sep: rgba(255, 255, 255, .07); --border: rgba(255, 255, 255, .07);
  --label: #eceef3; --label-2: #a7afbd; --label-3: #747d8c;
  --green: #34d399; --orange: #fb923c; --red: #f87171;
  --ring-cpu: #fbbf24; --ring-mem: #60a5fa; --ring-disk: #34d399;
  --green-soft: rgba(52, 211, 153, .14); --orange-soft: rgba(251, 146, 60, .15); --red-soft: rgba(248, 113, 113, .14);
  --bar-bg: rgba(10, 12, 16, .72); --side-bg: #0e1015;
  --shadow: 0 0 0 1px rgba(255, 255, 255, .04); --shadow-hover: 0 0 0 1px rgba(255, 255, 255, .08), 0 12px 32px rgba(0, 0, 0, .4);
  --shadow-pop: 0 20px 60px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .08);
  --accent: #5b9dff; --accent-press: #7cb1ff; --on-accent: #06101f;
}

/* ---- accents (clair puis sombre) ---- */
:root[data-accent="teal"] { --accent: #0d9488; --accent-press: #0f766e; --on-accent: #fff; }
:root[data-accent="green"] { --accent: #16a34a; --accent-press: #15803d; --on-accent: #fff; }
:root[data-accent="orange"] { --accent: #ea580c; --accent-press: #c2410c; --on-accent: #fff; }
:root[data-accent="pink"] { --accent: #db2777; --accent-press: #be185d; --on-accent: #fff; }
:root[data-accent="red"] { --accent: #dc2626; --accent-press: #b91c1c; --on-accent: #fff; }
:root[data-accent="graphite"] { --accent: #334155; --accent-press: #1e293b; --on-accent: #fff; }
:root[data-mode="dark"][data-accent="teal"] { --accent: #2dd4bf; --accent-press: #5eead4; --on-accent: #042f2b; }
:root[data-mode="dark"][data-accent="green"] { --accent: #4ade80; --accent-press: #86efac; --on-accent: #052e14; }
:root[data-mode="dark"][data-accent="orange"] { --accent: #fb923c; --accent-press: #fdba74; --on-accent: #2a1204; }
:root[data-mode="dark"][data-accent="pink"] { --accent: #f472b6; --accent-press: #f9a8d4; --on-accent: #2b0618; }
:root[data-mode="dark"][data-accent="red"] { --accent: #f87171; --accent-press: #fca5a5; --on-accent: #2b0707; }
:root[data-mode="dark"][data-accent="graphite"] { --accent: #cbd5e1; --accent-press: #e2e8f0; --on-accent: #0a0c10; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--label);
  font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
svg.i { width: 20px; height: 20px; flex: none; fill: currentColor; }
svg.i.s { width: 16px; height: 16px; }
.secondary { color: var(--label-2); }
.tertiary { color: var(--label-3); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: 13px; }
.num, .v, .val, .table .r { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; border-radius: 8px; }

/* ---------- boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 0 16px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--fill); color: var(--accent); font-weight: 600; font-size: 14px;
  transition: transform .15s var(--ease), background .15s, opacity .15s;
  white-space: nowrap;
}
.btn:hover { background: var(--fill-2); transform: translateY(-1px); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-press); }
.btn-danger { color: var(--red); }
.btn-plain { background: transparent; padding: 0 10px; }
.btn-plain:hover { background: var(--fill); }
.btn-wide { width: 100%; min-height: 44px; font-size: 15px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 999px; border: 0; background: transparent; color: var(--accent);
  display: inline-grid; place-items: center; cursor: pointer; transition: background .15s, transform .15s var(--ease);
}
.icon-btn:hover { background: var(--fill); }
.icon-btn:active { transform: scale(.94); }
.busy svg.i { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- segmented control ---------- */
.seg { display: inline-flex; padding: 2px; border-radius: 9px; background: var(--fill); gap: 2px; }
.seg button {
  border: 0; background: transparent; padding: 5px 14px; min-height: 30px; border-radius: 7px; cursor: pointer;
  font-size: 13px; font-weight: 500; color: var(--label); transition: background .15s;
}
.seg button[aria-checked="true"] { background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); font-weight: 600; }
:root[data-mode="dark"] .seg button[aria-checked="true"] { background: #2b313b; }
.seg-small button { padding: 3px 12px; min-height: 28px; }

/* ---------- champs ---------- */
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--label-2); }
.field .hint { font-size: 12px; color: var(--label-3); }
.input {
  width: 100%; min-height: 44px; padding: 10px 14px; border-radius: var(--r-s);
  border: 1px solid var(--sep); background: var(--surface); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.check-row { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; font-size: 14px; }
.check-row input { width: 18px; height: 18px; accent-color: var(--accent); }
.field-error { color: var(--red); font-size: 13px; min-height: 18px; }
.field-error:empty { min-height: 0; }

/* interrupteur */
.switch { position: relative; width: 51px; height: 31px; flex: none; display: inline-block; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--fill-2); transition: background .2s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .2); transition: transform .2s var(--ease); }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }

/* ---------- écran d'accès ---------- */
.gate { min-height: 100%; display: grid; place-items: center; padding: 32px 16px; }
.gate-card {
  width: min(400px, 100%); background: var(--surface); border-radius: 24px; padding: 36px 32px 24px;
  box-shadow: var(--shadow-hover); border: 1px solid var(--border); display: grid; gap: 16px; text-align: center;
}
.gate-mark, .side-mark {
  display: block; margin: 0 auto 4px; width: 64px; height: 64px; border-radius: 15px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cg id='icon'%3E%3Crect width='512' height='512' rx='114' fill='%231C1C1E'/%3E%3Cg fill='none' stroke-width='60' stroke-linecap='round' transform='rotate(-90 256 256)'%3E%3Ccircle cx='256' cy='256' r='146' stroke='%23FF9F0A' stroke-dasharray='232 685' stroke-dashoffset='-27'/%3E%3Ccircle cx='256' cy='256' r='146' stroke='%230A84FF' stroke-dasharray='232 685' stroke-dashoffset='-333'/%3E%3Ccircle cx='256' cy='256' r='146' stroke='%2330D158' stroke-dasharray='232 685' stroke-dashoffset='-639'/%3E%3C/g%3E%3Ccircle id='pupil' cx='256' cy='256' r='46' fill='%23FFFFFF'/%3E%3C/g%3E%3C/svg%3E") center/100% no-repeat;
}
.gate h1 { font: 700 26px/1.2 var(--font-d); letter-spacing: -.01em; }
.gate-fields { display: grid; gap: 14px; text-align: left; margin-top: 8px; }
.gate-lang { justify-self: center; }
.gate-foot { font-size: 12px; }

/* ---------- coquille ---------- */
body { background: var(--bg-grad), var(--bg); background-attachment: fixed; }
.app { display: grid; grid-template-columns: 252px 1fr; min-height: 100%; transition: grid-template-columns .25s var(--ease); }
.app.collapsed { grid-template-columns: 76px 1fr; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px;
  padding: 16px 12px 12px; background: var(--side-bg); border-right: 1px solid var(--border); overflow: hidden;
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 2px 6px 14px; min-height: 48px; }
.side-mark { width: 30px; height: 30px; border-radius: 8px; margin: 0; flex: none; }
.brand-name { font: 700 18px var(--font-d); letter-spacing: -.02em; flex: 1; white-space: nowrap; }
.side-collapse { color: var(--label-3); width: 32px; height: 32px; }
.side-nav { flex: 1; overflow-y: auto; overflow-x: hidden; display: grid; align-content: start; gap: 2px; margin: 0 -4px; padding: 0 4px; }
.side-group { font-size: 11.5px; font-weight: 600; color: var(--label-3); padding: 14px 10px 6px; white-space: nowrap; letter-spacing: .02em; }
.side-group:first-child { padding-top: 2px; }
.side-nav a {
  position: relative; display: flex; align-items: center; gap: 11px; min-height: 38px; padding: 0 10px; border-radius: 10px;
  color: var(--label-2); font-weight: 500; font-size: 14px; text-decoration: none; white-space: nowrap;
  transition: background .15s, color .15s;
}
.side-nav a svg.i { width: 20px; height: 20px; color: var(--label-3); transition: color .15s; }
.side-nav a:hover { background: var(--fill); color: var(--label); }
.side-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--label); font-weight: 600; }
.side-nav a[aria-current="page"] svg.i { color: var(--accent); }
.side-nav a[aria-current="page"]::before { content: ""; position: absolute; left: -4px; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: var(--accent); }
.side-nav .badge { margin-left: auto; }
.side-foot { display: flex; align-items: center; gap: 4px; padding-top: 10px; border-top: 1px solid var(--border); }
.side-foot .account-btn { flex: 1; min-width: 0; justify-content: flex-start; gap: 10px; padding: 6px; border-radius: 12px; }
.side-foot .account-btn:hover { background: var(--fill); }
.who-mini { display: grid; text-align: left; min-width: 0; line-height: 1.25; }
.who-mini b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-mini span { font-size: 12px; color: var(--label-3); white-space: nowrap; }
#mode-btn { color: var(--label-2); }
.app.collapsed .brand-name, .app.collapsed .side-group, .app.collapsed .side-nav a span, .app.collapsed .who-mini, .app.collapsed #mode-btn { display: none; }
.app.collapsed .side-brand { flex-direction: column; gap: 8px; padding-bottom: 8px; }
.app.collapsed .side-nav a { justify-content: center; padding: 0; }
.app.collapsed .side-nav .badge { display: none; }
.app.collapsed .side-group + a, .app.collapsed a + .side-group { margin-top: 0; }
.app.collapsed .side-foot { justify-content: center; }
.app.collapsed .side-foot .account-btn { flex: none; justify-content: center; }

.main { min-width: 0; display: flex; flex-direction: column; }
.toolbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 14px;
  min-height: 76px; padding: 14px 36px; background: var(--bar-bg);
  backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.toolbar.scrolled { border-bottom-color: var(--border); }
.toolbar-heading { margin-right: auto; min-width: 0; }
.toolbar-title { font: 700 26px/1.15 var(--font-d); letter-spacing: -.025em; }
.toolbar-sub { font-size: 13.5px; color: var(--label-3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toolbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.mobile-mark, .account-btn.mobile-account { display: none; }
.account-btn { border: 0; background: transparent; padding: 4px; border-radius: 999px; cursor: pointer; min-height: 44px; display: flex; align-items: center; color: inherit; }
.avatar {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none;
  background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 13px;
}
.content { padding: 6px 36px 56px; max-width: 1240px; width: 100%; outline: none; }
.tabbar { display: none; }

/* sélecteur d'apparence */
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch {
  width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer; position: relative;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); transition: transform .15s var(--ease);
}
.swatch:hover { transform: scale(1.08); }
.swatch[aria-checked="true"]::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--label); }
.mode-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mode-card {
  border: 1.5px solid var(--sep); border-radius: 14px; background: var(--surface); padding: 10px; cursor: pointer; display: grid; gap: 8px;
  text-align: left; font-weight: 600; font-size: 13.5px; transition: border-color .15s;
}
.mode-card[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.mode-card .mini { height: 56px; border-radius: 9px; display: grid; grid-template-columns: 26% 1fr; overflow: hidden; border: 1px solid rgba(0, 0, 0, .08); }
.mini.l { background: #f3f4f7; } .mini.l i:first-child { background: #fff; }
.mini.d { background: #0a0c10; } .mini.d i:first-child { background: #12151b; }
.mini.a { background: linear-gradient(90deg, #f3f4f7 50%, #0a0c10 50%); } .mini.a i:first-child { background: linear-gradient(180deg, #fff 50%, #12151b 50%); }
.mini i { display: block; }
.mini i:last-child { margin: 10px; border-radius: 5px; background: var(--accent); opacity: .85; height: 10px; width: 50%; }
.folder-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.folder-row .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 14px; }
.sugg { display: flex; flex-wrap: wrap; gap: 6px; }
.sugg button { border: 1px dashed var(--fill-2); background: transparent; color: var(--label-2); border-radius: 999px; padding: 4px 12px; font-size: 12.5px; cursor: pointer; min-height: 30px; }
.sugg button:hover { border-color: var(--accent); color: var(--accent); }

/* USB */
.drive-card { padding: 18px 18px 14px; display: grid; gap: 12px; transition: box-shadow .2s, transform .2s var(--ease); }
.drive-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.drive-head { display: flex; gap: 12px; align-items: center; }
.drive-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.drive-ico svg.i { width: 24px; height: 24px; }
.drive-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 14px; }
.crumbs button { border: 0; background: transparent; color: var(--accent); font-weight: 600; cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.crumbs button:hover { background: var(--fill); }
.crumbs .sep { color: var(--label-3); }
.crumbs .here { font-weight: 600; padding: 4px 6px; }
.thumb { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex: none; background: var(--fill); }
.empty-hero { padding: 48px 20px; text-align: center; display: grid; justify-items: center; gap: 8px; }
.empty-hero .big-ico { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 6px; }
.empty-hero .big-ico svg.i { width: 34px; height: 34px; }
.empty-hero b { font-size: 17px; }
.pulse { animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }

/* ---------- blocs ---------- */
.section { margin-top: 28px; }
.section:first-child { margin-top: 12px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 0 4px 8px; flex-wrap: wrap; }
.section-head h2 { font: 650 18px/1.3 var(--font-d); letter-spacing: -.01em; }
.section-head .secondary { font-size: 13px; }
.group { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); border: 1px solid var(--border); overflow: hidden; }
:root[data-mode="dark"] .group { border-color: transparent; }
.group.pad { padding: 18px 20px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* lignes de liste groupée */
.row { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 10px 16px; position: relative; }
.row + .row::before, .row + details > summary.row::before, details + .row::before, details + details > summary.row::before {
  content: ""; position: absolute; top: 0; left: 56px; right: 0; border-top: 1px solid var(--sep);
}
.rows-plain .row + .row::before { left: 16px; }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 500; }
.row .sub { font-size: 13px; color: var(--label-2); overflow-wrap: anywhere; }
.row .val { color: var(--label-2); text-align: right; font-size: 14px; }
.row .trail { display: flex; align-items: center; gap: 8px; flex: none; }
.row.tap { cursor: pointer; transition: background .12s; width: 100%; border: 0; background: transparent; text-align: left; }
.row.tap:hover { background: var(--fill); }
.row .chev { color: var(--label-3); }
.tile { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; flex: none; color: #fff; }
.tile svg.i { width: 18px; height: 18px; }
.t-blue { background: #007aff; } .t-green { background: #34c759; } .t-orange { background: #ff9500; }
.t-red { background: #ff3b30; } .t-gray { background: #8e8e93; } .t-teal { background: #30b0c7; } .t-indigo { background: #5856d6; }

.status-ico.ok { color: var(--green); } .status-ico.warn { color: var(--orange); }
.status-ico.bad { color: var(--red); } .status-ico.unknown { color: var(--label-3); }
.status-ico svg.i { width: 26px; height: 26px; }

.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--fill); color: var(--label-2);
}
.badge.ok { background: var(--green-soft); color: var(--green); }
.badge.warn { background: var(--orange-soft); color: var(--orange); }
.badge.bad { background: var(--red-soft); color: var(--red); }
.badge.info { background: var(--blue-soft); color: var(--accent); }

.empty { padding: 28px 20px; text-align: center; color: var(--label-2); font-size: 14px; }
.empty b { display: block; color: var(--label); font-size: 15px; margin-bottom: 4px; }

/* ---------- santé : anneaux ---------- */
.hero { display: grid; grid-template-columns: auto 1fr; gap: 32px; align-items: center; padding: 26px 28px; }
.rings { position: relative; width: 196px; height: 196px; }
.rings svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.rings circle { fill: none; stroke-width: 18; stroke-linecap: round; }
.rings .track { opacity: .2; }
.rings .arc { transition: stroke-dashoffset .9s var(--ease); }
.rings-center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.rings-center b { font: 700 30px/1 var(--font-d); display: block; }
.rings-center span { font-size: 12px; color: var(--label-2); }
.hero h2 { font: 700 28px/1.15 var(--font-d); letter-spacing: -.015em; }
.hero .lead { color: var(--label-2); margin-top: 6px; }
.legend { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 18px; }
.legend div { display: grid; gap: 1px; }
.legend .k { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--label-2); }
.legend .k i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.legend .v { font: 600 22px/1.2 var(--font-d); }
.legend .v small { font-size: 13px; font-weight: 500; color: var(--label-2); }
.reasons { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 6px; }
.reasons li { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
.reasons li svg { margin-top: 1px; }
.reasons .warn { color: var(--orange); } .reasons .ok { color: var(--green); }

.metric { padding: 16px 18px 12px; display: grid; gap: 4px; }
.metric .k { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--label-2); }
.metric .v { font: 600 26px/1.15 var(--font-d); }
.metric .v small { font-size: 13px; font-weight: 500; color: var(--label-2); }
.metric canvas { width: 100%; height: 44px; display: block; margin-top: 4px; }
.metric .sub { font-size: 12px; color: var(--label-3); }

.chart-box { padding: 14px 18px 12px; }
.chart-box canvas { width: 100%; height: 220px; display: block; }
.chart-legend { display: flex; gap: 18px; font-size: 12px; color: var(--label-2); margin-top: 6px; flex-wrap: wrap; }
.chart-legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }

.meter { height: 6px; border-radius: 999px; background: var(--fill); overflow: hidden; margin-top: 6px; }
.meter i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .6s var(--ease); }
.meter.warn i { background: var(--orange); } .meter.bad i { background: var(--red); }

/* tables */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--label-2); padding: 10px 16px 6px; }
.table td { padding: 10px 16px; border-top: 1px solid var(--sep); vertical-align: top; }
.table .r { text-align: right; white-space: nowrap; }
.table .sub { display: block; font-size: 12px; color: var(--label-3); overflow-wrap: anywhere; }
.table-wrap { overflow-x: auto; }

details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
details[open] > summary .chev { transform: rotate(90deg); }
details > summary .chev { transition: transform .2s var(--ease); }
details.more ul { margin: 0; padding: 4px 16px 14px 56px; font-size: 13px; color: var(--label-2); display: grid; gap: 4px; }

/* ---------- sécurité ---------- */
.shield-hero { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; padding: 24px 28px; }
.shield-big { width: 92px; height: 92px; border-radius: 26px; display: grid; place-items: center; color: #fff; }
.shield-big svg.i { width: 54px; height: 54px; }
.shield-big.ok { background: linear-gradient(180deg, #34c759, #248a3d); }
.shield-big.warn { background: linear-gradient(180deg, #ffb340, #f08c00); }
.shield-big.bad { background: linear-gradient(180deg, #ff6961, #e0352b); }
.shield-hero h2 { font: 700 26px/1.15 var(--font-d); }
.shield-hero .score { font-size: 15px; color: var(--label-2); margin-top: 4px; }
.check-detail { padding: 0 16px 14px 56px; font-size: 13px; color: var(--label-2); display: grid; gap: 8px; }
.fix { background: var(--blue-soft); color: var(--label); border-radius: var(--r-s); padding: 10px 12px; font-size: 13px; }
.fix b { color: var(--accent); }
.filter-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--sep); flex-wrap: wrap; }
.change-sign { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; flex: none; }
.change-sign.added { background: var(--green-soft); color: var(--green); }
.change-sign.removed { background: var(--red-soft); color: var(--red); }

/* ---------- fichiers ---------- */
.search-box { position: relative; }
.search-box svg.i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--label-3); }
.search-box input {
  width: 100%; min-height: 48px; padding: 12px 16px 12px 44px; border-radius: 12px; border: 0;
  background: var(--fill); font-size: 17px; outline: none; transition: box-shadow .15s, background .15s;
}
.search-box input:focus { background: var(--surface); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent), var(--shadow); }
.search-hint { font-size: 13px; color: var(--label-3); margin: 8px 4px 0; }
.search-hint code { font-family: var(--mono); font-size: 12px; background: var(--fill); padding: 1px 5px; border-radius: 5px; color: var(--label-2); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 999px;
  border: 0; background: var(--surface); box-shadow: var(--shadow); cursor: pointer; font-size: 14px; font-weight: 500;
  transition: background .15s, color .15s, transform .15s var(--ease);
}
:root[data-mode="dark"] .chip { background: var(--surface-2); }
.chip:hover { transform: translateY(-1px); }
.chip:active { transform: scale(.97); }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.understood { font-size: 13px; color: var(--label-2); }
.hit-ico { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; flex: none; color: #fff; }
.hit-ico svg.i { width: 19px; height: 19px; }
.k-photo { background: #ff9500; } .k-video { background: #ff2d55; } .k-pdf { background: #ff3b30; }
.k-document { background: #007aff; } .k-tableur { background: #34c759; } .k-presentation { background: #ff9f0a; }
.k-archive { background: #8e8e93; } .k-code { background: #5856d6; } .k-audio { background: #af52de; } .k-autre { background: #8e8e93; }
.snip { font-size: 13px; color: var(--label-2); margin-top: 3px; overflow-wrap: anywhere; }
.snip mark { background: color-mix(in srgb, var(--ring-cpu) 35%, transparent); color: inherit; border-radius: 3px; padding: 0 2px; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.ph { position: relative; aspect-ratio: 1; border: 0; padding: 0; border-radius: 10px; overflow: hidden; cursor: pointer; background: var(--fill); display: block; }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s var(--ease); }
.ph:hover img { transform: scale(1.03); }
.ph span { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 6px; font-size: 12px; color: #fff; text-align: left; background: linear-gradient(transparent, rgba(0, 0, 0, .55)); }
.ph .noprev { display: grid; place-items: center; height: 100%; color: var(--label-3); font-weight: 700; }
.bar-stack { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--fill); margin: 4px 0 14px; }
.bar-stack i { display: block; height: 100%; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.months { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding: 8px 4px 0; overflow-x: auto; }
.month { flex: 1 0 28px; min-width: 28px; height: 100%; border: 0; background: transparent; cursor: pointer; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 2px; padding: 0; border-radius: 6px; }
.month:hover { background: var(--fill); }
.month i { width: 70%; border-radius: 4px 4px 0 0; background: var(--ring-cpu); min-height: 2px; }
.month i.vid { background: #ff2d55; border-radius: 4px; min-height: 0; }
.month small { font-size: 11px; color: var(--label-3); padding-top: 4px; white-space: nowrap; }

/* ---------- accès ---------- */
.role-pick { display: grid; gap: 8px; }
.role-opt {
  position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; cursor: pointer;
  border: 1.5px solid var(--sep); background: var(--surface); text-align: left; transition: border-color .15s, background .15s;
}
.role-opt:hover { background: var(--fill); }
.role-opt input { position: absolute; opacity: 0; pointer-events: none; }
.role-opt:has(input:checked) { border-color: var(--accent); background: var(--blue-soft); }
.role-opt:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }
.role-opt b { display: block; font-size: 14px; }
.role-opt span { font-size: 13px; color: var(--label-2); }
.perm-dots { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }

/* ---------- popover, feuille, toast ---------- */
.popover {
  position: fixed; z-index: 30; bottom: 76px; left: 14px; width: 300px; background: var(--surface);
  border-radius: 14px; box-shadow: var(--shadow-pop); padding: 6px; animation: pop .18s var(--ease);
}
:root[data-mode="dark"] .popover { background: var(--surface-2); }
.popover .who { padding: 12px 12px 10px; border-bottom: 1px solid var(--sep); margin-bottom: 4px; }
.popover .who b { display: block; }
.popover .line { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; min-height: 44px; }
.popover .menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 12px; border: 0;
  border-radius: 8px; background: transparent; cursor: pointer; text-align: left; font-size: 14px;
}
.popover .menu-item:hover { background: var(--fill); }
.popover .menu-item.danger { color: var(--red); }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }

.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .32); animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: fixed; z-index: 41; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(520px, calc(100% - 32px)); max-height: calc(100% - 48px); overflow: auto;
  background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-pop); animation: sheet .25s var(--ease);
}
:root[data-mode="dark"] .sheet { background: var(--surface-2); }
:root[data-mode="dark"] .sheet .input, :root[data-mode="dark"] .sheet .role-opt { background: var(--surface); }
@keyframes sheet { from { opacity: 0; transform: translate(-50%, -46%) scale(.98); } }
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--sep); position: sticky; top: 0; background: inherit; z-index: 2; }
.sheet-head h2 { flex: 1; text-align: center; font-size: 17px; font-weight: 600; }
.sheet-head .btn { min-width: 84px; min-height: 40px; }
.sheet-body { padding: 18px 20px 22px; display: grid; gap: 16px; }
.sheet-body .danger-zone { border-top: 1px solid var(--sep); padding-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; }
.sheet-body .line { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }

#toast {
  position: fixed; z-index: 60; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: rgba(30, 30, 32, .94); color: #fff; padding: 12px 18px; border-radius: 14px; font-size: 14px;
  max-width: min(520px, calc(100% - 32px)); box-shadow: var(--shadow-pop); transition: opacity .2s, transform .25s var(--ease);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.err { background: rgba(200, 0, 20, .95); }

.live-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--label-2); }
.live-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--label-3); }
.live-dot.on::before { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }

.skeleton { background: linear-gradient(90deg, var(--fill) 0%, var(--fill-2) 50%, var(--fill) 100%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--r); min-height: 120px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .app, .app.collapsed { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .toolbar { padding: 10px 16px; min-height: 60px; gap: 10px; }
  .mobile-mark, .account-btn.mobile-account { display: flex; }
  .mobile-mark { width: 28px; height: 28px; }
  .toolbar-title { font-size: 21px; }
  .toolbar-sub { display: none; }
  .content { padding: 4px 16px calc(96px + env(safe-area-inset-bottom)); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 22px 18px; }
  .hero .legend { justify-content: center; }
  .reasons li { text-align: left; }
  .shield-hero { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border);
    background: var(--bar-bg); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  }
  .tabbar a, .tabbar button {
    flex: 1; display: grid; justify-items: center; gap: 2px; min-height: 50px; padding-top: 4px; border: 0; background: none; cursor: pointer;
    color: var(--label-3); font-size: 11px; font-weight: 500; text-decoration: none;
  }
  .tabbar svg.i { width: 25px; height: 25px; }
  .tabbar [aria-current="page"] { color: var(--accent); }
  .popover { right: 12px; left: 12px; width: auto; top: 64px; bottom: auto; }
  .sheet { top: auto; bottom: 0; transform: translateX(-50%); width: 100%; border-radius: 18px 18px 0 0; max-height: 92%; animation: sheet-up .3s var(--ease); }
  .photos { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 3px; }
  .hide-s { display: none; }
  .mode-cards { grid-template-columns: 1fr 1fr 1fr; }
}
@keyframes sheet-up { from { transform: translate(-50%, 100%); } }
@media (max-width: 520px) {
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .gate-card { padding: 28px 20px 20px; }
  .metric .v { font-size: 22px; }
  .toolbar-actions .lbl { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media (prefers-contrast: more) {
  :root { --sep: rgba(60, 60, 67, .45); --label-2: rgba(60, 60, 67, .92); --label-3: rgba(60, 60, 67, .8); }
}
.snip { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }

/* ---------- assistant ---------- */
.chat { display: flex; flex-direction: column; min-height: calc(100vh - 150px); max-width: 860px; margin: 0 auto; }
.msgs { flex: 1; display: flex; flex-direction: column; gap: 14px; padding: 16px 0 8px; }
.msg { max-width: 88%; line-height: 1.55; font-size: 15px; overflow-wrap: anywhere; }
.msg.user { align-self: flex-end; background: var(--accent); color: var(--on-accent); padding: 10px 15px; border-radius: 18px 18px 4px 18px; white-space: pre-wrap; }
.msg.bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); padding: 12px 16px; border-radius: 18px 18px 18px 4px; box-shadow: var(--shadow); }
.msg.bot p { margin: 0 0 8px; } .msg.bot p:last-child { margin-bottom: 0; }
.msg.bot .md-h { font-weight: 700; margin-top: 6px; }
.msg.bot ul, .msg.bot ol { margin: 4px 0 8px; padding-left: 22px; } .msg.bot li { margin: 2px 0; }
.msg.bot code { font-family: var(--mono); font-size: 13px; background: var(--fill); padding: 1px 5px; border-radius: 5px; }
.msg.bot pre { background: var(--fill); padding: 10px 12px; border-radius: 10px; overflow-x: auto; margin: 6px 0; }
.msg.bot pre code { background: none; padding: 0; }
.used { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--label-3); animation: blink 1.2s infinite both; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.chat-hello { margin: auto 0; text-align: center; display: grid; justify-items: center; gap: 8px; padding: 30px 0; }
.chat-hello .big-ico { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.chat-hello .big-ico svg.i { width: 34px; height: 34px; }
.chat-hello h2 { font: 700 24px/1.2 var(--font-d); letter-spacing: -.02em; margin-top: 6px; }
.sugg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; width: 100%; margin-top: 14px; }
.sugg-card { text-align: left; border: 1px solid var(--border); background: var(--surface); border-radius: 14px; padding: 12px 14px; cursor: pointer; font-size: 14px; color: var(--label); transition: border-color .15s, transform .15s var(--ease), box-shadow .15s; }
.sugg-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.composer { position: sticky; bottom: 0; padding: 14px 0 18px; background: linear-gradient(transparent, var(--bg) 35%); }
.composer-box { display: flex; gap: 8px; align-items: flex-end; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 8px 8px 8px 16px; box-shadow: var(--shadow-hover); }
.composer-box:focus-within { border-color: var(--accent); }
.composer textarea { flex: 1; border: 0; background: transparent; resize: none; max-height: 160px; outline: none; padding: 9px 0; font-size: 15px; line-height: 1.4; color: var(--label); }
.send { width: 42px; height: 42px; border-radius: 14px; border: 0; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; cursor: pointer; flex: none; transition: transform .15s var(--ease); }
.send:active { transform: scale(.94); } .send.stop { background: var(--label); color: var(--bg); }
@media (max-width: 860px) { .composer { bottom: calc(64px + env(safe-area-inset-bottom)); } .chat { min-height: calc(100vh - 200px); } .msg { max-width: 94%; } }

.steps { margin: 14px 0 6px; padding-left: 0; list-style: none; counter-reset: st; display: grid; gap: 14px; }
.steps li { counter-increment: st; position: relative; padding-left: 40px; }
.steps li::before { content: counter(st); position: absolute; left: 0; top: -1px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 14px; }

.ph-play { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, .55); color: #fff; }
.thumb.noprev { display: grid; place-items: center; font-size: 10px; font-weight: 700; color: var(--label-3); }

/* sélection multiple */
.selecting .ph, .selecting [data-hit], .selecting [data-photo] { cursor: pointer; }
.selecting .ph::after { content: ""; position: absolute; top: 8px; left: 8px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; background: rgba(0, 0, 0, .25); box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.selecting .ph.picked { outline: 3px solid var(--accent); outline-offset: -3px; }
.selecting .ph.picked::after { background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/14px no-repeat; border-color: var(--accent); }
.selecting .row.picked { background: var(--accent-soft); }
.sel-bar {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 25; display: flex; align-items: center; gap: 8px;
  width: min(720px, calc(100% - 24px)); padding: 10px 12px 10px 18px; border-radius: 18px; background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow-pop); flex-wrap: wrap; animation: pop .2s var(--ease);
}
@media (max-width: 860px) { .sel-bar { bottom: calc(74px + env(safe-area-inset-bottom)); } }

/* gestionnaire de dossiers */
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
.fo-tile { position: relative; display: grid; justify-items: center; gap: 6px; padding: 12px 8px 10px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); cursor: pointer; text-align: center; transition: transform .15s var(--ease), box-shadow .15s, border-color .15s; user-select: none; }
.fo-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.fo-thumb { width: 100%; aspect-ratio: 4 / 3; border-radius: 10px; object-fit: cover; display: grid; place-items: center; background: var(--fill); }
.fo-thumb svg.i { width: 40px; height: 40px; }
.fo-thumb.noprev, .thumb.noprev { display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--label-3); }
.fo-dir { background: var(--accent-soft); color: var(--accent); }
.fo-kind { width: 52px; height: 52px; border-radius: 13px; }
.fo-kind svg.i { width: 26px; height: 26px; }
.fo-name { font-size: 13px; font-weight: 500; line-height: 1.25; max-width: 100%; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.fo-meta { font-size: 11.5px; color: var(--label-3); min-height: 14px; }
.fo-check { position: absolute; top: 8px; left: 8px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--label-3); background: var(--surface); opacity: 0; transition: opacity .15s; z-index: 1; }
.fo-row .fo-check { position: static; opacity: .5; flex: none; }
.fo-tile:hover .fo-check, .fo-tile:focus-within .fo-check, .picked .fo-check, .fo-row:hover .fo-check { opacity: 1; }
.picked .fo-check { background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/14px no-repeat; border-color: var(--accent); }
.fo-tile.picked { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.fo-row.picked { background: var(--accent-soft); }
.drop-on { outline: 3px dashed var(--accent) !important; outline-offset: 2px; background: var(--accent-soft) !important; }
#content.dropping { outline: 3px dashed var(--accent); outline-offset: -6px; border-radius: 16px; background: var(--accent-soft); }
.up-panel { position: fixed; right: 18px; bottom: 18px; z-index: 26; width: min(340px, calc(100% - 36px)); display: grid; gap: 8px; }
.up-item { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow-pop); animation: pop .2s var(--ease); }
.up-row { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; }
@media (max-width: 860px) { .up-panel { bottom: calc(80px + env(safe-area-inset-bottom)); } .fgrid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; } }

/* alertes : groupes */
.tg-group { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--label-2); margin: 16px 4px 6px; text-transform: none; }

/* WireGuard : dépôt du .conf */
.drop-conf { display: flex; gap: 14px; align-items: center; padding: 18px; border: 2px dashed var(--border); cursor: pointer; transition: border-color .15s, background .15s; }
.drop-conf:hover, .drop-conf:focus-visible { border-color: var(--accent); }
.drop-conf > svg.i { width: 28px; height: 28px; color: var(--accent); flex: none; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }

/* assistant d'accès à distance */
.wz-head { display: flex; align-items: center; justify-content: space-between; min-height: 36px; }
.wz-q { font-size: 17px; font-weight: 600; margin: 6px 0 14px; }
.wz-list { display: grid; gap: 10px; }
.wz-card { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); color: inherit; font: inherit; cursor: pointer; transition: border-color .15s, transform .15s var(--ease), box-shadow .15s; }
.wz-card:hover, .wz-card:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.wz-card:active { transform: scale(.99); }
.wz-card .badge { margin-left: 6px; vertical-align: 1px; }
.wz-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.wz-steps li { display: flex; gap: 12px; align-items: flex-start; color: var(--label-3); }
.wz-steps li.ok, .wz-steps li.active { color: var(--label); }
.wz-steps .dot { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border); flex: none; display: grid; place-items: center; }
.wz-steps li.ok .dot { background: var(--green); border-color: var(--green); color: #fff; }
.wz-steps li.active .dot { border-color: var(--accent); border-top-color: transparent; animation: spin 1s linear infinite; }
.wz-extra { margin-top: 8px; display: grid; gap: 6px; justify-items: start; }
.wz-done { display: flex; gap: 14px; align-items: flex-start; margin-top: 16px; padding: 14px; border-radius: 14px; background: var(--accent-soft); }
.wz-done img { border-radius: 10px; background: #fff; padding: 4px; flex: none; }
.wz-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.callout { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--fill); margin-top: 12px; font-size: 14px; }
.callout > svg.i { flex: none; color: var(--accent); }
.callout.bad { background: var(--red-soft); } .callout.bad > svg.i { color: var(--red); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .wz-steps li.active .dot { animation: none; border-top-color: var(--accent); } }
