/* MocoCellar — design dans l'esprit d'apple.com et des Human Interface Guidelines.
   Principes (skill apple-design) : réponse immédiate (retour dès l'appui), mouvements à ressort interruptibles,
   matériaux translucides, interlettrage adapté à la taille, thème clair / sombre / automatique, réduction de
   mouvement, de transparence et contraste renforcé respectés. */

:root {
  color-scheme: light;
  /* Palette apple.com : gris clair, tuiles blanches à plat, texte quasi noir, un seul bleu pour l'action. */
  --bg: #f5f5f7;
  --bg-elev: #ffffff;
  --bg-elev-2: #fbfbfd;
  --label: #1d1d1f;
  --label-2: #6e6e73;
  --label-3: #a1a1a6;
  --sep: #d2d2d7;
  --fill: #f0f0f3;
  --fill-2: #e8e8ed;
  --tint: #0071e3;
  --tint-hover: #0077ed;
  --link: #0066cc;
  --tint-soft: rgba(0, 113, 227, 0.08);
  --on-tint: #ffffff;
  --green: #1d8a3a;
  --orange: #b64400;
  --red: #e30000;
  --blue: #0066cc;
  --green-soft: #f0f0f3;
  --orange-soft: #f0f0f3;
  --red-soft: #f0f0f3;
  --blue-soft: #f0f0f3;
  --material: rgba(245, 245, 247, 0.72);
  --material-border: rgba(0, 0, 0, 0.1);
  --material-edge: rgba(255, 255, 255, 0.7);
  --shadow-sheet: 0 -8px 40px rgba(0, 0, 0, 0.12);
  --shadow-card: none;
  --shadow-hover: 2px 4px 16px rgba(0, 0, 0, 0.08);
  --scrim: rgba(0, 0, 0, 0.4);
  --seg-active: #ffffff;
  --toast-bg: rgba(29, 29, 31, 0.9);

  --wine-rouge: #7a1530;
  --wine-blanc: #e6cf7c;
  --wine-rose: #f19aa0;
  --wine-effervescent: #efe0a0;
  --wine-liquoreux: #d4921f;

  --cab-body: #1d1d1f;
  --cab-glass: linear-gradient(180deg, #111113 0%, #161618 100%);
  --cab-rail: #6b4a2f;

  --radius: 18px;
  --radius-lg: 28px;
  --pill: 980px;
  --tabbar-h: 50px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);

  /* Mouvement : ressorts (amortissement 1 = sans rebond ; 0,8 = léger rebond pour les gestes à élan). */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in: cubic-bezier(0.64, 0, 0.78, 0);
  --spring: cubic-bezier(0.22, 1, 0.36, 1);
  --spring-bounce: cubic-bezier(0.34, 1.4, 0.64, 1);

  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}
@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --spring: linear(0, 0.028, 0.093, 0.179, 0.272, 0.365, 0.453, 0.533, 0.605, 0.669, 0.724, 0.77, 0.81, 0.844, 0.872, 0.895, 0.915, 0.93, 0.944, 0.954, 0.963, 0.97, 0.976, 0.981, 0.984, 0.988, 0.99, 0.992, 1);
    --spring-bounce: linear(0, 0.04, 0.137, 0.26, 0.39, 0.515, 0.628, 0.724, 0.804, 0.867, 0.915, 0.951, 0.977, 0.994, 1.005, 1.011, 1.014, 1.015, 1.015, 1.013, 1.011, 1.009, 1.007, 1.006, 1.004, 1.003, 1.002, 1.001, 1.001, 1.0, 1.0, 1.0, 1.0, 1.0, 1);
  }
}

/* Thème sombre : suit l'appareil sauf choix « clair » ; forcé par data-theme="dark". */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --bg: #000000;
    --bg-elev: #1d1d1f;
    --bg-elev-2: #161617;
    --label: #f5f5f7;
    --label-2: #a1a1a6;
    --label-3: #6e6e73;
    --sep: #424245;
    --fill: #2a2a2d;
    --fill-2: #333336;
    --link: #2997ff;
    --tint-soft: rgba(41, 151, 255, 0.14);
    --green: #30d158;
    --orange: #ff9f0a;
    --red: #ff453a;
    --blue: #2997ff;
    --green-soft: #2a2a2d;
    --orange-soft: #2a2a2d;
    --red-soft: #2a2a2d;
    --blue-soft: #2a2a2d;
    --material: rgba(22, 22, 23, 0.72);
    --material-border: rgba(255, 255, 255, 0.1);
    --material-edge: rgba(255, 255, 255, 0.12);
    --shadow-sheet: 0 -8px 40px rgba(0, 0, 0, 0.6);
    --shadow-hover: none;
    --scrim: rgba(0, 0, 0, 0.6);
    --seg-active: #636366;
    --toast-bg: rgba(58, 58, 60, 0.92);
    --wine-rouge: #a3264a;
  }
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #000000;
  --bg-elev: #1d1d1f;
  --bg-elev-2: #161617;
  --label: #f5f5f7;
  --label-2: #a1a1a6;
  --label-3: #6e6e73;
  --sep: #424245;
  --fill: #2a2a2d;
  --fill-2: #333336;
  --link: #2997ff;
  --tint-soft: rgba(41, 151, 255, 0.14);
  --green: #30d158;
  --orange: #ff9f0a;
  --red: #ff453a;
  --blue: #2997ff;
  --green-soft: #2a2a2d;
  --orange-soft: #2a2a2d;
  --red-soft: #2a2a2d;
  --blue-soft: #2a2a2d;
  --material: rgba(22, 22, 23, 0.72);
  --material-border: rgba(255, 255, 255, 0.1);
  --material-edge: rgba(255, 255, 255, 0.12);
  --shadow-sheet: 0 -8px 40px rgba(0, 0, 0, 0.6);
  --shadow-hover: none;
  --scrim: rgba(0, 0, 0, 0.6);
  --seg-active: #636366;
  --toast-bg: rgba(58, 58, 60, 0.92);
  --wine-rouge: #a3264a;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--label);
  font: 400 1.0625rem/1.47 var(--font);
  letter-spacing: -0.016em;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  overscroll-behavior-y: none;
  /* Changement de thème adouci (pas de saut de luminosité brutal). */
  transition: background-color 0.35s ease, color 0.35s ease;
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
a.row:hover, a.btn:hover, a.nav-btn:hover, a.side-link:hover, a.tab:hover { text-decoration: none; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; border-radius: 8px; }
.mono { font-family: var(--font-mono); font-size: 0.9375rem; letter-spacing: 0; user-select: all; }

/* ---------------------------------------------------------------- Structure */
.app { min-height: 100dvh; }
.sidebar { display: none; }
#view { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 28px); }
.page { max-width: 760px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 600px) { .page { padding: 0 24px; } }
.page.wide { max-width: 1100px; }

/* Barre de navigation : matériau translucide, estompage du contenu dessous (pas de filet dur) */
.navbar {
  position: sticky; top: 0; z-index: 20;
  padding-top: var(--safe-t);
  background: transparent;
  transition: background-color 0.3s ease;
}
.navbar::after {
  content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 14px; pointer-events: none;
  background: linear-gradient(var(--material), transparent); opacity: 0; transition: opacity 0.3s ease;
}
.navbar-inner {
  max-width: 760px; margin: 0 auto; height: 48px; padding: 0 8px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
}
.page.wide ~ .navbar .navbar-inner, .navbar.wide .navbar-inner { max-width: 1100px; }
.navbar-title {
  font-weight: 600; font-size: 1.0625rem; letter-spacing: -0.02em; opacity: 0; transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.5s var(--spring); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 56vw;
}
.navbar.scrolled, .navbar.solid {
  background: var(--material);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
}
.navbar.scrolled::after, .navbar.solid::after { opacity: 1; }
.navbar.scrolled .navbar-title, .navbar.solid .navbar-title { opacity: 1; transform: none; }
.navbar .left { justify-self: start; display: flex; align-items: center; }
.navbar .right { justify-self: end; display: flex; gap: 4px; align-items: center; }
.nav-btn {
  display: inline-flex; align-items: center; gap: 2px; min-height: 44px; min-width: 44px; padding: 0 8px;
  border: 0; background: none; color: var(--link); font-size: 1.0625rem; border-radius: 10px;
}
.nav-btn svg { width: 22px; height: 22px; }
.nav-btn.back svg { width: 13px; height: 22px; margin-right: 4px; }
.nav-btn:active { opacity: 0.4; transition: none; }
.nav-btn:hover { text-decoration: none; opacity: 0.8; }
.nav-btn.strong { font-weight: 600; }

/* Titres : plus ils sont grands, plus l'interlettrage est serré ; l'interligne se resserre aussi. */
.large-title {
  font: 600 2.125rem/1.1 var(--font-display);
  letter-spacing: -0.026em;
  margin: 10px 0 8px;
}
@media (min-width: 900px) { .large-title { font-size: 3rem; line-height: 1.05; letter-spacing: -0.032em; margin-top: 14px; } }
.subtitle { color: var(--label-2); font-size: 1.1875rem; line-height: 1.42; letter-spacing: -0.012em; margin: 0 0 24px; }

/* ---------------------------------------------------------------- Barre d'onglets : verre dépoli, bord supérieur lumineux */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding-bottom: var(--safe-b);
  background: var(--material);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 -0.5px 0 var(--material-border), inset 0 0.5px 0 var(--material-edge);
}
.tabbar-inner { display: grid; grid-template-columns: repeat(5, 1fr); max-width: 600px; margin: 0 auto; height: var(--tabbar-h); }
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--label-2); font-size: 0.625rem; font-weight: 500; letter-spacing: 0.02em;
  border: 0; background: none; padding: 4px 0 0; transition: color 0.2s ease;
}
.tab svg { width: 25px; height: 25px; transition: transform 0.5s var(--spring); }
.tab:active svg { transform: scale(0.88); transition-duration: 0.08s; }
.tab[aria-current='page'] { color: var(--tint); }
.tab.add .add-pill {
  width: 30px; height: 30px; border-radius: 50%; background: var(--tint); color: var(--on-tint);
  display: grid; place-items: center; transition: transform 0.5s var(--spring);
}
.tab.add:active .add-pill { transform: scale(0.9); transition-duration: 0.08s; }
.tab.add .add-pill svg { width: 17px; height: 17px; stroke-width: 2.4; }
.tab.add { color: var(--label-2); }

@media (min-width: 900px) {
  .app { display: grid; grid-template-columns: 264px 1fr; }
  .tabbar { display: none; }
  #view { padding-bottom: 56px; min-width: 0; }
  .sidebar {
    display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100dvh;
    padding: 22px 14px; background: var(--material);
    -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
    box-shadow: 0.5px 0 0 var(--material-border);
  }
  .brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 28px; font: 600 1.25rem/1 var(--font-display); letter-spacing: -0.022em; }
  .brand .logo { width: 30px; height: 30px; color: var(--label); }
  .side-link {
    display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px;
    color: var(--label); font-weight: 500; font-size: 0.9375rem; border: 0; background: none; text-align: left;
    transition: background-color 0.2s ease;
  }
  .side-link svg { width: 20px; height: 20px; color: var(--label-2); transition: color 0.2s ease; }
  .side-link:hover { background: var(--fill); }
  .side-link[aria-current='page'] { background: var(--fill-2); color: var(--label); font-weight: 600; }
  .side-link[aria-current='page'] svg { color: var(--tint); }
  .side-foot { margin-top: auto; color: var(--label-3); font-size: 0.75rem; padding: 0 12px; letter-spacing: 0.01em; }
  .navbar-inner { padding: 0 16px; }
  .large-title { margin-top: 12px; }
}

/* ---------------------------------------------------------------- Transitions de vues : ressort sans rebond, symétriques */
.view-enter { animation: view-fade 0.5s var(--spring) both; }
.view-push { animation: view-push 0.55s var(--spring) both; }
.view-pop { animation: view-pop 0.55s var(--spring) both; }
@keyframes view-fade { from { opacity: 0; transform: translateY(8px); } }
@keyframes view-push { from { opacity: 0.3; transform: translateX(32%); } }
@keyframes view-pop { from { opacity: 0.3; transform: translateX(-32%); } }

/* ---------------------------------------------------------------- Listes groupées */
.section { margin: 28px 0; }
.section-header {
  display: flex; align-items: baseline; justify-content: space-between;
  color: var(--label); font-size: 0.9375rem; font-weight: 600; letter-spacing: -0.016em;
  padding: 0 4px 9px;
}
.section-header.big { font: 600 1.75rem/1.14 var(--font-display); letter-spacing: -0.018em; color: var(--label); padding: 0 4px 14px; }
.section-header button { text-transform: none; letter-spacing: 0; }
.section-footer { color: var(--label-2); font-size: 0.8125rem; padding: 9px 4px 0; line-height: 1.4; letter-spacing: 0; }
.list { background: var(--bg-elev); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-card); }
.row {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 44px;
  padding: 11px 18px; width: 100%; border: 0; background: none; text-align: left; color: inherit;
}
.row + .row::before, .row + .row-wrap::before, .row-wrap + .row::before {
  content: ''; position: absolute; top: 0; right: 0; left: 18px; height: 1px; background: var(--fill-2);
}
.row.with-thumb + .row::before, .row.with-thumb + .row.with-thumb::before { left: 72px; }
button.row:active, a.row:active, .row.tappable:active { background: var(--fill); transition: none; }
.row .icon-tile { transition: transform 0.5s var(--spring); }
button.row:active .icon-tile { transform: scale(0.92); transition-duration: 0.08s; }
@media (hover: hover) { button.row:hover, a.row:hover, .row.tappable:hover { background: var(--bg-elev-2); } }
button.row, a.row, .row.tappable { transition: background-color 0.45s ease; cursor: pointer; }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-size: 1.0625rem; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .title.strong { font-weight: 600; }
.row .sub { color: var(--label-2); font-size: 0.875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.row .value { color: var(--label-2); text-align: right; max-width: 60%; overflow-wrap: anywhere; }
.row .chev { color: var(--label-3); width: 8px; height: 14px; flex: none; }
/* Pictogrammes sobres : monochromes, sans pastilles colorées */
.row .icon-tile { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--label); background: var(--fill) !important; flex: none; }
.row .icon-tile svg { width: 18px; height: 18px; }
.row.destructive { color: var(--red); }
.row.tint { color: var(--link); }
.row.center { justify-content: center; }
.kv { display: grid; grid-template-columns: auto 1fr; }

/* ---------------------------------------------------------------- Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 24px; border-radius: var(--pill); border: 0;
  background: var(--tint); color: var(--on-tint); font-weight: 400; font-size: 1.0625rem; letter-spacing: -0.016em;
  touch-action: manipulation;
}
.btn svg { width: 20px; height: 20px; }

@media (hover: hover) { .btn:hover { background: var(--tint-hover); } .btn.secondary:hover, .btn.plain:hover { background: var(--fill-2); } .btn.ghost:hover { background: none; text-decoration: underline; } .btn.destructive:hover { background: var(--fill-2); } }
.btn:disabled { opacity: 0.4; transform: none; }
.btn.block { width: 100%; }
.btn.secondary { background: var(--fill); color: var(--label); }
.btn.plain { background: var(--fill); color: var(--label); }
.btn.ghost { background: none; color: var(--link); min-height: 44px; }
.btn.destructive { background: var(--fill); color: var(--red); }
.btn.small { min-height: 36px; padding: 0 16px; font-size: 0.9375rem; }
.btn-row { display: flex; gap: 10px; }
.btn-row > * { flex: 1; }
.stack { display: grid; gap: 10px; }

.action-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0; }
.action-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 78px; padding: 12px 6px; border-radius: var(--radius); border: 0;
  background: var(--bg-elev); color: var(--label); font-size: 0.8125rem; font-weight: 500; box-shadow: var(--shadow-card);
}
.action-tile svg { width: 24px; height: 24px; }
.action-tile svg { color: var(--link); }
.action-tile.primary { background: var(--tint); color: var(--on-tint); }
.action-tile.primary svg { color: var(--on-tint); }
.action-tile:disabled { opacity: 0.4; }

/* ---------------------------------------------------------------- Formulaires */
.field-row { display: flex; align-items: center; gap: 12px; padding: 0 18px; min-height: 50px; position: relative; transition: background-color 0.6s var(--ease-out); }
.field-row + .field-row::before, .field-row + .row::before, .row + .field-row::before, .suggest + .field-row::before {
  content: ''; position: absolute; top: 0; right: 0; left: 18px; height: 1px; background: var(--fill-2);
}
.field-row:focus-within { background: var(--bg-elev-2); }
.field-row.just-filled { background: var(--tint-soft); transition: none; }
.field-row label { flex: none; width: 34%; max-width: 150px; font-size: 1rem; color: var(--label); }
.field-row input, .field-row select, .field-row textarea {
  flex: 1; min-width: 0; border: 0; background: none; padding: 12px 0; outline: none; font-size: 1rem; text-align: right;
}
.field-row.stacked { flex-direction: column; align-items: stretch; gap: 0; padding-top: 10px; }
.field-row.stacked label { width: auto; max-width: none; font-size: 0.8125rem; color: var(--label-2); }
.field-row.stacked textarea, .field-row.stacked input { text-align: left; padding: 6px 0 12px; resize: vertical; line-height: 1.45; }
.field-row input::placeholder, .field-row textarea::placeholder { color: var(--label-3); }
.field-row select { appearance: none; -webkit-appearance: none; text-align-last: right; color: var(--label-2); cursor: pointer; }
.field-row .auto-tag, .section-header .auto-tag { flex: none; font-size: 0.6875rem; font-weight: 500; color: var(--label-2); background: var(--fill); padding: 2px 8px; border-radius: var(--pill); letter-spacing: 0; }
.input {
  width: 100%; border: 1px solid var(--sep); border-radius: 12px; background: var(--bg-elev); padding: 15px 16px; font-size: 1.0625rem; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus { border-color: var(--tint); box-shadow: 0 0 0 4px rgba(0, 125, 250, 0.16); }

.search {
  display: flex; align-items: center; gap: 8px; background: var(--bg-elev); border: 1px solid var(--fill-2); border-radius: 12px; padding: 0 12px; height: 44px; margin: 10px 0 14px;
}
.search svg { width: 17px; height: 17px; color: var(--label-2); flex: none; }
.search input { flex: 1; border: 0; background: none; outline: none; font-size: 1.0625rem; min-width: 0; }
.search input::placeholder { color: var(--label-2); }
.search .clear { border: 0; background: var(--label-3); color: var(--bg-elev); width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; padding: 0; }
.search .clear svg { width: 10px; height: 10px; color: var(--bg-elev); }

/* Contrôle segmenté */
.segmented {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--fill); border-radius: 9px; padding: 2px; position: relative;
}
.segmented button {
  position: relative; z-index: 1; border: 0; background: none; padding: 6px 4px; font-size: 0.8125rem; font-weight: 500; border-radius: 7px; min-height: 32px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: background-color 0.3s ease, box-shadow 0.3s ease;
}
.segmented button svg { width: 16px; height: 16px; flex: none; }
.segmented button[aria-pressed='true'] { background: var(--seg-active); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12); font-weight: 600; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 16px 4px; margin: 0 -16px 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--fill-2); border-radius: var(--pill); padding: 7px 15px;
  background: var(--bg-elev); color: var(--label); font-size: 0.875rem; font-weight: 400; box-shadow: none;
}
.chip[aria-pressed='true'] { background: var(--label); color: var(--bg-elev); border-color: var(--label); }
.chip .dot { width: 9px; height: 9px; border-radius: 50%; }
.chip .count { color: var(--label-2); font-variant-numeric: tabular-nums; }
.chip[aria-pressed='true'] .count { color: inherit; opacity: 0.7; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 18px; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--pill); background: var(--fill); font-size: 0.9375rem; }
.tag button { border: 0; background: none; padding: 0; color: var(--label-2); display: grid; place-items: center; }
.tag button svg { width: 14px; height: 14px; }
.tag-input { flex: 1; min-width: 120px; border: 0; background: none; outline: none; padding: 6px 2px; font-size: 0.9375rem; }

.stepper { display: inline-flex; align-items: center; background: var(--fill); border-radius: 9px; }
.stepper button { border: 0; background: none; width: 44px; height: 32px; display: grid; place-items: center; color: var(--label); }
.stepper button:disabled { color: var(--label-3); }
.stepper button svg { width: 16px; height: 16px; }
.stepper .val { min-width: 34px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.stepper .divider { width: 0.5px; height: 18px; background: var(--sep); }

/* ---------------------------------------------------------------- Pastilles statut / couleur */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 0.75rem; font-weight: 500; padding: 3px 9px; border-radius: var(--pill); white-space: nowrap; background: var(--fill) !important; }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-garder { color: var(--blue); background: var(--blue-soft); }
.st-boire { color: var(--green); background: var(--green-soft); }
.st-urgent { color: var(--orange); background: var(--orange-soft); }
.st-passe { color: var(--red); background: var(--red-soft); }
.c-rouge { --wine: var(--wine-rouge); }
.c-blanc { --wine: var(--wine-blanc); }
.c-rose { --wine: var(--wine-rose); }
.c-effervescent { --wine: var(--wine-effervescent); }
.c-liquoreux { --wine: var(--wine-liquoreux); }

/* Vignette bouteille / photo */
.thumb { width: 44px; height: 58px; border-radius: 10px; flex: none; overflow: hidden; background: var(--bg); display: grid; place-items: center; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .bottle-svg { width: 22px; height: 50px; }
.bottle-svg .glass { fill: var(--wine, var(--wine-rouge)); }
.bottle-svg .shine { fill: rgba(255, 255, 255, 0.35); }
.bottle-svg .label { fill: rgba(255, 255, 255, 0.85); }
.count-badge { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--label-2); font-size: 0.9375rem; }

/* ---------------------------------------------------------------- Accueil : tuiles statistiques */
.stats { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 10px; margin: 6px 0 14px; }
.stat {
  background: var(--bg-elev); border-radius: var(--radius); padding: 14px 14px 13px; border: 0; text-align: left; box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; gap: 6px;
}
@media (hover: hover) { .stat:hover, .action-tile:hover, .pairing:hover { box-shadow: var(--shadow-hover); } }
.stat .lbl { font-size: 0.8125rem; color: var(--label-2); font-weight: 500; }
.stat .num { font: 600 1.75rem/1 var(--font-display); letter-spacing: -0.022em; font-variant-numeric: tabular-nums; color: var(--label) !important; }
.stat .num small { font-size: 0.9375rem; color: var(--label-2); font-weight: 600; letter-spacing: 0; }
.stat.capacity { flex-direction: row; align-items: center; gap: 10px; }
.ring { width: 46px; height: 46px; flex: none; }
.ring circle { fill: none; stroke-width: 6; }
.ring .track { stroke: var(--fill-2); }
.ring .bar { stroke: var(--label); stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset 0.8s var(--ease-out); }
.stat .icon { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; }
.stat .icon svg { width: 13px; height: 13px; }

/* ---------------------------------------------------------------- État vide */
.empty { text-align: center; padding: 48px 24px; color: var(--label-2); }
.empty svg.big { width: 64px; height: 64px; color: var(--label-3); margin-bottom: 12px; }
.empty h2 { color: var(--label); font: 600 1.5rem/1.17 var(--font-display); letter-spacing: -0.018em; margin: 0 0 8px; }
.empty p { margin: 0 auto 20px; max-width: 320px; }

/* ---------------------------------------------------------------- Fiche vin */
.hero { display: grid; grid-template-columns: 112px 1fr; gap: 18px; align-items: end; margin: 6px 0 16px; }
.hero-media {
  width: 112px; aspect-ratio: 3 / 4; border-radius: var(--radius); overflow: hidden; background: var(--bg-elev); display: grid; place-items: center;
}
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero-media .bottle-svg { width: 40px; height: 100px; }
.hero h1 { font: 600 2rem/1.1 var(--font-display); letter-spacing: -0.026em; margin: 0 0 4px; overflow-wrap: anywhere; }
.hero .producer { color: var(--label-2); font-size: 1.0625rem; margin: 0 0 12px; }
.hero .meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.meta-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 0.75rem; font-weight: 500; padding: 3px 10px; border-radius: var(--pill); background: var(--bg-elev); color: var(--label-2); }
.color-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.vintage-big { font: 600 1.1875rem/1 var(--font-display); font-variant-numeric: tabular-nums; }

.window-card { background: var(--bg-elev); border-radius: var(--radius); padding: 18px 20px 18px; box-shadow: var(--shadow-card); }
.window-card .headline { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.window-card .headline strong { font-size: 1.0625rem; }
.window-card .explain { color: var(--label-2); font-size: 0.875rem; margin: 0 0 14px; }
.timeline { position: relative; height: 34px; }
.timeline .track { position: absolute; left: 0; right: 0; top: 10px; height: 8px; border-radius: 4px; background: var(--fill-2); }
.timeline .win { position: absolute; top: 10px; height: 8px; border-radius: 4px; background: color-mix(in srgb, var(--green) 55%, transparent); }
.timeline .peak { position: absolute; top: 10px; height: 8px; border-radius: 4px; background: var(--green); }
.timeline .now { position: absolute; top: 4px; width: 3px; height: 20px; border-radius: 2px; background: var(--label); transform: translateX(-50%); box-shadow: 0 0 0 2px var(--bg-elev); }
.timeline .ticks { position: absolute; left: 0; right: 0; top: 22px; display: flex; justify-content: space-between; font-size: 0.6875rem; color: var(--label-2); font-variant-numeric: tabular-nums; }
.timeline-legend { display: flex; gap: 14px; font-size: 0.75rem; color: var(--label-2); margin-top: 6px; }
.timeline-legend span { display: inline-flex; align-items: center; gap: 5px; }
.timeline-legend i { width: 10px; height: 6px; border-radius: 3px; display: inline-block; }

.prose { background: var(--bg-elev); border-radius: var(--radius); padding: 18px 20px; line-height: 1.5; font-size: 1rem; box-shadow: var(--shadow-card); white-space: pre-line; }
.prose .src { display: block; margin-top: 8px; color: var(--label-2); font-size: 0.8125rem; }
.pairings { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.pairing { display: flex; align-items: center; gap: 10px; background: var(--bg-elev); border-radius: 14px; padding: 13px 14px; font-size: 0.9375rem; box-shadow: var(--shadow-card); transition: box-shadow 0.3s; }
.pairing svg { width: 18px; height: 18px; color: var(--label-2); flex: none; }

.stars { display: inline-flex; gap: 2px; color: var(--label); }
.stars svg { width: 14px; height: 14px; }
.stars.big { gap: 10px; }
.stars.big button { border: 0; background: none; padding: 4px; color: var(--label-3); transition: transform 0.15s var(--ease-out); }
.stars.big button svg { width: 34px; height: 34px; }
.stars.big button.on { color: var(--label); }
.stars.big button:active { transform: scale(0.85); }

/* ---------------------------------------------------------------- Cave 2D */
.cabinet-wrap { container-type: inline-size; display: flex; justify-content: center; }
.cabinet {
  --gap: 6px;
  --slot: min(48px, calc((100cqw - 56px) / var(--maxn) - var(--gap)));
  width: max-content; max-width: 100%;
  background: linear-gradient(180deg, #2a2a2e, var(--cab-body) 30%);
  border-radius: 24px; padding: 12px 12px 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  color: #f2f2f7;
}
.cabinet-top { display: flex; align-items: center; justify-content: space-between; padding: 2px 8px 10px; font-size: 0.6875rem; color: rgba(235, 235, 245, 0.6); letter-spacing: 0.06em; text-transform: uppercase; }
.cabinet-top .display { font-variant-numeric: tabular-nums; color: #f5f5f7; letter-spacing: 0.02em; }
.cabinet-glass {
  position: relative; border-radius: 14px; padding: 6px 10px 4px; background: var(--cab-glass);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.07), inset 0 20px 40px rgba(120, 170, 255, 0.04);
  overflow: hidden;
}
.cabinet-glass::after { /* reflet de la vitre */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0) 32%, rgba(255, 255, 255, 0) 70%, rgba(255, 255, 255, 0.04) 100%);
}
.shelf { padding: 8px 0 0; }
.shelf-label { display: flex; justify-content: space-between; font-size: 0.6875rem; color: rgba(235, 235, 245, 0.55); padding: 0 2px 5px; letter-spacing: 0.02em; }
.rack { display: flex; justify-content: center; gap: var(--gap); padding: 0 0 7px; }
.rail { height: 5px; border-radius: 3px; background: linear-gradient(180deg, #8a6340, var(--cab-rail)); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.6); }
.slot {
  position: relative; width: var(--slot); height: var(--slot); border-radius: 50%; border: 0; padding: 0;
  background: transparent; color: #fff; display: grid; place-items: center; touch-action: manipulation;
  transition: transform 0.5s var(--spring), opacity 0.3s;
}
.slot:active { transform: scale(0.9); transition-duration: 0.08s; }
.slot.empty { box-shadow: inset 0 0 0 1.5px rgba(235, 235, 245, 0.16); }
.slot.empty .plus { opacity: 0; width: 40%; height: 40%; color: rgba(235, 235, 245, 0.7); transition: opacity 0.2s; }
.slot .bottle-end {
  position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, var(--punt, rgba(0, 0, 0, 0.32)) 0 30%, transparent 31%),
    radial-gradient(circle at 36% 30%, rgba(255, 255, 255, 0.45), transparent 42%),
    radial-gradient(circle at 50% 50%, var(--wine) 58%, color-mix(in srgb, var(--wine) 60%, #000) 100%);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.slot .yr { position: relative; font-size: max(9px, calc(var(--slot) * 0.24)); font-weight: 700; letter-spacing: -0.01em; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8); font-variant-numeric: tabular-nums; }
.slot.c-blanc, .slot.c-effervescent, .slot.c-rose { --punt: rgba(255, 255, 255, 0.28); }
.slot.c-blanc .yr, .slot.c-effervescent .yr, .slot.c-rose .yr { color: #2b1d08; text-shadow: 0 0 3px rgba(255, 255, 255, 0.7); }
.slot .sdot { position: absolute; top: 1px; right: 1px; width: 26%; height: 26%; max-width: 12px; max-height: 12px; border-radius: 50%; box-shadow: 0 0 0 2px #151518; }
.sdot.garder { background: #0a84ff; } .sdot.boire { background: #30d158; } .sdot.urgent { background: #ff9f0a; } .sdot.passe { background: #ff453a; }
.cabinet.picking .slot.empty .plus { opacity: 1; }
.cabinet.picking .slot.occupied { opacity: 0.35; }
.cabinet.picking.allow-occupied .slot.occupied { opacity: 0.85; }
.slot.selected { box-shadow: 0 0 0 2.5px #2997ff; }
.slot.selected .plus { display: none; }
.slot .order { position: relative; font-weight: 600; font-size: calc(var(--slot) * 0.36); color: #2997ff; }
.slot.selected.empty { background: rgba(41, 151, 255, 0.18); }
.slot.source { box-shadow: 0 0 0 2.5px #fff; }
.cabinet.highlighting .slot.occupied:not(.hl) { opacity: 0.22; }
.slot.hl::after {
  content: ''; position: absolute; inset: -5px; border-radius: 50%; border: 2.5px solid #fff;
  animation: pulse 1.6s var(--ease-out) infinite;
}
@keyframes pulse { 0% { transform: scale(0.85); opacity: 1; } 100% { transform: scale(1.35); opacity: 0; } }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 14px; font-size: 0.75rem; color: var(--label-2); margin: 14px 0 0; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* ---------------------------------------------------------------- Ajout : capture */
.capture-card {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center;
  width: 100%; min-height: 260px; border-radius: var(--radius-lg); border: 0; padding: 32px 24px; overflow: hidden;
  background: var(--bg-elev); color: var(--label); box-shadow: var(--shadow-card);
  cursor: pointer;
}
@media (hover: hover) { .capture-card:hover { box-shadow: var(--shadow-hover); } }
.capture-card .cam { width: 72px; height: 72px; border-radius: 50%; background: var(--tint); color: #fff; display: grid; place-items: center; margin-bottom: 6px; }
.capture-card .cam svg { width: 34px; height: 34px; }
.capture-card strong { font: 600 1.75rem/1.14 var(--font-display); letter-spacing: -0.02em; }
.capture-card span { color: var(--label-2); font-size: 1.0625rem; max-width: 320px; }
.capture-card input, .file-overlay { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 1; font-size: 0; }

.scan-stage { position: relative; border-radius: var(--radius-lg); overflow: hidden; background: var(--bg-elev); aspect-ratio: 3 / 4; max-height: 56vh; margin: 8px auto 22px; width: min(100%, 420px); }
.scan-stage img { width: 100%; height: 100%; object-fit: cover; }
.scan-stage .beam { display: none; }
.scan-status { text-align: center; }
.scan-status strong { display: block; font-size: 1.0625rem; margin-bottom: 4px; }
.scan-status span { color: var(--label-2); font-size: 0.9375rem; }
.progress { height: 4px; border-radius: 2px; background: var(--fill-2); overflow: hidden; width: min(100%, 280px); margin: 14px auto 0; }
.progress i { display: block; height: 100%; width: 0; background: var(--label); border-radius: 2px; transition: width 0.3s var(--ease-out); }

.banner { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: var(--radius); background: var(--bg-elev); box-shadow: var(--shadow-card); margin: 8px 0 18px; font-size: 0.9375rem; }
.banner svg { width: 22px; height: 22px; flex: none; color: var(--label); margin-top: 1px; }
.banner strong { display: block; }
.banner span { color: var(--label-2); }
.banner.warn svg { color: var(--orange); }
.banner.tinted { background: var(--bg-elev); }
.banner.tinted svg { color: var(--green); }
.photo-mini { width: 54px; height: 72px; border-radius: 10px; object-fit: cover; flex: none; }

.candidate { display: flex; gap: 12px; align-items: center; }
.candidate img { width: 40px; height: 52px; object-fit: cover; border-radius: 6px; background: var(--fill); }

/* ---------------------------------------------------------------- Feuilles (sheets) */
.scrim { position: fixed; inset: 0; z-index: 90; background: var(--scrim); opacity: 0; transition: opacity 0.3s; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.scrim.show { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 100;
  max-height: calc(100dvh - var(--safe-t) - 12px);
  display: flex; flex-direction: column;
  background: var(--bg); border-radius: 28px 28px 0 0; box-shadow: var(--shadow-sheet), inset 0 0.5px 0 var(--material-edge);
  transform: translateY(100%); will-change: transform;
  padding-bottom: var(--safe-b);
}
.sheet.elevated { background: var(--bg-elev); }
.sheet .grabber-zone { padding: 6px 0 2px; touch-action: none; cursor: grab; flex: none; }
.sheet .grabber { width: 36px; height: 5px; border-radius: 3px; background: var(--label-3); margin: 0 auto; }
.sheet-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 44px; padding: 0 8px; touch-action: none; flex: none; }
.sheet-head h2 { margin: 0; font-size: 1.0625rem; font-weight: 600; text-align: center; letter-spacing: -0.016em; }
.sheet-head .right { justify-self: end; }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; padding: 4px 16px 20px; -webkit-overflow-scrolling: touch; }
.sheet .close-x { width: 30px; height: 30px; border-radius: 50%; background: var(--fill); border: 0; display: grid; place-items: center; color: var(--label-2); }
.sheet .close-x svg { width: 12px; height: 12px; }

@media (min-width: 768px) {
  .sheet {
    left: 50%; right: auto; bottom: auto; top: 50%; width: min(560px, calc(100vw - 48px));
    max-height: min(86vh, 860px); border-radius: 28px; transform: translate(-50%, -50%) scale(0.96); opacity: 0;
    padding-bottom: 0;
  }
  .sheet.wide { width: min(760px, calc(100vw - 48px)); }
  .sheet .grabber-zone { display: none; }
  .sheet-head { padding-top: 6px; }
}

/* Feuille d'actions */
.action-group { background: var(--bg-elev); border-radius: var(--radius); overflow: hidden; margin-bottom: 8px; }
.action-group .msg { padding: 14px 16px; text-align: center; color: var(--label-2); font-size: 0.8125rem; position: relative; }
.action-group button {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 57px; border: 0; background: none;
  color: var(--link); font-size: 1.1875rem;
}
.action-group button svg { width: 22px; height: 22px; }
.action-group > * + *::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 0.5px; background: var(--sep); }
.action-group button:active { background: var(--fill); }
.action-group button.destructive { color: var(--red); }
.action-group button.bold { font-weight: 600; }

/* ---------------------------------------------------------------- Toast */
.toast-host { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + var(--safe-b) + 12px); z-index: 200; display: flex; justify-content: center; pointer-events: none; padding: 0 16px; }
@media (min-width: 900px) { .toast-host { bottom: 24px; } }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 12px 16px 12px 18px; border-radius: var(--pill); max-width: 480px;
  background: var(--toast-bg); color: #f5f5f7; font-size: 0.9375rem; font-weight: 400;
  -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  animation: toast-in 0.55s var(--spring) both;
}
.toast.out { animation: toast-out 0.25s var(--ease-in) both; }
.toast svg { width: 20px; height: 20px; color: #f5f5f7; flex: none; }
.toast.error svg { color: #ff453a; }
.toast button { border: 0; background: none; color: #2997ff; font-weight: 400; padding: 6px 4px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(0.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px) scale(0.98); } }

/* ---------------------------------------------------------------- Connexion */
.login {
  min-height: 100dvh; display: grid; place-items: center; padding: 24px;
  background: var(--bg-elev);
}
.login-card { width: min(100%, 400px); text-align: center; }
.login-card .app-icon { width: 84px; height: 84px; margin: 0 auto 22px; color: var(--label); }
.login-card .app-icon svg { width: 100%; height: 100%; }
.login-card h1 { font: 600 2.5rem/1.08 var(--font-display); letter-spacing: -0.03em; margin: 0 0 8px; }
.login-card p { color: var(--label-2); font-size: 1.1875rem; margin: 0 0 32px; }
.login-card form { display: grid; gap: 12px; }
.login-card .error { color: var(--red); font-size: 0.9375rem; min-height: 1.4em; }
.shake { animation: shake 0.42s cubic-bezier(0.36, 0.07, 0.19, 0.97); }
@keyframes shake { 15%, 85% { transform: translateX(-2px); } 30%, 70% { transform: translateX(5px); } 45%, 55% { transform: translateX(-7px); } }

.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--fill-2); border-top-color: var(--label-2); animation: spin 0.8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: grid; place-items: center; padding: 80px 0; }

.muted { color: var(--label-2); }
.small { font-size: 0.8125rem; }
.center { text-align: center; }
.mt-0 { margin-top: 0; }

/* ---------------------------------------------------------------- Accessibilité */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.12s !important; transition-timing-function: ease !important; }
  .view-push, .view-pop, .view-enter { animation: view-fade-only 0.2s ease both !important; }
  .toast { animation: view-fade-only 0.2s ease both !important; }
  .slot.hl::after { animation: none !important; opacity: 1; transform: none; }
}
@keyframes view-fade-only { from { opacity: 0; } }
@media (prefers-reduced-transparency: reduce) {
  .navbar.scrolled, .navbar.solid, .tabbar, .sidebar { background: var(--bg-elev); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .navbar::after, .scrim { -webkit-backdrop-filter: none; backdrop-filter: none; }
  .toast { background: #28282a; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
/* ---------------------------------------------------------------- Saisie assistée */
.suggest { position: relative; background: var(--bg-elev-2); border-top: 1px solid var(--fill-2); animation: suggest-in 0.18s var(--ease-out) both; }
.suggest-item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; border: 0; background: none; text-align: left;
  padding: 10px 18px 10px 30px; min-height: 48px; justify-content: center; color: var(--label); cursor: pointer; position: relative;
}
.suggest-item + .suggest-item::before { content: ''; position: absolute; top: 0; left: 30px; right: 0; height: 1px; background: var(--fill-2); }
.suggest-item.is-active, .suggest-item:active { background: var(--fill); }
@media (hover: hover) { .suggest-item:hover { background: var(--fill); } }
.suggest-title { font-size: 1rem; letter-spacing: -0.016em; color: var(--label-2); }
.suggest-title b { color: var(--label); font-weight: 600; }
.suggest-sub { display: flex; gap: 8px; align-items: baseline; font-size: 0.8125rem; color: var(--label-2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest-sub em { font-style: normal; font-size: 0.6875rem; color: var(--label-3); flex: none; }
@keyframes suggest-in { from { opacity: 0; transform: translateY(-4px); } }

@media (prefers-contrast: more) {
  :root:not([data-theme='dark']) { --sep: rgba(60, 60, 67, 0.6); --label-2: rgba(60, 60, 67, 0.85); }
  .list, .stat, .chip, .prose, .pairing, .window-card, .vintage-card { box-shadow: 0 0 0 1px var(--sep); }
  .navbar.scrolled, .navbar.solid, .tabbar { background: var(--bg-elev); -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: 0 0 0 1px var(--sep); }
}

/* Notation du millésime */
.vintage-card { background: var(--bg-elev); border-radius: var(--radius); padding: 20px 20px 16px; box-shadow: var(--shadow-card); }
.vintage-score { display: flex; align-items: baseline; gap: 2px; flex-wrap: wrap; }
.vintage-score .num { font-size: 3rem; font-weight: 600; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.vintage-score .of { font-size: 1.0625rem; color: var(--label-2); margin-right: 14px; }
.vintage-score .verdict { display: flex; flex-direction: column; align-self: center; min-width: 0; }
.vintage-score .verdict strong { font-size: 1.1875rem; font-weight: 600; letter-spacing: -0.01em; }
.vintage-score .verdict span { color: var(--label-2); font-size: 0.8125rem; }
.vintage-summary { margin: 14px 0 0; line-height: 1.5; font-size: 0.9688rem; }
.vintage-summary.muted { font-size: 0.875rem; }
.vintage-facts { list-style: none; margin: 14px 0 0; padding: 12px 0 0; border-top: 1px solid var(--sep); display: grid; gap: 9px; }
.vintage-facts li { display: flex; gap: 10px; align-items: flex-start; font-size: 0.875rem; line-height: 1.42; }
.vintage-facts i { flex: none; width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; background: var(--label-3); }
.vintage-facts .tone-good i { background: var(--green); }
.vintage-facts .tone-bad i { background: var(--orange); }
.vintage-aging { margin: 12px 0 0; font-size: 0.8125rem; color: var(--label-2); }
.link-btn { appearance: none; background: none; border: 0; padding: 0; font: inherit; color: var(--link); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.spinner.small { width: 16px; height: 16px; border-width: 2px; flex: none; }

/* Cote */
.trend.tone-good { color: var(--green); }
.trend.tone-bad { color: var(--orange); }
.offers { list-style: none; margin: 12px 0 0; padding: 10px 0 0; border-top: 1px solid var(--sep); display: grid; gap: 8px; }
.offers li { display: flex; align-items: baseline; gap: 8px; font-size: 0.875rem; min-width: 0; }
.offers a { color: var(--link); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.offers a:hover { text-decoration: underline; }
.offers .muted { font-size: 0.75rem; flex: none; }
.offers .value { margin-left: auto; font-variant-numeric: tabular-nums; flex: none; }

/* Comptes */
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--fill-2); color: var(--label); font: 600 0.8125rem/1 var(--font); letter-spacing: 0.02em;
}
.account-row .avatar { width: 52px; height: 52px; font-size: 1.125rem; }
.account-row { padding-top: 14px; padding-bottom: 14px; }
.account-row .title { font-size: 1.1875rem; font-weight: 600; letter-spacing: -0.02em; }
.login-card input[hidden] { display: none; }

/* Retour immédiat à l'appui (dès le contact, 80 ms), relâchement en ressort amorti : jamais d'attente du « click ». */
.btn, .action-tile, .stat, .chip, .capture-card, .nav-btn, .stepper button, .pairing {
  transition-property: transform, background-color, opacity, box-shadow, color;
  transition-duration: 0.5s, 0.3s, 0.2s, 0.3s, 0.2s;
  transition-timing-function: var(--spring), ease, ease, ease, ease;
}
.btn:active, .action-tile:active, .stat:active, .chip:active, .capture-card:active, .stepper button:active, .pairing:active {
  transform: scale(0.97); transition-duration: 0.08s;
  transition-timing-function: ease-out;
}
.capture-card:active { transform: scale(0.985); }
.btn:disabled:active { transform: none; }

/* Pictogrammes en tête de ligne (« Ajouter… ») : taille fixe, jamais étirés */
.row > svg:not(.chev) { width: 22px; height: 22px; flex: none; }
.row.tint > svg { width: 20px; height: 20px; }


/* ---------------------------------------------------------------- Connexion, inscription, récupération */
.login { align-content: center; }
.login-card { padding: 8px 0 24px; }
.login-card h1 { margin-bottom: 6px; }
.login-card p { margin-bottom: 26px; font-size: 1.0625rem; line-height: 1.42; }
.login-card form { text-align: left; }
.login-card .btn { margin-top: 4px; }
.auth-links { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 22px; font-size: 0.9375rem; color: var(--label-2); }
.auth-links .link-btn { font-size: 0.9375rem; }
.notice { background: var(--tint-soft); color: var(--label); border-radius: 12px; padding: 12px 14px; margin: 0 0 16px; font-size: 0.9375rem; text-align: left; }
.mono-input { font-family: var(--font-mono); letter-spacing: 0.02em; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.9375rem; text-align: left; padding: 4px 2px 8px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--tint); flex: none; }

/* Force du mot de passe */
.strength { margin: -4px 2px 2px; text-align: left; }
.strength .bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.strength .bar i { height: 4px; border-radius: 2px; background: var(--fill-2); transition: background-color 0.3s ease; }
.strength[data-score='1'] .bar i:nth-child(-n+1) { background: var(--red); }
.strength[data-score='2'] .bar i:nth-child(-n+2) { background: var(--orange); }
.strength[data-score='3'] .bar i:nth-child(-n+3) { background: #c9a200; }
.strength[data-score='4'] .bar i { background: var(--green); }
.strength .txt { font-size: 0.8125rem; color: var(--label-2); margin-top: 6px; min-height: 1.2em; }

/* Codes (récupération, invitation) */
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 4px 0 0; }
.codes code { font-family: var(--font-mono); font-size: 1rem; letter-spacing: 0.04em; text-align: center; padding: 12px 8px; border-radius: 12px; background: var(--fill); user-select: all; }
.codes.one { grid-template-columns: 1fr; margin-top: 14px; }
.codes.one code { font-size: 1.5rem; padding: 18px; }

/* Pastille de cave sur « Ma cave » */
.cave-chip {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%; margin: 0 0 14px; padding: 7px 8px 7px 12px; border: 0; border-radius: var(--pill);
  background: var(--bg-elev); color: var(--label); font-size: 0.9375rem; font-weight: 500;
  transition: transform 0.5s var(--spring), background-color 0.3s ease;
}
.cave-chip:active { transform: scale(0.97); transition-duration: 0.08s; }
.cave-chip svg { width: 18px; height: 18px; color: var(--label-2); flex: none; }
.cave-chip svg.chev { width: 8px; height: 14px; color: var(--label-3); margin-right: 4px; }
.cave-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cave-chip .badge { background: var(--tint); color: var(--on-tint); font-size: 0.75rem; font-weight: 600; min-width: 20px; height: 20px; border-radius: 10px; display: grid; place-items: center; padding: 0 6px; }

/* Droits : lecteur = lecture seule ; éditeur = pas de plan ni de sauvegarde (le serveur refuse de toute façon) */
html[data-role='viewer'] .tab.add,
html[data-role='viewer'] a[href='#/ajouter'],
html[data-role='viewer'] a[href$='/modifier'],
html[data-role='viewer'] .action-tiles { display: none !important; }
html:not([data-role='owner']) [data-owner] { display: none !important; }
