/* Layout : « chambre noire ». Un objet seul dans une pénombre chaude, la typographie crème
   comme seul décor. Accueil plein cadre (capsule 3D fixée au centre, sections qui défilent
   autour), puis l'outil de commande en colonnes sobres : capitales 500, filets pointillés,
   boutons pilule, aucune ombre portée. Le fond « Noyer » reste sombre en mode clair comme en
   mode sombre ; les autres fonds du panneau Apparence gardent leurs deux versions. */
:root {
  --paper: #100904;       /* noyer : le vide derrière la capsule */
  --sheet: #160d07;       /* un pas au-dessus : fiches, panneaux */
  --ink: #ffedd7;         /* crème : tout le texte */
  --ink-2: #b9a58c;       /* crème éteinte : texte secondaire */
  --rule: #40372e;        /* liège : filets */
  --rule-strong: #6c5f51; /* bois flotté : contours de contrôles */
  --accent: #ffedd7; --accent-ink: #100904; --accent-soft: #3a3029;
  --fill: #382416; --fill-ink: #ffedd7;   /* écorce : le bouton plein */
  --coffee: #ffedd7; --coffee-soft: #3a3029;
  --ember: #dc5000;       /* braise : crédits et mentions, jamais un bouton */
  --capsule: #ee7415;     /* aluminium anodisé de la capsule Inizio */
  --stamp: #f2806a; --ok: #8fcf9f; --warn: #e8b45a; --warn-soft: #2c1f0c;
  --form-bg: #ffffff; --form-ink: #111111; --form-yellow: #fff9b0;
  --font-display: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-form: "Didact Gothic", "Century Gothic", "Avenir", sans-serif;
  --r: 12px; --pad-y: 14px; --pad-x: 16px; --gap: 18px; --fs: 15px; --card-min: 255px; --display-weight: 500;
  --hdr-h: 62px;
  --gutter: clamp(16px, 2.4vw, 32px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { background: var(--paper); color: var(--ink); }
body { font-family: var(--font-body); font-size: var(--fs); line-height: 1.45; -webkit-font-smoothing: antialiased; font-feature-settings: "ss01"; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--paper); }
.wrap { max-width: 1320px; margin: 0 auto; padding-left: max(var(--gutter), env(safe-area-inset-left, 0px)); padding-right: max(var(--gutter), env(safe-area-inset-right, 0px)); }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: var(--display-weight); text-transform: uppercase; letter-spacing: 0; line-height: .92; text-wrap: balance; margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
:focus-visible { outline: 1px dashed var(--ink); outline-offset: 3px; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.label { font-family: var(--font-display); text-transform: uppercase; letter-spacing: .04em; font-size: 11px; font-weight: 500; color: var(--ink-2); }
.dash { border: 0; border-top: 1px dashed var(--rule-strong); margin: 0; }
::placeholder { color: var(--ink-2); opacity: .55; }
input[type="checkbox"] { accent-color: var(--accent); }

/* --- navigation --- */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--paper); border-bottom: 1px dashed var(--rule); }
.top .wrap { max-width: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 28px; padding-block: 12px; }
.brand { display: flex; flex-direction: column; gap: 4px; min-width: 0; color: var(--ink); text-decoration: none; }
.brand .label { font-size: 10px; }
.brand h1 { font-size: 17px; line-height: 1; }
.brand h1 span { color: var(--coffee); }
.right { display: flex; align-items: center; gap: 8px 22px; margin-left: auto; min-width: 0; max-width: 100%; }
.tabs { display: flex; gap: 4px 20px; overflow-x: auto; min-width: 0; scrollbar-width: none; }
.tab { appearance: none; border: 0; background: none; padding: 6px 0 5px; cursor: pointer; font-family: var(--font-display); font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .02em; color: var(--ink-2); border-bottom: 1px dashed transparent; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.count { font-size: 10.5px; font-weight: 500; font-variant-numeric: tabular-nums; background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 1px 6px; }
.count[hidden] { display: none; }
.who { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.who img { width: 22px; height: 22px; border-radius: 50%; }
.role { text-transform: uppercase; letter-spacing: .04em; font-size: 10px; font-weight: 500; border: 1px solid var(--rule-strong); border-radius: 999px; padding: 2px 8px; }
.look-btn { flex: none; }

.banner-wrap { padding-block: 14px 0; }
.banner { border: 1px dashed var(--warn); background: var(--warn-soft); color: var(--ink); padding: 10px 16px; border-radius: var(--r); font-size: 14px; }
main.wrap { padding-block: 44px 96px; display: flex; flex-direction: column; gap: 28px; }
.view { display: flex; flex-direction: column; gap: 26px; }
.intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 46ch); gap: 18px 48px; align-items: end; padding-bottom: 26px; border-bottom: 1px dashed var(--rule); }
.intro h2 { font-size: clamp(40px, 5.4vw, 76px); line-height: .88; }
.intro p { margin: 0; font-size: clamp(16px, 1.45vw, 20px); line-height: 1.32; }

/* --- filtres --- */
.filters { display: flex; flex-direction: column; gap: 14px; }
.frow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.frow.sub { padding-top: 14px; border-top: 1px dashed var(--rule); gap: 8px 10px; }
.sel { display: inline-flex; align-items: center; gap: 8px; }
.sel select { border: 0; border-bottom: 1px solid var(--rule-strong); border-radius: 0; background: transparent; padding: 4px 2px; }
.chip { appearance: none; border: 1px solid var(--rule-strong); background: transparent; border-radius: 999px; padding: 6px 14px; cursor: pointer; font-size: 11.5px; font-weight: 500; text-transform: uppercase; letter-spacing: .02em; color: var(--ink); }
.chip:hover { border-color: var(--ink); }
.chip.small { font-size: 10.5px; padding: 4px 11px; }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.search { flex: 1 1 220px; max-width: 320px; border: 0; border-bottom: 1px solid var(--rule-strong); border-radius: 0; background: transparent; padding: 7px 2px; }
.search:focus-visible, .sel select:focus-visible, .field input:focus-visible, .field textarea:focus-visible, .field select:focus-visible, .prod-tbl input:focus-visible, .prod-tbl select:focus-visible { outline: none; border-bottom-color: var(--ink); }

/* --- catalogue --- */
.supplier { display: flex; flex-direction: column; gap: 18px; }
.supplier-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; padding-bottom: 12px; border-bottom: 1px dashed var(--rule-strong); }
.supplier-head h3 { font-size: clamp(28px, 3.2vw, 41px); }
.supplier-head p { flex-basis: 100%; margin: 0; font-size: 13.5px; color: var(--ink-2); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(var(--card-min), 100%), 1fr)); gap: var(--gap); }
.card { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r); display: flex; flex-direction: column; min-width: 0; transition: border-color .15s; }
.card:hover { border-color: var(--rule-strong); }
.card.in { border-color: var(--ink); }
.card-photo { height: 132px; display: grid; place-items: center; padding: 18px var(--pad-x) 2px; border-radius: var(--r) var(--r) 0 0; overflow: hidden; }
.card-photo img { max-width: 74%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.card-photo.carre { height: clamp(180px, 16vw, 240px); padding: 12px var(--pad-x) 8px; }
.card-photo.carre img { max-width: 92%; max-height: 100%; }
.card-photo.portrait { height: clamp(190px, 18vw, 260px); }
.card-photo.paysage { height: clamp(118px, 12vw, 170px); }
.card-top { display: flex; align-items: center; gap: 10px; padding: var(--pad-y) var(--pad-x) 0; }
.glyph { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--rule-strong); color: var(--ink); }
.glyph.cafe { color: var(--coffee); }
.glyph.une { border-color: var(--capsule); color: var(--capsule); }
.glyph svg { width: 20px; height: 20px; }
.card-top .label { font-size: 10.5px; }
.card-body { padding: calc(var(--pad-y) * .7) var(--pad-x) var(--pad-y); display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card h4 { font-size: 21px; line-height: .95; }
.card .sub { font-size: 11px; text-transform: uppercase; letter-spacing: .03em; font-weight: 500; color: var(--ink-2); }
.card .desc { font-size: 14px; line-height: 1.42; margin: 0; }
.desc-row { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.desc-row .desc { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; flex: 1; min-width: 0; }
.info-btn { flex: 0 0 auto; width: 28px; height: 28px; font-size: 0; }
.info-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.desc-dialog-backdrop { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: rgb(20 24 20 / 46%); }
.desc-dialog { width: min(620px, 100%); max-height: min(70vh, 620px); overflow: auto; padding: 20px 22px; background: var(--sheet); border: 1px solid var(--rule-strong); border-radius: var(--r); box-shadow: 0 18px 60px rgb(0 0 0 / 24%); }
.desc-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.desc-dialog p { margin: 0; font-size: 14px; line-height: 1.55; white-space: pre-wrap; }
.meter { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-2); }
.notches { display: grid; grid-template-columns: repeat(13, 6px); gap: 2px; }
.notches i { height: 10px; border-radius: 1px; background: var(--rule); }
.notches i.on { background: var(--coffee); }
.meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 10px; font-size: 12.5px; margin-top: auto; padding-top: 10px; border-top: 1px dashed var(--rule); }
.meta a { white-space: nowrap; }
.price { font-weight: 500; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: calc(var(--pad-y) * .8) var(--pad-x); border-top: 1px dashed var(--rule); }
.card-foot .state { font-size: 12px; color: var(--ink-2); }
.stepper { display: inline-flex; align-items: stretch; border: 1px solid var(--rule-strong); border-radius: 999px; overflow: hidden; flex: none; }
.stepper button { appearance: none; border: 0; background: none; width: 34px; height: 32px; cursor: pointer; font-size: 17px; line-height: 1; color: var(--ink); }
.stepper button:hover:not(:disabled) { background: var(--accent-soft); }
.stepper button:disabled { color: var(--rule-strong); cursor: default; }
.stepper input { width: 44px; border: 0; border-inline: 1px dashed var(--rule); text-align: center; font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 500; background: none; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.empty { border: 1px dashed var(--rule-strong); border-radius: var(--r); padding: 26px; color: var(--ink-2); }

/* --- boutons --- */
.btn { appearance: none; border: 1px solid var(--ink); background: transparent; color: var(--ink); border-radius: 999px; padding: 9px 18px; cursor: pointer; font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .02em; line-height: 1.2; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.btn:hover:not(:disabled) { background: var(--accent-soft); }
.btn.primary { background: var(--fill); border-color: var(--fill); color: var(--fill-ink); }
.btn.primary:hover:not(:disabled) { background: var(--fill); filter: brightness(1.22); }
.btn.danger { color: var(--stamp); border-color: var(--stamp); }
.btn.armed { background: var(--stamp); border-color: var(--stamp); color: var(--paper); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.small { padding: 6px 13px; font-size: 11px; }
.btn.big { padding: 14px 24px; font-size: 12.5px; }
.linkbtn { appearance: none; border: 0; background: none; color: var(--ink); cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; font-size: inherit; }

/* --- commande --- */
.order { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r); display: flex; flex-direction: column; min-width: 0; }
.order-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px 24px; padding: 18px 20px; border-bottom: 1px dashed var(--rule); }
.order-head > div:first-child { display: flex; flex-direction: column; gap: 6px; }
.order-head h3 { font-size: clamp(26px, 2.6vw, 34px); }
.order-head .figs { display: flex; gap: 28px; flex-wrap: wrap; }
.fig { display: flex; flex-direction: column; gap: 5px; }
.fig b { font-size: 24px; font-weight: 500; font-variant-numeric: tabular-nums; line-height: 1; }
.tbl-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th { text-align: left; text-transform: uppercase; letter-spacing: .03em; font-size: 10.5px; font-weight: 500; color: var(--ink-2); padding: 10px 12px; border-bottom: 1px dashed var(--rule-strong); white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px dashed var(--rule); vertical-align: middle; }
td.r, th.r { text-align: right; }
tr:last-child td { border-bottom: 0; }
.pname { font-weight: 500; min-width: 180px; text-transform: uppercase; font-size: 13.5px; line-height: 1.15; }
.pname .muted, .pname div { text-transform: none; font-weight: 400; }
.people { display: flex; flex-wrap: wrap; gap: 4px; }
.person { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--rule); border-radius: 999px; padding: 1px 5px 1px 3px; font-size: 12.5px; white-space: nowrap; }
.person img { width: 18px; height: 18px; border-radius: 50%; }
.person b { font-weight: 500; font-variant-numeric: tabular-nums; }
.person button { appearance: none; border: 0; background: none; cursor: pointer; color: var(--ink-2); padding: 0 3px; font-size: 13px; line-height: 1; }
.person button.armed { color: var(--stamp); font-weight: 600; }
.order-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px 22px; padding: 18px 20px; border-top: 1px dashed var(--rule); align-items: end; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field input, .field textarea, .field select { border: 0; border-bottom: 1px solid var(--rule-strong); border-radius: 0; background: transparent; padding: 6px 2px; width: 100%; }
.field textarea { resize: vertical; min-height: 38px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.order-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 16px 20px; border-top: 1px dashed var(--rule); }
.order-actions .spacer { flex: 1; }
.warnline { color: var(--warn); font-size: 13px; }

/* --- aperçu du bon (reproduit la feuille Excel de l'administration) --- */
.sheet-wrap { overflow-x: auto; padding: 22px; background: var(--paper); border-top: 1px dashed var(--rule); }
.bon { width: 760px; margin: 0 auto; background: var(--form-bg); color: var(--form-ink); font-family: var(--font-form); font-size: 11px; padding: 26px 30px 34px; border-radius: 2px; }
.bon .b-top { display: grid; grid-template-columns: 170px 1fr; align-items: end; gap: 10px; }
.bon .b-top img { width: 150px; }
.bon .b-dept { font-weight: 700; font-size: 15px; text-align: center; border-bottom: 2px solid var(--form-ink); padding-bottom: 6px; }
.bon .b-title { text-align: center; font-weight: 700; text-decoration: underline; font-size: 12.5px; margin: 16px 0 18px; }
.bon .b-ids { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
.bon .b-ids div { display: grid; grid-template-columns: 150px 1fr; gap: 2px 6px; align-content: start; }
.bon .b-ids h5 { grid-column: 1 / -1; margin: 0 0 3px; font-size: 12px; text-decoration: underline double; }
.bon .b-ids span:nth-child(odd):not(h5) { white-space: nowrap; }
.bon .b-ids .v { font-weight: 400; min-height: 1em; }
.bon .b-ids .miss { color: #b3312a; }
.bon .b-req { font-weight: 700; margin: 6px 0 14px; }
.bon table { font-size: 10.5px; border: 1px solid var(--form-ink); margin-top: 10px; }
.bon th { font-family: var(--font-form); text-transform: none; letter-spacing: 0; color: var(--form-ink); font-size: 10.5px; font-weight: 700; text-align: center; border: 1px solid var(--form-ink); padding: 3px 4px; white-space: normal; }
.bon td { border: 1px solid var(--form-ink); padding: 2px 4px; }
.bon tr:last-child td { border-bottom: 1px solid var(--form-ink); }
.bon td.nb { border: 0; }
.bon td.tl { border: 0; text-align: right; font-weight: 700; white-space: nowrap; }
.bon .b-box { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; margin-top: 18px; }
.bon .yellow { background: var(--form-yellow); border: 2px solid var(--form-ink); min-height: 18px; padding: 1px 6px; text-align: center; }
.bon .b-foot { text-align: right; font-size: 7px; margin-top: 26px; color: #444; }

/* --- historique / réglages --- */
.hist { display: flex; flex-direction: column; gap: 12px; }
.hrow { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r); }
.hrow summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; padding: 14px 18px; }
.hrow summary::-webkit-details-marker { display: none; }
.hrow summary h4 { font-size: 22px; }
.hrow summary .grow { flex: 1; }
.hrow[open] summary { border-bottom: 1px dashed var(--rule); }
.stamp { text-transform: uppercase; letter-spacing: .08em; font-weight: 600; font-size: 11px; color: var(--stamp); border: 1.5px solid var(--stamp); border-radius: 3px; padding: 1px 6px; transform: rotate(-3deg); }
.stamp.import { color: var(--ink-2); border-color: var(--rule-strong); transform: none; }
.hrow .acts { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px 18px; border-top: 1px dashed var(--rule); }
.settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 18px; align-items: start; }
.panel { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r); padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.panel h3 { font-size: 24px; }
.panel p { margin: 0; color: var(--ink-2); font-size: 14px; }
.panel.wide { grid-column: 1 / -1; }
.cols2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px 22px; }
.req::after { content: " *"; color: var(--stamp); }
.prod-tbl input[type="number"] { width: 92px; border: 0; border-bottom: 1px solid var(--rule-strong); border-radius: 0; padding: 4px 2px; background: transparent; font-variant-numeric: tabular-nums; text-align: right; }
.prod-tbl select { border: 0; border-bottom: 1px solid var(--rule-strong); border-radius: 0; background: transparent; padding: 3px 2px; }
.prod-tbl .tva { width: 64px; }
.prod-tbl td { padding: 6px 10px; }
.tag { text-transform: uppercase; letter-spacing: .04em; font-size: 10.5px; font-weight: 500; color: var(--ink-2); }

.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--paper); padding: 10px 18px; border-radius: 999px; font-size: 13.5px; font-weight: 500; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100% - 32px); z-index: 40; }
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* --- badges, notes --- */
.badges { display: flex; flex-wrap: wrap; gap: 4px; }
.badge { font-size: 10px; line-height: 1.2; text-transform: uppercase; letter-spacing: .03em; font-weight: 500; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--rule-strong); color: var(--ink-2); }
.badge.hab { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.badge.une { border-color: var(--capsule); color: var(--capsule); }
.badge.decaf { border-color: var(--coffee); color: var(--coffee); }
.badge.alert { border-color: var(--stamp); color: var(--stamp); }
.notes { margin: 0; font-size: 13px; color: var(--ink-2); }
.notes .label { font-size: 10px; margin-right: 4px; }
.card.oos { opacity: .7; }
.look-panel { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.look-panel > div:first-child { flex: 1 1 320px; display: flex; flex-direction: column; gap: 6px; }
#prod-q { max-width: 340px; }

/* --- panneau Apparence --- */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(400px, 100%); z-index: 30; background: var(--sheet); color: var(--ink); border-left: 1px dashed var(--rule-strong); display: flex; flex-direction: column; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); padding-right: env(safe-area-inset-right, 0px); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px dashed var(--rule); }
.drawer-head h2 { font-size: 26px; }
.iconbtn { appearance: none; border: 1px solid var(--rule-strong); background: transparent; border-radius: 50%; width: 34px; height: 34px; font-size: 19px; line-height: 1; cursor: pointer; color: var(--ink); }
.drawer-body { flex: 1; overflow-y: auto; padding: 6px 20px 20px; display: flex; flex-direction: column; }
.dsec { display: flex; flex-direction: column; gap: 9px; padding: 15px 0; border-bottom: 1px dashed var(--rule); }
.dsec:last-child { border-bottom: 0; }
.dsec output { font-variant-numeric: tabular-nums; text-transform: none; letter-spacing: 0; float: right; color: var(--ink); }
.dsec input[type="range"] { width: 100%; accent-color: var(--accent); }
.drawer-foot { display: flex; align-items: center; gap: 8px; padding: 12px 20px; border-top: 1px dashed var(--rule); }
.drawer-foot .spacer { flex: 1; }
.drawer-foot #look-state { font-size: 12px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.sw.fond { appearance: none; cursor: pointer; display: grid; grid-template-columns: repeat(3, 14px); grid-template-rows: 14px auto; gap: 4px 0; padding: 7px; border: 1px solid var(--rule-strong); border-radius: 8px; background: transparent; color: var(--ink); }
.sw.fond i { display: block; width: 14px; height: 14px; border: 1px solid var(--rule); }
.sw.fond span { grid-column: 1 / -1; font-size: 10.5px; text-transform: uppercase; letter-spacing: .03em; text-align: left; }
.sw[aria-pressed="true"], .fontopt[aria-pressed="true"] { border-color: var(--ink); outline: 1px solid var(--ink); outline-offset: 1px; }
.dot { appearance: none; cursor: pointer; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--sheet); box-shadow: 0 0 0 1px var(--rule-strong); }
.dot[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--ink); }
.dot.same { background-image: linear-gradient(135deg, transparent 45%, var(--sheet) 46%, var(--sheet) 54%, transparent 55%); }
.picker { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; cursor: pointer; }
.picker input { width: 34px; height: 30px; padding: 0; border: 1px solid var(--rule-strong); border-radius: 8px; background: none; cursor: pointer; }
.fonts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fontopt { appearance: none; cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 3px; padding: 9px 10px; border: 1px solid var(--rule-strong); border-radius: 8px; background: transparent; color: var(--ink); }
.fontopt b { font-size: 18px; line-height: 1.1; }
.fontopt small { font-size: 11px; color: var(--ink-2); }
.seg { display: flex; border: 1px solid var(--rule-strong); border-radius: 999px; overflow: hidden; }
.seg button { appearance: none; flex: 1; border: 0; background: transparent; color: var(--ink); padding: 7px 8px; cursor: pointer; font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .02em; }
.seg button + button { border-left: 1px solid var(--rule-strong); }
.seg button[aria-checked="true"] { background: var(--accent); color: var(--accent-ink); }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; }
@media (min-width: 980px) { body.drawer-open { padding-right: 400px; } }

/* --- vue liste et éléments masqués --- */
body.vue-liste .grid { grid-template-columns: 1fr; gap: calc(var(--gap) * .5); }
body.vue-liste .card { flex-direction: row; flex-wrap: wrap; align-items: center; }
body.vue-liste .card-top { padding: var(--pad-y) 0 var(--pad-y) var(--pad-x); }
body.vue-liste .card-photo { width: 92px; height: 58px; padding: 6px 0 6px 12px; background: none; flex: none; }
body.vue-liste .card-photo img { max-width: 100%; }
body.vue-liste .card-top .label, body.vue-liste .desc, body.vue-liste .notes { display: none; }
body.vue-liste .card-body { flex: 1 1 360px; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 16px; padding: var(--pad-y) var(--pad-x); min-width: 0; }
body.vue-liste .card h4 { flex: 0 1 auto; font-size: 17px; }
body.vue-liste .meta { margin: 0; padding: 0; border-top: 0; flex: 1 1 260px; justify-content: flex-end; }
body.vue-liste .card-foot { border-top: 0; padding: var(--pad-y) var(--pad-x); flex: 0 0 auto; }
body.sans-desc .desc, body.sans-notes .notes, body.sans-badges .badges, body.sans-intensite .meter, body.sans-prix .pr { display: none; }

/* --- souhaits --- */
.wish-grid { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 24px; align-items: start; }
.wish-side { position: sticky; top: calc(env(safe-area-inset-top, 0px) + var(--hdr-h) + 16px); min-width: 0; }
.wish-form { display: flex; flex-direction: column; gap: 16px; }
.wish-form .row2 { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 16px; }
.wish-list { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.wish { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r); padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.wish.st-refuse { opacity: .62; }
.wish-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.wish-head h4 { font-size: 20px; line-height: 1; flex: 1 1 220px; min-width: 0; overflow-wrap: anywhere; }
.wish-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: 13px; color: var(--ink-2); }
.wish-note { margin: 0; font-size: 14.5px; line-height: 1.45; overflow-wrap: anywhere; }
.wish-acts .linkbtn { font-size: 12.5px; }
.wish-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 10px; border-top: 1px dashed var(--rule); }
.pill { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; font-weight: 500; padding: 3px 9px; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap; }
.pill.nouveau { color: var(--capsule); }
.pill.retenu { color: var(--ok); }
.pill.commande { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pill.refuse { color: var(--ink-2); }
@media (max-width: 860px) { .wish-grid { grid-template-columns: minmax(0, 1fr); } .wish-side { position: static; } }

/* --- accueil : la capsule à la une --- */
.home { position: relative; --stage-h: calc(100svh - env(safe-area-inset-top, 0px) - var(--hdr-h)); }
.glow { background: radial-gradient(50% 44% at 50% 60%, color-mix(in srgb, var(--ink) 9%, transparent), transparent 100%); }
.cap { margin: 0; min-width: 0; display: grid; place-items: center; }
.cap img { display: block; max-width: 100%; height: auto; }
.cap-reveal { grid-column: 2; grid-row: 1; justify-self: stretch; aspect-ratio: 4 / 3; }
.cap-reveal img { width: min(84%, 360px); }
.cap-fiche { grid-column: 1; grid-row: 1; justify-self: stretch; aspect-ratio: 4 / 3; }
.cap-fiche img { width: min(72%, 330px); }

/* carrousel : une photo de capsule détourée à la fois, sans défilement automatique */
.carousel { grid-column: 2; grid-row: 1; align-self: center; display: flex; flex-direction: column; align-items: center; gap: 16px; min-width: 0; }
.car-stage { position: relative; width: 100%; max-width: 540px; aspect-ratio: 16 / 10; display: grid; place-items: center; touch-action: pan-y; }
.car-img { grid-area: 1 / 1; width: min(70%, 340px); height: auto; opacity: 0; transition: opacity .35s ease; }
.car-img.on { opacity: 1; }
.car-bar { display: flex; align-items: center; gap: 14px; }
.car-arrow { appearance: none; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--rule-strong); background: transparent; color: var(--ink); cursor: pointer; font-size: 16px; line-height: 1; }
.car-arrow:hover { border-color: var(--ink); }
.car-count { min-width: 64px; text-align: center; font-size: 12px; font-weight: 500; letter-spacing: .04em; }
.car-thumbs { display: flex; gap: 4px; max-width: 100%; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.car-thumb { appearance: none; flex: none; width: 52px; height: 40px; padding: 5px; border: 1px solid transparent; border-radius: 8px; background: transparent; cursor: pointer; display: grid; place-items: center; opacity: .5; transition: opacity .15s; }
.car-thumb img { max-width: 100%; max-height: 100%; width: auto; height: auto; }
.car-thumb:hover { opacity: .9; }
.car-thumb[aria-current="true"] { opacity: 1; border-color: var(--rule-strong); }
.h-sec { position: relative; min-height: var(--stage-h); padding-left: max(var(--gutter), env(safe-area-inset-left, 0px)); padding-right: max(var(--gutter), env(safe-area-inset-right, 0px)); padding-block: 32px; scroll-margin-top: calc(env(safe-area-inset-top, 0px) + var(--hdr-h)); }
.kicker { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .02em; }
.kicker .hot { color: var(--capsule); }
.lead { margin: 0; font-size: clamp(21px, 2.1vw, 29px); line-height: 1.26; font-weight: 400; }
.credit { margin: 0; color: var(--ember); font-size: 11px; text-transform: uppercase; letter-spacing: .03em; font-weight: 500; }

.hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); grid-template-rows: 1fr auto; gap: 28px 32px; padding-right: max(calc(var(--gutter) + 26px), env(safe-area-inset-right, 0px)); }
.hero-main { grid-column: 1; grid-row: 1; align-self: center; display: flex; flex-direction: column; gap: 22px; }
.hero-word { font-size: max(44px, min(232px, 15vw, calc(47vw / (var(--lw, 6) * .68)))); line-height: .86; margin-left: -.04em; overflow-wrap: anywhere; }
.hero-main .lead { max-width: 21ch; }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.info { grid-column: 1; grid-row: 2; align-self: end; max-width: 440px; border-radius: var(--r); background: color-mix(in srgb, var(--ink) 5%, transparent); border: 1px solid var(--rule); padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.info h3 { font-size: 15px; line-height: 1.05; }
.info p { margin: 0; font-size: 14.5px; line-height: 1.45; color: var(--ink-2); }
.tagcard { grid-column: 2; grid-row: 2; justify-self: end; align-self: end; display: flex; flex-direction: column; gap: 10px; min-width: 220px; border-radius: var(--r); border: 1px solid var(--rule); padding: 14px 16px; background: color-mix(in srgb, var(--ink) 5%, transparent); }
.tagcard .row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.tagcard b { font-size: 22px; font-weight: 500; font-variant-numeric: tabular-nums; }
.tagcard .state { font-size: 12px; color: var(--ink-2); }
.vlabel { position: absolute; right: max(10px, env(safe-area-inset-right, 0px)); top: 50%; transform: translateY(-50%); writing-mode: vertical-rl; font-size: 10.5px; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); white-space: nowrap; }

.reveal { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1fr); align-items: center; gap: 18px; }
.reveal h2 { grid-column: 1; grid-row: 1; font-size: clamp(36px, 3.9vw, 60px); line-height: .9; }
.reveal .body { grid-column: 3; grid-row: 1; display: flex; flex-direction: column; gap: 20px; }

.fiche { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 24px; }
.fiche-data { grid-column: 2; grid-row: 1; display: flex; flex-direction: column; gap: 20px; max-width: 620px; }
.fiche-data h2 { font-size: clamp(32px, 3.3vw, 50px); }
.spec { display: grid; grid-template-columns: minmax(110px, .75fr) minmax(0, 1.5fr); margin: 0; }
.spec dt, .spec dd { margin: 0; padding: 11px 0; border-top: 1px dashed var(--rule); }
.spec dt { font-size: 11px; text-transform: uppercase; letter-spacing: .03em; font-weight: 500; color: var(--ink-2); padding-top: 13px; }
.spec dd { font-size: 15px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; min-width: 0; }
.bars { display: grid; grid-template-columns: repeat(5, 30px); gap: 4px; }
.bars i { height: 3px; background: var(--rule); }
.bars i.on { background: var(--ink); }
.spec .notches i.on { background: var(--capsule); }
.buy { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.buy .state { font-size: 13px; color: var(--ink-2); flex: 1 1 160px; }

.etat { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-content: end; gap: 24px 48px; padding-bottom: 56px; }
.etat h2 { font-size: clamp(36px, 3.9vw, 60px); line-height: .9; }
.etat-head { display: flex; flex-direction: column; gap: 18px; }
.sumlist { display: flex; flex-direction: column; }
.sumrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 18px; padding: 14px 0; border-top: 1px dashed var(--rule); align-items: baseline; }
.sumrow b { font-size: 21px; font-weight: 500; text-transform: uppercase; }
.sumrow span { font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; text-align: right; }
.sumrow.une b { color: var(--capsule); }
.etat-acts { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 16px; border-top: 1px dashed var(--rule); }

@media (max-width: 760px) {
  .h-sec { min-height: 0; padding-block: 26px 36px; }
  .hero, .reveal, .fiche, .etat { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .hero { padding-right: max(var(--gutter), env(safe-area-inset-right, 0px)); padding-top: 4px; }
  .hero-main, .info, .tagcard, .reveal h2, .reveal .body, .fiche-data, .cap, .carousel { grid-column: 1; grid-row: auto; }
  .carousel { order: -1; }
  .cap-reveal { aspect-ratio: auto; padding-block: 12px; }
  .cap-fiche { display: none; }
  .tagcard { justify-self: stretch; min-width: 0; }
  .hero-word { font-size: max(40px, min(25vw, calc(88vw / (var(--lw, 6) * .68)))); }
  .vlabel { display: none; }
  .intro { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .brand h1 { font-size: 15px; }
  .right { margin-left: 0; width: 100%; }
  .tabs { flex: 1; }
  .who { display: none; }
  .order-head, .order-form, .order-actions { padding-inline: 14px; }
  .spec { grid-template-columns: minmax(96px, .7fr) minmax(0, 1.5fr); }
}
@media (prefers-reduced-motion: reduce) { .toast, .card, .car-img, .car-thumb { transition: none; } }
