/* app.css : La Bookinerie. Thème « librairie chaleureuse » : crème papier,
   encre brune, terracotta, titres en serif. Mobile-first. */

:root {
  --bg: #faf6ee;
  --surface: #f3ecdd;
  --card: #ffffff;
  --border: #e8e0d0;
  --text: #2b2320;
  --muted: #857a6e;
  --accent: #b5522a;
  --accent-dark: #9a4423;
  --accent-soft: rgba(181, 82, 42, .10);
  --danger: #b3261e;
  --star: #d9930d;
  --radius: 14px;
  --nav-h: 62px;
  --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --shadow: 0 2px 10px rgba(43, 35, 32, .07);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

/* Fond aussi sur html : zone révélée par le dézoom/overscroll = crème, pas blanc */
html { height: 100%; -webkit-text-size-adjust: 100%; background: var(--bg); }

body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  overscroll-behavior-y: none;
}

body.no-scroll { overflow: hidden; }

h1, h2, h3 { font-family: var(--serif); font-weight: 700; }

button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
/* 16px minimum : en dessous, iOS Safari zoome sur le champ au focus */
input, select, textarea {
  font: inherit; font-size: 16px; color: var(--text);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

#view {
  max-width: 680px;
  margin: 0 auto;
  padding: 14px 16px calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 28px);
}

/* ---------- En-têtes de page ---------- */

.page-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 0 14px; }
.page-head h1 { font-size: 26px; letter-spacing: -.01em; }
.sub { color: var(--muted); font-size: 13px; }

section.rail { margin: 18px 0; }
section.rail h2, .card h2 { font-size: 17px; margin-bottom: 10px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 14px 0;
  box-shadow: var(--shadow);
}

/* ---------- Couvertures ---------- */

.cover {
  width: 92px; aspect-ratio: 2 / 3;
  border-radius: 6px;
  background: var(--surface);
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(43, 35, 32, .18);
}
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-fallback {
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 8px; font-size: 11px; font-weight: 600; color: #6b5f52;
  font-family: var(--serif);
  background: linear-gradient(160deg, #efe6d4, #e2d5bd);
}
.cover-sm { width: 52px; }
.cover-xs { width: 38px; border-radius: 4px; }
.cover-lg { width: 108px; }
.cover-shelf { width: 100%; }

/* ---------- Rails horizontaux + cartes ---------- */

.rail-scroll {
  display: flex; gap: 12px;
  overflow-x: auto;
  padding: 4px 2px 10px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.rail-scroll::-webkit-scrollbar { display: none; }

.book-card {
  width: 96px; flex-shrink: 0;
  display: flex; flex-direction: column; gap: 6px;
  text-align: left; scroll-snap-align: start;
  position: relative;
}
.book-card .cover { width: 96px; }
.book-card-txt { display: flex; flex-direction: column; }
.book-card-txt .t {
  font-size: 12px; font-weight: 600;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.book-card-txt .s { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.owned-dot {
  position: absolute; top: 6px; right: 6px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); border: 2px solid #fff;
}

/* ---------- Accueil ---------- */

.reading-list { display: flex; flex-direction: column; gap: 10px; }
.reading-card {
  display: flex; gap: 14px; align-items: center; text-align: left;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px;
  box-shadow: var(--shadow);
}
.reading-card .cover { width: 60px; }
.reading-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.reading-info .t { font-weight: 650; font-size: 14px; }
.reading-info .s, .reading-info .pct { font-size: 12px; color: var(--muted); }

.meter {
  height: 6px; border-radius: 3px;
  background: rgba(181, 82, 42, .15); /* piste : ton clair du même terracotta */
  overflow: hidden;
}
.meter-lg { height: 10px; border-radius: 5px; margin: 8px 0 6px; }
.meter-fill { height: 100%; background: var(--accent); border-radius: inherit; transition: width .3s; }

.goal-card .goal-head, .goal-head { display: flex; align-items: baseline; justify-content: space-between; }
.goal-head b { font-size: 15px; }

.act-list { display: flex; flex-direction: column; gap: 4px; }
.act-row {
  display: flex; gap: 12px; align-items: center; text-align: left;
  padding: 8px 6px; border-radius: 10px;
}
.act-row:active { background: var(--surface); }
.act-txt { min-width: 0; display: flex; flex-direction: column; }
.act-txt .t { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-txt .s { font-size: 12px; color: var(--muted); }

/* ---------- Explorer ---------- */

.search-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 4px 12px;
  position: sticky; top: 8px; z-index: 5;
  box-shadow: 0 4px 14px rgba(43, 35, 32, .10);
}
.search-bar input { flex: 1; background: none; border: none; padding: 10px 0; }
.search-bar input:focus { outline: none; }
.search-ico { opacity: .6; }
.search-clear { color: var(--muted); padding: 6px; }

.results { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.result-row {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 12px;
  box-shadow: var(--shadow);
}
.result-main { flex: 1; min-width: 0; display: flex; gap: 12px; align-items: center; text-align: left; }
.result-txt { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.result-txt .t { font-weight: 650; font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.result-txt .s { font-size: 12px; color: var(--muted); }
.result-txt .dim { opacity: .8; }

.add-btn {
  width: 38px; height: 38px; flex-shrink: 0;
  border-radius: 50%; font-size: 20px; font-weight: 600;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.add-btn.added { background: var(--accent); color: #fff; }

/* ---------- Bibliothèque ---------- */

.lib-tabs {
  display: flex; gap: 8px; overflow-x: auto;
  padding-bottom: 4px; scrollbar-width: none;
}
.lib-tabs::-webkit-scrollbar { display: none; }
.lib-tab {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap;
}
.lib-tab.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.lib-tab .count {
  background: rgba(43, 35, 32, .07); border-radius: 999px;
  font-size: 11px; padding: 1px 7px;
}
.lib-tab.active .count { background: rgba(181, 82, 42, .18); }

.sort-bar { display: flex; justify-content: flex-end; margin: 10px 0; }
.sort-bar select { font-size: 16px; padding: 7px 10px; color: var(--muted); }

.shelf-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px 12px;
}
@media (min-width: 480px) { .shelf-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 640px) { .shelf-grid { grid-template-columns: repeat(5, 1fr); } }

.shelf-cell { display: flex; flex-direction: column; gap: 5px; text-align: left; position: relative; }
.cell-title {
  font-size: 11px; font-weight: 600; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cell-rating { font-size: 11px; color: var(--star); letter-spacing: 1px; }
.cell-meter {
  display: block; height: 4px; border-radius: 2px;
  background: rgba(181, 82, 42, .15); overflow: hidden;
}
.cell-meter span { display: block; height: 100%; background: var(--accent); }

/* ---------- Profil ---------- */

.stat-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin: 4px 0 6px;
}
.stat-tile {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  display: flex; flex-direction: column; gap: 4px;
  box-shadow: var(--shadow);
}
.stat-tile .label { font-size: 12px; color: var(--muted); }
.stat-tile .value { font-size: 26px; font-weight: 700; font-family: var(--serif); letter-spacing: -.01em; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.chip {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 5px 12px; font-size: 12px; color: var(--text);
}

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }

/* ---------- Graphique du profil ---------- */

.chart-card svg { width: 100%; height: auto; display: block; margin-top: 4px; }
.chart-bar { transition: fill .15s; }
.chart-bar.hot { fill: var(--accent-dark); }
.chart-tip {
  position: fixed; z-index: 80; pointer-events: none;
  background: #2b2320; color: #faf6ee;
  border-radius: 8px;
  padding: 6px 10px; font-size: 12px; font-weight: 600;
  box-shadow: 0 6px 18px rgba(43, 35, 32, .3);
  white-space: nowrap;
}

.footer-note { text-align: center; color: var(--muted); font-size: 12px; margin-top: 24px; opacity: .8; }

/* ---------- Boutons génériques ---------- */

.primary-btn {
  background: var(--accent); color: #fff;
  border-radius: 12px; padding: 12px 18px; font-weight: 700;
}
.primary-btn:active { background: var(--accent-dark); }
.ghost-btn {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 18px; font-weight: 600;
}
.small { padding: 9px 14px; font-size: 13px; }
.link-btn { color: var(--accent); font-weight: 600; font-size: 13px; padding: 4px 0; }
.danger-btn {
  display: block; width: 100%; margin-top: 8px;
  color: var(--danger); font-weight: 600;
  padding: 12px; border-radius: 12px;
  background: rgba(179, 38, 30, .06);
}

/* ---------- Accueil statique (SEO), onboarding, installation, partage ---------- */

.hero-list { list-style: none; margin: 12px 0; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.hero-list b { font-weight: 650; }

.onboard { text-align: center; padding: 22px 16px; }
.onboard h2 { margin-bottom: 4px; }
.onboard-steps { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.onboard-step {
  display: flex; align-items: center; gap: 14px; text-align: left;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 13px 14px; font-size: 13px; color: var(--muted);
}
.onboard-step b { color: var(--text); font-size: 14px; }
.onboard-step:active { border-color: var(--accent); }
.ob-ico { font-size: 24px; }

.install-card { border-color: rgba(181, 82, 42, .35); }
.install-card .btn-row { margin-bottom: 0; }
.install-card .sub b { color: var(--text); }

.share-btn {
  margin-top: 8px; padding: 6px 12px;
  border-radius: 999px; font-size: 12.5px; font-weight: 600;
  background: var(--accent-soft); color: var(--accent);
}
.share-btn:active { background: var(--accent); color: #fff; }

/* ---------- Bandeau hors ligne ---------- */

#offline-banner {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
  background: var(--text);
  color: var(--bg);
  font-size: 13px; font-weight: 600;
}
#offline-banner button {
  padding: 3px 10px; border-radius: 8px;
  border: 1px solid rgba(250, 246, 238, .45);
  color: var(--bg); font-size: 12px; font-weight: 600;
}
#offline-banner button:active { background: rgba(250, 246, 238, .18); }

/* ---------- Écran de connexion ---------- */

.auth-screen {
  position: fixed; inset: 0; z-index: 50;
  background: var(--bg);
  overflow-y: auto;
  display: flex; flex-direction: column; align-items: center;
  padding: max(48px, 12vh) 24px 40px;
}
.auth-logo { width: 76px; height: 76px; border-radius: 20px; margin-bottom: 14px; }
.auth-screen h1 { font-size: 30px; margin-bottom: 4px; }
.auth-screen > .sub { margin-bottom: 24px; text-align: center; }
.auth-box { width: 100%; max-width: 360px; }
.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.auth-tab {
  flex: 1; padding: 10px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border);
  font-weight: 600; color: var(--muted);
}
.auth-tab.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.auth-box form { display: flex; flex-direction: column; gap: 10px; }
.auth-box .primary-btn { margin-top: 6px; }
.auth-error { color: var(--danger); font-size: 13px; min-height: 18px; }
.auth-note { color: var(--muted); font-size: 12px; text-align: center; margin-top: 18px; }

/* Vérification du pseudo en direct : ✓ vert qui pop, ✕ rouge qui secoue */
.field-check { position: relative; }
.field-check input { width: 100%; padding-right: 40px; transition: border-color .2s; }
.field-check.ok input { border-color: #3d8b40; }
.field-check.bad input { border-color: var(--danger); }
.field-status {
  position: absolute; right: 13px; top: 50%; translate: 0 -50%;
  font-size: 17px; font-weight: 800; pointer-events: none;
}
.field-check.ok .field-status { color: #3d8b40; }
.field-check.bad .field-status { color: var(--danger); }
@keyframes status-pop {
  0% { transform: scale(0); }
  60% { transform: scale(1.35); }
  100% { transform: scale(1); }
}
.field-status.pop { animation: status-pop .3s ease-out; }
@keyframes status-spin { to { transform: rotate(360deg); } }
.field-status.spin { color: var(--muted); animation: status-spin .8s linear infinite; }
@keyframes field-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
.field-check.shake, .code-input.shake { animation: field-shake .4s; }
.field-hint { color: var(--danger); font-size: 12.5px; margin-top: -4px; }

/* Étape A2F au login + configuration */
.auth-2fa { display: flex; flex-direction: column; gap: 10px; text-align: center; }
.auth-2fa-title { font-weight: 700; font-size: 16px; }
.code-input {
  text-align: center; font-size: 22px; letter-spacing: 4px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.mfa-sheet { text-align: center; }
.mfa-sheet h3 { font-size: 17px; margin-bottom: 10px; }
.mfa-steps { text-align: left; margin: 0 0 14px 20px; font-size: 13px; color: var(--muted); }
.mfa-steps li { margin: 6px 0; }
.mfa-steps b { color: var(--text); }
.mfa-qr { display: block; width: min(220px, 60vw); margin: 0 auto 10px; background: #fff;
  border: 1px solid var(--border); border-radius: 12px; padding: 10px; }
.mfa-qr svg { display: block; width: 100%; height: auto; }
.mfa-qr-link { padding: 14px; font-weight: 600; color: var(--accent); }
.mfa-secret { font-size: 12px; color: var(--muted); margin-bottom: 12px; overflow-wrap: anywhere; }
.mfa-secret code { background: var(--surface); padding: 2px 6px; border-radius: 6px; }
.mfa-sheet .code-input { width: 100%; margin-bottom: 8px; }
.mfa-sheet .primary-btn { width: 100%; }
.recovery-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0;
}
.recovery-grid code {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 6px; font-size: 13px; font-weight: 600;
}

/* ---------- États vides & squelettes ---------- */

.empty { text-align: center; padding: 48px 24px; color: var(--muted); }
.empty-emoji { font-size: 44px; margin-bottom: 12px; }
.empty h3 { color: var(--text); font-size: 17px; margin-bottom: 6px; }
.empty p { font-size: 13px; max-width: 320px; margin: 0 auto; }

@keyframes pulse { 50% { opacity: .45; } }
.skeleton {
  width: 96px; aspect-ratio: 2 / 3; flex-shrink: 0;
  border-radius: 6px; background: #efe7d6;
  animation: pulse 1.4s ease-in-out infinite;
}
.skeleton-list { display: flex; flex-direction: column; gap: 10px; }
.skeleton-row-item {
  height: 84px; border-radius: var(--radius);
  background: #efe7d6; animation: pulse 1.4s ease-in-out infinite;
}

/* ---------- Navigation basse ---------- */

.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: flex; align-items: stretch; justify-content: space-around;
  background: rgba(250, 246, 238, .92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
}
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--muted); font-size: 10.5px; font-weight: 600;
}
.nav-item svg { width: 22px; height: 22px; fill: currentColor; }
.nav-item.active { color: var(--accent); }

.nav-scan {
  width: 58px; height: 58px; flex-shrink: 0;
  margin-top: -20px; align-self: flex-start;
  border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(181, 82, 42, .38);
}
.nav-scan svg { width: 26px; height: 26px; }
.nav-scan:active { transform: scale(.94); }

/* ---------- Modales / bottom sheets ---------- */

.modal-backdrop {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(43, 35, 32, .42);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; transition: opacity .22s;
}
.modal-backdrop.open { opacity: 1; }

.sheet {
  width: 100%; max-width: 680px;
  max-height: 88vh; overflow-y: auto;
  background: #fffdf8;
  border-radius: 20px 20px 0 0;
  padding: 10px 18px calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translateY(24px); transition: transform .22s;
}
.modal-backdrop.open .sheet { transform: none; }
.sheet-grab {
  width: 42px; height: 4px; border-radius: 2px;
  background: #e0d5c0; margin: 4px auto 14px;
}

.book-head { display: flex; gap: 16px; margin-bottom: 16px; }
.book-head-info { min-width: 0; }
.book-head-info h2 { font-size: 19px; line-height: 1.25; margin-bottom: 6px; }
.book-head-info .authors { color: var(--accent); font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.book-head-info .meta { color: var(--muted); font-size: 12.5px; }

.shelf-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }
.shelf-btn {
  padding: 10px 4px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 12px; font-weight: 600; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.shelf-btn.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.progress-box, .rate-box {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; margin-bottom: 16px;
}
.progress-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 8px; }
.progress-edit { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.progress-edit input { width: 90px; padding: 8px 10px; }

.rate-label { font-size: 13px; color: var(--muted); }
.stars { font-size: 26px; letter-spacing: 6px; color: #e3d8c4; margin: 6px 0 10px; user-select: none; }
.stars .star.on { color: var(--star); }
.stars-input .star { cursor: pointer; }
.rate-box textarea { width: 100%; resize: vertical; }

.book-desc h3, .book-meta-list h3 { font-size: 15px; margin: 14px 0 8px; }
.book-desc p { color: var(--muted); font-size: 13.5px; }
.book-desc p.clamp { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.meta-row {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 8px 0; border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.meta-row span { color: var(--muted); }
.meta-row b { font-weight: 600; text-align: right; min-width: 0; overflow-wrap: anywhere; }

.picker-sheet h3 { font-size: 16px; margin-bottom: 14px; text-align: center; }
.picker-list { display: flex; flex-direction: column; gap: 8px; }
.picker-item {
  padding: 14px; border-radius: 12px; text-align: left;
  background: var(--surface); border: 1px solid var(--border);
  font-weight: 600;
}
.picker-item:active { border-color: var(--accent); }

/* ---------- Scanner (par-dessus la caméra : reste sombre) ---------- */

.scan-overlay { position: fixed; inset: 0; z-index: 60; background: #000; }
.scan-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan-mask {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 20px calc(20px + env(safe-area-inset-bottom, 0px));
  background: radial-gradient(ellipse at center 42%, transparent 30%, rgba(0, 0, 0, .55) 75%);
}
.scan-top {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  color: #fff; font-weight: 600;
}
.scan-close, .scan-torch {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(0, 0, 0, .45); color: #fff; font-size: 17px;
}
.scan-torch.active { background: var(--accent); color: #fff; }
.scan-frame {
  margin-top: 12vh;
  width: min(78vw, 340px); height: 150px;
  border-radius: 16px;
  border: 2.5px solid #f0b28a;
  box-shadow: 0 0 0 4000px rgba(0, 0, 0, .25);
  position: relative; overflow: hidden;
}
@keyframes scanline { 0% { top: 8%; } 50% { top: 88%; } 100% { top: 8%; } }
.scan-line {
  position: absolute; left: 6%; right: 6%; height: 2px;
  background: #f0b28a; border-radius: 1px;
  box-shadow: 0 0 12px #f0b28a;
  animation: scanline 2.4s ease-in-out infinite;
}
.scan-hint { color: #fff; opacity: .85; font-size: 13.5px; margin-top: 18px; }
.scan-manual {
  margin-top: auto; width: 100%; max-width: 360px;
  display: flex; gap: 8px;
}
.scan-manual input { flex: 1; background: rgba(0, 0, 0, .55); border-color: rgba(255, 255, 255, .25); color: #fff; }
.scan-manual button {
  background: var(--accent); color: #fff;
  border-radius: 10px; padding: 0 18px; font-weight: 700;
}
.scan-error { color: #ffb0be; font-size: 13px; margin-top: 12px; text-align: center; }

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

.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 22px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 12px); z-index: 70;
  background: #2b2320; color: #faf6ee;
  padding: 11px 18px; border-radius: 12px;
  font-size: 13.5px; font-weight: 600;
  box-shadow: 0 8px 24px rgba(43, 35, 32, .35);
  opacity: 0; transition: opacity .25s, transform .25s;
  max-width: 88vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Desktop : on garde la maquette mobile centrée ---------- */

@media (min-width: 720px) {
  .bottom-nav { max-width: 680px; margin: 0 auto; border-radius: 18px 18px 0 0; border: 1px solid var(--border); border-bottom: none; }
}
