:root {
  --bg: #f5f6f8; --panel: #fff; --text: #1d2330; --muted: #6b7385; --border: #dde1e8;
  --accent: #2f6fed; --accent-weak: #e6eeff; --ok: #1f9d55; --warn: #c27c0e; --err: #d64545;
  --ok-weak: #e3f6eb; --warn-weak: #fdf2dc; --err-weak: #fbe5e5;
  --radius: 10px;
}
:root { color-scheme: light; }
/* thème sombre : choisi dans la barre du haut (☀ / 🌙 / auto), sinon celui du système */
:root[data-theme="dark"] {
    --bg: #12151b; --panel: #1b2029; --text: #e6e9ef; --muted: #98a1b3; --border: #2c3340;
    --accent: #5b8cff; --accent-weak: #1e2a45; --ok: #3ccf7f; --warn: #e6a23c; --err: #f06a6a;
    --ok-weak: #143323; --warn-weak: #3a2c10; --err-weak: #3d1a1a; color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12151b; --panel: #1b2029; --text: #e6e9ef; --muted: #98a1b3; --border: #2c3340;
    --accent: #5b8cff; --accent-weak: #1e2a45; --ok: #3ccf7f; --warn: #e6a23c; --err: #f06a6a;
    --ok-weak: #143323; --warn-weak: #3a2c10; --err-weak: #3d1a1a; color-scheme: dark;
  }
}
/* thème « indigo » (allure Overseerr) : gris ardoise, indigo, cartes arrondies, en-tête vitré */
:root[data-theme="ov"] {
    --bg: #111827; --panel: #1f2937; --text: #e5e7eb; --muted: #9ca3af; --border: #374151;
    --accent: #818cf8; --accent-weak: #312e81; --ok: #4ade80; --warn: #fbbf24; --err: #f87171;
    --ok-weak: #14532d; --warn-weak: #451a03; --err-weak: #450a0a; --radius: 12px; color-scheme: dark;
}
:root[data-theme="ov"] body { background: radial-gradient(ellipse at top, #1e1b4b 0%, #111827 55%) fixed; }
:root[data-theme="ov"] header { background: rgba(17, 24, 39, .95); border-bottom-color: #1f2937; }  /* pas de backdrop-filter : il ferait du header le repère des menus « fixed » */
:root[data-theme="ov"] nav a.active { background: #4f46e5; color: #fff; }
:root[data-theme="ov"] .panel { box-shadow: 0 0 0 1px #374151, 0 10px 25px -10px rgba(0, 0, 0, .6); border-color: transparent; }
:root[data-theme="ov"] button.primary, :root[data-theme="ov"] .btn.primary { background: #4f46e5; border-color: #4f46e5; color: #fff; }
:root[data-theme="ov"] button.primary:hover, :root[data-theme="ov"] .btn.primary:hover { background: #6366f1; }
:root[data-theme="ov"] .subnav { background: transparent; }

* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--accent); text-decoration: none; }
header { display: flex; align-items: center; gap: 20px; padding: 10px 20px; background: var(--panel); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 16px; color: var(--text); }
nav { display: flex; gap: 4px; }
nav a { padding: 6px 12px; border-radius: 8px; color: var(--muted); }
nav a.active { background: var(--accent-weak); color: var(--accent); font-weight: 600; }
#pills { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.pill { font-size: 12px; padding: 3px 9px; border-radius: 99px; background: var(--bg); border: 1px solid var(--border); color: var(--muted); }
.pill.ok { color: var(--ok); background: var(--ok-weak); border-color: transparent; }
.pill.warn { color: var(--warn); background: var(--warn-weak); border-color: transparent; }
main { padding: 20px; max-width: 1500px; margin: 0 auto; }
h1 { font-size: 20px; margin: 0 0 16px; }
h2 { font-size: 16px; margin: 0 0 12px; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea { background: var(--bg); border: 1px solid var(--border); border-radius: 7px; padding: 6px 9px; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
button, .btn { background: var(--panel); border: 1px solid var(--border); border-radius: 7px; padding: 6px 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
button:hover, .btn:hover { border-color: var(--accent); }
button.primary, .btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
button.danger { color: var(--err); }
button:disabled { opacity: .5; cursor: default; }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
label.field > input, label.field > select { color: var(--text); font-size: 14px; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--border); }
th { font-size: 12px; color: var(--muted); font-weight: 600; }
tr.link { cursor: pointer; }
tr.link:hover td { background: var(--bg); }
.num { text-align: right; font-variant-numeric: tabular-nums; }

.drop { border: 2px dashed var(--border); border-radius: var(--radius); padding: 24px; text-align: center; color: var(--muted); cursor: pointer; }
.drop.over { border-color: var(--accent); background: var(--accent-weak); }

.toolbar { position: sticky; top: 53px; z-index: 5; background: var(--bg); padding: 8px 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
.scan { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.scan.sel { outline: 2px solid var(--accent); }
.scan.review { border-color: var(--warn); }
.scan.error { border-color: var(--err); }
.scan.listed { opacity: .75; }
.scan .imgs { display: flex; gap: 8px; }
.scan .imgs img { width: 110px; aspect-ratio: 63/88; object-fit: cover; border-radius: 6px; background: var(--bg); border: 1px solid var(--border); }
.scan .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.scan .name { font-weight: 600; font-size: 15px; }
.scan .fields { display: grid; grid-template-columns: 1fr 1fr 70px 90px; gap: 6px; }
.scan .fields > * { width: 100%; }
.scan .title-in { width: 100%; font-size: 12px; }
.badge { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 99px; font-weight: 600; }
.b-matched { background: var(--ok-weak); color: var(--ok); }
.b-review { background: var(--warn-weak); color: var(--warn); }
.b-error { background: var(--err-weak); color: var(--err); }
.b-pending, .b-processing { background: var(--accent-weak); color: var(--accent); }
.b-listed { background: var(--accent); color: #fff; }
.b-sold { background: var(--ok); color: #fff; }
.b-ended { background: var(--border); color: var(--muted); }
.err { color: var(--err); font-size: 12px; white-space: pre-wrap; word-break: break-word; }

.cands { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.cand { border: 1px solid var(--border); border-radius: 8px; padding: 6px; cursor: pointer; font-size: 12px; background: var(--panel); }
.cand:hover { border-color: var(--accent); }
.cand.cur { outline: 2px solid var(--ok); }
.cand img { width: 100%; aspect-ratio: 63/88; object-fit: cover; border-radius: 5px; background: var(--bg); }

.progress { height: 6px; background: var(--bg); border-radius: 99px; overflow: hidden; border: 1px solid var(--border); }
.progress > div { height: 100%; background: var(--accent); transition: width .3s; }
.sets { max-height: 55vh; overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
.sets label { display: flex; gap: 8px; padding: 5px 10px; border-bottom: 1px solid var(--border); align-items: center; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; z-index: 50; overflow: auto; }
.modal.hidden { display: none; }
.modal-box { background: var(--panel); border-radius: var(--radius); padding: 20px; width: min(1000px, 100%); position: relative; }
.modal .close { position: absolute; right: 12px; top: 12px; }
#toast { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
#toast > div { background: var(--text); color: var(--panel); padding: 10px 14px; border-radius: 8px; max-width: 420px; box-shadow: 0 4px 14px rgba(0,0,0,.2); white-space: pre-wrap; }
#toast > div.e { background: var(--err); color: #fff; }

@media (max-width: 640px) {
  main { padding: 12px 16px; }
  header { padding: 8px 16px; gap: 10px; }
  .cards { grid-template-columns: 1fr; }
  .scan .fields { grid-template-columns: 1fr 1fr; }
  .toolbar { top: 0; position: static; }
}

/* Scan rapide (caméra) */
body.live-mode header { display: none; }
body.live-mode main { padding: 0; max-width: none; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.live-top, .live-ctrl { display: flex; gap: 8px; align-items: center; padding: 8px 12px; background: var(--panel); }
.live-top { border-bottom: 1px solid var(--border); }
.live-ctrl button { justify-content: center; padding: 10px 12px; }
.live-cam { position: relative; flex: 1 1 auto; min-height: 45vh; background: #000; overflow: hidden; }
.live-cam video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.guide { position: absolute; border: 3px solid rgba(255,255,255,.9); border-radius: 14px; box-shadow: 0 0 0 9999px rgba(0,0,0,.38); transition: border-color .15s; pointer-events: none; }
.guide.hold { border-color: #f5c542; }
.guide.busy { border-color: var(--accent); border-style: dashed; }
.guide.ok { border-color: #2ecc71; }
.guide.bad { border-color: #ff6b6b; }
.lvstate { position: absolute; left: 8px; right: 8px; bottom: 12px; text-align: center; color: #fff; font-weight: 600; text-shadow: 0 1px 4px #000; }
.lvflash { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); background: rgba(31,157,85,.92); color: #fff; padding: 8px 14px; border-radius: 99px; display: flex; gap: 10px; opacity: 0; pointer-events: none; max-width: 90%; white-space: nowrap; }
.lvflash.show { animation: lvflash 2.2s ease; }
@keyframes lvflash { 0% { opacity: 0; } 10%, 75% { opacity: 1; } 100% { opacity: 0; } }
.live-nocam { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 20px; color: #fff; }
.live-nocam .btn { color: var(--text); }
.live-list { height: 28vh; flex: none; overflow: auto; background: var(--bg); border-top: 1px solid var(--border); }
.live-item { display: flex; gap: 10px; align-items: center; padding: 6px 12px; border-bottom: 1px solid var(--border); background: var(--panel); }
.live-item img { width: 40px; aspect-ratio: 63/88; object-fit: cover; border-radius: 4px; }
[hidden] { display: none !important; }
.live-top select { padding: 4px 6px; max-width: 34vw; }
.quick-cur { display: flex; gap: 12px; padding: 10px 12px; background: var(--panel); border-bottom: 1px solid var(--border); }
.quick-cur img { width: 92px; aspect-ratio: 63/88; object-fit: cover; border-radius: 6px; flex: none; }
.quick-name { font-size: 17px; font-weight: 700; }
.quick-prices { display: flex; gap: 18px; margin: 6px 0 4px; }
.quick-prices > div { display: flex; flex-direction: column; }
.quick-prices b { font-size: 18px; }

/* scan rapide, mode photos */
.lvqueue { position: absolute; right: 10px; top: 10px; background: rgba(0,0,0,.65); color: #fff; padding: 5px 10px; border-radius: 99px; font-size: 13px; }
.lvsnap { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.lvsnap.show { animation: lvsnap .25s ease-out; }
@keyframes lvsnap { 0% { opacity: .7; } 100% { opacity: 0; } }
.lvfocus { position: absolute; width: 70px; height: 70px; margin: -35px 0 0 -35px; border: 2px solid #ffd60a; border-radius: 8px; pointer-events: none; animation: lvfocus .9s ease-out forwards; }
@keyframes lvfocus { 0% { transform: scale(1.5); opacity: 1; } 40% { transform: scale(1); } 100% { transform: scale(1); opacity: 0; } }

/* carte déjà en vente sur eBay */
.listed-note { margin-top: 8px; padding: 6px 8px; border-radius: 8px; background: color-mix(in srgb, var(--warn) 14%, transparent); border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); font-size: 13px; }

/* en-têtes triables (Mes annonces) */
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover { color: var(--text, inherit); text-decoration: underline; }

/* Mes annonces : groupes d'annonces d'un même objet */
.lv-group td { background: rgba(127,127,127,.12); }
.lv-group:hover td { background: rgba(127,127,127,.18); }
.lv-child td { background: rgba(127,127,127,.06); }
.lv-caret { display: inline-block; width: 1em; color: var(--muted, #888); }

/* Lot : vue tableau */
.scantbl td { vertical-align: middle; }
.scantbl tr.sel td { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.scantbl tr.review td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.scantbl tr.error td:first-child { box-shadow: inset 3px 0 0 var(--err); }
.scantbl tr.listed td, .scantbl tr.sold td { opacity: .8; }
.scantbl .thumb { height: 72px; aspect-ratio: 63/88; object-fit: cover; border-radius: 4px; border: 1px solid var(--border); background: var(--bg); transition: transform .15s; transform-origin: left center; position: relative; }
.scantbl .thumb:hover { transform: scale(3); z-index: 20; box-shadow: 0 6px 24px rgba(0,0,0,.35); }
.scantbl td.ttl { min-width: 280px; }
.scantbl td.ttl .title-in { width: 100%; font-size: 13px; font-weight: 500; resize: none; font-family: inherit; line-height: 1.35; }
.scantbl select { font-size: 12px; }
.scantbl .mono { font-family: ui-monospace, monospace; white-space: nowrap; }
.scantbl .len { font-size: 11px; padding: 1px 6px; border-radius: 6px; background: var(--border); white-space: nowrap; }
.scantbl .len.warn { background: color-mix(in srgb, var(--warn) 35%, transparent); }
.conf { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.conf.hi { background: color-mix(in srgb, #22a06b 18%, transparent); color: #1f8a5c; }
.conf.mid { background: color-mix(in srgb, var(--warn) 22%, transparent); }
.conf.lo { background: color-mix(in srgb, var(--err) 18%, transparent); color: var(--err); }
#modal #edit-scan .scan { border: 0; padding: 0; background: transparent; }
#modal #edit-scan .scan > .row:first-child { padding-right: 44px; } /* place pour le ✕ de la fenêtre */

/* Vérification d'un lot recto/verso */
.pairs { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; padding-bottom: 80px; }
.pair { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.pair.error { border-color: var(--err); }
.pair img, .pair .noback { width: 100%; aspect-ratio: 63/88; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); background: var(--bg); }
.pair .noback { display: flex; align-items: center; justify-content: center; color: var(--muted, #888); font-size: 12px; }
.pair .pname { font-weight: 600; font-size: 14px; line-height: 1.2; }
.review-bar { position: sticky; bottom: 0; background: var(--panel); border-top: 1px solid var(--border); padding: 10px 12px; gap: 8px; margin: 0 -12px; box-shadow: 0 -4px 12px rgba(0,0,0,.08); }

/* Recto · Verso ▶◀ Reconnue : comparaison côte à côte, encadrée */
.scantbl th.cmp-h { text-align: center; }
.scantbl td.cmp { text-align: center; padding-left: 4px; padding-right: 4px; border-left: 0; border-right: 0; }
.scantbl .cmp-in { display: flex; align-items: center; justify-content: center; gap: 6px; }
.scantbl .cmp-arrows { color: var(--err); font-size: 19px; line-height: 1; margin-right: -14px; padding: 4px 3px;
  background: none; border: 1px solid transparent; border-radius: 6px; cursor: pointer; }
.scantbl .cmp-arrows:hover { border-color: var(--err); background: color-mix(in srgb, var(--err) 10%, transparent); }
.scantbl .cmp-arrows:disabled { opacity: .4; cursor: wait; }
.scantbl td.cmp .thumb { height: 84px; }
.scantbl .thumb-empty { display: inline-flex; align-items: center; justify-content: center; color: var(--muted); font-size: 18px; }

/* tableau des lots : titres et contenu centrés */
.scantbl th, .scantbl td, .scantbl th.num, .scantbl td.num { text-align: center; }
.scantbl td .cmp-in, .scantbl td .row { justify-content: center; }
.scantbl td input[type=number] { text-align: center; }

/* crayon et poubelle : deux carrés identiques, l'un sous l'autre */
.scantbl .sq-acts { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.scantbl .sq { width: 34px; height: 34px; padding: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; line-height: 1; box-sizing: border-box; }
.scantbl .sq[data-act="edit"] { color: var(--accent); }
.scantbl .sq[data-act="del"] { color: var(--err); }
/* titres et contenu centrés verticalement */
.scantbl th, .scantbl td { vertical-align: middle; }
.scantbl td > *, .scantbl th > * { vertical-align: middle; }
.scantbl td.ttl .title-in { display: block; margin: 0 auto; }
/* barre du haut : pastilles et bouton de même hauteur, texte centré verticalement */
#pills { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
/* menu sous le nom d'utilisateur */
.umenu { position: relative; display: inline-flex; }
.ubtn { display: inline-flex; align-items: center; gap: 4px; height: 28px; box-sizing: border-box; cursor: pointer; font: inherit; font-size: 12px; }
.ubtn:hover, .ubtn[aria-expanded="true"] { color: var(--text); border-color: var(--accent); }
.ubtn.active { color: var(--accent); background: var(--accent-weak); border-color: transparent; font-weight: 600; }
.ubtn .caret { font-size: 9px; opacity: .7; }
.umenu-list { position: absolute; right: 0; top: calc(100% + 6px); min-width: 180px; z-index: 50; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); padding: 4px; display: flex; flex-direction: column; }
.umenu-list[hidden] { display: none; }
.umenu-list a { padding: 8px 12px; border-radius: 7px; color: var(--text); font-size: 14px; }
.umenu-list a:hover { background: var(--accent-weak); color: var(--accent); text-decoration: none; }
.umenu-sep { height: 1px; background: var(--border); margin: 4px 6px; }
.umenu-list .umenu-item { all: unset; box-sizing: border-box; padding: 8px 12px; border-radius: 7px; font-size: 14px; cursor: pointer; color: var(--text); }
.umenu-list .umenu-item:hover, .umenu-list .umenu-item:focus-visible { background: var(--danger-weak, rgba(220, 53, 69, .12)); color: var(--danger, #d33); }
#pills > .pill, #pills > button { display: inline-flex; align-items: center; justify-content: center; gap: 4px; height: 28px; box-sizing: border-box; line-height: 1; padding-top: 0; padding-bottom: 0; }

#themebtn { width: 28px; padding: 0; font-size: 14px; }

/* téléphone : tableau des lots compact (colonnes secondaires masquées, miniatures plus petites) */
@media (max-width: 760px) {
  header { padding: 8px 10px; gap: 8px; position: static; }
  nav { overflow-x: auto; max-width: 100%; scrollbar-width: none; }
  nav::-webkit-scrollbar { display: none; }
  nav.more-r { -webkit-mask-image: linear-gradient(to right, #000 82%, transparent); mask-image: linear-gradient(to right, #000 82%, transparent); }
  nav.more-l { -webkit-mask-image: linear-gradient(to right, transparent, #000 18%); mask-image: linear-gradient(to right, transparent, #000 18%); }
  nav.more-l.more-r { -webkit-mask-image: linear-gradient(to right, transparent, #000 18%, #000 82%, transparent); mask-image: linear-gradient(to right, transparent, #000 18%, #000 82%, transparent); }
  nav a { padding: 6px 8px; white-space: nowrap; }
  #pills { margin-left: 0; }
  #pills .p-sec { display: none !important; }  /* tout va bien : pastilles masquées sur téléphone (les alertes restent) */
  main { padding-left: 8px !important; padding-right: 8px !important; }
  #cards .scantbl th:nth-child(7), #cards .scantbl td:nth-child(7),
  #cards .scantbl th:nth-child(12), #cards .scantbl td:nth-child(12),
  #cards .scantbl th:nth-child(14), #cards .scantbl td:nth-child(14) { display: none; }
  #cards .scantbl th, #cards .scantbl td { padding: 6px 4px; }
  #cards .scantbl td.cmp .thumb { height: 60px; }
  #cards .scantbl .thumb:hover { transform: none; box-shadow: none; }
  #cards .scantbl td.ttl { min-width: 170px; }
  #cards .scantbl td.ttl .title-in { font-size: 12px; }
  #cards .scantbl .sq { width: 30px; height: 30px; }
  #cards .scantbl .cmp-arrows { font-size: 16px; margin-right: -10px; }
  #cards .scantbl select { max-width: 92px; }
  #cards .scantbl td input[type=number] { width: 64px !important; }
}

/* « Scan rapide » (caméra) : seulement sur téléphone / tablette tactile */
@media (hover: hover) and (pointer: fine) {
  nav a[data-nav="scan"] { display: none; }
}

/* Environnement test : bandeau bien visible pour ne jamais confondre avec la production */
.envbanner { background: #d97706; color: #fff; text-align: center; font-weight: 600; font-size: 13px; padding: 6px 12px; }
body.env-test header { border-top: 3px solid #d97706; }

/* Bouton « Test on/off » à côté du nom d'utilisateur */
.envswitch { display: inline-flex; align-items: center; gap: 6px; height: 28px; box-sizing: border-box; text-decoration: none; font-size: 12px; cursor: pointer; }
.envswitch:hover { color: var(--text); border-color: #d97706; }
.envswitch .sw { position: relative; width: 26px; height: 14px; border-radius: 99px; background: var(--border); transition: background .15s; }
.envswitch .knob { position: absolute; top: 2px; left: 2px; width: 10px; height: 10px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 0 1px rgba(0,0,0,.4); }
.envswitch.on { color: #d97706; border-color: #d97706; font-weight: 600; }
.envswitch.on .sw { background: #d97706; }
.envswitch.on .knob { left: 14px; }

.nowrap { white-space: nowrap; }

/* Page Catalogue */
.cat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-top: 12px; }
.cat-tile { padding: 12px 14px; }
.cat-big { font-size: 22px; font-weight: 700; margin: 2px 0; }
.cat-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px 18px; margin-top: 8px; font-size: 13px; }
.cat-facts > div > .muted:first-child { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px; }
.cat-facts .pill { display: inline-block; margin: 0 2px 3px 0; }
.cat-sets { margin-top: 12px; }
.cat-sets summary { cursor: pointer; font-weight: 600; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.cat-card { border: 1px solid var(--border); border-radius: 8px; padding: 6px; background: var(--bg); }
.cat-card img { width: 100%; aspect-ratio: 63 / 88; object-fit: contain; border-radius: 4px; display: block; margin-bottom: 4px; }
.cat-noimg { aspect-ratio: 63 / 88; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; }
.warn-text { color: var(--warn); }

/* Grosses commandes */
.pill.bigorder { color: #fff; background: #d9480f; border-color: transparent; font-weight: 600; text-decoration: none; height: 28px; box-sizing: border-box; display: inline-flex; align-items: center; }
tr.row-big td { background: rgba(217, 72, 15, .10); }
.big-text { color: #d9480f; font-weight: 600; }
.big-panel { border-color: #d9480f; background: rgba(217, 72, 15, .08); }

/* Ma collection */
.pill.p-coll { color: #7c3aed; background: rgba(124, 58, 237, .12); border-color: transparent; }
.p-coll-panel { border-color: rgba(124, 58, 237, .5); background: rgba(124, 58, 237, .07); padding: 10px 14px; }
a.co-card { color: inherit; text-decoration: none; display: block; }
a.co-card:hover { border-color: var(--accent); }

/* Ma collection (liste à part) */
.co-card { position: relative; display: flex; flex-direction: column; gap: 2px; }
.co-img { position: relative; }
.co-sel { position: absolute; top: 6px; left: 6px; width: 20px; height: 20px; }
.co-allsale > .co-img img, .co-allsale > .small:not(.co-sale), .co-allsale > .muted { opacity: .45; filter: grayscale(.8); }
.co-sale { border: 1px dashed var(--border); border-radius: 6px; padding: 4px 6px; margin-top: 4px; background: rgba(127,127,127,.08); }
.co-sale button { margin-top: 3px; }
.co-edit { margin-top: auto; align-self: flex-start; }

/* Ma collection : photos à ajouter */
.ci-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.ci-item { border: 1px solid var(--border); border-radius: 8px; padding: 8px; }
.ci-item.review { border-color: var(--warn); }
.ci-item.error { border-color: var(--danger, #d9480f); }
.ci-img { width: 48%; max-width: 110px; border-radius: 6px; }

/* Ma collection : carte agrandie */
.co-img img { cursor: zoom-in; }
.co-zoom { text-align: center; }
/* aperçu grand format : fenêtre ajustée à la carte, sans grandes marges */
.modal.lightbox { align-items: center; padding: 12px; background: rgba(0,0,0,.75); }
.modal.lightbox .modal-box { width: auto; max-width: 100%; padding: 10px 10px 8px; }
.modal.lightbox .close { right: 6px; top: 6px; z-index: 2; }
.co-zoom-stage { display: flex; align-items: center; gap: 6px; justify-content: center; }
/* cadre fixe au format d'une carte (63 × 88 mm) : l'image officielle et ma photo s'y logent sans que la fenêtre bouge */
.co-zoom-stage img { display: block; height: min(78vh, 680px); width: calc(min(78vh, 680px) * 0.716); max-width: calc(100vw - 120px); object-fit: contain; border-radius: 14px; }
.co-nav { width: 40px; height: 64px; padding: 0; border-radius: 10px; flex: none; display: inline-flex; align-items: center; justify-content: center; }
.co-nav:disabled { opacity: .25; }
.co-zoom-info { margin-top: 6px; max-width: min(560px, calc(100vw - 60px)); margin-left: auto; margin-right: auto; }

.co-flip { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; padding: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: rgba(0,0,0,.6); color: #fff; border: 1px solid rgba(255,255,255,.4); }
.wl-hit { background: color-mix(in srgb, var(--ok) 10%, transparent); border-radius: 6px; padding-left: 6px !important; padding-right: 6px !important; }
a.btn { text-decoration: none; color: inherit; }
a.btn.primary { color: #fff; }

/* sélecteur de mode 🎴 Joueur | 🏪 Vendeur (profil « Les deux ») */
.modesw { display: inline-flex; border: 1px solid var(--border); border-radius: 99px; overflow: hidden; height: 28px; }
.modesw .pill { border: 0; border-radius: 0; height: 100%; cursor: pointer; background: transparent; display: inline-flex; align-items: center; }
.modesw .pill.on { background: var(--accent-weak); color: var(--accent); font-weight: 600; }

/* accueil (Vendeur / Joueur) */
a.home-tile { text-decoration: none; color: inherit; display: block; }
a.home-tile:hover { border-color: var(--accent); }
.home-alert { border-color: var(--warn, #d98c00); background: color-mix(in srgb, var(--warn, #d98c00) 10%, var(--panel)); }
.home-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-top: 16px; align-items: start; }
.home-cols > .panel { margin: 0; }
.home-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; }
.home-card img { width: 100%; border-radius: 6px; cursor: zoom-in; display: block; margin-bottom: 4px; }
.home-card .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-bar { height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; margin-top: 4px; }
.home-bar span { display: block; height: 100%; background: var(--ok, #2e9e5b); }

.home-sec { margin: 22px 0 0; font-size: 18px; }

/* Mes annonces / Vendues : la barre de filtres reste au même endroit */
.lv-bar { gap: 8px; flex-wrap: wrap; align-items: flex-start; margin-top: 10px; }
.seg { display: inline-flex; }
.seg > button { border-radius: 0; margin-left: -1px; min-width: 112px; justify-content: center; }
.seg > button:first-child { border-radius: 6px 0 0 6px; margin-left: 0; }
.seg > button:last-child { border-radius: 0 6px 6px 0; }

/* extension : grille de toutes les cartes, celles qui manquent en gris */
.sp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.sp-card { cursor: zoom-in; text-align: center; }
.sp-card img { width: 100%; border-radius: 6px; display: block; }
.sp-card.sp-miss img, .sp-card.sp-miss .cat-noimg { filter: grayscale(1); opacity: .35; }
.sp-card.sp-miss:hover img { opacity: .7; }
/* assistant deck : aperçu des cartes d'un deck proposé */
.da-grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
.da-card { position: relative; }
.da-card img { border-radius: 4.5% / 3.2%; }
.da-qty { position: absolute; top: 6px; right: 6px; background: rgba(0,0,0,.78); color: #fff; font-weight: 700; font-size: 13px; padding: 1px 7px; border-radius: 10px; }
.da-card img, .da-card .cat-noimg { cursor: zoom-in; }
.da-acts { display: flex; justify-content: center; gap: 2px; margin-top: 2px; }
.da-b { padding: 1px 5px; font-size: 13px; line-height: 1.3; border-radius: 6px; background: transparent; border: 1px solid transparent; cursor: pointer; opacity: .55; }
.da-b:hover { opacity: 1; border-color: var(--border); }
.da-b.on { opacity: 1; background: var(--accent-weak); border-color: var(--accent); }
.da-prog { height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; }
.da-prog span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 3px; transition: width .6s; }
.da-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); vertical-align: baseline; }
.da-dot.on { background: var(--ok); animation: da-pulse 1.4s ease-in-out infinite; }
@keyframes da-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .da-dot.on { animation: none; } }
.da-gpu { display: grid; grid-template-columns: 92px 1fr 96px; gap: 8px; align-items: center; margin-top: 5px; }
.da-gpu .num { text-align: right; color: var(--muted); }
.da-gbar { height: 8px; border-radius: 4px; background: var(--border); overflow: hidden; }
.da-gbar span { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width .6s; }
.da-cmd { width: 200px; max-width: 45vw; border-radius: 4.5% / 3.2%; cursor: zoom-in; }
@media (max-width: 640px) { .da-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; } }
.sp-cap { margin-top: 2px; }

/* Ma collection : exemplaires d'un deck affichés à part */
.co-card.co-indeck { border-color: var(--accent); }
.co-deckband { position: absolute; left: 6px; right: 6px; bottom: 6px; z-index: 2; font-size: 12px; font-weight: 600; color: #fff; background: var(--accent); border-radius: 6px; padding: 2px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; box-shadow: 0 1px 4px rgba(0,0,0,.35); pointer-events: none; }

/* Ma collection : grille de filtres à place fixe */
.co-filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.co-filters > select, .co-filters > input { width: 100%; min-width: 0; box-sizing: border-box; text-overflow: ellipsis; }
.co-filters > select:disabled { opacity: .5; }
.co-fstate { gap: 10px; align-items: center; min-height: 32px; margin: 6px 0 8px; }

.wl-links { display: flex; gap: 12px; margin-top: 2px; }

/* envoi de photos : barre de progression fixe */
.upbox { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 60; width: min(420px, calc(100vw - 24px));
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; box-shadow: 0 10px 30px rgba(0,0,0,.25); display: grid; gap: 6px; }
.upbar { height: 8px; border-radius: 4px; background: var(--border); overflow: hidden; }
.upbar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .25s ease; }
.upbox.done .upbar span { background: var(--ok, #2e9e5b); }
.upbox.err .upbar span { background: var(--warn, #d98c00); }

/* lot : photo à tourner d'un clic */
.scantbl .thumb.rot { cursor: pointer; }
/* une photo qu'on peut tourner : l'agrandissement attend un peu, et s'arrête dès qu'on clique (la cible ne bouge pas) */
.scantbl .thumb.rot:hover { transition-delay: .45s; }
.scantbl .thumb.rot.still, .scantbl .thumb.rot.still:hover { transform: none; transition: none; z-index: auto; box-shadow: none; outline: 2px solid var(--accent, #4a8); }
.rot-tag { position: absolute; transform: translate(-50%, -50%); pointer-events: none; z-index: 30; background: rgba(0,0,0,.78); color: #fff; font-size: 12px; font-weight: 600; padding: 2px 6px; border-radius: 10px; white-space: nowrap; }
.scantbl .thumb.rot.busy { opacity: .45; }

/* avancement de l'analyse d'un lot */
.anaprog { margin: 0 0 10px; font-size: .9rem; }
.anaprog .progress { margin-top: 4px; max-width: 420px; }

/* 📚 Mes sets : un bloc repliable par jeu, sets en tuiles */
details.sp-game { border-top: 1px solid var(--border); }
details.sp-game > summary { cursor: pointer; padding: 10px 4px; font-size: 1.05rem; }
.sp-sets { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; padding: 2px 0 14px; }
.sp-tile { display: flex; flex-direction: column; gap: 4px; align-items: stretch; text-align: left; min-width: 0;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); color: inherit; cursor: pointer; font: inherit; }
.sp-tile:hover, .sp-tile:focus-visible { border-color: var(--accent); }
.sp-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-bar { display: block; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.sp-bar > span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
@media (max-width: 520px) { .sp-sets { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* 💰 Vendues : choix de la boîte d'une annonce fusionnée */
.pk-line { margin-top: 4px; line-height: 2; }
.pk-line button { padding: 1px 8px; }

/* v175 — téléphone : menu en bas façon application, rien ne dépasse de l'écran, fenêtres plein écran */
@media (max-width: 760px) {
  body { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
  header { position: sticky; top: 0; padding: calc(6px + env(safe-area-inset-top)) 10px 6px; gap: 6px 8px; }
  #pills { margin-left: auto; }
  nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; gap: 0; max-width: none; background: var(--panel);
    border-top: 1px solid var(--border); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
  nav a { flex: 1 0 auto; min-width: 62px; display: flex; flex-direction: column; align-items: center; gap: 1px;
    padding: 4px 6px; font-size: 11px; line-height: 1.2; border-radius: 10px; }
  nav a[hidden] { display: none; }
  nav .ni { font-size: 20px; line-height: 1.15; }
  h1 { font-size: 18px; }
  .panel { padding: 12px; overflow-x: auto; }
  /* champs à 16 px : l'iPhone ne zoome plus tout seul quand on tape dedans */
  input, select, textarea { font-size: 16px; }
  button:not(.small):not(.sq):not(.close):not(.pill):not(.sp-tile), .btn:not(.small) { min-height: 38px; }
  /* barre d'outils d'un lot : une seule rangée qui défile, « Publier » toujours au début */
  .toolbar.row { flex-wrap: nowrap; overflow-x: auto; gap: 6px; padding: 8px 20px 8px 0; scrollbar-width: none;
    -webkit-mask-image: linear-gradient(to right, #000 92%, transparent); mask-image: linear-gradient(to right, #000 92%, transparent); }
  .toolbar.row::-webkit-scrollbar { display: none; }
  .toolbar.row > * { flex: 0 0 auto; white-space: nowrap; }
  .toolbar.row > .grow, .toolbar.row > #selcount:empty { display: none; }
  .toolbar.row > #pub { order: -2; }
  .toolbar.row > #drip { order: -1; }
  /* cartes d'un lot */
  .cards { grid-template-columns: minmax(0, 1fr); }
  .scan { min-width: 0; }
  .scan .imgs img { width: 84px; min-width: 0; }
  /* liste des lots : l'essentiel seulement (nom, cartes, à vérifier, valeur) */
  .btbl th:nth-child(3), .btbl td:nth-child(3), .btbl th:nth-child(5), .btbl td:nth-child(5),
  .btbl th:nth-child(7), .btbl td:nth-child(7), .btbl th:nth-child(9), .btbl td:nth-child(9),
  .btbl th:nth-child(10), .btbl td:nth-child(10) { display: none; }
  th, td { padding: 8px 5px; }
  /* fenêtres : plein écran */
  .modal:not(.lightbox) { padding: 0; align-items: stretch; }
  .modal:not(.lightbox) .modal-box { width: 100%; min-height: 100%; border-radius: 0;
    padding: calc(14px + env(safe-area-inset-top)) 12px calc(16px + env(safe-area-inset-bottom)); }
  .modal:not(.lightbox) .close { top: calc(8px + env(safe-area-inset-top)); right: 8px; min-width: 38px; min-height: 38px; justify-content: center; z-index: 2; }
  .modal-box h2:first-child { padding-right: 44px; }
  #toast { left: 10px; right: 10px; bottom: calc(70px + env(safe-area-inset-bottom)); }
  #toast > div { max-width: none; }
}
/* installé comme application : pas de barre d'adresse, on laisse la place de l'encoche */
@media (display-mode: standalone) and (min-width: 761px) { header { padding-top: calc(10px + env(safe-area-inset-top)); } }

/* Assistant deck, vue « Colonnes » : par type de carte, lignes de texte en colonnes */
.da-cols { column-width: 250px; column-gap: 26px; margin-top: 12px; }
.da-colg { margin-bottom: 14px; }
.da-colh { font-weight: 700; padding-bottom: 3px; margin-bottom: 2px; border-bottom: 1px solid var(--border); break-after: avoid; }
.da-line { display: flex; gap: 6px; align-items: baseline; padding: 2px 0; font-size: 13.5px; cursor: zoom-in; break-inside: avoid; }
.da-line:hover { background: color-mix(in srgb, var(--border) 45%, transparent); }
.da-lq { flex: none; width: 1.4em; text-align: right; opacity: .7; }
.da-ln { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.da-lc { flex: none; font-size: 11.5px; letter-spacing: .3px; }
.da-lp { flex: none; min-width: 2.6em; text-align: right; font-size: 12px; }
#da_peek { position: fixed; right: 18px; bottom: 18px; width: 250px; border-radius: 12px; box-shadow: 0 8px 28px rgba(0,0,0,.55); z-index: 60; pointer-events: none; display: none; }
@media (max-width: 640px) { .da-cols { column-width: auto; column-count: 1; } .da-line { padding: 5px 0; font-size: 14.5px; } }
/* Nouvelles TCG (accueil) */
#hm_news { margin-top: 8px; }
.news-item { padding: 10px 0; border-top: 1px solid var(--border); }
.news-item:first-child { border-top: 0; padding-top: 0; }
.news-title { font-size: 15.5px; font-weight: 600; margin: 3px 0; }
.news-title a { color: inherit; }
.news-sum { margin: 4px 0; line-height: 1.45; }
/* cartes nommées dans la nouvelle : vignettes cliquables, une rangée qui défile sur téléphone */
.news-cards { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 6px; }
.news-card { flex: 0 0 auto; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 5px; }
.news-card img { display: block; height: 96px; width: auto; border-radius: 5px; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.news-card:hover img, .news-card:focus-visible img { outline: 2px solid var(--accent, #3b82f6); outline-offset: 1px; }
.news-week { background: var(--panel2, rgba(127,127,127,.08)); border-radius: 8px; padding: 10px 12px; margin-bottom: 4px; border-top: 0; }
.news-pts { margin: 6px 0; padding-left: 20px; line-height: 1.45; }
.news-det { margin: 6px 0 8px; padding: 8px 12px; border-left: 3px solid var(--accent, #3b82f6); background: rgba(127,127,127,.06); border-radius: 0 6px 6px 0; line-height: 1.5; }
.news-det p { margin: 0 0 8px; }
.news-det p:last-child { margin-bottom: 0; }

/* v201 — sous-onglets de l'espace (🗂️ Collection, 🏪 Vendre) sous la barre du haut */
.subnav { display: flex; gap: 2px; padding: 0 20px; background: var(--panel); border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.subnav::-webkit-scrollbar { display: none; }
.subnav[hidden] { display: none; }
.subnav a { padding: 9px 12px 8px; color: var(--muted); white-space: nowrap; border-bottom: 2px solid transparent; }
.subnav a:hover { color: var(--text); }
.subnav a.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.sn-badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 99px; background: var(--ok); color: #fff; font-size: 11px; line-height: 18px; text-align: center; font-weight: 600; }
.umenu-info { padding: 6px 12px 4px; font-size: 12px; color: var(--muted); max-width: 240px; }
/* accueil : chiffres clés, puis À faire */
.home-todo p { margin: 6px 0; }
.home-todo a { color: inherit; }
.home-todo a:hover { color: var(--accent); }
@media (max-width: 760px) {
  .subnav { padding: 0 8px; }
  .subnav a { padding: 8px 10px 7px; font-size: 13px; }
}

/* v202 — Profil et Administration en onglets */
.page-tabs { display: flex; gap: 2px; margin: 0 0 16px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.page-tabs::-webkit-scrollbar { display: none; }
.page-tabs button { all: unset; cursor: pointer; padding: 9px 12px 8px; color: var(--muted); white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.page-tabs button:hover { color: var(--text); }
.page-tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 6px 6px 0 0; }
.page-tabs button.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.tab-off { display: none !important; }

/* v203 — Ma collection allégée */
.dmenu { position: relative; display: inline-block; }
.dmenu > summary { list-style: none; cursor: pointer; }
.dmenu > summary::-webkit-details-marker { display: none; }
.dmenu-list { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; z-index: 40; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); padding: 4px; display: flex; flex-direction: column; }
.dmenu-list > button, .dmenu-list > a { all: unset; box-sizing: border-box; padding: 8px 12px; border-radius: 7px; font-size: 14px; cursor: pointer; color: var(--text); white-space: nowrap; }
.dmenu-list > button:hover, .dmenu-list > a:hover, .dmenu-list > button:focus-visible, .dmenu-list > a:focus-visible { background: var(--accent-weak); color: var(--accent); }
.co-evo { margin-top: 16px; }
.co-evo > summary { cursor: pointer; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; list-style: none; }
.co-evo > summary::-webkit-details-marker { display: none; }
.co-evo > summary h2 { margin: 0; }
.co-evo > summary::after { content: "▾"; margin-left: auto; color: var(--muted); }
.co-evo[open] > summary::after { content: "▴"; }
.co-evo .panel { border: 0; padding: 0; margin: 12px 0 0; background: none; }
.co-filters:not(.open) > .co-x:not(.on) { display: none; }
.co-fx { width: 100%; justify-content: center; }

/* v204 — en-tête de page commun : titre à gauche, actions à droite, même espace sous chaque en-tête */
.page-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 12px; min-height: 36px; margin: 0 0 16px; }
.page-head h1 { margin: 0; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.page-head + .panel, .page-head + .cat-tiles, .page-head + .page-tabs { margin-top: 0 !important; }
.page-head + p.muted { margin-top: -6px; }
@media (max-width: 760px) { .page-head { margin-bottom: 12px; } }

/* v205 — page d'un lot allégée */
.bname { font-size: 18px; font-weight: 600; min-width: 0; }
.page-head .bname { flex: 1 1 240px; }
.dmenu-list > .danger-text { color: var(--err); }
.bmeta { padding: 10px 16px; }
.bmeta > summary { cursor: pointer; list-style: none; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.bmeta > summary::-webkit-details-marker { display: none; }
.bmeta > summary::after { content: "▾"; margin-left: auto; color: var(--muted); }
.bmeta[open] > summary::after { content: "▴"; }
.toolbar > .tb-row { gap: 8px; }
.toolbar > .tb-row + .tb-row { margin-top: 8px; }
.tb-sel { padding: 6px 8px; border-radius: 10px; background: var(--accent-weak); }
.tb-sel[hidden] { display: none; }
@media (max-width: 760px) {
  .toolbar > .tb-row { flex-wrap: nowrap; overflow-x: auto; gap: 6px; scrollbar-width: none; }
  .toolbar > .tb-row::-webkit-scrollbar { display: none; }
  .toolbar > .tb-row > * { flex: 0 0 auto; white-space: nowrap; }
  .toolbar > .tb-row > .grow { display: none; }
  .toolbar > .tb-row > #pub { order: -2; }
  .toolbar > .tb-row > #drip { order: -1; }
}

/* v206 — notifications de l'app installée */
.pu-opts { display: flex; flex-direction: column; gap: 6px; }
.pu-opts label { display: flex; gap: 8px; align-items: center; }
.pu-ntfy { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 10px; }
.pu-ntfy > summary { cursor: pointer; color: var(--muted); }

/* v207 : aubaines eBay */
.deals { display: flex; flex-direction: column; gap: 8px; }
.deal { display: grid; grid-template-columns: 72px 1fr auto; gap: 12px; align-items: start; padding: 10px; border: 1px solid var(--border, #2a2f3a); border-radius: 10px; background: var(--panel, transparent); }
.deal-img img { width: 72px; height: 100px; object-fit: cover; border-radius: 6px; display: block; }
.deal-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.deal-title { font-weight: 600; overflow-wrap: anywhere; }
.deal-px { text-align: right; display: flex; flex-direction: column; gap: 2px; align-items: flex-end; }
.deal-pct { font-size: 20px; font-weight: 700; color: var(--ok, #3fb950); }
.deal-px button { margin-top: 4px; }
@media (max-width: 640px) {
  .deal { grid-template-columns: 56px 1fr; }
  .deal-img img { width: 56px; height: 78px; }
  .deal-px { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-start; text-align: left; }
}

/* v213 : recherche globale, collection ↔ vente, prix dans le temps, valeur par emplacement, nouvelles de mes cartes */
.gs-h { font-size: 14px; margin: 14px 0 4px; }
.gs-row { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; padding: 6px 4px; border: 0; border-top: 1px solid var(--border); background: none; color: inherit; font: inherit; text-decoration: none; cursor: pointer; border-radius: 0; }
div.gs-row { cursor: default; }
.gs-row:hover { background: var(--hover, rgba(127,127,127,.08)); }
.gs-row .grow { min-width: 0; }
.gs-sub { display: block; overflow: hidden; text-overflow: ellipsis; }
.gs-img { width: 36px; height: 50px; object-fit: cover; border-radius: 3px; flex: none; }
.pr-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
.pr-act { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ce-hist { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
table.locv { width: 100%; }
table.locv .locv-bar-c { width: 30%; }
.locv-bar { display: block; height: 8px; border-radius: 4px; background: var(--accent, #3b82f6); opacity: .7; }
@media (max-width: 600px) { table.locv .locv-bar-c, table.locv .locv-bar-h { display: none; } }
.news-card { position: relative; }
.news-card.own img { outline: 2px solid var(--ok, #16a34a); outline-offset: 1px; }
.news-bans { margin: 0 0 12px; padding: 8px 12px 10px; border: 1px solid var(--border); border-left: 4px solid var(--warn); border-radius: 8px; background: var(--warn-weak); }
.news-bans > summary { cursor: pointer; padding: 2px 0; }
.news-ban { padding: 8px 0; border-top: 1px solid var(--border); }
.news-bans > summary + .news-ban { border-top: 0; }
.news-card.indeck img { outline: 2px solid var(--err); outline-offset: 1px; }
.pill.err { color: var(--err); background: var(--err-weak); border-color: transparent; }
.dk-sheet { margin: 10px 0 0; padding: 8px 12px 10px; }
.dk-sheet > summary { cursor: pointer; }
.dk-pip { display: flex; align-items: center; gap: 6px; margin: 3px 0; }
.dk-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(0,0,0,.25); vertical-align: middle; margin-right: 2px; }
.dk-bar { flex: 1; min-width: 70px; height: 8px; border-radius: 4px; background: var(--border); overflow: hidden; }
.dk-bar span { display: block; height: 100%; border-radius: 4px; }
.dk-tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-top: 12px; }
.dk-tool { border-top: 1px solid var(--border); padding-top: 8px; }
.dk-br { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; font-weight: 700; color: #fff; background: var(--ok); }
.dk-br.b3 { background: var(--warn); } .dk-br.b4, .dk-br.b5 { background: var(--err); }
table.dk-mana { border-collapse: collapse; font-size: 13px; } table.dk-mana td, table.dk-mana th { padding: 2px 8px 2px 0; }
.ms-c { display: inline-flex; align-items: center; gap: 2px; cursor: pointer; }
.dk-cmd img { display: block; height: 84px; width: auto; border-radius: 5px; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.dk-cmd:hover img, .dk-cmd:focus-visible img { transform: scale(1.06); }
.news-cal { margin: 0 0 12px; padding: 8px 12px 10px; border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 8px; background: var(--accent-weak); }
.news-cal > summary { cursor: pointer; padding: 2px 0; }
table.cal { width: 100%; border-collapse: collapse; margin-top: 6px; }
table.cal td { padding: 6px 4px; border-top: 1px solid var(--border); vertical-align: top; }
table.cal tr:first-child td { border-top: 0; }
td.cal-d { width: 92px; white-space: nowrap; }
.cal-n { font-weight: 600; margin-top: 2px; }
.news-card.unban img { outline: 2px solid var(--ok); outline-offset: 1px; opacity: .85; }
.nc-unban { position: absolute; left: 2px; top: 2px; font-size: 12px; line-height: 1; }
.nc-deck { position: absolute; right: 2px; bottom: 2px; font-size: 11px; padding: 0 4px; border-radius: 6px; background: var(--err); color: #fff; }
.nc-own { position: absolute; left: 3px; bottom: 3px; font-size: 11px; line-height: 1; padding: 2px 4px; border-radius: 4px; background: rgba(0,0,0,.72); color: #fff; }
.sidesub, #sidebtn { display: none; }
/* grand écran : menu en barre latérale à gauche (allure Overseerr), barre du haut = pastilles + compte */
@media (min-width: 1024px) {
  body::before { content: ""; position: fixed; inset: 0 auto 0 0; width: 232px; background: var(--panel); border-right: 1px solid var(--border); z-index: 11; }
  header { padding-left: 252px; min-height: 56px; z-index: 12; }
  header .brand { position: fixed; top: 0; left: 0; width: 232px; padding: 18px 22px; font-size: 18px; z-index: 12; }
  header nav { position: fixed; top: 64px; left: 0; width: 232px; flex-direction: column; gap: 4px; padding: 0 12px; z-index: 12; }
  header nav a { padding: 10px 14px; font-size: 15px; border-radius: 8px; }
  header nav a:hover { background: var(--accent-weak); color: var(--text); }
  :root[data-theme="ov"] header nav a.active { background: linear-gradient(90deg, #4f46e5, #6366f1); }
  main, .envbanner { margin-left: 232px; }
  main { max-width: none; padding: 24px 32px; }
  #subnav { display: none; }
  .sidesub { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 8px 22px; padding-left: 10px; border-left: 1px solid var(--border); }
  .sidesub a { padding: 6px 10px; font-size: 13.5px; color: var(--muted); border-radius: 6px; }
  .sidesub a:hover { color: var(--text); background: var(--accent-weak); }
  .sidesub a.active { color: var(--accent); background: var(--accent-weak); font-weight: 600; }
  /* bouton « / » : la barre glisse au complet vers la gauche ; le bouton reste au bord pour la rouvrir */
  #sidebtn { display: inline-flex; position: fixed; top: 15px; left: 190px; z-index: 13; transition: left .25s ease; }
  body::before, header .brand, header nav { transition: transform .25s ease; }
  main, .envbanner, header { transition: margin-left .25s ease, padding-left .25s ease; }
  body.side-off::before, body.side-off header .brand, body.side-off header nav { transform: translateX(-100%); }
  body.side-off main, body.side-off .envbanner { margin-left: 0; }
  body.side-off header { padding-left: 56px; }
  body.side-off #sidebtn { left: 12px; }
}
