/* WishNote — « gadget de suivi » : cadre bleu ciel en relief, écran sombre à balayage, toile en filigrane.
   Police pixel (Bitcount) pour l'interface, police système pour les noms et descriptions. */

@font-face { font-family: "Bitcount"; src: url("fonts/BitcountPropSingle-Regular.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }

:root {
  --page: #1748b5;
  --page-2: #0b2f8a;
  --bezel: #43ade0;
  --bezel-hi: #a4e2fa;
  --bezel-lo: #2584bb;
  --bezel-edge: #0a3560;
  --screen: #0a1530;
  --panel: #10224a;
  --panel-hi: #163060;
  --line: rgba(150, 224, 247, .26);
  --field-line: #2b5d8c;
  --cyan: #96e0f7;
  --cyan-2: #4fc3f0;
  --ink: #e6f6fc;
  --muted: #7f9ec6;
  --orange: #ffa24c;
  --orange-edge: #8c4610;
  --red: #ff5148;
  --green: #4be487;
  --danger-ink: #ff8a80;
  --hud: "Bitcount", ui-monospace, monospace;
  --text: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --pc: var(--cyan);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { height: 100%; background: var(--page); -webkit-text-size-adjust: 100%; }
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: transparent; /* le fond vient de .bg */
  color: var(--ink);
  font-family: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea { font: inherit; color: inherit; }
button, label { touch-action: manipulation; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
#app { height: 100%; }
.file-input { position: fixed; left: -9999px; width: 1px; height: 1px; opacity: 0; }

@keyframes blink { 50% { opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- fond de page */
.bg { position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse at 50% -10%, #3170e0 0%, var(--page) 45%, var(--page-2) 100%); }
.bg::after { content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(255, 255, 255, .08) 1px, transparent 1.6px);
  background-size: 14px 14px; }

.boot { height: 100%; display: grid; place-content: center; font: 700 18px var(--hud); letter-spacing: 3px; text-transform: uppercase; color: var(--cyan); }
.caret { display: inline-block; width: .55em; height: 1em; margin-left: 6px; vertical-align: -2px; background: var(--orange); animation: blink 1s steps(1) infinite; }

.ico { display: inline-grid; place-items: center; width: 20px; height: 20px; flex: none; }
.ico svg { width: 100%; height: 100%; }
.led { display: inline-block; width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--pc); box-shadow: 0 0 8px var(--pc); }

/* ---------- l'appareil */
.device {
  position: fixed;
  top: calc(var(--safe-t) + 8px); bottom: calc(var(--safe-b) + 8px); left: 8px; right: 8px;
  display: flex; flex-direction: column;
  padding: 0 10px 10px;
  border-radius: 26px;
  background: linear-gradient(180deg, var(--bezel-hi) 0, var(--bezel) 16px, var(--bezel) calc(100% - 20px), var(--bezel-lo) 100%);
  box-shadow:
    0 0 0 3px var(--bezel-edge),
    inset 0 3px 0 rgba(255, 255, 255, .5),
    inset 0 -4px 0 rgba(10, 53, 96, .35),
    0 22px 50px rgba(3, 12, 40, .55);
}
/* rivets décoratifs */
.device::before, .device::after { content: ""; position: absolute; bottom: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--bezel-lo); box-shadow: inset 0 1px 0 rgba(0, 0, 0, .35); }
.device::before { left: 9px; }
.device::after { right: 9px; }

.device-top { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 6px; height: 64px; }
.device-top > :first-child { justify-self: start; max-width: 100%; }
.device-top > :last-child { justify-self: end; }

.logo {
  justify-self: center; display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 12px;
  background: linear-gradient(#183d7e, #0c2352);
  border: 3px solid var(--bezel-edge);
  box-shadow: inset 0 0 0 2px var(--cyan-2), 0 3px 0 rgba(10, 53, 96, .5);
  font: 800 16px/1 var(--hud); letter-spacing: 2px; color: var(--cyan);
  text-shadow: 0 0 10px rgba(150, 224, 247, .55);
  user-select: none;
}
.logo.clickable { cursor: pointer; }
/* les capitales pixel ont plus de place au-dessus qu'en dessous : on rogne la boîte à leur hauteur exacte */
.logo > span:not(.logo-gift) { text-box: trim-both cap alphabetic; margin-right: -2px; }
.logo-gift { display: inline-block; width: 21px; height: 21px; filter: drop-shadow(0 0 6px rgba(255, 162, 76, .45)); }
.logo-gift svg, .hang-gift svg { display: block; width: 100%; height: 100%; }

.corner-btn {
  position: relative; display: grid; place-items: center; width: 46px; height: 46px; padding: 0;
  border-radius: 13px; border: 3px solid var(--bezel-edge);
  background: linear-gradient(#ffbd6e, #f08a2a); color: #2a1300;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .5), inset 0 -3px 0 rgba(0, 0, 0, .15), 0 3px 0 rgba(10, 53, 96, .55);
}
.corner-btn.light { background: linear-gradient(#ffffff, #dcecf5); color: #10264d; }
.corner-btn:active { transform: translateY(2px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .5), 0 1px 0 rgba(10, 53, 96, .55); }
.corner-btn .ico { width: 22px; height: 22px; }
.corner-btn.me { width: auto; min-width: 46px; padding: 0 9px; }
.me-name { font: 800 12px/1 var(--text); letter-spacing: .5px; text-transform: uppercase; white-space: nowrap; text-box: trim-both cap alphabetic; margin-right: -.5px; }
.corner-btn .led { position: absolute; top: -6px; right: -6px; width: 13px; height: 13px; border: 2px solid var(--bezel-edge); }

/* ---------- l'écran */
.screen {
  position: relative; flex: 1; min-height: 0; overflow: hidden;
  border-radius: 18px;
  background: radial-gradient(ellipse at 50% 35%, #13285a 0%, var(--screen) 70%);
}
.screen-web { position: absolute; inset: -20% -40%; display: grid; place-items: center; color: rgba(150, 224, 247, .07); pointer-events: none; }
.screen-web svg { width: 100%; height: 100%; }
.screen-scroll {
  position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  padding: 14px 12px 22px;
  scrollbar-width: thin; scrollbar-color: var(--bezel-lo) transparent;
}
.screen-fx {
  position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background:
    repeating-linear-gradient(180deg, rgba(255, 255, 255, .035) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, .5) 100%);
  box-shadow: inset 0 0 0 3px var(--bezel-edge), inset 0 0 0 5px rgba(150, 224, 247, .12), inset 0 0 30px rgba(0, 0, 0, .6);
}
.screen-fx::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 0 46%, rgba(150, 224, 247, .07) 50%, transparent 54%);
  background-size: 100% 240px; animation: scan 8s linear infinite; }
@keyframes scan { to { background-position: 0 240px; } }
.screen-center { min-height: 100%; display: grid; align-content: center; }

/* ---------- filtres par personne : de vraies touches en relief, la touche choisie reste enfoncée */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; padding-bottom: 5px; }
.seg-btn {
  --pc: var(--cyan);
  position: relative; top: 0;
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 6px; row-gap: 4px;
  min-width: 0; padding: 9px 9px 8px; text-align: left; cursor: pointer;
  border-radius: 12px; border: 2px solid color-mix(in srgb, var(--pc) 45%, #2b6b9d);
  background: linear-gradient(#21447f, #132b5e);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 4px 0 #050d22, 0 7px 12px rgba(0, 0, 0, .35);
  color: #c4d5ec; font: 700 11.5px/1 var(--text); letter-spacing: 1px; text-transform: uppercase;
  transition: top .08s, box-shadow .08s, border-color .15s, background .15s, color .15s;
}
.seg-name { line-height: 1.3; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.seg-btn b { grid-column: 1 / -1; font: 800 22px/1 var(--hud); letter-spacing: 1px; color: var(--ink); }
.seg-btn .led { opacity: .7; box-shadow: none; }
/* petit chevron qui invite à appuyer */
.seg-btn::after {
  content: ""; position: absolute; right: 10px; bottom: 11px; width: 7px; height: 7px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); opacity: .55;
}
.seg-btn:hover { border-color: var(--pc); }
.seg-btn:active { top: 3px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 1px 0 #050d22; }
/* la touche choisie s'allume en entier à la couleur de la personne, comme dans les fiches */
.seg-btn.active {
  top: 3px; border-color: var(--pc); color: #06132b;
  background: linear-gradient(color-mix(in srgb, var(--pc) 80%, #fff), var(--pc));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 1px 0 #050d22, 0 0 18px color-mix(in srgb, var(--pc) 60%, transparent);
}
.seg-btn.active b { color: #06132b; }
.seg-btn.active::after { opacity: 0; }
.seg-btn.active .led { opacity: 1; background: #06132b; box-shadow: none; }

/* ---------- tableau de bord : total + radar */
.dash {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 12px 0 14px; padding: 10px 10px 10px 14px;
  border-radius: 14px; border: 2px solid var(--line); background: rgba(8, 18, 42, .72);
}
.dash-info { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.dash-label { font: 700 11.5px var(--text); letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.dash-total { font: 800 32px/1 var(--hud); color: var(--orange); text-shadow: 0 0 16px rgba(255, 162, 76, .45); white-space: nowrap; }
.dash-count { display: inline-flex; align-items: center; gap: 7px; font: 700 12px var(--text); letter-spacing: 1px; text-transform: uppercase; color: var(--cyan); }
.dash-count .led { animation: blink 1.6s steps(1) infinite; }
.radar { flex: none; width: 84px; height: 84px; color: rgba(150, 224, 247, .5); }
.radar svg { display: block; width: 100%; height: 100%; overflow: visible; }
.radar-sweep { transform-box: view-box; transform-origin: 50px 50px; animation: spin 3.6s linear infinite; }
.blip { filter: drop-shadow(0 0 3px currentColor); animation: blink 2.4s ease-in-out infinite; }
.blip.b1 { animation-delay: .6s; }
.blip.b2 { animation-delay: 1.2s; }
.blip.b3 { animation-delay: 1.8s; }

/* ---------- grille d'objets */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(146px, 1fr)); gap: 12px; }
.card {
  position: relative; display: flex; flex-direction: column; width: 100%; padding: 0; margin: 0; overflow: hidden;
  text-align: left; color: inherit;
  border-radius: 16px; border: 2px solid var(--line);
  background: linear-gradient(180deg, var(--panel-hi), var(--panel));
  box-shadow: 0 4px 0 rgba(3, 10, 30, .55);
  transition: border-color .15s, box-shadow .15s, transform .12s;
  animation: card-in .35s ease both;
}
.card:hover { border-color: var(--cyan); box-shadow: 0 4px 0 rgba(3, 10, 30, .55), 0 0 18px rgba(150, 224, 247, .28); }
.card:active { transform: translateY(2px); }
@keyframes card-in { from { opacity: 0; transform: translateY(8px); } }
.card-img { position: relative; display: grid; place-items: center; aspect-ratio: 1; overflow: hidden; background: #f3f7fa; }
.card-img img { width: 100%; height: 100%; padding: 10px; object-fit: contain; }
.card-img.empty, .slot { background: repeating-linear-gradient(45deg, rgba(79, 195, 240, .08) 0 6px, transparent 6px 12px), #0b1938; color: var(--muted); }
.card-img.empty .ico { width: 36px; height: 36px; opacity: .7; }
/* pastille ronde de la personne, comme un marqueur sur une carte */
.badge {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--pc); color: #06132b; font: 800 13px/1 var(--text);
  border: 3px solid #0a1530; box-shadow: 0 0 0 2px var(--pc), 0 0 14px var(--pc);
}
.badge > span { text-box: trim-both cap alphabetic; }
.card-body { display: flex; flex-direction: column; gap: 9px; flex: 1; padding: 10px 11px 11px; border-top: 2px solid var(--line); }
.card-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; font: 600 13.5px/1.3 var(--text); color: var(--ink); }
.card-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; margin-top: auto; }
.price { font: 800 19px/1 var(--hud); color: var(--cyan); text-shadow: 0 0 10px rgba(150, 224, 247, .35); white-space: nowrap; }
.price.none { color: var(--muted); text-shadow: none; }
.who { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: 700 11px var(--text); letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }

/* ---------- écran vide : un cadeau suspendu à son fil */
.empty { display: grid; justify-items: center; padding: 4px 16px 30px; text-align: center; }
.hang { position: relative; width: 84px; height: 176px; transform-origin: 50% 0; animation: swing 3.4s ease-in-out infinite; }
.hang .thread { position: absolute; left: 50%; top: 0; width: 2px; height: 100px; margin-left: -1px; background: linear-gradient(rgba(230, 246, 252, .15), rgba(230, 246, 252, .9)); }
.hang-gift { position: absolute; left: 0; bottom: 0; width: 84px; height: 84px; filter: drop-shadow(0 6px 0 rgba(0, 0, 0, .35)); }
@keyframes swing { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg); } }
.empty strong { margin-top: 18px; font: 800 19px var(--hud); letter-spacing: 2px; text-transform: uppercase; color: var(--cyan); text-shadow: 0 0 10px rgba(150, 224, 247, .4); }
.empty p { max-width: 300px; margin: 8px 0 0; font-size: 15px; line-height: 1.45; color: var(--muted); }

/* ---------- bas de l'appareil : bande défilante + actions */
.device-bottom { display: flex; flex-direction: column; gap: 10px; padding-top: 10px; }
.ticker {
  position: relative; height: 40px; overflow: hidden;
  border-radius: 12px; border: 3px solid var(--bezel-edge);
  background: linear-gradient(#0d1a3c, #070f26);
  box-shadow: inset 0 0 0 2px rgba(150, 224, 247, .14), inset 0 0 14px rgba(0, 0, 0, .6);
}
.ticker::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(180deg, rgba(255, 255, 255, .04) 0 1px, transparent 1px 3px); }
.ticker-track { position: absolute; top: 0; left: 0; height: 100%; display: flex; align-items: center; white-space: nowrap; animation: marquee var(--dur, 20s) linear infinite; }
.ticker-text { padding-left: 14px; font: 700 17px/1 var(--hud); letter-spacing: 2px; text-transform: uppercase; color: #c3d2e2; text-shadow: 0 0 8px rgba(195, 210, 226, .35); }
@keyframes marquee { to { transform: translateX(-50%); } }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-bottom: 4px; }

/* ---------- boutons en relief */
.btn {
  --top: #ffbd6e; --bot: #f08a2a; --edge: var(--orange-edge); --fg: #2a1300;
  appearance: none; -webkit-appearance: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 16px; margin: 0;
  border-radius: 13px; border: 3px solid var(--edge);
  background: linear-gradient(var(--top), var(--bot)); color: var(--fg);
  font: 800 18px/1 var(--hud); letter-spacing: 2px; text-transform: uppercase; text-decoration: none;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .45), inset 0 -3px 0 rgba(0, 0, 0, .12), 0 4px 0 var(--edge);
  cursor: pointer; user-select: none; -webkit-user-select: none;
  transition: transform .08s, box-shadow .08s;
}
.btn:active { transform: translateY(3px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .45), inset 0 -3px 0 rgba(0, 0, 0, .12), 0 1px 0 var(--edge); }
.btn:disabled { filter: grayscale(.5) brightness(.8); cursor: default; }
.btn .ico { width: 22px; height: 22px; }
.btn-cyan { --top: #c2f0ff; --bot: #5cc8f0; --edge: #135883; --fg: #062238; }
.btn-ghost { --top: #142b5d; --bot: #0b1a3e; --edge: #2b6b9d; --fg: var(--cyan); min-height: 46px; font-size: 15px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 4px 0 var(--edge); }
.btn-ghost.danger { --edge: #9c2f2f; --fg: var(--danger-ink); }
.btn-ghost.danger.armed { --top: #ff8a80; --bot: #e0443a; --edge: #7a1c1c; --fg: #2a0505; }
.btn.wide { width: 100%; }

.chip {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 12px;
  border-radius: 11px; border: 2px solid rgba(150, 224, 247, .35); background: rgba(8, 18, 42, .75);
  color: var(--cyan); font: 700 13px var(--text); letter-spacing: 1px; text-transform: uppercase; text-decoration: none; cursor: pointer;
}
.chip:hover { border-color: var(--cyan); }
.chip:active { transform: translateY(1px); }
.chip .ico { width: 18px; height: 18px; }

/* ---------- fenêtre qui monte du bas (mini appareil) */
.sheet-wrap {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
  padding: calc(var(--safe-t) + 24px) 6px 0;
  background: rgba(3, 10, 30, 0); transition: background .22s;
}
.sheet-wrap.open { background: rgba(3, 10, 30, .72); }
.sheet {
  position: relative; display: flex; flex-direction: column; width: min(640px, 100%); max-height: 100%;
  padding: 0 8px;
  border-radius: 24px 24px 0 0;
  background: linear-gradient(180deg, var(--bezel-hi) 0, var(--bezel) 14px);
  box-shadow: 0 0 0 3px var(--bezel-edge), inset 0 3px 0 rgba(255, 255, 255, .45);
  transform: translateY(105%); transition: transform .28s cubic-bezier(.2, .8, .2, 1);
}
.sheet-wrap.open .sheet { transform: none; }
.sheet-head { position: relative; display: flex; align-items: center; justify-content: center; height: 60px; padding: 0 56px; }
.sheet-title {
  max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  padding: 7px 14px 6px; border-radius: 11px;
  background: linear-gradient(#183d7e, #0c2352); border: 3px solid var(--bezel-edge);
  box-shadow: inset 0 0 0 2px var(--cyan-2);
  font: 800 16px/1 var(--hud); letter-spacing: 2px; text-transform: uppercase; color: var(--cyan);
  text-shadow: 0 0 8px rgba(150, 224, 247, .5);
}
.sheet-close { position: absolute; right: 2px; top: 8px; width: 42px; height: 42px; }
.sheet-body {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  display: flex; flex-direction: column; gap: 16px;
  padding: 16px 14px calc(var(--safe-b) + 24px);
  border-radius: 16px 16px 0 0;
  background: radial-gradient(ellipse at 50% 0%, #13285a 0%, var(--screen) 60%);
  box-shadow: inset 0 0 0 3px var(--bezel-edge), inset 0 0 0 5px rgba(150, 224, 247, .1);
}
.sheet-body > * { flex-shrink: 0; }
.sheet-wrap.busy .sheet-body { pointer-events: none; }
.sheet-wrap.busy .sheet-body > :not(.status) { opacity: .55; }

/* ---------- champs */
.field { display: flex; flex-direction: column; gap: 7px; }
.label { font: 700 12.5px var(--text); letter-spacing: 1.5px; text-transform: uppercase; color: var(--cyan); }
.label::before { content: "▸ "; color: var(--orange); }
.input {
  width: 100%; min-height: 48px; padding: 11px 12px; margin: 0;
  border-radius: 11px; border: 2px solid var(--field-line); background: #060e26; color: #f3fbff;
  font: 16px/1.35 var(--text); outline: none; -webkit-appearance: none; appearance: none;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, .45);
}
.input::placeholder { color: rgba(127, 158, 198, .6); }
.input:focus { border-color: var(--cyan); box-shadow: inset 0 2px 8px rgba(0, 0, 0, .45), 0 0 0 3px rgba(150, 224, 247, .2); }
textarea.input { min-height: 86px; resize: vertical; }
.row { display: flex; gap: 8px; }
.row .input { flex: 1; min-width: 0; }
.row .btn { min-height: 48px; padding: 0 14px; font-size: 15px; }
.price-field { position: relative; }
.price-field .input { padding-right: 46px; font: 800 24px/1 var(--hud); color: var(--orange); }
.price-field .unit { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font: 800 20px var(--hud); color: var(--muted); pointer-events: none; }
.field.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.field.shake .input { border-color: var(--red); }

/* ---------- ligne d'état */
.status {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 11px; border: 2px solid currentColor; background: rgba(8, 18, 42, .8);
  font: 600 14px/1.35 var(--text);
}
.status .led { --pc: currentColor; }
.status-scan { color: var(--orange); }
.status-scan .led { animation: blink .5s steps(1) infinite; }
.status-ok { color: var(--green); }
.status-warn { color: var(--orange); }
.status-err { color: var(--danger-ink); }

/* ---------- emplacement de l'image */
.slot { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 4 / 3; max-height: 38dvh; overflow: hidden; border-radius: 14px; border: 2px solid var(--field-line); }
.slot img { position: absolute; inset: 0; width: 100%; height: 100%; padding: 12px; object-fit: contain; background: #f3f7fa; }
.slot:not(.has-img) img { display: none; }
.slot-empty { display: grid; justify-items: center; gap: 8px; font: 700 13px var(--text); letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.slot-empty .ico { width: 38px; height: 38px; }
.slot.has-img .slot-empty { display: none; }
.slot-hint { display: none; font-size: 12px; letter-spacing: 1px; color: rgba(127, 158, 198, .75); }
@media (hover: hover) and (pointer: fine) { .slot-hint { display: block; } }
.slot.drop { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255, 162, 76, .35); }
.slot::after { content: ""; position: absolute; inset: 8px; z-index: 2; pointer-events: none;
  background:
    linear-gradient(var(--cyan-2), var(--cyan-2)) top left / 18px 3px, linear-gradient(var(--cyan-2), var(--cyan-2)) top left / 3px 18px,
    linear-gradient(var(--cyan-2), var(--cyan-2)) top right / 18px 3px, linear-gradient(var(--cyan-2), var(--cyan-2)) top right / 3px 18px,
    linear-gradient(var(--cyan-2), var(--cyan-2)) bottom left / 18px 3px, linear-gradient(var(--cyan-2), var(--cyan-2)) bottom left / 3px 18px,
    linear-gradient(var(--cyan-2), var(--cyan-2)) bottom right / 18px 3px, linear-gradient(var(--cyan-2), var(--cyan-2)) bottom right / 3px 18px;
  background-repeat: no-repeat; }
.slot-scan { position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0;
  background: linear-gradient(180deg, transparent 0 44%, rgba(150, 224, 247, .6) 50%, transparent 56%); background-size: 100% 200%; }
.slot.scanning .slot-scan { opacity: 1; animation: sweep 1.1s linear infinite; }
@keyframes sweep { from { background-position: 0 100%; } to { background-position: 0 0; } }
.slot-actions { display: flex; gap: 8px; }

/* ---------- « pour qui ? » */
.who-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; padding-bottom: 4px; }
.who-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 60px; padding: 0 12px;
  border-radius: 15px; border: 3px solid var(--pc); color: #fff;
  background: #13285a;
  background: color-mix(in srgb, var(--pc) 20%, #0a1530);
  font: 800 19px var(--hud); letter-spacing: 2px; text-transform: uppercase;
  box-shadow: 0 4px 0 #04102a, 0 0 16px color-mix(in srgb, var(--pc) 30%, transparent);
  transition: transform .08s, box-shadow .08s;
}
.who-btn .led { width: 12px; height: 12px; box-shadow: 0 0 0 3px #0a1530, 0 0 0 5px var(--pc), 0 0 12px var(--pc); }
.who-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #04102a; }
.who-btn.current { background: var(--pc); color: #06132b; }
.who-btn.current .led { background: #06132b; }
.who-btn.armed { outline: 3px solid var(--orange); outline-offset: 3px; animation: armed .9s ease-in-out infinite; }
@keyframes armed { 50% { filter: brightness(1.35); } }

.dup { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 11px; border: 2px dashed var(--orange); background: rgba(255, 162, 76, .1); color: #ffdcb8; font-size: 14px; line-height: 1.4; }
.dup .ico { width: 20px; height: 20px; margin-top: 1px; color: var(--orange); }

.edit-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-bottom: 4px; }
.edit-actions .btn { gap: 8px; padding: 0 10px; font-size: 15px; letter-spacing: 1px; white-space: nowrap; }
.edit-actions .ico { width: 18px; height: 18px; }

/* ---------- menu */
.help { margin: 0; font-size: 15px; line-height: 1.5; color: var(--ink); }
.help.small { font-size: 13px; color: var(--muted); }
ul.help, ol.help { display: grid; gap: 6px; padding-left: 20px; }
.bm-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding-bottom: 4px; }
.bm-row .chip { flex: 0 1 auto; padding: 0 14px; }
.bookmarklet { cursor: grab; }

/* ---------- connexion */
.pw-form { display: flex; flex-direction: column; gap: 14px; }
.login { display: flex; flex-direction: column; gap: 14px; width: min(380px, 100%); margin: 0 auto; padding: 6px 4px 18px; }
.bootlog { display: grid; gap: 3px; margin-bottom: 4px; font: 600 12.5px/1.5 ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace; letter-spacing: .5px; text-transform: uppercase; color: #8fb3d6; }
.bootlog span { opacity: 0; animation: appear .01s linear forwards; animation-delay: var(--d); }
.bootlog b { color: var(--green); font-weight: 800; }
@keyframes appear { to { opacity: 1; } }
.login h1 { margin: 6px 0 0; font: 800 22px var(--hud); letter-spacing: 3px; text-transform: uppercase; color: var(--cyan); text-shadow: 0 0 12px rgba(150, 224, 247, .45); }
.login-error { min-height: 1.2em; margin: 0; font: 600 14px/1.4 var(--text); color: var(--danger-ink); }
.fatal { display: grid; justify-items: center; gap: 14px; padding: 20px; text-align: center; }
.fatal strong { font: 800 20px var(--hud); letter-spacing: 2px; text-transform: uppercase; color: var(--danger-ink); }
.fatal p { margin: 0; color: var(--muted); }

/* ---------- messages éphémères */
.toast {
  --pc: var(--green);
  position: fixed; left: 50%; top: calc(var(--safe-t) + 16px); z-index: 80;
  display: flex; align-items: center; gap: 10px; max-width: calc(100% - 32px); padding: 11px 16px;
  border-radius: 13px; border: 3px solid var(--bezel-edge); background: #0c1838; color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--pc), 0 10px 28px rgba(0, 0, 0, .5);
  font: 600 14px/1.3 var(--text);
  transform: translate(-50%, calc(-100% - 50px)); transition: transform .25s;
}
.toast.in { transform: translate(-50%, 0); }
.toast-warn { --pc: var(--orange); }
.toast-err { --pc: var(--red); }

/* ---------- grand écran */
@media (min-width: 760px) {
  .device { top: 24px; bottom: 24px; left: 50%; right: auto; width: min(1120px, calc(100vw - 48px)); transform: translateX(-50%); padding: 0 18px 16px; border-radius: 32px; }
  .device-top { height: 74px; gap: 8px; }
  .logo { gap: 8px; font-size: 24px; letter-spacing: 3px; padding: 7px 18px; }
  .logo > span:not(.logo-gift) { margin-right: -3px; }
  .logo-gift { width: 30px; height: 30px; }
  .corner-btn.me { padding: 0 15px; }
  .me-name { font-size: 14px; letter-spacing: 1px; margin-right: -1px; }
  .screen-scroll { padding: 20px 22px 26px; }
  .seg { grid-auto-columns: minmax(150px, 210px); justify-content: start; }
  .dash { max-width: 560px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(184px, 1fr)); gap: 16px; }
  .device-bottom { flex-direction: row; align-items: center; gap: 16px; padding-top: 14px; }
  .ticker { flex: 1; height: 46px; }
  .actions { flex: none; width: 380px; padding-bottom: 4px; }
  .sheet-wrap { align-items: center; padding: 24px; }
  .sheet { max-height: 90dvh; padding-bottom: 10px; border-radius: 28px; transform: translateY(30px); opacity: 0; transition: transform .25s, opacity .2s; }
  .sheet-wrap.open .sheet { opacity: 1; }
  .sheet-body { border-radius: 18px; padding-bottom: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .bootlog span { opacity: 1; }
}
