/* Casier : design system v1.0 (Geist / Geist Mono, grille de 4 px). Tokens clair + sombre (AA).
   Le thème suit prefers-color-scheme ; html.dark / html.light forcent un choix (menu compte). */

@font-face { font-family: 'Geist'; font-style: normal; font-weight: 400 600; font-display: swap; src: url('../fonts/geist-latin.woff2') format('woff2'); }
@font-face { font-family: 'Geist Mono'; font-style: normal; font-weight: 400 500; font-display: swap; src: url('../fonts/geist-mono-latin.woff2') format('woff2'); }

:root {
  --bg: #F7F7F8; --surface: #FFFFFF; --surface-2: #F1F1F4; --hover: #EDEDF1; --border: #E2E2E8; --border-strong: #C9C9D2;
  --text: #17171C; --text-2: #55555F; --text-3: #6B6B75;
  --accent: #2B5FD9; --accent-hover: #234FB8; --accent-fg: #FFFFFF; --accent-soft: #E9EFFD; --accent-soft-fg: #1F4AAE;
  --shared: #7044C9; --shared-soft: #F1EBFC; --success: #1D7A4B; --success-soft: #E5F4EC;
  --warning: #9A5800; --warning-soft: #FDF1DF; --warning-bar: #E09B2D; --danger: #C22F2F; --danger-soft: #FCE9E9;
  --teal: #14705C; --teal-soft: #E3F3EF; --focus: #2B5FD9; --overlay: rgba(23, 23, 28, .45); --scrim: rgba(23, 23, 28, .45);
  --stage: #ECECEF; --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 8px 24px rgba(0, 0, 0, .08);
  color-scheme: light;
}
html.dark {
  --bg: #0D0D10; --surface: #151519; --surface-2: #1C1C21; --hover: #232329; --border: #2A2A31; --border-strong: #3A3A43;
  --text: #EDEDF1; --text-2: #B0B0BA; --text-3: #8F8F99;
  --accent: #7EA4FF; --accent-hover: #9BB8FF; --accent-fg: #0D0D10; --accent-soft: #1B2442; --accent-soft-fg: #A9C2FF;
  --shared: #B596F5; --shared-soft: #261D3B; --success: #55C68F; --success-soft: #14291F;
  --warning: #F0AA4A; --warning-soft: #2E2213; --warning-bar: #F0AA4A; --danger: #FF7A7A; --danger-soft: #331818;
  --teal: #5FD0B0; --teal-soft: #12271F; --focus: #7EA4FF; --overlay: rgba(0, 0, 0, .6); --scrim: rgba(0, 0, 0, .6);
  --stage: #08080A; --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 32px rgba(0, 0, 0, .5);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  html:not(.light) {
    --bg: #0D0D10; --surface: #151519; --surface-2: #1C1C21; --hover: #232329; --border: #2A2A31; --border-strong: #3A3A43;
    --text: #EDEDF1; --text-2: #B0B0BA; --text-3: #8F8F99;
    --accent: #7EA4FF; --accent-hover: #9BB8FF; --accent-fg: #0D0D10; --accent-soft: #1B2442; --accent-soft-fg: #A9C2FF;
    --shared: #B596F5; --shared-soft: #261D3B; --success: #55C68F; --success-soft: #14291F;
    --warning: #F0AA4A; --warning-soft: #2E2213; --warning-bar: #F0AA4A; --danger: #FF7A7A; --danger-soft: #331818;
    --teal: #5FD0B0; --teal-soft: #12271F; --focus: #7EA4FF; --overlay: rgba(0, 0, 0, .6); --scrim: rgba(0, 0, 0, .6);
    --stage: #08080A; --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 32px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: 'Geist', system-ui, sans-serif; color: var(--text); background: var(--bg);
  font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { margin: 0; }
[hidden] { display: none !important; }
.mono { font-family: 'Geist Mono', ui-monospace, monospace; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--text-3); }
.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
@media (prefers-reduced-motion: no-preference) {
  .btn, .nav, .mi, .card, .seg, .pill { transition: background-color .15s ease-out, border-color .15s ease-out, color .15s ease-out; }
  .modal, .menu, .toast, .sheet { animation: pop .16s ease-out; }
  @keyframes pop { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
}

/* ---------------------------------------------------------------- boutons, champs */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 14px;
  border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none;
}
.btn:hover { background: var(--hover); color: var(--text); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn-primary:hover { background: var(--accent-hover); color: var(--accent-fg); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-danger { color: var(--danger); }
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #FFFFFF; }
.btn-danger-solid:hover { background: var(--danger); filter: brightness(.92); color: #FFFFFF; }
.btn-sm { height: 32px; padding: 0 10px; font-size: 13px; }
.icon-btn { width: 40px; padding: 0; }
.icon-btn.sm { width: 36px; height: 36px; }
.input {
  height: 40px; border: 1px solid var(--border); background: var(--surface); border-radius: 8px;
  padding: 0 12px; width: 100%; color: var(--text);
}
.input[aria-invalid='true'] { border-color: var(--danger); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 13px; font-weight: 500; }
.hint { font-size: 12px; color: var(--text-3); }
.hint.err { color: var(--danger); }
.hint.warn { color: var(--warning); }
.lbl { font-size: 12px; font-weight: 500; color: var(--text-3); }
.check { display: flex; align-items: center; gap: 10px; min-height: 32px; font-size: 13px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.kbd { margin-left: auto; font-family: 'Geist Mono', ui-monospace, monospace; font-size: 11px; color: var(--text-3); }
.kbd-box { font-family: 'Geist Mono', ui-monospace, monospace; font-size: 11px; border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px; }

/* ---------------------------------------------------------------- badges, tuiles de type */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.b-admin, .b-private { background: var(--accent-soft); color: var(--accent-soft-fg); }
.b-shared { background: var(--shared-soft); color: var(--shared); }
.b-user { background: var(--surface-2); color: var(--text-2); }
.b-ok { background: var(--success-soft); color: var(--success); }
.b-warn { background: var(--warning-soft); color: var(--warning); }
.b-bad { background: var(--danger-soft); color: var(--danger); }
.badge .i { width: 14px; height: 14px; }

.tile {
  width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; flex: none;
  font-family: 'Geist Mono', ui-monospace, monospace; font-size: 9px; font-weight: 600;
}
.k-dir { background: var(--accent-soft); color: var(--accent-soft-fg); }
.k-dirs { background: var(--shared-soft); color: var(--shared); }
.k-pdf { background: var(--danger-soft); color: var(--danger); }
.k-img { background: var(--success-soft); color: var(--success); }
.k-doc { background: var(--surface-2); color: var(--text-2); }
.k-xls { background: var(--teal-soft); color: var(--teal); }
.k-zip { background: var(--warning-soft); color: var(--warning); }
.k-vid { background: var(--shared-soft); color: var(--shared); }

.bar { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; display: flex; }
.bar > span { display: block; height: 100%; background: var(--accent); }
.bar > span.shared { background: var(--shared); }
.bar > span.warn { background: var(--warning-bar); }
.bar > span.ok { background: var(--success); }
.bar.thin { height: 4px; border-radius: 2px; }
.bar.thick { height: 12px; border-radius: 6px; gap: 2px; }

/* ---------------------------------------------------------------- application (explorateur) */
.app { min-height: 100vh; display: flex; flex-wrap: wrap; position: relative; background: var(--bg); }
.side {
  flex: 1 1 248px; max-width: 280px; background: var(--surface); border-right: 1px solid var(--border);
  padding: 16px; display: flex; flex-direction: column; gap: 20px; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 4px; font-size: 16px; font-weight: 600; text-decoration: none; color: var(--text); }
.brand .logo { width: 28px; height: 28px; border-radius: 7px; background: var(--accent); display: grid; place-items: center; color: var(--accent-fg); }
.side-title { font-size: 12px; font-weight: 500; color: var(--text-3); padding: 0 12px 6px; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.nav {
  display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border-radius: 8px; border: 0;
  background: transparent; color: var(--text-2); font-weight: 500; width: 100%; text-align: left; cursor: pointer; text-decoration: none;
}
.nav:hover { background: var(--hover); color: var(--text); }
.nav.on { background: var(--accent-soft); color: var(--accent-soft-fg); }
.nav.on-shared { background: var(--shared-soft); color: var(--shared); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 16px; }
.storage { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; }
.storage-row { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
.storage-row strong { font-weight: 500; }
.me { position: relative; }
.me-btn { display: flex; align-items: center; gap: 10px; padding: 4px; border: 0; background: transparent; width: 100%; text-align: left; cursor: pointer; border-radius: 8px; }
.me-btn:hover { background: var(--hover); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-size: 12px; font-weight: 600; flex: none; text-transform: uppercase; }
.avatar.lg { width: 40px; height: 40px; font-size: 14px; }
.me-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.me-text strong { font-weight: 500; font-size: 13px; text-transform: capitalize; }
.me-text span { font-size: 12px; color: var(--text-3); }

.main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 12px 32px; border-bottom: 1px solid var(--border); background: var(--surface); flex-wrap: wrap; }
.search {
  flex: 1 1 280px; max-width: 560px; display: flex; align-items: center; gap: 8px; height: 40px;
  border: 1px solid var(--border); border-radius: 8px; padding: 0 12px; background: var(--bg); color: var(--text-3);
}
.search input { flex: 1; min-width: 0; border: 0; background: transparent; height: 38px; outline: none; color: var(--text); }
.topbar-end { margin-left: auto; display: flex; gap: 4px; }

.head { padding: 24px 32px 0; display: flex; flex-direction: column; gap: 16px; }
.head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.head-title { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.head-title h1 { font-size: 24px; font-weight: 600; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.crumbs { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--text-2); flex-wrap: wrap; }
.crumbs button { border: 0; background: transparent; color: var(--text-2); padding: 2px 4px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.crumbs button:hover { color: var(--text); background: var(--hover); }
.crumbs button.badge { padding: 0 8px; }
.crumbs [aria-current='page'] { color: var(--text); font-weight: 500; }
.crumbs .i { width: 14px; height: 14px; color: var(--text-3); }
.actions { display: flex; gap: 8px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.toolbar-group { display: flex; align-items: center; gap: 8px; }
.segbox { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; padding: 2px; background: var(--surface-2); }
.seg { width: 36px; height: 32px; border: 0; border-radius: 6px; background: transparent; color: var(--text-2); display: grid; place-items: center; cursor: pointer; }
.seg.on, .pill.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.pill { height: 32px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: var(--text-2); cursor: pointer; font-size: 13px; font-weight: 500; }

.content { padding: 16px 32px 120px; }
.panel { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
table.files { width: 100%; border-collapse: collapse; table-layout: fixed; }
.files th { height: 40px; text-align: left; font-size: 12px; font-weight: 500; color: var(--text-3); border-bottom: 1px solid var(--border); padding: 0 12px; }
.files td { height: 52px; border-bottom: 1px solid var(--border); padding: 0 12px; font-size: 13px; color: var(--text-2); }
.files tbody tr:last-child td { border-bottom: 0; }
.files tbody tr:hover td { background: var(--hover); }
.files tr.sel td { background: var(--accent-soft); }
.files tr.drop td { background: var(--shared-soft); }
.files .col-size, .files .col-date { width: 140px; }
.files .col-act { width: 56px; text-align: right; position: relative; }
.th-btn { border: 0; background: transparent; color: inherit; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; height: 32px; padding: 0 6px; margin-left: -6px; border-radius: 6px; font-size: 12px; font-weight: 500; }
.th-btn:hover, .th-btn.on { color: var(--text); }
.name-btn { border: 0; background: transparent; display: flex; align-items: center; gap: 12px; font-weight: 500; color: var(--text); cursor: pointer; padding: 0; text-align: left; font-size: 14px; min-height: 44px; width: 100%; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.card { position: relative; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.card:hover { border-color: var(--border-strong); }
.card.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.card.drop { border-color: var(--shared); box-shadow: 0 0 0 1px var(--shared); }
.card-btn { border: 0; background: transparent; padding: 0; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.card-meta { display: flex; flex-direction: column; gap: 2px; padding-right: 36px; min-width: 0; }
.card-meta strong { font-weight: 500; font-size: 13px; }
.card-meta span { font-size: 12px; color: var(--text-3); }
.card .more { position: absolute; right: 6px; bottom: 8px; }
.thumb { height: 108px; border-radius: 8px; display: grid; place-items: center; font-family: 'Geist Mono', ui-monospace, monospace; font-size: 13px; font-weight: 600; overflow: hidden; }
.thumb .i { width: 32px; height: 32px; stroke-width: 1.5; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }

.empty { border: 1px dashed var(--border-strong); border-radius: 14px; padding: 48px 24px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.empty .i { width: 28px; height: 28px; color: var(--text-3); }
.empty span { color: var(--text-2); font-size: 13px; }
.loading { padding: 48px; text-align: center; color: var(--text-3); }

/* ---------------------------------------------------------------- menus, feuilles, modales */
.menu { position: fixed; z-index: 40; width: 232px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); padding: 4px; }
.mi { display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; text-align: left; cursor: pointer; color: var(--text); font-size: 14px; text-decoration: none; }
.mi:hover, .mi:focus-visible { background: var(--hover); }
.mi.danger, .mi.danger .kbd { color: var(--danger); }
.sep { height: 1px; background: var(--border); margin: 4px 0; }
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 45; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 46; background: var(--surface); border-radius: 20px 20px 0 0; box-shadow: var(--shadow); padding: 8px 0 24px; max-height: 85vh; overflow-y: auto; }
.grabber { width: 36px; height: 4px; border-radius: 2px; background: var(--border-strong); margin: 0 auto 8px; }
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 8px 20px 16px; border-bottom: 1px solid var(--border); }
.sheet-head .tile { width: 40px; height: 40px; border-radius: 10px; font-size: 10px; }
.sheet-head strong { font-weight: 600; font-size: 15px; }
.sheet-head span { font-size: 13px; color: var(--text-3); }
.sheet .mi { min-height: 52px; height: auto; padding: 0 20px; font-size: 16px; gap: 14px; border-radius: 0; }
.sheet .mi .kbd { display: none; }

.modal-wrap { position: fixed; inset: 0; z-index: 50; background: var(--overlay); display: grid; place-items: center; padding: 16px; }
.modal { width: 100%; max-width: 440px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); padding: 24px; display: flex; flex-direction: column; gap: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }
.modal h2 { font-size: 18px; font-weight: 600; }
.modal p { margin: 0; color: var(--text-2); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.picker { border: 1px solid var(--border); border-radius: 10px; max-height: 280px; overflow-y: auto; }
.picker button { display: flex; align-items: center; gap: 10px; width: 100%; height: 44px; padding: 0 12px; border: 0; border-bottom: 1px solid var(--border); background: transparent; text-align: left; cursor: pointer; }
.picker button:last-child { border-bottom: 0; }
.picker button:hover { background: var(--hover); }

.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; width: min(420px, calc(100% - 32px)); }
.toast { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); padding: 12px 14px; font-size: 13px; }
.toast span { flex: 1; }
.toast.ok .i { color: var(--success); }
.toast.err { border-color: var(--danger); }
.toast.err .i { color: var(--danger); }

/* ---------------------------------------------------------------- envois, dépôt */
.uploads { position: fixed; right: 24px; bottom: 24px; width: 380px; max-width: calc(100% - 32px); border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; z-index: 30; }
.up-head { display: flex; flex-direction: column; gap: 8px; padding: 12px 8px 12px 16px; border-bottom: 1px solid var(--border); }
.up-title { display: flex; align-items: center; gap: 8px; }
.up-title strong { font-weight: 600; font-size: 13px; flex: 1; }
.up-head .bar { margin-right: 8px; }
.up-list { list-style: none; margin: 0; padding: 4px 0; max-height: 320px; overflow-y: auto; }
.up-list li { display: flex; align-items: center; gap: 12px; padding: 10px 8px 10px 16px; }
.up-list li.err { background: var(--danger-soft); }
.up-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.up-line { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.up-line strong { font-weight: 500; }
.up-state { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.up-state.ok { color: var(--success); }
.up-state.err { color: var(--danger); white-space: normal; }
.uploads.min .up-list { display: none; }

.dropzone { position: fixed; inset: 12px; z-index: 35; border: 2px dashed var(--accent); border-radius: 16px; background: var(--overlay); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 24px; pointer-events: none; color: #FFFFFF; }
.dropzone.shared { border-color: var(--shared); }
.dropzone strong { font-size: 20px; font-weight: 600; }
.dropzone .target { font-weight: 600; }
.dropzone .i { width: 40px; height: 40px; }

/* ---------------------------------------------------------------- aperçu */
.viewer { position: fixed; inset: 0; z-index: 55; display: flex; flex-direction: column; background: var(--stage); }
.viewer-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.viewer-name { display: flex; flex-direction: column; min-width: 0; flex: 1 1 200px; line-height: 1.25; }
.viewer-name strong { font-weight: 600; }
.viewer-name span { font-size: 12px; color: var(--text-3); }
.viewer-nav { display: flex; align-items: center; gap: 4px; }
.viewer-nav .vsep { width: 1px; height: 24px; background: var(--border); margin: 0 6px; }
.viewer-body { flex: 1; display: flex; min-height: 0; }
.stage { flex: 999 1 480px; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 24px; gap: 16px; overflow: auto; }
.stage img, .stage video { max-width: 100%; max-height: calc(100vh - 180px); border-radius: 4px; box-shadow: var(--shadow); background: var(--surface); }
.stage audio { width: min(520px, 100%); }
.textview { width: 100%; max-width: 820px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); overflow: hidden; align-self: stretch; margin: 0 auto; }
.textview-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--border); font-size: 12px; color: var(--text-3); }
.textview pre { margin: 0; padding: 16px 0; overflow: auto; max-height: calc(100vh - 220px); font-family: 'Geist Mono', ui-monospace, monospace; font-size: 13px; line-height: 1.7; counter-reset: ln; }
.textview pre span { display: block; padding: 0 24px 0 0; white-space: pre; }
.textview pre span::before { counter-increment: ln; content: counter(ln); display: inline-block; width: 56px; padding-right: 16px; text-align: right; color: var(--text-3); user-select: none; }
.noview { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; color: var(--text-2); }
.noview .tile { width: 64px; height: 64px; border-radius: 14px; font-size: 13px; }
.details { flex: 1 1 300px; max-width: 340px; background: var(--surface); border-left: 1px solid var(--border); padding: 24px; display: flex; flex-direction: column; gap: 24px; overflow-y: auto; }
.details strong { font-weight: 600; }
dl.meta { margin: 0; display: grid; grid-template-columns: 110px 1fr; row-gap: 10px; column-gap: 12px; font-size: 13px; }
dl.meta dt { color: var(--text-3); }
dl.meta dd { margin: 0; color: var(--text); min-width: 0; overflow-wrap: anywhere; }
.details-foot { margin-top: auto; font-size: 12px; color: var(--text-3); display: flex; flex-direction: column; gap: 4px; }

/* ---------------------------------------------------------------- mobile (< 720 px) */
.mhead, .mtabs, .fab, .mback { display: none; }
@media (max-width: 720px) {
  .hide-sm { display: none !important; }
  .side { display: none; }
  .topbar { display: none; }
  .mhead { display: flex; flex-direction: column; gap: 12px; padding: 12px 16px 8px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
  .mhead-row { display: flex; align-items: center; gap: 8px; }
  .mhead-row .brand { flex: 1; padding: 0; }
  .mhead .search { max-width: none; }
  .mtabs { display: flex; padding: 2px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
  .tabbtn { flex: 1; height: 40px; border: 0; border-radius: 8px; background: transparent; color: var(--text-2); font-weight: 500; font-size: 14px; display: flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; }
  .tabbtn.on { background: var(--surface); color: var(--accent-soft-fg); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
  .tabbtn.on.shared { color: var(--shared); }
  .i { width: 20px; height: 20px; }
  .head { padding: 8px 8px 0 4px; gap: 8px; }
  .head-row { flex-wrap: nowrap; align-items: center; gap: 4px; }
  .mback { display: grid; }
  .head-title { flex: 1; gap: 0; line-height: 1.25; }
  .head-title h1 { font-size: 20px; }
  .crumbs.desk { display: none; }
  .mcrumb { font-size: 12px; color: var(--text-3); }
  .actions .btn-label { display: none; }
  .actions { gap: 0; }
  .actions .btn { width: 44px; height: 44px; padding: 0; border: 0; background: transparent; color: var(--text-2); }
  .toolbar { padding: 0 12px; }
  .content { padding: 4px 0 112px; }
  .panel { border: 0; border-radius: 0; background: transparent; }
  .files td { height: 64px; padding: 0 4px 0 16px; }
  .files thead { display: none; }
  .files .tile { width: 40px; height: 40px; border-radius: 10px; font-size: 10px; }
  .name-btn { font-size: 15px; }
  .name-sub { display: block; font-size: 13px; font-weight: 400; color: var(--text-3); }
  .grid { padding: 0 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .thumb { height: 96px; }
  .fab { display: grid; position: fixed; right: 16px; bottom: 24px; width: 56px; height: 56px; border-radius: 16px; border: 0; background: var(--accent); color: var(--accent-fg); place-items: center; box-shadow: 0 6px 20px rgba(0, 0, 0, .2); cursor: pointer; z-index: 25; }
  .uploads { left: 0; right: 0; bottom: 0; width: auto; max-width: none; border-radius: 20px 20px 0 0; }
  .details { display: none; }
  .viewer-nav .hide-xs { display: none; }
  .btn, .icon-btn { min-height: 44px; }
  .icon-btn { width: 44px; }
}
@media (min-width: 721px) { .name-sub { display: none; } .mcrumb { display: none; } }

/* ---------------------------------------------------------------- connexion */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-box { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 32px; }
.login-brand { display: flex; flex-direction: column; gap: 20px; }
.login-logo { width: 48px; height: 48px; border-radius: 12px; background: var(--accent); display: grid; place-items: center; color: var(--accent-fg); }
.login h1 { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; }
.login p { margin: 6px 0 0; color: var(--text-2); font-size: 15px; }
.login form { display: flex; flex-direction: column; gap: 16px; }
.login .btn, .login .input { height: 48px; border-radius: 10px; }
.login .btn { font-size: 15px; }
.login .input { font-size: 16px; padding: 0 14px; }
.login .label { font-size: 14px; }
.pw { position: relative; }
.pw .input { padding-right: 52px; }
.pw button { position: absolute; right: 2px; top: 2px; width: 44px; height: 44px; border: 0; background: transparent; color: var(--text-2); display: grid; place-items: center; cursor: pointer; border-radius: 8px; }
.login .check { min-height: 44px; font-size: 14px; color: var(--text-2); }
.login .check input { width: 20px; height: 20px; }
.alert { border: 1px solid var(--danger); background: var(--danger-soft); color: var(--danger); border-radius: 10px; padding: 10px 14px; font-size: 14px; }
.login-foot { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); }
.login-foot span { display: inline-flex; align-items: center; gap: 6px; }
.login-foot .i { width: 14px; height: 14px; }

/* ---------------------------------------------------------------- administration */
.admin-head { background: var(--surface); border-bottom: 1px solid var(--border); }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 32px; }
.admin-bar { display: flex; align-items: center; gap: 12px; height: 64px; flex-wrap: wrap; }
.admin-bar .vbar { width: 1px; height: 24px; background: var(--border); }
.admin-bar h1 { font-size: 18px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.tabs { display: flex; gap: 24px; overflow-x: auto; }
.tab { display: inline-flex; align-items: center; height: 44px; padding: 0 4px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--text-2); font-weight: 500; cursor: pointer; }
.tab.on { border-color: var(--accent); color: var(--text); }
.admin-body { max-width: 1280px; margin: 0 auto; padding: 32px; display: flex; flex-direction: column; gap: 24px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.box { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); padding: 20px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.box.wide { grid-column: span 2; gap: 16px; }
.big { font-size: 28px; font-weight: 600; letter-spacing: -0.01em; }
.big small { font-size: 16px; font-weight: 400; color: var(--text-2); }
.box-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.legend { display: flex; gap: 20px; flex-wrap: wrap; font-size: 13px; }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.sw { width: 10px; height: 10px; border-radius: 3px; background: var(--accent); }
.sw.shared { background: var(--shared); }
.sw.free { background: var(--surface-2); border: 1px solid var(--border-strong); }
.split { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.split-main { flex: 999 1 640px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.split-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.split-head h2 { font-size: 18px; font-weight: 600; }
.split-tools { display: flex; gap: 8px; flex: 1 1 320px; justify-content: flex-end; }
.split-tools .search { max-width: 280px; background: var(--surface); }
.table-wrap { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); overflow-x: auto; }
table.users { width: 100%; border-collapse: collapse; min-width: 760px; }
.users th { height: 40px; text-align: left; font-size: 12px; font-weight: 500; color: var(--text-3); border-bottom: 1px solid var(--border); padding: 0 16px; }
.users td { height: 60px; border-bottom: 1px solid var(--border); padding: 0 16px; font-size: 13px; color: var(--text-2); }
.users tbody tr:last-child td { border-bottom: 0; }
.users tbody tr { cursor: pointer; }
.users tbody tr:hover td { background: var(--hover); }
.users tr.sel td { background: var(--accent-soft); }
.who { display: flex; align-items: center; gap: 12px; }
.who strong { font-weight: 500; color: var(--text); font-size: 14px; text-transform: capitalize; }
.quota-cell { display: flex; flex-direction: column; gap: 6px; width: 200px; }
.edit { flex: 1 1 300px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); padding: 20px; display: flex; flex-direction: column; gap: 20px; position: sticky; top: 16px; }
.edit-who { display: flex; align-items: center; gap: 12px; }
.edit-who h2 { font-size: 16px; font-weight: 600; text-transform: capitalize; }
.presets { display: flex; border: 1px solid var(--border); border-radius: 8px; padding: 2px; background: var(--surface-2); }
.presets .seg { width: auto; flex: 1; height: 36px; padding: 0 12px; font-size: 13px; font-weight: 500; }
.edit-foot { display: flex; gap: 8px; justify-content: space-between; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 16px; }
.edit-foot > div { display: flex; gap: 8px; }
select.input { appearance: auto; }
@media (max-width: 720px) {
  .wrap, .admin-body { padding-left: 16px; padding-right: 16px; }
  .admin-body { padding-top: 16px; }
  .box.wide { grid-column: auto; }
  .edit { position: static; }
}
