/* MacAppIA — back-office : sobre, lisible, utilisable sans connaissances techniques. */
@font-face { font-family: "Archivo"; src: url("../fonts/archivo-var.woff2") format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
:root { --ink: #0b0b0b; --orange: #ff4f00; --bg: #f6f6f4; --line: #e3e3df; --muted: #6b6b66; --ok: #1d7a43; --warn: #b54a00; --danger: #b42300; --white: #fff; }
* { box-sizing: border-box; }
body { margin: 0; font-family: "Archivo", system-ui, sans-serif; font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--bg); }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.devbar { background: repeating-linear-gradient(-45deg, #ffe600 0 14px, #111 14px 28px); color: #fff; text-align: center; font-size: 12px; font-weight: 700; padding: 5px; text-shadow: 0 0 3px #000; }
.signature { display: inline-block; aspect-ratio: 1600/554; height: 30px; background: currentColor; -webkit-mask: url("../img/signature.png") center/contain no-repeat; mask: url("../img/signature.png") center/contain no-repeat; }
.signature.big { height: 64px; }
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: var(--ink); color: #eee; padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; margin: 0 6px 18px; }
.logo small { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; font-stretch: 125%; color: var(--orange); }
.side nav a { display: flex; justify-content: space-between; align-items: center; padding: 7px 10px; border-radius: 4px; text-decoration: none; font-size: 14px; color: #d8d8d4; }
.side nav a:hover { background: #222; color: #fff; }
.side nav a.on { background: var(--orange); color: var(--ink); font-weight: 600; }
.grp { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: #8a8a85; margin: 16px 10px 4px; font-stretch: 125%; }
.cnt { background: var(--orange); color: var(--ink); border-radius: 10px; font-size: 11px; padding: 0 7px; }
.side nav a.on .cnt { background: var(--ink); color: #fff; }
.side-foot { margin-top: auto; padding: 16px 10px 0; border-top: 1px solid #2a2a2a; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.side-foot a { color: #ddd; }
.linkbtn { background: none; border: 0; color: #ddd; padding: 0; cursor: pointer; text-decoration: underline; font: inherit; font-size: 13px; text-align: left; }
.main { min-width: 0; }
.top { display: flex; align-items: center; gap: 16px; padding: 18px 28px; background: var(--white); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top h1 { font-size: 22px; font-weight: 800; font-stretch: 85%; margin: 0; flex: 1; letter-spacing: -.01em; }
.top-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.burger { display: none; background: none; border: 1px solid var(--line); border-radius: 4px; font-size: 18px; padding: 4px 10px; cursor: pointer; }
.content { padding: 24px 28px 80px; max-width: 1500px; }
h2 { font-size: 18px; font-weight: 750; font-stretch: 90%; margin: 0 0 14px; }
h3 { font-size: 15px; margin: 18px 0 8px; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: 6px; padding: 20px; margin: 0 0 20px; }
fieldset.card { padding-top: 10px; }
legend { font-weight: 700; font-size: 13px; padding: 0 6px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 16px; align-items: end; }
.grid6 { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0 12px; align-items: end; }
.grid-edit { display: grid; grid-template-columns: minmax(260px, 380px) 1fr; gap: 28px; align-items: start; margin-bottom: 20px; }
.col-img { position: sticky; top: 90px; }
.preview { background: #ecebe7; padding: 14px; border-radius: 6px; margin-bottom: 12px; }
.preview img { width: 100%; height: auto; display: block; }
.ph { padding: 60px 10px; text-align: center; color: var(--muted); }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.gallery img { width: 100%; height: 80px; object-fit: contain; background: #ecebe7; }
.fld { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.fld label { font-size: 12px; font-weight: 650; color: #333; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=date], input[type=search], input:not([type]), select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid #c9c9c4; border-radius: 4px; font: inherit; background: var(--white); color: var(--ink); }
textarea { resize: vertical; line-height: 1.5; }
textarea.mono { font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(255, 79, 0, .35); }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; margin: 6px 0 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--orange); }
.help { color: var(--muted); font-size: 12.5px; }
.big { font-size: 26px; font-weight: 800; margin: 2px 0; }
.btn, .btn-s { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--ink); background: var(--ink); color: #fff; border-radius: 4px; padding: 9px 16px; font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--orange); border-color: var(--orange); color: var(--ink); }
.btn.ghost, .btn-s { background: var(--white); color: var(--ink); }
.btn-s { padding: 5px 10px; font-size: 12.5px; }
.btn-s:hover, .btn.ghost:hover { background: var(--ink); color: #fff; }
.btn.danger, .btn-s.danger { border-color: var(--danger); color: var(--danger); background: var(--white); }
.btn.danger:hover, .btn-s.danger:hover { background: var(--danger); color: #fff; }
.btn.wide { width: 100%; justify-content: center; padding: 12px; }
.form-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.form-actions.sticky { position: sticky; bottom: 0; background: var(--bg); padding: 14px 0; border-top: 1px solid var(--line); z-index: 4; }
form.inline { display: inline; }
.inline-form { display: flex; gap: 10px; align-items: end; }
.search { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.search input, .search select { max-width: 280px; }
.alert { padding: 11px 14px; border-radius: 4px; border-left: 4px solid var(--muted); background: var(--white); margin: 0 0 16px; }
.content > .alert:first-child { margin-top: 0; }
.main > .alert { margin: 16px 28px 0; }
.alert.ok { border-color: var(--ok); }
.alert.warn { border-color: var(--warn); background: #fff6ef; }
.alert.info { border-color: #3a6ea5; }
.table-wrap { overflow-x: auto; background: var(--white); border: 1px solid var(--line); border-radius: 6px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 650; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fbfbfa; white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:hover { background: #fcfbf8; }
tfoot td { font-size: 14px; }
.card table td, .card table th { padding: 8px 6px; }
.thumb { width: 64px; height: 48px; object-fit: contain; background: #ecebe7; display: block; }
.thumb.none { display: block; width: 64px; height: 48px; background: repeating-linear-gradient(45deg, #eee 0 6px, #f6f6f6 6px 12px); }
.badge { display: inline-block; font-size: 11.5px; font-weight: 650; padding: 2px 8px; border-radius: 10px; background: #eee; color: #333; white-space: nowrap; }
.badge.ok, .badge.os-paid, .badge.os-shipped, .badge.os-delivered, .badge.pay-paid, .badge.st-available, .badge.is-done { background: #e3f3e8; color: var(--ok); }
.badge.warn, .badge.os-pending_payment, .badge.is-new, .badge.st-reserved, .badge.pay-pending { background: #fff0e3; color: var(--warn); }
.badge.os-paid_conflict, .badge.pay-mismatch, .badge.pay-duplicate, .badge.pay-error { background: #fde4df; color: var(--danger); }
.badge.muted, .badge.os-expired, .badge.os-cancelled, .badge.st-unavailable { background: #efefed; color: #777; }
.badge.demo { background: #ffe600; color: #111; }
.badge.info, .badge.is-in_progress, .badge.st-exhibited { background: #e5eef8; color: #2b5d8f; }
.badge.st-sold, .badge.os-refunded { background: var(--ink); color: #fff; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { background: var(--white); border: 1px solid var(--line); border-radius: 6px; padding: 16px 18px; text-decoration: none; display: flex; flex-direction: column; gap: 2px; transition: border-color .15s; }
.kpi:hover { border-color: var(--ink); }
.kpi span { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 650; }
.kpi b { font-size: 30px; font-weight: 850; font-stretch: 75%; line-height: 1.1; }
.kpi small { color: var(--muted); font-size: 12px; }
.kpi.accent { background: var(--orange); border-color: var(--orange); }
.kpi.accent span, .kpi.accent small { color: var(--ink); }
.kpi.danger { border-color: var(--danger); }
.kpi.danger b { color: var(--danger); }
.checklist { margin: 0; padding: 0; list-style: none; }
.checklist li { padding: 8px 0 8px 28px; border-bottom: 1px solid var(--line); position: relative; font-size: 14px; }
.checklist li::before { content: "!"; position: absolute; left: 0; top: 8px; width: 18px; height: 18px; border-radius: 50%; background: var(--warn); color: #fff; font-size: 12px; font-weight: 800; text-align: center; line-height: 18px; }
.checklist li.info::before { content: "i"; background: #3a6ea5; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 14px; margin: 0; font-size: 14px; }
.kv dt { color: var(--muted); font-size: 12px; font-weight: 650; padding-top: 2px; }
.kv dd { margin: 0; }
.msg { background: #fbfbfa; border: 1px solid var(--line); padding: 14px; border-radius: 4px; white-space: normal; }
.tabs { background: var(--white); border: 1px solid var(--line); border-radius: 6px; margin-bottom: 16px; }
.tab-list { display: flex; border-bottom: 1px solid var(--line); }
.tab-list button { background: none; border: 0; border-bottom: 3px solid transparent; padding: 12px 20px; font: inherit; font-weight: 700; cursor: pointer; color: var(--muted); }
.tab-list button[aria-selected="true"] { color: var(--ink); border-color: var(--orange); }
.tab-panel { padding: 18px 20px 6px; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.pills a { padding: 6px 12px; border: 1px solid var(--line); border-radius: 16px; text-decoration: none; background: var(--white); font-size: 13px; }
.pills a.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.empty { color: var(--muted); padding: 20px; background: var(--white); border: 1px dashed var(--line); border-radius: 6px; }
.log { background: #111; color: #ddd; padding: 12px; border-radius: 4px; font-size: 12px; overflow-x: auto; max-height: 340px; }
.numbers { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 12px; }
.num { width: 40px; height: 32px; border: 1px solid var(--line); background: #e3f3e8; border-radius: 3px; cursor: pointer; font: inherit; font-size: 12px; }
.num-sold { background: var(--ink); color: #fff; cursor: default; }
.num-withheld { background: #eee; color: #999; text-decoration: line-through; }
.row-src { padding: 6px 0; border-bottom: 1px solid var(--line); }
.sources { font-size: 13px; padding-left: 18px; }
details summary { cursor: pointer; font-weight: 650; margin: 10px 0; }
code { background: #efefec; padding: 1px 5px; border-radius: 3px; font-size: 12.5px; }
.login-page { display: grid; place-items: center; min-height: 100vh; background: var(--white); }
.login { width: min(380px, 92vw); padding: 20px; }
.login h1 { font-size: 13px; letter-spacing: .2em; text-transform: uppercase; font-stretch: 125%; margin: 12px 0 24px; color: var(--orange); }
@media (max-width: 1000px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; z-index: 20; transform: translateX(-100%); transition: transform .25s; }
  .side.open { transform: none; }
  .burger { display: block; }
  .grid2, .grid3, .grid4, .grid6, .grid-edit { grid-template-columns: 1fr; }
  .col-img { position: static; }
  .content { padding: 18px 16px 80px; }
  .top { padding: 12px 16px; }
  .kv { grid-template-columns: 1fr; }
}
.slide-previews { display: flex; gap: 10px; margin: 6px 0 4px; }
.slide-previews figure { margin: 0; text-align: center; font-size: 12px; font-weight: 700; }
.slide-previews .thumb { width: 120px; height: 80px; }

/* ---------- Statistiques ---------- */
:root { --s1: #e64500; --s2: #2f6bd8; --s3: #1f9e74; --s4: #8a5cd6; --grid: #ececea; }
.stats-filter { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin-bottom: 6px; }
.stats-filter .pills { margin: 0; }
.stats-filter .custom { display: flex; gap: 6px; align-items: center; font-size: 13px; }
.stats-filter input[type=date] { width: auto; padding: 5px 8px; }
.period { margin: 6px 0 16px; }
.live { margin-left: 12px; display: inline-flex; align-items: center; gap: 6px; font-weight: 650; color: var(--ink); }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px #dff2e6; }
.stats-kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.stats-kpis .kpi b { font-size: 28px; }
.d { font-size: 12px; font-weight: 700; }
.d.up { color: var(--ok); } .d.down { color: var(--danger); } .d.flat { color: var(--muted); }
.kpi.accent .d { color: var(--ink); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: #333; margin: 0 0 8px; }
.legend i { display: inline-block; width: 12px; height: 4px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.chart { position: relative; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .ax { font-size: 11px; fill: var(--muted); font-family: inherit; }
.chart .line1 { fill: none; stroke: var(--s1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .line2 { fill: none; stroke: var(--s2); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area1 { fill: var(--s1); opacity: .10; }
.chart .hit { fill: transparent; }
.chart .dot1, .chart .dot2 { opacity: 0; stroke: #fff; stroke-width: 2; }
.chart .dot1 { fill: var(--s1); } .chart .dot2 { fill: var(--s2); }
.chart .pt:hover .dot1, .chart .pt:hover .dot2, .chart .pt.on .dot1, .chart .pt.on .dot2 { opacity: 1; }
.chart .cross { stroke: #bdbdb8; stroke-width: 1; opacity: 0; pointer-events: none; }
.chart.hover .cross { opacity: 1; }
.chart .tip { position: absolute; pointer-events: none; background: var(--ink); color: #fff; font-size: 12.5px; line-height: 1.5; padding: 8px 10px; border-radius: 4px; white-space: nowrap; transform: translate(-50%, -110%); z-index: 3; }
.chart .tip i { display: inline-block; width: 10px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.tableview { margin-top: 8px; font-size: 13px; }
.tableview table { max-width: 420px; }
.barlist { list-style: none; margin: 0 0 6px; padding: 0; }
.barlist li { display: grid; grid-template-columns: minmax(110px, 1.3fr) 2fr 64px 58px; gap: 10px; align-items: center; padding: 5px 0; font-size: 13.5px; border-bottom: 1px solid #f2f2ef; }
.bl-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bl-track { display: block; height: 10px; background: #f3f3f1; border-radius: 0 4px 4px 0; overflow: hidden; flex: 1; }
.bl-fill { display: block; height: 100%; background: var(--s1); border-radius: 0 4px 4px 0; }
.bl-val { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.bl-pct { text-align: right; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.empty.small { padding: 12px; font-size: 13px; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
.heat { display: grid; grid-template-columns: 34px repeat(24, 1fr); gap: 2px; font-size: 10.5px; color: var(--muted); }
.heat .hd { font-weight: 650; color: #333; align-self: center; }
.heat .hc { aspect-ratio: 1; border-radius: 2px; background: #f3f3f1; position: relative; }
.heat .hc::after { content: ""; position: absolute; inset: 0; border-radius: 2px; background: var(--s1); opacity: var(--a); }
.heat-legend { display: flex; align-items: center; gap: 8px; }
.heat-legend .scale { width: 120px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, rgba(230,69,0,.08), #e64500); }
.big-num { font-size: 40px; font-weight: 850; font-stretch: 75%; margin: 0 0 10px; }
.big-num small { font-size: 13px; font-weight: 400; color: var(--muted); font-stretch: 100%; }
.stack { display: flex; gap: 2px; height: 14px; margin: 6px 0 10px; }
.stack span { display: block; height: 100%; }
.stack span:first-child { border-radius: 4px 0 0 4px; } .stack span:last-child { border-radius: 0 4px 4px 0; }
.stack span:only-child { border-radius: 4px; }
.funnel { list-style: none; margin: 0; padding: 0; }
.funnel li { display: grid; grid-template-columns: minmax(150px, 1.4fr) 2fr 54px 54px; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid #f2f2ef; font-size: 13.5px; }
.funnel li b { text-align: right; font-variant-numeric: tabular-nums; }
.funnel li small { text-align: right; color: var(--muted); }
.stats-table td { font-variant-numeric: tabular-nums; }
.stats-table .score { min-width: 160px; display: flex; gap: 8px; align-items: center; font-weight: 700; }
.grid3s { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 20px; }
.privacy-note { margin-top: 10px; }
@media (max-width: 1100px) { .grid3s { grid-template-columns: 1fr; } .barlist li { grid-template-columns: minmax(90px, 1fr) 1.2fr 56px 40px; } }

/* ---------- Réordonnancement au glisser-déposer ---------- */
.handle-col { width: 34px; padding-left: 6px !important; padding-right: 0 !important; }
.drag-handle { width: 28px; height: 36px; border: 0; background: none; cursor: grab; font-size: 18px; line-height: 1; color: #9a9a95; border-radius: 4px; touch-action: none; }
.drag-handle:hover, .drag-handle:focus-visible { color: var(--ink); background: #f0efeb; }
.is-sorting, .is-sorting * { cursor: grabbing !important; user-select: none; }
tr.dragging { background: #fff6ef !important; box-shadow: 0 6px 18px -8px rgba(0,0,0,.35); position: relative; z-index: 2; }
tr.dragging td { border-bottom-color: var(--orange); }
.sort-hint { margin: -4px 0 12px; }
.sort-toast { position: fixed; right: 24px; bottom: 24px; padding: 10px 16px; border-radius: 4px; background: var(--ink); color: #fff; font-weight: 600; font-size: 14px; opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; pointer-events: none; z-index: 50; }
.sort-toast.show { opacity: 1; transform: none; }
.sort-toast.err { background: var(--danger); }

.cert-form { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.cert-form .fld { margin: 0; min-width: 200px; }

/* ==========================================================================
   Thème « iOS » — verre translucide (Liquid Glass), grands titres, listes groupées,
   boutons en pilule, interrupteurs, contrôles segmentés, mode sombre automatique.
   Couche d'apparence uniquement : elle surcharge les styles ci-dessus.
   ========================================================================== */
:root {
  --tint: #ff5a1f; --tint-press: #e8480f; --tint-soft: rgba(255, 90, 31, .14);
  --label: #000; --label-2: rgba(60, 60, 67, .6); --label-3: rgba(60, 60, 67, .3);
  --sep: rgba(60, 60, 67, .18); --fill: rgba(118, 118, 128, .12); --fill-2: rgba(118, 118, 128, .2);
  --bg: #f2f2f7; --glass: rgba(255, 255, 255, .62); --glass-strong: rgba(255, 255, 255, .78); --glass-edge: rgba(255, 255, 255, .7);
  --shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 10px 30px -12px rgba(0, 0, 0, .18), 0 2px 6px -2px rgba(0, 0, 0, .06);
  --green: #34c759; --red: #ff3b30; --blue: #0a84ff; --yellow: #ffcc00;
  --r-xl: 26px; --r-lg: 20px; --r-md: 14px; --r-sm: 10px;
  --ok: #248a3d; --warn: #c93400; --danger: #d70015; --muted: rgba(60, 60, 67, .6); --line: var(--sep); --ink: #000;
}
@media (prefers-color-scheme: dark) {
  :root {
    --label: #fff; --label-2: rgba(235, 235, 245, .6); --label-3: rgba(235, 235, 245, .3);
    --sep: rgba(84, 84, 88, .55); --fill: rgba(118, 118, 128, .24); --fill-2: rgba(118, 118, 128, .32);
    --bg: #000; --glass: rgba(36, 36, 38, .58); --glass-strong: rgba(44, 44, 46, .78); --glass-edge: rgba(255, 255, 255, .09);
    --shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 12px 34px -12px rgba(0, 0, 0, .7);
    --ok: #30d158; --warn: #ff9f0a; --danger: #ff453a; --muted: rgba(235, 235, 245, .6); --ink: #fff; --white: #1c1c1e;
    --tint-soft: rgba(255, 90, 31, .22); --grid: rgba(84, 84, 88, .45);
  }
}

/* Fond : légères taches de couleur sous le verre */
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", system-ui, sans-serif;
  font-size: 15px; letter-spacing: -.01em; color: var(--label); background: var(--bg);
  background-image:
    radial-gradient(60vw 50vh at 8% -10%, rgba(255, 140, 90, .22), transparent 60%),
    radial-gradient(50vw 50vh at 100% 0%, rgba(120, 160, 255, .18), transparent 60%),
    radial-gradient(60vw 60vh at 60% 110%, rgba(255, 200, 140, .16), transparent 60%);
  background-attachment: fixed; -webkit-font-smoothing: antialiased;
}
@media (prefers-color-scheme: dark) {
  body { background-image: radial-gradient(60vw 50vh at 8% -10%, rgba(255, 90, 31, .18), transparent 60%), radial-gradient(50vw 50vh at 100% 0%, rgba(10, 132, 255, .14), transparent 60%); }
}
a { color: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--tint) 55%, transparent); outline-offset: 2px; border-radius: 8px; }

/* Barre latérale : panneau de verre flottant */
.shell { grid-template-columns: 268px 1fr; }
.side {
  margin: 12px 0 12px 12px; height: calc(100vh - 24px); top: 12px; border-radius: var(--r-xl); padding: 18px 12px;
  background: var(--glass); color: var(--label); -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%);
  box-shadow: var(--shadow); border: 1px solid var(--glass-edge);
}
.logo { color: var(--label); }
.logo small { color: var(--tint); letter-spacing: .1em; font-weight: 700; }
.grp { color: var(--label-2); font-size: 12px; letter-spacing: 0; text-transform: none; font-weight: 600; margin: 16px 12px 4px; font-stretch: 100%; }
.side nav a { color: var(--label); border-radius: var(--r-sm); padding: 8px 12px; font-size: 15px; font-weight: 500; transition: background .15s; }
.side nav a:hover { background: var(--fill); color: var(--label); }
.side nav a.on { background: var(--tint); color: #fff; font-weight: 600; box-shadow: 0 6px 16px -8px var(--tint); }
.cnt { background: var(--red); color: #fff; border-radius: 999px; min-width: 20px; height: 20px; line-height: 20px; text-align: center; padding: 0 6px; font-size: 12px; font-weight: 600; }
.side nav a.on .cnt { background: #fff; color: var(--tint); }
.side-foot { border-top: 1px solid var(--sep); color: var(--label-2); }
.side-foot a, .linkbtn { color: var(--tint); text-decoration: none; }

/* Barre du haut : grand titre sur verre */
.top {
  margin: 12px 12px 0; border-radius: var(--r-lg); border: 1px solid var(--glass-edge); padding: 14px 20px;
  background: var(--glass); -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%); box-shadow: var(--shadow); top: 12px;
}
.top h1 { font-family: -apple-system, "SF Pro Display", system-ui, sans-serif; font-size: 30px; font-weight: 700; letter-spacing: -.02em; font-stretch: 100%; }
.burger { border: 0; background: var(--fill); border-radius: 999px; width: 38px; height: 38px; color: var(--label); }
.content { padding: 20px 24px 90px; }
.main > .alert { margin: 14px 24px 0; }

/* Cartes / sections groupées */
.card, .kpi, .table-wrap, .tabs, .empty, fieldset.card {
  background: var(--glass-strong); border: 1px solid var(--glass-edge); border-radius: var(--r-lg); box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(24px) saturate(160%); backdrop-filter: blur(24px) saturate(160%);
}
.card { padding: 20px 22px; }
h2 { font-family: -apple-system, "SF Pro Display", system-ui, sans-serif; font-size: 20px; font-weight: 700; letter-spacing: -.015em; font-stretch: 100%; }
h3 { font-size: 15px; font-weight: 600; color: var(--label); }
legend { font-size: 13px; font-weight: 600; color: var(--label-2); text-transform: none; letter-spacing: 0; padding: 0 4px; }
.help, .kv dt, small { color: var(--label-2); }

/* Indicateurs */
.kpi { padding: 16px 18px; gap: 4px; }
.kpi span { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 600; color: var(--label-2); }
.kpi b { font-family: -apple-system, "SF Pro Display", system-ui; font-size: 32px; font-weight: 700; letter-spacing: -.02em; font-stretch: 100%; font-variant-numeric: tabular-nums; }
.kpi:hover { border-color: var(--glass-edge); transform: translateY(-1px); transition: transform .2s; }
.kpi.accent { background: linear-gradient(135deg, #ff7a3d, var(--tint)); border-color: transparent; color: #fff; }
.kpi.accent span, .kpi.accent small, .kpi.accent .d { color: rgba(255, 255, 255, .9); }

/* Champs de saisie iOS */
.fld label { font-size: 13px; font-weight: 600; color: var(--label-2); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=date], input[type=search], input:not([type]), select, textarea {
  border: 0; border-radius: var(--r-sm); background: var(--fill); color: var(--label); padding: 11px 13px; font-size: 16px; box-shadow: none;
}
input:focus, select:focus, textarea:focus { background: var(--glass-strong); box-shadow: 0 0 0 3px var(--tint-soft), 0 0 0 1px var(--tint); }
select { -webkit-appearance: none; appearance: none; padding-right: 34px; background-image: linear-gradient(45deg, transparent 50%, var(--label-2) 50%), linear-gradient(135deg, var(--label-2) 50%, transparent 50%); background-position: calc(100% - 17px) 52%, calc(100% - 12px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
textarea.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; }
input[type=file] { font-size: 14px; color: var(--label-2); }
input[type=file]::file-selector-button { border: 0; border-radius: 999px; background: var(--fill-2); color: var(--tint); font-weight: 600; padding: 7px 14px; margin-right: 10px; cursor: pointer; }

/* Interrupteurs à la place des cases à cocher */
.check { gap: 14px; font-size: 15px; flex-direction: row-reverse; justify-content: space-between; padding: 6px 0; border-bottom: .5px solid var(--sep); }
.check input[type=checkbox] {
  -webkit-appearance: none; appearance: none; width: 51px; height: 31px; flex: 0 0 51px; border-radius: 999px; background: var(--fill-2);
  position: relative; cursor: pointer; transition: background .25s; margin: 0;
}
.check input[type=checkbox]::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 1px 1px rgba(0, 0, 0, .16); transition: transform .25s cubic-bezier(.3, .7, .2, 1.2);
}
.check input[type=checkbox]:checked { background: var(--green); }
.check input[type=checkbox]:checked::after { transform: translateX(20px); }

/* Boutons en pilule */
.btn, .btn-s { border: 0; border-radius: 999px; font-weight: 600; letter-spacing: -.01em; font-size: 15px; padding: 10px 20px; background: var(--tint); color: #fff; box-shadow: 0 6px 16px -10px var(--tint); transition: transform .12s, background .15s; }
.btn:hover { background: var(--tint-press); color: #fff; border: 0; }
.btn:active, .btn-s:active { transform: scale(.97); }
.btn.ghost, .btn-s { background: var(--fill); color: var(--tint); box-shadow: none; }
.btn-s { padding: 6px 13px; font-size: 13px; }
.btn-s:hover, .btn.ghost:hover { background: var(--fill-2); color: var(--tint); }
.btn.danger, .btn-s.danger { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--danger); }
.btn.danger:hover, .btn-s.danger:hover { background: var(--red); color: #fff; }
.top-actions .btn { padding: 9px 16px; font-size: 14px; }
.form-actions.sticky { background: var(--glass); -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%); border: 1px solid var(--glass-edge); border-radius: 999px; padding: 8px; bottom: 14px; box-shadow: var(--shadow); width: max-content; max-width: 100%; }

/* Listes / tableaux groupés */
.table-wrap { overflow: hidden; }
table { font-size: 15px; }
th { background: transparent; color: var(--label-2); text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 600; border-bottom: 1px solid var(--sep); }
td { border-bottom: .5px solid var(--sep); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--fill); }
.thumb { border-radius: 8px; background: var(--fill); }

/* Capsules d'état */
.badge { border-radius: 999px; font-weight: 600; font-size: 12px; padding: 3px 10px; background: var(--fill); color: var(--label-2); }
.badge.ok, .badge.os-paid, .badge.os-shipped, .badge.os-delivered, .badge.pay-paid, .badge.st-available, .badge.is-done { background: color-mix(in srgb, var(--green) 18%, transparent); color: var(--ok); }
.badge.warn, .badge.os-pending_payment, .badge.is-new, .badge.st-reserved, .badge.pay-pending { background: color-mix(in srgb, #ff9500 18%, transparent); color: var(--warn); }
.badge.os-paid_conflict, .badge.pay-mismatch, .badge.pay-duplicate, .badge.pay-error { background: color-mix(in srgb, var(--red) 16%, transparent); color: var(--danger); }
.badge.info, .badge.is-in_progress, .badge.st-exhibited { background: color-mix(in srgb, var(--blue) 15%, transparent); color: var(--blue); }
.badge.st-sold, .badge.os-refunded { background: var(--label); color: var(--bg); }

/* Contrôles segmentés (filtres, langues) */
.pills, .tab-list { display: inline-flex; gap: 2px; padding: 3px; background: var(--fill); border-radius: 12px; border: 0; flex-wrap: wrap; }
.pills a { border: 0; border-radius: 9px; background: transparent; padding: 6px 14px; font-size: 14px; font-weight: 500; color: var(--label); }
.pills a.on { background: var(--glass-strong); color: var(--label); font-weight: 600; box-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 0 0 .5px rgba(0, 0, 0, .04); }
.tabs { padding: 10px; }
.tab-list { margin: 4px 6px 6px; }
.tab-list button { border: 0; border-radius: 9px; padding: 7px 18px; font-size: 14px; font-weight: 600; color: var(--label); }
.tab-list button[aria-selected="true"] { background: var(--glass-strong); color: var(--label); box-shadow: 0 3px 8px rgba(0, 0, 0, .12); }
.tab-panel { padding: 12px 10px 4px; }

/* Bannières */
.alert { border: 0; border-radius: var(--r-md); background: var(--glass-strong); box-shadow: var(--shadow); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); padding: 12px 16px 12px 44px; position: relative; }
.alert::before { content: "i"; position: absolute; left: 14px; top: 12px; width: 20px; height: 20px; border-radius: 50%; background: var(--blue); color: #fff; font-size: 12px; font-weight: 700; text-align: center; line-height: 20px; }
.alert.ok::before { content: "✓"; background: var(--green); }
.alert.warn { background: var(--glass-strong); }
.alert.warn::before { content: "!"; background: #ff9500; }
.checklist li { border-bottom: .5px solid var(--sep); }
.checklist li::before { background: #ff9500; }
.checklist li.info::before { background: var(--blue); }

/* Divers */
.preview, .ph { background: var(--fill); border-radius: var(--r-md); }
.preview img { border-radius: 6px; }
.msg, .log { border-radius: var(--r-md); border: 0; background: var(--fill); }
.log { background: #1c1c1e; }
code { background: var(--fill); border-radius: 6px; }
.empty { color: var(--label-2); border-style: solid; }
.num { border-radius: 8px; border: 0; background: color-mix(in srgb, var(--green) 18%, transparent); color: var(--ok); font-weight: 600; }
.num-sold { background: var(--label); color: var(--bg); }
.num-withheld { background: var(--fill); color: var(--label-3); }
.drag-handle { color: var(--label-3); }
.drag-handle:hover, .drag-handle:focus-visible { background: var(--fill); color: var(--label); }
tr.dragging { background: var(--glass-strong) !important; box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .35); }
.sort-toast { border-radius: 999px; background: var(--glass-strong); color: var(--label); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); box-shadow: var(--shadow); border: 1px solid var(--glass-edge); }
.sort-toast.err { background: var(--red); color: #fff; }
.devbar { border-radius: 0; }
.bl-track { background: var(--fill); border-radius: 999px; }
.bl-fill { border-radius: 999px; }
.barlist li, .funnel li { border-bottom: .5px solid var(--sep); }
.heat .hc { background: var(--fill); border-radius: 4px; }
.chart .tip { border-radius: 12px; background: var(--glass-strong); color: var(--label); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); box-shadow: var(--shadow); }
.live i { background: var(--green); }

/* Connexion */
.login-page { background: var(--bg); }
.login { background: var(--glass-strong); border: 1px solid var(--glass-edge); border-radius: var(--r-xl); box-shadow: var(--shadow); padding: 34px 30px; -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%); }
.login h1 { color: var(--label-2); letter-spacing: 0; text-transform: none; font-size: 15px; font-weight: 600; font-stretch: 100%; }
.login .signature { color: var(--label); }

@media (max-width: 1000px) {
  .shell { grid-template-columns: 1fr; }
  .side { margin: 0; height: 100vh; top: 0; border-radius: 0 var(--r-xl) var(--r-xl) 0; }
  .top { margin: 8px 8px 0; top: 8px; }
  .top h1 { font-size: 24px; }
  .content { padding: 14px 10px 90px; }
}
@media (prefers-reduced-motion: reduce) { .check input[type=checkbox]::after, .kpi:hover { transition: none; transform: none; } }
/* Couleurs de texte fixes héritées → couleurs système (lisibles en mode sombre) */
.legend, .heat .hd, .fld label, .check, .kv dd, .funnel li, .barlist li { color: var(--label); }
.heat, .chart .ax, .bl-pct, .funnel li small { color: var(--label-2); fill: var(--label-2); }
.stack span { border-radius: 4px; }

/* ==========================================================================
   E-mailing : contacts, campagnes, éditeur visuel, demandes (fil de réponses)
   ========================================================================== */
.badge.ok { background: rgba(52, 199, 89, .16); color: var(--ok); }
.badge.info { background: rgba(10, 132, 255, .14); color: var(--blue); }
.badge.accent { background: var(--tint); color: #fff; }
.badge.is-spam { background: var(--fill-2); color: var(--label-2); text-decoration: line-through; }
.tag { display: inline-block; padding: 1px 8px; margin: 1px 2px 1px 0; border-radius: 999px; background: var(--fill); color: var(--label); font-size: 11.5px; white-space: nowrap; }
.muted { color: var(--label-2); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 14px; }
.filters input[type=search] { flex: 1 1 260px; width: auto; }
.filters select { width: auto; max-width: 220px; }
.filters .check { margin: 0 4px; }
.bulkbar { position: sticky; top: 72px; z-index: 4; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px; margin: 0 0 12px; border-radius: var(--r-md); background: var(--glass-strong); border: 1px solid var(--glass-edge); box-shadow: var(--shadow); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); opacity: .55; transition: opacity .2s; }
.bulkbar.has-sel, .bulkbar:focus-within { opacity: 1; }
.bulkbar input:not([type=checkbox]), .bulkbar select { width: auto; min-width: 120px; padding: 6px 10px; }
.bulk-count { font-weight: 650; font-variant-numeric: tabular-nums; margin-right: 6px; }
.pager { display: flex; gap: 10px; align-items: center; justify-content: flex-end; margin: 12px 0; color: var(--label-2); font-size: 13px; }
.sync { margin-top: 18px; }
ul.plain { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.counter { display: block; text-align: right; color: var(--label-2); font-size: 11.5px; margin-top: 3px; }
.counter.over { color: var(--warn); }

/* Étapes de campagne */
.steps { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 18px; padding: 6px; border-radius: 999px; background: var(--fill); width: fit-content; max-width: 100%; }
.step { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px 7px 7px; border-radius: 999px; text-decoration: none; color: var(--label-2); font-weight: 600; font-size: 13.5px; }
.step i { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--fill-2); color: var(--label); font-style: normal; font-size: 12px; }
.step.done i { background: var(--green); color: #fff; }
.step.on { background: var(--glass-strong); color: var(--label); box-shadow: var(--shadow); }
.step.on i { background: var(--tint); color: #fff; }
.step small { color: var(--label-2); font-weight: 500; }
.starters { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.starter { display: flex; gap: 10px; align-items: flex-start; padding: 14px; border-radius: var(--r-md); border: 1.5px solid var(--sep); cursor: pointer; background: var(--glass); }
.starter:has(input:checked) { border-color: var(--tint); box-shadow: 0 0 0 3px var(--tint-soft); }
.starter b { display: block; }
.starter small { color: var(--label-2); font-size: 12px; }
.starter.saved b::before { content: "★ "; color: var(--tint); }
.inbox { display: grid; gap: 2px; padding: 14px 16px; border-radius: var(--r-md); background: var(--fill); font-size: 14px; }
.inbox span { font-weight: 600; }
.inbox small { color: var(--label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-target { margin-top: 16px; padding-top: 14px; border-top: .5px solid var(--sep); }
.ai-target .row { display: flex; gap: 8px; margin: 6px 0; }
.ai-target input { flex: 1; }
.mchecklist { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; }
.mchecklist li.ok { color: var(--ok); }
.mchecklist li.ko { color: var(--warn); }
.alert.info { border-left-color: var(--blue); }
.progress { height: 10px; border-radius: 999px; background: var(--fill); overflow: hidden; margin: 6px 0 10px; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--tint), #ff9a5c); border-radius: 999px; transition: width .6s ease; }
.send-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 12px 0; }
.schedule { display: inline-flex; gap: 6px; align-items: center; }
.schedule input { width: auto; }
.progress.thin { height: 6px; margin: 4px 0; min-width: 90px; }
.lot-summary { margin: 4px 0 12px; }
.lot-summary p { margin: 4px 0; }
.sender { margin-top: 10px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; color: var(--label-2); }
.mfunnel { display: grid; gap: 8px; margin-bottom: 10px; }
.fun-row { display: grid; grid-template-columns: 120px 1fr 60px; gap: 12px; align-items: center; }
.fun-row i { display: block; height: 22px; border-radius: 6px; background: linear-gradient(90deg, var(--tint), #ffb085); min-width: 4px; }
.fun-row b { text-align: right; font-variant-numeric: tabular-nums; }
svg.tl { width: 100%; height: auto; }
svg.tl .b-open, .legend i.b-open { fill: var(--tint-soft); background: var(--tint-soft); }
svg.tl .b-click, .legend i.b-click { fill: var(--tint); background: var(--tint); }
svg.tl .ax { font-size: 11px; fill: var(--label-2); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin: 0 4px 0 12px; }

/* Fil des demandes */
.thread { display: grid; gap: 12px; }
.msg-item { padding: 12px 16px; border-radius: var(--r-md); background: var(--fill); max-width: 92%; }
.msg-item.out { margin-left: auto; background: var(--tint-soft); }
.msg-item.failed { outline: 1.5px dashed var(--danger); }
.msg-item header { margin-bottom: 6px; color: var(--label-2); font-size: 13px; }
.msg-item header b { color: var(--label); }
.msg-item .msg { white-space: normal; }
.danger-zone { border-color: rgba(255, 59, 48, .35); }
.danger-zone .check { display: flex; margin: 6px 0; }
details summary { cursor: pointer; font-weight: 600; margin-top: 10px; }

/* Éditeur visuel */
.me-bar { position: sticky; top: 72px; z-index: 6; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 10px; margin-bottom: 12px; border-radius: var(--r-lg); background: var(--glass-strong); border: 1px solid var(--glass-edge); box-shadow: var(--shadow); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); }
.me-spacer { flex: 1; }
.me-langs { display: flex; gap: 4px; }
.me-langs button { border: 0; background: var(--fill); color: var(--label); border-radius: 999px; padding: 6px 12px; font: inherit; font-weight: 650; font-size: 13px; cursor: pointer; position: relative; }
.me-langs button[aria-selected=true] { background: var(--tint); color: #fff; }
.me-langs button.missing { background: transparent; border: 1.5px dashed var(--sep); color: var(--label-2); }
.me-langs .dot { position: absolute; top: 3px; right: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--yellow); }
.me-status { font-size: 12.5px; color: var(--label-2); }
.me-status.ok { color: var(--ok); }
.me-status.err { color: var(--danger); }
.me-version { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 14px; margin-bottom: 12px; border-radius: var(--r-md); background: rgba(255, 204, 0, .14); font-size: 13.5px; }
.me-version span { flex: 1 1 260px; }
.seg { display: inline-flex; padding: 2px; border-radius: 9px; background: var(--fill); }
.seg button { border: 0; background: transparent; padding: 5px 12px; border-radius: 7px; font: inherit; font-size: 13px; cursor: pointer; color: var(--label); }
.seg button[aria-pressed=true] { background: var(--glass-strong); box-shadow: 0 1px 3px rgba(0, 0, 0, .15); font-weight: 600; }
.me-grid { display: grid; grid-template-columns: minmax(320px, 420px) minmax(0, 1fr); gap: 18px; align-items: start; }
.me-left { display: grid; gap: 12px; position: sticky; top: 140px; max-height: calc(100vh - 160px); overflow-y: auto; padding: 2px 4px 20px 2px; }
.me-add, .me-settings { background: var(--glass); border: 1px solid var(--glass-edge); border-radius: var(--r-md); padding: 10px 14px; }
.me-add summary, .me-settings summary { margin: 0; }
.me-add-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.me-add-btn { border: 1px solid var(--sep); background: var(--glass-strong); color: var(--label); border-radius: var(--r-sm); padding: 8px 6px; font: inherit; font-size: 12.5px; cursor: pointer; line-height: 1.2; }
.me-add-btn:hover { border-color: var(--tint); color: var(--tint); }
.me-blocks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.me-block { background: var(--glass-strong); border: 1px solid var(--sep); border-radius: var(--r-md); }
.me-block.open { border-color: var(--tint); box-shadow: 0 0 0 3px var(--tint-soft); }
.me-block.dragging { opacity: .4; }
.me-block.drop-before { box-shadow: 0 -3px 0 var(--tint); }
.me-block.drop-after { box-shadow: 0 3px 0 var(--tint); }
.me-head { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 10px; cursor: pointer; min-height: 40px; }
.me-handle { cursor: grab; color: var(--label-3); font-size: 16px; }
.me-head b { font-size: 13px; white-space: nowrap; }
.me-ex { flex: 1; min-width: 0; color: var(--label-2); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-tools { display: inline-flex; gap: 2px; }
.me-tools button { border: 0; background: transparent; width: 26px; height: 26px; border-radius: 7px; cursor: pointer; color: var(--label-2); font-size: 13px; }
.me-tools button:hover:not(:disabled) { background: var(--fill); color: var(--label); }
.me-tools button.del:hover { color: var(--danger); }
.me-tools button:disabled { opacity: .3; cursor: default; }
.me-body { padding: 4px 14px 14px; display: grid; gap: 10px; border-top: .5px solid var(--sep); }
.me-empty { color: var(--label-2); padding: 12px; text-align: center; }
.me-fld { display: grid; gap: 4px; }
.me-fld > label { font-size: 12px; font-weight: 600; color: var(--label-2); }
.me-range { display: flex; gap: 8px; align-items: center; }
.me-range input { flex: 1; padding: 0; accent-color: var(--tint); }
.me-range output { width: 34px; text-align: right; font-variant-numeric: tabular-nums; font-size: 12.5px; }
.me-color { display: flex; gap: 8px; align-items: center; }
.me-color input { width: 44px; height: 30px; padding: 2px; border-radius: 8px; }
.me-rich-wrap { border: 1px solid var(--sep); border-radius: var(--r-sm); overflow: hidden; background: var(--white); }
.me-rich-bar { display: flex; flex-wrap: wrap; gap: 2px; padding: 4px; background: var(--fill); }
.me-rich-bar button { border: 0; background: transparent; min-width: 28px; height: 28px; border-radius: 6px; cursor: pointer; font: inherit; font-size: 13px; color: var(--label); }
.me-rich-bar button:hover { background: var(--glass-strong); }
.me-rich { min-height: 110px; max-height: 340px; overflow: auto; padding: 10px 12px; outline: none; font-size: 14px; line-height: 1.55; color: var(--label); }
.me-rich p { margin: 0 0 .8em; }
.me-pick { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.me-pick img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--sep); }
.me-refs { display: grid; gap: 4px; max-height: 260px; overflow-y: auto; padding: 4px; border: 1px solid var(--sep); border-radius: var(--r-sm); }
.me-ref { display: flex; gap: 8px; align-items: center; font-size: 13px; cursor: pointer; }
.me-ref img { width: 34px; height: 34px; object-fit: cover; border-radius: 5px; }
.me-right { min-width: 0; }
.me-frame { margin: 0 auto; max-width: 760px; border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--sep); background: #f2f1ee; transition: max-width .3s ease; }
.me-frame.mobile { max-width: 390px; border-radius: 34px; border: 10px solid #1c1c1e; }
.me-frame iframe { display: block; width: 100%; min-height: 600px; border: 0; background: #f2f1ee; }
.me-dialog { width: min(980px, 94vw); max-height: 86vh; border: 0; border-radius: var(--r-xl); padding: 0; background: var(--glass-strong); color: var(--label); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .5); -webkit-backdrop-filter: blur(30px); backdrop-filter: blur(30px); }
.me-dialog::backdrop { background: rgba(0, 0, 0, .35); }
.me-dialog-head { position: sticky; top: 0; display: flex; gap: 10px; align-items: center; padding: 14px 18px; background: var(--glass-strong); border-bottom: .5px solid var(--sep); }
.me-dialog-head input[type=search] { flex: 1; }
.me-upload { cursor: pointer; }
.me-media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; padding: 16px 18px 22px; overflow-y: auto; max-height: calc(86vh - 70px); }
.me-media-item { border: 1px solid var(--sep); background: var(--white); border-radius: var(--r-sm); padding: 6px; cursor: pointer; display: grid; gap: 4px; text-align: left; color: var(--label); }
.me-media-item:hover { border-color: var(--tint); box-shadow: 0 0 0 3px var(--tint-soft); }
.me-media-item img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; }
.me-media-item span { font-size: 11px; color: var(--label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1100px) {
  .me-grid { grid-template-columns: 1fr; }
  .me-left { position: static; max-height: none; }
  .bulkbar, .me-bar { top: 64px; }
}
.me-version[hidden], .bulkbar[hidden] { display: none; }
.me-left { min-width: 0; overflow-x: hidden; }
.me-left > *, .me-blocks, .me-block { min-width: 0; max-width: 100%; }
.me-add-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.me-add-btn { min-width: 0; overflow-wrap: anywhere; }
.me-left code { white-space: normal; word-break: break-all; }

/* Boîte de réception */
.inbox-list { display: grid; gap: 2px; background: var(--glass-strong); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 14px; }
.inbox-row { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(0, 2.4fr) auto; gap: 4px 16px; align-items: center; padding: 12px 16px; text-decoration: none; color: var(--label); border-bottom: 1px solid var(--sep); }
.inbox-row:last-child { border-bottom: 0; }
.inbox-row:hover { background: var(--fill); }
.inbox-row .who, .inbox-row .what { min-width: 0; overflow: hidden; }
.inbox-row .who b, .inbox-row .what b { font-weight: 500; }
.inbox-row.unread .who b, .inbox-row.unread .what b { font-weight: 700; }
.inbox-row.unread { box-shadow: inset 3px 0 0 var(--tint); }
.inbox-row small { color: var(--label-2); }
.inbox-row .addr { display: block; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-row .what small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-row .when { font-size: 12.5px; color: var(--label-2); white-space: nowrap; text-align: right; }
.side-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.msg-item { min-width: 0; }
.msg-item .msg, .msg-item header { overflow-wrap: anywhere; }
details.quoted { margin-top: 8px; font-size: 13px; color: var(--label-2); }
details.quoted summary { font-weight: 500; margin: 4px 0; }
details.quoted .msg { opacity: .85; }
@media (max-width: 1000px) {
  .inbox-row { grid-template-columns: minmax(0, 1fr) auto; padding: 12px; }
  .inbox-row .what { grid-column: 1 / -1; grid-row: 2; }
  .inbox-row .when { grid-column: 2; grid-row: 1; align-self: start; }
}

/* Téléphone et tablette : en-tête compact, étapes lisibles, contenu sur toute la largeur */
@media (max-width: 1000px) {
  .top { position: static; display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 8px 10px; align-items: center; margin: 8px 8px 0; padding: 10px 12px; }
  .top h1 { font-size: 19px; line-height: 1.2; letter-spacing: -.01em; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
  .top-actions { grid-column: 1 / -1; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .top-actions::-webkit-scrollbar { display: none; }
  .top-actions:empty { display: none; }
  .top-actions .btn { flex: none; padding: 8px 14px; font-size: 13.5px; }
  .bulkbar, .me-bar { top: 8px; }
  .main > .alert { margin: 10px 8px 0; }
  .content { padding: 12px 8px calc(90px + env(safe-area-inset-bottom)); }
  .card { padding: 16px 14px; margin-bottom: 12px; }
  .card h2 { font-size: 18px; }
  .alert { font-size: 14px; padding: 10px 12px 10px 40px; margin-bottom: 12px; }
  .alert::before { left: 12px; top: 10px; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; width: auto; padding: 4px; border-radius: var(--r-md); margin-bottom: 12px; }
  .step { flex-direction: column; justify-content: flex-start; gap: 3px; padding: 6px 0; border-radius: 10px; font-size: 10px; letter-spacing: -.01em; line-height: 1.15; text-align: center; min-width: 0; }
  .step small { display: none; }
  .kpis, .stats-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
  .kpi { padding: 12px; min-width: 0; }
  .kpi b { font-size: 24px; }
  .mchecklist li, .kv dd { overflow-wrap: anywhere; }
  .pills, .tab-list { flex-wrap: nowrap; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .pills a, .tab-list a { flex: none; }
  .filters select { flex: 1 1 140px; max-width: none; }
  .send-actions .btn, .send-actions .btn-s, .sender .btn-s { min-height: 40px; }
  .schedule { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
  .schedule input { flex: 1 1 100%; }
  .form-actions.sticky { width: auto; border-radius: var(--r-md); flex-wrap: wrap; }
  /* Rien ne dépasse de l'écran : colonnes réductibles, tableaux défilants, formulaires à la ligne */
  .card, fieldset.card, .grid2 > *, .grid3 > *, .grid4 > *, .grid6 > *, .grid-edit > *, .grid3s > *, .fld { min-width: 0; max-width: 100%; }
  fieldset.card { min-inline-size: 0; }
  .card > table, fieldset > table, .card > form > table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  input, select, textarea { max-width: 100%; }
  .stats-filter .custom { flex-wrap: wrap; }
  .stats-filter input[type=date] { flex: 1 1 130px; min-width: 0; }
  .btn, .btn-s { white-space: normal; max-width: 100%; }
  .card form.inline, .card .inline { max-width: 100%; flex-wrap: wrap; }
  .inline-form { flex-wrap: wrap; }
  .inline-form > * { min-width: 0; max-width: 100%; }
  .slide-previews { flex-wrap: wrap; }
  .heat { grid-template-columns: 26px repeat(24, minmax(0, 1fr)); gap: 1px; }
  .heat .hh { font-size: 7.5px; overflow: hidden; text-align: center; }
  /* iOS agrandit la page si un champ est plus petit que 16 px */
  input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea { font-size: 16px; }
}
@media (max-width: 350px) { .step { font-size: 8.5px; } }

/* MacAppIA */
.logo-word { font-weight: 900; font-stretch: 62%; font-size: 1.5rem; text-transform: uppercase; letter-spacing: -.01em; line-height: 1; }
.logo-word b { color: #ff4f00; }
.app-icon { display: block; border-radius: 22.5%; object-fit: cover; }
.app-icon-ph { display: inline-grid; place-items: center; background: var(--accent, #ff4f00); color: #fff; font-weight: 900; font-size: 1rem; }
.icon-preview { margin-bottom: 12px; }
.form-actions.sticky { position: sticky; bottom: 0; background: var(--bg, #fff); padding: 12px 0; z-index: 5; }
.inline-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
