/* Fidélité Docteur Smoke — mobile d'abord. Les couleurs de marque viennent de /theme.css. */
:root {
  --primary: #123d2f;
  --on-primary: #ffffff;
  --accent: #c8f169;
  --on-accent: #111814;
  --bg: #f5f2ea;
  --card: #ffffff;
  --ink: #14201b;
  --muted: #5f6b66;
  --line: #e7e2d7;
  --soft: #efece4;
  --danger: #b42318;
  --success: #1f7a4d;
  --radius: 18px;
  --shadow: 0 1px 0 rgba(20, 32, 27, 0.04), 0 10px 26px -18px rgba(20, 32, 27, 0.35);
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 16px/1.45 var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { max-width: 100%; }
code { font-family: var(--mono); font-size: 0.9em; }

.wrap { max-width: 560px; margin: 0 auto; padding: 16px 16px 28px; }
.wrap-wide { max-width: 980px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.link-muted { color: var(--muted); }

h1 { font-size: 30px; line-height: 1.1; margin: 0 0 10px; letter-spacing: -0.02em; }
h2 { font-size: 18px; line-height: 1.25; margin: 0 0 12px; }

/* --- Barre du haut ---------------------------------------------------------------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(env(safe-area-inset-top) + 12px) 16px 12px;
  background: var(--primary); color: var(--on-primary);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; font-size: 15px; }
.brand img { border-radius: 50%; }
.topbar .back { font-size: 17px; font-weight: 700; text-decoration: none; padding: 4px 2px; }
.staff-nav { display: flex; align-items: center; gap: 14px; font-size: 14px; }
.staff-nav a { text-decoration: none; font-weight: 600; }
.staff-nav form { margin: 0; }
.linklike { background: none; border: 0; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; padding: 0; }
.topbar .muted { color: inherit; opacity: 0.75; }

/* --- Blocs --------------------------------------------------------------------- */
.panel { background: var(--card); border-radius: var(--radius); padding: 18px; margin: 14px 0; box-shadow: var(--shadow); }
.hero { padding: 22px 2px 6px; text-align: center; }
.hero-logo { display: block; width: min(210px, 58vw); height: auto; margin: 0 auto 14px; }
.hero + .perks { justify-content: center; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-size: 12px; font-weight: 700; color: var(--muted); margin: 0 0 8px; }
.lead { font-size: 17px; color: var(--muted); margin: 0 0 20px; }
.perks { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.perks li { background: var(--card); border-radius: 999px; padding: 8px 14px; font-size: 14px; box-shadow: var(--shadow); }
.plain { margin: 0; padding-left: 18px; }

/* --- Boutons ------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 14px; padding: 12px 18px; min-height: 48px;
  font: 650 16px/1.2 var(--font); text-decoration: none; cursor: pointer; text-align: center;
  transition: transform 0.06s ease, opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.6; }
.btn-accent { background: var(--accent); color: var(--on-accent); }
.btn-dark { background: var(--primary); color: var(--on-primary); }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-light { background: #fff; color: #111; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-disabled { background: var(--soft); color: #9aa19d; cursor: not-allowed; }
.btn-block { display: flex; width: 100%; margin: 10px 0; }
.btn-lg { min-height: 56px; font-size: 17px; border-radius: 16px; }
.btn-xl { min-height: 74px; font-size: 20px; border-radius: 18px; }
.btn-small { min-height: 34px; padding: 6px 12px; font-size: 14px; border-radius: 10px; }
.btn small { display: block; font-weight: 500; opacity: 0.75; font-size: 13px; }

/* --- Formulaires ---------------------------------------------------------------- */
.form h1 { font-size: 26px; }
.field { display: block; margin: 0 0 14px; }
.field > span { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.field small { display: block; color: var(--muted); font-size: 13px; margin-top: 6px; }
input, select, textarea {
  width: 100%; font: 16px var(--font); color: var(--ink);
  padding: 12px 14px; min-height: 50px; border-radius: 12px;
  border: 1.5px solid var(--line); background: #fff;
}
textarea { min-height: 104px; line-height: 1.4; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(18, 61, 47, 0.15); }
fieldset.field { border: 0; padding: 0; min-width: 0; }
fieldset.field > legend { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; padding: 0; }

/* Choix sous forme de cartes (boutique, destinataires) */
.options { display: grid; gap: 8px; }
.option { position: relative; display: block; cursor: pointer; }
.option input { position: absolute; left: 14px; top: 50%; width: 1px; height: 1px; min-height: 0; margin: 0; padding: 0; border: 0; opacity: 0; }
.option > span {
  display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 12px 14px;
  border-radius: 12px; border: 1.5px solid var(--line); background: #fff; font-weight: 600;
}
.option > span::before { content: ''; flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid #c9c3b6; background: #fff; }
.option input:checked + span { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent); }
.option input:checked + span::before { border-color: var(--primary); background: radial-gradient(circle, var(--primary) 0 42%, #fff 46%); }
.option input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.option small { margin-left: auto; font-weight: 500; color: var(--muted); font-size: 13px; text-align: right; }
@media (min-width: 520px) { .options-inline { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } }

/* Boutique de la caisse : choisie une fois par téléphone, rappelée (cochée) dans chaque formulaire */
.shop-chips { margin: 0 0 14px; }
.pills { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.pill { position: relative; display: block; cursor: pointer; }
.pill input {
  position: absolute; clip-path: inset(50%); overflow: hidden; white-space: nowrap;
  width: 1px; height: 1px; min-height: 0; margin: -1px; padding: 0; border: 0;
}
.pill > span {
  display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 8px 12px;
  border-radius: 999px; border: 1.5px solid var(--line); background: #fff; font-weight: 700; text-align: center;
}
.pill input:checked + span { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.pill input:checked + span::before { content: '✓'; }
.pill input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.field-error { display: none; align-items: center; gap: 6px; margin: 8px 0 0; color: var(--danger); font-size: 14px; font-weight: 600; }
/* Rien de coché et le vendeur valide : en rouge, avec le message (deux règles : un navigateur qui
   ne connaît pas :user-invalid ignore la première, la seconde suit la classe posée par caisse.js). */
.shop-chips:has(input:user-invalid) .field-error { display: flex; }
.shop-chips:has(input:user-invalid) .pill > span { border-color: var(--danger); background: #fde8e6; }
.shop-chips.is-invalid .field-error { display: flex; }
.shop-chips.is-invalid .pill > span { border-color: var(--danger); background: #fde8e6; }
.caisse-where h2 { margin-bottom: 4px; }
.where-buttons { display: grid; gap: 8px; margin-top: 12px; }
.where-buttons .btn-block { margin: 0; }
.caisse-shop { margin: 0 0 12px; }
.caisse-shop > summary { cursor: pointer; padding: 6px 2px; font-size: 15px; }
.caisse-shop .where-buttons { margin-top: 4px; }
input[type='color'] { padding: 4px; }
input[type='date'] { -webkit-appearance: none; appearance: none; }
.input-xl { font-size: 34px; font-weight: 800; text-align: center; letter-spacing: -0.01em; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 14px; font-size: 14px; line-height: 1.4; }
.check input { width: 22px; height: 22px; min-height: 0; flex: none; margin: 1px 0 0; padding: 0; accent-color: var(--primary); }
.points-preview { text-align: center; font-size: 20px; font-weight: 800; min-height: 28px; margin: 0 0 4px; color: var(--primary); }
.row2 { display: grid; grid-template-columns: 1fr; gap: 0 14px; }
.search-form .field > span { font-weight: 500; color: var(--muted); }
.search-inline { display: flex; gap: 8px; margin: 0 0 10px; }
.search-inline input { flex: 1; }
.inline { margin: 0; }

.flash { border-radius: 12px; padding: 12px 14px; margin: 0 0 14px; font-size: 15px; }
.flash-error { background: #fde8e6; color: #8a1c12; }
.flash-success { background: #e3f4ea; color: #14532d; }
.flash-info { background: #eef3df; color: #2f3d12; }
.flash ul { margin: 6px 0 0; padding-left: 18px; }

/* --- Carte de fidélité ---------------------------------------------------------- */
.card-body { background: linear-gradient(180deg, var(--primary) 0, var(--primary) 210px, var(--bg) 210px); }
.card-wrap { padding-top: calc(env(safe-area-inset-top) + 14px); }
.loyalty-card {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  aspect-ratio: 1.586; border-radius: 24px; padding: 20px 22px;
  color: var(--on-primary);
  background: var(--primary);
  background:
    radial-gradient(110% 120% at 100% 0%, color-mix(in srgb, var(--accent) 38%, transparent) 0%, transparent 46%),
    linear-gradient(140deg, color-mix(in srgb, var(--primary) 80%, #ffffff) 0%, var(--primary) 52%, color-mix(in srgb, var(--primary) 70%, #000000) 100%);
  box-shadow: 0 22px 44px -20px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.loyalty-card::after {
  content: ''; position: absolute; inset: auto -40px -70px auto; width: 220px; height: 220px; border-radius: 50%;
  border: 26px solid rgba(255, 255, 255, 0.05); pointer-events: none;
}
.lc-top { display: flex; align-items: center; gap: 10px; }
.lc-top img { border-radius: 50%; }
.lc-shop { font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; font-size: 14px; }
.lc-tag { margin-left: auto; font-size: 11px; text-transform: uppercase; letter-spacing: 0.16em; opacity: 0.75; }
.lc-points { display: flex; align-items: baseline; gap: 8px; }
.lc-number { font-size: 68px; font-weight: 800; line-height: 1; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.lc-unit { font-size: 18px; opacity: 0.85; }
.lc-bottom { display: flex; justify-content: space-between; align-items: center; font-size: 15px; }
.lc-name { font-weight: 700; }
.lc-code { font-family: var(--mono); letter-spacing: 0.12em; opacity: 0.85; }
.bump { animation: bump 0.7s ease; }
@keyframes bump { 0% { transform: scale(1); } 35% { transform: scale(1.18); } 100% { transform: scale(1); } }

.qr-box { background: #fff; border-radius: 20px; padding: 18px 18px 12px; margin: 14px 0; text-align: center; box-shadow: var(--shadow); }
.qr-box svg { display: block; width: min(250px, 68vw); height: auto; margin: 0 auto; }
.qr-box p { margin: 10px 0 0; font-size: 14px; color: var(--muted); font-weight: 600; }
.qr-big svg { width: min(320px, 80vw); }
.next { font-weight: 700; margin: 0 0 10px; }
progress { display: block; width: 100%; height: 12px; border: 0; border-radius: 999px; overflow: hidden; -webkit-appearance: none; appearance: none; background: var(--soft); }
progress::-webkit-progress-bar { background: var(--soft); border-radius: 999px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 999px; transition: width 0.6s ease; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
.birthday { background: #fff4d6; }

/* Message de la boutique en haut de la carte */
.notice { position: relative; background: #fffbea; box-shadow: inset 0 0 0 1.5px #efe0a0, var(--shadow); }
.notice h2 { margin: 0 0 4px; padding-right: 30px; }
.notice-kicker { margin: 0 0 6px; padding-right: 30px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.notice-body { margin: 0; overflow-wrap: anywhere; }
.tip { background: #fffbea; box-shadow: inset 0 0 0 1.5px #efe0a0, var(--shadow); }
.tip p { margin: 0 0 10px; font-size: 15px; }
.notice-close {
  position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: transparent; color: var(--muted); font-size: 24px; line-height: 1; cursor: pointer;
}
.steps { margin: 0 0 12px; padding-left: 20px; }
.steps li { margin: 4px 0; }

.rewards { list-style: none; margin: 0; padding: 0; }
.reward { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.reward:first-child { border-top: 0; padding-top: 2px; }
.chip { flex: none; min-width: 66px; text-align: center; font-weight: 800; font-size: 14px; padding: 6px 10px; border-radius: 999px; background: var(--soft); }
.reward.is-ok .chip { background: var(--accent); color: var(--on-accent); }
.r-name { flex: 1; font-weight: 600; }
.r-name small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }
.r-status { font-size: 13px; color: var(--muted); white-space: nowrap; }
.reward.is-ok .r-status { color: var(--success); font-weight: 700; }

.history, .ops { list-style: none; margin: 0; padding: 0; }
.history li, .ops li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.history li:first-child, .ops li:first-child { border-top: 0; padding-top: 2px; }
.history li > :first-child, .ops li > :first-child { font-weight: 600; text-decoration: none; }
.h-date { grid-column: 1; font-size: 13px; color: var(--muted); }
.h-pts { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-weight: 800; font-variant-numeric: tabular-nums; }
.h-pts.plus { color: var(--success); }
.h-pts.minus { color: var(--danger); }
.ops li form { grid-column: 1 / -1; }
.is-reversed > :first-child { text-decoration: line-through; opacity: 0.6; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: #111; color: #fff; padding: 12px 20px; border-radius: 999px; font-weight: 700; z-index: 60;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); max-width: 90vw; text-align: center; animation: toast-in 0.25s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* --- Caisse ---------------------------------------------------------------------- */
.client-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 2px 6px; }
.client-head h1 { margin: 0; }
.client-head p { margin: 4px 0 0; }
.balance { text-align: right; }
.balance span { display: block; font-size: 46px; font-weight: 800; line-height: 1; color: var(--primary); font-variant-numeric: tabular-nums; }
.balance small { color: var(--muted); }
.reward-actions { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.reward-actions .btn { flex-direction: column; align-items: flex-start; text-align: left; margin: 0; padding: 12px 16px; }
.result { padding: 26px 18px; }
.result-icon { width: 68px; height: 68px; border-radius: 50%; margin: 0 auto 12px; display: grid; place-items: center; font-size: 34px; font-weight: 800; background: var(--accent); color: var(--on-accent); }
.result.is-reversed .result-icon { background: var(--soft); color: var(--ink); }
.big-balance { font-size: 20px; margin: 10px 0 4px; }

.scanner {
  position: fixed; inset: 0; z-index: 50; background: #000;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
}
.scanner video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan-frame { position: absolute; top: 45%; left: 50%; width: min(72vw, 300px); aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 26px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5); outline: 3px solid var(--accent); }
.scan-status { position: relative; color: #fff; font-weight: 650; text-align: center; margin: 0 0 14px; text-shadow: 0 1px 4px #000; max-width: 360px; }
.scan-cancel { position: relative; width: 100%; max-width: 360px; }

/* --- Gestion ---------------------------------------------------------------------- */
.tabs { display: flex; gap: 4px; overflow-x: auto; padding: 8px 12px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.tabs a { white-space: nowrap; text-decoration: none; padding: 8px 12px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--muted); }
.tabs a.is-active { background: var(--primary); color: var(--on-primary); }
.admin h1 { font-size: 26px; margin-top: 6px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 14px 0; }
.tile { background: #fff; border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); }
.tile-v { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.tile-l { font-weight: 600; color: var(--muted); font-size: 14px; }
.tile small { color: var(--muted); font-size: 12px; }
.quick { display: flex; flex-wrap: wrap; gap: 10px; }
.table-wrap { overflow-x: auto; background: #fff; border-radius: 16px; box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.table th { font-size: 13px; color: var(--muted); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* Tableau de bord par boutique : onglets Toutes / Cannes / Le Suquet et comparaison */
.segmented {
  display: flex; gap: 4px; padding: 4px; margin: 4px 0 0; width: fit-content; max-width: 100%;
  overflow-x: auto; background: #e9e5da; border-radius: 14px;
}
.segmented a {
  flex: none; padding: 8px 16px; border-radius: 10px; white-space: nowrap;
  text-decoration: none; font-weight: 700; font-size: 15px; color: var(--muted);
}
.segmented a[aria-current='page'] { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.segmented a:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
/* Clients par boutique choisie : Tous / Cannes / Le Suquet / Les deux, avec leur nombre */
.segment-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin: 0 0 14px; }
.segment-grid a {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-height: 48px; padding: 12px 14px;
  border-radius: 14px; background: var(--card); box-shadow: var(--shadow); color: var(--ink); font-weight: 700; text-decoration: none;
}
.segment-grid b { font-size: 20px; font-variant-numeric: tabular-nums; }
.segment-grid a[aria-current='page'] { background: var(--ink); color: #fff; }
.segment-grid a:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.panel .segment-grid a { background: var(--soft); box-shadow: none; }
.panel .segment-grid { margin-bottom: 10px; }
.panel .compare-wrap { box-shadow: none; border-radius: 0; }
.compare { border-collapse: separate; border-spacing: 0; }
.compare caption { caption-side: top; text-align: left; padding: 0 0 6px; font-size: 13px; color: var(--muted); }
.compare th, .compare td { padding: 9px 8px; }
.compare thead th a { color: var(--ink); font-weight: 800; font-size: 15px; text-decoration: none; }
/* Libellé de la ligne figé à gauche si le tableau défile (beaucoup de boutiques). */
.compare tbody th { position: sticky; inset-inline-start: 0; z-index: 1; background: #fff; font-size: 14px; font-weight: 600; }
.compare td.num { font-weight: 700; }
.compare tbody tr:last-child > * { border-bottom: 0; }
.pager { display: flex; justify-content: space-between; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0 0 12px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }
.reward-form.is-off { opacity: 0.6; }

/* Gestion › Messages */
.char-count { float: right; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.char-count.is-full { color: var(--danger); }
.audience { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 6px; padding: 0; list-style: none; }
.audience li { background: var(--soft); border-radius: 999px; padding: 6px 12px; font-size: 14px; }
.preview-label { margin: 18px 0 8px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.preview-label:first-child { margin-top: 0; }
.notif {
  display: grid; grid-template-columns: 38px 1fr; gap: 2px 10px; align-items: start;
  max-width: 400px; padding: 12px 14px; border-radius: 20px; background: #f1f1f3; color: #1c1c1e;
  box-shadow: 0 10px 26px -16px rgba(0, 0, 0, 0.45); font-size: 15px; line-height: 1.3;
}
.notif img { grid-row: 1 / span 3; width: 38px; height: 38px; border-radius: 9px; }
.notif-app { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: #6c6c70; }
.notif-title { font-weight: 700; overflow-wrap: anywhere; }
.notif-body { overflow-wrap: anywhere; }
.notice-preview { max-width: 400px; margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }
.actions form { margin: 0; }
.status-chip { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--soft); color: var(--muted); }
.status-chip.is-sent { background: #e3f4ea; color: #14532d; }
.status-chip.is-sending { background: #fff4c2; color: #4a3b00; }
.send-progress progress { height: 14px; margin: 10px 0 6px; }
.msg-list { list-style: none; margin: 0; padding: 0; }
.msg-list li { display: grid; gap: 4px; padding: 12px 0; border-top: 1px solid var(--line); }
.msg-list li:first-child { border-top: 0; padding-top: 2px; }
.msg-list a { font-weight: 700; text-decoration: none; overflow-wrap: anywhere; }
.msg-excerpt { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.msg-meta { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; font-size: 13px; color: var(--muted); }
.shop-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.shop-row:first-of-type { border-top: 0; }
.shop-row input, .shop-row select { flex: 1 1 230px; min-width: 0; }
.shop-row .btn { flex: none; }
.danger-zone { box-shadow: inset 0 0 0 1.5px #f3c7c2, var(--shadow); }
mark.todo { background: #fff1b8; padding: 0 4px; border-radius: 4px; }
.prose h2 { font-size: 17px; margin: 22px 0 6px; }
.prose p, .prose li { color: #2b3632; }
@media (min-width: 680px) {
  .row2 { grid-template-columns: 1fr 1fr; }
  .row5 { display: grid; grid-template-columns: 2fr 0.8fr 0.9fr 1.3fr 0.7fr; gap: 0 12px; }
}

.footer { text-align: center; font-size: 13px; color: var(--muted); padding: 8px 16px calc(28px + env(safe-area-inset-bottom)); }
.footer a { color: var(--muted); }
.footer p { margin: 6px 0 0; }

/* --- Affiche A4 ------------------------------------------------------------------ */
.poster-body { background: #e6e2d8; }
.poster-actions { display: flex; justify-content: space-between; align-items: center; max-width: 210mm; margin: 12px auto; padding: 0 12px; }
.poster-warning { max-width: 210mm; margin: 0 auto 12px; padding: 10px 14px; border-radius: 10px; background: #fff4c2; color: #4a3b00; font-weight: 600; }
.poster {
  width: 210mm; max-width: 100%; min-height: 297mm; margin: 0 auto 24px; padding: 14mm 16mm;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  background: var(--primary); color: var(--on-primary);
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.poster-logo { background: #fff; border-radius: 8mm; padding: 4mm 7mm; width: 58mm; max-width: 60%; }
.poster-logo img { display: block; width: 100%; height: auto; }
.poster-shop { margin: 4mm 0 0; font-size: 5.5mm; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.actions-inline { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.poster-switch { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-start; font-size: 14px; }
.poster-switch a { padding: 6px 10px; border-radius: 999px; background: #fff; text-decoration: none; font-weight: 600; }
.poster-switch a.is-active { background: var(--primary); color: var(--on-primary); }
.poster h1 { font-size: 13mm; line-height: 1.04; margin: 6mm 0; letter-spacing: -0.02em; }
.poster-qr { background: #fff; padding: 5mm; border-radius: 8mm; width: 82mm; max-width: 80%; }
.poster-qr svg { display: block; width: 100%; height: auto; }
.poster-sub { font-size: 5mm; margin: 4mm 0 5mm; opacity: 0.9; }
.poster-rule { display: inline-block; background: var(--accent); color: var(--on-accent); font-weight: 800; font-size: 6.5mm; padding: 3mm 8mm; border-radius: 99px; margin: 0 0 5mm; }
.poster-rewards { list-style: none; padding: 0; margin: 0; font-size: 4.8mm; line-height: 1.6; }
.poster-foot { margin-top: auto; padding-top: 8mm; opacity: 0.8; font-size: 4mm; }
@media screen and (max-width: 820px) {
  .poster { min-height: 0; padding: 32px 20px; }
  .poster h1 { font-size: 36px; }
  .poster-logo { width: 190px; padding: 12px 18px; border-radius: 22px; }
  .poster-qr { width: 260px; padding: 16px; border-radius: 22px; }
  .poster-sub, .poster-rewards { font-size: 17px; }
  .poster-rule { font-size: 22px; padding: 8px 20px; }
  .poster-foot { font-size: 14px; padding-top: 24px; }
  .poster-shop { font-size: 18px; margin-top: 12px; }
}
@page { size: A4; margin: 0; }
@media print {
  .no-print { display: none !important; }
  body { background: none; }
  .poster { margin: 0; width: 210mm; height: 297mm; min-height: 0; }
}
