:root {
  --bg: #12141a;
  --surface: #1a1d25;
  --surface-2: #232733;
  --line: #2e3342;
  --text: #eceef4;
  --muted: #9aa1b2;
  --accent: #7c5cff;
  --accent-2: #9b82ff;
  --accent-text: #fff;
  --ok: #22c55e;
  --ok-bg: rgba(34, 197, 94, .14);
  --warn: #f59e0b;
  --warn-bg: rgba(245, 158, 11, .14);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, .12);
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --nav-h: 64px;
  --sony: #3d6df2; --nintendo: #e4202e; --microsoft: #1f9d3a; --sega: #1694d6; --other: #7b8296;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f6fa; --surface: #ffffff; --surface-2: #eef0f6; --line: #dfe2ec; --text: #161924; --muted: #626a7d;
    --accent: #6a46f5; --accent-2: #5a38e6; --shadow: 0 10px 30px rgba(20, 24, 40, .12);
    --ok-bg: rgba(34, 197, 94, .12); --warn-bg: rgba(245, 158, 11, .14); --danger-bg: rgba(239, 68, 68, .1);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
body.no-scroll { overflow: hidden; }
a { color: inherit; text-decoration: none; }
h1 { font-size: 1.4rem; margin: 0 0 .6rem; }
h2 { font-size: 1.05rem; margin: 0 0 .7rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
h3 { font-size: .95rem; margin: 1rem 0 .5rem; }
p { margin: .4rem 0; }
img { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
.icon { flex: none; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.tiny { font-size: .78rem; }
.center { text-align: center; justify-content: center; }
.error { color: var(--danger); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-top: .8rem; }
.loading { padding: 3rem 1rem; text-align: center; color: var(--muted); }

/* ---------- boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 42px; padding: .5rem 1rem; border-radius: 11px; border: 1px solid var(--line);
  background: var(--surface-2); cursor: pointer; font-weight: 600; white-space: nowrap; transition: filter .15s, transform .05s;
}
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); }
.btn.small { min-height: 34px; padding: .3rem .7rem; font-size: .88rem; }
.btn.block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 0;
  background: transparent; cursor: pointer; flex: none;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn.on { color: var(--warn); }
.icon-btn.danger:hover { color: var(--danger); }
.icon-btn.round { border-radius: 50%; background: rgba(0, 0, 0, .45); color: #fff; width: 46px; height: 46px; }
.icon-btn.round.on { background: var(--warn); color: #111; }
.link { background: none; border: 0; color: var(--accent-2); cursor: pointer; padding: .2rem 0; display: inline-flex; align-items: center; gap: .3rem; font-weight: 600; }

/* ---------- cartes, pastilles ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }
.pills { display: flex; gap: .3rem; flex-wrap: wrap; }
.pill {
  display: inline-flex; align-items: center; gap: .25rem; padding: .1rem .5rem; border-radius: 99px;
  font-size: .74rem; font-weight: 700; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap;
}
.pills.big .pill { font-size: .85rem; padding: .2rem .7rem; }
.pf-sony { --pf: var(--sony); } .pf-nintendo { --pf: var(--nintendo); } .pf-microsoft { --pf: var(--microsoft); }
.pf-sega { --pf: var(--sega); } .pf-other { --pf: var(--other); }
.pill[class*="pf-"] { background: color-mix(in srgb, var(--pf) 18%, transparent); color: color-mix(in srgb, var(--pf) 75%, var(--text)); border-color: color-mix(in srgb, var(--pf) 40%, transparent); }
.state-neuf { background: rgba(124, 92, 255, .16); color: var(--accent-2); border-color: rgba(124, 92, 255, .35); }
.state-complet { background: var(--ok-bg); color: var(--ok); border-color: rgba(34, 197, 94, .35); }
.state-sans_notice, .state-partiel { background: var(--warn-bg); color: var(--warn); border-color: rgba(245, 158, 11, .35); }
.state-loose, .state-sans_jeu { background: var(--danger-bg); color: #f87171; border-color: rgba(239, 68, 68, .3); }
.state-inconnu { color: var(--muted); }

/* ---------- navigation ---------- */
.nav {
  position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); display: flex; justify-content: space-around; align-items: center;
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--line);
}
.nav .brand { display: none; }
.nav-link { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .7rem; color: var(--muted); padding: .3rem .6rem; min-width: 64px; }
.nav-link.active { color: var(--accent-2); }
.nav-scan { background: var(--accent); color: #fff !important; border-radius: 18px; padding: .45rem 1rem; transform: translateY(-10px); box-shadow: 0 8px 20px rgba(124, 92, 255, .45); }
.main { padding: 1rem 1rem calc(var(--nav-h) + 1.5rem + env(safe-area-inset-bottom)); max-width: 1280px; margin: 0 auto; padding-top: max(1rem, env(safe-area-inset-top)); }
.offline-bar { background: var(--warn-bg); color: var(--warn); text-align: center; font-size: .85rem; padding: .4rem 1rem; }

@media (min-width: 900px) {
  .nav { top: 0; bottom: auto; height: 60px; padding: 0 1.5rem; justify-content: flex-start; gap: .3rem; border-top: 0; border-bottom: 1px solid var(--line); }
  .nav .brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.05rem; margin-right: auto; }
  .nav-link { flex-direction: row; font-size: .92rem; gap: .45rem; padding: .5rem .9rem; border-radius: 10px; }
  .nav-link:hover { background: var(--surface-2); color: var(--text); }
  .nav-scan { transform: none; box-shadow: none; border-radius: 10px; }
  .main { padding: 80px 1.5rem 2rem; }
}

/* ---------- connexion ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.login-card { width: min(380px, 100%); display: flex; flex-direction: column; gap: .8rem; text-align: center; padding: 2rem 1.5rem; }
.login-card img { margin: 0 auto; border-radius: 18px; }
.login-card h1 { margin: 0; }

/* ---------- champs ---------- */
.field { display: flex; flex-direction: column; gap: .3rem; text-align: left; }
.field > span { font-size: .82rem; font-weight: 600; color: var(--muted); }
input:not([type=checkbox]):not([type=file]), select, textarea {
  width: 100%; min-height: 42px; padding: .5rem .7rem; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface-2); outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
textarea { resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr; gap: .8rem; }
@media (min-width: 640px) { .grid2 { grid-template-columns: 1fr 1fr; } }

/* ---------- collection ---------- */
.toolbar { position: sticky; top: 0; z-index: 10; background: var(--bg); padding: .2rem 0 .6rem; display: flex; flex-direction: column; gap: .5rem; }
@media (min-width: 900px) { .toolbar { top: 60px; } }
.search { display: flex; align-items: center; gap: .5rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0 .4rem 0 .8rem; }
.search input { border: 0 !important; background: transparent !important; box-shadow: none !important; padding-left: 0; min-height: 46px; }
.search .icon { color: var(--muted); }
.filters { display: flex; gap: .4rem; overflow-x: auto; scrollbar-width: none; }
.filters select { width: auto; min-height: 36px; font-size: .88rem; padding: .3rem .5rem; flex: none; max-width: 60vw; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; flex: none; margin-left: auto; }
.seg button { background: var(--surface-2); border: 0; padding: 0 .6rem; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--accent); color: #fff; }
.count { margin: .2rem 0 .7rem; font-size: .85rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .8rem; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 1rem; } }
.game-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; transition: transform .12s, border-color .12s; }
.game-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.game-card-body { padding: .55rem .6rem .7rem; display: flex; flex-direction: column; gap: .35rem; }
.game-card-body strong { font-size: .9rem; line-height: 1.25; }
.list { display: flex; flex-direction: column; gap: 1px; background: var(--line); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.list-row { display: flex; align-items: center; gap: .7rem; padding: .45rem .7rem; background: var(--surface); }
.list-row:hover { background: var(--surface-2); }
.list-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.list-meta { display: flex; gap: .3rem; flex: none; }
@media (max-width: 600px) { .list-row { flex-wrap: wrap; } .list-meta { width: 100%; padding-left: calc(36px + .7rem); } .list-title { white-space: normal; } }
.sentinel { text-align: center; color: var(--muted); padding: 1rem; }
.no-result { text-align: center; padding: 2rem 1rem; display: flex; flex-direction: column; align-items: center; gap: .8rem; }
.empty { text-align: center; max-width: 460px; margin: 3rem auto; }
.empty-art { width: 92px; height: 92px; border-radius: 26px; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; margin: 0 auto 1rem; color: var(--accent-2); }

/* ---------- jaquettes ---------- */
.cover { aspect-ratio: 3 / 4; background: var(--surface-2); overflow: hidden; position: relative; flex: none; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover-sm { width: 54px; border-radius: 8px; }
.cover-xs { width: 36px; border-radius: 6px; }
.cover-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem;
  background: linear-gradient(150deg, color-mix(in srgb, var(--pf) 35%, var(--surface-2)), var(--surface-2)); }
.cover-empty span { font-size: 1.8rem; font-weight: 800; letter-spacing: .02em; color: color-mix(in srgb, var(--pf) 60%, #fff); }
.cover-empty small { font-size: .7rem; color: var(--muted); text-align: center; padding: 0 .3rem; }
.cover-sm.cover-empty span { font-size: 1rem; } .cover-sm.cover-empty small, .cover-xs.cover-empty small { display: none; }
.cover-xs.cover-empty span { font-size: .75rem; }

/* ---------- ligne de jeu (scan, autres versions) ---------- */
.item-row { display: flex; gap: .8rem; align-items: center; width: 100%; padding: .6rem; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); text-align: left; cursor: pointer; margin-top: .5rem; }
.item-row:hover { border-color: var(--accent); }
.item-row-body { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.item-row-body strong { overflow: hidden; text-overflow: ellipsis; }

/* ---------- scanner ---------- */
.view-scan { padding-left: 0; padding-right: 0; padding-top: 0; }
@media (min-width: 900px) { .view-scan { padding-top: 76px; max-width: 760px; } }
.scan { display: flex; flex-direction: column; gap: .8rem; }
.camera { position: relative; background: #000; aspect-ratio: 3 / 4; max-height: calc(100vh - var(--nav-h) - 90px); width: 100%; overflow: hidden; }
@media (min-width: 900px) { .camera { aspect-ratio: 16 / 10; border-radius: var(--radius); } }
.scan.has-result .camera { aspect-ratio: 16 / 7; }
.camera video { width: 100%; height: 100%; object-fit: cover; display: block; }
.camera-msg { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .8rem; color: #fff; padding: 1.5rem; text-align: center; }
.camera-msg .muted { color: #b9bfcc; }
.aim { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.aim span { width: 82%; height: 34%; max-height: 220px; border-radius: 14px; box-shadow: 0 0 0 2000px rgba(0, 0, 0, .35); border: 3px solid rgba(255, 255, 255, .9); position: relative; }
.aim span::after { content: ''; position: absolute; left: 6%; right: 6%; top: 50%; height: 2px; background: #ff4d5a; box-shadow: 0 0 10px #ff4d5a; animation: laser 1.6s ease-in-out infinite; }
@keyframes laser { 0%, 100% { transform: translateY(-34px); opacity: .6; } 50% { transform: translateY(34px); opacity: 1; } }
.camera-tools { position: absolute; top: .7rem; right: .7rem; left: .7rem; display: flex; gap: .5rem; justify-content: flex-end; align-items: center; }
.camera-tools select { width: auto; max-width: 60%; background: rgba(0, 0, 0, .55); color: #fff; border-color: rgba(255, 255, 255, .25); min-height: 40px; }
.manual { display: flex; align-items: center; gap: .5rem; margin: 0 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: .4rem .4rem .4rem .8rem; }
.manual input { border: 0 !important; background: transparent !important; box-shadow: none !important; padding-left: 0; }
.manual .icon { color: var(--muted); }
.scan-result { padding: 0 1rem; }
@media (min-width: 900px) { .manual, .scan-result { margin-left: 0; margin-right: 0; padding: 0; } }
.result-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; animation: pop .18s ease-out; }
@keyframes pop { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.verdict { display: flex; align-items: center; gap: .8rem; padding: .8rem; border-radius: 12px; margin-bottom: .4rem; }
.verdict > div { display: flex; flex-direction: column; }
.verdict strong { font-size: 1.25rem; }
.verdict.ok { background: var(--ok-bg); color: var(--ok); }
.verdict.no { background: var(--warn-bg); color: var(--warn); }
.verdict span { color: var(--text); opacity: .8; font-size: .9rem; }
.code-line { font-family: ui-monospace, Consolas, monospace; color: var(--muted); font-size: .8rem; text-align: center; margin-top: .8rem; letter-spacing: .08em; }
.suggestion { display: flex; gap: .9rem; margin: .8rem 0; align-items: flex-start; }
.suggestion-cover { width: 96px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 10px; background: var(--surface-2); flex: none; }
.suggestion-cover.empty { display: grid; place-items: center; color: var(--muted); }
.suggestion-title { font-size: 1.1rem; display: block; margin: .1rem 0 .4rem; }
.picks { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .4rem; }
.pick { flex: none; width: 92px; background: var(--surface-2); border: 2px solid transparent; border-radius: 10px; padding: .3rem; cursor: pointer; display: flex; flex-direction: column; gap: .2rem; }
.pick.on { border-color: var(--accent); }
.pick img, .pick-empty { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 6px; display: grid; place-items: center; background: var(--bg); }
.pick small { font-size: .7rem; line-height: 1.2; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.similar { margin-top: .8rem; padding: .8rem; border-radius: 12px; background: var(--warn-bg); }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; margin: 1rem auto .5rem; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- en-tête de page ---------- */
.page-head { display: flex; align-items: center; gap: .6rem; margin-bottom: 1rem; }
.page-head h1 { flex: 1; margin: 0; font-size: 1.25rem; min-width: 0; }

/* ---------- formulaire ---------- */
.edit { display: flex; flex-direction: column; gap: 1rem; max-width: 860px; margin: 0 auto; }
.form-section { display: flex; flex-direction: column; gap: .8rem; }
.form-section h2 { margin: 0; }
.identity { display: flex; gap: 1rem; align-items: flex-start; }
.identity-fields { flex: 1; display: flex; flex-direction: column; gap: .5rem; min-width: 0; }
.cover-pick { width: 92px; aspect-ratio: 3 / 4; border-radius: 10px; border: 2px dashed var(--line); background: var(--surface-2); cursor: pointer; overflow: hidden; padding: 0; flex: none; }
.cover-pick img { width: 100%; height: 100%; object-fit: cover; }
.cover-pick span { display: flex; flex-direction: column; align-items: center; gap: .3rem; color: var(--muted); }
.choice { display: flex; flex-wrap: wrap; gap: .4rem; }
.choice button { padding: .45rem .8rem; border-radius: 99px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; font-size: .88rem; font-weight: 600; min-height: 38px; }
.choice button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.choice.disabled { opacity: .4; }
.state-block { display: flex; flex-direction: column; gap: .9rem; }
.state-block.disabled { opacity: .45; pointer-events: none; }
.state-row { display: flex; flex-direction: column; gap: .4rem; }
.state-label { font-weight: 700; font-size: .9rem; }
.switch { display: flex; align-items: center; gap: .7rem; cursor: pointer; font-weight: 600; }
.switch input { position: absolute; opacity: 0; }
.switch-ui { width: 46px; height: 28px; border-radius: 99px; background: var(--line); position: relative; flex: none; transition: background .15s; }
.switch-ui::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + .switch-ui { background: var(--accent); }
.switch input:checked + .switch-ui::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-ui { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { display: inline-flex; align-items: center; gap: .3rem; padding: .4rem .75rem; border-radius: 99px; border: 1px dashed var(--line); background: transparent; cursor: pointer; font-size: .86rem; }
.chip.on { border-style: solid; border-color: var(--ok); background: var(--ok-bg); color: var(--ok); font-weight: 600; }
.chip.static { cursor: default; }
.inline-add { display: flex; gap: .5rem; }
.inline-add input { flex: 1; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .7rem; }
.photo-tile { background: var(--surface-2); border-radius: 12px; overflow: hidden; border: 1px solid var(--line); display: flex; flex-direction: column; }
.photo-tile img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.photo-tile select { border-radius: 0; border: 0; border-top: 1px solid var(--line); min-height: 36px; font-size: .85rem; }
.photo-actions { display: flex; justify-content: space-between; }
.photo-add { display: flex; flex-direction: column; gap: .5rem; }
.photo-add button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem; border: 2px dashed var(--line); border-radius: 12px; background: transparent; cursor: pointer; padding: .7rem .4rem; color: var(--muted); font-size: .8rem; font-weight: 600; min-height: 80px; }
.photo-add button:hover { border-color: var(--accent); color: var(--accent-2); }
.form-foot { display: flex; justify-content: space-between; gap: .6rem; flex-wrap: wrap; }
.form-foot .primary { margin-left: auto; }

/* ---------- recherche de jaquettes ---------- */
.meta-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .7rem; margin: .8rem 0; }
.meta-result { display: flex; gap: .7rem; background: var(--surface-2); border-radius: 12px; padding: .6rem; }
.meta-result img, .meta-empty { width: 78px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 8px; flex: none; background: var(--bg); display: grid; place-items: center; color: var(--muted); }
.meta-body { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.meta-body .row { margin-top: auto; padding-top: .4rem; }

/* ---------- fiche ---------- */
.item { max-width: 1100px; margin: 0 auto; }
.item-layout { display: grid; gap: 1.2rem; }
@media (min-width: 860px) { .item-layout { grid-template-columns: minmax(300px, 420px) 1fr; align-items: start; } .gallery { position: sticky; top: 76px; } }
.item-info { display: flex; flex-direction: column; gap: .9rem; }
.gallery { display: flex; flex-direction: column; gap: .6rem; }
.gallery-main { position: relative; border: 0; padding: 0; background: var(--surface); border-radius: var(--radius); overflow: hidden; cursor: zoom-in; }
.gallery-main img { width: 100%; max-height: 70vh; object-fit: contain; background: #000; }
.gallery-kind { position: absolute; left: .6rem; bottom: .6rem; background: rgba(0, 0, 0, .6); color: #fff; font-size: .75rem; padding: .15rem .55rem; border-radius: 99px; }
.gallery-kind:empty { display: none; }
.gallery-strip { display: flex; gap: .4rem; overflow-x: auto; }
.gallery-strip button { flex: none; width: 64px; height: 64px; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; cursor: pointer; background: var(--surface-2); }
.gallery-strip button.on { border-color: var(--accent); }
.gallery-strip img { width: 100%; height: 100%; object-fit: cover; }
.gallery-empty { aspect-ratio: 4 / 3; border: 2px dashed var(--line); border-radius: var(--radius); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; color: var(--muted); font-weight: 600; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1rem; margin: 0; }
.kv dt { color: var(--muted); font-size: .88rem; }
.kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.notes { white-space: pre-wrap; }
.zoom img { width: 100%; max-height: 75vh; object-fit: contain; border-radius: 10px; background: #000; }
.zoom { display: flex; flex-direction: column; gap: .6rem; }

/* ---------- réglages ---------- */
.settings { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: 1rem; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; margin-bottom: 1rem; }
@media (min-width: 640px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stats div { background: var(--surface-2); border-radius: 12px; padding: .7rem; display: flex; flex-direction: column; }
.stats strong { font-size: 1.35rem; }
.stats span { color: var(--muted); font-size: .8rem; }
.bars { display: flex; flex-direction: column; gap: .35rem; }
.bar { display: grid; grid-template-columns: 130px 1fr 44px; gap: .6rem; align-items: center; font-size: .86rem; padding: .15rem 0; }
.bar-track { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.bar-n { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.bar:hover .bar-label { color: var(--accent-2); }
.sessions { list-style: none; padding: 0; margin: 0 0 .4rem; display: flex; flex-direction: column; gap: .4rem; }
.sessions li { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; padding: .5rem .7rem; background: var(--surface-2); border-radius: 10px; }
.import-preview { margin-top: .8rem; padding: .8rem; background: var(--surface-2); border-radius: 12px; }

/* ---------- fenêtres ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .55); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.sheet { background: var(--surface); width: 100%; max-height: 92vh; overflow: auto; border-radius: 18px 18px 0 0; padding-bottom: env(safe-area-inset-bottom); box-shadow: var(--shadow); animation: up .2s ease-out; }
@keyframes up { from { transform: translateY(40px); } }
@media (min-width: 700px) { .sheet-backdrop { align-items: center; } .sheet { width: min(560px, 94vw); border-radius: 18px; } .sheet.wide { width: min(900px, 94vw); } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: .8rem .8rem 0 1.1rem; }
.sheet-head h2 { margin: 0; }
.sheet-body { padding: 1rem 1.1rem 1.2rem; }

/* ---------- notifications ---------- */
.toasts { position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: .4rem; align-items: center; pointer-events: none; width: min(92vw, 440px); }
@media (min-width: 900px) { .toasts { bottom: 24px; } }
.toast { background: #1f2330; color: #fff; padding: .65rem 1rem; border-radius: 12px; box-shadow: var(--shadow); font-weight: 600; font-size: .9rem; animation: pop .2s; text-align: center; }
.toast-ok { background: #15803d; } .toast-error { background: #b91c1c; }
