/* ==========================================================================
   NSOROMMA — Pages intérieures (fiche livre, panier, paiement, compte, bibliothèque)
   Même langage que l'accueil : fond crème, panneaux clairs, serif fin, angles droits.
   ========================================================================== */

.pg {
    --ink: var(--shell-ink, #1E2230);
    --ink-soft: var(--shell-ink-soft, #5F5E5A);
    --muted: var(--shell-muted, #9A978F);
    --line: var(--shell-line, rgba(30, 34, 48, .1));
    --panel: var(--shell-panel, #FAF9F5);
    --serif: var(--shell-serif, 'Cormorant Garamond', Georgia, serif);
    --page-x: clamp(1.5rem, 4vw, 4rem);
    --danger: #B42318;
    --success: #067647;
    max-width: 1180px;
    margin: 0 auto;
    padding: .5rem var(--page-x) 5rem;
    color: var(--ink);
}

.pg-honeypot { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ---------- En-tête de page ---------- */
.pg-head { padding: 1.5rem 0 2.5rem; margin-bottom: 2.5rem; border-bottom: 1px solid var(--line); animation: pg-fade .7s cubic-bezier(.2, .8, .2, 1) both; }
.pg-crumbs { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1rem; padding: 0; list-style: none; font-size: .8rem; color: var(--muted); }
.pg-crumbs a { color: inherit; text-decoration: none; }
.pg-crumbs a:hover { color: var(--ink); }
.pg-crumbs li + li::before { content: '/'; margin-right: .5rem; opacity: .6; }
.pg-eyebrow { margin: 0; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.pg-title { margin: .5rem 0 0; font-family: var(--serif); font-weight: 500; font-size: clamp(2.4rem, 4.6vw, 4rem); line-height: 1.05; color: var(--ink); }
.pg-subtitle { margin: .9rem 0 0; font-size: .92rem; line-height: 1.6; color: var(--ink-soft); max-width: 62ch; }

/* ---------- Mises en page ---------- */
.pg-split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
.pg-aside { position: sticky; top: 1.5rem; }
.pg-panel { background: var(--panel); padding: clamp(1.5rem, 3vw, 2.25rem); }
.pg-section + .pg-section { margin-top: 2.75rem; }
.pg-section-title { margin: 0 0 1.25rem; display: flex; align-items: baseline; gap: .75rem; font-size: 1rem; font-weight: 600; color: var(--ink); }
.pg-step { font-family: var(--serif); font-size: 1.4rem; font-weight: 500; color: var(--muted); }

/* ---------- Boutons & liens ---------- */
.pg-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
    padding: .85rem 1.4rem; border: 1px solid var(--ink); border-radius: 999px;
    background: var(--ink); color: #fff; text-decoration: none; cursor: pointer;
    font: inherit; font-size: .9rem; font-weight: 500; line-height: 1.2;
    transition: background .2s, border-color .2s, color .2s, gap .2s, transform .2s;
}
.pg-btn:hover { background: #33384A; border-color: #33384A; gap: .8rem; }
.pg-btn:active { transform: scale(.98); }
.pg-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.pg-btn:disabled { opacity: .4; cursor: not-allowed; }
.pg-btn-block { width: 100%; }
.pg-btn-ghost { background: transparent; color: var(--ink); border-color: rgba(30, 34, 48, .25); }
.pg-btn-ghost:hover { background: rgba(30, 34, 48, .05); border-color: var(--ink); color: var(--ink); }
.pg-link { border: 0; padding: 0; background: none; cursor: pointer; font: inherit; font-size: .85rem; color: var(--ink-soft); text-decoration: underline; text-underline-offset: 3px; }
.pg-link:hover { color: var(--ink); }
.pg-link-danger { color: var(--danger); }
.pg-link-danger:hover { color: #8E1B12; }

/* ---------- Formulaires ---------- */
.pg-form { display: flex; flex-direction: column; gap: 1.4rem; }
.pg-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4rem 1.75rem; }
.pg-full { grid-column: 1 / -1; }
.pg-field { display: flex; flex-direction: column; gap: .45rem; }
.pg-label { font-size: .78rem; font-weight: 500; color: var(--ink-soft); }
.pg-input, .pg-select, .pg-textarea {
    width: 100%; padding: .65rem 0;
    border: 0; border-bottom: 1px solid rgba(30, 34, 48, .2); border-radius: 0;
    background: transparent; font: inherit; font-size: .95rem; color: var(--ink);
    outline: none; transition: border-color .2s;
}
.pg-textarea { min-height: 110px; resize: vertical; line-height: 1.6; }
.pg-input::placeholder, .pg-textarea::placeholder { color: var(--muted); }
.pg-input:focus, .pg-select:focus, .pg-textarea:focus { border-bottom-color: var(--ink); }
.pg-input.is-invalid, .pg-select.is-invalid, .pg-textarea.is-invalid { border-bottom-color: var(--danger); }
.pg-error { font-size: .76rem; color: var(--danger); }
.pg-hint { font-size: .76rem; color: var(--muted); }
.pg-password { position: relative; }
.pg-password .pg-input { padding-right: 2.5rem; }
.pg-password button { position: absolute; right: 0; top: 50%; transform: translateY(-50%); border: 0; background: none; cursor: pointer; color: var(--muted); padding: .35rem; }
.pg-password button:hover { color: var(--ink); }
.pg-checkbox { display: inline-flex; align-items: center; gap: .55rem; font-size: .85rem; color: var(--ink-soft); cursor: pointer; }
.pg-checkbox input { width: 16px; height: 16px; accent-color: var(--ink); }

/* Cartes de choix (format, zone, paiement) */
.pg-choices { display: grid; gap: .75rem; }
.pg-choice { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.15rem; border: 1px solid var(--line); background: transparent; cursor: pointer; transition: border-color .2s, background .2s; }
.pg-choice:hover { border-color: rgba(30, 34, 48, .3); }
.pg-choice input { position: absolute; opacity: 0; pointer-events: none; }
.pg-choice:has(input:checked) { border-color: var(--ink); background: var(--panel); }
.pg-choice:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.pg-choice:has(input:disabled) { opacity: .45; cursor: not-allowed; }
.pg-choice-main { display: flex; align-items: center; gap: .9rem; min-width: 0; }
.pg-choice-dot { width: 18px; height: 18px; flex-shrink: 0; border-radius: 50%; border: 1px solid rgba(30, 34, 48, .35); display: grid; place-items: center; transition: border-color .2s; }
.pg-choice-dot::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); transform: scale(0); transition: transform .2s cubic-bezier(.2, 1.4, .4, 1); }
.pg-choice:has(input:checked) .pg-choice-dot { border-color: var(--ink); }
.pg-choice:has(input:checked) .pg-choice-dot::after { transform: scale(1); }
.pg-choice-title { display: block; font-size: .92rem; font-weight: 500; color: var(--ink); }
.pg-choice-sub { display: block; margin-top: .15rem; font-size: .76rem; color: var(--muted); }
.pg-choice-price { flex-shrink: 0; font-size: .9rem; font-weight: 600; color: var(--ink); }

/* ---------- Alertes ---------- */
.pg-alert { padding: .9rem 1.1rem; margin-bottom: 1.5rem; border-left: 2px solid var(--danger); background: rgba(180, 35, 24, .05); font-size: .85rem; color: var(--danger); }
.pg-alert ul { margin: .35rem 0 0; padding-left: 1.1rem; }

/* ---------- Récapitulatif ---------- */
.pg-summary-title { margin: 0 0 1.25rem; font-family: var(--serif); font-weight: 500; font-size: 1.7rem; color: var(--ink); }
.pg-row { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; font-size: .88rem; color: var(--ink-soft); }
.pg-row strong { font-weight: 500; color: var(--ink); }
.pg-row-total { margin-top: .75rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: 1rem; color: var(--ink); }
.pg-row-total strong { font-family: var(--serif); font-size: 1.6rem; font-weight: 600; }
.pg-summary-actions { display: flex; flex-direction: column; gap: .85rem; margin-top: 1.75rem; }
.pg-note { margin: 1rem 0 0; font-size: .74rem; line-height: 1.55; color: var(--muted); text-align: center; }

/* ---------- Ligne de livre (panier, paiement, commandes) ---------- */
.pg-line { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 1.25rem; align-items: center; padding: 1.5rem 0; border-bottom: 1px solid var(--line); }
.pg-line:first-child { padding-top: 0; }
.pg-line-cover img { display: block; width: 72px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 0; box-shadow: -8px 12px 18px -12px rgba(30, 34, 48, .5); }
.pg-line-format { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.pg-line-title { display: block; margin-top: .25rem; font-family: var(--serif); font-weight: 500; font-size: 1.3rem; line-height: 1.2; color: var(--ink); text-decoration: none; }
a.pg-line-title:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.pg-line-author { margin-top: .2rem; font-size: .84rem; color: var(--ink-soft); }
.pg-line-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem; margin-top: .85rem; }
.pg-line-tools form { margin: 0; }
.pg-line-price { text-align: right; font-size: .95rem; font-weight: 600; color: var(--ink); white-space: nowrap; }
.pg-line-price small { display: block; font-size: .74rem; font-weight: 400; color: var(--muted); }
.pg-qty { display: inline-flex; align-items: center; gap: .5rem; font-size: .8rem; color: var(--ink-soft); }
.pg-qty select { border: 0; border-bottom: 1px solid var(--line); background: transparent; font: inherit; font-size: .88rem; color: var(--ink); padding: .2rem 1rem .2rem 0; cursor: pointer; outline: none; }
.pg-mini { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: .9rem; align-items: center; padding: .7rem 0; }
.pg-mini img { width: 44px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 0; }
.pg-mini-title { font-size: .86rem; font-weight: 500; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg-mini-sub { font-size: .74rem; color: var(--muted); }
.pg-mini-price { font-size: .84rem; font-weight: 500; white-space: nowrap; }

/* ---------- États vides ---------- */
.pg-empty { padding: 4.5rem 1rem; text-align: center; color: var(--ink-soft); }
.pg-empty-title { margin: 0 0 .6rem; font-family: var(--serif); font-weight: 500; font-size: 2.2rem; color: var(--ink); }
.pg-empty .pg-btn { margin-top: 1.75rem; }

/* ---------- Onglets ---------- */
.pg-tabs { display: flex; gap: 2rem; margin-bottom: 2.25rem; border-bottom: 1px solid var(--line); }
.pg-tab { position: relative; padding: 0 0 .9rem; border: 0; background: none; cursor: pointer; font: inherit; font-size: .92rem; color: var(--muted); transition: color .2s; }
.pg-tab::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--ink); transform: scaleX(0); transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
.pg-tab:hover { color: var(--ink); }
.pg-tab.is-active { color: var(--ink); }
.pg-tab.is-active::after { transform: scaleX(1); }
.pg-tab-count { margin-left: .35rem; font-size: .75rem; color: var(--muted); }

/* ---------- Bibliothèque ---------- */
.pg-shelf { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3rem clamp(1.25rem, 2.5vw, 2.5rem); }
.pg-owned { display: flex; flex-direction: column; animation: pg-rise .7s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(80ms + var(--i, 0) * 50ms); }
.pg-owned-cover { display: block; margin-bottom: 1rem; }
.pg-owned-cover img { display: block; width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 0; box-shadow: 0 1px 2px rgba(30, 34, 48, .14), -14px 24px 36px -22px rgba(30, 34, 48, .5); transition: transform .5s cubic-bezier(.2, .8, .2, 1); }
.pg-owned-cover:hover img { transform: translateY(-6px); }
.pg-owned-meta { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.pg-owned-title { margin: .35rem 0 0; font-family: var(--serif); font-weight: 500; font-size: 1.25rem; line-height: 1.2; }
.pg-owned-title a { color: var(--ink); text-decoration: none; }
.pg-owned-author { margin-top: .25rem; font-size: .84rem; color: var(--ink-soft); }
.pg-owned .pg-btn { margin-top: 1rem; padding: .65rem 1rem; font-size: .82rem; }
.pg-owned-quota { margin-top: .5rem; font-size: .74rem; color: var(--muted); }

.pg-orders { display: flex; flex-direction: column; gap: 1.25rem; }
.pg-order { background: var(--panel); padding: 1.5rem clamp(1.25rem, 3vw, 2rem); }
.pg-order-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem 1.5rem; padding-bottom: 1rem; margin-bottom: .5rem; border-bottom: 1px solid var(--line); }
.pg-order-number { font-weight: 600; font-variant-numeric: tabular-nums; }
.pg-order-date { font-size: .8rem; color: var(--muted); }
.pg-badge { display: inline-flex; align-items: center; gap: .35rem; font-size: .76rem; color: var(--ink-soft); }
.pg-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.pg-badge.is-success::before { background: var(--success); }
.pg-badge.is-warning::before { background: #B54708; }

/* ---------- Authentification ---------- */
.pg-auth { min-height: calc(100vh - 220px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 6vw, 6rem); align-items: center; padding-top: 1rem; }
.pg-auth-brand { position: relative; padding: clamp(2rem, 4vw, 3.5rem); background: var(--panel); min-height: 520px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; animation: pg-fade .8s cubic-bezier(.2, .8, .2, 1) both; }
.pg-auth-mark { width: clamp(120px, 14vw, 180px); opacity: .9; animation: pg-spin-in 1.4s cubic-bezier(.2, .8, .2, 1) both; }
.pg-auth-quote { margin: 0; font-family: var(--serif); font-weight: 500; font-size: clamp(1.8rem, 2.8vw, 2.5rem); line-height: 1.2; color: var(--ink); }
.pg-auth-quote small { display: block; margin-top: .75rem; font-family: 'Plus Jakarta Sans', system-ui, sans-serif; font-size: .82rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.pg-auth-perks { list-style: none; margin: 2rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .75rem; font-size: .86rem; color: var(--ink-soft); }
.pg-auth-perks li { display: flex; gap: .65rem; }
.pg-auth-perks li::before { content: '—'; color: var(--muted); }
.pg-auth-form { max-width: 420px; width: 100%; animation: pg-fade .8s .1s cubic-bezier(.2, .8, .2, 1) both; }
.pg-auth-form .pg-title { font-size: clamp(2.4rem, 4vw, 3.4rem); }
.pg-auth-switch { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--line); font-size: .86rem; color: var(--ink-soft); }
.pg-auth-switch a { color: var(--ink); font-weight: 500; }

/* ---------- Sécurité du compte ---------- */
.pg-google { gap: .75rem; background: var(--panel); }
.pg-google:hover { background: #fff; }
.pg-divider { display: flex; align-items: center; gap: 1rem; margin: 1.5rem 0 0; font-size: .76rem; color: var(--muted); }
.pg-divider::before, .pg-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.pg-strength { height: 3px; margin-top: .35rem; background: rgba(30, 34, 48, .1); overflow: hidden; }
.pg-strength span { display: block; height: 100%; background: #B54708; transition: width .3s ease, background .3s; }
.pg-strength span.is-strong { background: var(--success); }
.pg-rules { list-style: none; margin: .35rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem 1rem; font-size: .74rem; color: var(--muted); }
.pg-rules li::before { content: '○ '; }
.pg-rules li.is-ok { color: var(--success); }
.pg-rules li.is-ok::before { content: '✓ '; }
.pg-notice { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.5rem; padding: 1rem 1.25rem; margin-bottom: 2rem; background: var(--panel); border-left: 2px solid var(--ink); font-size: .88rem; color: var(--ink-soft); }
.pg-notice form { margin: 0; }
.pg-auth-simple { max-width: 460px; margin: 2rem auto 0; }

/* ---------- Fiche livre ---------- */
.pg-detail .spotlight { padding-left: 0; margin-bottom: 4rem; }
.pg-detail .spotlight-slide { animation: none; }
.pg-detail-formats { margin-top: 2rem; max-width: 560px; }
.pg-detail-buy { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-top: 1.25rem; }
.pg-stock { font-size: .76rem; color: var(--muted); }
.pg-stock.is-low { color: #B54708; }
.pg-player { display: flex; align-items: center; gap: .9rem; margin-top: 1.5rem; max-width: 560px; }
.pg-player-btn { width: 42px; height: 42px; flex-shrink: 0; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--ink); color: #fff; cursor: pointer; }
.pg-player-track { flex: 1; height: 3px; background: rgba(30, 34, 48, .12); cursor: pointer; position: relative; }
.pg-player-fill { position: absolute; inset: 0 auto 0 0; background: var(--ink); }
.pg-player-label { font-size: .76rem; color: var(--muted); white-space: nowrap; }
.pg-excerpt { margin: 1.5rem 0 0; padding-left: 1.25rem; border-left: 1px solid var(--line); font-family: var(--serif); font-style: italic; font-size: 1.15rem; line-height: 1.6; color: var(--ink-soft); }

.pg-reviews { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
.pg-review { display: flex; gap: 1.1rem; padding: 1.5rem 0; border-bottom: 1px solid var(--line); }
.pg-review:first-child { padding-top: 0; }
.pg-review-avatar { width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; background: #E4E1D6; font-weight: 600; color: var(--ink); }
.pg-review-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem 1rem; }
.pg-review-name { font-weight: 600; font-size: .92rem; }
.pg-review-date { font-size: .76rem; color: var(--muted); }
.pg-stars { color: var(--ink); letter-spacing: 2px; font-size: .85rem; }
.pg-stars .is-off { color: rgba(30, 34, 48, .2); }
.pg-review-text { margin: .5rem 0 0; font-style: italic; font-size: .9rem; line-height: 1.65; color: var(--ink-soft); }
.pg-rating-input { display: inline-flex; flex-direction: row-reverse; gap: .25rem; }
.pg-rating-input input { position: absolute; opacity: 0; pointer-events: none; }
.pg-rating-input label { font-size: 1.6rem; line-height: 1; color: rgba(30, 34, 48, .2); cursor: pointer; transition: color .15s, transform .15s; }
.pg-rating-input label:hover, .pg-rating-input label:hover ~ label, .pg-rating-input input:checked ~ label { color: var(--ink); }
.pg-rating-input label:active { transform: scale(.9); }
.pg-rating-input input:focus-visible + label { outline: 2px solid var(--ink); outline-offset: 2px; }

.pg-related-title { margin: 0 0 2rem; font-family: var(--serif); font-weight: 500; font-size: clamp(2rem, 3vw, 2.6rem); }

/* ---------- Confirmation & suivi de commande ---------- */
.pg-success-mark { width: 64px; height: 64px; margin-bottom: 1.5rem; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: #fff; animation: pg-pop .6s cubic-bezier(.2, 1.4, .4, 1) both; }
.pg-success-mark.is-pending { background: transparent; color: var(--ink); border: 1px solid rgba(30, 34, 48, .3); }
.pg-success-mark path, .pg-success-mark polyline { stroke-dasharray: 40; stroke-dashoffset: 40; animation: pg-draw .6s .35s ease forwards; }
.pg-order-ref { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: .5rem 1.5rem; margin-top: 1.25rem; font-size: .88rem; color: var(--ink-soft); }
.pg-order-ref strong { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.pg-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }

.pg-order-facts { margin: 0; display: flex; flex-direction: column; gap: 1.5rem; }
.pg-order-facts dt { margin-bottom: .5rem; font-size: .92rem; font-weight: 600; color: var(--ink); }
.pg-order-facts dd { margin: 0; font-size: .86rem; line-height: 1.7; color: var(--ink-soft); }

.pg-timeline { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pg-timeline-step { position: relative; display: flex; flex-direction: column; gap: .35rem; padding-top: 1.6rem; animation: pg-fade .6s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i) * 90ms); }
.pg-timeline-step::before { content: ''; position: absolute; top: 6px; left: 0; right: 0; height: 1px; background: rgba(30, 34, 48, .15); }
.pg-timeline-step.is-done::before { background: var(--ink); }
.pg-timeline-step:first-child::before { left: 6px; }
.pg-timeline-step:last-child::before { right: auto; width: 6px; }
.pg-timeline-dot { position: absolute; top: 0; left: 0; width: 13px; height: 13px; border-radius: 50%; background: var(--shell-bg, #EEECE3); border: 1px solid rgba(30, 34, 48, .3); }
.pg-timeline-step.is-done .pg-timeline-dot { background: var(--ink); border-color: var(--ink); }
.pg-timeline-step.is-current .pg-timeline-dot { box-shadow: 0 0 0 5px rgba(30, 34, 48, .1); animation: pg-pulse 2s ease-in-out infinite; }
.pg-timeline-label { font-size: .86rem; color: var(--muted); }
.pg-timeline-step.is-done .pg-timeline-label { color: var(--ink); font-weight: 500; }
.pg-timeline-date { font-size: .74rem; color: var(--muted); }

.pg-lookup { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 1.5rem 2rem; align-items: end; max-width: 820px; margin-top: 2rem; }

@keyframes pg-pop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
@keyframes pg-draw { to { stroke-dashoffset: 0; } }
@keyframes pg-pulse { 50% { box-shadow: 0 0 0 9px rgba(30, 34, 48, .04); } }

@media (max-width: 640px) {
    .pg-timeline { grid-template-columns: 1fr; gap: 1.1rem; }
    .pg-timeline-step { padding: 0 0 0 1.75rem; }
    .pg-timeline-step::before { top: 0; bottom: -1.1rem; left: 6px !important; right: auto !important; width: 1px !important; height: auto; }
    .pg-timeline-step:last-child::before { display: none; }
    .pg-lookup { grid-template-columns: 1fr; }
}

/* ---------- Animations ---------- */
@keyframes pg-fade { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes pg-rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes pg-spin-in { from { opacity: 0; transform: rotate(-90deg) scale(.8); } to { opacity: .9; transform: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .pg-shelf { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .pg-split, .pg-reviews { grid-template-columns: 1fr; }
    .pg-aside { position: static; }
    .pg-auth { grid-template-columns: 1fr; min-height: 0; }
    .pg-auth-brand { min-height: 0; gap: 2rem; }
    .pg-auth-form { max-width: none; }
}

@media (max-width: 640px) {
    .pg { padding: 1.25rem 1.25rem 3rem; }
    .pg-head { padding: .5rem 0 1.75rem; margin-bottom: 1.75rem; }
    .pg-grid-2 { grid-template-columns: 1fr; }
    .pg-line { grid-template-columns: 60px minmax(0, 1fr); gap: 1rem; }
    .pg-line-cover img { width: 60px; }
    .pg-line-price { grid-column: 2; text-align: left; }
    .pg-shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.25rem 1rem; }
    .pg-tabs { gap: 1.25rem; }
    .pg-auth-brand { padding: 1.75rem; }
    .pg-auth-mark { width: 90px; }
    .pg-auth-perks { display: none; }
}

/* Écoute audio par abonnement */
.pg-audio-parts { display: grid; gap: .75rem; margin: 0; padding: 0; list-style: none; }
.pg-audio-part { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 1.5rem; padding: 1.15rem 1.25rem; border: 1px solid var(--line); transition: border-color .2s, background .2s; }
.pg-audio-part.is-playing { border-color: var(--ink); background: var(--panel); }
.pg-audio-part-head { flex: 1 1 18rem; min-width: 0; }
.pg-audio-part-buy, .pg-audio-renew { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.pg-audio-part-buy .pg-select { width: auto; min-width: 12rem; }
.pg-audio-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin-bottom: 1.5rem; }
.pg-audio-toolbar .pg-select { width: auto; min-width: 12rem; }
.pg-audio-dock { position: sticky; bottom: 1rem; z-index: 20; margin-top: 1.5rem; padding: .75rem; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 12px 32px -18px rgba(30, 34, 48, .45); }
.pg-audio-dock audio { display: block; width: 100%; }
@media (max-width: 640px) {
    .pg-audio-part-buy, .pg-audio-renew, .pg-audio-part-buy .pg-select { width: 100%; }
    .pg-audio-part-buy .pg-btn { flex: 1; justify-content: center; }
    .pg-audio-dock { bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px)); }
}

/* Pages légales */
.pg-legal-nav { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin: -1rem 0 2.5rem; font-size: .85rem; }
.pg-legal-nav a { color: var(--muted); text-decoration: none; padding-bottom: .25rem; border-bottom: 1px solid transparent; }
.pg-legal-nav a:hover, .pg-legal-nav a.is-active { color: var(--ink); border-bottom-color: var(--ink); }
.pg-legal-body { max-width: 46rem; color: var(--ink); font-size: .95rem; line-height: 1.75; }
.pg-legal-body h2 { margin: 2.5rem 0 .75rem; font-family: var(--serif); font-size: 1.35rem; font-weight: 500; }
.pg-legal-body h2:first-child { margin-top: 0; }
.pg-legal-body p, .pg-legal-body ul { margin: 0 0 1rem; }
.pg-legal-body ul { padding-left: 1.2rem; }
.pg-legal-body li + li { margin-top: .35rem; }
.pg-legal-body a { color: var(--ink); text-underline-offset: 3px; }
.pg-legal-body table { width: 100%; margin: 0 0 1rem; border-collapse: collapse; font-size: .88rem; }
.pg-legal-body th, .pg-legal-body td { padding: .6rem .75rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.pg-legal-body th { font-weight: 600; }
.legal-missing { padding: 0 .25rem; background: #FFF1C2; color: #7A5A00; }
@media (max-width: 640px) {
    .pg-legal-body table, .pg-legal-body tbody, .pg-legal-body tr, .pg-legal-body td, .pg-legal-body th { display: block; }
    .pg-legal-body thead { display: none; }
    .pg-legal-body td { border: 0; padding: .2rem 0; }
    .pg-legal-body tr { padding: .75rem 0; border-bottom: 1px solid var(--line); }
}

@media (prefers-reduced-motion: reduce) {
    .pg *, .pg-head { animation: none !important; transition: none !important; }
}
