/* ===== V-Storm App — pont de variables (JS inline) + STYLE DU ZIP VERBATIM ===== */
:root{ --bg:var(--vs-bg); --card:var(--vs-card); --nav:var(--vs-card); --accent:var(--vs-violet); --accent-hover:var(--vs-violet-2); --accent-light:var(--vs-violet-light); --border:var(--vs-border); --text:var(--vs-text); --text-muted:var(--vs-text-mute); --input-bg:var(--vs-card-2); --btn-ghost:rgba(255,255,255,0.06); --btn-ghost-hover:rgba(255,255,255,0.12); --shadow:rgba(0,0,0,0.6); }
/* ---- style du ZIP tel quel (body.light -> [data-theme=light] pour coller au toggle existant) ---- */
  :root { --pop: #a88cff; --pop-soft: rgba(122,82,255,0.16); --mint: #3ddc97; --mint-soft: rgba(61,220,151,0.12); --blue: #4f7cff; --blue-soft: rgba(79,124,255,0.14); }

  /* sun/moon toggle */
  #themeToggle .ic-moon { display: none; }
  [data-theme="light"] #themeToggle .ic-sun { display: none; }
  [data-theme="light"] #themeToggle .ic-moon { display: block; }

  /* ============ THÈME CLAIR ============ */
  [data-theme="light"] {
    --vs-bg: #f5f3fc; --vs-card: #ffffff; --vs-card-2: #f7f5fd; --vs-card-hi: #efecf9;
    --vs-overlay: rgba(255,255,255,0.78);
    --vs-border: rgba(90,46,229,0.12); --vs-border-hi: rgba(90,46,229,0.24);
    --vs-text: #1a1430; --vs-text-2: #37315a; --vs-text-mute: #6a6088; --vs-text-dim: #8a82a5; --vs-text-faint: #b6afcc;
    --vs-violet-light: #5a2ee5; --vs-violet-tint: rgba(122,82,255,0.10);
    --vs-shadow-card: 0 1px 2px rgba(30,20,60,0.04), 0 10px 30px rgba(90,46,229,0.08);
    --pop-soft: rgba(122,82,255,0.10);
    color: var(--vs-text);
  }
  [data-theme="light"] .stage {
    background:
      radial-gradient(900px 500px at 88% -10%, rgba(122,82,255,0.12), transparent 60%),
      radial-gradient(700px 500px at 0% 108%, rgba(122,82,255,0.08), transparent 55%),
      #f5f3fc;
  }
  [data-theme="light"] .stars { display: none; }
  [data-theme="light"] .top { background: rgba(255,255,255,0.82); }
  [data-theme="light"] .status { color: var(--vs-text-2); }
  /* champs de saisie : texte lisible en clair */
  [data-theme="light"] .search input, [data-theme="light"] .sel, [data-theme="light"] .field .in, [data-theme="light"] textarea.in { color: var(--vs-text); }
  [data-theme="light"] .search, [data-theme="light"] .sel, [data-theme="light"] .field .in, [data-theme="light"] textarea.in,
  [data-theme="light"] .acct, [data-theme="light"] .iconbtn, [data-theme="light"] .btn.ghost, [data-theme="light"] .abtn.zip, [data-theme="light"] .chk, [data-theme="light"] .drop, [data-theme="light"] .thumb.more { background: rgba(122,82,255,0.05); }
  [data-theme="light"] .sel option { background: #ffffff; color: var(--vs-text); }
  /* onglet actif visible en clair */
  [data-theme="light"] .tab.on { color: var(--vs-violet-2); }
  /* survols qui viraient au blanc */
  [data-theme="light"] .iconbtn:hover, [data-theme="light"] .btn.ghost:hover, [data-theme="light"] .abtn.zip:hover, [data-theme="light"] .selbar .lk:hover { color: var(--vs-text); }
  /* nav mobile en clair */
  [data-theme="light"] .mnav { background: rgba(255,255,255,0.92); border-top: 1px solid var(--vs-border); }
  /* surfaces cartes en clair (fond blanc + ombre douce) */
  [data-theme="light"] .art, [data-theme="light"] .stat, [data-theme="light"] .crow { background: #ffffff; box-shadow: 0 1px 2px rgba(30,20,60,0.04), 0 8px 24px rgba(90,46,229,0.06); }
  [data-theme="light"] .chk { background: rgba(90,46,229,0.05); border-color: var(--vs-border-hi); }
  [data-theme="light"] .thumb { background-color: #efecf9; }
  [data-theme="light"] .btn { background: rgba(90,46,229,0.05); }
  [data-theme="light"] .art__title, [data-theme="light"] .stat .v { color: var(--vs-text); }
  * { box-sizing: border-box; }
  html, body { height: 100%; margin: 0; }
  body { background: #08080c; font-family: 'Inter', system-ui, sans-serif; color: var(--vs-text); -webkit-font-smoothing: antialiased; }

  .stage { position: relative; min-height: 100vh; overflow-x: hidden; background:
      radial-gradient(900px 500px at 88% -10%, rgba(122,82,255,0.16), transparent 60%),
      radial-gradient(700px 500px at 0% 108%, rgba(90,46,229,0.12), transparent 55%),
      #08080c; }
  .stars { position: fixed; inset: 0; pointer-events: none; opacity: 0.55; z-index: 0;
    background-image:
      radial-gradient(1.4px 1.4px at 12% 18%, rgba(255,255,255,0.7), transparent),
      radial-gradient(1.4px 1.4px at 82% 12%, rgba(255,255,255,0.5), transparent),
      radial-gradient(1px 1px at 66% 36%, rgba(255,255,255,0.5), transparent),
      radial-gradient(1px 1px at 26% 62%, rgba(196,179,255,0.5), transparent),
      radial-gradient(1.4px 1.4px at 92% 70%, rgba(196,179,255,0.55), transparent),
      radial-gradient(1px 1px at 8% 82%, rgba(255,255,255,0.4), transparent),
      radial-gradient(1px 1px at 46% 88%, rgba(255,255,255,0.35), transparent);
    background-repeat: no-repeat; }

  button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
  a { color: inherit; text-decoration: none; }

  /* ---------------- Top bar ---------------- */
  .top { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 14px; padding: 16px 28px; background: #0f0f17; border-bottom: 1px solid rgba(255,255,255,0.08); }
  .logo { display: inline-flex; align-items: center; flex-shrink: 0; text-decoration: none; border-radius: 11px; }
  .logo img { height: 42px; width: auto; display: block; }
  /* logo blanc → fond sombre + fin contour noir en thème clair */
  [data-theme="light"] .logo { background: #14101f; padding: 6px 12px; border: 1px solid rgba(0,0,0,0.25); box-shadow: 0 1px 3px rgba(20,10,40,0.14); }
  [data-theme="light"] .logo img { height: 34px; }
  .top__sp { flex: 1; }
  .status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--vs-text-2); }
  .status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 8px var(--mint); animation: pulse 2s ease-in-out infinite; }
  @keyframes pulse { 0%,100%{ opacity: 1; } 50%{ opacity: 0.45; } }
  .acct { display: inline-flex; align-items: center; gap: 9px; height: 40px; padding: 0 15px 0 5px; border-radius: 999px; background: rgba(255,255,255,0.05); border: 1px solid var(--vs-border); font-size: 13px; font-weight: 600; max-width: 220px; cursor: pointer; transition: border-color .15s; }
  .acct:hover { border-color: var(--vs-border-hi); }
  .acct__av { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; font-size: 13px; font-weight: 800; color: #fff; background: var(--vs-violet-grad); border: 1px solid var(--vs-border-hi); }
  .acct__e { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--vs-text-2); font-weight: 700; }
  .acct__img { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; display: block; }
  .iconbtn { width: 40px; height: 40px; border-radius: 999px; display: grid; place-items: center; color: var(--vs-text-mute); background: rgba(255,255,255,0.05); border: 1px solid var(--vs-border); transition: color .15s, border-color .15s; position: relative; }
  .iconbtn:hover { color: #fff; border-color: var(--vs-border-hi); }
  .iconbtn svg { width: 17px; height: 17px; }
  .iconbtn .badge { position: absolute; top: -3px; right: -3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--vs-violet); color: #fff; font-size: 10px; font-weight: 800; display: grid; place-items: center; border: 2px solid #08080c; }
  .iconbtn.power:hover { color: #f0625a; border-color: rgba(240,98,90,0.4); }

  /* ---------------- Tab nav ---------------- */
  .tabs { position: sticky; top: 73px; z-index: 30; display: flex; gap: 2px; padding: 0 28px; background: #0f0f17; border-bottom: 1px solid rgba(255,255,255,0.08); overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { position: relative; display: inline-flex; align-items: center; gap: 9px; padding: 15px 20px; font-size: 14px; font-weight: 700; color: var(--vs-text-mute); white-space: nowrap; cursor: pointer; transition: color .15s; }
  .tab svg { width: 17px; height: 17px; }
  .tab:hover { color: var(--vs-text); }
  .tab.on { color: #fff; }
  .tab.on::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 2.5px; border-radius: 3px; background: var(--vs-violet-grad); box-shadow: 0 0 12px rgba(122,82,255,0.7); }
  .tab .cnt { font-size: 11.5px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: rgba(200,242,78,0.13); color: #c8f24e; border: 1px solid rgba(200,242,78,0.30); }
  .tab.on .cnt { background: #c8f24e; color: #0a0a0a; border-color: transparent; }

  /* ---------------- Page wrap ---------------- */
  .wrap { position: relative; z-index: 2; max-width: 1080px; margin: 0 auto; padding: 26px 24px 120px; }
  .view { display: none; animation: fade .3s ease; }
  .view.on { display: block; }
  @keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

  /* header row */
  .card-blk { background: rgba(255,255,255,0.02); border: 1px solid var(--vs-border); border-radius: 16px; padding: 14px; margin-bottom: 12px; }
  [data-view="add"] { max-width: 560px; margin: 0 auto; }
  [data-view="add"] .phead { margin-bottom: 14px; }
  [data-view="add"] .phead h1 { font-size: 19px; }
  [data-view="add"] .phead p { font-size: 12.5px; }
  [data-view="add"] .field { gap: 12px; margin: 0; max-width: none; }
  [data-view="add"] .field label { font-size: 11px; margin-bottom: 6px; }
  [data-view="add"] .field .in, [data-view="add"] .sel { height: 40px; font-size: 13px; border-radius: 10px; }
  [data-view="add"] .sechd { font-size: 11px; margin-bottom: 12px; }
  .opt { font-weight: 500; color: var(--vs-text-mute); }
  .inpfx { display: flex; align-items: stretch; gap: 0; }
  .inpfx .pfx { display: grid; place-items: center; width: 34px; border: 1px solid var(--vs-border); border-right: 0; border-radius: 10px 0 0 10px; background: rgba(255,255,255,0.04); color: var(--vs-text-mute); font-weight: 700; font-size: 13px; }
  .inpfx .in { flex: 1; border-radius: 0 10px 10px 0 !important; }
  .lblrow { display: flex; align-items: center; justify-content: space-between; }
  .lk-gerer { font-size: 12px; font-weight: 700; color: var(--vs-violet-light); text-decoration: none; }
  .lk-gerer:hover { color: #fff; }
  .photobtns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
  .photobtns .btn { justify-content: center; height: 40px; font-size: 12.5px; }
  .savebtn { width: 100%; height: 46px; justify-content: center; font-size: 14px; }
  .savebtn[disabled] { opacity: 0.55; cursor: not-allowed; }
  [data-view="add"] .drop { border-radius: 14px; padding: 22px 16px; border-width: 1.5px; }
  [data-view="add"] .drop .di { width: 46px; height: 46px; border-radius: 50%; margin-bottom: 4px; box-shadow: none; background: var(--vs-violet-tint2); color: var(--vs-violet-light); }
  [data-view="add"] .drop .di svg { width: 18px; height: 18px; }
  [data-view="add"] .drop p { margin: 6px 0 0; font-size: 12.5px; }
  .acctpop { position: fixed; left: 50%; top: 50%; transform: translate(-50%,-50%); z-index: 60; width: min(340px, calc(100vw - 32px)); max-height: min(560px, calc(100vh - 48px)); overflow-y: auto; background: #16131f; border: 1px solid var(--vs-border-hi); border-radius: 16px; padding: 16px; box-shadow: 0 30px 70px rgba(0,0,0,0.6); }
  .acctpop .in { height: 38px; font-size: 12.5px; border-radius: 10px; }
  .acctpop .btn { height: 38px; font-size: 12.5px; }
  .acctpop__hd { display: flex; align-items: center; justify-content: space-between; font-size: 14px; }
  .pmenu { position: fixed; z-index: 70; min-width: 190px; background: #16131f; border: 1px solid var(--vs-border-hi); border-radius: 14px; padding: 6px; box-shadow: 0 20px 50px rgba(0,0,0,0.6); }
  .pmenu__hd { padding: 9px 12px 7px; font-size: 12px; color: var(--vs-text-mute); border-bottom: 1px solid var(--vs-border); margin-bottom: 6px; }
  .pmenu__hd b { display: block; font-size: 13px; color: #fff; }
  .pmenu button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 12px; border: 0; border-radius: 9px; background: none; color: var(--vs-text-2); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; text-align: left; }
  .pmenu button:hover { background: var(--vs-violet-tint); color: #fff; }
  .pmenu button.out { color: #f0625a; }
  .pmenu button.out:hover { background: rgba(240,98,90,0.1); color: #f0625a; }
  .pmenu svg { width: 15px; height: 15px; flex: none; }
  .acctpop__x { background: none; border: 0; color: var(--vs-text-mute); font-size: 18px; cursor: pointer; }
  .acctpop__x:hover { color: #fff; }
  .acctpop__empty { margin: 8px 0 10px; font-size: 12px; color: var(--vs-text-2); }
  .acctpop__row { display: flex; gap: 8px; }
  .acctpop__row .in { flex: 1; }
  .acctpop__list { list-style: none; margin: 10px 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
  .acctpop__list li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; padding: 8px 12px; border: 1px solid var(--vs-border); border-radius: 12px; }
  .acctpop__list .rm { margin-left: auto; background: none; border: 0; color: var(--vs-text-mute); cursor: pointer; font-size: 15px; }
  .acctpop__list .rm:hover { color: #f0625a; }
  .linked { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--vs-border); }
  .linked h3 { margin: 0 0 4px; font-size: 13.5px; }
  .linked > p { margin: 0 0 10px; font-size: 11.5px; color: var(--vs-text-2); line-height: 1.45; }
  .lacct { background: rgba(255,255,255,0.03); border: 1px solid var(--vs-border); border-radius: 12px; padding: 9px 10px; margin-bottom: 8px; }
  .lacct .real { font-size: 11.5px; color: var(--vs-text-mute); margin-bottom: 6px; }
  .lacct .real b { color: #fff; }
  .lacct .rrow { display: flex; gap: 6px; }
  .lacct .rrow .in { flex: 1; min-width: 0; }
  .lacct .rrow .btn { padding: 0 13px; justify-content: center; }
  .phead { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
  .phead__t { flex: 1; min-width: 200px; }
  .phead__t h1 { margin: 0; font-size: 34px; font-weight: 900; letter-spacing: -0.03em; }
  .phead__t p { margin: 6px 0 0; font-size: 13.5px; color: var(--vs-text-mute); }
  .phead__t p b { color: var(--pop); font-weight: 700; }
  .phead__a { display: flex; gap: 10px; flex-shrink: 0; }
  .btn { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: 12px; font-size: 13px; font-weight: 700; white-space: nowrap; transition: filter .12s, border-color .12s, background .12s; }
  .btn svg { width: 15px; height: 15px; }
  .btn.ghost { color: var(--vs-text-2); background: rgba(255,255,255,0.04); border: 1px solid var(--vs-border); }
  .btn.ghost:hover { border-color: var(--vs-border-hi); color: #fff; }
  .btn.danger { color: #ffb4ad; background: rgba(240,98,90,0.1); border: 1px solid rgba(240,98,90,0.24); }
  .btn.danger:hover { background: rgba(240,98,90,0.18); color: #fff; }
  .btn.primary { color: #fff; background: linear-gradient(135deg,#9a74ff,#6a3eef); border: 1px solid rgba(196,179,255,0.25); box-shadow: 0 8px 22px -6px rgba(122,82,255,0.6), inset 0 1px 0 rgba(255,255,255,0.25); }
  .btn.primary:hover { filter: brightness(1.08); }

  /* filter + search row */
  .flabel { font-family: var(--vs-font-mono, monospace); font-size: 10.5px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--vs-text-mute); margin-bottom: 8px; }
  .toolbar { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
  .search { flex: 1; min-width: 220px; display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 16px; border-radius: 14px; background: rgba(255,255,255,0.03); border: 1px solid var(--vs-border); transition: border-color .15s; }
  .search:focus-within { border-color: var(--vs-border-vio); box-shadow: 0 0 0 3px var(--vs-violet-tint); }
  .search svg { width: 17px; height: 17px; color: var(--vs-text-mute); flex-shrink: 0; }
  .search input { flex: 1; background: none; border: none; outline: none; color: #fff; font: inherit; font-size: 14px; }
  .search input::placeholder { color: var(--vs-text-dim); }
  .selwrap { position: relative; min-width: 220px; }
  .selwrap svg { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--vs-text-mute); pointer-events: none; }
  .sel { width: 100%; height: 48px; padding: 0 40px 0 16px; border-radius: 14px; background: rgba(255,255,255,0.03); border: 1px solid var(--vs-border); color: #fff; font: inherit; font-size: 14px; font-weight: 600; appearance: none; cursor: pointer; transition: border-color .15s; }
  .sel:focus { outline: none; border-color: var(--vs-border-vio); }
  .sel option { background: #14141d; color: #fff; }

  /* selection action bar */
  .selbar { display: none; align-items: center; gap: 14px; margin-bottom: 16px; padding: 12px 16px; border-radius: 14px; background: var(--vs-violet-tint); border: 1px solid var(--vs-border-vio); }
  .selbar.show { display: flex; animation: fade .2s ease; }
  .selbar .n { font-size: 13.5px; font-weight: 700; }
  .selbar .n b { color: var(--vs-violet-light); }
  .selbar__sp { flex: 1; }
  .selbar .lk { font-size: 12.5px; font-weight: 700; color: var(--vs-text-mute); }
  .selbar .lk:hover { color: #fff; }

  /* article card */
  .list { display: flex; flex-direction: column; gap: 14px; }
  .art { border-radius: 18px; border: 1px solid var(--vs-border); background: #101016; overflow: hidden; transition: border-color .15s, transform .15s; }
  .art:hover { border-color: var(--vs-border-hi); }
  .art.sel { border-color: var(--vs-violet); box-shadow: 0 0 0 1px var(--vs-violet), 0 12px 32px -14px rgba(122,82,255,0.6); }
  .art__hd { display: flex; align-items: center; gap: 14px; padding: 16px 18px; }
  .chk { width: 22px; height: 22px; border-radius: 7px; flex-shrink: 0; border: 2px solid var(--vs-border-hi); background: rgba(255,255,255,0.02); display: grid; place-items: center; transition: background .15s, border-color .15s; }
  .chk svg { width: 13px; height: 13px; color: #fff; opacity: 0; transform: scale(0.6); transition: opacity .15s, transform .15s; }
  .art.sel .chk { background: var(--vs-violet-grad); border-color: transparent; }
  .art.sel .chk svg { opacity: 1; transform: none; }
  .art__info { flex: 1; min-width: 0; }
  .art__title { font-size: 15.5px; font-weight: 800; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .art__title .num { color: var(--vs-text-dim); font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 14px; }
  .abadge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--blue-soft); color: #9fc0ff; border: 1px solid rgba(79,124,255,0.24); }
  .abadge .d { width: 5px; height: 5px; border-radius: 50%; background: #6f9bff; }
  .abadge.pro { background: var(--pop-soft); color: var(--pop); border-color: rgba(122,82,255,0.32); }
  .abadge.pro .d { background: var(--pop); }
  .art__note { font-size: 12px; color: var(--vs-text-dim); font-weight: 600; }
  .art__meta { font-size: 12.5px; color: var(--vs-text-mute); margin-top: 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .art__meta .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--vs-text-dim); }
  .art__meta svg { width: 13px; height: 13px; vertical-align: -2px; margin-right: 3px; }
  .art__acts { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
  .abtn { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: 10px; font-size: 12.5px; font-weight: 700; transition: filter .12s, background .12s, border-color .12s; }
  .abtn svg { width: 14px; height: 14px; }
  .abtn.ext { color: #fff; background: linear-gradient(135deg,#8c66ff,#6a3eef); box-shadow: inset 0 1px 0 rgba(255,255,255,0.2); }
  .abtn.ext:hover { filter: brightness(1.1); }
  .abtn.zip { color: var(--vs-text-2); background: rgba(255,255,255,0.05); border: 1px solid var(--vs-border); }
  .abtn.zip:hover { border-color: var(--vs-border-hi); color: #fff; }
  .aicon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; transition: background .12s, color .12s; }
  .aicon svg { width: 16px; height: 16px; }
  .aicon.del { color: #f0857c; background: rgba(240,98,90,0.1); border: 1px solid rgba(240,98,90,0.22); }
  .aicon.del:hover { background: rgba(240,98,90,0.2); color: #fff; }

  /* photo strip */
  .art__photos { display: grid; grid-auto-flow: column; grid-auto-columns: 84px; gap: 8px; padding: 0 18px 16px 18px; overflow-x: auto; scrollbar-width: thin; }
  .art__photos::-webkit-scrollbar { height: 6px; }
  .art__photos::-webkit-scrollbar-thumb { background: rgba(196,179,255,0.16); border-radius: 9px; }
  .thumb { width: 84px; height: 84px; border-radius: 11px; flex-shrink: 0; position: relative; overflow: hidden; border: 1px solid var(--vs-border); background-size: cover; background-position: center; }
  .thumb .idx { position: absolute; top: 5px; left: 5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 6px; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); color: #fff; font-size: 10px; font-weight: 800; display: grid; place-items: center; }
  .thumb.more { display: grid; place-items: center; background: rgba(255,255,255,0.03); color: var(--vs-violet-light); font-size: 13px; font-weight: 800; cursor: pointer; }
  .thumb.more:hover { background: var(--vs-violet-tint); }

  /* empty */
  .empty { display: none; flex-direction: column; align-items: center; text-align: center; padding: 60px 20px; }
  .empty.show { display: flex; }
  .empty .ei { width: 72px; height: 72px; border-radius: 20px; display: grid; place-items: center; background: var(--vs-violet-tint); border: 1px solid var(--vs-border-vio); color: var(--vs-violet-light); margin-bottom: 18px; }
  .empty .ei svg { width: 34px; height: 34px; }
  .empty h3 { margin: 0 0 6px; font-size: 18px; font-weight: 800; }
  .empty p { margin: 0; font-size: 13.5px; color: var(--vs-text-mute); }

  /* ---------- Ajouter view ---------- */
  .drop { border-radius: 20px; border: 2px dashed var(--vs-border-hi); background: rgba(255,255,255,0.02); padding: 48px 24px; text-align: center; transition: border-color .15s, background .15s; }
  .drop:hover, .drop.drag { border-color: var(--vs-violet); background: var(--vs-violet-tint); }
  .drop .di { width: 76px; height: 76px; border-radius: 22px; margin: 0 auto 20px; display: grid; place-items: center; background: var(--vs-violet-grad); color: #fff; box-shadow: 0 14px 34px -12px rgba(122,82,255,0.7), inset 0 1px 0 rgba(255,255,255,0.28); }
  .drop .di svg { width: 36px; height: 36px; }
  .drop h2 { margin: 0 0 8px; font-size: 22px; font-weight: 900; letter-spacing: -0.02em; }
  .drop p { margin: 0 0 22px; font-size: 14px; color: var(--vs-text-mute); }
  .drop p b { color: var(--vs-violet-light); }
  .field { display: grid; gap: 16px; max-width: 520px; margin: 26px auto 0; text-align: left; }
  .field label { font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--vs-text-mute); display: block; margin-bottom: 8px; }
  .field .in { width: 100%; height: 48px; padding: 0 15px; border-radius: 12px; background: rgba(255,255,255,0.03); border: 1px solid var(--vs-border); color: #fff; font: inherit; font-size: 14px; }
  .field .in:focus { outline: none; border-color: var(--vs-border-vio); box-shadow: 0 0 0 3px var(--vs-violet-tint); }
  textarea.in { height: 92px; padding: 12px 15px; resize: vertical; }

  /* ---------- Colis / Heures generic cards ---------- */
  .grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
  .stat { border-radius: 18px; border: 1px solid var(--vs-border); background: #101016; padding: 20px; }
  .stat .k { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; color: var(--vs-text-mute); }
  .stat .k svg { width: 15px; height: 15px; }
  .stat .v { font-size: 34px; font-weight: 900; letter-spacing: -0.03em; margin-top: 10px; }
  .stat .v small { font-size: 15px; font-weight: 700; color: var(--vs-text-mute); }
  .stat .sub { font-size: 12px; color: var(--mint); font-weight: 600; margin-top: 4px; }

  /* colis rows */
  [data-view="colis"] { max-width: 720px; margin: 0 auto; }
  [data-view="colis"] .phead__t { width: 100%; }
  .relay { background: rgba(255,255,255,0.02); border: 1px solid var(--vs-border); border-radius: 18px; padding: 18px; margin-bottom: 24px; }
  .relay__hd { display: flex; align-items: flex-start; gap: 13px; padding-bottom: 15px; border-bottom: 1px solid var(--vs-border); }
  .relay__pin { width: 36px; height: 36px; border-radius: 11px; flex: none; display: grid; place-items: center; background: var(--vs-violet-tint); color: var(--vs-violet-light); border: 1px solid var(--vs-border-vio); }
  .relay__pin svg { width: 17px; height: 17px; }
  .relay__t { flex: 1; min-width: 0; }
  .relay__t .n { font-size: 14.5px; font-weight: 800; }
  .relay__t .a { font-size: 12px; color: var(--vs-text-mute); margin-top: 2px; }
  .relay__cnt { flex: none; font-size: 11.5px; font-weight: 800; padding: 5px 11px; border-radius: 999px; background: var(--vs-violet-tint); color: var(--vs-violet-light); border: 1px solid var(--vs-border-vio); }
  .pkg { display: flex; align-items: center; gap: 14px; padding: 16px 2px 2px; }
  .pkg > .btn { flex: none; }
  .pkg .qr { width: 64px; height: 64px; flex: none; border-radius: 9px; background: #fff; padding: 4px; cursor: zoom-in; transition: transform .12s; }
  .pkg .qr:hover { transform: scale(1.05); }
  .pkg__b { flex: 1; min-width: 0; }
  .pkg__b .num { font-family: var(--vs-font-mono, monospace); font-size: 15px; font-weight: 700; }
  .pkg__b .d { font-size: 13px; color: var(--vs-text-mute); margin-top: 2px; }
  .pkg__b .ok { font-size: 12px; color: var(--mint); font-weight: 600; margin-top: 4px; }
  .pkg .tags { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
  .ptag { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 11px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.01em; background: rgba(255,255,255,0.04); border: 1px solid var(--vs-border-hi); color: var(--vs-text-2); }
  .ptag svg { width: 12px; height: 12px; }
  .ptag.mr { background: rgba(240,98,90,0.10); border-color: rgba(240,98,90,0.32); color: #ff9089; }
  .ptag.j4 { background: var(--vs-violet-tint); border-color: var(--vs-border-vio); color: var(--vs-violet-light); }
  .pkg.hist { background: rgba(255,255,255,0.02); border: 1px solid var(--vs-border); border-radius: 16px; padding: 14px 15px; margin-bottom: 12px; }
  .pkg.hist .qr { width: 56px; height: 56px; }
  .histhd { display: flex; align-items: center; gap: 9px; width: 100%; padding: 13px 15px; margin-bottom: 14px; border-radius: 14px; background: rgba(255,255,255,0.02); border: 1px solid var(--vs-border); color: var(--vs-text-2); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; transition: border-color .15s; }
  .histhd:hover { border-color: var(--vs-border-hi); }
  .histhd .bx { width: 15px; height: 15px; color: var(--vs-text-mute); }
  .histhd b { color: var(--vs-violet-light); }
  .histhd .chev { width: 15px; height: 15px; margin-left: auto; color: var(--vs-text-mute); transition: transform .2s; }
  .histhd[aria-expanded="true"] .chev { transform: rotate(180deg); }
  .qrbox { position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: rgba(5,4,10,0.85); backdrop-filter: blur(6px); cursor: zoom-out; }
  .qrbox canvas { width: min(300px, 72vw); height: min(300px, 72vw); border-radius: 18px; background: #fff; padding: 14px; box-shadow: 0 30px 80px rgba(0,0,0,0.7); }
  .qrbox .qn { font-family: var(--vs-font-mono, monospace); font-size: 17px; font-weight: 700; color: #fff; }
  .qrbox .qh { font-size: 12px; color: var(--vs-text-mute); }
  .aicon.undo { width: 38px; height: 38px; border-radius: 11px; flex: none; display: grid; place-items: center; background: var(--mint-soft); border: 1px solid rgba(61,220,151,0.3); color: var(--mint); }
  .aicon.undo:hover { background: rgba(61,220,151,0.2); }
  .aicon.undo svg { width: 15px; height: 15px; }
  /* heures */
  [data-view="heures"] { max-width: 640px; margin: 0 auto; }
  .chrono { text-align: center; padding: 26px 18px 18px; }
  .chrono__time { font-family: var(--vs-font-mono, monospace); font-size: 44px; font-weight: 700; letter-spacing: 0.02em; }
  .chrono__st { font-size: 12.5px; color: var(--vs-text-mute); margin: 4px 0 18px; }
  .chrono__btn { display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; height: 52px; border-radius: 13px; border: 0; font: inherit; font-size: 15px; font-weight: 800; color: #06120b; background: linear-gradient(135deg, #4be3a4, #22b877); cursor: pointer; box-shadow: 0 8px 22px -8px rgba(61,220,151,0.55); transition: filter .12s; }
  .chrono__btn:hover { filter: brightness(1.06); }
  .chrono__btn svg { width: 16px; height: 16px; }
  .chrono__btn.stop { color: #fff; background: linear-gradient(135deg, #f2766e, #d8453c); box-shadow: 0 8px 22px -8px rgba(240,98,90,0.55); }
  .recap { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .recap__c { border: 1px solid var(--vs-border); border-radius: 14px; padding: 18px 12px; text-align: center; }
  .recap__c .v { font-size: 24px; font-weight: 900; letter-spacing: -0.02em; }
  .recap__c:first-child .v { color: var(--vs-violet-light); }
  .recap__c .l { font-family: var(--vs-font-mono, monospace); font-size: 10px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--vs-text-mute); margin-top: 5px; }
  .recap__empty { margin: 14px 2px 2px; font-size: 12.5px; color: var(--vs-text-mute); }
  .sess { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--vs-border); border-radius: 12px; margin-top: 10px; font-size: 12.5px; color: var(--vs-text-2); }
  .sess .dur { margin-left: auto; font-family: var(--vs-font-mono, monospace); font-weight: 700; color: var(--vs-violet-light); }
  @media (max-width: 480px) {
    .relay { padding: 14px; }
    .relay__t .a { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .pkg { flex-wrap: wrap; }
    .pkg > .btn { flex-basis: 100%; justify-content: center; margin-top: 4px; }
    .pkg.hist { padding: 12px; }
    .pkg.hist .qr { width: 48px; height: 48px; }
    .aicon.undo { width: 34px; height: 34px; }
  }
  .crow { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 16px; border: 1px solid var(--vs-border); background: #101016; margin-top: 12px; }
  .crow__ic { width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0; display: grid; place-items: center; background: var(--blue-soft); color: #9fc0ff; }
  .crow__ic svg { width: 20px; height: 20px; }
  .crow__b { flex: 1; min-width: 0; }
  .crow__b .t { font-size: 14.5px; font-weight: 800; }
  .crow__b .d { font-size: 12.5px; color: var(--vs-text-mute); margin-top: 2px; }
  .cstat { font-size: 12px; font-weight: 800; padding: 5px 11px; border-radius: 999px; flex-shrink: 0; }
  .cstat.transit { background: var(--pop-soft); color: var(--pop); }
  .cstat.ok { background: var(--mint-soft); color: var(--mint); }
  .cstat.wait { background: rgba(245,180,84,0.14); color: #f5c07a; }

  .sechd { font-size: 13px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--vs-text-mute); margin: 26px 0 4px; }

  /* ---------- Mobile bottom nav ---------- */
  .mnav { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: rgba(10,10,16,0.92); backdrop-filter: blur(16px); border-top: 1px solid var(--vs-border); }
  .mnav__row { display: flex; }
  .mtab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0; font-size: 10.5px; font-weight: 700; color: var(--vs-text-mute); transition: color .15s; }
  .mtab svg { width: 22px; height: 22px; }
  .mtab.on { color: var(--vs-violet-light); }

  /* ---------- Responsive ---------- */
  @media (max-width: 840px) {
    .phead__t h1 { font-size: 27px; }
    .art__hd { flex-wrap: wrap; }
    .art__acts { width: 100%; padding-left: 36px; }
    .abtn.ext, .abtn.zip { flex: 1; justify-content: center; }
  }
  @media (max-width: 680px) {
    .top { padding: 12px 16px; gap: 10px; }
    .status span { display: none; }
    .tabs { display: none; }
    .wrap { padding: 20px 16px 110px; }
    .mnav { display: block; }
    .phead__a { width: 100%; }
    .phead__a .btn { flex: 1; justify-content: center; }
  }

/* --- Plomberie : cacher les vrais <input type=file> (déclenchés par les boutons Galerie/Photo) --- */
.drop input[type="file"], #file-input, #file-input-camera { display: none !important; }

/* --- Plomberie : neutralise l'ancien <header> qui entre en conflit avec .top du ZIP --- */
header.top { justify-content: normal; box-shadow: none; padding: 14px 24px; }
header.top .logo img { height: 34px; }

/* --- Carte article : checkbox + filtre compte au style ZIP --- */
.art__hd input[type="checkbox"] { width: 20px; height: 20px; flex-shrink: 0; accent-color: var(--vs-violet); cursor: pointer; }
.art__photos .thumb.more { min-width: 84px; height: 84px; }
#account-filter select, .account-filter select { width: 100%; height: 46px; padding: 0 16px; border-radius: 14px; background: var(--vs-card); border: 1px solid var(--vs-border); color: var(--vs-text); font: inherit; font-size: 14px; font-weight: 600; margin-bottom: 18px; appearance: none; cursor: pointer; }
#account-filter, .account-filter { display: block; }

/* --- Colis : look ZIP (.relay/.pkg) appliqué aux classes du renderer --- */
#colis-list .colis-lieu { background: var(--vs-card); border: 1px solid var(--vs-border); border-radius: 18px; padding: 6px; margin-bottom: 16px; }
.colis-lieu-hd { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.colis-pin { width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0; display: grid; place-items: center; background: var(--vs-violet-tint); color: var(--vs-violet-light); }
.colis-pin svg { width: 18px; height: 18px; }
.colis-name { font-size: 14px; font-weight: 800; color: var(--vs-text); }
.colis-addr { font-size: 11.5px; color: var(--vs-text-mute); margin-top: 2px; max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.colis-count { margin-left: auto; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--vs-violet-tint); color: var(--vs-violet-light); border: 1px solid var(--vs-border-vio); flex-shrink: 0; }
.colis-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--vs-card-2); border: 1px solid var(--vs-border); margin: 8px; }
.colis-row.done { opacity: .7; }
.colis-qr { width: 60px; height: 60px; border-radius: 10px; background: #fff; padding: 4px; flex-shrink: 0; cursor: pointer; }
.colis-main { flex: 1; min-width: 0; }
.colis-code { font-family: 'JetBrains Mono', monospace; font-weight: 800; font-size: 16px; color: var(--vs-text); }
.colis-art { font-size: 12.5px; color: var(--vs-text-mute); margin-top: 2px; }
.colis-toggle { flex-shrink: 0; height: 38px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--vs-border-hi); background: transparent; color: var(--vs-text-2); font-weight: 700; font-size: 12.5px; cursor: pointer; font-family: inherit; display: inline-flex; align-items: center; gap: 6px; }
.colis-toggle:hover { border-color: var(--vs-violet); color: #fff; }
.colis-toggle.ok { width: 38px; padding: 0; justify-content: center; color: var(--vs-text-mute); }
.colis-toggle svg { width: 16px; height: 16px; }
.colis-empty { text-align: center; padding: 44px 20px; color: var(--vs-text-mute); font-size: 13.5px; line-height: 1.6; }
.colis-hist { margin-top: 14px; }
.colis-hist summary { cursor: pointer; font-weight: 700; font-size: 13.5px; color: var(--vs-text-2); padding: 13px 16px; border-radius: 14px; background: var(--vs-card); border: 1px solid var(--vs-border); list-style: none; }
.colis-hist summary::-webkit-details-marker { display: none; }
.colis-hist-body { margin-top: 10px; }
.colis-modal { position: fixed; inset: 0; z-index: 999; background: rgba(0,0,0,0.85); display: none; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px; }
.colis-modal.open { display: flex; }
.colis-modal img { width: min(360px, 80vw); border-radius: 16px; background: #fff; padding: 12px; }
.colis-modal-code { font-family: 'JetBrains Mono', monospace; font-weight: 800; font-size: 20px; color: #fff; }

/* ---- Topbar theme toggle sun/moon ---- */
#theme-toggle .ic-sun, #theme-toggle .ic-moon { width: 18px; height: 18px; }
#theme-toggle .ic-moon { display: none; }
[data-theme="light"] #theme-toggle .ic-sun { display: none; }
[data-theme="light"] #theme-toggle .ic-moon { display: block; }

/* ---- Account pill dropdown ---- */
.acctwrap { position: relative; display: inline-flex; }
.pmenu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 190px; background: var(--vs-card); border: 1px solid var(--vs-border-hi); border-radius: 14px; box-shadow: 0 18px 40px rgba(0,0,0,.45); padding: 6px; z-index: 120; }
.pmenu[hidden] { display: none; }
.pmenu__it { width: 100%; display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 10px; border: 0; background: transparent; color: var(--vs-text-2); font-weight: 700; font-size: 13.5px; font-family: inherit; cursor: pointer; text-align: left; }
.pmenu__it:hover { background: var(--vs-card-2); color: var(--vs-text); }
.pmenu__it svg { width: 17px; height: 17px; flex-shrink: 0; }
.pmenu__it.out { color: #ff6b6b; }
.pmenu__it.out:hover { background: rgba(255,107,107,.1); color: #ff8585; }

/* ---- Topbar fixes (logo size + hide status) ---- */
header.top .logo img { height: 48px !important; }
#online-status { display: none !important; }
header.top { gap: 12px; }

/* ---- Topbar: center bell icon (place-items ignored on flex) + spacing ---- */
header.top { gap: 18px; }
header.top .iconbtn { display: inline-flex !important; align-items: center !important; justify-content: center !important; }

/* ---- Espace entre les vignettes photo des cartes ---- */
.art__photos { gap: 14px; }

/* ---- Espace entre les cartes articles ---- */
#articles-container { display: flex; flex-direction: column; gap: 14px; }

/* ============ MOBILE / TÉLÉPHONE (renforcé) ============ */
@media (max-width: 680px) {
  /* Barre du haut compacte : logo + cloche + avatar seul */
  header.top, .top { padding: 10px 14px !important; gap: 10px !important; }
  header.top .logo img, .top .logo img { height: 40px !important; }
  .acctwrap .acct { max-width: none; width: 40px; padding: 0; justify-content: center; }
  .acct .acct__e { display: none; }
  .acctwrap .pmenu { right: 0; }

  /* Contenu pleine largeur + place pour la barre du bas */
  .wrap { padding: 18px 14px 100px !important; }
  [data-view="add"] { max-width: 100% !important; }

  /* Titres un cran plus petits */
  .phead__t h1, .phead h1 { font-size: 23px; }
  .phead { gap: 10px; }

  /* Inputs à 16px : empêche le zoom auto iOS au focus */
  .in, .field .in, textarea.in, .sel,
  #account-filter select, .account-filter select,
  input[type="text"], input[type="number"], input[type="search"], select, textarea { font-size: 16px !important; }

  /* Cibles tactiles plus grandes */
  .btn, .abtn, .aicon, .colis-toggle, .savebtn, .iconbtn { min-height: 44px; }

  /* Carte article : actions pleine largeur, bien cliquables */
  .art__hd { flex-wrap: wrap; }
  .art__acts { width: 100%; padding-left: 0; margin-top: 8px; gap: 8px; }
  .abtn.ext, .abtn.zip { flex: 1; justify-content: center; }

  /* Colis : la ligne s'adapte, le bouton passe dessous si besoin */
  .colis-row { flex-wrap: wrap; }
  .colis-toggle { margin-left: auto; }

  /* Modales : jamais plus large que l'écran */
  .acctpop, #accounts-modal .acctpop { width: calc(100vw - 24px) !important; max-width: 380px; }
}
@media (max-width: 420px) {
  .phead__t h1, .phead h1 { font-size: 20px; }
  .art__photos { grid-auto-columns: 74px; }
  .thumb, .art__photos .thumb.more { width: 74px !important; height: 74px !important; min-width: 74px !important; }
  .chrono__time { font-size: 38px; }
}

/* ---- En-tête du menu compte (style ZIP) ---- */
.pmenu__hd { padding: 9px 12px 8px; font-size: 12px; color: var(--vs-text-mute); border-bottom: 1px solid var(--vs-border); margin-bottom: 6px; }
.pmenu__hd b { display: block; font-size: 13px; color: #fff; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pmenu__it { text-decoration: none; }
