/* Habillage Anneau (docs/design-anneau.md) : chargé en dernier, surcharge layout.css et components.css. */

:root {
  --ring-track: rgba(120, 120, 128, 0.16);
  --sheetbg: var(--card);
  --bar2: color-mix(in srgb, var(--bg) 88%, transparent);
  --sidebar-w: 232px;
}
:root[data-theme="dark"] {
  --ring-track: rgba(120, 120, 128, 0.28);
}

body { font-size: 14.5px; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
body::before { display: none; }
b, strong { font-weight: 600; }
::selection { background: var(--tint-bg); }

/* ---------- Boutons ---------- */
.btn { border-radius: 999px; font-weight: 600; }
.btn-primary, .nav-btn-primary, .tab.active, .period-btn.active {
  background: var(--tint);
  color: #fff;
  border-color: transparent;
  box-shadow: none;
}
.btn-secondary {
  background: var(--tint-bg);
  color: var(--tint);
  border: none;
}
.btn-secondary:hover { background: color-mix(in srgb, var(--tint) 22%, transparent); }
.btn-danger { background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); border: none; }
.input, .form-group input, .form-group select, .form-group textarea, select.input {
  background: var(--fill);
  border: none;
  border-radius: 10px;
  color: var(--label);
}
.input:focus, .form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--tint);
}

/* ---------- Segmentés ---------- */
.tabs, .period-selector, .export-range-tabs {
  background: var(--fill);
  border-radius: 9px;
  padding: 2px;
  gap: 0;
  border: none;
}
.tab, .period-btn {
  border-radius: 7px;
  color: var(--label);
  font-weight: 500;
  background: transparent;
}
.tab.active, .period-btn.active {
  background: var(--seg-on);
  color: var(--label);
  box-shadow: 0 1px 4px var(--shadow-color);
}

/* ---------- Connexion et inscription ---------- */
#login-screen { background: var(--bg); gap: 24px; padding: 24px 20px; overflow-y: auto; }
.login-logo { width: 84px; height: 84px; border-radius: 20px; }
.login-brand h1 {
  background: none;
  -webkit-text-fill-color: var(--label);
  color: var(--label);
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -1.2px;
}
.login-subtitle { color: var(--label2); letter-spacing: 0; font-size: 0.95rem; }
#login-form, #signup-form , #forgot-form , #reset-form {
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 340px;
}
#login-form input, #signup-form input, #forgot-form input, #reset-form input {
  flex: none;
  width: 100%;
  min-height: 46px;
  background: var(--card);
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  color: var(--label);
  font-size: 1rem;
}
#login-form input:focus, #signup-form input:focus, #forgot-form input:focus, #reset-form input:focus { box-shadow: 0 0 0 2px var(--tint); }
#login-form .btn-primary, #signup-form .btn-primary, #forgot-form .btn-primary, #reset-form .btn-primary {
  width: 100%;
  min-height: 46px;
  justify-content: center;
  background: var(--tint);
  color: #fff;
  font-size: 1rem;
}
.google-login {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 340px;
  min-height: 46px;
  background: #fff;
  border: 1px solid #747775;
  border-radius: 999px;
  color: #1F1F1F;
  font-weight: 500;
}
.google-login svg { width: 18px; height: 18px; flex: none; }
.google-login:hover { background: #F8F9FA; }
:root[data-theme="dark"] .google-login { background: #131314; border-color: #8E918F; color: #E3E3E3; }
:root[data-theme="dark"] .google-login:hover { background: #1F1F20; }
.login-link { color: var(--tint); font-weight: 500; min-height: 44px; padding: 0 12px; }
.login-legal { color: var(--label2); }
#login-error { color: var(--red); text-align: center; }

/* ---------- Coque : barre latérale (bureau) et barre d'onglets (téléphone) ---------- */
#dashboard { background: var(--bg); }
.navbar {
  background: var(--bar);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 0.5px solid var(--sep);
  padding: 0 24px;
}
.navbar-brand h1 { color: var(--label); font-weight: 800; }
.date-nav { background: var(--fill); border: none; border-radius: 9px; padding: 2px; }
.date-nav button { color: var(--label); border-radius: 7px; }
.date-nav button:hover { background: var(--seg-on); }
.date-nav .date-label { color: var(--label); font-weight: 600; }
.nav-btn { border-radius: 999px; border: none; font-weight: 600; }
.nav-btn-primary { background: var(--tint); color: #fff; }
.nav-btn-primary:hover { background: var(--tint); color: #fff; opacity: .9; }
.nav-btn-logout, .nav-btn-round { background: var(--fill); color: var(--label); border: none; }

.nav-tab { color: var(--label2); font-weight: 500; border-radius: 8px; }
.nav-tab:hover { background: var(--fill); color: var(--label); }
.nav-tab.active { color: var(--tint); background: var(--tint-bg); }
.tab-dot::after, .me-row-dot::after { background: var(--tint); }

/* Marque de la barre latérale, visible seulement au bureau */
.tab-brand { display: none; }

@media (min-width: 769px) {
  #dashboard.active {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    grid-template-rows: auto 1fr;
  }
  .tabbar {
    grid-column: 1;
    grid-row: 1 / 3;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 2px;
    padding: 16px 12px;
    background: var(--bar);
    border-bottom: none;
    border-right: 0.5px solid var(--sep);
  }
  .tab-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 4px 8px 16px;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.4px;
    color: var(--label);
    text-align: left;
    cursor: pointer;
  }
  .tab-brand::before {
    content: '';
    flex: none;
    width: 30px;
    height: 30px;
    border-radius: 22%;
    background: url('/icons/icon-192.png') center / cover no-repeat;
  }
  .tab-brand-word { line-height: 1; }
  .tab-brand:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; border-radius: 8px; }
  .nav-tab { padding: 8px 10px; font-size: 14.5px; min-height: 38px; }
  .nav-tab svg { width: 18px; height: 18px; }
  .navbar { grid-column: 2; grid-row: 1; height: 54px; }
  .navbar-brand { display: none; }
  .main-content { grid-column: 2; grid-row: 2; padding: 20px 24px; }
  .tab-dot::after { top: 12px; right: 12px; }
}

@media (max-width: 768px) {
  :root { --tabbar-h: 92px; }
  .navbar { padding: 0 12px; }
  .tabbar {
    background: var(--bar2);
    -webkit-backdrop-filter: blur(22px);
    backdrop-filter: blur(22px);
    border-top: 0.5px solid var(--sep);
    height: var(--tabbar-h);
    align-items: flex-start;
    padding: 7px 4px calc(env(safe-area-inset-bottom));
  }
  .nav-tab { background: transparent; border-radius: 0; color: var(--label2); min-height: 0; gap: 2px; font-size: 10px; font-weight: 500; }
  .nav-tab.active { color: var(--tint); background: transparent; }
  .nav-tab svg { width: 26px; height: 26px; }
  .tab-add {
    flex: 0 0 60px;
    width: 60px;
    height: 60px;
    margin-top: -18px;
    border-radius: 50%;
    background: linear-gradient(135deg, color-mix(in srgb, var(--tint) 72%, #fff), var(--tint));
    color: #fff;
    box-shadow: 0 8px 20px color-mix(in srgb, var(--tint) 45%, transparent);
  }
  .tab-add:hover, .tab-add.active { background: linear-gradient(135deg, color-mix(in srgb, var(--tint) 72%, #fff), var(--tint)); color: #fff; }
  .tab-add svg { width: 26px; height: 26px; }
  .main-content { padding: 14px 16px calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px); }
}

/* ---------- Journal : jauge de poids, anneaux ---------- */
.deficit-display {
  background: var(--fill);
  border: none;
  border-radius: 10px;
  padding: 4px 10px;
}
.deficit-bar-wrap, .deficit-text { display: none; }
.deficit-weight { border: none; margin: 0; padding: 0; }
.deficit-weight input { color: var(--indigo); font-weight: 800; }
.deficit-weight .unit { color: var(--label2); }

.summary-row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}
.summary-row .summary-card {
  background: var(--card);
  border: none;
  border-radius: 20px;
  padding: 16px 18px;
  box-shadow: none;
  backdrop-filter: none;
}
.summary-row .summary-card::before { display: none; }
.summary-row .summary-card:hover { border: none; }

.ring { position: relative; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); display: block; }
.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
}
.ring-big { --rs: 176px; width: var(--rs); height: var(--rs); }
.ring-mini { --rs: 76px; width: var(--rs); height: var(--rs); }
:root[data-theme="dark"] #kcal-ring svg { filter: drop-shadow(0 0 7px color-mix(in srgb, var(--tint) 45%, transparent)); }
@media (prefers-reduced-motion: no-preference) {
  .ring svg circle { transition: stroke-dasharray 0.6s ease-out; }
}

.card-kcal { display: flex; align-items: center; gap: 26px; }
.card-kcal .card-value { font-family: inherit; font-size: 32px; font-weight: 800; letter-spacing: -1px; color: var(--label); display: flex; flex-direction: column; align-items: center; }
.card-kcal .card-unit { font-size: 12px; font-weight: 400; color: var(--label2); margin: 0; }
.ring-text { min-width: 0; }
.summary-row .card-label {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--label2);
  margin: 0;
}
.ring-status { font-size: 20px; margin-top: 2px; color: var(--label); }
.ring-status .deficit-remaining { font-size: 20px; font-weight: 800; letter-spacing: -0.5px; color: var(--tint); font-family: inherit; }
.ring-status .deficit-remaining.over { color: var(--red); }
.ring-sub { font-size: 13.5px; color: var(--label3); margin-top: 4px; line-height: 1.4; }
.ring-sub .deficit-legend-cursor { display: none; }

.card-macros { display: flex; align-items: center; }
.card-macros .macros-row { display: flex; justify-content: space-around; width: 100%; gap: 8px; }
.card-macros .macro-item { display: flex; flex-direction: column; align-items: center; text-align: center; flex: none; }
.card-macros .macro-item .card-label { margin-top: 8px; text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 12.5px; }
.card-macros .macro-value { font-family: inherit; font-size: 17px; font-weight: 700; letter-spacing: -0.3px; color: var(--label); flex-direction: row; align-items: baseline; justify-content: center; }
.card-macros .macro-unit { font-size: 10.5px; color: var(--label2); margin-left: 1px; font-weight: 400; }

/* ---------- Liste des consommations ---------- */
.consumption-panel {
  background: var(--card);
  border: none;
  border-radius: 20px;
  box-shadow: none;
  backdrop-filter: none;
}
.panel-header { border-bottom: none; padding: 16px 18px 6px; }
.panel-header h2 { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; }
.panel-header h2 > svg { display: none; }
.panel-header .entry-count { background: var(--fill); color: var(--label2); font-weight: 600; }
#btn-select, #btn-select-all { background: transparent; color: var(--tint); font-weight: 500; padding: 4px 10px; border-radius: 999px; }
#btn-select.active { background: var(--tint-bg); }
.entry-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 10px 18px;
  border-bottom: none;
  position: relative;
}
.entry-item + .entry-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 54px;
  right: 0;
  height: 0.5px;
  background: var(--sep);
}
.entry-item:hover { background: transparent; }
.entry-item.entry-selected, .entry-item.entry-selected:hover { background: var(--tint-soft); }
.entry-lead { display: flex; align-items: center; flex: none; }
.entry-checkbox {
  width: 24px;
  height: 24px;
  border: 1.8px solid var(--chev);
  border-radius: 50%;
  margin: 0;
  background: transparent;
}
.entry-checkbox:checked { background: var(--green); border-color: var(--green); }
.entry-checkbox:checked::after { left: 7px; top: 3px; width: 6px; height: 11px; }
.entry-checkbox:indeterminate { background: var(--chev); border-color: var(--chev); }
.entry-checkbox:indeterminate::after { left: 5px; top: 9px; width: 10px; }
.entry-checkbox-all { margin: 0 4px 0 0; width: 22px; height: 22px; }
.entry-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.entry-name { font-size: 15.5px; font-weight: 500; color: var(--label); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entry-qty-inline { font-size: 12.5px; color: var(--label2); font-family: inherit; }
.entry-macros { display: flex; flex-wrap: wrap; gap: 0 10px; font-size: 12px; margin-top: 1px; }
.entry-macros span { min-width: 0 !important; }
.entry-macros .macro-p { color: var(--blue); }
.entry-macros .macro-l { color: var(--orange); }
.entry-macros .macro-g { color: var(--green); }
/* Texte de 12 px : en clair, orange et vert s'assombrissent un peu pour rester lisibles, sans changer de teinte */
:root:not([data-theme="dark"]) .entry-macros .macro-l { color: color-mix(in srgb, var(--orange) 78%, #000); }
:root:not([data-theme="dark"]) .entry-macros .macro-g { color: color-mix(in srgb, var(--green) 72%, #000); }
:root:not([data-theme="dark"]) .entry-macros .macro-p { color: color-mix(in srgb, var(--blue) 90%, #000); }
.entry-macros span { font-weight: 500; }
.entry-kcal { font-family: inherit; font-weight: 600; font-size: 15px; color: var(--label); white-space: nowrap; }
.entry-edit, .entry-delete { color: var(--label2); opacity: 1; min-width: 32px; min-height: 32px; border-radius: 8px; }
.entry-edit:hover { color: var(--tint); background: var(--tint-bg); }
.entry-delete:hover { color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); }
.empty-state { color: var(--label2); }

@media (max-width: 768px) {
  .summary-row { grid-template-columns: 1fr; gap: 12px; margin-bottom: 12px; }
  .ring-big { --rs: 116px; }
  .ring-mini { --rs: 54px; }
  .card-kcal { gap: 18px; }
  .card-kcal .card-value { font-size: 25px; }
  .ring-status, .ring-status .deficit-remaining { font-size: 17px; }
  .ring-sub { font-size: 12.5px; }
  .card-macros .macro-value { font-size: 13px; }
  .card-macros .macro-unit { display: none; }
  .entry-macros { display: none; }
  .entry-item { padding: 9px 14px; }
  .entry-item + .entry-item::before { left: 50px; }
  .entry-edit, .entry-delete { min-width: 28px; }
}

.card-macros .macro-value { align-items: center; }
.entry-info { flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: 10px; }
.entry-name { flex: 0 0 100%; }
.entry-macros { margin-top: 0; }

.navbar { flex-wrap: nowrap; }
.navbar-center { flex: 0 0 auto; margin-left: auto; }
.navbar-left { flex: 0 0 auto; }
@media (max-width: 768px) {
  .navbar { height: 52px; }
  .navbar-brand { display: none; }
  .navbar-center { margin-left: auto; }
  .navbar-actions { margin-left: 0; }
}

/* ---------- Feuilles (modales) ---------- */
:root { --sheetbg: #F2F2F7; --group: #FFFFFF; }
:root[data-theme="dark"] { --sheetbg: #1C1C1E; --group: #2C2C2E; }

.modal-overlay { backdrop-filter: none; -webkit-backdrop-filter: none; padding-top: 36px; }
.modal {
  background: var(--sheetbg);
  border: none;
  border-radius: 16px;
  box-shadow: 0 30px 80px var(--veil);
}
.modal-header { border-bottom: none; padding: 14px 18px 6px; position: relative; }
.modal-header h2 { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; color: var(--label); }
.modal-close { background: var(--fill); color: var(--label2); width: 30px; height: 30px; font-size: 1rem; }
.modal-close:hover { background: var(--fill); color: var(--label); }
.modal-body { padding: 8px 18px 22px; }
.modal-footer { border-top: 0.5px solid var(--sep); }

@media (max-width: 768px) {
  .modal-overlay { align-items: flex-end; padding-top: 0; }
  .modal, .modal.wide {
    height: calc(100% - 46px);
    max-height: calc(100% - 46px);
    border-radius: 12px 12px 0 0;
    box-shadow: none;
  }
  .modal-header { padding-top: 22px; }
  .modal-header::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    width: 36px;
    height: 5px;
    margin-left: -18px;
    border-radius: 3px;
    background: var(--chev);
  }
  .modal-body { padding: 8px 16px calc(24px + env(safe-area-inset-bottom)); }
}

/* Liste groupée du catalogue */
.item-list-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 10px 14px;
  background: var(--group);
  border: none;
  border-radius: 0;
  position: relative;
}
.item-list-entry:first-of-type { border-radius: 14px 14px 0 0; }
.item-list-entry:last-of-type { border-radius: 0 0 14px 14px; }
.item-list-entry:only-of-type { border-radius: 14px; }
.item-list-entry + .item-list-entry::before { content: ''; position: absolute; top: 0; left: 60px; right: 0; height: 0.5px; background: var(--sep); }
.item-list-entry:hover { background: var(--group); }
.ini {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  flex: none;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
}
.item-list-info { flex: 1; min-width: 0; }
.item-list-topline { display: flex; align-items: baseline; gap: 8px; }
.item-list-name { font-size: 15.5px; font-weight: 500; color: var(--label); }
.item-list-kcal { font-size: 12.5px; color: var(--label2); font-family: inherit; }
.item-list-macros { font-size: 12.5px; }
.item-list-macros .macro-p { color: var(--blue); }
.item-list-macros .macro-l { color: var(--orange); }
.item-list-macros .macro-g { color: var(--green); }
.item-mode-badge {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: none;
  background: var(--fill);
  color: var(--label3);
  border: none;
  border-radius: 999px;
  padding: 2px 9px;
}
.item-list-add { background: transparent; color: var(--tint); font-weight: 500; padding: 4px 8px; }
.me-list { background: var(--group); border-radius: 14px; overflow: hidden; gap: 0; }
.me-row { border-radius: 0; padding: 6px 16px; min-height: 46px; position: relative; color: var(--label); }
.me-row + .me-row::before { content: ''; position: absolute; top: 0; left: 16px; right: 0; height: 0.5px; background: var(--sep); }
.me-row:hover { background: var(--fill); }
.me-row-danger { color: var(--red); }
.empty-state { color: var(--label2); }
.chart-container, .stats-summary .summary-card { background: var(--group); border: none; border-radius: 20px; box-shadow: none; }

.item-list-topline { flex-wrap: wrap; column-gap: 8px; row-gap: 0; }
.item-list-name { overflow-wrap: anywhere; }
.item-list-macros { display: flex; flex-wrap: wrap; gap: 0 8px; }
@media (max-width: 480px) {
  .item-mode-badge { display: none; }
}

input[type="checkbox"], input[type="range"], input[type="radio"] { accent-color: var(--tint); }

.me-row > span:first-child::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  background: var(--chev);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M9 18l6-6-6-6'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M9 18l6-6-6-6'/></svg>") center / contain no-repeat;
}
.me-row-danger > span:first-child::after { display: none; }
.me-row-dot { padding-right: 38px; }

:root { --font-mono: var(--font-sans); }
.form-group label { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 500; color: var(--label3); }
.form-hint { color: var(--label2); font-size: 12.5px; }
.profile-section { background: var(--group); }
.profile-section-title { color: var(--label); font-size: 19px; }
.profile-advanced > summary { color: var(--tint); }

/* Feuille d'ajout */
.search-results {
  background: var(--group);
  border: none;
  border-radius: 14px;
  max-height: none;
  overflow: hidden;
}
.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  padding: 8px 14px;
  border: none;
  position: relative;
}
.search-result-item + .search-result-item::before { content: ''; position: absolute; top: 0; left: 60px; right: 0; height: 0.5px; background: var(--sep); }
.search-result-item:hover { background: var(--fill); }
.search-result-item .ini { width: 30px; height: 30px; font-size: 14px; }
.search-result-item .result-name { flex: 1; font-size: 15.5px; font-weight: 500; color: var(--label); }
.search-result-item .result-detail { font-size: 12.5px; color: var(--label2); text-align: right; }
.form-row { gap: 12px; }
select.input, select { appearance: auto; }
.entry-qty-inline { margin: 0; padding: 0; }
.period-selector { background: var(--fill); border: none; border-radius: 9px; padding: 2px; gap: 0; }
.period-btn { background: transparent; color: var(--label); border: none; border-radius: 7px; font-weight: 500; }
.period-btn:hover { background: transparent; color: var(--label); }
.period-btn.active { background: var(--seg-on); color: var(--label); box-shadow: 0 1px 4px var(--shadow-color); }
.estimate-btn-group { gap: 8px; }
.estimate-btn-text, .estimate-btn-icon, .estimate-btn-icon:last-of-type { border-radius: 999px; border: none; }
.estimate-btn-icon { width: 44px; height: 38px; padding: 0; }
.estimate-btn-icon svg { width: 20px; height: 20px; }

/* Page Premium */
body { background: var(--bg); color: var(--label); font-family: var(--font-sans); }
.premium-card { background: var(--card); border-radius: 20px; padding: 32px 28px; max-width: 420px; width: 100%; }
.premium-card h1 { font-size: 34px; font-weight: 800; letter-spacing: -1.2px; }
.premium-card a { color: var(--tint); font-weight: 500; }
.navbar-center, .deficit-display { min-width: 0; width: auto; }
.deficit-display { box-shadow: none; }
#deficit-display { border: 0; background: transparent; padding: 0 4px; }
@media (min-width: 769px) { #deficit-display { background: var(--fill); padding: 4px 10px; } }

/* Curseur d'objectif : dégradé rouge, orange, bleu, poignée blanche 28 px */
.form-group .deficit-slider {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--red), var(--orange), var(--blue));
}
.deficit-slider::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--red), var(--orange), var(--blue));
}
.deficit-slider::-webkit-slider-thumb { width: 28px; height: 28px; background: #fff; box-shadow: 0 2px 6px var(--shadow-color), 0 0 0 0.5px var(--sep); }
.deficit-slider::-moz-range-thumb { width: 28px; height: 28px; border: none; background: #fff; box-shadow: 0 2px 6px var(--shadow-color); }
.deficit-slider-pct { font-size: 1.1rem; font-weight: 800; letter-spacing: -0.5px; }

/* Interrupteur 46 x 28 */
.incomplete-toggle input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  position: relative;
  width: 46px;
  height: 28px;
  margin: 0;
  border-radius: 999px;
  background: var(--fill);
  cursor: pointer;
  transition: background 0.2s;
}
.incomplete-toggle input[type="checkbox"]::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px var(--shadow-color);
  transition: transform 0.2s;
}
.incomplete-toggle input[type="checkbox"]:checked { background: var(--green); }
.incomplete-toggle input[type="checkbox"]:checked::after { transform: translateX(18px); }
.incomplete-toggle { font-size: 13.5px; color: var(--label3); }

/* Pas de quantité */
.qty-stepper {
  display: flex;
  align-items: center;
  flex: 1;
  background: var(--group);
  border-radius: 12px;
  box-shadow: 0 0 0 0.5px var(--sep);
}
.qty-step {
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 500;
  color: var(--tint);
  border-radius: 12px;
}
.qty-step:active { background: var(--tint-bg); }
.form-group .qty-input, .qty-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  padding: 6px 0;
  -moz-appearance: textfield;
}
.qty-input::-webkit-outer-spin-button, .qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-input:focus { box-shadow: none; }

/* Tableau du catalogue (bureau) */
.item-list-head { display: none; }
@media (min-width: 769px) {
  .item-list-head, .item-list-entry {
    display: grid;
    grid-template-columns: 34px minmax(0, 1.6fr) minmax(0, 0.8fr) minmax(0, 0.9fr) minmax(0, 0.7fr) minmax(0, 0.7fr) minmax(0, 0.7fr) 76px;
    align-items: center;
    column-gap: 12px;
  }
  .item-list-head { padding: 6px 14px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--label2); }
  .item-list-entry .item-list-info, .item-list-entry .item-list-topline, .item-list-entry .item-list-macros { display: contents; }
  .item-list-entry .ini { order: 1; }
  .item-list-entry .item-list-name { order: 2; }
  .item-list-entry .item-mode-badge { order: 3; justify-self: start; }
  .item-list-entry .item-list-kcal { order: 4; color: var(--label); font-weight: 500; font-size: 14.5px; }
  .item-list-entry .macro-p { order: 5; }
  .item-list-entry .macro-l { order: 6; }
  .item-list-entry .macro-g { order: 7; }
  .item-list-entry .item-list-add { order: 8; }
}
.qty-stepper .qty-input:focus { box-shadow: none; }
.qty-stepper:focus-within { box-shadow: 0 0 0 2px var(--tint); }

/* Logo-mot Annelo : le « o » est un anneau aux cotes du « o » de la police (largeur .56em, hauteur .57em, jambage bas .02em) */
.wm-o { display: inline-block; width: .566em; height: .566em; margin: 0 .03em 0 .045em; vertical-align: -.01em; overflow: visible; fill: none; stroke-width: .26; }
.wm-o .track { stroke: color-mix(in srgb, var(--label) 26%, transparent); }
.wm-o .arc { stroke: var(--tint); stroke-linecap: round; }
.login-note { max-width: 320px; margin: 0 auto 8px; color: var(--label2); font-size: 14px; text-align: center; }
#login-info.login-note { margin-top: 8px; color: var(--green); }

/* Pastille Premium sur la ligne d'estimation d'un compte gratuit */
.estimate-locked { position: relative; cursor: pointer; }
.estimate-locked .btn { opacity: 0.45; filter: grayscale(1); }
.estimate-crown { position: absolute; top: -13px; right: 2px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--card); color: var(--tint); box-shadow: 0 0 0 1px color-mix(in srgb, var(--tint) 35%, transparent), 0 3px 8px var(--shadow-color); }
.estimate-crown svg { width: 14px; height: 14px; }

/* ---------- Chargement : blocs qui pulsent, jamais un écran vide ---------- */
.skel { border-radius: 12px; background: linear-gradient(90deg, var(--fill) 0%, color-mix(in srgb, var(--fill) 35%, transparent) 50%, var(--fill) 100%); background-size: 300px 100%; animation: skel-slide 1.3s linear infinite; }
.skel-row { height: 56px; margin-bottom: 8px; }
.skel-line { height: 14px; width: 40%; margin-bottom: 10px; }
.skel-big { height: 44px; width: 55%; }
.skel-chart { height: 180px; }
.is-loading .ring, .week-days.loading .ring { animation: skel-pulse 1.2s ease-in-out infinite; }
.is-loading .ring-big::before, .is-loading .ring-mini::before { content: ''; position: absolute; inset: 0; border-radius: 50%; border: calc(var(--rs) * 0.1) solid var(--ring-track, var(--fill)); }
.is-loading .ring-center span, .is-loading .ring-text > div { color: transparent; }
@keyframes skel-slide { from { background-position: -300px 0; } to { background-position: 300px 0; } }
@keyframes skel-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .skel, .is-loading .ring, .week-days.loading .ring { animation: none; } }

/* Amorçage : un anneau qui pulse tant qu'on ne sait pas si la session est valide */
#boot { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: var(--bg); }
.boot-ring { width: 56px; height: 56px; border-radius: 50%; border: 6px solid var(--ring-track); border-top-color: var(--tint); animation: boot-spin 0.9s linear infinite; }
@keyframes boot-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .boot-ring { animation: skel-pulse 1.2s ease-in-out infinite; } }

/* ---------- Aide de l'anneau : fenêtre soignée, dessins réels ---------- */
.hint-popup.ring-help { background: var(--card); border: none; border-radius: 28px; padding: 24px 22px 20px; max-width: 420px; max-height: 92vh; box-shadow: 0 30px 70px -24px rgba(0, 0, 0, 0.5), 0 0 0 0.5px var(--sep); transform: translateY(16px) scale(0.97); transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.1); }
.hint-popup-overlay.active .ring-help { transform: none; }
.ring-help h3 { display: block; text-align: center; font-size: 22px; font-weight: 800; letter-spacing: -0.5px; color: var(--tint); margin: 0 0 12px; }
.ring-help p { font-size: 15px; line-height: 1.45; color: var(--label2); margin: 0 0 14px; }
.ring-help strong { color: var(--label); font-weight: 700; }
.ring-help .rh-intro { text-align: center; }
.ring-help .rh-foot { text-align: center; font-size: 13.5px; margin: 0 0 10px; }
.rh-hero { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 0 0 12px; }
.rh-hero-ring { --rs: 132px; width: var(--rs); height: var(--rs); }
:root[data-theme="dark"] .rh-hero-ring svg { filter: drop-shadow(0 0 8px color-mix(in srgb, var(--tint) 45%, transparent)); }
.rh-num { font-size: 32px; font-weight: 800; letter-spacing: -1px; color: var(--label); line-height: 1; }
.rh-unit { font-size: 12px; color: var(--label2); margin-top: 2px; }
.rh-legend { font-size: 13.5px; font-weight: 600; color: var(--label2); padding: 5px 14px; border-radius: 999px; background: var(--fill); }
.rh-list { background: var(--bg); border-radius: 18px; padding: 4px 14px; margin: 0 0 14px; }
.rh-row { display: flex; align-items: center; gap: 14px; padding: 9px 0; }
.rh-row + .rh-row { border-top: 0.5px solid var(--sep); }
.ring-help .rh-row p { margin: 0; font-size: 14.5px; }
.rh-mini { --rs: 46px; width: var(--rs); height: var(--rs); }
.ring-help .rh-full, .ring-help .rh-rose { color: var(--tint); }
.ring-help .rh-over { color: var(--red); }
.ring-help .hint-close { width: 100%; min-height: 50px; margin-top: 8px; border: none; border-radius: 999px; background: var(--tint); color: #fff; font-size: 17px; font-weight: 700; box-shadow: 0 10px 22px -8px color-mix(in srgb, var(--tint) 65%, transparent); }
.ring-help .hint-close:hover { background: var(--tint); color: #fff; border: none; filter: brightness(1.06); }
.ring-help .hint-close:active { transform: scale(0.98); }
@media (max-width: 480px) { .hint-popup.ring-help { width: 92%; padding: 22px 16px 16px; max-height: 88vh; } .rh-hero-ring { --rs: 116px; } }
@media (prefers-reduced-motion: reduce) { .hint-popup.ring-help { transition: none; transform: none; } }
