/* ==========================================================================
   Garde-Manger — feuille de style
   Implémentation de Garde-Manger.dc.html (Claude Design).
   Les valeurs (couleurs, rayons, tailles) reprennent la maquette au pixel.
   ========================================================================== */

:root {
  /* Encre et surfaces */
  --ink:        #12121A;
  --bg:         #F2F3F9;
  --surface:    #E4E7F2;
  --white:      #FFFFFF;

  /* Gris de texte */
  --muted:      #71768C;
  --muted-2:    #8A8FA3;
  --muted-3:    #A9AEC2;

  /* Accents */
  --violet:      #5B4BFF;
  --violet-deep: #4A38E0;
  --violet-soft: #E6E2FF;
  --red:         #FF4D3D;
  --red-deep:    #D93A26;
  --red-soft:    #FFE2DC;
  --amber:       #FF9F1C;
  --amber-deep:  #B87400;
  --amber-soft:  #FFF0CC;
  --teal:        #00806E;
  --teal-soft:   #D3F7F0;
  --lime:        #C8FF3D;

  /* Traits et ombres */
  --hairline:  rgba(18, 18, 26, .07);
  --rule:      rgba(18, 18, 26, .1);
  --border:    rgba(18, 18, 26, .14);
  --card-sh:   0 1px 2px rgba(18, 18, 26, .06);

  --font:  'Outfit', system-ui, -apple-system, sans-serif;
  --font-display: 'Space Grotesk', var(--font);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  margin: 0;
  background: radial-gradient(120% 80% at 50% 0%, #FFFFFF 0%, #DDE1F0 100%);
  font-family: var(--font);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--violet); }
a:hover { color: var(--red); }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  text-align: left;
  cursor: pointer;
}

input, select, textarea { font-family: inherit; color: inherit; }

::-webkit-scrollbar { width: 0; height: 0; }
.scroll-y { scrollbar-width: none; }

/* --------------------------------------------------------------------------
   Châssis : plein écran sur mobile, cadre iPhone sur grand écran
   -------------------------------------------------------------------------- */

.stage {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.device {
  position: relative;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
}

/* Installée sur l'écran d'accueil, l'app occupe l'encoche et la barre
   d'accueil : les zones sûres sont reportées sur la barre d'onglets et sur
   la marge haute des écrans. */
@media (display-mode: standalone), (display-mode: fullscreen) {
  .tabbar { bottom: calc(26px + env(safe-area-inset-bottom, 0px)); }
  .toast { bottom: calc(104px + env(safe-area-inset-bottom, 0px)); }
  .screen { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  .screen { padding-top: calc(62px + env(safe-area-inset-top, 0px)); }
  .screen--tight { padding-top: calc(56px + env(safe-area-inset-top, 0px)); }
  .banner { top: calc(60px + env(safe-area-inset-top, 0px)); }
  .scan-hint { top: calc(60px + env(safe-area-inset-top, 0px)); }
  .scan-close { top: calc(56px + env(safe-area-inset-top, 0px)); }
  .scan-foot { bottom: calc(52px + env(safe-area-inset-bottom, 0px)); }
  .scan-sheet { bottom: calc(118px + env(safe-area-inset-bottom, 0px)); }
}

.device-island,
.status-bar,
.home-indicator { display: none; }

@media (min-width: 700px) and (min-height: 940px) {
  .stage { padding: 48px 0; }

  .device {
    width: 402px;
    height: 874px;
    border-radius: 48px;
    box-shadow: 0 40px 80px rgba(0, 0, 0, .18), 0 0 0 1px rgba(0, 0, 0, .12);
  }

  .device-island {
    display: block;
    position: absolute;
    top: 11px;
    left: 50%;
    transform: translateX(-50%);
    width: 126px;
    height: 37px;
    border-radius: 24px;
    background: #000;
    z-index: 50;
  }

  .status-bar {
    display: flex;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 45;
    align-items: center;
    justify-content: space-between;
    padding: 21px 30px 19px;
    pointer-events: none;
    color: #000;
  }
  .status-time {
    font-family: -apple-system, 'SF Pro', system-ui;
    font-weight: 600;
    font-size: 17px;
    line-height: 22px;
  }
  .status-icons { display: flex; align-items: center; gap: 7px; }

  .home-indicator {
    display: flex;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 34px;
    z-index: 60;
    justify-content: center;
    align-items: flex-end;
    padding-bottom: 8px;
    pointer-events: none;
  }
  .home-indicator span {
    width: 139px;
    height: 5px;
    border-radius: 100px;
    background: rgba(0, 0, 0, .25);
  }

  /* Barre d'état claire au-dessus de l'écran scan (fond sombre) */
  .device[data-screen="scan"] .status-bar { color: #FFF; }
  .device[data-screen="scan"] .home-indicator span { background: rgba(255, 255, 255, .7); }
}

.app {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  position: relative;
  overflow: hidden;
}

.screen-host {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* --------------------------------------------------------------------------
   Animations
   -------------------------------------------------------------------------- */

@keyframes slidein { from { transform: translateY(-120%); opacity: 0 } to { transform: translateY(0); opacity: 1 } }
@keyframes scanline { 0% { top: 8% } 100% { top: 92% } }
@keyframes pop { from { transform: scale(.96); opacity: 0 } to { transform: scale(1); opacity: 1 } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* --------------------------------------------------------------------------
   Primitives partagées
   -------------------------------------------------------------------------- */

.screen {
  flex: 1;
  overflow: auto;
  scrollbar-width: none;
  padding: 62px 0 96px;
}
.screen--tight { padding-top: 56px; }
.pad { padding: 0 20px; }

/* 40px cale « Le garde-manger » sur une ligne dans le gabarit 402px de la
   maquette ; en dessous, le titre se réduit plutôt que de passer à la ligne. */
.title-xl {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -.03em;
  font-size: clamp(30px, 9.5vw, 40px);
  line-height: 1.05;
}
.title-l  { font-family: var(--font-display); font-weight: 700; letter-spacing: -.03em; font-size: 36px; line-height: 1.05; }
.title-m  { font-family: var(--font-display); font-weight: 700; letter-spacing: -.03em; font-size: 30px; line-height: 1.1; }
.title-s  { font-family: var(--font-display); font-weight: 700; letter-spacing: -.03em; font-size: 22px; line-height: 1.15; padding-right: 4px; }

.eyebrow {
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted-2);
  font-weight: 500;
}

.section-label {
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted-2);
  font-weight: 500;
}
.section-label--tight { letter-spacing: .1em; font-size: 11.5px; font-weight: 400; }

.section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
}
.section-head .rule { flex: 1; height: 1px; background: var(--rule); }
.section-head .count { font-size: 12px; color: var(--muted-2); }

.card {
  background: var(--white);
  border-radius: 20px;
  box-shadow: var(--card-sh);
}
.card--pad { padding: 16px; }
.card--list { padding: 4px 16px; }
.card--sm { border-radius: 18px; }

.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--hairline);
}
.list-row:last-child { border-bottom: none; }

.tile {
  border-radius: 12px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grow { flex: 1; min-width: 0; }

.round-btn {
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  cursor: pointer;
  border: 1px solid var(--border);
  background: transparent;
}
.round-btn--filled { background: var(--violet); border-color: var(--violet); }

.pill {
  flex: none;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--rule);
  background: var(--white);
  color: var(--ink);
  white-space: nowrap;
}
.pill[aria-pressed="true"] { background: var(--ink); color: var(--white); border-color: var(--ink); }

.btn-primary {
  background: var(--violet);
  color: var(--white);
  border-radius: 16px;
  padding: 15px;
  text-align: center;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  display: block;
}
.btn-secondary {
  padding: 13px 16px;
  border-radius: 14px;
  border: 1px solid rgba(18, 18, 26, .16);
  font-size: 14.5px;
  cursor: pointer;
  background: transparent;
  flex: none;
  white-space: nowrap;
}

/* Dans une paire d'actions, le bouton principal occupe la place restante. */
.actions .btn-primary,
.account-actions .btn-primary { flex: 1; width: auto; }

.link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--violet);
  cursor: pointer;
}

.chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 16px 20px 4px;
}

/* --------------------------------------------------------------------------
   Bannière de notification
   -------------------------------------------------------------------------- */

.banner {
  position: absolute;
  top: 60px;
  left: 12px;
  right: 12px;
  z-index: 80;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 22px;
  padding: 13px 15px;
  box-shadow: 0 12px 30px rgba(18, 18, 26, .18);
  display: flex;
  gap: 11px;
  align-items: flex-start;
  animation: slidein .5s cubic-bezier(.2, .9, .3, 1) both;
  cursor: pointer;
  width: calc(100% - 24px);
}
.banner-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.banner-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.banner-app { font-size: 13px; font-weight: 700; }
.banner-time { font-size: 11px; color: var(--muted); }
.banner-body { font-size: 13.5px; line-height: 1.35; margin-top: 1px; }

/* --------------------------------------------------------------------------
   Écran Stock
   -------------------------------------------------------------------------- */

.stock-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.icon-btn {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 19px;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 2px rgba(18, 18, 26, .08);
  cursor: pointer;
  flex: none;
}
.icon-btn--offset { margin-top: 6px; }
.icon-btn .dot {
  position: absolute;
  top: 6px;
  right: 7px;
  width: 9px;
  height: 9px;
  border-radius: 5px;
  background: var(--red);
  border: 2px solid var(--white);
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}
.stat {
  border-radius: 18px;
  padding: 14px 15px;
  background: var(--white);
  box-shadow: var(--card-sh);
}
.stat--accent { background: var(--violet); color: var(--white); box-shadow: none; }
.stat-value {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -.03em;
  font-size: 34px;
  line-height: 1;
}
.stat-label { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.stat--accent .stat-label { color: inherit; opacity: .8; }

.group { padding: 14px 20px 0; }
.group-items { display: flex; flex-direction: column; gap: 8px; }

.product-row {
  background: var(--white);
  border-radius: 16px;
  padding: 12px 13px;
  display: flex;
  gap: 12px;
  align-items: center;
  cursor: pointer;
  box-shadow: var(--card-sh);
  width: 100%;
}
.product-row .tile { width: 44px; height: 44px; font-size: 14px; }
.product-row .name { font-size: 15px; font-weight: 500; }
.product-row .dlc { font-size: 12.5px; margin-top: 2px; }
.product-row .qty { font-size: 15px; font-weight: 700; }
.product-row .seuil { font-size: 11.5px; color: var(--muted-2); }

.empty-note {
  padding: 40px;
  text-align: center;
  color: var(--muted-2);
  font-size: 13.5px;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Écran Scan
   -------------------------------------------------------------------------- */

/* Le flux caméra est masqué hors de l'écran de scan, mais reste dans le DOM
   pour que la piste vidéo ne soit pas recréée à chaque rendu. */
#camera {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  background: #0D0D1A;
}
.device[data-screen="scan"] #camera { display: block; }

.scan {
  flex: 1;
  background: transparent;
  position: relative;
  overflow: hidden;
}
/* Dégradé de repli tant que la caméra n'a pas démarré, ou si elle est refusée. */
.scan-bg { position: absolute; inset: 0; background: linear-gradient(160deg, #2C2A63, #0D0D1A 62%); }
.scan--live .scan-bg { background: transparent; }
.scan-hint {
  position: absolute;
  top: 60px;
  left: 0;
  right: 0;
  z-index: 2;
  text-align: center;
  color: rgba(255, 255, 255, .7);
  font-size: 13.5px;
}
/* Le voile sombre est l'ombre portée du viseur : elle recouvre tout l'écran,
   d'où l'étagement explicite des éléments qui doivent rester au-dessus. */
.scan-window {
  position: absolute;
  top: 190px;
  left: 50%;
  transform: translateX(-50%);
  width: 310px;
  height: 200px;
  z-index: 1;
  border-radius: 20px;
  box-shadow: 0 0 0 2000px rgba(9, 9, 20, .6);
  overflow: hidden;
}
.scan-window .frame {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  border: 2px solid rgba(255, 255, 255, .9);
}
.scan-line {
  position: absolute;
  left: 6%;
  right: 6%;
  height: 2px;
  background: var(--lime);
  box-shadow: 0 0 16px var(--lime);
  animation: scanline 1.1s ease-in-out infinite alternate;
}
.scan-barcode {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  gap: 3px;
  align-items: flex-end;
  opacity: .85;
}
.scan-barcode i { display: block; height: 86px; background: #FFF; }

.scan-sheet {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 118px;
  z-index: 2;
  background: var(--bg);
  border-radius: 24px;
  padding: 16px;
  animation: pop .35s cubic-bezier(.2, .9, .3, 1) both;
}
.scan-sheet .actions { display: flex; gap: 9px; margin-top: 14px; }
.scan-sheet .actions .btn-primary { border-radius: 14px; padding: 13px; font-size: 14.5px; }

.scan-close {
  position: absolute;
  left: 20px;
  top: 56px;
  width: 34px;
  height: 34px;
  z-index: 2;
  border-radius: 17px;
  background: rgba(255, 255, 255, .16);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.scan-manual { margin-top: 12px; }
.scan-manual input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
  background: transparent;
  font-size: 16px;
  letter-spacing: .06em;
  color: var(--ink);
}
.scan-thumb {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  object-fit: cover;
  flex: none;
  background: var(--surface);
}
.scan-busy {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 118px;
  z-index: 2;
  text-align: center;
  color: rgba(255, 255, 255, .85);
  font-size: 14px;
}

.scan-foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 52px;
  z-index: 2;
  text-align: center;
  color: rgba(255, 255, 255, .5);
  font-size: 12.5px;
}

/* --------------------------------------------------------------------------
   Fiche produit
   -------------------------------------------------------------------------- */

.product-head {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-top: 14px;
}
.product-head .tile { width: 60px; height: 60px; border-radius: 18px; font-size: 19px; }
.product-meta { font-size: 13px; color: var(--muted); margin-top: 3px; }

.photo-slot {
  position: relative;
  height: 150px;
  border-radius: 22px;
  overflow: hidden;
  margin-top: 16px;
  display: block;
  width: 100%;
  cursor: pointer;
}
.photo-slot--edit { height: 140px; border-radius: 20px; margin-top: 14px; }
.photo-slot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-slot .placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: currentColor;
  opacity: .65;
}
.photo-slot.is-over { outline: 2px dashed var(--violet); outline-offset: -6px; }

.qty-card { padding: 16px; margin-top: 10px; }
.qty-head { display: flex; align-items: center; justify-content: space-between; }
.qty-value {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 2px;
}
.qty-number {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -.03em;
  font-size: 44px;
  line-height: 1;
}
.qty-unit { font-size: 15px; color: var(--muted); }
.qty-actions { display: flex; gap: 10px; }
.qty-actions .round-btn { width: 46px; height: 46px; }

.gauge {
  height: 6px;
  border-radius: 3px;
  background: var(--surface);
  margin-top: 14px;
  overflow: hidden;
}
.gauge i { display: block; height: 100%; border-radius: 3px; }
.qty-note { font-size: 12.5px; color: var(--muted); margin-top: 7px; }

.mini-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}
.mini { padding: 14px 15px; }
.mini .value { font-size: 16px; font-weight: 500; margin-top: 4px; }
.mini .sub { font-size: 12.5px; color: var(--muted-2); }

.lot-bar { width: 8px; height: 32px; border-radius: 4px; flex: none; }
.lot-date { font-size: 14px; }
.lot-status { font-size: 12px; }
.lot-qty { font-size: 14px; font-weight: 500; }

.move-badge {
  width: 26px;
  height: 26px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex: none;
}
.move-label { font-size: 14px; }
.move-who { font-size: 12px; color: var(--muted-2); }
.move-date { font-size: 12.5px; color: var(--muted-2); }

.stack-head { display: flex; align-items: center; gap: 8px; margin: 22px 0 10px; }
.stack-head .rule { flex: 1; height: 1px; background: var(--rule); }
.stack-title { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-2); margin: 22px 0 10px; }

/* --------------------------------------------------------------------------
   Écran Courses
   -------------------------------------------------------------------------- */

.courses-sub { font-size: 13px; color: var(--muted-2); margin-top: 6px; }

.cat-chip {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  background: var(--white);
  color: var(--ink);
  border: 1px solid var(--white);
  white-space: nowrap;
}
.cat-chip[aria-pressed="false"] {
  background: transparent;
  color: var(--muted-3);
  border-color: rgba(18, 18, 26, .16);
}
.cat-chip .dot { width: 7px; height: 7px; border-radius: 4px; }
.cat-chip .n { opacity: .55; }

.add-zone { padding: 6px 20px 0; position: relative; z-index: 20; }
.add-bar {
  background: var(--white);
  border-radius: 16px;
  box-shadow: var(--card-sh);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
}
.add-bar input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  font-size: 15px;
  background: transparent;
}
.add-bar .go { font-size: 13.5px; font-weight: 500; color: var(--violet); cursor: pointer; flex: none; }

.suggestions {
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 8px 26px rgba(18, 18, 26, .14);
  margin-top: 6px;
  overflow: hidden;
}
.suggestion {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 14px;
  cursor: pointer;
  border-bottom: 1px solid rgba(18, 18, 26, .06);
  width: 100%;
}
.suggestion:last-child { border-bottom: none; }
.suggestion .tile { width: 30px; height: 30px; border-radius: 9px; font-size: 11px; }
.suggestion .name { font-size: 14.5px; }
.suggestion .meta { font-size: 12px; color: var(--muted-2); }
.suggestion .cat { font-size: 12px; color: var(--muted-2); }

.swipe-wrap {
  position: relative;
  border-radius: 15px;
  overflow: hidden;
  background: var(--red-soft);
  touch-action: pan-y;
}
.swipe-bg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 14px;
}
.swipe-del {
  height: 44px;
  border-radius: 22px;
  background: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.swipe-card {
  position: relative;
  background: var(--white);
  border-radius: 15px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--card-sh);
  touch-action: pan-y;
}
.check {
  width: 22px;
  height: 22px;
  border-radius: 11px;
  flex: none;
  cursor: pointer;
  border: 1.6px solid rgba(18, 18, 26, .25);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}
.check[aria-checked="true"] { background: var(--violet); border-color: var(--violet); }
.line-name { font-size: 15px; }
.line-reason { font-size: 12px; color: var(--muted-2); }
.qty-ctrl { display: flex; align-items: center; gap: 9px; flex: none; }
.qty-ctrl .round-btn { width: 28px; height: 28px; }
.qty-ctrl .n { font-size: 14px; font-weight: 500; min-width: 44px; text-align: center; }

/* --------------------------------------------------------------------------
   Écran Alertes
   -------------------------------------------------------------------------- */

.alerts-head { display: flex; justify-content: space-between; align-items: center; }
.alert-group { margin-top: 22px; }
.alert-items { display: flex; flex-direction: column; gap: 9px; }
.alert {
  background: var(--white);
  border-left: 4px solid var(--muted-2);
  border-radius: 14px;
  padding: 13px 14px;
  cursor: pointer;
  box-shadow: var(--card-sh);
  width: 100%;
}
.alert-top { display: flex; justify-content: space-between; gap: 10px; }
.alert-title { font-size: 15px; font-weight: 500; }
.alert-tag { font-size: 12px; font-weight: 500; flex: none; }
.alert-sub { font-size: 13px; color: var(--muted); margin-top: 3px; line-height: 1.35; }
.alert-action { font-size: 13px; color: var(--violet); font-weight: 500; margin-top: 8px; }

/* --------------------------------------------------------------------------
   Écran Réglages
   -------------------------------------------------------------------------- */

.setting-title { font-size: 14.5px; font-weight: 500; }
.setting-sub { font-size: 12.5px; color: var(--muted-2); margin-top: 3px; }

.delay-value { display: flex; align-items: baseline; gap: 6px; margin-top: 12px; }
.delay-number {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -.03em;
  font-size: 38px;
  line-height: 1;
}
.delay-unit { font-size: 14px; color: var(--muted); }
.delay-options { display: flex; gap: 7px; margin-top: 12px; }
.delay-option {
  flex: 1;
  text-align: center;
  padding: 10px 0;
  border-radius: 12px;
  font-size: 14px;
  cursor: pointer;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--rule);
}
.delay-option[aria-pressed="true"] { background: var(--violet); color: var(--white); border-color: var(--violet); }

.switch {
  width: 50px;
  height: 30px;
  border-radius: 15px;
  flex: none;
  background: rgba(18, 18, 26, .16);
  position: relative;
  cursor: pointer;
  transition: background .2s;
}
.switch[aria-checked="true"] { background: var(--violet); }
.switch i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 12px;
  background: var(--white);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
  transition: left .2s;
}
.switch[aria-checked="true"] i { left: 23px; }

.member-avatar {
  width: 34px;
  height: 34px;
  border-radius: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex: none;
}
.member-name { flex: 1; font-size: 14.5px; }
.member-role { font-size: 12.5px; color: var(--muted-2); }

.place-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.place-name { font-size: 14.5px; }
.place-count { font-size: 12px; color: var(--muted-2); }
.place-remove { font-size: 12.5px; color: var(--red); cursor: pointer; }

.inline-input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14.5px;
}

.account-avatar {
  width: 46px;
  height: 46px;
  border-radius: 23px;
  background: var(--violet-soft);
  color: var(--violet-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  flex: none;
}
.account-name { font-size: 16px; font-weight: 500; }
.account-email { font-size: 12.5px; color: var(--muted-2); margin-top: 2px; }
.account-actions { display: flex; gap: 9px; margin-top: 14px; }
.account-actions .btn-primary { border-radius: 13px; padding: 12px; font-size: 14px; }
.account-actions .btn-secondary { border-radius: 13px; padding: 12px 16px; font-size: 14px; }

.danger-btn {
  background: var(--white);
  border: 1px solid rgba(255, 77, 61, .35);
  border-radius: 16px;
  padding: 14px;
  text-align: center;
  font-size: 15px;
  font-weight: 500;
  color: var(--red);
  margin-top: 10px;
  cursor: pointer;
  width: 100%;
  display: block;
}
.version { font-size: 12px; color: var(--muted-3); text-align: center; margin-top: 10px; }

/* --------------------------------------------------------------------------
   Écran Modifier la fiche
   -------------------------------------------------------------------------- */

.photo-note { font-size: 12px; color: var(--muted-2); margin-top: 7px; text-align: center; }

.place-picker { display: flex; flex-wrap: wrap; gap: 7px; }
.place-pick {
  padding: 9px 14px;
  border-radius: 20px;
  font-size: 13.5px;
  cursor: pointer;
  background: var(--white);
  color: var(--ink);
  border: 1px solid rgba(18, 18, 26, .12);
}
.place-pick[aria-pressed="true"] { background: var(--violet); color: var(--white); border-color: var(--violet); }

.stepper-card {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.stepper { display: flex; align-items: center; gap: 11px; }
.stepper .round-btn { width: 32px; height: 32px; }
.stepper .n {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  min-width: 60px;
  text-align: center;
}
.stepper--sm { gap: 10px; }
.stepper--sm .round-btn { width: 30px; height: 30px; }
.stepper--sm .n { font-family: var(--font); font-size: 15px; font-weight: 500; min-width: 26px; }

.weight-field { display: flex; align-items: center; gap: 7px; flex: none; }
.weight-field input {
  width: 64px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  outline: none;
  background: transparent;
  font-size: 14.5px;
  text-align: right;
}
.weight-field select {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 26px 8px 10px;
  outline: none;
  background: transparent;
  font-size: 14.5px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none'><path d='M6 9l6 6 6-6' stroke='%2371768C' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
}

.lot-editor-row .stepper--sm .n { min-width: 22px; font-size: 14px; }
.lot-remove {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: none;
}
.new-lot-input {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  outline: none;
  background: transparent;
  font-size: 14px;
}

/* --------------------------------------------------------------------------
   Barre d'onglets et toast
   -------------------------------------------------------------------------- */

.tabbar {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 26px;
  height: 64px;
  border-radius: 32px;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 10px 30px rgba(18, 18, 26, .14);
  display: flex;
  align-items: center;
  padding: 0 6px;
  z-index: 40;
}
.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  color: var(--muted-3);
  background: none;
}
.tab[aria-current="page"] { color: var(--violet); }
.tab span { font-size: 10.5px; font-weight: 500; }
.tab-scan { flex: none; width: 56px; display: flex; justify-content: center; cursor: pointer; }
.tab-scan i {
  width: 48px;
  height: 48px;
  border-radius: 24px;
  background: var(--violet);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(91, 75, 255, .38);
}

/* --------------------------------------------------------------------------
   Accueil de foyer
   -------------------------------------------------------------------------- */

.onboard { padding-top: 24px; }

.onboard-mark {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: var(--violet);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
}
.onboard-mark svg { width: 32px; height: 32px; }

.onboard-lead {
  font-size: 15px;
  line-height: 1.45;
  color: var(--muted);
  margin: 12px 0 0;
}

.field { display: block; }
.field > span {
  display: block;
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 6px;
}
.field > input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
  background: transparent;
  font-size: 16px;
  color: var(--ink);
}
.field > input:focus { border-color: var(--violet); }

.onboard-error {
  font-size: 13.5px;
  color: var(--red);
  line-height: 1.4;
  margin: 12px 0 0;
}

.btn-outline {
  display: block;
  width: 100%;
  border-radius: 16px;
  padding: 15px;
  text-align: center;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  background: var(--white);
  color: var(--ink);
  border: 1px solid var(--border);
}

.btn-primary[disabled],
.btn-outline[disabled] { opacity: .55; cursor: default; }

/* --------------------------------------------------------------------------
   Foyer : code d'invitation, membres, état de connexion
   -------------------------------------------------------------------------- */

.field-inline { margin-bottom: 14px; }

.invite {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg);
  border-radius: 14px;
  padding: 12px 14px;
}
.invite-code {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: .08em;
  margin-top: 2px;
}

.badge-you {
  font-size: 11px;
  font-weight: 500;
  color: var(--violet-deep);
  background: var(--violet-soft);
  border-radius: 6px;
  padding: 2px 6px;
  margin-left: 6px;
  vertical-align: 1px;
}

/* Posé au-dessus de la zone du toast pour que les deux puissent coexister. */
.conn {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 148px;
  border-radius: 14px;
  padding: 10px 14px;
  font-size: 12.5px;
  text-align: center;
  z-index: 65;
  background: rgba(18, 18, 26, .82);
  color: var(--white);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.conn--connecting { background: rgba(91, 75, 255, .92); }
.conn--offline { background: rgba(255, 159, 28, .95); color: #2A1A00; }

.toast {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 104px;
  background: var(--ink);
  color: var(--white);
  border-radius: 16px;
  padding: 13px 16px;
  font-size: 13.5px;
  text-align: center;
  z-index: 70;
  animation: pop .3s both;
}
