/* Carrousels horizontaux */
.carousel { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; margin: 0 -18px; padding-left: 18px; padding-right: 18px; scrollbar-width: none; }
.carousel::-webkit-scrollbar { display: none; }
@media (max-width: 520px) { .carousel { margin: 0 -14px; padding-left: 14px; padding-right: 14px; scroll-padding-left: 14px; } }
.carousel { scroll-padding-left: 18px; }
.carousel > * { scroll-snap-align: start; flex-shrink: 0; }

/* Séries */
.serie-card { width: 320px; max-width: 82vw; display: flex; flex-direction: column; gap: 16px; padding: 22px; border-radius: var(--radius); background: linear-gradient(160deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .03)); border: 1px solid var(--line-2); color: var(--text); }
.serie-card:hover { border-color: var(--accent); }
.serie-logo { height: 90px; display: grid; place-items: center; }
.serie-logo img { max-height: 90px; max-width: 220px; object-fit: contain; }
.serie-logo span { font-weight: 700; font-size: 1.2rem; text-align: center; }
.serie-progress { display: flex; align-items: center; gap: 12px; }
.serie-progress .progress { flex: 1; }
.serie-progress b { font-size: 1.1rem; }
.serie-figures { display: flex; justify-content: space-between; gap: 10px; }
.serie-figures b { display: block; font-size: 1.35rem; }
.serie-figures span { color: var(--muted); font-size: .9rem; }
.set-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.set-tile { display: flex; gap: 14px; align-items: center; background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; color: var(--text); }
.set-tile:hover { border-color: var(--accent); }
.set-logo { width: 86px; height: 48px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: .75rem; color: var(--muted); text-align: center; }
.set-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.set-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.set-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bloc { display: flex; flex-direction: column; gap: 12px; }
.set-head { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.set-head-logo { max-width: 200px; max-height: 90px; object-fit: contain; }

/* Cartes */
.card-grid { display: grid; gap: 14px; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); }
.card-grid.cols-2 { --cols: 2; } .card-grid.cols-3 { --cols: 3; } .card-grid.cols-4 { --cols: 4; } .card-grid.cols-6 { --cols: 3; }
@media (min-width: 900px) {
  .card-grid.cols-2 { --cols: 4; } .card-grid.cols-3 { --cols: 5; } .card-grid.cols-4 { --cols: 7; } .card-grid.cols-6 { --cols: 6; }
}
.card-tile { display: flex; flex-direction: column; gap: 6px; background: none; border: 0; padding: 0; color: var(--text); font: inherit; text-align: left; cursor: pointer; min-width: 0; }
.card-tile:hover .card-img { transform: translateY(-3px); box-shadow: var(--shadow); }
.card-frame { position: relative; }
.card-img { width: 100%; aspect-ratio: 63 / 88; object-fit: cover; border-radius: 5% / 3.6%; display: block; background: var(--glass); transition: transform .15s, box-shadow .15s; }
.card-img.placeholder { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: .8rem; padding: 8px; text-align: center; }
.card-tile.missing .card-img { filter: grayscale(.8) brightness(.7); opacity: .75; }
.card-tile.missing:hover .card-img { filter: grayscale(.3) brightness(.85); }
.card-tile.selected .card-img { outline: 3px solid var(--accent); outline-offset: 2px; filter: none; opacity: 1; }
.card-caption { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.card-name { font-weight: 700; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-price { position: absolute; right: 6px; bottom: 6px; }
.chip { position: absolute; top: 6px; font-size: .72rem; font-weight: 800; border-radius: 99px; padding: 2px 8px; }
.chip.inline { position: static; margin-left: 6px; }
.owned-chip { right: 6px; background: var(--accent); color: var(--accent-ink); }
.wish-chip { left: 6px; background: var(--danger); color: #fff; }
.select-chip { left: 50%; top: 40%; transform: translateX(-50%); background: var(--accent); color: var(--accent-ink); font-size: 1.1rem; padding: 4px 11px; }
.variant-dots { display: flex; gap: 4px; flex-wrap: wrap; }
.vdot { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line-2); font-size: .68rem; font-weight: 800; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.vdot.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.vdot.picked { outline: 2px solid var(--amber); }
.qty-row { display: flex; justify-content: space-between; align-items: center; }
.bulk-bar { position: fixed; bottom: 110px; left: 50%; transform: translateX(-50%); z-index: 45; display: flex; gap: 10px; align-items: center; background: #0c1d18; border: 1px solid var(--accent); border-radius: 20px; padding: 12px 16px; box-shadow: var(--shadow); flex-wrap: wrap; max-width: calc(100% - 24px); }

/* Fiche carte */
.card-nav { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.card-detail { display: grid; grid-template-columns: minmax(220px, 360px) 1fr; gap: 30px; }
.card-img.big { box-shadow: var(--shadow); }
.card-info { display: flex; flex-direction: column; gap: 14px; }
.variant-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
@media (max-width: 700px) { .card-detail { grid-template-columns: 1fr; } .card-visual { max-width: 300px; margin: 0 auto; width: 100%; } }

/* Produits scellés */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
@media (max-width: 680px) { .cat-grid { grid-template-columns: 1fr 1fr; } }
.cat-tile { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--radius); background: var(--glass); border: 1px solid var(--line-2); color: var(--text); min-width: 0; }
.cat-tile:hover { border-color: var(--accent); }
.cat-visual { width: 74px; height: 92px; flex-shrink: 0; display: grid; place-items: center; border-radius: 14px; background: radial-gradient(circle at 30% 20%, rgba(61, 214, 140, .25), rgba(255, 255, 255, .03)); color: var(--accent); }
.cat-text { min-width: 0; display: flex; flex-direction: column; }
.cat-text strong { text-transform: uppercase; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-text b { font-size: 1.55rem; line-height: 1.25; }
.cat-text span { color: var(--faint); font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 520px) { .cat-tile { padding: 12px; gap: 10px; } .cat-visual { width: 54px; height: 72px; } .cat-text strong { font-size: .9rem; } .cat-text b { font-size: 1.3rem; } .cat-text span { font-size: .78rem; } }
.product-grid { display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 900px) { .product-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.product-tile { position: relative; min-height: 220px; border-radius: var(--radius); border: 1px solid var(--line-2); background: var(--glass); color: var(--text); display: flex; flex-direction: column; overflow: hidden; }
.product-tile:hover { border-color: var(--accent); }
.product-visual { flex: 1; display: grid; place-items: center; padding: 14px; position: relative; }
.product-visual img { max-width: 100%; max-height: 70px; object-fit: contain; }
.product-visual .ph { color: var(--accent); }
.product-visual .badge-dark { position: absolute; top: 10px; left: 10px; font-size: .72rem; padding: 3px 9px; }
.product-visual { padding-top: 34px; }
.product-name { padding: 0 12px; font-size: .8rem; font-weight: 600; line-height: 1.3; min-height: 2.6em; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.product-tile .price-pill { align-self: flex-end; margin: 8px 10px 10px; }
.product-hero { display: grid; place-items: center; gap: 14px; padding: 20px 0 10px; text-align: center; }
.product-hero .visual { width: 220px; height: 150px; display: grid; place-items: center; border-radius: var(--radius); background: radial-gradient(circle at 50% 30%, rgba(61, 214, 140, .2), rgba(255, 255, 255, .03)); color: var(--accent); }
.product-hero .visual img { max-width: 190px; max-height: 110px; object-fit: contain; }
.price-line { display: flex; justify-content: space-between; align-items: center; padding: 0 12px; font-size: 1.25rem; font-weight: 700; }
.sheet-panel { background: rgba(40, 44, 50, .55); border: 1px solid var(--line-2); border-radius: 30px; padding: 16px; display: flex; flex-direction: column; gap: 14px; backdrop-filter: blur(18px); }
.info-block { background: rgba(255, 255, 255, .06); border-radius: 18px; padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; }
.info-block .row strong { font-size: 1.15rem; }
.kv { display: flex; justify-content: space-between; color: var(--muted); }
.kv b { color: var(--text); }

/* Tableaux et listes */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 11px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.table thead th { color: var(--muted); font-size: .8rem; font-weight: 600; }
.table td.actions { text-align: right; }
.plain-list { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 8px; }
.alert-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.notif-list { list-style: none; padding: 0; margin: 0; }
.notif-list li { display: flex; flex-direction: column; padding: 12px 0; border-bottom: 1px solid var(--line); }
.notif-list li.unread a { font-weight: 700; }
.list-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.list-tile { background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 6px; color: var(--text); }
.list-tile:hover { border-color: var(--accent); }
.listing { font-family: ui-monospace, monospace; font-size: .9rem; }
.profile-head { display: flex; align-items: center; gap: 16px; }
.avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--grad); color: var(--accent-ink); display: grid; place-items: center; font-weight: 800; font-size: 1.6rem; }

/* Graphique */
.chart { display: flex; flex-direction: column; gap: 14px; }
.legend { display: flex; gap: 14px; font-size: .82rem; color: var(--muted); align-items: center; flex-wrap: wrap; }
.legend i, .chart-tip i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; }
.chart-area { background: rgba(255, 255, 255, .04); border-radius: var(--radius-sm); padding: 10px 6px 4px; min-height: 230px; display: flex; flex-direction: column; justify-content: center; border-bottom: 1px dashed var(--line-2); }
.chart-inner { position: relative; }
.chart-svg { width: 100%; display: block; }
.chart-svg .grid { stroke: var(--line); stroke-width: 1; }
.chart-svg .axis { fill: var(--faint); font-size: 11px; }
.chart-svg .line { fill: none; stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.chart-svg .cursor { stroke: var(--muted); stroke-dasharray: 3 3; opacity: 0; }
.chart-tip { position: absolute; top: 0; transform: translateX(-50%); background: #0c1d18; border: 1px solid var(--line-2); border-radius: 10px; padding: 6px 10px; font-size: .8rem; pointer-events: none; opacity: 0; white-space: nowrap; }
.chart-tip.show { opacity: 1; }
.chart-empty { text-align: center; color: var(--faint); padding: 30px 40px; font-size: 1.05rem; }

/* Fenêtres */
.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .62); display: flex; align-items: center; justify-content: center; z-index: 60; padding: 16px; }
.modal { background: #0c1a16; border: 1px solid var(--line-2); border-radius: 28px; width: 100%; max-width: 520px; max-height: 88vh; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.modal.wide { max-width: 900px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 20px 22px 0; gap: 10px; }
.modal-head h2 { margin: 0; }
.modal-body { padding: 18px 22px 22px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
@media (max-width: 640px) {
  .overlay { align-items: flex-end; padding: 0; }
  .modal, .modal.wide { max-width: none; border-radius: 30px 30px 0 0; max-height: 90vh; }
  .modal::before { content: ""; width: 44px; height: 5px; border-radius: 99px; background: var(--line-2); margin: 10px auto 0; }
}
.choice { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: 18px; background: var(--glass); border: 1px solid var(--line-2); color: var(--text); font: inherit; cursor: pointer; width: 100%; text-align: left; }
.choice.disabled { opacity: .45; cursor: default; }
.choice .flag { font-size: 1.6rem; }
.choice .radio { margin-left: auto; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--muted); }
.choice.selected .radio { border-color: var(--accent); box-shadow: inset 0 0 0 4px #0c1a16, inset 0 0 0 12px var(--accent); }
#toast { position: fixed; bottom: 120px; left: 50%; transform: translate(-50%, 10px); z-index: 70; opacity: 0; transition: .2s; pointer-events: none; width: max-content; max-width: calc(100% - 24px); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast { background: #12261f; border: 1px solid var(--line-2); border-left: 4px solid var(--blue); padding: 12px 18px; border-radius: 14px; box-shadow: var(--shadow); }
.toast.success { border-left-color: var(--accent); }
.toast.error { border-left-color: var(--danger); }

/* En-têtes des pages secondaires */
.page-head { display: flex; flex-direction: column; gap: 6px; }
.page-head.row { flex-direction: row; align-items: center; flex-wrap: wrap; }
.page-head a { color: var(--accent); }

/* Photos de produits et cartes sans image */
.product-visual img.photo { max-height: 120px; width: 100%; object-fit: contain; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .45)); }
.cat-visual { background: none; overflow: hidden; }
.cat-visual img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .5)); }
.product-hero .visual.has-photo { width: min(420px, 100%); height: 300px; background: none; }
.product-hero .visual img.photo { max-width: 100%; max-height: 300px; object-fit: contain; filter: drop-shadow(0 14px 24px rgba(0, 0, 0, .5)); }
.card-img.placeholder { flex-direction: column; gap: 6px; background: linear-gradient(160deg, #1b3a2f, #0e1f19); border: 1px solid var(--line-2); color: var(--text); }
.card-img.placeholder .ph-logo { width: 28px; height: 28px; border-radius: 4px 70% 4px 70%; background: var(--grad); opacity: .8; }
.card-img.placeholder small { color: var(--muted); }

/* Bouton d'actualisation manuelle (home) */
.refresh-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0 16px; }
.refresh-row .small.faint { flex: 1; min-width: 0; }
.refresh-spinner { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-size: .85rem; animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
