:root {
  --bg: #0c0d10;
  --bg-soft: #14161b;
  --bg-card: #181a20;
  --line: #262932;
  --text: #eceef2;
  --muted: #8b90a0;
  --accent: #6d8cff;
  --like: #ff4d6d;
  --ok: #35c98a;
  --error: #ff6b6b;
  --radius: 14px;
  --shadow: 0 8px 28px rgb(0 0 0 / 45%);
}

* {
  box-sizing: border-box;
}

/*
 * L'attribut `hidden` du HTML doit toujours l'emporter. Sans cette regle, une
 * classe qui impose son propre `display` (.viewer, .modal, .unlock, .panel...)
 * reaffiche l'element alors que le code le croit masque : la visionneuse et
 * l'ecran de partage se superposent alors a la galerie en permanence.
 */
[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body.no-scroll {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.muted {
  color: var(--muted);
}

.error {
  color: var(--error);
}

/* ----------------------------- Connexion ---------------------------- */

.login-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  background: radial-gradient(120% 120% at 50% 0%, #1b2033 0%, var(--bg) 60%);
  padding: 24px;
}

.login-card {
  width: min(380px, 100%);
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 36px 32px;
  box-shadow: var(--shadow);
  text-align: center;
}

.login-logo {
  font-size: 44px;
  line-height: 1;
  margin-bottom: 12px;
}

.login-card h1 {
  margin: 0 0 6px;
  font-size: 24px;
}

.login-sub {
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 14px;
}

.login-card label {
  display: block;
  text-align: left;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.login-card input {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 18px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
}

.login-card input:focus {
  border-color: var(--accent);
}

.login-card button {
  width: 100%;
  padding: 12px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}

.login-card button:hover:not(:disabled) {
  filter: brightness(1.1);
}

.login-card button:disabled {
  opacity: 0.6;
  cursor: progress;
}

.login-card .error {
  margin: 14px 0 0;
  font-size: 14px;
}

/* ------------------------------ En-tete ----------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgb(12 13 16 / 88%);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  padding: 12px 20px 0;
}

.topbar-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
  white-space: nowrap;
}

.search-wrap {
  flex: 1 1 220px;
  min-width: 160px;
}

.search-wrap input {
  width: 100%;
  padding: 9px 14px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  outline: none;
}

.search-wrap input:focus {
  border-color: var(--accent);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.who {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.ghost {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.ghost:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.ghost:disabled {
  opacity: 0.5;
  cursor: progress;
}

.filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 0 10px;
}

.tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  background: transparent;
  border: none;
  padding: 7px 14px;
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}

.tab:hover {
  color: var(--text);
}

.tab.is-active {
  background: var(--bg-card);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line);
}

.selects {
  display: flex;
  gap: 8px;
}

.selects select {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 13px;
  max-width: 200px;
  cursor: pointer;
}

/* ------------------------------ Galerie ----------------------------- */

main {
  padding: 20px;
  max-width: 1600px;
  margin: 0 auto;
}

.count {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.card:hover {
  transform: translateY(-3px);
  border-color: #3a3f4d;
}

.thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #0f1116;
  display: grid;
  place-items: center;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb-failed img {
  display: none;
}

.thumb-failed::after {
  content: attr(data-fallback);
  font-size: 34px;
  opacity: 0.4;
}

.play-badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  background: rgb(0 0 0 / 65%);
  border-radius: 50%;
  font-size: 12px;
  padding-left: 2px;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 11px;
}

.card-name {
  font-size: 12.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.like-btn,
.dl-btn {
  background: transparent;
  border: none;
  padding: 4px 6px;
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 13px;
}

.like-btn:hover,
.dl-btn:hover {
  background: var(--bg-soft);
  color: var(--text);
}

.like-btn.liked {
  color: var(--like);
}

.like-btn .heart {
  font-size: 15px;
}

.like-btn .n {
  font-size: 11px;
}

.empty,
.loading {
  text-align: center;
  color: var(--muted);
  padding: 50px 0;
}

.empty p {
  margin: 0 auto 10px;
  max-width: 520px;
  line-height: 1.6;
}

.empty-title {
  color: var(--error);
  font-size: 17px;
  font-weight: 650;
}

.sentinel {
  height: 1px;
}

/* --------------------------- Visionneuse ---------------------------- */

.viewer {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgb(6 7 9 / 96%);
  display: flex;
  flex-direction: column;
}

.viewer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}

.viewer-title {
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.viewer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.icon-btn {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.icon-btn:hover {
  border-color: var(--accent);
}

#viewer-like.liked {
  color: var(--like);
  border-color: var(--like);
}

.viewer-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
  min-height: 0;
}

.viewer-img,
.viewer-video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  background: #000;
}

.viewer-loading,
.viewer-note {
  color: var(--muted);
  text-align: center;
  max-width: 520px;
}

.viewer-meta {
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
  margin: 0;
  padding: 0 18px 16px;
}

.nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 46px;
  height: 46px;
  background: rgb(20 22 27 / 85%);
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.nav-arrow:hover {
  border-color: var(--accent);
}

.nav-arrow.prev {
  left: 14px;
}

.nav-arrow.next {
  right: 14px;
}

.transcode-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(720px, 100%);
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 14px;
  flex-wrap: wrap;
}

.transcode-tag {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  white-space: nowrap;
}

.transcode-bar input[type='range'] {
  flex: 1;
  min-width: 140px;
  accent-color: var(--accent);
}

.transcode-time {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ----------------------------- Activite ----------------------------- */

.activity {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.stat {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat strong {
  font-size: 26px;
  font-weight: 650;
}

.stat span {
  color: var(--muted);
  font-size: 13px;
}

.activity-block h2 {
  font-size: 15px;
  margin: 0 0 12px;
}

.activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.activity-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
}

.activity-list img {
  width: 56px;
  height: 42px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--bg-soft);
  flex-shrink: 0;
}

.activity-list div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.activity-list strong,
.activity-list span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.activity-list .muted {
  font-size: 12px;
}

.user-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.user-list li {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13.5px;
}

/* ------------------------------ Toast ------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 80;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 13.5px;
  box-shadow: var(--shadow);
}

.toast.ok {
  border-color: var(--ok);
  color: var(--ok);
}

.toast.error {
  border-color: var(--error);
  color: var(--error);
}

/* --------------------------- Explorateur ---------------------------- */

.crumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.crumb {
  background: transparent;
  border: none;
  padding: 4px 8px;
  border-radius: 7px;
  color: var(--accent);
  cursor: pointer;
  font-size: 13.5px;
}

.crumb:hover {
  background: var(--bg-soft);
}

.crumb.current {
  color: var(--text);
  cursor: default;
  font-weight: 600;
}

.crumb-sep {
  color: var(--muted);
  font-size: 13px;
}

.crumb-share {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.crumb-share:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}

.folder-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.folder-card:hover,
.folder-card:focus-visible {
  transform: translateY(-3px);
  border-color: var(--accent);
  outline: none;
}

.folder-cover {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #0f1116;
  display: grid;
  place-items: center;
}

.folder-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.42;
}

.folder-icon {
  position: relative;
  font-size: 38px;
  filter: drop-shadow(0 3px 8px rgb(0 0 0 / 60%));
}

.folder-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  min-width: 0;
}

.folder-name {
  font-size: 13.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-meta {
  font-size: 12px;
  color: var(--muted);
}

.folder-share {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  background: rgb(0 0 0 / 62%);
  border: 1px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  font-size: 13px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.folder-card:hover .folder-share,
.folder-card:focus-within .folder-share {
  opacity: 1;
}

.folder-share:hover {
  border-color: var(--accent);
}

.section-title {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 12px;
  font-weight: 600;
}

/* ------------------------- Panneaux (liens) ------------------------- */

.panel {
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.panel-head h2 {
  margin: 0;
  font-size: 16px;
}

.panel-head button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  cursor: pointer;
}

.panel-head button:hover {
  filter: brightness(1.1);
}

.share-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.share-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
}

.share-list li.expired {
  opacity: 0.5;
}

.share-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.share-info strong,
.share-info span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13.5px;
}

.share-info .muted {
  font-size: 12px;
}

.share-link {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  width: 100%;
  min-width: 0;
}

.share-row-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.ghost.danger:hover {
  border-color: var(--error);
  color: var(--error);
}

/* ------------------------ Modale de partage ------------------------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgb(6 7 9 / 82%);
  display: grid;
  place-items: center;
  padding: 20px;
  overflow-y: auto;
}

.modal-card {
  width: min(460px, 100%);
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 26px;
  box-shadow: var(--shadow);
}

.modal-card h2 {
  margin: 0 0 6px;
  font-size: 19px;
}

.modal-sub {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 13.5px;
}

.modal-card label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.modal-card input[type='text'],
.modal-card input[type='password'],
.modal-card select {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 16px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
}

.modal-card input:focus,
.modal-card select:focus {
  border-color: var(--accent);
}

.modal-card .check {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-size: 13.5px;
  margin-bottom: 20px;
  cursor: pointer;
}

.modal-card .check input {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
  margin: 0;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.modal-actions button[type='submit'] {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 9px 20px;
  font-weight: 600;
  cursor: pointer;
}

.modal-actions button[type='submit']:disabled {
  opacity: 0.6;
  cursor: progress;
}

.share-result .ok-line {
  color: var(--ok);
  margin: 0 0 14px;
  font-size: 14px;
}

.link-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.link-row input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 9px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

.link-row button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 9px;
  padding: 0 18px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.share-result .muted {
  font-size: 12.5px;
  margin: 0 0 18px;
}

.share-result .ghost {
  width: 100%;
  padding: 10px;
}

/* ---------------- Ouverture d'un lien de partage -------------------- */

.unlock {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: radial-gradient(120% 120% at 50% 0%, #1b2033 0%, var(--bg) 60%);
  display: grid;
  place-items: center;
  padding: 24px;
  overflow-y: auto;
}

.unlock-card {
  width: min(380px, 100%);
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 36px 32px;
  box-shadow: var(--shadow);
  text-align: center;
}

.unlock-card h1 {
  margin: 0 0 6px;
  font-size: 22px;
  word-break: break-word;
}

.unlock-card label {
  display: block;
  text-align: left;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.unlock-card input {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 18px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
}

.unlock-card input:focus {
  border-color: var(--accent);
}

.unlock-card button {
  width: 100%;
  padding: 12px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}

.unlock-card button:disabled {
  opacity: 0.6;
  cursor: progress;
}

.unlock-card .error {
  margin: 14px 0 0;
  font-size: 14px;
}

/* Toujours proposer une sortie : sans ça, un lien mort enferme le visiteur. */
.unlock-exit {
  margin: 18px 0 0;
  font-size: 13.5px;
}

.unlock-exit a {
  color: var(--muted);
  text-decoration: none;
}

.unlock-exit a:hover {
  color: var(--accent);
}

/* --------------------- Sélection de fichiers ------------------------ */

.card-check {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 26px;
  height: 26px;
  display: none;
  place-items: center;
  background: rgb(0 0 0 / 55%);
  border: 2px solid rgb(255 255 255 / 55%);
  border-radius: 50%;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.card {
  position: relative;
}

/* Les cases n'apparaissent qu'en mode sélection, ou au survol d'une carte. */
body.selecting .card-check,
.card:hover .card-check {
  display: grid;
}

.card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
}

.card.selected .card-check {
  display: grid;
  background: var(--accent);
  border-color: var(--accent);
}

.ghost.active {
  border-color: var(--accent);
  color: var(--accent);
}

.selbar {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: 14px;
  padding: 12px 18px;
  box-shadow: var(--shadow);
  max-width: calc(100vw - 24px);
}

.selbar-count {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
}

.selbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

#sel-share {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

#sel-share:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Laisse la place à la barre flottante en bas de page. */
body.has-selbar main {
  padding-bottom: 110px;
}

#viewer-slideshow.active {
  border-color: var(--accent);
  color: var(--accent);
}

/* ----------------------------- Mobile ------------------------------- */

@media (max-width: 640px) {
  .topbar {
    padding: 10px 12px 0;
  }

  main {
    padding: 14px 12px 40px;
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
  }

  .search-wrap {
    order: 3;
    flex-basis: 100%;
  }

  .selects select {
    max-width: 46vw;
  }

  .nav-arrow {
    width: 40px;
    height: 40px;
    font-size: 22px;
  }

  .viewer-actions .icon-btn {
    padding: 7px 10px;
  }

  .folder-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
  }

  /* Sur telephone, chaque lien de partage s'empile au lieu de tenir sur une ligne. */
  .share-list li {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .share-row-actions {
    justify-content: flex-end;
  }

  .crumb-share {
    margin-left: 0;
    width: 100%;
    margin-top: 4px;
  }

  .modal-card {
    padding: 22px 18px;
  }

  .selbar {
    left: 12px;
    right: 12px;
    bottom: 12px;
    transform: none;
    max-width: none;
    gap: 10px;
    padding: 12px 14px;
  }

  .selbar-actions {
    width: 100%;
  }

  .selbar-actions button {
    flex: 1;
  }

  /* Sur téléphone, les cases restent visibles : il n'y a pas de survol. */
  .card-check {
    display: grid;
  }
}
