/* ==========================================================
   WeddingPart — Papeterie de table
   1. Interface (mobile d'abord)   2. Cartes (mm)   3. Impression
   ========================================================== */

/* ── 1. Interface ─────────────────────────────────────────── */
.idd-pp {
    --pp-brand: var(--wp-brand, #9E4D64);
    --pp-brand-soft: var(--wp-brand-soft, rgba(181,99,122,.09));
    --pp-ink: var(--wp-ink, #1D1819);
    --pp-muted: var(--wp-muted, #7A6A6F);
    --pp-line: var(--wp-line, #EDE0E4);
    --pp-surface: var(--wp-surface, #fff);
    --pp-surface-2: var(--wp-surface-2, #FAF5F3);
    color: var(--pp-ink);
    font-family: var(--wp-font-sans, 'DM Sans', system-ui, sans-serif);
    padding-bottom: calc(132px + env(safe-area-inset-bottom, 0px));
    max-width: 1320px;
    margin: 0 auto;
}
.idd-pp [hidden] { display: none !important; }
.idd-pp *, .idd-pp *::before, .idd-pp *::after { box-sizing: border-box; }

/* Onglets produits */
.pp-tabs {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    padding: 4px;
    margin: 0 0 14px;
    background: var(--pp-surface-2);
    border: 1px solid var(--pp-line);
    border-radius: 16px;
}
.pp-tab {
    position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    min-height: 58px; padding: 8px 4px;
    border: 0; border-radius: 12px; background: transparent;
    color: var(--pp-muted); font-weight: 600; font-size: 12px; line-height: 1.15; font-family: inherit; cursor: pointer;
    transition: background .15s, color .15s, box-shadow .15s;
}
.pp-tab:hover { color: var(--pp-ink); }
.pp-tab[aria-selected="true"] { background: var(--pp-surface); color: var(--pp-brand); box-shadow: 0 4px 14px -8px rgba(29,24,25,.35); }
.pp-tab__count { position: absolute; top: 5px; right: 6px; font-weight: 600; font-size: 10px; line-height: 1; font-family: inherit; font-style: normal; color: var(--pp-muted); }
.pp-tab__count:empty { display: none; }
.pp-tab[aria-selected="true"] .pp-tab__count { color: var(--pp-brand); }

/* Mise en page : aperçu puis réglages (mobile), côte à côte (desktop) */
.pp-layout { display: flex; flex-direction: column; gap: 14px; }
.pp-stage {
    position: sticky; top: calc(var(--app-header-h, 64px) + 6px); z-index: 5;
    background: var(--pp-surface);
    border: 1px solid var(--pp-line);
    border-radius: 18px;
    padding: 10px 10px 8px;
    box-shadow: 0 10px 30px -22px rgba(29,24,25,.4);
}
.pp-stage__bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pp-tab span, .pp-view__btn span { white-space: nowrap; }
.pp-view, .pp-nav { flex: none; }
.pp-view { display: inline-flex; padding: 3px; gap: 2px; background: var(--pp-surface-2); border-radius: 999px; }
.pp-view__btn {
    display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
    border: 0; border-radius: 999px; background: transparent; color: var(--pp-muted);
    font-weight: 600; font-size: 12.5px; line-height: 1; font-family: inherit; cursor: pointer;
}
.pp-view__btn.is-on { background: var(--pp-surface); color: var(--pp-ink); box-shadow: 0 2px 8px -4px rgba(0,0,0,.3); }
.pp-nav { display: inline-flex; align-items: center; gap: 4px; }
.pp-nav__btn {
    width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--pp-line); border-radius: 50%; background: var(--pp-surface); color: var(--pp-ink); cursor: pointer;
}
.pp-nav__btn:hover { border-color: var(--pp-brand); color: var(--pp-brand); }
.pp-nav__pos { min-width: 64px; text-align: center; font-weight: 600; font-size: 12.5px; line-height: 1; font-family: inherit; color: var(--pp-muted); font-variant-numeric: tabular-nums; }
.pp-stage__canvas {
    height: clamp(190px, 34vh, 340px);
    margin-top: 8px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 12px;
    background: radial-gradient(circle at 50% 40%, #fff 0%, #f4eeec 100%);
    overflow: hidden;
    touch-action: pan-y;
}
.pp-stage__canvas { position: relative; cursor: zoom-in; }
.pp-stage__canvas:focus-visible { outline: 2px solid var(--pp-brand); outline-offset: 2px; }
.pp-stage__zoom {
    position: absolute; right: 8px; bottom: 8px; width: 34px; height: 34px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; background: rgba(255,255,255,.92); color: var(--pp-ink);
    box-shadow: 0 2px 10px -4px rgba(29,24,25,.4); pointer-events: none;
}
.pp-fit { position: relative; flex: none; }

/* Aperçu plein écran */
.pp-zoom {
    position: fixed; inset: 0; z-index: 100002; display: flex; flex-direction: column;
    background: rgba(24,20,21,.94); color: #fff; touch-action: pan-x pan-y pinch-zoom;
    font-family: var(--wp-font-sans, 'DM Sans', system-ui, sans-serif);
    padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px);
}
.pp-zoom[hidden] { display: none; }
.pp-zoom__bar { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px 4px 18px; }
.pp-zoom__pos { font-size: 14px; font-weight: 600; opacity: .85; font-variant-numeric: tabular-nums; }
.pp-zoom__close, .pp-zoom__nav button {
    width: 48px; height: 48px; display: inline-flex; align-items: center; justify-content: center;
    border: 0; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; cursor: pointer;
}
.pp-zoom__close:hover, .pp-zoom__nav button:hover { background: rgba(255,255,255,.22); }
.pp-zoom__stage { flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
.pp-zoom__nav { flex: none; display: flex; justify-content: center; gap: 28px; padding: 6px 0 14px; }
.pp-zoom__nav[hidden] { display: none; }
.pp-scale { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.pp-scale > .pp-card { box-shadow: 0 10px 28px -12px rgba(29,24,25,.45), 0 1px 3px rgba(29,24,25,.12); }
.pp-scale > .pp-sheet { box-shadow: 0 8px 26px -10px rgba(29,24,25,.4); }
.pp-stage__sum { margin: 8px 2px 0; font-size: 12.5px; line-height: 1.4; color: var(--pp-muted); text-align: center; }
/* Vue à plat d'un chevalet : pli matérialisé à l'écran uniquement */
.pp-stage .pp-tent .pp-panel--back { box-shadow: inset 0 -1px 0 rgba(0,0,0,.18); }

/* Réglages */
.pp-controls { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pp-sec { background: var(--pp-surface); border: 1px solid var(--pp-line); border-radius: 16px; }
.pp-sec__head {
    list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 14px 16px; cursor: pointer; font-weight: 700; font-size: 15px; line-height: 1.2; font-family: inherit; color: var(--pp-ink);
}
.pp-sec__head::-webkit-details-marker { display: none; }
.pp-sec__head::after {
    content: ''; width: 8px; height: 8px; margin-left: 4px; flex: none;
    border-right: 2px solid var(--pp-muted); border-bottom: 2px solid var(--pp-muted);
    transform: rotate(45deg) translateY(-2px); transition: transform .2s;
}
.pp-sec[open] > .pp-sec__head::after { transform: rotate(-135deg) translateY(-1px); }
.pp-sec__head em { margin-left: auto; font-weight: 500; font-size: 12.5px; line-height: 1; font-family: inherit; font-style: normal; color: var(--pp-muted); }
.pp-sec__body { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 14px; }

.pp-field { display: flex; flex-direction: column; gap: 7px; }
.pp-label { font-weight: 600; font-size: 12.5px; line-height: 1.3; font-family: inherit; color: var(--pp-muted); letter-spacing: .01em; margin: 0; }
.pp-hint { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--pp-muted); }
.pp-hint--full { flex-basis: 100%; }
.pp-input {
    width: 100%; min-height: 44px; padding: 10px 12px;
    border: 1px solid var(--wp-line-strong, #DECFD5); border-radius: 12px;
    background: #fff; color: var(--pp-ink); font-weight: 400; font-size: 16px; line-height: 1.35; font-family: inherit;
}
.pp-input:focus { outline: none; border-color: var(--pp-brand); box-shadow: 0 0 0 3px var(--pp-brand-soft); }
.pp-input--num { max-width: 140px; }
.pp-textarea { min-height: 96px; resize: vertical; }
select.pp-input { appearance: auto; }
.pp-inline { display: flex; gap: 8px; align-items: stretch; }
.pp-inline .pp-input { flex: 1; min-width: 0; }
.pp-grid2 { display: grid; grid-template-columns: 1fr; gap: 8px; }
.pp-sub { display: flex; flex-direction: column; gap: 7px; padding-top: 12px; border-top: 1px dashed var(--pp-line); }

/* Choix segmentés */
.pp-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.pp-seg label { position: relative; flex: 1 1 auto; }
.pp-seg input { position: absolute; opacity: 0; pointer-events: none; }
.pp-seg span {
    display: flex; align-items: center; justify-content: center; min-height: 40px; padding: 8px 12px;
    border: 1px solid var(--wp-line-strong, #DECFD5); border-radius: 999px; background: #fff;
    font-weight: 600; font-size: 13px; line-height: 1.2; font-family: inherit; color: var(--pp-ink); cursor: pointer; text-align: center; white-space: nowrap;
}
.pp-seg input:checked + span { background: var(--pp-ink); border-color: var(--pp-ink); color: #fff; }
.pp-seg input:focus-visible + span { box-shadow: 0 0 0 3px var(--pp-brand-soft); }

.pp-cards-choice { display: grid; grid-template-columns: 1fr; gap: 8px; }
.pp-choice { position: relative; display: block; cursor: pointer; }
.pp-choice input { position: absolute; opacity: 0; pointer-events: none; }
.pp-choice > span {
    display: flex; flex-direction: column; gap: 3px; padding: 12px 14px 12px 42px;
    border: 1.5px solid var(--pp-line); border-radius: 14px; background: #fff; position: relative;
}
.pp-choice > span::before {
    content: ''; position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; margin-top: -9px;
    border: 2px solid var(--wp-line-strong, #DECFD5); border-radius: 50%; background: #fff;
}
.pp-choice strong { font-weight: 700; font-size: 14px; line-height: 1.2; font-family: inherit; }
.pp-choice small { font-weight: 400; font-size: 12.5px; line-height: 1.35; font-family: inherit; color: var(--pp-muted); }
.pp-choice input:checked + span { border-color: var(--pp-brand); background: var(--pp-brand-soft); }
.pp-choice input:checked + span::before { border-color: var(--pp-brand); background: radial-gradient(circle, var(--pp-brand) 0 4px, #fff 5px); }
.pp-choice input:focus-visible + span { box-shadow: 0 0 0 3px var(--pp-brand-soft); }

.pp-check { display: flex; align-items: flex-start; gap: 10px; font-weight: 500; font-size: 14px; line-height: 1.4; font-family: inherit; cursor: pointer; }
.pp-check input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--pp-brand); }
.pp-check small { color: var(--pp-muted); font-weight: 400; }

/* Styles (vignettes réelles) */
.pp-styles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pp-style {
    display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 6px 6px 8px;
    border: 1.5px solid var(--pp-line); border-radius: 14px; background: #fff; cursor: pointer; min-width: 0;
}
.pp-style.is-on { border-color: var(--pp-brand); box-shadow: 0 0 0 3px var(--pp-brand-soft); }
.pp-style__thumb { position: relative; display: block; width: 100%; aspect-ratio: 90 / 50; overflow: hidden; border-radius: 8px; }
.pp-style__scale { position: absolute; left: 0; top: 0; transform-origin: 0 0; transform: scale(.42); }
.pp-style__name { font-weight: 600; font-size: 12.5px; line-height: 1.2; font-family: inherit; color: var(--pp-ink); text-align: center; }

/* Couleurs */
.pp-swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pp-sw {
    position: relative; width: 34px; height: 34px; border-radius: 50%; padding: 0; cursor: pointer;
    border: 2px solid #fff; box-shadow: 0 0 0 1px var(--wp-line-strong, #DECFD5); background: var(--c, #ccc);
    display: inline-flex; align-items: center; justify-content: center; color: #fff;
}
.pp-sw.is-on { box-shadow: 0 0 0 2px var(--pp-ink); }
.pp-sw--auto { width: auto; padding: 0 12px; border-radius: 999px; background: #fff; color: var(--pp-ink); font-weight: 600; font-size: 12px; line-height: 1; font-family: inherit; border: 1px solid var(--wp-line-strong, #DECFD5); box-shadow: none; }
.pp-sw--auto.is-on { background: var(--pp-ink); color: #fff; border-color: var(--pp-ink); }
.pp-sw--mb::after { content: ''; position: absolute; right: -2px; bottom: -2px; width: 10px; height: 10px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 2px var(--pp-brand); }
.pp-sw--custom { background: conic-gradient(#e66, #eb5, #6c6, #5ae, #a6e, #e66); }
.pp-sw--custom.is-on { background: var(--c); }
.pp-sw--custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }

/* Puces, listes */
.pp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pp-chip {
    min-height: 36px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--wp-line-strong, #DECFD5);
    background: #fff; color: var(--pp-ink); font-weight: 600; font-size: 13px; line-height: 1.2; font-family: inherit; cursor: pointer;
}
.pp-chip.is-on { background: var(--pp-brand); border-color: var(--pp-brand); color: #fff; }
.pp-picker { border: 1px solid var(--pp-line); border-radius: 14px; overflow: hidden; }
.pp-picker__bar { display: flex; gap: 6px; padding: 8px; background: var(--pp-surface-2); align-items: center; }
.pp-search { position: relative; flex: 1; min-width: 0; display: block; }
.pp-search svg { position: absolute; left: 11px; top: 50%; margin-top: -7.5px; color: var(--pp-muted); }
.pp-search .pp-input { padding-left: 34px; min-height: 40px; }
.pp-mini { flex: none; height: 36px; padding: 0 10px; border: 1px solid var(--wp-line-strong, #DECFD5); border-radius: 10px; background: #fff; font-weight: 600; font-size: 12.5px; line-height: 1; font-family: inherit; cursor: pointer; }
.pp-picker__list { max-height: 280px; overflow: auto; padding: 4px 0; overscroll-behavior: contain; }
.pp-pick { display: flex; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer; font-size: 14px; }
.pp-pick:hover { background: var(--pp-surface-2); }
.pp-pick input { width: 18px; height: 18px; accent-color: var(--pp-brand); flex: none; }
.pp-pick span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-pick em { font-style: normal; font-size: 12px; color: var(--pp-muted); white-space: nowrap; }
.pp-manual-menu { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.pp-manual-menu .pp-textarea { min-height: 64px; }

.pp-link { display: inline-flex; align-items: center; gap: 4px; color: var(--pp-brand); font-weight: 600; text-decoration: none; white-space: nowrap; }
.pp-link:hover { text-decoration: underline; }
.pp-notice, .pp-empty-box {
    display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px;
    background: var(--wp-gold-light, #F7EFE3); border: 1px solid var(--wp-gold-border, rgba(201,168,124,.28));
    color: var(--wp-gold-dark, #836947); font-size: 13.5px; line-height: 1.45;
}
.pp-notice svg, .pp-empty-box svg { flex: none; margin-top: 1px; }
.pp-empty-box p { margin: 0; color: var(--pp-ink); }
.pp-check-info:empty { display: none; }
.pp-check-info { display: flex; flex-direction: column; gap: 6px; }
.pp-ck { display: flex; gap: 8px; align-items: flex-start; margin: 0; font-size: 13px; line-height: 1.4; }
.pp-ck svg { flex: none; margin-top: 2px; }
.pp-ck.is-ok svg { color: var(--wp-success, #059669); }
.pp-ck.is-warn svg { color: var(--wp-warning, #F59E0B); }

/* Idées (Claude) */
.pp-ai {
    flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; min-height: 44px;
    border: 1px solid var(--pp-brand); border-radius: 12px; background: var(--pp-brand-soft); color: var(--pp-brand);
    font-weight: 600; font-size: 13px; line-height: 1; font-family: inherit; cursor: pointer;
}
.pp-ai-box { padding: 12px; border-radius: 14px; background: var(--pp-surface-2); border: 1px solid var(--pp-line); display: flex; flex-direction: column; gap: 8px; }
.pp-ideas { display: flex; flex-direction: column; gap: 6px; }
.pp-idea { text-align: left; padding: 10px 12px; border: 1px solid var(--pp-line); border-radius: 12px; background: #fff; font-weight: 500; font-size: 14px; line-height: 1.35; font-family: inherit; color: var(--pp-ink); cursor: pointer; }
.pp-idea:hover { border-color: var(--pp-brand); }
.pp-loading { animation: pp-pulse 1.2s ease-in-out infinite; }
@keyframes pp-pulse { 50% { opacity: .45; } }

.pp-print-cta {
    display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 52px;
    border: 0; border-radius: 16px; background: var(--pp-brand); color: #fff; font-weight: 700; font-size: 15px; line-height: 1; font-family: inherit; cursor: pointer;
    box-shadow: 0 10px 24px -12px rgba(158,77,100,.6);
}
.pp-print-cta:hover { background: var(--wp-brand-dark, #853F55); }

/* Fenêtre d'impression */
.pp-modal { position: fixed; inset: 0; z-index: 100000; display: flex; align-items: flex-end; justify-content: center; }
.pp-modal__backdrop { position: absolute; inset: 0; background: rgba(29,24,25,.5); }
.pp-modal__box {
    position: relative; width: 100%; max-width: 560px; max-height: 92vh; display: flex; flex-direction: column;
    background: #fff; border-radius: 22px 22px 0 0; box-shadow: 0 -10px 40px rgba(0,0,0,.2);
}
.pp-modal__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 10px; }
.pp-modal__head h3 { margin: 0; font: 600 22px/1.2 var(--wp-font-serif, 'Cormorant Garamond', serif); }
.pp-modal__close { width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--pp-surface-2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.pp-modal__body { padding: 4px 20px 16px; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.pp-modal__sum { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--pp-brand-soft); color: var(--pp-brand); font-weight: 600; font-size: 13.5px; line-height: 1.4; font-family: inherit; }
.pp-modal__foot { display: flex; gap: 10px; padding: 12px 20px calc(14px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--pp-line); }
.pp-btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; border-radius: 14px; font-weight: 700; font-size: 15px; line-height: 1; font-family: inherit; cursor: pointer; }
.pp-btn--ghost { background: #fff; border: 1px solid var(--wp-line-strong, #DECFD5); color: var(--pp-ink); }
.pp-btn--primary { background: var(--pp-brand); border: 0; color: #fff; flex: 2; }
.pp-btn[disabled] { opacity: .6; cursor: wait; }
.pp-tips h4 { margin: 4px 0 6px; font-weight: 700; font-size: 14px; line-height: 1.3; font-family: inherit; }
.pp-tips ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; line-height: 1.45; color: #3d3437; }
html.pp-modal-open { overflow: hidden; }

.pp-toast {
    position: fixed; left: 50%; bottom: calc(136px + env(safe-area-inset-bottom, 0px)); z-index: 100001;
    transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
    padding: 10px 16px; border-radius: 999px; background: var(--pp-ink); color: #fff; font-weight: 600; font-size: 13.5px; line-height: 1.3; font-family: inherit;
    transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px); text-align: center;
}
.pp-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* Téléphone : 5 onglets sur une ligne, libellé sur deux lignes si besoin (« Marque-/places ») */
@media (max-width: 559px) {
    .pp-tab { padding: 8px 2px; font-size: 11px; }
    .pp-tab span { white-space: normal; text-align: center; }
}
/* Onglets en ligne (icône + libellé + nombre) seulement quand les 5 tiennent côte à côte */
@media (min-width: 900px) {
    .pp-tab { flex-direction: row; min-height: 48px; font-size: 13.5px; gap: 8px; }
    .pp-tab__count { position: static; margin-left: 2px; padding: 3px 7px; border-radius: 999px; background: var(--pp-surface-2); }
}
@media (min-width: 560px) {
    .pp-cards-choice { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
    .pp-grid2 { grid-template-columns: 1fr 1fr; }
    .pp-modal { align-items: center; padding: 20px; }
    .pp-modal__box { border-radius: 22px; }
    .pp-styles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 980px) {
    .pp-layout { display: grid; grid-template-columns: minmax(340px, 400px) minmax(0, 1fr); align-items: start; gap: 20px; }
    .pp-stage { order: 2; top: calc(var(--app-header-h, 64px) + 16px); padding: 14px; }
    .pp-controls { order: 1; }
    .pp-stage__canvas { height: calc(100vh - var(--app-header-h, 64px) - 250px); min-height: 380px; }
    .pp-styles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pp-print-cta { display: none; }
}

/* ── 2. Cartes (dimensions réelles en mm) ─────────────────── */
.pp-card {
    position: relative; overflow: hidden; flex: none;
    color: var(--ink); background-color: var(--paper);
    font-family: var(--ft); font-weight: var(--ft-w);
    line-height: 1.2; text-align: center;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
    text-rendering: geometricPrecision; -webkit-font-smoothing: antialiased;
}
.pp-card *, .pp-card *::before, .pp-card *::after { box-sizing: border-box; }
.pp-card.pp-round { border-radius: 50%; }
.pp-trim { position: absolute; display: flex; flex-direction: column; }
.pp-panel { position: relative; flex: none; width: 100%; overflow: hidden; }
.pp-panel--back { transform: rotate(180deg); }
.pp-frame { position: absolute; inset: var(--fi); pointer-events: none; }
.pp-round .pp-frame, .pp-fmt-napkin-round .pp-frame { border-radius: 50% !important; }

.pp-in {
    position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: calc(var(--fi) + 2.4mm) calc(var(--fi) + 3mm);
}
.pp-name {
    display: block; width: 100%; overflow: hidden; white-space: nowrap;
    padding: .4em 1.5mm .3em; margin: -.3em 0 -.2em;
    font-family: var(--fn); font-weight: var(--fn-w); font-style: var(--fn-i);
    text-transform: var(--fn-up); letter-spacing: var(--fn-ls);
    line-height: 1.15; color: var(--ink);
}
.pp-small {
    font-family: var(--fs); font-weight: var(--fs-w); text-transform: var(--fs-up); letter-spacing: var(--fs-ls);
    font-size: 2mm; line-height: 1.3; color: var(--accent); max-width: 100%;
}
.pp-note { font-family: var(--ft); font-style: italic; color: var(--ink); line-height: 1.3; max-width: 100%; }
.pp-orn { color: var(--accent); line-height: 0; margin: .9mm auto; flex: none; max-width: 70%; }
.pp-orn svg { display: block; width: 100%; height: auto; overflow: visible; }

/* Cadres par style */
.pp-fr-double .pp-frame { border: .3mm solid var(--accent); }
.pp-fr-double .pp-frame::after { content: ''; position: absolute; inset: var(--fi2); border: .12mm solid var(--accent); }
.pp-fr-round .pp-frame { border: .25mm solid var(--accent); border-radius: 2.4mm; }
.pp-fr-arch .pp-frame { border: .3mm solid var(--accent); border-radius: 999mm 999mm 2mm 2mm / 32mm 32mm 2mm 2mm; }
.pp-fr-arch-s .pp-frame { border: .3mm solid var(--accent); border-radius: 7mm 7mm 1.5mm 1.5mm; }
.pp-fr-deco .pp-frame { border: .35mm solid var(--accent); }
.pp-fr-deco .pp-frame::before { content: ''; position: absolute; inset: var(--fi2); border: .15mm solid var(--accent); }
.pp-fr-chalk .pp-frame { border: .3mm solid var(--ink-soft); border-radius: 1.2mm; }
.pp-tall.pp-fr-chalk .pp-frame { border-style: dashed; border-width: .35mm; }

/* Repère discret pour le traiteur */
.pp-reg {
    position: absolute; right: calc(var(--fi) + 1.6mm); bottom: calc(var(--fi) + 1.3mm);
    min-width: 3.6mm; height: 3.6mm; padding: 0 .7mm; border: .2mm solid var(--accent); border-radius: 2mm;
    font: 600 1.6mm/3.2mm 'Lato', sans-serif; letter-spacing: .02em; color: var(--accent);
}

/* Marque-places / serviettes */
.pp-in--place .pp-top { margin-bottom: .6mm; max-width: 92%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pp-in--place .pp-tline { margin-top: .2mm; max-width: 92%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pp-in--note .pp-note { display: block; width: 100%; white-space: nowrap; overflow: hidden; padding: 0 1mm; }
.pp-in--napkin .pp-small { margin-top: .4mm; }
.pp-fmt-napkin-round .pp-in { padding: 9mm 6mm; }
.pp-fmt-napkin-round .pp-small { font-size: 1.8mm; margin-top: 1mm; }
.pp-mono i { font-style: normal; font-size: .55em; vertical-align: .18em; color: var(--accent); }

/* Cartes de table */
.pp-in--table { justify-content: flex-start; padding: calc(var(--fi) + 8mm) calc(var(--fi) + 6mm) calc(var(--fi) + 6mm); }
.pp-in--table.is-center { justify-content: center; }
.pp-eyebrow { font-size: 3.2mm; letter-spacing: .38em; margin-bottom: 1mm; }
.pp-tname {
    display: block; width: 100%; overflow: hidden; white-space: nowrap; padding: .3em 2mm .25em; margin: -.25em 0 -.15em;
    font-family: var(--fn); font-weight: var(--fn-w); font-style: var(--fn-i); text-transform: var(--fn-up); letter-spacing: var(--fn-ls);
    line-height: 1.15; color: var(--ink);
}
.pp-tname.is-num { line-height: 1; }
.pp-glist { flex: 1 1 auto; min-height: 0; width: 100%; overflow: hidden; display: flex; flex-direction: column; margin-top: 3mm; }
.pp-glist ul {
    margin: auto 0; padding: 0; list-style: none; column-gap: 6mm;
    font-family: var(--ft); font-weight: var(--ft-w); font-size: calc(var(--k, 1) * 3.7mm * var(--ft-k)); line-height: 1.55;
}
.pp-glist li { break-inside: avoid; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-foot { flex: none; margin-top: 3mm; }
.pp-fmt-table-a6 .pp-in--table, .pp-fmt-table-tent .pp-in--table { padding: calc(var(--fi) + 4mm) calc(var(--fi) + 5mm) calc(var(--fi) + 3.5mm); }
.pp-fmt-table-a6 .pp-glist ul, .pp-fmt-table-tent .pp-glist ul { font-size: calc(var(--k, 1) * 3mm * var(--ft-k)); line-height: 1.45; }
.pp-fmt-table-a6 .pp-eyebrow, .pp-fmt-table-tent .pp-eyebrow { font-size: 2.6mm; }

/* Menus */
.pp-in--menu { justify-content: flex-start; padding: calc(var(--fi) + 7mm) calc(var(--fi) + 5mm) calc(var(--fi) + 6mm); }
.pp-mhead { flex: none; width: 100%; display: flex; flex-direction: column; align-items: center; gap: .8mm; }
.pp-mtitle { flex: none; font-family: var(--fs); text-transform: uppercase; letter-spacing: .34em; font-size: 2.9mm; color: var(--accent); margin: .8mm 0 2.5mm; padding-left: .34em; }
.pp-courses { flex: 1 1 auto; min-height: 0; width: 100%; overflow: hidden; display: flex; flex-direction: column; }
.pp-courses__in { margin: auto 0; display: flex; flex-direction: column; gap: calc(var(--k, 1) * 4.2mm); }
.pp-course h5 { margin: 0 0 calc(var(--k, 1) * 1.2mm); font-size: calc(var(--k, 1) * 2.1mm); }
.pp-dish { margin: 0; font-family: var(--ft); font-weight: var(--ft-w); font-size: calc(var(--k, 1) * 3.6mm * var(--ft-k)); line-height: 1.25; color: var(--ink); }
.pp-dish + .pp-dish { margin-top: calc(var(--k, 1) * 1.4mm); }
.pp-desc { margin: calc(var(--k, 1) * .5mm) 0 0; font-family: var(--ft); font-style: italic; font-size: calc(var(--k, 1) * 2.7mm * var(--ft-k)); line-height: 1.3; opacity: .82; }
.pp-desc + .pp-dish { margin-top: calc(var(--k, 1) * 1.8mm); }
.pp-var { margin: calc(var(--k, 1) * .8mm) 0 0; font-family: var(--ft); font-style: italic; font-size: calc(var(--k, 1) * 2.5mm * var(--ft-k)); color: var(--accent); line-height: 1.3; }
.pp-empty { opacity: .6; font-style: italic; font-size: 3mm; }
.pp-mfoot { flex: none; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 1.2mm; margin-top: 3mm; }
.pp-mfoot .pp-note { font-size: 3mm; }
.pp-fmt-menu-a5 .pp-in--menu { padding: calc(var(--fi) + 10mm) calc(var(--fi) + 10mm) calc(var(--fi) + 8mm); }
.pp-fmt-menu-a5 .pp-dish { font-size: calc(var(--k, 1) * 4.2mm * var(--ft-k)); }
.pp-fmt-menu-a5 .pp-desc { font-size: calc(var(--k, 1) * 3mm * var(--ft-k)); }

/* QR photos (album photo des invités) */
.pp-in--qr { justify-content: center; padding: calc(var(--fi) + 9mm) calc(var(--fi) + 10mm) calc(var(--fi) + 7mm); }
.pp-qr { flex: none; width: 92mm; margin: 2.5mm auto 3mm; line-height: 0; background: #fff; border: .3mm solid var(--accent); border-radius: 3mm; overflow: hidden; }
.pp-qr__code { display: block; width: 100%; height: auto; }
.pp-qr__missing { display: block; padding: 40% 0; font: 600 3mm/1 'Lato', sans-serif; color: #999; text-align: center; }
.pp-qr__title { flex: none; text-align: center; }
.pp-qr__text { flex: 1 1 auto; min-height: 0; width: 100%; overflow: hidden; display: flex; flex-direction: column; }
.pp-qr__text > div { margin: auto 0; }
.pp-qr__text p { margin: 0; font-family: var(--ft); font-weight: var(--ft-w); font-size: calc(var(--k, 1) * 4.4mm * var(--ft-k)); line-height: 1.35; color: var(--ink); }
.pp-qr__url { flex: none; width: 100%; overflow: hidden; white-space: nowrap; margin-top: 1.5mm; font-family: 'Lato', sans-serif; letter-spacing: .02em; color: var(--ink-soft); }
.pp-qr__foot { flex: none; margin-top: 2.5mm; }
.pp-in--qr.is-row { flex-direction: row; align-items: center; gap: 5mm; padding: calc(var(--fi) + 4mm) calc(var(--fi) + 5mm); }
.pp-in--qr.is-row .pp-qr { width: 64mm; margin: 0; border-radius: 2.4mm; }
.pp-qr__side { flex: 1 1 0; min-width: 0; align-self: stretch; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.pp-in--qr.is-row .pp-qr__text p { font-size: calc(var(--k, 1) * 3.3mm * var(--ft-k)); line-height: 1.3; }
.pp-in--qr.is-row .pp-qr__foot { margin-top: 1.6mm; }
.pp-fmt-qr-card .pp-in--qr.is-row { gap: 2.6mm; padding: calc(var(--fi) + 1.4mm) calc(var(--fi) + 2.2mm); }
.pp-fmt-qr-card .pp-in--qr.is-row .pp-qr { width: 35mm; border-width: .2mm; border-radius: 1.6mm; }
.pp-fmt-qr-card .pp-in--qr.is-row .pp-qr__text p { font-size: calc(var(--k, 1) * 2.1mm * var(--ft-k)); line-height: 1.28; }
.pp-fmt-qr-card .pp-in--qr .pp-qr__url { margin-top: .8mm; }
.pp-fmt-qr-card .pp-in--qr .pp-qr__foot { font-size: 1.6mm; margin-top: 1mm; }
.pp-fmt-qr-card .pp-orn { margin: .4mm auto .8mm; }

/* Fonds sombres : petites corrections de lisibilité */
.pp-dark .pp-desc { opacity: .9; }

/* Planches A4 */
.pp-sheet { position: relative; width: 210mm; height: 296.7mm; background: #fff; overflow: hidden; }
.pp-slot { position: absolute; }
.pp-marks { position: absolute; left: 0; top: 0; width: 210mm; height: 297mm; pointer-events: none; }
.pp-sheet--round .pp-card.pp-round { box-shadow: 0 0 0 .15mm #bbb; }
.pp-page { position: relative; overflow: hidden; background: #fff; }
.pp-page > .pp-card { position: absolute; left: 0; top: 0; }

/* Fiche traiteur */
.pp-recap { padding: 16mm 15mm; font-family: 'Lato', Arial, sans-serif; color: #222; font-size: 3.1mm; line-height: 1.4; }
.pp-recap h2 { margin: 0 0 1mm; font: 600 7mm/1.2 'Cormorant Garamond', serif; }
.pp-recap__sub { margin: 0 0 4mm; color: #666; }
.pp-recap__tot { display: flex; flex-wrap: wrap; gap: 2mm 6mm; margin: 0 0 5mm; padding: 3mm 4mm; background: #f5f1ee; border-radius: 2mm; }
.pp-recap__tot em { font-style: normal; color: #888; }
.pp-recap table { width: 100%; border-collapse: collapse; }
.pp-recap th { text-align: left; font-size: 2.6mm; text-transform: uppercase; letter-spacing: .08em; color: #777; border-bottom: .3mm solid #222; padding: 1.5mm 2mm; }
.pp-recap td { padding: 1.4mm 2mm; border-bottom: .15mm solid #ddd; vertical-align: top; }
.pp-recap tr.is-first td { border-top: .3mm solid #999; }
.pp-recap td:first-child { font-weight: 700; width: 24%; }
.pp-recap__foot { margin-top: 6mm; font-size: 2.6mm; color: #888; }

/* Zone d'impression : mesurée hors écran, affichée seule à l'impression */
#idd-pp-print { position: absolute; left: -30000px; top: 0; visibility: hidden; pointer-events: none; }

/* ── 3. Impression ────────────────────────────────────────── */
@media print {
    html, body.pp-printing { margin: 0 !important; padding: 0 !important; background: #fff !important; }
    html { margin-top: 0 !important; }
    body.pp-printing > *:not(#idd-pp-print) { display: none !important; }
    body.pp-printing #idd-pp-print { position: static; left: auto; visibility: visible; }
    #idd-pp-print .pp-sheet, #idd-pp-print .pp-page { break-after: page; page-break-after: always; box-shadow: none; }
    #idd-pp-print > :last-child { break-after: auto; page-break-after: auto; }
    #idd-pp-print * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
}
