/* ───────────── Modèles Roblox — style ───────────── */

@font-face {
  font-family: "Inter";
  src: url("inter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  src: url("inter-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308,
    U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --ease: cubic-bezier(.32, .72, 0, 1);
  --spring: cubic-bezier(.34, 1.4, .64, 1);
  --radius: 14px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0a0c;
  --bg-glow: rgba(10, 132, 255, .07);
  --card: #1c1c1e;
  --card-2: #2c2c2e;
  --card-3: #3a3a3c;
  --glass: rgba(30, 30, 33, .78);
  --pop: rgba(38, 38, 41, .97);
  --header: rgba(10, 10, 12, .72);
  --sep: rgba(255, 255, 255, .07);
  --sep-2: rgba(255, 255, 255, .13);
  --text: #f5f5f7;
  --text-2: #a1a1a6;
  --text-3: #6e6e73;
  --accent: #0a84ff;
  --accent-2: #5eb0ff;
  --accent-soft: rgba(10, 132, 255, .17);
  --green: #30d158;
  --green-soft: rgba(48, 209, 88, .16);
  --red: #ff453a;
  --red-soft: rgba(255, 69, 58, .15);
  --orange: #ff9f0a;
  --purple: #bf5af2;
  --teal: #64d2ff;
  --pink: #ff375f;
  --gray: #8e8e93;
  --hover: rgba(255, 255, 255, .045);
  --press: rgba(255, 255, 255, .08);
  --input: rgba(118, 118, 128, .24);
  --shadow: 0 18px 50px rgba(0, 0, 0, .55), 0 2px 10px rgba(0, 0, 0, .35);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --folder-a: #5cb0ff;
  --folder-b: #2a88f2;
  --folder-tab: #2f8cf5;
  --page: #3a3a3c;
  --page-fold: #545458;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f5f7;
  --bg-glow: rgba(0, 122, 255, .06);
  --card: #ffffff;
  --card-2: #f2f2f7;
  --card-3: #e5e5ea;
  --glass: rgba(255, 255, 255, .82);
  --pop: rgba(255, 255, 255, .97);
  --header: rgba(245, 245, 247, .74);
  --sep: rgba(0, 0, 0, .07);
  --sep-2: rgba(0, 0, 0, .13);
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #a1a1a6;
  --accent: #007aff;
  --accent-2: #3395ff;
  --accent-soft: rgba(0, 122, 255, .11);
  --green: #28b04c;
  --green-soft: rgba(52, 199, 89, .14);
  --red: #ff3b30;
  --red-soft: rgba(255, 59, 48, .1);
  --orange: #ff9500;
  --purple: #af52de;
  --teal: #32ade6;
  --pink: #ff2d55;
  --gray: #8e8e93;
  --hover: rgba(0, 0, 0, .035);
  --press: rgba(0, 0, 0, .06);
  --input: rgba(118, 118, 128, .12);
  --shadow: 0 18px 50px rgba(0, 0, 0, .14), 0 2px 10px rgba(0, 0, 0, .06);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .06);
  --folder-a: #6cb8ff;
  --folder-b: #3592f7;
  --folder-tab: #3d93f7;
  --page: #ffffff;
  --page-fold: #d8d8dd;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.4;
  color: var(--text);
  background: var(--bg);
  background-image: radial-gradient(1200px 600px at 85% -10%, var(--bg-glow), transparent 60%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01";
}
.theme-switching, .theme-switching * {
  transition: background-color .4s var(--ease), color .4s var(--ease), border-color .4s var(--ease),
    fill .4s var(--ease), stroke .4s var(--ease), box-shadow .4s var(--ease) !important;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; -webkit-tap-highlight-color: transparent; }
svg { display: block; }
[hidden] { display: none !important; }
::selection { background: var(--accent-soft); }

/* ───────────── Boutons ───────────── */

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: 10px;
  background: var(--card-2); color: var(--text);
  font-weight: 550; font-size: 14px; white-space: nowrap;
  transition: background .2s var(--ease), transform .2s var(--ease), opacity .2s;
}
.btn:hover { background: var(--card-3); }
.btn:active { transform: scale(.96); }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); }
.btn.danger { background: var(--red-soft); color: var(--red); }
.btn.danger.solid { background: var(--red); color: #fff; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.ghost.on { background: var(--accent-soft); }
.btn:disabled { opacity: .45; pointer-events: none; }

.icon-btn {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; color: var(--text-2);
  transition: background .2s var(--ease), color .2s, transform .2s var(--ease);
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn:active { transform: scale(.9); }
.icon-btn svg { width: 20px; height: 20px; }

.link-btn { color: var(--accent); font-size: 13px; font-weight: 550; padding: 4px 6px; border-radius: 6px; }
.link-btn:hover { background: var(--accent-soft); }

/* Bouton soleil / lune */
.theme-toggle { position: relative; overflow: hidden; }
.theme-toggle svg { position: absolute; transition: transform .5s var(--spring), opacity .3s var(--ease); }
:root[data-theme="dark"] .theme-toggle .sun { transform: rotate(-90deg) scale(.4); opacity: 0; }
:root[data-theme="dark"] .theme-toggle .moon { transform: none; opacity: 1; }
:root[data-theme="light"] .theme-toggle .moon { transform: rotate(90deg) scale(.4); opacity: 0; }
:root[data-theme="light"] .theme-toggle .sun { transform: none; opacity: 1; }

/* ───────────── Barre du haut ───────────── */

.topbar {
  position: sticky; top: 0; z-index: 40;
  background: var(--header);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--sep);
}
.topbar-inner {
  max-width: 1240px; margin: 0 auto; height: 56px; padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; min-width: 0; }
.brand-icon {
  width: 32px; height: 32px; border-radius: 9px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #3d9bff, #6b4dff 55%, #b24dff);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 2px 8px rgba(80, 90, 255, .35);
}
.brand-icon svg { width: 19px; height: 19px; }
.brand-name { font-weight: 650; font-size: 16px; letter-spacing: -.01em; white-space: nowrap; }
.brand-name span { color: var(--text-3); font-weight: 500; }
.topbar-actions { display: flex; align-items: center; gap: 6px; }

.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 650; font-size: 14px; color: #fff; text-transform: uppercase;
  background: var(--av, var(--accent));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25);
  transition: transform .2s var(--ease), box-shadow .2s;
}
button.avatar:hover { box-shadow: 0 0 0 3px var(--accent-soft); }
button.avatar:active { transform: scale(.92); }
.avatar.sm { width: 26px; height: 26px; font-size: 12px; flex: none; }

/* ───────────── Indicateur de transfert (façon GNOME) ───────────── */

.anchor { position: relative; }
.transfer-btn {
  position: relative; width: 36px; color: var(--accent);
  transition: transform .45s var(--spring), opacity .3s var(--ease), width .45s var(--ease), margin .45s var(--ease), background .2s;
}
.transfer-btn.off { transform: scale(.2); opacity: 0; width: 0; margin: 0 -3px; pointer-events: none; }
.transfer-btn .ring { position: absolute; inset: 3px; width: 30px; height: 30px; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--sep-2); stroke-width: 3; }
.ring-fill {
  fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round;
  stroke-dasharray: 94.25; stroke-dashoffset: 94.25;
  transition: stroke .35s var(--ease);
}
.transfer-btn .glyph { position: absolute; inset: 0; display: grid; place-items: center; }
.transfer-btn .glyph svg { width: 15px; height: 15px; transition: transform .45s var(--spring), opacity .25s var(--ease); }
.transfer-btn .g-check, .transfer-btn .g-warn { opacity: 0; transform: scale(.4); position: absolute; }
.transfer-btn.running .g-arrow { animation: bob 1.4s var(--ease) infinite; }
.transfer-btn.done { color: var(--green); }
.transfer-btn.done .ring-fill { stroke: var(--green); }
.transfer-btn.done .g-arrow, .transfer-btn.error .g-arrow { opacity: 0; transform: translateY(-8px) scale(.5); }
.transfer-btn.done .g-check { opacity: 1; transform: none; }
.transfer-btn.error { color: var(--red); }
.transfer-btn.error .ring-fill { stroke: var(--red); }
.transfer-btn.error .g-warn { opacity: 1; transform: none; }
.transfer-btn .pulse {
  position: absolute; inset: 3px; border-radius: 50%; border: 2px solid var(--green);
  opacity: 0; pointer-events: none;
}
.transfer-btn.done .pulse { animation: pulse .9s var(--ease) 1; }
.g-check path { stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset .5s var(--ease) .1s; }
.transfer-btn.done .g-check path { stroke-dashoffset: 0; }
@keyframes bob { 0%, 100% { transform: translateY(1px); } 50% { transform: translateY(-2px); } }
@keyframes pulse { 0% { opacity: .9; transform: scale(1); } 100% { opacity: 0; transform: scale(1.7); } }

/* ───────────── Popovers et menus ───────────── */

.popover {
  position: absolute; z-index: 60; top: calc(100% + 10px); right: 0;
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
  border: 1px solid var(--sep-2);
  border-radius: 16px; box-shadow: var(--shadow);
  transform-origin: top right;
  opacity: 0; transform: scale(.92) translateY(-6px); pointer-events: none;
  transition: opacity .2s var(--ease), transform .3s var(--spring);
}
.popover.open { opacity: 1; transform: none; pointer-events: auto; }
/* Dans la barre du haut, le flou d'arrière-plan ne traverse pas : fond presque opaque. */
.topbar .popover, .ctx { background: var(--pop); }
.menu { min-width: 220px; padding: 6px; }
.menu-head { padding: 8px 10px 10px; font-size: 13px; color: var(--text-2); border-bottom: 1px solid var(--sep); margin-bottom: 6px; }
.menu-head b { color: var(--text); font-weight: 600; }
.menu-item {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 9px; text-align: left; font-size: 14px;
  transition: background .15s;
}
.menu-item:hover, .menu-item:focus-visible { background: var(--accent); color: #fff; outline: none; }
.menu-item:hover svg, .menu-item:focus-visible svg { color: #fff; }
.menu-item svg { width: 17px; height: 17px; color: var(--text-2); flex: none; }
.menu-item.danger { color: var(--red); }
.menu-item.danger svg { color: var(--red); }
.menu-item.danger:hover { background: var(--red); color: #fff; }
.menu-sep { height: 1px; background: var(--sep); margin: 5px 6px; }
.menu form { margin: 0; }
.ctx { position: fixed; top: 0; left: 0; right: auto; transform-origin: top left; }

/* Panneau des transferts */
.transfer-pop { width: min(400px, calc(100vw - 24px)); padding: 0; overflow: hidden; }
.pop-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px; }
.pop-head h3 { margin: 0; font-size: 15px; font-weight: 650; }
.transfer-list { max-height: min(60vh, 460px); overflow-y: auto; padding: 0 8px 8px; }
.tr-empty { padding: 18px 16px 22px; text-align: center; color: var(--text-3); font-size: 13px; }

.tr-item {
  display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; align-items: start;
  padding: 12px 10px; border-radius: 12px;
  animation: trIn .55s var(--spring) both;
  transition: background .2s;
}
.tr-item + .tr-item { border-top: 1px solid var(--sep); border-radius: 0; }
.tr-item.leaving { animation: trOut .35s var(--ease) both; }
@keyframes trIn { from { opacity: 0; transform: translateY(-10px) scale(.97); } }
@keyframes trOut { to { opacity: 0; transform: translateX(20px); height: 0; padding-top: 0; padding-bottom: 0; } }
.tr-item.clickable { cursor: pointer; }
.tr-item.clickable:hover { background: var(--hover); }
.tr-icon { position: relative; width: 40px; height: 40px; }
.tr-icon > svg { width: 40px; height: 40px; }
.tr-badge {
  position: absolute; right: -4px; bottom: -4px; width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; background: var(--green);
  box-shadow: 0 0 0 2.5px var(--card);
  transform: scale(0); transition: transform .5s var(--spring);
}
.tr-badge svg { width: 12px; height: 12px; }
.tr-item.done .tr-badge, .tr-item.error .tr-badge, .tr-item.cancelled .tr-badge { transform: scale(1); }
.tr-item.error .tr-badge { background: var(--red); }
.tr-item.cancelled .tr-badge { background: var(--gray); }
.tr-body { min-width: 0; }
.tr-top { display: flex; align-items: center; gap: 8px; min-height: 22px; }
.tr-title { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-pct { font-size: 12.5px; font-weight: 650; color: var(--accent); font-variant-numeric: tabular-nums; transition: opacity .3s; }
.tr-item:not(.running) .tr-pct { opacity: 0; width: 0; overflow: hidden; }
.tr-dest { color: var(--text-2); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.tr-bar {
  position: relative; height: 6px; border-radius: 6px; margin: 9px 0 7px;
  background: var(--input); overflow: hidden;
}
.tr-fill {
  position: absolute; inset: 0; transform-origin: left center; transform: scaleX(0);
  border-radius: 6px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: background .4s var(--ease);
}
.tr-fill::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, .45) 50%, transparent 100%);
  transform: translateX(-100%);
  animation: shine 1.6s var(--ease) infinite;
}
.tr-item:not(.running) .tr-fill::after { animation: none; opacity: 0; }
.tr-item.done .tr-fill { background: var(--green); }
.tr-item.error .tr-fill { background: var(--red); }
.tr-item.cancelled .tr-fill { background: var(--gray); }
@keyframes shine { to { transform: translateX(100%); } }
.tr-sub { font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.tr-file { font-size: 12px; color: var(--text-3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity .2s; }
.tr-errors { margin: 6px 0 0; padding: 0; list-style: none; font-size: 12px; color: var(--red); }
.tr-errors li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-cancel {
  width: 22px; height: 22px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: var(--input); color: var(--text-2);
  transition: background .2s, color .2s, transform .3s var(--spring), opacity .2s;
}
.tr-cancel:hover { background: var(--red); color: #fff; }
.tr-cancel svg { width: 11px; height: 11px; }
.tr-item:not(.running) .tr-cancel { transform: scale(0); opacity: 0; width: 0; pointer-events: none; }

/* ───────────── Mise en page ───────────── */

.layout {
  max-width: 1240px; margin: 0 auto; padding: 28px 20px 120px;
  display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start;
}
.title-block { margin-bottom: 16px; min-height: 64px; }
.nav-row { display: flex; align-items: center; gap: 12px; min-height: 28px; }
.nav-btns { display: flex; gap: 2px; padding: 2px; border-radius: 10px; background: var(--input); flex: none; }
.nav-btn {
  width: 30px; height: 24px; border-radius: 8px; display: grid; place-items: center; color: var(--text);
  transition: background .2s var(--ease), color .2s, transform .2s var(--ease), opacity .2s;
}
.nav-btn svg { width: 14px; height: 14px; }
.nav-btn:hover:not(:disabled) { background: var(--card); box-shadow: var(--shadow-sm); }
.nav-btn:active:not(:disabled) { transform: scale(.88); }
.nav-btn:disabled { color: var(--text-3); opacity: .55; cursor: default; }
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; font-size: 13px; color: var(--text-2); min-height: 22px; }
.crumbs a { color: var(--text-2); text-decoration: none; padding: 2px 6px; border-radius: 6px; transition: background .15s, color .15s; }
.crumbs a:hover { background: var(--hover); color: var(--text); }
.crumbs a.drop-target { background: var(--accent); color: #fff; }
.crumbs svg { width: 12px; height: 12px; color: var(--text-3); }
.crumbs a:first-child { margin-left: -6px; }
h1.title {
  margin: 2px 0 0; font-size: 32px; font-weight: 700; letter-spacing: -.025em; line-height: 1.15;
  word-break: break-word;
}
h1.title.swap { animation: titleIn .45s var(--ease); }
@keyframes titleIn { from { opacity: 0; transform: translateY(6px); filter: blur(3px); } }

.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.search {
  flex: 1 1 220px; display: flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 12px; border-radius: 10px; background: var(--input);
  color: var(--text-3); transition: box-shadow .2s, background .2s;
}
.search:focus-within { box-shadow: 0 0 0 3.5px var(--accent-soft); background: var(--card); }
.search svg { width: 16px; height: 16px; flex: none; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 14px; }
.search input::placeholder { color: var(--text-3); }
.toolbar-btns { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.select {
  appearance: none; -webkit-appearance: none;
  height: 36px; padding: 0 32px 0 12px; border-radius: 10px; border: 0;
  background: var(--card-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%238e8e93' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 8l4 4 4-4'/%3E%3C/svg%3E") no-repeat right 9px center / 16px;
  font-weight: 550; font-size: 14px; cursor: pointer; transition: background-color .2s;
}
.select:hover { background-color: var(--card-3); }
.select option { background: var(--card); color: var(--text); }

/* ───────────── Cartes ───────────── */

.card {
  background: var(--card); border-radius: var(--radius);
  border: 1px solid var(--sep); box-shadow: var(--shadow-sm);
}
.list-card { overflow: hidden; position: relative; }
.side-col { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 84px; }
.side-card { padding: 16px 16px 14px; }
.side-card h2 { margin: 0 0 12px; font-size: 13px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }

/* ───────────── Liste des fichiers ───────────── */

.list-head {
  display: grid; grid-template-columns: 28px 40px minmax(0, 1fr) 96px 150px 70px; gap: 12px;
  align-items: center; padding: 10px 14px 9px; font-size: 12px; font-weight: 600; color: var(--text-3);
  border-bottom: 1px solid var(--sep); text-transform: uppercase; letter-spacing: .04em;
}
.list-head .r { text-align: right; }
.list.anim-forward { animation: slideFwd .38s var(--ease); }
.list.anim-back { animation: slideBack .38s var(--ease); }
.list.anim-fade { animation: fadeIn .3s var(--ease); }
@keyframes slideFwd { from { opacity: 0; transform: translateX(26px); } }
@keyframes slideBack { from { opacity: 0; transform: translateX(-26px); } }
@keyframes fadeIn { from { opacity: 0; } }

.row {
  position: relative;
  display: grid; grid-template-columns: 28px 40px minmax(0, 1fr) 96px 150px 70px; gap: 12px;
  align-items: center; padding: 8px 14px; min-height: 58px;
  cursor: pointer; user-select: none; -webkit-user-select: none;
  transition: background .18s var(--ease), box-shadow .2s;
}
.row + .row::before {
  content: ""; position: absolute; top: 0; left: 94px; right: 0; height: 1px; background: var(--sep);
}
.row:hover { background: var(--hover); }
.row:active { background: var(--press); }
.row:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--accent); }
.row.selected { background: var(--accent-soft); }
.row.drop-target { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.row.drop-target .ico { transform: scale(1.12) rotate(-3deg); }
.row.appear { animation: rowIn .5s var(--ease) both; }
@keyframes rowIn { from { opacity: 0; transform: translateY(8px) scale(.985); } }
.row.landed .ico { animation: land .6s var(--spring); }
@keyframes land { 0% { transform: scale(.85); } 60% { transform: scale(1.08); } 100% { transform: none; } }
.row.ghost { cursor: default; }
.row.ghost .more { visibility: hidden; }
.row.ghost .name { color: var(--text-2); }
.row.ghost .ico > svg:not(.mini-ring), .row.ghost .ico > img { opacity: .5; transition: opacity .5s var(--ease); }
.row.removing { animation: rowOut .32s var(--ease) both; }
@keyframes rowOut { to { opacity: 0; transform: translateX(-14px); } }

.check {
  width: 22px; height: 22px; border-radius: 50%;
  border: 1.8px solid var(--sep-2); display: grid; place-items: center; color: #fff;
  opacity: 0; transform: scale(.6);
  transition: opacity .2s var(--ease), transform .3s var(--spring), background .2s, border-color .2s;
}
.check svg { width: 13px; height: 13px; opacity: 0; transform: scale(.4); transition: transform .35s var(--spring), opacity .15s; }
.row:hover .check, .selecting .check { opacity: 1; transform: none; }
.row.selected .check { background: var(--accent); border-color: var(--accent); opacity: 1; transform: none; }
.row.selected .check svg { opacity: 1; transform: none; }
.row.ghost .check, .trash .check { visibility: hidden; }

.ico { position: relative; width: 40px; height: 40px; display: grid; place-items: center; transition: transform .35s var(--spring), opacity .3s; }
.ico > svg { width: 40px; height: 40px; }
.ico img {
  width: 40px; height: 40px; object-fit: cover; border-radius: 8px;
  background: var(--card-2); box-shadow: 0 0 0 1px var(--sep);
  opacity: 0; transition: opacity .4s var(--ease);
}
.ico img.ok { opacity: 1; }
.mini-ring {
  position: absolute; inset: -3px; width: 46px; height: 46px; transform: rotate(-90deg);
  transition: opacity .4s var(--ease);
}
.mini-ring circle { fill: none; stroke-width: 2.6; }
.mini-ring .t { stroke: var(--sep-2); }
.mini-ring .f { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 135.1; stroke-dashoffset: 135.1; }
.row:not(.transferring) .mini-ring { opacity: 0; }

.info { min-width: 0; }
.name { font-weight: 550; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta { font-size: 12.5px; color: var(--text-2); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.meta .progress { color: var(--accent); font-weight: 550; }
.m-extra { display: none; }

/* Icônes de fichiers et de dossiers */
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.fa { stop-color: var(--folder-a); }
.fb { stop-color: var(--folder-b); }
.f-back { fill: var(--folder-tab); }
.f-body { fill: var(--folder-b); }
.f-back, .f-body { transition: fill .45s var(--ease); }
.f-shine { fill: #fff; opacity: .22; }
/* Couleurs de dossiers */
.fc-rouge { --folder-b: #ff453a; --folder-tab: #e0362c; }
.fc-orange { --folder-b: #ff9f0a; --folder-tab: #e08600; }
.fc-jaune { --folder-b: #ffcc00; --folder-tab: #e0b000; }
.fc-vert { --folder-b: #30c552; --folder-tab: #25a443; }
.fc-menthe { --folder-b: #00c7be; --folder-tab: #00aaa2; }
.fc-violet { --folder-b: #af52de; --folder-tab: #9440c2; }
.fc-rose { --folder-b: #ff375f; --folder-tab: #e02a50; }
.fc-gris { --folder-b: #8e8e93; --folder-tab: #75757a; }
.p-body { fill: var(--page); stroke: var(--sep-2); stroke-width: 1; }
.p-fold { fill: var(--page-fold); stroke: var(--sep-2); stroke-width: 1; stroke-linejoin: round; }
.bg-purple { fill: var(--purple); }
.bg-green { fill: var(--green); }
.bg-orange { fill: var(--orange); }
.bg-teal { fill: var(--teal); }
.bg-blue { fill: var(--accent); }
.bg-pink { fill: var(--pink); }
.bg-red { fill: var(--red); }
.bg-gray { fill: var(--gray); }
.badge-t { fill: #fff; font: 700 7.2px var(--font); letter-spacing: .03em; }
.e-back { fill: var(--folder-tab); }
.e-stroke { color: var(--text-3); }
.tr-icon .p-body { stroke: var(--sep-2); }
.tree .f-back { fill: var(--folder-tab); }
.tree li button.sel .f-back { fill: rgba(255, 255, 255, .55); }
.tree li button.sel .f-body { fill: #fff; }
.tree li button.sel .f-shine { opacity: 0; }
.col { font-size: 13px; color: var(--text-2); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 2px; }
.more, .peek {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: var(--text-2);
  opacity: 0; transition: opacity .15s, background .15s, transform .2s var(--ease);
}
.more svg, .peek svg { width: 18px; height: 18px; }
.row:hover .more, .more:focus-visible, .more.open, .row:hover .peek, .peek:focus-visible { opacity: 1; }
.more:hover, .more.open, .peek:hover { background: var(--press); color: var(--text); }
.peek:active, .more:active { transform: scale(.88); }
.chev { display: none; }

/* Recherche */
.search-head {
  display: flex; align-items: center; gap: 8px; padding: 11px 16px 10px;
  font-size: 13px; color: var(--text-2); border-bottom: 1px solid var(--sep);
}
.search-head svg { width: 15px; height: 15px; flex: none; color: var(--accent); }
.search-head b { color: var(--text); font-weight: 650; }
.searching .check { visibility: hidden; }
.meta .where { color: var(--text-2); font-weight: 550; }
mark {
  background: color-mix(in srgb, var(--accent) 30%, transparent); color: inherit;
  border-radius: 4px; padding: 0 1px; margin: 0 -1px;
}
.search.busy svg { animation: searchPulse 1s ease-in-out infinite; color: var(--accent); }
@keyframes searchPulse { 50% { opacity: .35; transform: scale(.88); } }
.row.flash { animation: rowFlash 2.2s var(--ease); }
@keyframes rowFlash {
  0%, 30% { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
  100% { background: transparent; box-shadow: inset 0 0 0 2px transparent; }
}

/* Corbeille */
.trash .row { grid-template-columns: 0 40px minmax(0, 1fr) auto; cursor: default; }
.trash .row + .row::before { left: 66px; }
.trash .row .check { width: 0; }
.trash-actions { display: flex; align-items: center; gap: 6px; }
.trash-actions .btn { height: 32px; padding: 0 12px; font-size: 13px; }
.notice {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; margin-bottom: 14px;
  border-radius: 12px; background: var(--card-2); color: var(--text-2); font-size: 13.5px;
}
.notice svg { width: 18px; height: 18px; flex: none; color: var(--text-3); }

/* Chargement */
.skeleton .row { cursor: default; }
.sk { height: 12px; border-radius: 6px; background: var(--card-2); position: relative; overflow: hidden; }
.sk::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, var(--hover), transparent);
  animation: shine 1.3s infinite;
}
.sk.ico-sk { width: 40px; height: 40px; border-radius: 10px; }
.sk.short { width: 30%; height: 10px; margin-top: 8px; }
.sk.w0 { width: 46%; } .sk.w1 { width: 62%; } .sk.w2 { width: 38%; }
.sk.w3 { width: 55%; } .sk.w4 { width: 42%; } .sk.w5 { width: 58%; }

/* Dossier vide */
.empty {
  margin: 14px; padding: 54px 20px 50px; border-radius: 12px; text-align: center;
  border: 2px dashed var(--sep-2); color: var(--text-2);
  transition: border-color .25s, background .25s;
}
.empty.hot { border-color: var(--accent); background: var(--accent-soft); }
.empty-art { width: 92px; height: 92px; margin: 0 auto 16px; animation: float 3.2s ease-in-out infinite; }
.empty-art svg { width: 92px; height: 92px; }
.empty h3 { margin: 0 0 6px; color: var(--text); font-size: 18px; font-weight: 650; letter-spacing: -.01em; }
.empty p { margin: 0 0 18px; font-size: 14px; }
.empty .btns { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }

/* ───────────── Colonne de droite ───────────── */

.storage-big { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.storage-sub { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.meter { display: flex; height: 8px; border-radius: 8px; overflow: hidden; background: var(--input); margin: 14px 0 8px; }
.meter span { display: block; height: 100%; width: 0; transition: width 1s var(--ease); }
.meter .m-models { background: linear-gradient(90deg, var(--accent), #8a5cff); }
.meter .m-other { background: var(--text-3); opacity: .55; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--text-2); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.legend .l1 { background: var(--accent); }
.legend .l2 { background: var(--text-3); }
.legend .l3 { background: var(--input); box-shadow: inset 0 0 0 1px var(--sep-2); }

.activity { list-style: none; margin: 0 -6px; padding: 0; max-height: 440px; overflow-y: auto; }
.act {
  display: grid; grid-template-columns: 26px 1fr; gap: 10px; padding: 8px 6px; border-radius: 10px;
  font-size: 13px; line-height: 1.35; cursor: pointer; transition: background .15s;
}
.act:hover { background: var(--hover); }
.act.new { animation: rowIn .5s var(--ease) both; }
.act b { font-weight: 600; }
.act .when { color: var(--text-3); font-size: 12px; margin-top: 2px; }
.act-empty { color: var(--text-3); font-size: 13px; padding: 4px 0 2px; }

.trash-link {
  display: flex; align-items: center; gap: 12px; padding: 13px 16px; text-decoration: none; color: var(--text);
  transition: background .2s, transform .2s var(--ease);
}
.trash-link:hover { background: var(--card-2); }
.trash-link:active { transform: scale(.98); }
.trash-link .t-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--card-2); color: var(--text-2); }
.trash-link .t-ico svg { width: 18px; height: 18px; }
.trash-link .t-txt { flex: 1; font-weight: 550; font-size: 14px; }
.trash-link .t-txt small { display: block; font-weight: 400; color: var(--text-3); font-size: 12px; }
.trash-link .count { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--card-2); color: var(--text-2); font-size: 12px; font-weight: 600; display: grid; place-items: center; }
.trash-link > svg { width: 14px; height: 14px; color: var(--text-3); }

/* ───────────── Barre de sélection ───────────── */

.selection-bar {
  position: fixed; left: 50%; bottom: 24px; z-index: 45;
  display: flex; align-items: center; gap: 4px; padding: 6px 6px 6px 16px;
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
  border: 1px solid var(--sep-2); border-radius: 18px; box-shadow: var(--shadow);
  transform: translate(-50%, 140%); opacity: 0; pointer-events: none;
  transition: transform .5s var(--spring), opacity .25s var(--ease);
  max-width: calc(100vw - 24px);
}
.selection-bar.open { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.selection-bar .count { font-weight: 600; font-size: 14px; margin-right: 8px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.selection-bar .btn { height: 34px; padding: 0 12px; background: transparent; }
.selection-bar .btn:hover { background: var(--hover); }
.selection-bar .btn.danger { color: var(--red); }
.selection-bar .btn.done-btn { background: var(--accent); color: #fff; }

/* ───────────── Zone de dépôt ───────────── */
/* Pas de flou : on doit voir la liste pour viser un dossier. */

.drop-overlay {
  position: fixed; inset: 0; z-index: 80; pointer-events: none;
  display: flex; align-items: flex-end; justify-content: center; padding: 0 16px 34px;
  opacity: 0; transition: opacity .22s var(--ease);
}
.drop-overlay.show { opacity: 1; }
.drop-frame {
  position: absolute; inset: 10px; border-radius: 22px;
  transform: scale(1.015); transition: transform .45s var(--spring);
}
.drop-overlay.show .drop-frame { transform: none; }
.drop-frame svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.drop-frame rect {
  width: calc(100% - 3px); height: calc(100% - 3px);
  fill: var(--accent-soft); fill-opacity: .35;
  stroke: var(--accent); stroke-width: 2.5; stroke-dasharray: 10 8;
  animation: march .9s linear infinite;
}
@keyframes march { to { stroke-dashoffset: -18; } }
.drop-card {
  position: relative; display: flex; align-items: center; gap: 14px; text-align: left;
  padding: 14px 22px 14px 16px; border-radius: 20px;
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
  box-shadow: var(--shadow); border: 1px solid var(--sep-2);
  transform: translateY(24px) scale(.94); transition: transform .55s var(--spring);
}
.drop-overlay.show .drop-card { transform: none; }
.drop-icon { width: 46px; height: 46px; flex: none; animation: float 1.6s ease-in-out infinite; color: var(--accent); }
.drop-icon svg { width: 46px; height: 46px; }
.drop-title { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.drop-sub { color: var(--text-2); font-size: 14px; margin-top: 1px; }
.drop-sub b { color: var(--accent); font-weight: 650; }

/* ───────────── Fenêtres (modales) ───────────── */

.modal-wrap {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px;
  background: rgba(0, 0, 0, .38);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  animation: fadeIn .25s var(--ease) both;
}
.modal-wrap.closing { animation: fadeOut .2s var(--ease) both; pointer-events: none; }
@keyframes fadeOut { to { opacity: 0; } }
.modal {
  width: min(420px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column;
  background: var(--card); border-radius: 18px; border: 1px solid var(--sep-2); box-shadow: var(--shadow);
  animation: modalIn .45s var(--spring) both;
}
.modal-wrap.closing .modal { animation: modalOut .2s var(--ease) both; }
@keyframes modalIn { from { opacity: 0; transform: scale(.9) translateY(12px); } }
@keyframes modalOut { to { opacity: 0; transform: scale(.96); } }
.modal-body { padding: 22px 22px 6px; overflow-y: auto; }
.modal h2 { margin: 0 0 6px; font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.modal p { margin: 0 0 14px; color: var(--text-2); font-size: 14px; }
.modal p b { color: var(--text); font-weight: 600; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 22px 20px; flex-wrap: wrap; }
.modal.shake { animation: shake .45s var(--ease); }
@keyframes shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }

.field { display: block; margin-bottom: 12px; }
.field span { display: block; font-size: 13px; font-weight: 550; color: var(--text-2); margin-bottom: 6px; }
.input {
  width: 100%; height: 42px; padding: 0 13px; border-radius: 11px;
  border: 1px solid var(--sep-2); background: var(--card-2); color: var(--text); font-size: 15px;
  outline: none; transition: border-color .2s, box-shadow .2s, background .2s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3.5px var(--accent-soft); background: var(--card); }
.form-error { min-height: 20px; color: var(--red); font-size: 13px; margin: 2px 0 4px; }

.name-list { margin: 0 0 14px; padding: 10px 12px; list-style: none; background: var(--card-2); border-radius: 10px; font-size: 13px; max-height: 150px; overflow-y: auto; }
.name-list li { padding: 2px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.name-list li.more-n { color: var(--text-3); }

.tree { margin: 0 0 6px; padding: 6px; list-style: none; background: var(--card-2); border-radius: 12px; max-height: 320px; overflow-y: auto; }
.tree li button {
  width: 100%; display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px;
  text-align: left; font-size: 14px; transition: background .15s;
}
.tree li button svg { width: 22px; height: 22px; flex: none; }
.tree li button span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tree li button:hover { background: var(--hover); }
.tree li button.sel { background: var(--accent); color: #fff; }
.tree li button:disabled { opacity: .35; pointer-events: none; }

/* Clés pour Claude & Studio */
.key-list { margin: 4px 0 16px; border-radius: 12px; background: var(--card-2); overflow: hidden; }
.key-empty { padding: 14px; text-align: center; color: var(--text-3); font-size: 13.5px; }
.key-row { display: flex; align-items: center; gap: 12px; padding: 11px 12px; animation: rowIn .45s var(--ease) both; }
.key-row + .key-row { border-top: 1px solid var(--sep); }
.key-ico { width: 32px; height: 32px; flex: none; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.key-ico svg { width: 17px; height: 17px; }
.key-info { flex: 1; min-width: 0; }
.key-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.key-meta { font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.key-meta code, .code-box code, .code-box pre { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.key-meta code { font-size: 12px; }
.key-revoke { height: 30px; padding: 0 12px; font-size: 13px; flex: none; }
.key-new { margin-bottom: 4px; }
.key-fresh {
  margin: 4px 0 6px; padding: 14px; border-radius: 14px; background: var(--green-soft);
  border: 1px solid color-mix(in srgb, var(--green) 35%, transparent); animation: modalIn .5s var(--spring) both;
}
.kf-title { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; margin-bottom: 10px; }
.kf-title svg { width: 18px; height: 18px; flex: none; color: var(--green); }
.kf-sub { font-size: 13px; color: var(--text-2); margin: 12px 0 6px; }
.code-box {
  display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px; border-radius: 10px;
  background: var(--card); border: 1px solid var(--sep-2);
}
.code-box code, .code-box pre {
  flex: 1; min-width: 0; margin: 0; font-size: 12.5px; color: var(--text);
  user-select: all; -webkit-user-select: all; overflow-wrap: anywhere;
}
.code-box pre { white-space: pre-wrap; line-height: 1.45; }
.code-box.multi { align-items: flex-start; }
.copy-btn { height: 30px; padding: 0 10px; font-size: 13px; flex: none; }
.copy-btn svg { width: 15px; height: 15px; }
.copy-btn.done { background: var(--green); color: #fff; }

/* Fenêtre « Nouveau dossier » / « Modifier le dossier » */
.fd-top { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 4px; }
.fd-name { flex: 1; min-width: 0; }
.fd-preview { width: 64px; height: 64px; flex: none; margin-bottom: 8px; }
.fd-preview svg { width: 64px; height: 64px; }
.fd-preview.pop { animation: fdPop .5s var(--spring); }
@keyframes fdPop { 0% { transform: scale(.86) rotate(-4deg); } 60% { transform: scale(1.07); } 100% { transform: none; } }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; padding: 4px 2px 6px; }
.swatch {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: var(--sw); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14);
  transition: transform .3s var(--spring), box-shadow .25s var(--ease);
}
.swatch:hover { transform: scale(1.12); }
.swatch:active { transform: scale(.92); }
.swatch:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--accent); }
.swatch svg { width: 14px; height: 14px; opacity: 0; transform: scale(.3); transition: opacity .15s, transform .35s var(--spring); }
.swatch.on { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--sw); }
.swatch.on svg { opacity: 1; transform: none; }
.sw-bleu { --sw: #2a88f2; } .sw-rouge { --sw: #ff453a; } .sw-orange { --sw: #ff9f0a; }
.sw-jaune { --sw: #ffcc00; color: #5c4600; } .sw-vert { --sw: #30c552; } .sw-menthe { --sw: #00c7be; }
.sw-violet { --sw: #af52de; } .sw-rose { --sw: #ff375f; } .sw-gris { --sw: #8e8e93; }

/* Aperçu rapide d'un dossier */
.modal.ql { width: min(920px, 100%); height: min(680px, calc(100vh - 40px)); overflow: hidden; outline: none; }
.ql-head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 14px 18px; border-bottom: 1px solid var(--sep); }
.ql-back { flex: none; transition: width .35s var(--ease), opacity .25s var(--ease), margin .35s var(--ease), transform .2s; }
.ql-back.hide { width: 0; opacity: 0; margin-right: -12px; pointer-events: none; }
.ql-icon, .ql-icon svg { width: 40px; height: 40px; flex: none; }
.ql-titles { flex: 1; min-width: 0; }
.ql-title { font-size: 17px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ql-meta { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.ql-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.ql-grid {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(134px, 1fr)); gap: 8px;
  padding: 16px; align-content: start;
}
.ql-grid.anim-forward { animation: slideFwd .38s var(--ease); }
.ql-grid.anim-back { animation: slideBack .38s var(--ease); }
.ql-grid.anim-fade { animation: fadeIn .3s var(--ease); }
.ql-tile {
  display: flex; flex-direction: column; padding: 8px 8px 10px; border-radius: 14px; text-align: center; min-width: 0;
  animation: tileIn .5s var(--spring) both;
  transition: background .18s var(--ease), transform .25s var(--ease);
}
.ql-tile:hover { background: var(--hover); }
.ql-tile:hover .ql-thumb { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0, 0, 0, .22); }
.ql-tile:active { transform: scale(.96); }
.ql-tile:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--accent); }
@keyframes tileIn { from { opacity: 0; transform: translateY(12px) scale(.93); } }
.ql-thumb {
  position: relative; aspect-ratio: 1 / 1; border-radius: 12px; overflow: hidden; margin-bottom: 8px;
  display: grid; place-items: center; background: var(--card-2);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.ql-thumb.icon > svg { width: 62px; height: 62px; }
.ql-thumb img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .45s var(--ease); }
.ql-thumb img.ok { opacity: 1; }
.ql-thumb img.broken { visibility: hidden; }
.ql-thumb.mosaic { gap: 3px; padding: 3px; background: var(--card-3); place-items: stretch; }
.ql-thumb.mosaic.n2 { grid-template-columns: 1fr 1fr; }
.ql-thumb.mosaic.n3, .ql-thumb.mosaic.n4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.ql-thumb.mosaic.n3 img:first-child { grid-row: span 2; }
.ql-thumb.mosaic img { min-height: 0; border-radius: 9px; }
.ql-badge { position: absolute; right: 6px; bottom: 6px; width: 32px; height: 32px; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .4)); }
.ql-badge svg { width: 32px; height: 32px; }
.ql-name {
  font-size: 13px; font-weight: 550; line-height: 1.3; word-break: break-word;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ql-sub { font-size: 12px; color: var(--text-2); margin-top: 2px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ql-empty { grid-column: 1 / -1; text-align: center; padding: 70px 20px; color: var(--text-2); }
.ql-empty h3 { margin: 0; color: var(--text); font-size: 17px; }
.sk-tile { animation: none; pointer-events: none; }
.ql-sk-line { width: 70%; height: 10px; margin: 2px auto 0; }

/* Visionneuse d'images */
.viewer { position: fixed; inset: 0; z-index: 95; display: flex; flex-direction: column; background: rgba(0, 0, 0, .86); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); animation: fadeIn .25s var(--ease) both; color: #fff; }
.viewer.closing { animation: fadeOut .2s var(--ease) both; pointer-events: none; }
.viewer-bar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; }
.viewer-bar .v-name { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer-bar .icon-btn { color: #fff; }
.viewer-bar .icon-btn:hover { background: rgba(255, 255, 255, .12); }
.viewer-stage { flex: 1; min-height: 0; display: grid; place-items: center; padding: 10px 60px 40px; position: relative; }
.viewer-stage img { max-width: 100%; max-height: 100%; border-radius: 10px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); animation: zoomIn .45s var(--spring) both; }
@keyframes zoomIn { from { opacity: 0; transform: scale(.92); } }
.viewer-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .12); color: #fff; transition: background .2s; }
.viewer-nav:hover { background: rgba(255, 255, 255, .22); }
.viewer-nav svg { width: 20px; height: 20px; }
.viewer-nav.prev { left: 12px; }
.viewer-nav.next { right: 12px; }

/* Notifications */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column-reverse; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 9px; padding: 10px 16px 10px 12px; border-radius: 14px;
  background: var(--glass); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--sep-2); box-shadow: var(--shadow); font-size: 14px; font-weight: 550;
  animation: toastIn .5s var(--spring) both; max-width: calc(100vw - 32px);
}
.toast.out { animation: toastOut .3s var(--ease) both; }
.toast svg { width: 18px; height: 18px; flex: none; }
.toast.ok svg { color: var(--green); }
.toast.err svg { color: var(--red); }
.toast.info svg { color: var(--accent); }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.94); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px) scale(.96); } }
.has-selection .toasts { bottom: 90px; }

/* ───────────── Page de connexion ───────────── */

.login-page { display: grid; place-items: center; padding: 24px; min-height: 100vh; }
.login-theme { position: fixed; top: 16px; right: 16px; }
.login-card {
  width: min(380px, 100%); padding: 34px 30px 28px; text-align: center;
  background: var(--card); border: 1px solid var(--sep); border-radius: 22px; box-shadow: var(--shadow);
  animation: modalIn .7s var(--spring) both;
}
.login-card.shake { animation: modalIn .7s var(--spring) both, shake .45s var(--ease) .15s; }
.login-logo { width: 64px; height: 64px; border-radius: 17px; margin: 0 auto 16px; }
.login-logo svg { width: 36px; height: 36px; }
.login-card h1 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.login-card .sub { margin: 4px 0 24px; color: var(--text-2); font-size: 14px; }
.login-card form { text-align: left; }
.login-card .btn.primary { width: 100%; height: 44px; justify-content: center; font-size: 15px; margin-top: 6px; border-radius: 12px; }
.login-error {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: 14px;
  border-radius: 11px; background: var(--red-soft); color: var(--red); font-size: 13.5px; font-weight: 550; text-align: left;
}
.login-error svg { width: 16px; height: 16px; flex: none; }
.login-foot { margin-top: 18px; font-size: 12px; color: var(--text-3); }

/* ───────────── Écrans étroits ───────────── */

@media (max-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 20px; padding-top: 20px; }
  .side-col { position: static; display: grid; grid-template-columns: 1fr 1fr; }
  .side-col .trash-link { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .list-head { display: none; }
  .row { grid-template-columns: 0 40px minmax(0, 1fr) auto; gap: 12px; padding: 8px 12px; }
  .selecting .row { grid-template-columns: 26px 40px minmax(0, 1fr) auto; }
  .peek { opacity: 1; }
  .ql-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; padding: 12px; }
  .ql-actions .label { display: none; }
  .ql-sub .k { display: none; }
  .ql-meta { white-space: normal; }
  .ql-actions .btn { padding: 0 10px; }
  .modal.ql { height: calc(100vh - 24px); }
  .ql-head { padding: 12px 10px 12px 14px; gap: 10px; }
  .row + .row::before { left: 64px; }
  .selecting .row + .row::before { left: 102px; }
  .row .col { display: none; }
  .m-extra { display: inline; }
  .check { width: 0; overflow: hidden; border-width: 0; }
  .selecting .check { width: 22px; border-width: 1.8px; }
  .more { opacity: 1; }
  .side-col { grid-template-columns: 1fr; }
  h1.title { font-size: 28px; }
  .toolbar .label { display: none; }
  .toolbar .btn { padding: 0 11px; }
  .brand-name span { display: none; }
  .viewer-stage { padding: 10px 10px 30px; }
  .viewer-nav { display: none; }
  .selection-bar .btn .label { display: none; }
}
@media (hover: none) {
  .row:hover { background: transparent; }
  .row:hover .check { opacity: 0; transform: scale(.6); }
  .selecting .row .check, .row.selected .check { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
