/* ════════════════════════════════════════════════════════════════
   VAULT — Design system inspiré pastel + typo geometric bold
   ════════════════════════════════════════════════════════════════ */
:root {
  /* ── Palette : fond chaleureux + pastels doux ──────────────── */
  --bg:           #EFE2D2;          /* beige pêche principal */
  --bg-soft:      #F6ECDD;          /* variation plus claire */
  --surface:      #FFFFFF;          /* cards blanches */
  --surface-alt:  #FBF5EB;          /* off-white subtle */

  /* Pastels pour tuiles (background COMPLET, pas juste icône) */
  --pastel-blue:    #D4DFED;
  --pastel-yellow:  #EFD080;
  --pastel-mint:    #C6DAC1;
  --pastel-coral:   #F2C9B6;
  --pastel-lavender:#D8D2EC;
  --pastel-pink:    #F4D8D8;
  --pastel-sage:    #B7C9B2;
  --pastel-cream:   #F0E3CB;

  /* Texte */
  --text:        #1A1A1A;            /* near-black, doux */
  --muted:       #7A736C;            /* warm gray */
  --muted-soft:  #A39B92;

  /* Accents fonctionnels */
  --primary:     #1A1A1A;            /* "vault" black */
  --accent:      #C97A52;            /* terracotta brand */
  --gold:        #D4A24A;
  --red:         #C76864;
  --green:       #7FA181;
  --amazon:      #FF9900;

  /* Borders & shadows */
  --border:      #E5DAC7;
  --border-soft: #EFE6D5;
  --shadow-sm:   0 2px 10px rgba(26, 26, 26, 0.04);
  --shadow:     0 8px 24px rgba(26, 26, 26, 0.07);
  --shadow-lg:  0 18px 48px rgba(26, 26, 26, 0.14);

  /* Radius (généreux) */
  --radius-sm:   10px;
  --radius:      18px;
  --radius-lg:   26px;
  --radius-xl:   36px;
  --radius-pill: 999px;

  /* Safe areas */
  --safe-bot:    env(safe-area-inset-bottom, 0);
  --safe-top:    env(safe-area-inset-top, 0);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
.hidden { display: none !important; }

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-feature-settings: 'ss01', 'cv11';
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button { font-family: inherit; }
a { color: var(--primary); }

/* ═══ LANDING SCREEN ════════════════════════════════════════════ */
#landing {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  animation: landingIn 0.4s ease-out;
}
#landing::before, #landing::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(8px);
  opacity: 0.6;
  z-index: 0;
}
#landing::before {
  width: 240px; height: 240px;
  background: var(--pastel-coral);
  top: -50px; right: -60px;
}
#landing::after {
  width: 300px; height: 300px;
  background: var(--pastel-blue);
  bottom: -80px; left: -80px;
}
#landing.fade-out { animation: landingOut 0.5s ease-in forwards; }
@keyframes landingIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes landingOut { from { opacity: 1; } to { opacity: 0; visibility: hidden; } }

.landing-inner { text-align: center; padding: 2rem; z-index: 1; position: relative; }
.landing-logo {
  width: 96px;
  height: 96px;
  margin-bottom: 1.5rem;
  filter: drop-shadow(0 12px 30px rgba(26, 26, 26, 0.15));
  animation: logoFloat 1.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes logoFloat {
  0%   { transform: translateY(-30px) scale(0.85); opacity: 0; }
  100% { transform: translateY(0)      scale(1);    opacity: 1; }
}
.landing-title {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
  margin-bottom: 0.5rem;
  line-height: 0.95;
}
.landing-sub {
  font-size: 1rem;
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 0.01em;
}

/* ═══ HEADER ════════════════════════════════════════════════════ */
#header {
  background: var(--bg);
  color: var(--text);
  position: sticky;
  top: 0;
  z-index: 100;
  padding-top: var(--safe-top);
  border-bottom: 1px solid var(--border-soft);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.85rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.header-home {
  background: none;
  border: none;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}
.header-home:hover { background: var(--surface-alt); }
.header-logo { width: 28px; height: 28px; }
#page-title {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 500;
  text-align: center;
  color: var(--muted);
  letter-spacing: 0;
}
.btn-install {
  background: var(--primary);
  border: none;
  color: #fff;
  font-size: 1rem;
  width: 38px; height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

/* ═══ MAIN ══════════════════════════════════════════════════════ */
#app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1.1rem calc(3rem + var(--safe-bot));
}

/* ═══ DASHBOARD ═════════════════════════════════════════════════ */
.dashboard-greeting {
  margin-bottom: 1.75rem;
  padding: 0 0.2rem;
}
.dashboard-greeting h2 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 0.4rem;
}
.dashboard-greeting h2 strong,
.dashboard-greeting h2 em { font-style: normal; font-weight: 800; color: var(--accent); }
.dashboard-greeting p {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 400;
}

/* ═══ DASHBOARD SEARCH BAR ══════════════════════════════════════ */
.dashboard-search {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
  padding: 0.3rem 0.3rem 0.3rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
  transition: box-shadow 0.2s;
}
.dashboard-search:focus-within { box-shadow: var(--shadow); }
.ds-icon { font-size: 1.05rem; opacity: 0.6; }
.dashboard-search input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.75rem 0;
  font-size: 1rem;
  color: var(--text);
  outline: none;
  font-family: inherit;
}
.dashboard-search input::placeholder { color: var(--muted-soft); }

.search-count {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.8rem;
  font-weight: 500;
}
.search-empty {
  text-align: center;
  padding: 1.5rem;
  color: var(--muted);
  background: var(--surface);
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

/* ═══ TILES (style bento, pastel) ══════════════════════════════ */
.tiles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
  margin-bottom: 2.5rem;
}
/* Variant strict 2-cols pour le dashboard, même en grand écran */
.tiles-grid.tiles-2col {
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
@media (min-width: 640px) { .tiles-grid:not(.tiles-2col) { grid-template-columns: repeat(3, 1fr); gap: 1rem; } }
@media (min-width: 960px) { .tiles-grid:not(.tiles-2col) { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 720px) { .tiles-grid.tiles-2col { max-width: 720px; margin-left: auto; margin-right: auto; gap: 1.25rem; } }

.tile {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1rem;
  cursor: pointer;
  text-align: left;
  border: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-height: 150px;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.15s;
  position: relative;
  overflow: hidden;
  color: var(--text);
}
.tile:hover  { transform: translateY(-3px); box-shadow: var(--shadow); }
.tile:active { transform: scale(0.98); }
.tile.disabled { opacity: 0.55; cursor: not-allowed; }
.tile.disabled:hover { transform: none; box-shadow: none; }

/* Variantes de couleur pastel par classe */
.tile-blue     { background: var(--pastel-blue); }
.tile-yellow,
.tile-gold     { background: var(--pastel-yellow); }
.tile-green    { background: var(--pastel-mint); }
.tile-coral,
.tile-red      { background: var(--pastel-coral); }
.tile-purple,
.tile-lavender { background: var(--pastel-lavender); }
.tile-pink     { background: var(--pastel-pink); }
.tile-cream    { background: var(--pastel-cream); }
.tile-gray     { background: var(--surface-alt); }

.tile-icon {
  font-size: 1.85rem;
  line-height: 1;
  margin-bottom: 0.3rem;
}
.tile-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.tile-sub {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 500;
  margin-top: auto;
  padding-top: 0.3rem;
}

.tile-badge {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  background: var(--primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  min-width: 1.5rem;
  text-align: center;
}
.tile-badge.coming { background: var(--muted); opacity: 0.7; }

/* Sections sous tuiles */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding: 0 0.2rem;
}
.section-header h3 {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.section-header a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}
.section-header a:hover { text-decoration: underline; }

/* ═══ TOOLBAR ═══════════════════════════════════════════════════ */
.toolbar {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  align-items: center;
}
.toolbar input[type="search"],
.toolbar input[type="text"],
.toolbar select {
  flex: 1;
  min-width: 180px;
  padding: 0.7rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 0.95rem;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
}
.toolbar input:focus { outline: none; border-color: var(--primary); }

/* ═══ BUTTONS ═══════════════════════════════════════════════════ */
.btn {
  padding: 0.7rem 1.3rem;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  transition: filter 0.15s, transform 0.1s, box-shadow 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  letter-spacing: -0.005em;
}
.btn:hover  { filter: brightness(1.08); transform: translateY(-1px); }
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-gold    { background: var(--accent);  color: #fff; }
.btn-danger  { background: var(--red);     color: #fff; }
.btn-success { background: var(--green);   color: #fff; }
.btn-ghost   { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--surface-alt); border-color: var(--text); }
.btn-amazon  { background: var(--amazon); color: #131921; }
.btn-sm      { padding: 0.4rem 0.85rem; font-size: 0.82rem; }
.btn-lg      { padding: 0.85rem 1.6rem; font-size: 1rem; }
.btn-block   { width: 100%; justify-content: center; }

/* ═══ BOOKS GRID ════════════════════════════════════════════════ */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1.1rem;
}
@media (min-width: 640px) { .books-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1.25rem; } }

.book-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.15s;
  display: flex;
  flex-direction: column;
  position: relative;
}
.book-card:hover  { transform: translateY(-4px); box-shadow: var(--shadow); }
.book-card:active { transform: scale(0.98); }
.book-cover {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  background: linear-gradient(135deg, var(--pastel-cream), var(--bg-soft));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 2.5rem;
  position: relative;
}
.book-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

.book-fav-marker {
  position: absolute;
  top: 0.5rem; right: 0.5rem;
  font-size: 1.2rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}
.book-status-badge {
  position: absolute;
  top: 0.5rem; left: 0.5rem;
  background: rgba(26, 26, 26, 0.78);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  backdrop-filter: blur(4px);
}

.book-info {
  padding: 0.65rem 0.75rem 0.8rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}
.book-series {
  font-size: 0.68rem;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.book-title  { font-size: 0.9rem;  font-weight: 600; line-height: 1.3; }
.book-tome   { font-size: 0.75rem; color: var(--muted); font-weight: 600; margin-top: 0.15rem; }

/* ═══ BD DETAIL PAGE ════════════════════════════════════════════ */
.bd-detail {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.bd-detail-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  padding: 1.5rem;
}
@media (min-width: 640px) {
  .bd-detail-hero { grid-template-columns: 220px 1fr; padding: 2rem; gap: 2rem; }
}
.bd-detail-cover {
  width: 100%;
  max-width: 260px;
  margin: 0 auto;
  aspect-ratio: 2/3;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: linear-gradient(135deg, var(--pastel-cream), var(--bg-soft));
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 4rem;
}
.bd-detail-cover img { width: 100%; height: 100%; object-fit: cover; }

.bd-detail-info { display: flex; flex-direction: column; gap: 0.5rem; }
.bd-detail-series {
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-bottom: 0.1rem;
}
.bd-detail-title {
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--muted);
}
.bd-detail-volume {
  display: inline-block;
  background: var(--pastel-yellow);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-pill);
  width: fit-content;
  margin-top: 0.4rem;
}

.bd-meta-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.5rem;
}
.bd-meta-list li {
  display: flex;
  gap: 0.75rem;
  font-size: 0.92rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-soft);
}
.bd-meta-list li:last-child { border-bottom: none; }
.bd-meta-label { color: var(--muted); font-weight: 500; min-width: 105px; }
.bd-meta-value { color: var(--text); font-weight: 500; }

.bd-notes {
  padding: 0 1.5rem 1.5rem;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.55;
  white-space: pre-wrap;
}
@media (min-width: 640px) { .bd-notes { padding: 0 2rem 2rem; } }

.bd-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border-soft);
  background: var(--surface-alt);
}
@media (min-width: 640px) { .bd-actions { padding: 1.5rem 2rem; } }

/* ═══ SERIES LIST ═══════════════════════════════════════════════ */
.series-list { display: flex; flex-direction: column; gap: 0.7rem; }
.series-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  transition: transform 0.15s, box-shadow 0.15s;
}
.series-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.series-name { font-weight: 700; font-size: 1.02rem; flex: 1; min-width: 150px; letter-spacing: -0.01em; }
.series-stats { font-size: 0.85rem; color: var(--muted); white-space: nowrap; font-weight: 500; }
.progress-wrap { flex: 2; min-width: 140px; }
.progress-bar  { height: 8px; border-radius: var(--radius-pill); background: var(--bg-soft); overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); border-radius: var(--radius-pill); transition: width 0.4s; }
.series-actions { display: flex; gap: 0.4rem; }

/* ═══ MISSING LIST ══════════════════════════════════════════════ */
.missing-section {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.1rem 1.25rem;
  margin-bottom: 0.85rem;
}
.missing-header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.missing-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.badge {
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-pill);
}
.missing-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.chip {
  background: var(--pastel-yellow);
  border: 1px solid transparent;
  color: var(--text);
  font-size: 0.85rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
}
.chip-link {
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.chip-link:hover { background: var(--accent); color: #fff; }
.chip-link:active { transform: scale(0.95); }

/* Buy overlay sur cartes */
.card-buy-overlay {
  position: absolute;
  bottom: 0.5rem; right: 0.5rem;
  background: var(--amazon);
  color: #131921;
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  text-decoration: none;
  box-shadow: 0 4px 10px rgba(0,0,0,0.18);
  transition: transform 0.15s;
  z-index: 2;
}
.card-buy-overlay:hover { transform: scale(1.12); }

/* ═══ EMPTY STATES ══════════════════════════════════════════════ */
.empty {
  text-align: center;
  padding: 3.5rem 1rem;
  color: var(--muted);
}
.empty .empty-icon { font-size: 4rem; margin-bottom: 0.75rem; opacity: 0.6; }
.empty p {
  font-size: 1rem;
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.loading {
  text-align: center;
  padding: 2.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ═══ MODAL ═════════════════════════════════════════════════════ */
#modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 26, 0.4);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.18s ease-out;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
#modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 540px;
  max-height: 92vh;
  overflow-y: auto;
  animation: slideUp 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

#modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--border-soft);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}
#modal-title { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.015em; }
#modal-close {
  background: var(--surface-alt);
  border: none;
  font-size: 1rem;
  cursor: pointer;
  color: var(--muted);
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
#modal-close:hover { background: var(--bg); color: var(--text); }
#modal-body { padding: 1.4rem; }

/* ═══ FORMS ═════════════════════════════════════════════════════ */
.form-grid { display: flex; flex-direction: column; gap: 1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem; }
@media (max-width: 480px) { .form-row { grid-template-columns: 1fr; } }

label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text);
  letter-spacing: 0;
}
input, select, textarea {
  width: 100%;
  padding: 0.75rem 0.95rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--surface-alt);
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
}
textarea { resize: vertical; min-height: 90px; }

.form-radio-group {
  display: flex;
  gap: 0.4rem;
  background: var(--surface-alt);
  padding: 0.35rem;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border);
}
.form-radio-group label {
  flex: 1;
  margin: 0;
  padding: 0.55rem 0.9rem;
  text-align: center;
  cursor: pointer;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--muted);
  transition: all 0.15s;
}
.form-radio-group input[type="radio"] { display: none; }
.form-radio-group label.checked {
  background: var(--primary);
  color: #fff;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}
.error-msg { color: var(--red); font-size: 0.88rem; margin-top: 0.25rem; min-height: 1.2em; }

/* ═══ COVER UPLOAD ══════════════════════════════════════════════ */
.cover-upload {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.cover-preview {
  flex-shrink: 0;
  width: 110px;
  height: 156px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--pastel-cream), var(--bg-soft));
  border: 1px solid var(--border-soft);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: var(--muted);
}
.cover-preview img { width: 100%; height: 100%; object-fit: cover; }
.cover-upload-actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
  padding-top: 0.3rem;
}
.cover-upload-actions .btn { justify-content: center; text-align: center; }

/* ═══ TITLE SEARCH RESULTS ══════════════════════════════════════ */
.title-search-result {
  display: flex;
  gap: 0.85rem;
  padding: 0.7rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.55rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.title-search-result:hover  { background: var(--surface-alt); border-color: var(--primary); }
.title-search-result:active { transform: scale(0.99); }
.tsr-cover {
  flex-shrink: 0;
  width: 56px; height: 80px;
  background: linear-gradient(135deg, var(--pastel-cream), var(--bg-soft));
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}
.tsr-cover img { width: 100%; height: 100%; object-fit: cover; }
.tsr-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.2rem; }
.tsr-title { font-weight: 700; font-size: 0.95rem; line-height: 1.25; letter-spacing: -0.01em; }
.tsr-meta { font-size: 0.8rem; color: var(--muted); }
.tsr-source { font-size: 0.7rem; color: var(--accent); font-weight: 700; margin-top: auto; }

/* ═══ HORIZONTAL SCROLL (collections sur dashboard) ══════════════ */
.horizontal-scroll {
  display: flex;
  gap: 0.9rem;
  overflow-x: auto;
  padding-bottom: 0.6rem;
  margin: 0 -1.1rem;
  padding-left: 1.1rem;
  padding-right: 1.1rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.horizontal-scroll .book-card {
  flex: 0 0 145px;
  scroll-snap-align: start;
}
.horizontal-scroll::-webkit-scrollbar { height: 4px; }
.horizontal-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* Liste verticale de collections sur dashboard (style bannière paysage) */
.collections-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}


.collection-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 5 / 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.15s;
  border: 1px solid var(--border-soft);
  padding: 0.7rem 1.1rem;
  text-align: center;
  background: var(--surface-alt);  /* blanc cassé / crème */
  font-family: inherit;
  color: var(--text);
}
.collection-tile:hover  { transform: translateY(-2px); box-shadow: var(--shadow); }
.collection-tile:active { transform: scale(0.99); }

/* Plus d'image affichée — vignette pure typo */
.ct-cover { display: none; }

/* Nom de la collection en Carter One, toujours visible et centré */
.ct-placeholder-name {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Electrolize', sans-serif;
  font-size: 26px;
  font-weight: 400;
  color: var(--text);
  text-align: center;
  line-height: 1.1;
  letter-spacing: 0.04em;
  max-width: 100%;
  word-break: break-word;
  text-transform: uppercase;
  white-space: pre-line;  /* préserve les sauts de ligne entrés par l'utilisateur */
  margin-bottom: 1.5rem;  /* espace entre le titre et la ligne des badges */
}

/* Stats à gauche, badge "séries" à droite, calés sur les bords */
.ct-overlay {
  position: absolute;
  bottom: 0.6rem;
  left: 0.9rem;
  right: 0.9rem;
  background: none;
  padding: 0;
  margin: 0;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  pointer-events: none;
}
.ct-stats {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0;
}
.ct-missing  { color: var(--accent); font-weight: 700; }
.ct-complete { color: var(--green);  font-weight: 700; }

/* Badge "groupe" pour les collections parentes — sur la même ligne que les stats */
.ct-group-badge {
  background: var(--text);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  letter-spacing: 0.01em;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

/* Ajustements responsives */
@media (max-width: 480px) {
  .collection-tile { aspect-ratio: 4 / 1; }
  .ct-placeholder-name { font-size: 20px; }
}

/* En-tête de la page d'une collection (titre + boutons empilés) */
.collection-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.collection-page-header h2 {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
  flex: 1;
  min-width: 0;
}
.collection-page-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: stretch;
  flex-shrink: 0;
}
.collection-page-actions .btn { justify-content: center; }

/* ═══ SUGGESTIONS IA / NOUVEAUTES sections ═════════════════════ */
.suggestion-card, .news-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 0.75rem;
}

/* ═══ RESPONSIVE FINE-TUNING ═════════════════════════════════════ */
@media (max-width: 380px) {
  .tile { min-height: 130px; padding: 0.95rem 0.8rem; }
  .tile-icon { font-size: 1.55rem; }
  .tile-title { font-size: 0.92rem; }
  .dashboard-greeting h2 { font-size: 1.6rem; }
  .landing-title { font-size: 2.8rem; }
}
