/* ==========================================================================
   Soute : feuille de style
   Jetons en trois couches : primitifs → sémantiques → composants.
   ========================================================================== */

@font-face { font-family: 'Bricolage'; src: url('/fonts/bricolage/bricolage-grotesque-latin-wght-normal.woff2') format('woff2-variations'); font-weight: 200 800; font-display: swap; }
@font-face { font-family: 'Bricolage'; src: url('/fonts/bricolage/bricolage-grotesque-latin-ext-wght-normal.woff2') format('woff2-variations'); font-weight: 200 800; font-display: swap; unicode-range: U+0100-024F, U+1E00-1EFF; }
@font-face { font-family: 'Figtree'; src: url('/fonts/figtree/figtree-latin-wght-normal.woff2') format('woff2-variations'); font-weight: 300 900; font-display: swap; }
@font-face { font-family: 'Figtree'; src: url('/fonts/figtree/figtree-latin-ext-wght-normal.woff2') format('woff2-variations'); font-weight: 300 900; font-display: swap; unicode-range: U+0100-024F, U+1E00-1EFF; }

/* ---------- 1. Primitifs ---------- */
:root {
  --ink-900: #191A38; --ink-700: #3A3C66; --ink-500: #62658F; --ink-300: #B9BBD6; --ink-150: #DCDDEC; --ink-100: #E9EAF4;
  --paper: #F3F3F9; --white: #FFFFFF;
  --cobalt-700: #2439B8; --cobalt-600: #3450E0; --cobalt-500: #4C68F5; --cobalt-100: #E1E6FF; --cobalt-50: #F0F3FF;
  --sun-400: #FFC93C; --sun-300: #FFDB7A;
  --mint-500: #13A883; --coral-500: #FF6B4A; --grape-500: #8C5CF0; --sky-500: #2F9BEA;
  --cherry-600: #D92A45; --cherry-100: #FFE3E7; --bark-500: #B7802A; --slate-400: #8D90AE;
  --night-950: #120E22; --night-900: #1B1631; --night-850: #221C3C; --night-800: #2B2449; --night-700: #3C3363;
  --night-400: #9A91C4; --night-200: #DAD4F4; --rose-500: #FF4F8B; --rose-300: #FF9DBF; --rose-900: #3A1330;

  --font-display: 'Bricolage', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Figtree', 'Segoe UI', system-ui, -apple-system, sans-serif;

  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-8: 32px;
  --r-sm: 8px; --r-md: 12px; --r-lg: 18px; --r-xl: 26px; --r-pill: 999px;
  --t-fast: 140ms; --t-med: 220ms; --ease: cubic-bezier(.2, .8, .2, 1);
  --bw: 2px;
}

/* ---------- 2. Sémantiques : thème invité (clair) ---------- */
[data-theme="guest"] {
  --bg: var(--paper);
  --surface: var(--white);
  --surface-2: #F8F8FC;
  --surface-sunk: var(--ink-100);
  --text: var(--ink-900);
  --text-muted: var(--ink-500);
  --line: var(--ink-900);
  --line-soft: var(--ink-150);
  --primary: var(--cobalt-600);
  --primary-hover: var(--cobalt-700);
  --on-primary: var(--white);
  --primary-soft: var(--cobalt-100);
  --primary-wash: var(--cobalt-50);
  --accent: var(--sun-400);
  --danger: var(--cherry-600);
  --danger-soft: var(--cherry-100);
  --focus: var(--cobalt-500);
  --shadow-hard: 3px 3px 0 var(--ink-900);
  --shadow-hard-sm: 2px 2px 0 var(--ink-900);
  --overlay: rgba(25, 26, 56, .45);
  color-scheme: light;
}

/* ---------- 2 bis. Sémantiques : thème Admin (sombre, rose) ---------- */
[data-theme="admin"] {
  --bg: var(--night-950);
  --surface: var(--night-900);
  --surface-2: var(--night-850);
  --surface-sunk: var(--night-800);
  --text: #F3F0FF;
  --text-muted: var(--night-400);
  --line: #07050F;
  --line-soft: var(--night-700);
  --primary: var(--rose-500);
  --primary-hover: var(--rose-300);
  --on-primary: #1A0712;
  --primary-soft: var(--rose-900);
  --primary-wash: #231530;
  --accent: var(--sun-400);
  --danger: #FF5A6E;
  --danger-soft: #3A1220;
  --focus: var(--rose-300);
  --shadow-hard: 3px 3px 0 var(--rose-500);
  --shadow-hard-sm: 2px 2px 0 var(--rose-500);
  --overlay: rgba(5, 3, 12, .65);
  color-scheme: dark;
}

/* ---------- 3. Composants ---------- */
:root {
  --panel-radius: var(--r-lg);
  --item-radius: var(--r-md);
  --btn-radius: var(--r-md);
  --btn-h: 40px;
  --topbar-h: 64px;
  --sidebar-w: 264px;
  --tile-w: 124px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 var(--font-body); -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.ic { width: 20px; height: 20px; flex: none; display: block; }
.ic.sm { width: 16px; height: 16px; }
.ic.lg { width: 26px; height: 26px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; border: var(--bw) solid var(--line); border-radius: var(--r-sm); }
.skip:focus { left: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -.01em; margin: 0; line-height: 1.15; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: var(--btn-h); padding: 0 var(--sp-4); border-radius: var(--btn-radius);
  border: var(--bw) solid var(--line); background: var(--surface); color: var(--text);
  font-weight: 600; box-shadow: var(--shadow-hard-sm); white-space: nowrap;
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), background var(--t-fast);
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translate(2px, 2px); box-shadow: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.primary { background: var(--primary); color: var(--on-primary); }
.btn.primary:hover { background: var(--primary-hover); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.ghost { border-color: transparent; box-shadow: none; background: transparent; }
.btn.ghost:hover { background: var(--surface-sunk); }
.btn.icon { padding: 0; width: var(--btn-h); }
.btn.sm { --btn-h: 32px; padding: 0 var(--sp-3); font-size: 14px; }
.btn.icon.sm { width: 32px; padding: 0; }
.btn[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); }

.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: 14px; }
.field .hint { font-size: 13px; color: var(--text-muted); }
.field .err { font-size: 13px; color: var(--danger); font-weight: 600; min-height: 0; }
.input {
  width: 100%; min-height: 44px; padding: 0 var(--sp-3); border-radius: var(--r-md);
  border: var(--bw) solid var(--line); background: var(--surface); color: var(--text);
}
.input:focus { outline: none; box-shadow: 0 0 0 3px var(--focus); }
.input[aria-invalid="true"] { border-color: var(--danger); }

/* ---------- Écran de profils ---------- */
#gate {
  position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: var(--sp-4);
  background:
    radial-gradient(circle at 12% 18%, var(--sun-300) 0 70px, transparent 71px),
    radial-gradient(circle at 88% 84%, var(--cobalt-100) 0 120px, transparent 121px),
    var(--paper);
  overflow: auto;
}
.gate-card {
  width: min(720px, 100%); background: var(--white); color: var(--ink-900);
  border: var(--bw) solid var(--ink-900); border-radius: var(--r-xl); box-shadow: 6px 6px 0 var(--ink-900);
  padding: clamp(20px, 4vw, 36px); animation: pop var(--t-med) var(--ease);
}
.gate-head { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-2); }
.gate-head h1 { font-size: clamp(28px, 5vw, 38px); font-weight: 800; }
.gate-sub { color: var(--ink-500); margin: 0 0 var(--sp-6); }
.gate-notice { background: var(--cobalt-50); border: var(--bw) dashed var(--cobalt-600); border-radius: var(--r-md); padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-5); font-size: 14px; }
.profiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: var(--sp-4); }
.profile {
  position: relative; display: grid; justify-items: center; gap: var(--sp-2); padding: var(--sp-4) var(--sp-2) var(--sp-3);
  background: var(--white); border: var(--bw) solid var(--ink-900); border-radius: var(--r-lg);
  box-shadow: 3px 3px 0 var(--ink-900); text-align: center; min-height: 148px;
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.profile:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--ink-900); }
.profile:active { transform: translate(2px, 2px); box-shadow: none; }
.profile .name { font-weight: 700; overflow-wrap: anywhere; line-height: 1.25; }
.profile .role { font-size: 12px; color: var(--ink-500); }
.profile.admin { background: var(--night-900); color: #F3F0FF; box-shadow: 3px 3px 0 var(--rose-500); }
.profile.admin .role { color: var(--rose-300); }
.profile.add { border-style: dashed; box-shadow: none; background: var(--paper); color: var(--ink-700); }
.profile.add:hover { box-shadow: none; transform: none; background: var(--cobalt-50); }
.avatar {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  font: 800 24px/1 var(--font-display); color: #fff; border: var(--bw) solid var(--ink-900);
  text-transform: uppercase; flex: none;
}
.avatar.sm { width: 32px; height: 32px; font-size: 14px; }
.avatar .lock { position: absolute; }
.profile .badge-lock { position: absolute; top: 10px; right: 10px; color: var(--rose-300); }
.gate-form { margin-top: var(--sp-5); display: grid; gap: var(--sp-3); padding-top: var(--sp-5); border-top: var(--bw) dashed var(--ink-150); animation: pop var(--t-med) var(--ease); }
.gate-form .row { display: flex; gap: var(--sp-3); flex-wrap: wrap; }
.gate-form .row .input { flex: 1 1 220px; }
.gate-card .input { background: var(--white); color: var(--ink-900); border-color: var(--ink-900); }
.gate-card .btn { background: var(--white); color: var(--ink-900); border-color: var(--ink-900); box-shadow: 2px 2px 0 var(--ink-900); }
.gate-card .btn.primary { background: var(--cobalt-600); color: #fff; }
.gate-card .btn.admin { background: var(--rose-500); color: #1A0712; }

/* ---------- Coque de l'application ---------- */
#app { height: 100%; display: flex; flex-direction: column; }
#app > .topbar { height: var(--topbar-h); flex: none; }
#app > .body { flex: 1 1 auto; }
.admin-strip {
  display: none; align-items: center; gap: var(--sp-2); justify-content: center;
  padding: 6px var(--sp-4); font-size: 13px; font-weight: 700;
  background: repeating-linear-gradient(135deg, var(--rose-500) 0 14px, #FF6A9D 14px 28px); color: #1A0712;
}
[data-theme="admin"] .admin-strip { display: flex; }
.topbar {
  position: relative;
  display: flex; align-items: center; gap: var(--sp-3); padding: 0 var(--sp-4);
  border-bottom: var(--bw) solid var(--line); background: var(--surface);
}
.brand { display: flex; align-items: center; gap: var(--sp-2); font: 800 22px/1 var(--font-display); margin-right: var(--sp-2); }
.brand-logo { width: 30px; height: 30px; }
.navbtns { display: flex; gap: 2px; }
.crumbs {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 2px; overflow-x: auto; scrollbar-width: none;
  height: 42px; padding: 0 var(--sp-2); border: var(--bw) solid var(--line); border-radius: var(--r-pill); background: var(--surface-2);
}
.crumbs::-webkit-scrollbar { display: none; }
.crumb {
  border: 0; background: none; padding: 4px 10px; border-radius: var(--r-pill); font-weight: 600; white-space: nowrap;
  color: var(--text-muted); display: inline-flex; align-items: center; gap: 6px; min-height: 32px;
}
.crumb:hover { background: var(--surface-sunk); color: var(--text); }
.crumb[aria-current="page"] { color: var(--text); background: var(--primary-soft); }
.crumb.drop { outline: 2px dashed var(--primary); }
.crumb-sep { color: var(--text-muted); flex: none; }
.searchbox { position: relative; width: clamp(180px, 22vw, 300px); }
.searchbox .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.searchbox input { padding-left: 38px; border-radius: var(--r-pill); min-height: 42px; background: var(--surface-2); }
.me { display: flex; align-items: center; gap: var(--sp-2); padding: 4px 6px 4px 4px; border-radius: var(--r-pill); border: var(--bw) solid var(--line); background: var(--surface-2); font-weight: 700; max-width: 200px; }
.me span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.body { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 0; }

/* ---------- Barre latérale / arborescence ---------- */
.sidebar { border-right: var(--bw) solid var(--line); background: var(--surface); overflow: auto; padding: var(--sp-3) var(--sp-2) var(--sp-6); display: flex; flex-direction: column; gap: var(--sp-4); }
.side-title { font: 700 13px/1 var(--font-body); color: var(--text-muted); padding: 0 var(--sp-2) var(--sp-2); }
.tree { list-style: none; margin: 0; padding: 0; }
.tree ul { list-style: none; margin: 0; padding-left: 14px; }
.node { display: flex; align-items: center; gap: 2px; border-radius: var(--r-sm); min-height: 34px; padding-right: 6px; }
.node:hover { background: var(--surface-sunk); }
.node.current { background: var(--primary-soft); }
.node.drop { outline: 2px dashed var(--primary); outline-offset: -2px; }
.node .tw { width: 24px; height: 28px; border: 0; background: none; display: grid; place-items: center; color: var(--text-muted); border-radius: 6px; padding: 0; }
.node .tw .ic { width: 14px; height: 14px; transition: transform var(--t-fast); }
.node .tw[aria-expanded="true"] .ic { transform: rotate(90deg); }
.node .tw.empty { visibility: hidden; }
.node .lbl { flex: 1; min-width: 0; border: 0; background: none; display: flex; align-items: center; gap: 8px; padding: 4px 2px; text-align: left; font-weight: 500; }
.node .lbl span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.node .lbl svg.fi { width: 20px; height: 20px; flex: none; }
.root-space { margin: 0 var(--sp-2) 0 34px; height: 5px; border-radius: var(--r-pill); background: var(--surface-sunk); overflow: hidden; }
.root-space i { display: block; height: 100%; background: var(--primary); border-radius: inherit; }
.side-link { display: flex; align-items: center; gap: 10px; width: 100%; border: var(--bw) solid var(--line); border-radius: var(--r-md); background: var(--primary-wash); padding: 10px 12px; font-weight: 700; text-align: left; }
.side-link[aria-current="page"] { background: var(--primary); color: var(--on-primary); }
.side-empty { padding: var(--sp-3); color: var(--text-muted); font-size: 14px; border: var(--bw) dashed var(--line-soft); border-radius: var(--r-md); }

/* ---------- Zone principale ---------- */
.main { display: grid; grid-template-rows: auto 1fr auto; min-width: 0; min-height: 0; position: relative; }
.toolbar { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4); border-bottom: var(--bw) solid var(--line-soft); flex-wrap: wrap; background: var(--bg); }
.toolbar .sep { width: 2px; height: 26px; background: var(--line-soft); margin: 0 var(--sp-1); border-radius: 2px; }
.toolbar .grow { flex: 1; }
.seg { display: inline-flex; border: var(--bw) solid var(--line); border-radius: var(--btn-radius); overflow: hidden; box-shadow: var(--shadow-hard-sm); }
.seg button { border: 0; background: var(--surface); width: 38px; height: 36px; display: grid; place-items: center; }
.seg button + button { border-left: var(--bw) solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); }
.sortsel { min-height: 40px; border-radius: var(--btn-radius); border: var(--bw) solid var(--line); background: var(--surface); padding: 0 var(--sp-2); font-weight: 600; box-shadow: var(--shadow-hard-sm); }

.search-banner { display: flex; align-items: center; gap: var(--sp-3); margin: var(--sp-3) var(--sp-4) 0; padding: var(--sp-2) var(--sp-3); border-radius: var(--r-md); background: var(--primary-wash); border: var(--bw) solid var(--line); font-weight: 600; }
.search-banner .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.files { overflow: auto; padding: var(--sp-4); outline: none; position: relative; user-select: none; -webkit-user-select: none; }
.files.drop-target { background: var(--primary-wash); box-shadow: inset 0 0 0 3px var(--primary); }

/* Grille */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--tile-w), 1fr)); gap: var(--sp-3); }
.item {
  position: relative; border: var(--bw) solid transparent; border-radius: var(--item-radius); background: transparent;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.grid .item { display: grid; justify-items: center; gap: 6px; padding: var(--sp-3) var(--sp-2) var(--sp-2); text-align: center; }
.item:hover { background: var(--surface); border-color: var(--line-soft); }
.item.sel { background: var(--primary-soft); border-color: var(--primary); }
.item.cut { opacity: .45; }
.item.drop { border-color: var(--primary); border-style: dashed; background: var(--primary-wash); }
.item:focus-visible { outline-offset: 0; }
.thumb { width: 76px; height: 64px; display: grid; place-items: center; position: relative; }
.thumb svg.fi { width: 64px; height: 64px; }
.thumb img { width: 76px; height: 64px; object-fit: cover; border-radius: var(--r-sm); border: var(--bw) solid var(--line); background: var(--surface-sunk); }
.item .nm { font-weight: 600; font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 100%; }
.item .sub { font-size: 12px; color: var(--text-muted); }
.item .flags { position: absolute; top: 6px; right: 6px; display: flex; gap: 3px; }
.flag { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); border: var(--bw) solid var(--line); }
.flag .ic { width: 12px; height: 12px; }
.flag.hidden { color: var(--danger); }
.flag.shared { color: var(--primary); }
.check {
  position: absolute; top: 6px; left: 6px; width: 24px; height: 24px; border-radius: 7px; border: var(--bw) solid var(--line);
  background: var(--surface); display: none; place-items: center; padding: 0;
}
.check .ic { width: 14px; height: 14px; opacity: 0; }
.item.sel .check { background: var(--primary); color: var(--on-primary); }
.item.sel .check .ic { opacity: 1; }
.item:hover .check, .item.sel .check, .selmode .check { display: grid; }
.rename-input { width: 100%; font-weight: 600; font-size: 14px; border: var(--bw) solid var(--primary); border-radius: 6px; padding: 2px 6px; background: var(--surface); text-align: inherit; }

/* Liste */
.list { display: grid; }
.list-head, .list .item { display: grid; grid-template-columns: 36px minmax(0, 1fr) 170px 120px 96px; align-items: center; gap: var(--sp-3); padding: 0 var(--sp-3); }
.list-head { position: sticky; top: calc(-1 * var(--sp-4)); z-index: 1; background: var(--bg); min-height: 38px; border-bottom: var(--bw) solid var(--line-soft); margin-bottom: 4px; }
.list-head button { border: 0; background: none; text-align: left; font-weight: 700; font-size: 13px; color: var(--text-muted); padding: 8px 0; display: flex; gap: 4px; align-items: center; }
.list-head button[aria-sort] { color: var(--text); }
.list-head .num { justify-content: flex-end; }
.list .item { min-height: 44px; border-radius: var(--r-sm); }
.list .thumb, .list .thumb svg.fi { width: 30px; height: 30px; }
.list .thumb img { width: 30px; height: 30px; border-width: 1px; border-radius: 6px; }
.list .item .nm { -webkit-line-clamp: 1; display: flex; gap: 8px; align-items: center; }
.list .item .nm span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .item .flags { position: static; }
.list .item .check { position: static; display: none; }
.list.selmode .item .thumb, .list .item.sel .thumb { display: none; }
.list.selmode .item .check, .list .item.sel .check { display: grid; }
.list .cell { font-size: 14px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .cell.num { text-align: right; font-variant-numeric: tabular-nums; }
.list .loc { font-size: 12px; color: var(--text-muted); }

/* États vides */
.empty { display: grid; justify-items: center; text-align: center; gap: var(--sp-3); padding: 12vh var(--sp-4); color: var(--text-muted); }
.empty svg.fi { width: 96px; height: 96px; }
.empty h2 { color: var(--text); font-size: 22px; }
.empty .row { display: flex; gap: var(--sp-2); flex-wrap: wrap; justify-content: center; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 4px solid var(--line-soft); border-top-color: var(--primary); animation: spin .8s linear infinite; }

/* Barre d'état */
.status { display: flex; align-items: center; gap: var(--sp-4); padding: 8px var(--sp-4); border-top: var(--bw) solid var(--line-soft); font-size: 13px; color: var(--text-muted); min-height: 38px; background: var(--bg); }
.status .grow { flex: 1; }
.status .space { display: flex; align-items: center; gap: var(--sp-2); }
.status .bar { width: 120px; height: 8px; border-radius: var(--r-pill); background: var(--surface-sunk); border: 1px solid var(--line-soft); overflow: hidden; }
.status .bar i { display: block; height: 100%; background: var(--primary); }

/* ---------- Superposition de dépôt ---------- */
.dropzone { position: fixed; inset: 0; z-index: 30; pointer-events: none; display: grid; place-items: center; background: var(--overlay); animation: fade var(--t-fast); }
.dropzone div { background: var(--surface); border: 3px dashed var(--primary); border-radius: var(--r-xl); padding: var(--sp-8); font: 800 22px/1.2 var(--font-display); display: grid; justify-items: center; gap: var(--sp-3); box-shadow: var(--shadow-hard); }

/* ---------- Menu contextuel ---------- */
.menu {
  position: fixed; z-index: 60; min-width: 220px; max-width: 290px; padding: 6px; background: var(--surface);
  border: var(--bw) solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-hard); animation: pop var(--t-fast) var(--ease);
}
.menu button { width: 100%; display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 9px 10px; border-radius: 8px; text-align: left; font-weight: 500; }
.menu button:hover, .menu button:focus-visible { background: var(--primary-soft); outline: none; }
.menu button.danger { color: var(--danger); }
.menu button.danger:hover { background: var(--danger-soft); }
.menu kbd { margin-left: auto; font: 12px var(--font-body); color: var(--text-muted); }
.menu hr { border: 0; border-top: var(--bw) solid var(--line-soft); margin: 4px 2px; }

/* ---------- Fenêtres modales ---------- */
.modal-bg { position: fixed; inset: 0; z-index: 70; background: var(--overlay); display: grid; place-items: center; padding: var(--sp-4); animation: fade var(--t-fast); }
.modal {
  width: min(480px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); color: var(--text);
  border: var(--bw) solid var(--line); border-radius: var(--r-xl); box-shadow: 6px 6px 0 var(--line); padding: var(--sp-6);
  animation: pop var(--t-med) var(--ease);
}
[data-theme="admin"] .modal { box-shadow: 6px 6px 0 var(--rose-500); }
.modal h2 { font-size: 22px; margin-bottom: var(--sp-3); }
.modal p { margin: 0 0 var(--sp-3); color: var(--text-muted); }
.modal .names { margin: 0 0 var(--sp-4); padding: var(--sp-3) var(--sp-4); background: var(--surface-2); border-radius: var(--r-md); font-weight: 600; font-size: 14px; list-style: none; display: grid; gap: 2px; }
.modal .names li { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal .actions { display: flex; justify-content: flex-end; gap: var(--sp-2); margin-top: var(--sp-5); flex-wrap: wrap; }
.modal form { display: grid; gap: var(--sp-4); }

/* ---------- Transferts ---------- */
.transfers {
  position: fixed; right: var(--sp-4); bottom: var(--sp-4); z-index: 50; width: min(380px, calc(100vw - 32px));
  background: var(--surface); border: var(--bw) solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-hard);
  overflow: hidden; animation: pop var(--t-med) var(--ease);
}
.tr-head { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-3) var(--sp-3) var(--sp-3) var(--sp-4); border-bottom: var(--bw) solid var(--line-soft); }
.tr-head strong { flex: 1; font-family: var(--font-display); font-size: 16px; }
.tr-total { height: 6px; background: var(--surface-sunk); }
.tr-total i { display: block; height: 100%; background: var(--primary); transition: width var(--t-med); }
.tr-list { max-height: 280px; overflow: auto; padding: var(--sp-2); display: grid; gap: 4px; }
.tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; padding: var(--sp-2); border-radius: var(--r-sm); }
.tr .n { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr .pct { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; align-self: center; }
.tr .bar { grid-column: 1 / -1; height: 8px; border-radius: var(--r-pill); background: var(--surface-sunk); overflow: hidden; }
.tr .bar i { display: block; height: 100%; background: var(--primary); border-radius: inherit; transition: width var(--t-fast) linear; }
.tr.done .bar i { background: var(--mint-500); }
.tr.err .bar i { background: var(--danger); }
.tr .msg { grid-column: 1 / -1; font-size: 12px; color: var(--danger); font-weight: 600; }
.tr .acts { display: flex; gap: 2px; align-items: center; }
.transfers.collapsed .tr-list { display: none; }

/* ---------- Visionneuse (fenêtre flottante) ---------- */
.viewer-bg { position: fixed; inset: 0; z-index: 65; background: rgba(10, 8, 22, .62); backdrop-filter: blur(3px); animation: fade var(--t-fast); }
.viewer {
  position: absolute; display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden;
  background: #151126; color: #F3F0FF; border: var(--bw) solid #07050F; border-radius: var(--r-lg);
  box-shadow: 6px 6px 0 #000, 0 24px 60px rgba(0, 0, 0, .45); animation: pop var(--t-med) var(--ease);
}
.viewer.moving { user-select: none; -webkit-user-select: none; }
.viewer.moving iframe, .viewer.moving video { pointer-events: none; }
.viewer.max, .viewer:fullscreen { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; border-radius: 0; border: 0; box-shadow: none; }
.viewer:fullscreen { background: #0A0816; }
.viewer-bar {
  display: flex; align-items: center; gap: var(--sp-2); padding: 8px 8px 8px var(--sp-4); min-width: 0;
  border-bottom: 1px solid #2B2446; background: #1B1631; cursor: grab; touch-action: none;
}
.viewer.moving .viewer-bar { cursor: grabbing; }
.viewer.max .viewer-bar, .viewer:fullscreen .viewer-bar { cursor: default; }
.viewer-bar .title { flex: 1; min-width: 0; }
.viewer-bar .title strong { display: block; font-family: var(--font-display); font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-bar .title span { display: block; font-size: 12px; color: #B3ACD6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-extra { display: contents; }
.viewer .btn { background: #231D3D; color: #F3F0FF; border-color: #07050F; box-shadow: 2px 2px 0 #000; }
.viewer .btn.primary { background: var(--sun-400); color: var(--ink-900); }
.viewer .btn:disabled { opacity: .45; }
.zoom-tools { display: flex; align-items: center; gap: 4px; }
.zoom-tools[hidden] { display: none; }
.zoom-lbl { min-width: 52px; text-align: center; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; color: #CFC9EC; }
.viewer-stage { position: relative; min-height: 0; overflow: hidden; background: #0E0B1C; touch-action: none; }
.viewer-fit { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: var(--sp-3); }
.viewer-fit.fill { display: grid; grid-template-rows: minmax(0, 1fr); align-items: stretch; justify-items: stretch; }
.viewer-fit.fill > .viewer-msg, .viewer-fit.fill > .spinner { align-self: center; justify-self: center; }
.viewer-fit img, .viewer-fit video {
  display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain;
  border-radius: var(--r-sm); flex: none;
}
.viewer-fit img { background: repeating-conic-gradient(#2a2440 0 25%, #1f1a33 0 50%) 0 0 / 20px 20px; transform-origin: center center; cursor: zoom-in; will-change: transform; user-select: none; -webkit-user-drag: none; }
.viewer-fit img.zoomed { cursor: grab; border-radius: 0; }
.viewer-stage.panning img { cursor: grabbing; }
.viewer-fit video { background: #000; }
.viewer-fit audio { width: min(520px, 100%); }
.viewer-fit iframe { width: 100%; height: 100%; border: 0; border-radius: var(--r-md); background: #fff; }
.viewer-text { width: 100%; height: 100%; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr); }
.viewer-text pre, .viewer-text textarea {
  margin: 0; width: 100%; height: 100%; overflow: auto; padding: var(--sp-5); border-radius: var(--r-md);
  background: #F7F6FC; color: var(--ink-900); font: 14px/1.6 ui-monospace, 'Cascadia Code', 'SF Mono', Consolas, monospace;
  white-space: pre-wrap; overflow-wrap: anywhere; border: var(--bw) solid #000; tab-size: 4; user-select: text;
}
.viewer-text textarea { resize: none; outline: none; box-shadow: 0 0 0 3px var(--sun-400); }
.viewer-nav { position: absolute; z-index: 4; top: calc(50% - 22px); width: 44px; height: 44px; border-radius: 50%; opacity: .85; }
.viewer-nav:hover, .viewer-nav:focus-visible { opacity: 1; }
.viewer-nav.prev { left: 10px; }
.viewer-nav.next { right: 10px; }
.viewer-msg { text-align: center; display: grid; gap: var(--sp-3); justify-items: center; color: #CFC9EC; padding: var(--sp-4); }
.viewer-grip {
  position: absolute; right: 0; bottom: 0; width: 22px; height: 22px; z-index: 3; cursor: nwse-resize; touch-action: none;
  background: linear-gradient(135deg, transparent 0 55%, #6E64A0 55% 62%, transparent 62% 72%, #6E64A0 72% 79%, transparent 79%);
}
.viewer-grip:focus-visible { outline: 3px solid var(--sun-400); outline-offset: -3px; }
.viewer.max .viewer-grip, .viewer:fullscreen .viewer-grip { display: none; }

/* ---------- Administration ---------- */
.admin { overflow: auto; padding: var(--sp-5) var(--sp-5) var(--sp-8); }
.admin-head { display: flex; align-items: flex-end; gap: var(--sp-4); flex-wrap: wrap; margin-bottom: var(--sp-5); }
.admin-head h1 { font-size: 30px; font-weight: 800; }
.tabs { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-bottom: var(--sp-5); }
.tab { display: inline-flex; align-items: center; gap: 8px; border: var(--bw) solid var(--line); background: var(--surface); padding: 8px 14px; border-radius: var(--r-pill); font-weight: 700; }
.tab[aria-selected="true"] { background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow-hard-sm); }
.panel { background: var(--surface); border: var(--bw) solid var(--line); border-radius: var(--panel-radius); padding: var(--sp-5); margin-bottom: var(--sp-5); box-shadow: var(--shadow-hard); }
.panel h2 { font-size: 20px; margin-bottom: 4px; }
.panel > p { margin: 0 0 var(--sp-4); color: var(--text-muted); font-size: 14px; max-width: 70ch; }
.rows { display: grid; gap: var(--sp-2); }
.row-item { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3); border-radius: var(--r-md); background: var(--surface-2); border: var(--bw) solid var(--line-soft); flex-wrap: wrap; }
.row-item .meta { flex: 1; min-width: 180px; }
.row-item .meta strong { display: block; overflow-wrap: anywhere; }
.row-item .meta span { font-size: 13px; color: var(--text-muted); overflow-wrap: anywhere; }
.row-item .fi { width: 36px; height: 36px; flex: none; }
.meter { width: 160px; display: grid; gap: 4px; font-size: 12px; color: var(--text-muted); }
.meter .bar { height: 8px; border-radius: var(--r-pill); background: var(--surface-sunk); overflow: hidden; }
.meter .bar i { display: block; height: 100%; background: var(--primary); }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 48px; height: 28px; border-radius: var(--r-pill); border: var(--bw) solid var(--line); background: var(--surface-sunk); position: relative; transition: background var(--t-fast); flex: none; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--text-muted); transition: transform var(--t-med) var(--ease), background var(--t-fast); }
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { transform: translateX(20px); background: var(--on-primary); }
.switch input:focus-visible + .track { outline: 3px solid var(--focus); outline-offset: 2px; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: var(--r-pill); font-size: 12px; font-weight: 700; border: var(--bw) solid var(--line); background: var(--surface); }
.pill.admin { background: var(--primary); color: var(--on-primary); }
.log-head { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-2); }
.log-head h2 { margin: 0; }
.log-filters { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; margin: var(--sp-4) 0 var(--sp-2); }
.log-search { position: relative; flex: 1 1 260px; min-width: 200px; }
.log-search .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.log-search input { padding-left: 36px; min-height: 40px; }
.log-filters .sortsel { min-height: 40px; }
.log-dates { display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; }
.log-dates[hidden] { display: none; }
.log-dates label { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; }
.log-dates input { min-height: 40px; width: auto; }
.log-bar { font-size: 13px; color: var(--text-muted); min-height: 20px; margin-bottom: var(--sp-2); }
.log { display: grid; font-size: 14px; border: var(--bw) solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--surface); }
.log > .side-empty { border: 0; border-radius: 0; }
.log-row { display: grid; grid-template-columns: 158px 78px minmax(0, 1fr) 118px; gap: var(--sp-3); padding: 10px var(--sp-3); border-bottom: 1px solid var(--line-soft); align-items: start; }
.log-row:last-child { border-bottom: 0; }
.log-row:nth-child(even) { background: var(--surface-2); }
.log-row .t { color: var(--text-muted); font-variant-numeric: tabular-nums; font-size: 13px; padding-top: 2px; }
.log-row .main { min-width: 0; display: grid; gap: 3px; }
.log-row .l1 { display: flex; flex-wrap: wrap; gap: 4px var(--sp-3); align-items: center; }
.log-row .a { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.log-row .who { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--text-muted); }
.log-row .who .pill { font-size: 11px; padding: 1px 7px; }
.log-row .tg { font: 13px/1.45 ui-monospace, 'Cascadia Code', 'SF Mono', Consolas, monospace; overflow-wrap: anywhere; color: var(--text); }
.log-row .dt { font-size: 13px; color: var(--text-muted); overflow-wrap: anywhere; }
.log-row .er { font-size: 13px; color: var(--danger); font-weight: 600; overflow-wrap: anywhere; }
.log-row .ip { color: var(--text-muted); font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; padding-top: 2px; overflow-wrap: anywhere; }
.res { justify-self: start; font-size: 11px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; padding: 3px 8px; border-radius: var(--r-pill); border: 1.5px solid currentColor; line-height: 1.2; }
.res-ok { color: var(--mint-500); }
.res-denied { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.res-fail { color: #E07A10; }
.res-partial { color: #C99A00; }
.log-row.r-denied { box-shadow: inset 4px 0 0 var(--danger); }
.log-row.r-fail { box-shadow: inset 4px 0 0 #E07A10; }
.log-more { display: flex; justify-content: center; margin-top: var(--sp-3); }
.log-more .btn[hidden] { display: none; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px var(--sp-5); font-size: 14px; }
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; font-weight: 600; }
.form-grid { display: grid; gap: var(--sp-4); max-width: 420px; }

/* ---------- Toasts ---------- */
#toasts { position: fixed; left: 50%; bottom: var(--sp-5); transform: translateX(-50%); z-index: 90; display: grid; gap: var(--sp-2); justify-items: center; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: var(--sp-2); padding: 10px 16px; border-radius: var(--r-pill); background: var(--ink-900); color: #fff; border: var(--bw) solid var(--ink-900); font-weight: 600; box-shadow: 3px 3px 0 var(--sun-400); animation: pop var(--t-med) var(--ease); max-width: min(560px, calc(100vw - 32px)); }
.toast.err { background: var(--cherry-600); box-shadow: 3px 3px 0 var(--ink-900); }
[data-theme="admin"] .toast { background: var(--night-800); border-color: #000; }

/* ---------- Animations ---------- */
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}

/* ---------- Responsive ---------- */
.only-mobile { display: none !important; }
@media (max-width: 1080px) {
  .searchbox { width: 180px; }
  .toolbar .lbl { display: none; }
  .toolbar .btn.withlbl { width: var(--btn-h); padding: 0; }
}
@media (max-width: 860px) {
  :root { --topbar-h: 58px; --tile-w: 100px; }
  .only-mobile { display: inline-flex !important; }
  .hide-mobile { display: none !important; }
  .body { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 55; top: 0; bottom: 0; left: 0; width: min(300px, 86vw); transform: translateX(-105%); transition: transform var(--t-med) var(--ease); box-shadow: var(--shadow-hard); padding-top: calc(var(--sp-4) + env(safe-area-inset-top)); }
  .sidebar.open { transform: none; }
  .scrim { position: fixed; inset: 0; z-index: 54; background: var(--overlay); }
  .topbar { gap: var(--sp-2); padding: 0 var(--sp-2); }
  .brand span, .navbtns .fwd { display: none; }
  .searchbox:not(.open) { display: none; }
  .searchbox.open { position: absolute; left: 8px; right: 8px; width: auto; z-index: 5; }
  .me { flex: none; padding: 3px; }
  .me > span:not(.avatar) { display: none; }
  .list-head, .list .item { grid-template-columns: 36px minmax(0, 1fr) 84px; }
  .list .col-date, .list .col-type { display: none; }
  .thumb, .thumb img { width: 64px; height: 54px; }
  .thumb svg.fi { width: 54px; height: 54px; }
  .viewer:not(.max):not(:fullscreen) { left: 6px !important; top: calc(6px + env(safe-area-inset-top, 0px)) !important; width: auto !important; right: 6px; height: auto !important; bottom: calc(6px + env(safe-area-inset-bottom, 0px)); }
  .viewer-bar { cursor: default; padding-left: var(--sp-3); flex-wrap: wrap; row-gap: 6px; }
  .viewer-bar .title { flex-basis: calc(100% - 150px); }
  .zoom-tools { order: 5; width: 100%; justify-content: center; }
  .viewer-grip { display: none; }
  .viewer-fit { padding: 6px; }
  .viewer-nav { display: none; }
  .log-row { grid-template-columns: auto minmax(0, 1fr); gap: 4px var(--sp-2); }
  .log-row .t { grid-column: 2; grid-row: 1; }
  .log-row .res { grid-column: 1; grid-row: 1; }
  .log-row .main { grid-column: 1 / -1; }
  .log-row .ip { grid-column: 1 / -1; text-align: left; }
  .log-filters .sortsel, .log-dates { flex: 1 1 45%; }
  .admin { padding: var(--sp-4); }
  .status .space { display: none; }
  .transfers { right: 8px; bottom: 8px; }
}

/* ---------- Accès distant ---------- */
.gate-access { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 var(--sp-3); padding: 6px 12px; border-radius: var(--r-pill); border: var(--bw) solid var(--ink-900, #191A38); background: var(--sun-400); font-weight: 700; font-size: 14px; }
.gate-foot { margin-top: var(--sp-4); font-size: 13px; color: var(--ink-500, #5B5E80); max-width: 60ch; }
.access-pill { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 5px 10px; border-radius: var(--r-pill); border: var(--bw) solid var(--line); font-size: 13px; font-weight: 800; background: var(--sun-400); color: var(--ink-900); }
.access-pill.external { background: var(--coral-500); color: #fff; }
.pill.ok { color: var(--mint-500); border-color: currentColor; }
.pill.warn { color: #C26A00; border-color: currentColor; }

.chks { display: grid; gap: var(--sp-2); }
.chk { display: flex; gap: var(--sp-3); align-items: flex-start; padding: 10px var(--sp-3); border-radius: var(--r-md); border: 1.5px solid var(--line-soft); background: var(--surface-2); }
.chk strong { display: block; font-size: 15px; }
.chk p { margin: 2px 0 0; font-size: 14px; color: var(--text-muted); }
.chk-ic { display: grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 50%; color: #fff; background: var(--sky-500); }
.chk.ok .chk-ic { background: var(--mint-500); }
.chk.warn .chk-ic { background: #E07A10; }
.urls { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 0 var(--sp-3) 0 calc(var(--sp-3) + 38px); }
.urls-l { font-size: 13px; font-weight: 700; color: var(--text-muted); margin-right: 4px; }
.urls code, .secret { font: 13px/1.4 ui-monospace, 'Cascadia Code', Consolas, monospace; padding: 3px 8px; border-radius: var(--r-sm); background: var(--surface); border: 1.5px solid var(--line-soft); user-select: all; overflow-wrap: anywhere; }
.twofa { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: var(--sp-5); align-items: start; margin-top: var(--sp-3); }
.qr { background: #fff; padding: 10px; border-radius: var(--r-md); border: var(--bw) solid var(--line); }
.qr svg { display: block; width: 100%; height: auto; }
.twofa-steps p { margin: 0 0 var(--sp-2); }
.secret { display: inline-block; margin-bottom: var(--sp-4); font-size: 15px; letter-spacing: .04em; }
.disclose { margin-top: var(--sp-3); }
.disclose summary { cursor: pointer; font-weight: 700; color: var(--text-muted); }
.disclose[open] summary { margin-bottom: var(--sp-3); }
.hint { font-size: 13px; color: var(--text-muted); }

.side-link, .tab { position: relative; }
.alert-dot { margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: var(--r-pill); display: inline-grid; place-items: center; font-size: 12px; font-weight: 800; background: #E07A10; color: #fff; border: 2px solid var(--surface); }
.tab .alert-dot { margin-left: 4px; }
.alert-dot.hot { background: var(--danger); }
.alert-dot[hidden] { display: none; }
.log-alert { display: flex; gap: var(--sp-3); align-items: center; margin-bottom: var(--sp-4); padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); border: var(--bw) solid var(--line); background: color-mix(in srgb, #E07A10 16%, var(--surface)); box-shadow: var(--shadow-hard); }
.log-alert.hot { background: color-mix(in srgb, var(--danger) 18%, var(--surface)); }
.log-alert > div { flex: 1; min-width: 0; }
.log-alert p { margin: 2px 0 0; font-size: 13px; color: var(--text-muted); overflow-wrap: anywhere; }
.log-row .ip { display: grid; gap: 3px; justify-items: end; }
.acc { font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: var(--r-pill); border: 1.5px solid currentColor; color: var(--text-muted); }
.acc-vpn { color: var(--sky-500); }
.acc-external { color: var(--coral-500); background: color-mix(in srgb, var(--coral-500) 12%, transparent); }
@media (max-width: 860px) {
  .twofa { grid-template-columns: 1fr; }
  .qr { max-width: 220px; }
  .urls { padding-left: var(--sp-3); }
  .log-row .ip { justify-items: start; grid-auto-flow: column; justify-content: start; gap: 8px; }
  .access-pill span { display: none; }
}

/* ---------- Éléments masqués (vue Admin) ---------- */
.item.is-hidden .thumb { opacity: .5; filter: saturate(.35); }
.item.is-hidden .nm { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--danger) 70%, transparent); text-decoration-thickness: 2px; }
.flag.hidden { background: var(--danger); color: #fff; border-color: var(--line); }
.flag.hidden.inherited { background: var(--surface); color: var(--danger); border-style: dashed; }
.row-item.gone { opacity: .7; }
.row-item .meta strong .pill { vertical-align: middle; margin-left: 4px; }
