/* ==========================================================================
   Cx Spoofer — design system (toutes les pages)
   Apple × Hermès : ivoire, noir profond, orange signature, Inter + Instrument Serif
   ========================================================================== */
@import url("https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,400..800&family=Instrument+Serif:ital@0;1&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
  --bg: #f6f3ee;            /* ivoire */
  --bg-2: #efebe4;          /* creux */
  --bg-3: #e7e2d9;
  --surface: #ffffff;
  --surface-2: #fbfaf7;
  --line: rgba(29, 29, 31, .08);
  --line-2: rgba(29, 29, 31, .14);
  --line-3: rgba(29, 29, 31, .22);
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #9a9aa0;
  --ink: #1d1d1f;           /* boutons principaux */
  --accent: #f37021;        /* orange signature */
  --accent-strong: #d95b0f;
  --accent-soft: #fdeee3;
  --accent-ring: rgba(243, 112, 33, .26);
  --ok: #1f8a4c; --ok-soft: #e6f4ec;
  --warn: #b7791f; --warn-soft: #fbf1de;
  --bad: #d1343a; --bad-soft: #fbe7e7;
  --info: #2f6fdf; --info-soft: #e8effc;
  --r-xs: 6px; --r-sm: 9px; --r: 12px; --r-lg: 18px; --r-xl: 24px;
  --sh-1: 0 1px 2px rgba(29, 29, 31, .05), 0 0 0 1px rgba(29, 29, 31, .04);
  --sh-2: 0 10px 30px -12px rgba(29, 29, 31, .16), 0 2px 6px rgba(29, 29, 31, .05);
  --sh-3: 0 40px 90px -24px rgba(29, 29, 31, .32), 0 8px 24px -8px rgba(29, 29, 31, .12);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-in: cubic-bezier(.55, 0, 1, .45);
  --dur: .22s;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --sb-w: 264px; --sb-min: 72px;
  color-scheme: light;
}
html.sb-min { --sb-cur: var(--sb-min); }
html:not(.sb-min) { --sb-cur: var(--sb-w); }

/* ── base ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { min-height: 100vh; background: var(--bg); color: var(--text); font: 400 14.5px/1.5 var(--sans);
       letter-spacing: -.006em; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
       font-feature-settings: "cv11", "ss01", "ss03"; text-rendering: optimizeLegibility; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
a { color: var(--text); text-decoration: none; }
svg { display: block; flex: none; }
img { display: block; }
[hidden] { display: none !important; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--mono); font-size: .92em; letter-spacing: 0; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.nowrap { white-space: nowrap; }
.tnum { font-variant-numeric: tabular-nums; }

/* ── typographie ──────────────────────────────────────────────────────── */
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font: 600 11px/1 var(--sans); letter-spacing: .12em;
           text-transform: uppercase; color: var(--text-3); }
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.display { margin: 0; font: 400 clamp(34px, 4.4vw, 48px)/1.02 var(--serif); letter-spacing: -.012em; color: var(--text); }
.display em { font-style: italic; color: var(--accent); }
.h2 { margin: 0; font: 600 19px/1.25 var(--sans); letter-spacing: -.018em; }
.h3 { margin: 0; font: 600 15px/1.3 var(--sans); letter-spacing: -.012em; }
.lead { margin: 0; color: var(--text-2); font-size: 15.5px; line-height: 1.55; }
.small { font-size: 13px; } .tiny { font-size: 12px; }

/* ── page ─────────────────────────────────────────────────────────────── */
.app-main { margin-left: var(--sb-cur); min-width: 0; min-height: 100vh; transition: margin-left .28s var(--ease); }
html.sb-noanim .app-main, html.sb-noanim .sb, html.sb-noanim .sb * { transition: none !important; }
.page { max-width: 1240px; margin: 0 auto; padding: 44px 40px 96px; }
.page.narrow { max-width: 880px; }
.page.wide { max-width: 1480px; }
.ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 30px; flex-wrap: wrap; }
.ph .t { min-width: 0; }
.ph .eyebrow { margin-bottom: 12px; }
.ph .lead { margin-top: 10px; }
.ph .acts { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-3); margin-bottom: 12px; }
.crumbs a { color: var(--text-2); } .crumbs a:hover { color: var(--text); }
.enter { animation: enter .42s var(--ease) both; }
.enter-2 { animation: enter .42s .05s var(--ease) both; }
.enter-3 { animation: enter .42s .1s var(--ease) both; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { 0% { transform: scale(.94); opacity: 0; } 100% { transform: none; opacity: 1; } }

/* ── cartes & sections ────────────────────────────────────────────────── */
.card { position: relative; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-1); }
.card.pad { padding: 24px; }
.card.hover { transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.card.hover:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.group { position: relative; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-1); }
.group:focus-within { z-index: 5; }
.group + .group { margin-top: 18px; }
.group-h { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 24px 0; }
.group-h .step { width: 26px; height: 26px; flex: none; border-radius: 50%; display: grid; place-items: center;
                 background: var(--bg-2); color: var(--text-2); font: 600 12px/1 var(--sans); }
.group-h .step.done { background: var(--ink); color: #fff; }
.group-b { padding: 18px 24px 24px; }
.row { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .lbl { font-weight: 500; }
.row .sub { color: var(--text-2); font-size: 13px; margin-top: 2px; }
.sep { height: 1px; background: var(--line); margin: 18px 0; border: 0; }

/* ── boutons ──────────────────────────────────────────────────────────── */
.btn { --h: 38px; position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--h);
       padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text);
       font: 500 14px/1 var(--sans); letter-spacing: -.01em; white-space: nowrap; text-decoration: none;
       transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease),
                   box-shadow var(--dur) var(--ease), transform .12s var(--ease), opacity var(--dur); user-select: none; }
.btn:hover { background: var(--surface-2); border-color: var(--line-3); }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.btn.sm { --h: 32px; padding: 0 12px; font-size: 13px; }
.btn.lg { --h: 48px; padding: 0 24px; font-size: 15px; font-weight: 600; }
.btn.xl { --h: 56px; padding: 0 30px; font-size: 16px; font-weight: 600; }
.btn.block { width: 100%; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: #000; border-color: #000; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 10px 26px -12px rgba(243, 112, 33, .7); }
.btn.accent:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: rgba(29, 29, 31, .05); color: var(--text); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); border-color: rgba(209, 52, 58, .35); }
.btn.solid-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.solid-danger:hover { background: #b82a30; }
.btn .spin { margin-right: 2px; }
.btn.loading { color: transparent !important; pointer-events: none; }
.btn.loading::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor;
                      border-color: rgba(255,255,255,.9) rgba(255,255,255,.9) rgba(255,255,255,.25) rgba(255,255,255,.25);
                      animation: spin .7s linear infinite; }
.btn:not(.primary):not(.accent):not(.solid-danger).loading::after { border-color: var(--text-2) var(--text-2) var(--line-2) var(--line-2); }
.icon-btn { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 10px; border: 0; background: transparent;
            color: var(--text-2); transition: background var(--dur), color var(--dur); }
.icon-btn:hover { background: rgba(29, 29, 31, .06); color: var(--text); }
.icon-btn.danger:hover { background: var(--bad-soft); color: var(--bad); }
.icon-btn svg { width: 17px; height: 17px; }
.link { border: 0; background: none; padding: 0; color: var(--accent-strong); font-weight: 500; cursor: pointer; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ── champs ───────────────────────────────────────────────────────────── */
.field { display: block; }
.field + .field { margin-top: 16px; }
.label { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px;
         font: 500 13px/1.3 var(--sans); color: var(--text); }
.label .val { color: var(--text-2); font-variant-numeric: tabular-nums; font-weight: 500; }
.hint { margin-top: 7px; font-size: 12.5px; color: var(--text-2); line-height: 1.45; }
.input, .select, .textarea { width: 100%; min-height: 42px; padding: 0 14px; border-radius: var(--r); border: 1px solid var(--line-2);
         background: var(--surface); color: var(--text); font-size: 14.5px; transition: border-color var(--dur), box-shadow var(--dur);
         -webkit-appearance: none; appearance: none; }
.textarea { padding: 10px 14px; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:hover, .select:hover { border-color: var(--line-3); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.select { padding-right: 36px; cursor: pointer;
          background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%236e6e73' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 4.5 3 3 3-3'/%3E%3C/svg%3E");
          background-repeat: no-repeat; background-position: right 14px center; }
.input.mono { font-family: var(--mono); font-size: 13.5px; }

/* combobox (saisie + liste déroulante) */
.cb { position: relative; }
.cb-in { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 12px 0 14px; border-radius: var(--r); border: 1px solid var(--line-2);
         background: var(--surface); cursor: text; transition: border-color var(--dur), box-shadow var(--dur); }
.cb-in:hover { border-color: var(--line-3); }
.cb.open .cb-in, .cb-in:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.cb-in input { flex: 1; min-width: 0; height: 44px; border: 0; outline: 0; background: transparent; font-size: 15px; }
.cb-in input::placeholder { color: var(--text-3); }
.cb-ico { width: 22px; flex: none; display: grid; place-items: center; font-size: 17px; color: var(--text-2); }
.cb-ico svg { width: 17px; height: 17px; }
.cb-chev { color: var(--text-3); transition: transform var(--dur) var(--ease); }
.cb.open .cb-chev { transform: rotate(180deg); }
.cb-clear { border: 0; background: var(--bg-2); color: var(--text-2); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; }
.cb-clear:hover { background: var(--bg-3); color: var(--text); }
.cb-list { position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 8px); max-height: 340px; overflow: auto; padding: 6px;
           background: rgba(255, 255, 255, .96); -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
           border-radius: 16px; box-shadow: var(--sh-3), 0 0 0 1px var(--line); opacity: 0; transform: translateY(-4px) scale(.99);
           transform-origin: top; pointer-events: none; transition: opacity .16s var(--ease), transform .16s var(--ease); overscroll-behavior: contain; }
.cb.open .cb-list { opacity: 1; transform: none; pointer-events: auto; }
.cb-opt { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; cursor: pointer; }
.cb-opt .e { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 8px; background: var(--bg-2); font-size: 16px; }
.cb-opt .t { flex: 1; min-width: 0; }
.cb-opt .t b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb-opt .t span { display: block; font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb-opt .r { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.cb-opt.act { background: var(--bg-2); }
.cb-opt.sel .t b { color: var(--accent-strong); }
.cb-opt.special .e { background: var(--accent-soft); }
.cb-sep { height: 1px; background: var(--line); margin: 6px 8px; }
.cb-head { padding: 8px 10px 4px; font: 600 11px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.cb-empty { padding: 18px 12px; text-align: center; color: var(--text-2); font-size: 13.5px; }
mark { background: transparent; color: var(--accent-strong); font-weight: 600; }

/* contrôle segmenté */
.seg { position: relative; display: inline-flex; padding: 3px; gap: 2px; background: var(--bg-2); border-radius: 999px; }
.seg button { position: relative; z-index: 1; height: 32px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent;
              color: var(--text-2); font: 500 13px/1 var(--sans); white-space: nowrap; transition: color var(--dur); }
.seg button:hover { color: var(--text); }
.seg button.on { color: var(--text); background: var(--surface); box-shadow: 0 1px 3px rgba(29,29,31,.1), 0 0 0 .5px rgba(29,29,31,.06); }
.seg.block { display: flex; } .seg.block button { flex: 1; }

/* curseur */
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; margin: 0; background: transparent; cursor: pointer; --p: 0%; }
.range::-webkit-slider-runnable-track { height: 5px; border-radius: 99px; background: linear-gradient(to right, var(--accent) var(--p), var(--bg-3) var(--p)); }
.range::-moz-range-track { height: 5px; border-radius: 99px; background: var(--bg-3); }
.range::-moz-range-progress { height: 5px; border-radius: 99px; background: var(--accent); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -8.5px; border-radius: 50%; background: #fff;
                               box-shadow: 0 1px 4px rgba(0,0,0,.25), 0 0 0 .5px rgba(0,0,0,.08); transition: transform .12s var(--ease); }
.range:active::-webkit-slider-thumb { transform: scale(1.12); }
.range::-moz-range-thumb { width: 22px; height: 22px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.range:focus-visible { outline: none; }
.range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 5px var(--accent-ring), 0 1px 4px rgba(0,0,0,.25); }
.ticks { display: flex; justify-content: space-between; margin-top: 2px; font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* interrupteur */
.switch { -webkit-appearance: none; appearance: none; position: relative; width: 44px; height: 26px; flex: none; margin: 0; border-radius: 99px;
          background: var(--bg-3); cursor: pointer; transition: background .2s var(--ease); }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: #fff;
                 box-shadow: 0 2px 5px rgba(0,0,0,.2); transition: transform .24s var(--ease); }
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(18px); }
.switch:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--accent-ring); }
.check { -webkit-appearance: none; appearance: none; width: 20px; height: 20px; flex: none; margin: 0; border-radius: 6px; border: 1.5px solid var(--line-3);
         background: var(--surface); display: inline-grid; place-content: center; cursor: pointer; transition: background .15s, border-color .15s; }
.check:checked { background: var(--ink); border-color: var(--ink); }
.check:checked::after { content: ""; width: 10px; height: 5px; margin-top: -2px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg); }
.check:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--accent-ring); }
.stepper { display: inline-flex; align-items: center; border-radius: 999px; background: var(--bg-2); padding: 3px; }
.stepper button { width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; font-size: 17px; color: var(--text-2); }
.stepper button:hover { background: var(--surface); color: var(--text); box-shadow: var(--sh-1); }
.stepper output { min-width: 34px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.swatch { width: 28px; height: 28px; border-radius: 50%; border: 0; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12);
          transition: transform .12s var(--ease), box-shadow .15s; }
.swatch:hover { transform: scale(1.08); }
.swatch.on { box-shadow: inset 0 0 0 1px rgba(0,0,0,.12), 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }
.swatch-in { position: relative; width: 28px; height: 28px; border-radius: 50%; overflow: hidden; cursor: pointer;
             background: conic-gradient(red, yellow, lime, aqua, blue, magenta, red); box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.swatch-in input { position: absolute; inset: -8px; width: 44px; height: 44px; opacity: 0; cursor: pointer; }

/* ── pastilles, badges, états ─────────────────────────────────────────── */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; background: var(--bg-2);
        color: var(--text-2); font: 500 12px/1 var(--sans); white-space: nowrap; }
.pill svg { width: 13px; height: 13px; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.accent { background: var(--accent-soft); color: var(--accent-strong); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.ink { background: var(--ink); color: #fff; }
.pill .d { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.live .d { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
.kbd { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 5px; background: var(--surface);
       box-shadow: 0 0 0 1px var(--line-2), 0 1px 0 var(--line-2); font: 500 11px/1 var(--mono); color: var(--text-2); }

/* ── progression & chargement ─────────────────────────────────────────── */
.spin { display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--accent);
        animation: spin .7s linear infinite; vertical-align: middle; }
.spin.lg { width: 28px; height: 28px; border-width: 2.5px; }
@keyframes spin { to { transform: rotate(360deg); } }
.bar { position: relative; height: 6px; border-radius: 99px; background: var(--bg-2); overflow: hidden; }
.bar > i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--accent), #ff9a52);
           transition: width .5s var(--ease); }
.bar > i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
                  transform: translateX(-100%); animation: sheen 1.6s var(--ease) infinite; }
.bar.idle > i::after, .bar.done > i::after { display: none; }
.bar.done > i { background: var(--ok); }
.bar.indet > i { width: 36% !important; animation: indet 1.2s var(--ease) infinite; }
@keyframes sheen { to { transform: translateX(200%); } }
@keyframes indet { 0% { left: -36%; } 100% { left: 100%; } }
.ring { --p: 0; --size: 44px; width: var(--size); height: var(--size); border-radius: 50%; flex: none; display: grid; place-items: center;
        background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--bg-2) 0); transition: --p .5s var(--ease); }
.ring::before { content: ""; grid-area: 1 / 1; width: calc(var(--size) - 8px); height: calc(var(--size) - 8px); border-radius: 50%; background: var(--surface); }
.ring > span { grid-area: 1 / 1; position: relative; font: 600 11px/1 var(--sans); font-variant-numeric: tabular-nums; }
@property --p { syntax: "<number>"; inherits: false; initial-value: 0; }
.skel { position: relative; overflow: hidden; background: var(--bg-2); border-radius: var(--r); }
.skel::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.65), transparent);
               transform: translateX(-100%); animation: sheen 1.3s ease-in-out infinite; }
.skel.line { height: 12px; border-radius: 6px; }
.dots::after { content: "…"; display: inline-block; animation: dots 1.2s steps(4, end) infinite; overflow: hidden; vertical-align: bottom; width: 0; }
@keyframes dots { to { width: 1.1em; } }

/* ── vides & zones de dépôt ───────────────────────────────────────────── */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 72px 24px; }
.empty .ico { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--surface); box-shadow: var(--sh-1);
              color: var(--accent); margin-bottom: 6px; }
.empty .ico svg { width: 28px; height: 28px; }
.empty .h2 { font-size: 20px; }
.empty p { margin: 0 0 8px; max-width: 420px; color: var(--text-2); }
.drop { position: relative; display: flex; align-items: center; gap: 20px; padding: 26px 28px; border-radius: var(--r-xl); cursor: pointer;
        background: var(--surface); box-shadow: var(--sh-1); transition: box-shadow var(--dur), transform var(--dur) var(--ease), background var(--dur); }
.drop::before { content: ""; position: absolute; inset: 8px; border-radius: 18px; border: 1.5px dashed var(--line-2); pointer-events: none;
                transition: border-color var(--dur); }
.drop:hover { box-shadow: var(--sh-2); }
.drop:hover::before { border-color: var(--line-3); }
.drop .ico { width: 54px; height: 54px; flex: none; border-radius: 16px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-strong);
             transition: transform .3s var(--ease); }
.drop .ico svg { width: 24px; height: 24px; }
.drop:hover .ico { transform: translateY(-2px); }
.drop .t b { display: block; font-size: 16px; font-weight: 600; letter-spacing: -.015em; }
.drop .t span { color: var(--text-2); font-size: 13.5px; }
body.dragging .drop { background: var(--accent-soft); transform: scale(1.005); }
body.dragging .drop::before { border-color: var(--accent); border-style: solid; }
.dropveil { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: rgba(246, 243, 238, .72);
            -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); opacity: 0; pointer-events: none; transition: opacity .2s var(--ease); }
body.dragging .dropveil { opacity: 1; }
.dropveil .card { padding: 34px 40px; text-align: center; animation: pop .3s var(--ease) both; }
.dropveil .ico { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 20px; display: grid; place-items: center; background: var(--accent); color: #fff; }
.dropveil .ico svg { width: 28px; height: 28px; }

/* ── tuiles médias ────────────────────────────────────────────────────── */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.tile { position: relative; aspect-ratio: 9 / 16; border-radius: 14px; overflow: hidden; background: var(--bg-2); border: 0; padding: 0; cursor: zoom-in;
        box-shadow: var(--sh-1); transition: transform .28s var(--ease), box-shadow .28s var(--ease); }
.tile.sq { aspect-ratio: 1; }
.tile:hover { transform: translateY(-3px); box-shadow: var(--sh-2); }
.tile img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .4s var(--ease), transform .5s var(--ease); }
.tile img.ld { opacity: 1; }
.tile:hover img { transform: scale(1.04); }
.tile .tag { position: absolute; left: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px;
             border-radius: 999px; background: rgba(0,0,0,.55); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
             color: #fff; font: 600 11px/1 var(--sans); font-variant-numeric: tabular-nums; }
.tile .tag svg { width: 9px; height: 9px; }
.tile .cc { position: absolute; right: 8px; bottom: 8px; height: 22px; padding: 0 7px; border-radius: 999px; display: inline-grid; place-items: center;
            font: 700 10px/1 var(--sans); letter-spacing: .04em; color: #fff; background: rgba(0,0,0,.55); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.tile .cc.ok { background: rgba(31, 138, 76, .9); } .tile .cc.run { background: rgba(243, 112, 33, .92); }
.tile .new { position: absolute; top: 9px; right: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px #fff; }
.tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ── dialogues, notifications, menus ──────────────────────────────────── */
dialog.dlg { width: min(460px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: var(--r-xl); background: var(--surface); color: var(--text);
             box-shadow: var(--sh-3); }
dialog.dlg[open] { animation: pop .26s var(--ease) both; }
dialog.dlg::backdrop { background: rgba(29, 29, 31, .32); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade .2s both; }
dialog.dlg.wide { width: min(720px, calc(100vw - 32px)); }
.dlg .in { padding: 28px; }
.dlg .h2 { margin-bottom: 8px; }
.dlg .btns { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.dlg .x { position: absolute; top: 14px; right: 14px; }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 200; display: flex; align-items: center; gap: 10px; max-width: min(520px, calc(100vw - 32px));
         padding: 12px 18px; border-radius: 999px; background: rgba(29, 29, 31, .92); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
         color: #fff; font-weight: 500; box-shadow: var(--sh-3); transform: translate(-50%, 16px); opacity: 0; transition: .32s var(--ease); pointer-events: none; }
.toast.on { transform: translate(-50%, 0); opacity: 1; }
.toast .i { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--ok); flex: none; }
.toast .i.bad { background: var(--bad); }
.toast .i svg { width: 12px; height: 12px; }
.menu { position: fixed; z-index: 150; min-width: 200px; padding: 6px; border-radius: 14px; background: rgba(255,255,255,.96);
        -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%); box-shadow: var(--sh-3), 0 0 0 1px var(--line);
        animation: pop .16s var(--ease) both; transform-origin: top left; }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 9px; background: transparent;
               text-align: left; font-size: 14px; color: var(--text); }
.menu button:hover, .menu button:focus-visible { background: var(--bg-2); outline: none; }
.menu button svg { width: 16px; height: 16px; color: var(--text-2); }
.menu button.danger { color: var(--bad); } .menu button.danger svg { color: var(--bad); }
.menu hr { border: 0; height: 1px; background: var(--line); margin: 5px 6px; }

/* ── tableau ──────────────────────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { padding: 12px 14px; text-align: left; font: 600 11px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3);
            border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.click { cursor: pointer; transition: background .15s; }
.table tr.click:hover td { background: var(--surface-2); }

/* ── barre latérale ───────────────────────────────────────────────────── */
.sb { position: fixed; z-index: 50; top: 0; bottom: 0; left: 0; width: var(--sb-cur); display: flex; flex-direction: column;
      background: rgba(246, 243, 238, .82); -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
      border-right: 1px solid var(--line); transition: width .28s var(--ease), transform .3s var(--ease); overflow: hidden; }
.sb-head { display: flex; align-items: center; gap: 10px; height: 68px; padding: 0 14px 0 20px; flex: none; }
.sb-brand { display: flex; align-items: center; gap: 11px; min-width: 0; flex: 1; color: var(--text); }
.logo { position: relative; width: 32px; height: 32px; flex: none; border-radius: 10px; background: var(--ink); color: #fff; display: grid; place-items: center;
        font: italic 400 19px/1 var(--serif); letter-spacing: -.02em; box-shadow: 0 4px 12px -4px rgba(0,0,0,.35); }
.logo::after { content: ""; position: absolute; right: -2px; top: -2px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent);
               box-shadow: 0 0 0 2.5px var(--bg); }
.wordmark { font: 600 16px/1 var(--sans); letter-spacing: -.02em; white-space: nowrap; transition: opacity .18s; }
.wordmark i { font: italic 400 19px/1 var(--serif); letter-spacing: -.01em; margin-right: 3px; }
.sb-toggle { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border: 0; border-radius: 9px; background: transparent; color: var(--text-3); }
.sb-toggle:hover { background: rgba(29,29,31,.06); color: var(--text); }
.sb-toggle svg { width: 17px; height: 17px; transition: transform .28s var(--ease); }
html.sb-min .sb-toggle svg { transform: rotate(180deg); }
.sb-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 4px 12px 18px; scrollbar-width: none; }
.sb-nav::-webkit-scrollbar { display: none; }
.sb-sec { margin-top: 20px; }
.sb-sec:first-child { margin-top: 6px; }
.sb-sec-h { display: flex; align-items: center; height: 26px; padding: 0 8px 0 12px; }
.sb-sec-t { flex: 1; font: 600 11px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); white-space: nowrap; transition: opacity .18s; }
.sb-add { width: 24px; height: 24px; display: grid; place-items: center; border: 0; border-radius: 7px; background: transparent; color: var(--text-3); transition: opacity .18s; }
.sb-add:hover { background: rgba(29,29,31,.07); color: var(--text); }
.sb-add svg { width: 15px; height: 15px; }
.sb-link { position: relative; display: flex; align-items: center; gap: 12px; height: 38px; margin-top: 2px; padding: 0 10px 0 12px; border-radius: 11px;
           color: var(--text-2); font: 500 14px/1 var(--sans); white-space: nowrap; transition: background .16s, color .16s, box-shadow .16s; outline: none; }
.sb-link svg { width: 18px; height: 18px; flex: none; }
.sb-link:hover { background: rgba(29, 29, 31, .05); color: var(--text); }
.sb-link:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.sb-link.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(29,29,31,.08), 0 0 0 .5px rgba(29,29,31,.06); }
.sb-link.on svg { color: var(--accent); }
.sb-link.sub { height: 34px; padding-left: 16px; font-size: 13.5px; }
.sb-link.sub .fdot { width: 18px; display: grid; place-items: center; }
.sb-link.sub .fdot i { width: 7px; height: 7px; border-radius: 2px; background: var(--text-3); transition: background .16s; }
.sb-link.sub.on .fdot i { background: var(--accent); }
.sb-lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; transition: opacity .18s; }
.sb-badge { min-width: 22px; height: 20px; padding: 0 7px; border-radius: 999px; display: inline-grid; place-items: center; background: rgba(29,29,31,.06);
            color: var(--text-2); font: 600 11px/1 var(--sans); font-variant-numeric: tabular-nums; transition: opacity .18s; }
.sb-badge:empty { display: none; }
.sb-badge.hot { background: var(--accent); color: #fff; }
.sb-badge.ok { background: var(--ok-soft); color: var(--ok); }
.sb-badge.bad { background: var(--bad-soft); color: var(--bad); }
.sb-more { width: 26px; height: 26px; margin-right: -4px; display: grid; place-items: center; border: 0; border-radius: 7px; background: transparent;
           color: var(--text-3); opacity: 0; transition: opacity .15s; }
.sb-link:hover .sb-more, .sb-more:focus-visible, .sb-link.on .sb-more { opacity: 1; }
.sb-more:hover { background: rgba(29,29,31,.08); color: var(--text); }
.sb-more svg { width: 15px; height: 15px; }
.sb-edit { width: 100%; height: 34px; margin-top: 2px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--accent); background: var(--surface);
           box-shadow: 0 0 0 4px var(--accent-ring); font: 500 13.5px var(--sans); outline: none; }
.sb-empty { padding: 6px 12px 2px; font-size: 12.5px; color: var(--text-3); white-space: nowrap; }
.sb-foot { flex: none; padding: 12px; }
.sb-status { display: flex; align-items: center; gap: 10px; padding: 0 12px 8px; font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; }
.sb-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex: none; margin: 0 5.5px; box-shadow: 0 0 0 3px var(--ok-soft); }
.sb-status.bad i { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.sb-status:empty { display: none; }
.sb-me { display: flex; align-items: center; gap: 11px; padding: 10px; border-radius: 14px; background: var(--surface); box-shadow: var(--sh-1); }
.sb-av { width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #f7a15e, var(--accent));
         color: #fff; font: 600 13px/1 var(--sans); text-transform: uppercase; }
.sb-who { flex: 1; min-width: 0; line-height: 1.25; transition: opacity .18s; }
.sb-who b { display: block; font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-who span { display: block; font: 500 11px/1.4 var(--mono); color: var(--text-3); white-space: nowrap; }
.sb-out { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border: 0; border-radius: 9px; background: transparent; color: var(--text-3); }
.sb-out:hover { background: var(--bad-soft); color: var(--bad); }
.sb-out svg { width: 16px; height: 16px; }
html.sb-min .wordmark, html.sb-min .sb-lbl, html.sb-min .sb-sec-t, html.sb-min .sb-who, html.sb-min .sb-badge,
html.sb-min .sb-add, html.sb-min .sb-more, html.sb-min .sb-status span, html.sb-min .sb-empty { opacity: 0; pointer-events: none; }
html.sb-min .sb-head { padding: 0 0 0 20px; }
html.sb-min .sb-brand { flex: 0 0 32px; }
html.sb-min .sb-toggle { position: absolute; left: 21px; top: 19px; opacity: 0; background: var(--bg); }
html.sb-min .sb-head:hover .sb-toggle, html.sb-min .sb-toggle:focus-visible { opacity: 1; }
html.sb-min .sb-link { padding: 0 15px; }
html.sb-min .sb-link.sub { padding-left: 15px; }
html.sb-min .sb-me { padding: 8px; background: transparent; box-shadow: none; }
html.sb-min .sb-out { display: none; }
.sb-tip { position: fixed; z-index: 300; padding: 7px 11px; border-radius: 9px; background: var(--ink); color: #fff; font: 500 12.5px/1.2 var(--sans);
          pointer-events: none; white-space: nowrap; opacity: 0; transform: translateX(-4px); transition: opacity .12s, transform .12s; box-shadow: var(--sh-2); }
.sb-tip.on { opacity: 1; transform: none; }
.viewbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: center; gap: 14px; padding: 10px 16px;
           background: var(--ink); color: #fff; font-size: 13.5px; }
.viewbar b { font-weight: 600; }
.viewbar button { height: 30px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 600; font-size: 13px; }
.mtop { display: none; }
.sb-scrim { display: none; }

/* ── mobile ───────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .app-main { margin-left: 0; }
  .page { padding: 24px 18px 80px; }
  .ph { margin-bottom: 22px; }
  .sb { width: min(86vw, 320px); transform: translateX(-104%); background: rgba(246, 243, 238, .97); }
  html.sb-open .sb { transform: none; box-shadow: var(--sh-3); }
  html.sb-min .wordmark, html.sb-min .sb-lbl, html.sb-min .sb-sec-t, html.sb-min .sb-who, html.sb-min .sb-badge,
  html.sb-min .sb-add, html.sb-min .sb-status span, html.sb-min .sb-empty { opacity: 1; pointer-events: auto; }
  html.sb-min .sb-more { pointer-events: auto; }
  html.sb-min .sb-head { padding: 0 14px 0 20px; } html.sb-min .sb-brand { flex: 1; }
  html.sb-min .sb-toggle { position: static; opacity: 1; background: transparent; }
  html.sb-min .sb-link { padding: 0 10px 0 12px; } html.sb-min .sb-link.sub { padding-left: 16px; }
  html.sb-min .sb-me { padding: 10px; background: var(--surface); box-shadow: var(--sh-1); } html.sb-min .sb-out { display: grid; }
  .sb-toggle svg { transform: rotate(0) !important; }
  .sb-more { opacity: 1; }
  .sb-link { height: 44px; font-size: 15px; } .sb-link.sub { height: 40px; }
  .sb-scrim { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(29, 29, 31, .3); -webkit-backdrop-filter: blur(3px);
              backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity .3s var(--ease); }
  html.sb-open .sb-scrim { opacity: 1; pointer-events: auto; }
  html.sb-open, html.sb-open body { overflow: hidden; }
  .mtop { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 8px; height: 58px; padding: 0 10px 0 8px;
          background: rgba(246, 243, 238, .86); -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
          border-bottom: 1px solid var(--line); }
  .mtop > button { width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 12px; background: transparent; color: var(--text); }
  .mtop > button:active { background: rgba(29,29,31,.06); }
  .mtop > button svg { width: 22px; height: 22px; }
  .mtop-t { flex: 1; min-width: 0; font: 600 16px/1 var(--sans); letter-spacing: -.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .viewbar { top: 58px; }
  .toast { bottom: calc(20px + env(safe-area-inset-bottom)); }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
  .drop { padding: 20px; gap: 16px; }
  .group-h { padding: 18px 18px 0; } .group-b { padding: 16px 18px 20px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* grilles de champs alignées ; pas de zoom automatique iOS sur les champs */
.grid2 > .field + .field, .grid2 > .field { margin-top: 0; }
@media (max-width: 900px) {
  .input, .select, .textarea, .cb-in input, .sb-edit, .title-edit, .mp-filter { font-size: 16px; }
}
