/*
 * OsaNAS — la sobriété de la suite Osa (OsaWallpaper → OsaHUB → OsaMaps) :
 * fond quasi noir, blanc à différentes opacités, Inter en gras, pilules blanches à texte noir,
 * cartes blanc 5 % + trait 8 %. La couleur ne sert qu'à dire un ÉTAT. Pas de dégradés décoratifs.
 */
:root {
  --bg: #0a0a0f;
  --raised: rgb(19, 19, 23);
  --surface: rgba(255, 255, 255, 0.05);
  --surface-hi: rgba(255, 255, 255, 0.08);
  --track: rgba(255, 255, 255, 0.07);
  --glass: rgba(14, 14, 20, 0.78);
  --line: rgba(255, 255, 255, 0.08);
  --line-hi: rgba(255, 255, 255, 0.16);
  --text: rgba(255, 255, 255, 0.95);
  --dim: rgba(255, 255, 255, 0.58);
  --faint: rgba(255, 255, 255, 0.38);
  --hint: rgba(255, 255, 255, 0.3);
  --ink: #000;

  --ok: #34c759;
  --warn: #ff9f0a;
  --bad: #ff453a;
  --info: #5aa9ff;

  --r-xs: 8px;
  --r-s: 10px;
  --r-m: 12px;
  --r-card: 18px;
  --r-l: 24px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  --blur: saturate(160%) blur(22px);

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);

  --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  --pad: 36px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 400 13px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
::selection { background: rgba(255, 255, 255, 0.22); }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* lumière d'ambiance : une ellipse blanche floue au-dessus du bord */
.ambient {
  position: fixed; left: 50%; top: -260px; width: 900px; height: 360px; margin-left: -450px;
  border-radius: 50%; background: #fff; opacity: 0.05; filter: blur(160px); pointer-events: none; z-index: 0;
}
#app { position: relative; z-index: 1; min-height: 100vh; }

/* ---------- icônes ---------- */
.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.i.sm { width: 15px; height: 15px; }
.i.lg { width: 22px; height: 22px; }

/* ---------- marque ---------- */
.wordmark { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; letter-spacing: -0.025em; text-decoration: none; }
.wordmark .mark { width: 26px; height: 26px; }
.wordmark .osa { color: var(--text); }
.wordmark .prod {
  margin-left: 1px; text-transform: uppercase;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.36));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- boutons ---------- */
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 18px; border: 0; border-radius: 999px;
  background: var(--text); color: var(--ink); font-weight: 700; font-size: 13px; white-space: nowrap;
  transition: transform 140ms var(--ease-out), background 160ms var(--ease-out), opacity 160ms;
  text-decoration: none;
}
.pill:active { transform: scale(0.97); }
.pill:disabled { opacity: 0.45; cursor: default; }
.pill.secondary { background: var(--surface-hi); color: var(--text); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12); }
.pill.secondary:hover { background: rgba(255, 255, 255, 0.11); }
.pill.danger { background: var(--surface-hi); color: var(--bad); box-shadow: inset 0 0 0 1px rgba(255, 69, 58, 0.28); }
.pill.danger.solid { background: var(--bad); color: #fff; box-shadow: none; }
.pill.sm { height: 32px; padding: 0 14px; font-size: 12.5px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 999px; border: 0;
  background: transparent; color: var(--dim);
  transition: background 150ms var(--ease-out), color 150ms, transform 140ms var(--ease-out);
}
.icon-btn:hover { background: var(--surface-hi); color: var(--text); }
.icon-btn:active { transform: scale(0.94); }
:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.7); outline-offset: 2px; }

/* ---------- barre du haut ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; height: 64px;
  display: flex; align-items: center; gap: 18px; padding: 0 var(--pad);
  padding-top: env(safe-area-inset-top, 0px);
  transition: background 200ms var(--ease-out), box-shadow 200ms var(--ease-out);
}
.topbar.scrolled { background: rgba(10, 10, 15, 0.72); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: 0 1px 0 var(--line); }
.topbar .spacer { flex: 1; }
.host { display: inline-flex; align-items: center; gap: 8px; color: var(--dim); font-size: 12px; font-weight: 600; }

/* onglets segmentés : capsule glissante blanche, texte actif noir */
.seg { position: relative; display: inline-flex; padding: 3px; border-radius: 999px; background: var(--track); box-shadow: inset 0 0 0 1px var(--line); }
.seg button {
  position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 7px;
  height: 32px; padding: 0 16px; border: 0; border-radius: 999px; background: none;
  color: var(--dim); font-weight: 650; font-size: 12.5px; transition: color 200ms var(--ease-out);
}
.seg button:hover { color: var(--text); }
.seg button.on { color: var(--ink); }
.seg .thumb {
  position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 0; border-radius: 999px; background: var(--text);
  transition: transform 320ms var(--ease-drawer), width 320ms var(--ease-drawer);
}
.seg.small button { height: 28px; padding: 0 10px; }

/* ---------- page ---------- */
.page { max-width: 1180px; margin: 0 auto; padding: 14px var(--pad) 80px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin: 6px 0 22px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 22px; font-weight: 750; letter-spacing: -0.02em; }
.page-head .sub { color: var(--dim); font-size: 12.5px; margin-top: 3px; }
.page-head .grow { flex: 1; min-width: 0; }

.enter > * { animation: enter 550ms var(--ease-out) both; }
.enter > *:nth-child(1) { animation-delay: 40ms; }
.enter > *:nth-child(2) { animation-delay: 100ms; }
.enter > *:nth-child(3) { animation-delay: 160ms; }
.enter > *:nth-child(4) { animation-delay: 220ms; }
.enter > *:nth-child(5) { animation-delay: 280ms; }
.enter > *:nth-child(6) { animation-delay: 340ms; }
.enter > *:nth-child(n+7) { animation-delay: 400ms; }
@keyframes enter { from { opacity: 0; transform: translateY(18px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
/* navigation entre onglets : action fréquente, donc quasi instantanée */
#view.quick .enter > * { animation: swap 160ms var(--ease-out) both; animation-delay: 0ms; }
#view.still .enter > * { animation: none; }
@keyframes swap { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- cartes ---------- */
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 12px; }
.card {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card);
  padding: 16px; min-width: 0;
  transition: border-color 200ms var(--ease-out), transform 200ms var(--ease-out), box-shadow 200ms var(--ease-out);
}
.card.hover:hover { border-color: var(--line-hi); transform: translateY(-2px); box-shadow: 0 14px 24px rgba(0, 0, 0, 0.5); }
.c-12 { grid-column: span 12; } .c-8 { grid-column: span 8; } .c-6 { grid-column: span 6; } .c-4 { grid-column: span 4; } .c-3 { grid-column: span 3; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-head h3 { margin: 0; font-size: 13px; font-weight: 700; flex: 1; letter-spacing: -0.005em; }
.card-head .meta { color: var(--faint); font-size: 11px; font-weight: 600; }
.tile { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: var(--r-xs); background: var(--surface-hi); color: var(--text); flex: none; }
.big { font-size: 26px; font-weight: 750; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.big small { font-size: 13px; font-weight: 600; color: var(--dim); letter-spacing: 0; margin-left: 3px; }
.label { color: var(--faint); font-size: 11px; font-weight: 600; }
.dim { color: var(--dim); }
.faint { color: var(--faint); }

.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.18); flex: none; }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 3px rgba(255, 159, 10, 0.18); }
.dot.bad { background: var(--bad); box-shadow: 0 0 0 3px rgba(255, 69, 58, 0.18); }
.dot.off { background: var(--faint); box-shadow: none; }
.dot.pulse { animation: pulse 2s var(--ease-in-out) infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(52, 199, 89, 0); } }

.bar { height: 6px; border-radius: 999px; background: var(--surface-hi); overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.85); transition: width 700ms var(--ease-out); }
.bar.thick { height: 10px; }
.bar.warn > i { background: var(--warn); }
.bar.bad > i { background: var(--bad); }

.spark { display: block; width: 100%; height: 38px; margin-top: 10px; }
.spark path.line { fill: none; stroke: rgba(255, 255, 255, 0.7); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.spark path.area { fill: rgba(255, 255, 255, 0.06); stroke: none; }
.spark path.line.alt { stroke: rgba(255, 255, 255, 0.32); }

/* ---------- accueil ---------- */
.hero { display: flex; align-items: center; gap: 22px; padding: 18px 22px; overflow: hidden; }
.hero .mascot-wrap { flex: none; margin: -10px -6px -16px -10px; }
.hero h2 { margin: 0 0 4px; font-size: 24px; font-weight: 750; letter-spacing: -0.03em; }
.hero p { margin: 0; color: var(--dim); font-size: 13px; }
.hero .actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.hero .grow { flex: 1; min-width: 0; }
.storage-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.legend { display: flex; justify-content: space-between; margin-top: 10px; color: var(--faint); font-size: 11px; font-weight: 600; }
.bays { display: grid; gap: 8px; }
.bay { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-m); background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); }
.bay .name { font-weight: 600; font-size: 12.5px; }
.bay .grow { flex: 1; min-width: 0; }
.bay.vacant { border-style: dashed; color: var(--faint); background: transparent; }
.bay.sick { border-color: rgba(255, 69, 58, 0.28); background: rgba(255, 69, 58, 0.05); }
.bay-label { width: 52px; color: var(--faint); font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 9px 18px; margin: 0; }
.kv dt { color: var(--faint); font-size: 12px; font-weight: 600; }
.kv dd { margin: 0; font-weight: 600; font-size: 12.5px; text-align: right; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.netrow { display: flex; gap: 20px; }
.netrow > div { flex: 1; }

.banner { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-m); background: rgba(255, 159, 10, 0.08); border: 1px solid rgba(255, 159, 10, 0.22); margin-bottom: 12px; }
.banner .grow { flex: 1; }
.banner b { font-weight: 700; }

/* ---------- mascotte ---------- */
.mascot { display: block; overflow: visible; }
.mascot .m-bob { animation: bob 3.2s var(--ease-in-out) infinite; transform-origin: 0 40px; }
.mascot .m-eye { animation: blink 4.6s infinite; transform-box: fill-box; transform-origin: center; }
.mascot .m-arm { transition: transform 400ms var(--ease-out); }
.mascot .m-arm.is-waving { animation: wave 1.6s var(--ease-in-out) infinite; }
.mascot.mood-busy .m-bob { animation-duration: 0.9s; }
@keyframes bob { 50% { transform: translateY(-2.5px) scale(1.01, 0.99); } }
@keyframes blink { 0%, 46%, 50%, 100% { transform: scaleY(1); } 48% { transform: scaleY(0.1); } }
@keyframes wave { 0%, 100% { transform: translate(44px, 2px) rotate(-150deg); } 50% { transform: translate(44px, 2px) rotate(-120deg); } }

/* ---------- connexion ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-box { width: 100%; max-width: 340px; text-align: center; }
.login-box .wordmark { font-size: 24px; margin: 4px 0 6px; }
.login-box p { color: var(--dim); margin: 0 0 22px; }
.login-box form { display: grid; gap: 10px; }
.field {
  width: 100%; height: 44px; padding: 0 16px; border-radius: var(--r-m);
  background: var(--track); border: 1px solid var(--line); color: var(--text); font-size: 14px;
  transition: border-color 160ms var(--ease-out), background 160ms;
}
.field::placeholder { color: var(--faint); }
.field:focus { outline: none; border-color: rgba(255, 255, 255, 0.35); background: rgba(255, 255, 255, 0.09); }
.login-box .pill { height: 44px; width: 100%; font-size: 14px; }
.err { color: var(--bad); font-size: 12px; font-weight: 600; min-height: 18px; }
.shake { animation: shake 400ms var(--ease-out); }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.login-foot { margin-top: 28px; color: var(--hint); font-size: 11px; text-transform: uppercase; letter-spacing: 3.2px; font-weight: 700; }

/* ---------- fichiers ---------- */
.crumbs { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; font-size: 22px; font-weight: 750; letter-spacing: -0.02em; min-width: 0; }
.crumbs button { border: 0; background: none; padding: 2px 6px; margin: 0 -2px; border-radius: 8px; color: var(--faint); font-weight: inherit; letter-spacing: inherit; transition: color 150ms, background 150ms; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumbs button:hover { color: var(--text); background: var(--surface); }
.crumbs button.cur { color: var(--text); pointer-events: none; }
.crumbs .sep { color: var(--hint); width: 16px; height: 16px; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.search { position: relative; }
.search .i { position: absolute; left: 12px; top: 50%; margin-top: -7.5px; color: var(--faint); pointer-events: none; }
.search input { height: 34px; width: 200px; padding: 0 12px 0 34px; border-radius: 999px; background: var(--track); border: 1px solid var(--line); font-size: 12.5px; transition: border-color 160ms, width 300ms var(--ease-out); }
.search input:focus { outline: none; border-color: rgba(255, 255, 255, 0.3); width: 240px; }
.search input::placeholder { color: var(--faint); }

.files { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.files-head, .row { display: grid; grid-template-columns: 34px minmax(0, 1fr) 110px 150px 84px; align-items: center; gap: 12px; padding: 0 14px; }
.files-head { height: 38px; color: var(--faint); font-size: 11px; font-weight: 700; border-bottom: 1px solid var(--line); text-transform: uppercase; letter-spacing: 0.3px; }
.files-head button { border: 0; background: none; padding: 0; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; text-align: left; display: inline-flex; align-items: center; gap: 4px; }
.files-head button:hover { color: var(--text); }
.files-head .r, .row .r { text-align: right; justify-self: end; }
.row { height: 50px; border-bottom: 1px solid rgba(255, 255, 255, 0.04); cursor: default; transition: background 120ms; position: relative; }
.row:last-child { border-bottom: 0; }
.row:hover { background: rgba(255, 255, 255, 0.035); }
.row.sel { background: rgba(255, 255, 255, 0.07); }
.row .name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.row .name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 13px; }
.row .name button { border: 0; background: none; padding: 0; font: inherit; color: inherit; display: flex; align-items: center; gap: 12px; min-width: 0; text-align: left; }
.row .sz, .row .dt { color: var(--dim); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row .acts { display: flex; gap: 2px; opacity: 0; transition: opacity 150ms; }
.row:hover .acts, .row.sel .acts, .row:focus-within .acts { opacity: 1; }
.check { width: 18px; height: 18px; border-radius: 6px; border: 1.5px solid var(--line-hi); background: transparent; display: grid; place-items: center; padding: 0; transition: background 150ms, border-color 150ms; color: var(--ink); }
.check svg { width: 12px; height: 12px; opacity: 0; stroke-width: 3; }
.check.on { background: var(--text); border-color: var(--text); }
.check.on svg { opacity: 1; }
.row:not(:hover):not(.sel) .check:not(.on) { opacity: 0.5; }
.ftile { width: 30px; height: 30px; border-radius: var(--r-xs); display: grid; place-items: center; background: var(--surface-hi); color: var(--dim); flex: none; overflow: hidden; }
.ftile.folder { background: rgba(255, 255, 255, 0.92); color: var(--ink); }
.ftile img { width: 100%; height: 100%; object-fit: cover; }

.gridview { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.gcard { position: relative; border: 1px solid var(--line); background: var(--surface); border-radius: 16px; padding: 10px; transition: border-color 200ms var(--ease-out), transform 200ms var(--ease-out); text-align: left; }
.gcard:hover { border-color: var(--line-hi); transform: translateY(-2px); }
.gcard.sel { border-color: rgba(255, 255, 255, 0.85); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.85); }
.gcard .thumb { aspect-ratio: 4 / 3; border-radius: 10px; background: rgba(255, 255, 255, 0.04); display: grid; place-items: center; overflow: hidden; color: var(--faint); }
.gcard .thumb img { width: 100%; height: 100%; object-fit: cover; }
.gcard .thumb .i { width: 34px; height: 34px; stroke-width: 1.5; }
.gcard .thumb.folder { background: rgba(255, 255, 255, 0.07); color: var(--text); }
.gcard .t { margin-top: 9px; font-weight: 600; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gcard .s { color: var(--faint); font-size: 11px; margin-top: 1px; font-variant-numeric: tabular-nums; }
.gcard .open { position: absolute; inset: 0; border: 0; background: none; border-radius: 16px; }
.gcard .check { position: absolute; top: 16px; left: 16px; z-index: 2; background: rgba(0, 0, 0, 0.45); }
.gcard .check.on { background: var(--text); }
.gcard:not(:hover):not(.sel) .check { opacity: 0; }

.empty { padding: 64px 20px; text-align: center; color: var(--faint); }
.empty .i { width: 30px; height: 30px; stroke-width: 1.5; opacity: 0.7; }
.empty p { margin: 10px 0 0; font-size: 13px; color: rgba(255, 255, 255, 0.5); }
.skel { height: 50px; border-bottom: 1px solid rgba(255, 255, 255, 0.04); padding: 0 14px; display: flex; align-items: center; gap: 12px; }
.skel i { display: block; height: 10px; border-radius: 6px; background: rgba(255, 255, 255, 0.05); animation: skel 0.9s ease-in-out infinite alternate; }
@keyframes skel { to { background: rgba(255, 255, 255, 0.09); } }

/* barre de sélection */
.selbar {
  position: fixed; left: 50%; bottom: 22px; z-index: 30; transform: translate(-50%, 140%);
  display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 16px; border-radius: 999px;
  background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--line); box-shadow: var(--shadow);
  opacity: 0; pointer-events: none;
  transition: transform 420ms var(--ease-drawer), opacity 200ms var(--ease-out);
}
.selbar.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.selbar .count { font-weight: 700; font-size: 12.5px; margin-right: 6px; white-space: nowrap; }

/* dépôt de fichiers */
.drop {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; pointer-events: none;
  background: rgba(10, 10, 15, 0.6); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  opacity: 0; transition: opacity 200ms var(--ease-out);
}
.drop.show { opacity: 1; }
.drop .zone { width: min(520px, 86vw); padding: 44px 24px; border-radius: var(--r-l); border: 1.5px dashed rgba(255, 255, 255, 0.35); text-align: center; background: rgba(255, 255, 255, 0.03); transform: scale(0.96); transition: transform 300ms var(--ease-out); }
.drop.show .zone { transform: none; }
.drop .zone b { display: block; font-size: 17px; font-weight: 750; margin-top: 4px; }
.drop .zone span { color: var(--dim); }

/* envois en cours */
.uploads {
  position: fixed; right: 22px; bottom: 22px; z-index: 40; width: 340px; max-width: calc(100vw - 32px);
  background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow); overflow: hidden;
  animation: rise 320ms var(--ease-out);
}
@keyframes rise { from { opacity: 0; transform: translateY(16px) scale(0.98); } }
.uploads header { display: flex; align-items: center; gap: 10px; padding: 12px 10px 12px 16px; border-bottom: 1px solid var(--line); }
.uploads header b { flex: 1; font-size: 13px; }
.uploads .list { max-height: 260px; overflow: auto; padding: 6px 0; }
.up { padding: 7px 16px; }
.up .l { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; margin-bottom: 6px; }
.up .l span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.up .l span:last-child { color: var(--faint); font-variant-numeric: tabular-nums; flex: none; }
.up .bar { height: 4px; }
.up.done .bar > i { background: var(--ok); }
.up.error .bar > i { background: var(--bad); }

/* ---------- feuilles (modales) ---------- */
.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, 0.55); display: grid; place-items: center; padding: 20px; animation: fade 200ms var(--ease-out); }
@keyframes fade { from { opacity: 0; } }
.sheet {
  width: 100%; max-width: 400px; background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-l);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6); padding: 22px; animation: pop 260ms var(--ease-out);
}
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(0.97); } }
.sheet h3 { margin: 0 0 6px; font-size: 17px; font-weight: 750; letter-spacing: -0.02em; }
.sheet p { margin: 0 0 16px; color: var(--dim); }
.sheet .field { margin-bottom: 10px; }
.sheet .btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }

.viewer { position: fixed; inset: 0; z-index: 70; background: rgba(5, 5, 8, 0.94); display: flex; flex-direction: column; animation: fade 200ms var(--ease-out); }
.viewer header { display: flex; align-items: center; gap: 12px; padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
.viewer header b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.viewer .stage { flex: 1; min-height: 0; display: grid; place-items: center; padding: 0 16px 20px; }
.viewer img, .viewer video { max-width: 100%; max-height: 100%; border-radius: 12px; box-shadow: var(--shadow); }
.viewer iframe { width: 100%; height: 100%; border: 0; border-radius: 12px; background: #fff; }
.viewer pre { width: min(900px, 100%); height: 100%; margin: 0; overflow: auto; padding: 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font: 12.5px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.viewer audio { width: min(520px, 90vw); }
.viewer .nav { position: absolute; top: 50%; margin-top: -22px; width: 44px; height: 44px; background: var(--glass); border: 1px solid var(--line); }
.viewer .nav.prev { left: 16px; } .viewer .nav.next { right: 16px; }

/* ---------- toasts ---------- */
#toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast {
  display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 999px;
  background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--line); box-shadow: var(--shadow); font-weight: 600; font-size: 12.5px;
  animation: rise 300ms var(--ease-out);
}
.toast.out { opacity: 0; transform: translateY(8px); transition: all 250ms var(--ease-out); }

/* ---------- système ---------- */
.copy { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px; border-radius: var(--r-s); background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); margin-top: 8px; }
.copy code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 12px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text); }
.copy .label { width: 64px; flex: none; }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; }
.foot { margin-top: 26px; display: flex; justify-content: space-between; gap: 12px; color: var(--hint); font-size: 11px; font-weight: 600; flex-wrap: wrap; }
.foot a { color: var(--faint); text-decoration: none; }
.foot a:hover { color: var(--text); }
.offline { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; background: rgba(10, 10, 15, 0.92); text-align: center; padding: 24px; }
.offline h2 { margin: 12px 0 6px; font-size: 20px; letter-spacing: -0.02em; }
.offline p { margin: 0; color: var(--dim); }

/* ---------- maison ---------- */
.log { margin: 0; padding: 12px 14px; border-radius: var(--r-s); background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); font: 500 11.5px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--dim); white-space: pre-wrap; word-break: break-word; max-height: 260px; overflow: auto; }
.hk-pair { display: flex; gap: 16px; align-items: center; margin-top: 12px; }
.hk-qr { width: 132px; height: 132px; flex: none; border-radius: var(--r-s); background: #fff; padding: 0; image-rendering: pixelated; transition: opacity 200ms var(--ease-out); }
.hk-qr.used { opacity: 0.35; }
@media (max-width: 640px) { .hk-pair { flex-direction: column; align-items: stretch; } .hk-qr { align-self: center; width: 180px; height: 180px; } }
.dot.info { background: var(--info); box-shadow: 0 0 0 3px rgba(90, 169, 255, 0.18); }

/* ---------- petits écrans ---------- */
@media (max-width: 900px) {
  :root { --pad: 18px; }
  .c-8, .c-6, .c-4 { grid-column: span 12; }
  .c-3 { grid-column: span 6; }
  .files-head, .row { grid-template-columns: 30px minmax(0, 1fr) 84px 60px; }
  .files-head .dt, .row .dt { display: none; }
}
@media (max-width: 640px) {
  .topbar { height: auto; flex-wrap: wrap; row-gap: 10px; padding-top: calc(12px + env(safe-area-inset-top, 0px)); padding-bottom: 10px; }
  .topbar .seg { order: 3; width: 100%; }
  .topbar .seg button { flex: 1; justify-content: center; padding: 0 8px; }
  .host .hn { display: none; }
  .hero { flex-direction: column; text-align: center; }
  .hero .actions { justify-content: center; }
  .crumbs { font-size: 18px; }
  .search input, .search input:focus { width: 100%; }
  .search { flex: 1; }
  .files-head, .row { grid-template-columns: 26px minmax(0, 1fr) 70px 36px; gap: 8px; padding: 0 10px; }
  .row .acts { opacity: 1; }
  .row .acts .hide-sm { display: none; }
  .uploads { right: 16px; bottom: 16px; }
  .gridview { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}
