/* Mangathèque — styles */
:root {
  --accent: #e8452c;
  --accent-2: #ff6a4d;
  --accent-ink: #fff;
  --ok: #3fbf7f;
  --danger: #e5484d;
  --radius: 14px;
  --radius-s: 10px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.22, .8, .24, 1);
  --gx: 16px; /* marge latérale du contenu */
}
@media (min-width: 900px) { :root { --gx: 28px; } }
@media (min-width: 1500px) { :root { --gx: calc((100vw - 1440px) / 2); } }
html[data-theme="dark"] {
  --bg: #121214; --bg-2: #18181b; --surface: #1f1f23; --surface-2: #2a2a30; --line: #34343b;
  --text: #ededf0; --muted: #9c9ca8; --shadow: 0 10px 30px rgba(0,0,0,.45);
  color-scheme: dark;
}
html[data-theme="light"] {
  --bg: #f6f4f0; --bg-2: #efece6; --surface: #ffffff; --surface-2: #f0ede7; --line: #e2ded6;
  --text: #1b1b1f; --muted: #6c6a72; --shadow: 0 10px 30px rgba(40,30,20,.14);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text); font: 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: default; }
[hidden] { display: none !important; }
img { -webkit-user-drag: none; user-select: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.ic { display: inline-flex; width: 22px; height: 22px; flex: none; }
.ic svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ic.big { width: 44px; height: 44px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.pad { padding-left: calc(var(--gx) + var(--safe-l)); padding-right: calc(var(--gx) + var(--safe-r)); }

/* ---------- boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); font-weight: 600; transition: transform .12s, background .2s;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.dialog .btn.danger { background: var(--danger); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn.big { min-height: 52px; padding: 0 22px; font-size: 16px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  border-radius: 50%; border: 0; background: transparent; flex: none;
}
.icon-btn:active { background: var(--surface-2); }

/* ---------- vues et barre supérieure ---------- */
.view { min-height: 100vh; min-height: 100dvh; padding-bottom: calc(96px + var(--safe-b)); }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 6px;
  padding: calc(6px + var(--safe-t)) calc(8px + var(--safe-r)) 6px calc(8px + var(--safe-l));
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  min-height: calc(56px + var(--safe-t));
}
.topbar.dark { background: rgba(10,10,12,.85); color: #eee; }
.topbar-title { flex: 1; min-width: 0; font-weight: 700; font-size: 17px; display: flex; flex-direction: column; line-height: 1.2; }
.topbar-title, .topbar-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-title small { font-weight: 500; font-size: 12px; color: var(--muted); }
.brand { flex: 1; display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; letter-spacing: -.01em; padding-left: 8px; }
.logo { width: 30px; height: 30px; }

/* ---------- état vide ---------- */
.empty-state { max-width: 520px; margin: 0 auto; padding: 28px 24px; text-align: center; }
.empty-state h1 { font-size: 24px; margin: 18px 0 8px; letter-spacing: -.01em; }
.empty-state p { color: var(--muted); margin: 0 0 22px; }
.empty-actions { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.empty-art { position: relative; height: 170px; margin-top: 18px; }
.empty-art .pg { position: absolute; left: 50%; top: 10px; width: 104px; height: 148px; border-radius: 6px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.empty-art .pg::before, .empty-art .pg::after { content: ""; position: absolute; left: 10px; right: 10px; border: 2px solid var(--line); border-radius: 3px; }
.empty-art .pg::before { top: 10px; height: 56px; }
.empty-art .pg::after { top: 74px; bottom: 10px; }
.empty-art .p1 { transform: translateX(-120%) rotate(-10deg); }
.empty-art .p2 { transform: translateX(-50%); z-index: 2; border-color: var(--accent); }
.empty-art .p2::before { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.empty-art .p3 { transform: translateX(20%) rotate(10deg); }

/* ---------- bibliothèque ---------- */
.searchbar {
  display: flex; align-items: center; gap: 8px; margin: 6px calc(var(--gx) + var(--safe-r)) 4px calc(var(--gx) + var(--safe-l));
  padding: 0 14px; height: 44px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted);
}
.searchbar input { flex: 1; border: 0; background: transparent; outline: none; color: var(--text); min-width: 0; }
.draft-banner {
  display: flex; align-items: center; gap: 10px; width: calc(100% - 2 * var(--gx)); margin: 6px var(--gx) 8px; padding: 12px 14px;
  border-radius: var(--radius-s); border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent);
  background: color-mix(in srgb, var(--accent) 14%, var(--surface)); text-align: left; font-weight: 600;
}
.draft-banner span:nth-child(2) { flex: 1; }
.shelf { margin-top: 14px; }
.section-head { display: flex; align-items: center; justify-content: space-between; padding-right: calc(var(--gx) + var(--safe-r)); }
.section-title { font-size: 18px; margin: 8px 0 10px; padding-left: calc(var(--gx) + var(--safe-l)); letter-spacing: -.01em; }
.shelf-row { display: flex; gap: 12px; overflow-x: auto; padding: 2px calc(var(--gx) + var(--safe-r)) 10px calc(var(--gx) + var(--safe-l)); scroll-snap-type: x mandatory; scrollbar-width: none; }
.shelf-row::-webkit-scrollbar { display: none; }
.cont-card { flex: none; width: 250px; display: flex; gap: 12px; padding: 10px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); text-align: left; scroll-snap-align: start; }
.cont-cover { position: relative; width: 70px; aspect-ratio: 5/7; border-radius: 6px; overflow: hidden; background: var(--surface-2); flex: none; }
.cont-cover img, .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cont-meta { display: flex; flex-direction: column; min-width: 0; padding-top: 2px; gap: 2px; }
.cont-meta strong, .cont-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cont-meta span { color: var(--muted); font-size: 14px; }
.cont-meta small { margin-top: auto; color: var(--accent-2); font-weight: 600; }
.bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(0,0,0,.45); }
.bar i { display: block; height: 100%; background: var(--accent); }

.series-grid, .vol-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 16px 12px;
  padding: 0 calc(var(--gx) + var(--safe-r)) 0 calc(var(--gx) + var(--safe-l));
}
@media (min-width: 700px) { .series-grid, .vol-grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 22px 16px; } }
@media (min-width: 1100px) { .series-grid, .vol-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 24px 18px; } }
.series-grid[data-size="s"] { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
.series-grid[data-size="l"] { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
@media (min-width: 700px) {
  .series-grid[data-size="s"] { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
  .series-grid[data-size="l"] { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}
.series-card, .vol-open { display: flex; flex-direction: column; gap: 6px; padding: 0; border: 0; background: none; text-align: left; min-width: 0; width: 100%; }
.cover { position: relative; aspect-ratio: 5/7; border-radius: 8px; overflow: hidden; background: var(--surface-2); box-shadow: 0 4px 14px rgba(0,0,0,.25); transition: transform .15s var(--ease); }
.series-card:active .cover, .vol-open:active .cover { transform: scale(.97); }
.cover-ph { width: 100%; height: 100%; display: grid; place-items: center; color: var(--muted); }
.series-meta { display: flex; flex-direction: column; min-width: 0; }
.series-card strong, .vol-open strong { font-size: 14px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.series-card small, .vol-open small { color: var(--muted); font-size: 12px; }
.badge { position: absolute; top: 6px; left: 6px; padding: 2px 8px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; }
.badge.done { left: auto; right: 6px; padding: 3px; background: var(--ok); }
.badge.done .ic { width: 14px; height: 14px; }
.vol-card { position: relative; }
.vol-more { position: absolute; top: 4px; right: 4px; width: 34px; height: 34px; background: rgba(0,0,0,.55); color: #fff; backdrop-filter: blur(6px); }
.vol-card .badge.done { top: auto; bottom: 8px; }

.fab {
  position: fixed; right: calc(18px + var(--safe-r)); bottom: calc(20px + var(--safe-b)); z-index: 30;
  width: 60px; height: 60px; border-radius: 20px; border: 0; background: var(--accent); color: #fff;
  box-shadow: 0 10px 28px color-mix(in srgb, var(--accent) 45%, transparent); display: grid; place-items: center;
}
.fab .ic { width: 28px; height: 28px; }
.fab:active { transform: scale(.94); }
#v-library:has(#lib-empty:not([hidden])) .fab { display: none; }

/* ---------- segmented ---------- */
.segmented { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface-2); gap: 2px; flex-wrap: wrap; }
.segmented button { border: 0; background: transparent; padding: 7px 12px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.segmented button .ic { width: 16px; height: 16px; }
.segmented button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.segmented.mini button { padding: 5px 10px; font-size: 13px; }

/* ---------- série ---------- */
.se-head { display: flex; gap: 18px; padding: 8px calc(var(--gx) + var(--safe-r)) 18px calc(var(--gx) + var(--safe-l)); align-items: flex-start; }
.se-cover { width: 118px; flex: none; aspect-ratio: 5/7; border-radius: 10px; overflow: hidden; background: var(--surface-2); box-shadow: var(--shadow); }
.se-cover img { width: 100%; height: 100%; object-fit: cover; }
.se-info { min-width: 0; flex: 1; }
.se-info h1 { margin: 2px 0 4px; font-size: 22px; line-height: 1.2; letter-spacing: -.01em; word-break: break-word; }
.se-info p { margin: 0 0 4px; }
.se-info p .ic { width: 16px; height: 16px; vertical-align: -3px; }
.se-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.se-actions .btn.primary span:last-child { max-width: 52vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 420px) { .se-head { gap: 14px; } .se-cover { width: 96px; } .se-info h1 { font-size: 19px; } }

/* ---------- dialogues ---------- */
#overlays { position: relative; z-index: 100; }
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: grid; place-items: center; padding: 16px; opacity: 0; transition: opacity .2s; z-index: 100; }
.scrim.show { opacity: 1; }
.scrim.bottom { place-items: end center; padding: 0; }
.dialog {
  width: min(440px, 100%); max-height: calc(100dvh - 32px); overflow: auto; background: var(--surface); color: var(--text);
  border-radius: 20px; padding: 20px; box-shadow: var(--shadow); transform: translateY(12px) scale(.98); transition: transform .22s var(--ease);
}
.dialog.wide { width: min(620px, 100%); }
.scrim.show .dialog { transform: none; }
.dialog-title { margin: 0 0 12px; font-size: 19px; }
.dialog-body p { margin: 0 0 8px; color: var(--muted); }
.dialog-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.lbl { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); font-weight: 600; }
.lbl.grow { flex: 1; min-width: 0; }
.field {
  width: 100%; min-height: 44px; padding: 8px 12px; border-radius: var(--radius-s); border: 1px solid var(--line);
  background: var(--bg-2); color: var(--text); font-size: 16px; font-weight: 500;
}
.field:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.field.num { width: 84px; }
.form { display: flex; flex-direction: column; gap: 12px; }
.radios { display: flex; gap: 18px; margin-bottom: 14px; font-weight: 600; }
.radios input { accent-color: var(--accent); width: 18px; height: 18px; vertical-align: -3px; }
.imp-list { display: flex; flex-direction: column; gap: 12px; }
.imp-row { padding: 12px; border-radius: var(--radius); background: var(--bg-2); border: 1px solid var(--line); }
.imp-file { display: grid; grid-template-columns: auto 1fr; gap: 0 8px; align-items: center; margin-bottom: 10px; }
.imp-file span:nth-child(2) { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imp-file small { grid-column: 2; color: var(--muted); font-size: 12px; }
.imp-fields { display: flex; flex-direction: column; gap: 8px; }
.imp-line { display: flex; gap: 8px; align-items: flex-end; }
.errlist { margin: 0; padding-left: 18px; color: var(--muted); }

/* feuille d'actions */
.sheet {
  width: min(560px, 100%); background: var(--surface); border-radius: 22px 22px 0 0; padding: 10px 8px calc(12px + var(--safe-b));
  transform: translateY(100%); transition: transform .24s var(--ease); max-height: 85dvh; overflow: auto;
}
.scrim.show .sheet { transform: none; }
.sheet::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 2px auto 8px; }
.sheet-title { padding: 4px 14px 8px; font-weight: 700; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-item { display: grid; grid-template-columns: 28px 1fr; align-items: center; gap: 2px 12px; width: 100%; padding: 13px 14px; border: 0; background: none; border-radius: 12px; text-align: left; font-size: 16px; font-weight: 500; }
.sheet-item small { grid-column: 2; color: var(--muted); font-size: 13px; }
.sheet-item:active { background: var(--surface-2); }
.sheet-item.danger { color: var(--danger); }
.sheet-sep { border: 0; border-top: 1px solid var(--line); margin: 6px 12px; }

/* attente */
.busy { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.6); display: grid; place-items: center; opacity: 0; transition: opacity .2s; }
.busy.show { opacity: 1; }
.busy-box { width: min(320px, 86vw); padding: 24px; border-radius: 20px; background: var(--surface); text-align: center; box-shadow: var(--shadow); }
.busy-text { font-weight: 700; margin-top: 14px; }
.busy-sub { font-size: 13px; color: var(--muted); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.busy-bar { height: 6px; border-radius: 6px; background: var(--surface-2); margin-top: 14px; overflow: hidden; visibility: hidden; }
.busy-bar.on { visibility: visible; }
.busy-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid color-mix(in srgb, var(--accent) 25%, transparent); border-top-color: var(--accent); animation: spin .8s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* toasts */
.toasts { position: fixed; left: 0; right: 0; bottom: calc(18px + var(--safe-b)); z-index: 300; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 12px; max-width: 520px; padding: 12px 16px; border-radius: 14px;
  background: #2b2b31; color: #f2f2f4; box-shadow: 0 10px 30px rgba(0,0,0,.4); font-size: 14px;
  transform: translateY(16px); opacity: 0; transition: transform .25s var(--ease), opacity .25s;
}
.toast.show { transform: none; opacity: 1; }
.toast-btn { border: 0; background: none; color: var(--accent-2); font-weight: 700; padding: 4px 0; white-space: nowrap; }

/* glisser-déposer */
.drop-hint { position: fixed; inset: 0; z-index: 400; display: none; place-items: center; background: rgba(232,69,44,.18); border: 3px dashed var(--accent); pointer-events: none; }
.drop-hint > div { background: var(--surface); padding: 22px 28px; border-radius: 18px; text-align: center; box-shadow: var(--shadow); color: var(--accent); }
.drop-hint p { margin: 8px 0 0; color: var(--text); font-weight: 700; }
body.dropping .drop-hint { display: grid; }

/* ---------- réglages ---------- */
.st-body { padding: 4px calc(var(--gx) + var(--safe-r)) 24px calc(var(--gx) + var(--safe-l)); max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.st-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.st-card h3 { margin: 0 0 12px; font-size: 16px; }
.st-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; border-top: 1px solid var(--line); }
.st-row:first-of-type { border-top: 0; }
.st-row > div:first-child { min-width: 0; }
.st-row small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.st-label { font-weight: 600; }
.st-row .field { width: auto; max-width: 56%; min-height: 40px; font-size: 14px; }
.st-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 8px; }
.st-stats div { background: var(--bg-2); border-radius: 12px; padding: 10px 6px; text-align: center; display: flex; flex-direction: column; }
.st-stats b { font-size: 17px; }
.st-stats span { font-size: 11px; color: var(--muted); }
.pill { padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.pill.ok { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }

/* ---------- gestion des pages ---------- */
.pm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; padding: 4px calc(var(--gx) + var(--safe-r)) 120px calc(var(--gx) + var(--safe-l)); }
@media (min-width: 900px) { .pm-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px; } }
.pm-tile { position: relative; padding: 0; border: 2px solid transparent; border-radius: 8px; background: var(--surface-2); aspect-ratio: 5/7; overflow: hidden; }
.pm-tile img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pm-num { position: absolute; left: 4px; bottom: 4px; min-width: 22px; padding: 1px 6px; border-radius: 6px; background: rgba(0,0,0,.65); color: #fff; font-size: 12px; font-weight: 700; }
.pm-star { position: absolute; top: 4px; left: 4px; color: #ffc53d; }
.pm-star .ic { width: 18px; height: 18px; }
.pm-check { position: absolute; top: 5px; right: 5px; width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff; background: rgba(0,0,0,.3); display: grid; place-items: center; color: #fff; }
.pm-check .ic { width: 14px; height: 14px; opacity: 0; }
.pm-tile.sel { border-color: var(--accent); }
.pm-tile.sel .pm-check { background: var(--accent); border-color: var(--accent); }
.pm-tile.sel .pm-check .ic { opacity: 1; }
.pm-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; align-items: center; gap: 2px; overflow-x: auto;
  padding: 8px calc(8px + var(--safe-r)) calc(8px + var(--safe-b)) calc(8px + var(--safe-l));
  background: var(--surface); border-top: 1px solid var(--line); transform: translateY(110%); transition: transform .22s var(--ease);
}
.pm-bar.on { transform: none; }
.pm-selcount { font-weight: 700; font-size: 13px; padding: 0 8px; white-space: nowrap; }
.tool { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; min-width: 58px; padding: 6px 6px; border: 0; background: none; border-radius: 12px; font-size: 11px; font-weight: 600; color: inherit; }
.tool:active { background: rgba(127,127,127,.18); }
.tool.danger { color: var(--danger); }

/* ---------- lecteur ---------- */
.reader { position: fixed; inset: 0; padding: 0; min-height: 0; overflow: hidden; z-index: 50; outline: none; touch-action: none; }
.reader[data-bg="black"] { background: #000; }
.reader[data-bg="gray"] { background: #3a3a3e; }
.reader[data-bg="white"] { background: #f4f2ee; }
.rd-stage { position: absolute; inset: 0; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
.rd-track { display: flex; width: 300%; height: 100%; will-change: transform; }
.rd-panel { position: relative; flex: 0 0 33.33333%; height: 100%; overflow: hidden; }
.rd-content { position: absolute; inset: 0; }
.rd-spread { position: absolute; left: 0; top: 0; display: flex; transform-origin: 0 0; }
.rd-spread.anim { transition: transform .24s var(--ease); }
.rd-spread.gesture { will-change: transform; }
.rd-page { position: relative; flex: none; overflow: hidden; }
.rd-page img { width: 100%; height: 100%; display: block; object-fit: fill; }
.rd-page.half img { position: absolute; top: 0; width: 200%; max-width: none; }
.rd-page.hL img { left: 0; }
.rd-page.hR img { left: -100%; }
.rd-vscroll { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; touch-action: pan-y; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.vs-page { width: var(--vw, 100%); margin: 0 auto var(--vgap, 0); background: rgba(127,127,127,.08); }
.vs-page img { width: 100%; height: 100%; display: block; }
.rd-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(127,127,127,.18); z-index: 2; pointer-events: none; transition: opacity .25s; }
.rd-progress i { display: block; height: 100%; background: var(--accent); transition: width .25s; }
.rd-pagebadge { position: absolute; right: calc(10px + var(--safe-r)); bottom: calc(10px + var(--safe-b)); z-index: 2; padding: 2px 9px; border-radius: 999px; background: rgba(0,0,0,.55); color: #ddd; font-size: 12px; font-weight: 600; pointer-events: none; opacity: .0; transition: opacity .3s; }
.reader:not(.ui-on) .rd-pagebadge { opacity: .75; }
.rd-ui { position: absolute; inset: 0; pointer-events: none; z-index: 5; color: #f1f1f3; }
.rd-top, .rd-bottom {
  position: absolute; left: 0; right: 0; display: flex; align-items: center; gap: 4px; pointer-events: auto;
  background: rgba(14,14,16,.88); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  transition: transform .25s var(--ease), opacity .25s;
}
.rd-top { top: 0; padding: calc(6px + var(--safe-t)) calc(8px + var(--safe-r)) 6px calc(8px + var(--safe-l)); transform: translateY(-110%); }
.rd-bottom { bottom: 0; padding: 10px calc(10px + var(--safe-r)) calc(12px + var(--safe-b)) calc(10px + var(--safe-l)); transform: translateY(110%); }
.reader.ui-on .rd-top, .reader.ui-on .rd-bottom { transform: none; }
.reader.ui-on .rd-progress { opacity: 0; }
.rd-ui .icon-btn:active { background: rgba(255,255,255,.12); }
.rd-titles { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.rd-titles strong, .rd-titles span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rd-titles span { font-size: 13px; color: #aaa; }
.rd-slider-wrap { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.rd-slabel { font-size: 13px; font-weight: 600; min-width: 64px; text-align: center; color: #ccc; white-space: nowrap; }
input[type="range"] { flex: 1; min-width: 0; accent-color: var(--accent); height: 28px; }

.rd-sheet { position: absolute; inset: 0; z-index: 8; background: rgba(0,0,0,.35); opacity: 0; transition: opacity .22s; }
.rd-sheet.open { opacity: 1; }
.rd-sheet-body {
  position: absolute; right: 0; top: 0; bottom: 0; width: min(380px, 100%); overflow-y: auto; background: #18181b; color: #ececef;
  padding: calc(16px + var(--safe-t)) calc(var(--gx) + var(--safe-r)) calc(20px + var(--safe-b)) 16px;
  transform: translateX(100%); transition: transform .25s var(--ease); --surface: #26262b; --surface-2: #2f2f35; --text: #ececef; --muted: #9b9ba6; --line: #34343b;
}
.rd-sheet.open .rd-sheet-body { transform: none; }
@media (max-width: 600px) {
  .rd-sheet-body { top: auto; left: 0; width: 100%; max-height: 78dvh; border-radius: 20px 20px 0 0; transform: translateY(100%); }
}
.rs-title { font-weight: 800; font-size: 17px; margin-bottom: 8px; }
.rs-row { padding: 10px 0; border-bottom: 1px solid #2c2c32; display: flex; flex-direction: column; gap: 8px; }
.rs-row.rs-toggle { flex-direction: row; align-items: center; justify-content: space-between; cursor: pointer; }
.rs-row small { color: #8e8e98; font-size: 12px; display: block; }
.rs-label { font-weight: 600; font-size: 14px; }
.rs-val { color: var(--accent-2); font-weight: 700; }
.rs-actions { margin-top: 14px; }
.rs-note { font-size: 12px; color: #8e8e98; }
.switch { appearance: none; -webkit-appearance: none; width: 46px; height: 28px; border-radius: 999px; background: #3b3b42; position: relative; flex: none; cursor: pointer; transition: background .2s; margin: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); }
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(18px); }
.range { width: 100%; }

.rd-end { position: absolute; inset: 0; z-index: 9; display: grid; place-items: center; background: rgba(0,0,0,.7); opacity: 0; transition: opacity .2s; padding: 20px; }
.rd-end.show { opacity: 1; }
.rd-end-box { width: min(380px, 100%); background: #1c1c20; color: #eee; border-radius: 22px; padding: 24px; display: flex; flex-direction: column; gap: 10px; text-align: center; }
.rd-end-box h2 { margin: 0; font-size: 19px; }
.rd-end-box p { margin: 0 0 6px; }
.rd-end-box .btn:not(.primary) { background: #2a2a30; border-color: #34343b; color: #eee; }
.rd-end-box .btn.ghost { background: transparent; border-color: transparent; color: #9c9ca8; }

.rd-hint { position: absolute; inset: 0; z-index: 10; display: grid; grid-template-columns: 30% 40% 30%; color: #fff; font-weight: 700; text-align: center; animation: fadein .3s; }
.rd-hint > div { display: grid; place-items: center; background: rgba(232,69,44,.28); border-right: 2px dashed rgba(255,255,255,.5); }
.rd-hint > div:nth-child(2) { background: rgba(0,0,0,.45); }
.rd-hint > div:last-child { border-right: 0; }
.rd-hint span { padding: 8px 12px; border-radius: 12px; background: rgba(0,0,0,.6); font-size: 14px; }
.rd-hint small { font-weight: 500; opacity: .8; }
@keyframes fadein { from { opacity: 0; } }

/* ---------- numérisation ---------- */
.scan { background: #0b0b0d; color: #eee; display: flex; flex-direction: column; height: 100dvh; padding: 0; overflow: hidden; }
.scan .topbar-title small { color: #999; }
.cam { position: relative; flex: 1; min-height: 0; background: #000; overflow: hidden; }
.cam video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.cam-guide { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.cam-guide polygon { fill: rgba(232,69,44,.16); stroke: #ff5a36; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.cam-frame { position: absolute; inset: 7% 12%; border: 1.5px dashed rgba(255,255,255,.25); border-radius: 8px; pointer-events: none; opacity: 0; transition: opacity .3s; }
.cam.live .cam-frame { opacity: 1; }
.cam.flash::after { content: ""; position: absolute; inset: 0; background: #fff; opacity: .7; animation: flash .18s ease-out forwards; }
@keyframes flash { to { opacity: 0; } }
.cam-msg { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; color: #bbb; gap: 8px; }
.cam-msg p { max-width: 380px; margin: 0 0 8px; }
.cam-msg .btn { background: #26262b; border-color: #3a3a40; color: #eee; }
.cam-tip { position: absolute; left: 0; right: 0; bottom: 8px; margin: 0; text-align: center; font-size: 12px; color: rgba(255,255,255,.7); text-shadow: 0 1px 3px #000; pointer-events: none; padding: 0 16px; }
.cam:not(.live) .cam-tip { display: none; }
.cam-controls { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 14px 18px 8px; gap: 10px; position: relative; }
.cam-controls #cam-gallery { justify-self: start; }
.cam-controls #cam-native { justify-self: end; }
.cam-controls #cam-torch { position: absolute; right: calc(50% - 110px); top: 24px; }
.cam-side { display: flex; flex-direction: column; align-items: center; gap: 3px; border: 0; background: none; color: #ddd; font-size: 11px; line-height: 1.15; text-align: center; min-width: 64px; padding: 4px; border-radius: 12px; }
.cam-side.on { color: #ffd23d; }
.cam-side:active { background: rgba(255,255,255,.08); }
.shutter { width: 74px; height: 74px; border-radius: 50%; border: 4px solid #fff; background: var(--accent); box-shadow: 0 0 0 4px rgba(232,69,44,.3); }
.shutter:active { transform: scale(.92); }
.tray-wrap { display: flex; align-items: center; gap: 10px; padding: 8px calc(14px + var(--safe-r)) calc(12px + var(--safe-b)) calc(14px + var(--safe-l)); border-top: 1px solid #222; min-height: 92px; }
.tray { flex: 1; display: flex; gap: 8px; overflow-x: auto; min-width: 0; scrollbar-width: none; }
.tray:empty { display: none; }
.tray-empty { flex: 1; margin: 0; color: #888; }
.tray-item { position: relative; flex: none; width: 52px; height: 72px; border-radius: 6px; overflow: hidden; background: #222; }
.tray-item img { width: 100%; height: 100%; object-fit: cover; }
.tray-item > span { position: absolute; left: 3px; bottom: 3px; background: rgba(0,0,0,.7); color: #fff; border-radius: 4px; font-size: 10px; padding: 0 4px; font-weight: 700; }
.tray-del { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: rgba(0,0,0,.7); color: #fff; display: grid; place-items: center; }
.tray-del .ic { width: 12px; height: 12px; }

.scan-editor { position: fixed; inset: 0; z-index: 60; background: #0b0b0d; display: flex; flex-direction: column; }
.ed-step { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ed-stage, .ed-stage2 { position: relative; flex: 1; min-height: 0; overflow: hidden; touch-action: none; }
#ed-canvas { position: absolute; }
.ed-svg { position: absolute; left: 0; top: 0; pointer-events: none; }
.ed-svg path { fill: rgba(0,0,0,.55); }
.ed-svg polygon { fill: none; stroke: #ff5a36; stroke-width: 2.5; stroke-linejoin: round; }
.handle { position: absolute; left: 0; top: 0; width: 48px; height: 48px; margin: -24px 0 0 -24px; border-radius: 50%; touch-action: none; cursor: grab; z-index: 2; }
.handle::after { content: ""; position: absolute; inset: 13px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); box-shadow: 0 2px 8px rgba(0,0,0,.5); transition: transform .12s; }
.handle.drag::after { transform: scale(1.35); }
.ed-loupe { position: absolute; width: 128px; height: 128px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 6px 20px rgba(0,0,0,.6); z-index: 3; pointer-events: none; }
.ed-stage2 { display: grid; place-items: center; padding: 14px; }
#ed-result { max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: 0 6px 24px rgba(0,0,0,.6); background: #fff; }
#ed-enh-spin { position: absolute; }
.ed-tools { display: flex; align-items: center; gap: 4px; padding: 10px calc(14px + var(--safe-r)) calc(12px + var(--safe-b)) calc(14px + var(--safe-l)); }
.ed-tools .btn { margin-left: auto; }
.ed-tools .tool { color: #ddd; }
.chips { display: flex; gap: 8px; padding: 10px 14px 0; overflow-x: auto; justify-content: center; flex-wrap: wrap; }
.chip { border: 1px solid #3a3a40; background: #1d1d21; color: #ddd; padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 14px; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }

@media (prefers-reduced-motion: reduce) { * { transition-duration: .01ms !important; animation-duration: .01ms !important; } }

/* toasts au-dessus des barres d'action */
html[data-view="pages"] .toasts { bottom: calc(86px + var(--safe-b)); }
html[data-view="scan"] .toasts { bottom: auto; top: calc(64px + var(--safe-t)); }
html[data-view="library"] .toasts { padding-right: 90px; }
@media (max-width: 520px) {
  .pm-selcount { display: none; }
  .pm-bar { justify-content: space-around; }
  .tool { min-width: 50px; }
}

/* =========================================================== v1.1 — nouveaux composants */
textarea.field { resize: vertical; min-height: 80px; line-height: 1.4; font-size: 15px; }
.icon-btn.small { width: 36px; height: 36px; }
.icon-btn.small .ic { width: 19px; height: 19px; }
.head-tools { display: flex; align-items: center; gap: 4px; }
.draft-banner.warn { border-color: color-mix(in srgb, #f5a524 60%, transparent); background: color-mix(in srgb, #f5a524 14%, var(--surface)); }

/* filtres */
.filters { display: flex; gap: 8px; overflow-x: auto; padding: 8px calc(var(--gx) + var(--safe-r)) 2px calc(var(--gx) + var(--safe-l)); scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.fchip { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 600; color: var(--muted); }
.fchip .ic { width: 15px; height: 15px; }
.fchip.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* vue liste */
.series-grid[data-view="list"] { display: flex; flex-direction: column; gap: 8px; }
.series-row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-align: left; }
.series-row .cover { width: 52px; flex: none; border-radius: 6px; box-shadow: none; }
.series-row .series-meta { flex: 1; min-width: 0; gap: 3px; }
.series-row strong { font-size: 15px; display: flex; align-items: center; gap: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.series-row .ic.fav { width: 15px; height: 15px; color: #ffc53d; }
.series-row .badge { position: static; flex: none; }
.rowbar { height: 4px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin-top: 4px; }
.rowbar i { display: block; height: 100%; background: var(--accent); }
.fav-badge { position: absolute; right: 6px; bottom: 6px; width: 24px; height: 24px; border-radius: 50%; background: rgba(0,0,0,.6); color: #ffc53d; display: grid; place-items: center; }
.fav-badge .ic { width: 15px; height: 15px; }
.bm-badge { position: absolute; left: 6px; top: 6px; color: var(--accent-2); filter: drop-shadow(0 1px 2px rgba(0,0,0,.7)); }
.bm-badge .ic { width: 18px; height: 18px; }
.bm-badge svg, .rg-bm svg, #rd-bm.on svg { fill: currentColor; }

/* série */
.se-titleline { display: flex; align-items: flex-start; gap: 4px; }
.se-titleline h1 { flex: 1; min-width: 0; }
.fav-toggle { color: var(--muted); margin-top: -6px; }
.fav-toggle.on { color: #ffc53d; }
.se-author { font-weight: 600; margin: 0 0 4px; }
.se-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.se-more { padding: 0 calc(var(--gx) + var(--safe-r)) 10px calc(var(--gx) + var(--safe-l)); }
.se-summary { margin: 0 0 8px; color: var(--text); line-height: 1.5; white-space: pre-line; }
.se-summary.clamp { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.se-notes { margin: 0; color: var(--muted); font-size: 14px; white-space: pre-line; }
.vol-grid.selecting .vol-card .cover { outline: 2px solid transparent; transition: outline-color .15s; }
.vol-card.sel .cover { outline: 3px solid var(--accent) !important; outline-offset: -3px; }
.vol-card .pm-check { top: auto; bottom: 6px; right: 6px; }
.vol-card.sel .pm-check { background: var(--accent); border-color: var(--accent); }
.vol-card.sel .pm-check .ic { opacity: 1; }
.se-bar { z-index: 35; }
#v-series { padding-bottom: calc(110px + var(--safe-b)); }

/* import */
.imp-file { grid-template-columns: auto 1fr; }
.imp-chk { grid-row: span 2; display: grid; place-items: center; padding-right: 4px; }
.imp-chk input { width: 20px; height: 20px; accent-color: var(--accent); }
.imp-row.off { opacity: .55; }
.imp-row.off .imp-fields { display: none; }
.imp-warn { margin: -4px 0 8px; font-size: 13px; color: #f5a524; }
.tag-picker { display: flex; flex-wrap: wrap; gap: 6px; }

/* lecteur : nouveaux éléments */
.rd-clock { position: absolute; top: calc(8px + var(--safe-t)); right: calc(12px + var(--safe-r)); z-index: 2; padding: 2px 9px; border-radius: 999px; background: rgba(0,0,0,.5); color: #ddd; font-size: 12px; font-weight: 600; pointer-events: none; transition: opacity .3s; font-variant-numeric: tabular-nums; }
.reader.ui-on .rd-clock { opacity: 0; }
.rd-note { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 6; padding: 12px 18px; border-radius: 14px; background: rgba(20,20,24,.92); color: #eee; font-weight: 600; }
#rd-bm.on { color: var(--accent-2); }
#rd-autoscroll .ic-pause { display: none; }
#rd-autoscroll.on { color: var(--accent-2); }
#rd-autoscroll.on .ic-play { display: none; }
#rd-autoscroll.on .ic-pause { display: inline-flex; }
.reader.idle, .reader.idle * { cursor: none !important; }
@media (hover: hover) and (pointer: fine) {
  .rd-stage[data-zone="left"] { cursor: w-resize; }
  .rd-stage[data-zone="right"] { cursor: e-resize; }
  .rd-stage[data-zone="center"] { cursor: default; }
}
.rs-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.rs-head .rs-title { margin: 0; }
.rs-head .icon-btn { color: #ccc; }
.rs-group { margin: 14px 0 0; padding-top: 6px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-2); }
.rs-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.rd-sheet-body .btn.small { background: #26262b; border-color: #3a3a40; color: #eee; }
.kbd-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.kbd-table td { padding: 6px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.kbd-table td:first-child { white-space: nowrap; width: 1%; padding-right: 12px; }
kbd { display: inline-block; padding: 2px 7px; border-radius: 6px; border: 1px solid var(--line); border-bottom-width: 2px; background: var(--bg-2); font: 600 12px/1.4 var(--font); }

/* vignettes du lecteur */
.rd-grid { position: absolute; inset: 0; z-index: 9; background: rgba(0,0,0,.6); display: grid; place-items: center; padding: calc(10px + var(--safe-t)) calc(10px + var(--safe-r)) calc(10px + var(--safe-b)) calc(10px + var(--safe-l)); opacity: 0; transition: opacity .2s; }
.rd-grid.open { opacity: 1; }
.rd-grid-box { width: min(1100px, 100%); height: 100%; max-height: 100%; display: flex; flex-direction: column; background: #18181b; color: #eee; border-radius: 18px; overflow: hidden; --surface: #26262b; --surface-2: #2f2f35; --text: #eee; --muted: #9b9ba6; --line: #34343b; --bg-2: #1f1f23; }
.rd-grid-head { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; border-bottom: 1px solid #2c2c32; flex-wrap: wrap; }
.rd-grid-head .icon-btn { margin-left: auto; color: #ccc; }
.rg-goto { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #aaa; }
.rg-goto .field { min-height: 36px; width: 76px; padding: 4px 8px; font-size: 15px; }
.rd-grid-body { flex: 1; overflow-y: auto; padding: 12px; }
.rg-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
@media (min-width: 900px) { .rg-list { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); } }
.rg-tile { position: relative; padding: 0; border: 2px solid transparent; border-radius: 8px; background: #26262b; aspect-ratio: 5/7; overflow: hidden; }
.rg-tile img { width: 100%; height: 100%; object-fit: contain; display: block; }
.rg-tile.cur { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.rg-num { position: absolute; left: 4px; bottom: 4px; padding: 1px 6px; border-radius: 6px; background: rgba(0,0,0,.7); color: #fff; font-size: 12px; font-weight: 700; direction: ltr; }
.rg-bm { position: absolute; top: 3px; right: 4px; color: var(--accent-2); filter: drop-shadow(0 1px 2px #000); }
.rg-bm .ic { width: 18px; height: 18px; }

/* numérisation : nouveaux éléments */
.cam-opts { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 3; }
.cam-opt { padding: 7px 13px; border-radius: 999px; border: 1px solid rgba(255,255,255,.3); background: rgba(0,0,0,.55); color: #ddd; font-size: 13px; font-weight: 700; backdrop-filter: blur(6px); }
.cam-opt.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.cam-status, .cam-burst-state { position: absolute; left: 50%; transform: translateX(-50%); margin: 0; padding: 6px 12px; border-radius: 999px; background: rgba(0,0,0,.7); color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap; z-index: 3; pointer-events: none; }
.cam-status { top: 54px; }
.cam-burst-state { bottom: 40px; background: rgba(232,69,44,.9); }
.cam-guide.stable polygon { stroke: #3fbf7f; fill: rgba(63,191,127,.18); }
.cam-focus { position: absolute; width: 70px; height: 70px; margin: -35px 0 0 -35px; border: 2px solid #ffd23d; border-radius: 12px; opacity: 0; pointer-events: none; z-index: 2; }
.cam-focus.go { animation: focusring .9s ease-out; }
@keyframes focusring { 0% { opacity: 1; transform: scale(1.4); } 30% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1); } }
.tray-item { border: 0; padding: 0; }
.ed-result-wrap { display: contents; }
.ed-split-line { position: absolute; left: 50%; top: 10px; bottom: 10px; border-left: 2px dashed #ff5a36; pointer-events: none; }
.ed-blur { display: flex; align-items: center; gap: 8px; margin: 8px 14px 0; padding: 8px 12px; border-radius: 10px; background: rgba(245,165,36,.16); color: #f5c06a; font-size: 13px; font-weight: 600; }
.ed-adjust { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 16px; padding: 8px 14px 0; color: #ccc; font-size: 12px; }
.ed-adjust label { display: flex; flex-direction: column; gap: 2px; min-width: 130px; flex: 1; max-width: 220px; }
.ed-adjust b { color: var(--accent-2); }
.ed-adjust .chip .ic { width: 16px; height: 16px; vertical-align: -3px; }
.chip.on .ic { color: #fff; }

/* gestion des pages : glisser-déposer */
.pm-tile { -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
.pm-tile.dragging { opacity: .3; }
.pm-ghost { position: fixed; left: 0; top: 0; z-index: 500; pointer-events: none; border-color: var(--accent) !important; box-shadow: 0 14px 34px rgba(0,0,0,.5); opacity: .95; }
.pm-tile.drop-before { box-shadow: -5px 0 0 0 var(--accent); }
.pm-tile.drop-after { box-shadow: 5px 0 0 0 var(--accent); }

/* tablette */
@media (min-width: 700px) {
  .topbar { min-height: calc(60px + var(--safe-t)); }
  .se-cover { width: 150px; }
  .se-info h1 { font-size: 26px; }
  .empty-actions { flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .rd-slabel { min-width: 80px; }
  .cont-card { width: 290px; }
}
@media (min-width: 1100px) {
  .se-cover { width: 180px; }
  .rd-bottom { padding-left: max(16px, calc((100vw - 1000px) / 2)); padding-right: max(16px, calc((100vw - 1000px) / 2)); }
}

/* PC : effets de survol (souris uniquement) */
@media (hover: hover) and (pointer: fine) {
  .btn:hover { filter: brightness(1.08); }
  .btn:not(.primary):not(.danger):hover { background: var(--surface-2); }
  .icon-btn:hover { background: color-mix(in srgb, var(--text) 9%, transparent); }
  .rd-ui .icon-btn:hover { background: rgba(255,255,255,.12); }
  .series-card:hover .cover, .vol-open:hover .cover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0,0,0,.35); }
  .cont-card:hover, .series-row:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
  .sheet-item:hover, .tool:hover { background: color-mix(in srgb, var(--text) 8%, transparent); }
  .fchip:not(.on):hover { color: var(--text); border-color: color-mix(in srgb, var(--text) 30%, var(--line)); }
  .pm-tile:hover, .rg-tile:hover { border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
  .segmented button:not(.on):hover { color: var(--text); }
  .fab:hover { filter: brightness(1.08); transform: translateY(-1px); }
  .vol-more { opacity: .0; transition: opacity .15s; }
  .vol-card:hover .vol-more, .vol-more:focus-visible { opacity: 1; }
  .series-card, .vol-open, .series-row, .cont-card, .pm-tile, .rg-tile { cursor: pointer; }
  .pm-tile { cursor: grab; }
}
.rd-hint span { max-width: 92%; }

html[data-view="series"]:has(#se-bar.on) .toasts { bottom: calc(86px + var(--safe-b)); }
.cam-opt { white-space: nowrap; font-size: 12px; padding: 6px 11px; }
.se-more { margin-top: -6px; }
