/* ============================================================
   SCANPRO v2 — CSS unifie light/dark + full responsive
   Breakpoints : mobile portrait <480 | mobile paysage <768
                 tablette portrait <900 | tablette paysage <1100
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

/* ── Tokens dark (defaut) ── */
:root {
  color-scheme: dark;
  --bg:        #09090f;
  --surface:   #111119;
  --card:      #17171f;
  --card2:     #1d1d27;
  --border:    rgba(255,255,255,0.07);
  --border-h:  rgba(255,255,255,0.14);
  --fg:        #eeeef6;
  --muted:     #6b6b88;
  --muted2:    #9090b0;
  --accent:    #6875f5;
  --accent-bg: rgba(104,117,245,0.12);
  --accent-bd: rgba(104,117,245,0.3);
  --green:     #10b981;
  --green-bg:  rgba(16,185,129,0.1);
  --green-bd:  rgba(16,185,129,0.28);
  --amber:     #f59e0b;
  --amber-bg:  rgba(245,158,11,0.1);
  --amber-bd:  rgba(245,158,11,0.28);
  --red:       #ef4444;
  --red-bg:    rgba(239,68,68,0.08);
  --red-bd:    rgba(239,68,68,0.28);
  --purple:    #a78bfa;
  --purple-bg: rgba(167,139,250,0.1);
  --purple-bd: rgba(167,139,250,0.28);
  --radius:    12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
}

/* ── Tokens light ── */
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg:        #f2f2f7;
    --surface:   #ffffff;
    --card:      #ffffff;
    --card2:     #f7f7fb;
    --border:    rgba(0,0,0,0.08);
    --border-h:  rgba(0,0,0,0.16);
    --fg:        #1a1a2e;
    --muted:     #7070a0;
    --muted2:    #a0a0c0;
    --accent:    #4f5ae8;
    --accent-bg: rgba(79,90,232,0.08);
    --accent-bd: rgba(79,90,232,0.22);
    --green:     #059669;
    --green-bg:  rgba(5,150,105,0.08);
    --green-bd:  rgba(5,150,105,0.22);
    --amber:     #d97706;
    --amber-bg:  rgba(217,119,6,0.08);
    --amber-bd:  rgba(217,119,6,0.22);
    --red:       #dc2626;
    --red-bg:    rgba(220,38,38,0.06);
    --red-bd:    rgba(220,38,38,0.22);
    --purple:    #7c3aed;
    --purple-bg: rgba(124,58,237,0.07);
    --purple-bd: rgba(124,58,237,0.22);
  }
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background .2s, color .2s;
}

/* ============================================================
   HEADER
   ============================================================ */
header {
  display: flex; align-items: center; gap: 12px;
  padding: 0 28px; height: 58px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 200;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.logo { display: flex; align-items: center; gap: 9px; text-decoration: none; flex-shrink: 0; }

.logo-mark {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 16px;
}

.logo-text {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px; letter-spacing: 0.07em; color: var(--fg); line-height: 1;
}

.logo-v {
  font-size: 10px; font-weight: 600; color: var(--accent);
  background: var(--accent-bg); border: 1px solid var(--accent-bd);
  padding: 1px 6px; border-radius: 20px; letter-spacing: .04em;
}

.nav-tabs { display: flex; gap: 4px; margin-left: auto; }

.nav-tab {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 20px;
  border: 1px solid transparent; background: transparent;
  color: var(--muted); font-family: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer; text-decoration: none; transition: all .18s; white-space: nowrap;
}

.nav-tab i { font-size: 15px; }
.nav-tab:hover { color: var(--fg); background: var(--card2); border-color: var(--border); }
.nav-tab.active { color: var(--accent); background: var(--accent-bg); border-color: var(--accent-bd); }

.status-pill {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 11px; border: 1px solid var(--border); border-radius: 20px;
  font-size: 11px; color: var(--muted); flex-shrink: 0;
}

.status-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green); animation: pulse 2.2s infinite;
}

@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.35} }

/* ============================================================
   MAIN
   ============================================================ */
main { max-width: 860px; margin: 0 auto; padding: 36px 24px 72px; }

/* ============================================================
   PAGE INTRO
   ============================================================ */
.page-intro { margin-bottom: 32px; }
.page-intro h1 { font-family: 'Bebas Neue', sans-serif; font-size: clamp(36px,7vw,62px); line-height: 1.05; letter-spacing: 0.03em; }
.page-intro h1 span { color: var(--accent); }
.page-intro p { color: var(--muted); font-size: 14px; margin-top: 7px; }

/* ============================================================
   MODE CARDS
   ============================================================ */
.mode-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; margin-bottom: 20px; }
.mode-grid.cols-3 { grid-template-columns: repeat(3,1fr); }

.mode-card {
  background: var(--card); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 16px 14px 14px;
  cursor: pointer; text-align: center; user-select: none;
  transition: border-color .18s, background .18s, transform .15s;
}

.mode-card:hover { border-color: var(--border-h); background: var(--card2); transform: translateY(-1px); }
.mode-card.active { border-color: var(--accent); background: var(--accent-bg); }

.mode-card-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--card2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 10px; font-size: 18px; color: var(--muted2);
  transition: background .18s, color .18s, border-color .18s;
}

.mode-card.active .mode-card-icon { background: var(--accent-bg); border-color: var(--accent-bd); color: var(--accent); }
.mode-card-title { font-weight: 600; font-size: 13px; margin-bottom: 3px; }
.mode-card-desc  { font-size: 11px; color: var(--muted); }

/* ============================================================
   PANELS
   ============================================================ */
.panel { display: none; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 20px; }
.panel.open { display: block; }

.panel-header {
  padding: 11px 15px; border-bottom: 1px solid var(--border);
  font-size: 11px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .09em;
  display: flex; align-items: center; gap: 7px;
}
.panel-header i { font-size: 14px; }
.panel-body { padding: 15px; }

/* ============================================================
   FORMS
   ============================================================ */
.search-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.field { flex: 1; min-width: 150px; }
.field label { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 5px; }

input[type="text"],
input[inputmode="numeric"] {
  width: 100%;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px;
  color: var(--fg); font-family: inherit; font-size: 14px;
  outline: none; -webkit-appearance: none;
  transition: border-color .18s, background .18s;
}

input::placeholder { color: var(--muted); }
input:focus { border-color: var(--accent); background: var(--card2); }

textarea {
  width: 100%;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px;
  color: var(--fg); font-family: inherit; font-size: 14px;
  outline: none; resize: none; transition: border-color .18s;
}
textarea:focus { border-color: var(--accent); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 16px; border: 1.5px solid transparent;
  border-radius: var(--radius-sm); font-family: inherit;
  font-size: 13px; font-weight: 600; cursor: pointer;
  text-decoration: none; white-space: nowrap;
  transition: opacity .18s, transform .14s, background .18s;
  -webkit-tap-highlight-color: transparent;
}

.btn i { font-size: 15px; }
.btn:hover  { opacity: .86; transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn:disabled { opacity: .35; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }

.btn-ghost {
  background: var(--surface); border-color: var(--border); color: var(--fg);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); opacity: 1; }

/* ============================================================
   CAMERA
   ============================================================ */
#camera-container { position: relative; border-radius: var(--radius-sm); overflow: hidden; margin: 10px 0; background: #000; max-height: 280px; }
#camera-preview { width: 100%; display: block; max-height: 280px; object-fit: cover; }
.scanner-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.scanner-frame { position: relative; width: 220px; height: 140px; }
.scanner-line { position: absolute; left: 0; right: 0; height: 2px; background: linear-gradient(90deg,transparent,var(--green),transparent); animation: scan 1.8s linear infinite; }
@keyframes scan { 0%{top:0} 100%{top:calc(100% - 2px)} }
.scanner-corner { position: absolute; width: 16px; height: 16px; border-color: var(--green); border-style: solid; }
.scanner-corner.tl { top:0; left:0; border-width:2.5px 0 0 2.5px; }
.scanner-corner.tr { top:0; right:0; border-width:2.5px 2.5px 0 0; }
.scanner-corner.bl { bottom:0; left:0; border-width:0 0 2.5px 2.5px; }
.scanner-corner.br { bottom:0; right:0; border-width:0 2.5px 2.5px 0; }
.camera-controls { display: flex; gap: 8px; margin-top: 8px; }

/* ============================================================
   LOADER
   ============================================================ */
#loader, #p-loader, #e-loader { display: none; text-align: center; padding: 56px 24px; }
.loader-ring { width: 44px; height: 44px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; margin: 0 auto 18px; }
@keyframes spin { to { transform: rotate(360deg); } }
.loader-title { font-family: 'Bebas Neue', sans-serif; font-size: 20px; letter-spacing: .05em; margin-bottom: 6px; }
.loader-sub { font-size: 13px; color: var(--muted); }

/* ============================================================
   BADGES
   ============================================================ */
.badge-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; letter-spacing: .03em; }
.badge i { font-size: 12px; }
.badge-blue,
.badge-accent  { background: var(--accent-bg);  border: 1px solid var(--accent-bd);  color: var(--accent); }
.badge-green   { background: var(--green-bg);   border: 1px solid var(--green-bd);   color: var(--green); }
.badge-amber,
.badge-orange  { background: var(--amber-bg);   border: 1px solid var(--amber-bd);   color: var(--amber); }
.badge-red     { background: var(--red-bg);     border: 1px solid var(--red-bd);     color: var(--red); }
.badge-purple  { background: var(--purple-bg);  border: 1px solid var(--purple-bd);  color: var(--purple); }
.badge-gray    { background: var(--card2);      border: 1px solid var(--border);     color: var(--muted); }

/* ============================================================
   PRODUIT — RESULT DESKTOP
   ============================================================ */
.result-hero {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); display: grid;
  grid-template-columns: 220px 1fr;
  overflow: hidden; margin-bottom: 16px;
}

.product-gallery {
  border-right: 1px solid var(--border); padding: 18px;
  background: color-mix(in srgb,var(--card) 60%,var(--bg));
  display: flex; flex-direction: column; gap: 8px;
}

.product-main-img {
  width: 100%; aspect-ratio: 1;
  border-radius: var(--radius-sm); overflow: hidden;
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
}
.product-main-img img { width: 100%; height: 100%; object-fit: contain; }

.no-img-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; color: var(--muted); font-size: 12px; width: 100%; aspect-ratio: 1;
}
.no-img-placeholder i { font-size: 36px; }

.product-thumbs { display: flex; gap: 6px; flex-wrap: wrap; }
.product-thumb { width: 44px; height: 44px; border-radius: 7px; border: 1.5px solid var(--border); object-fit: contain; cursor: pointer; background: var(--surface); transition: border-color .16s; }
.product-thumb.active, .product-thumb:hover { border-color: var(--accent); }

.product-info { padding: 20px; }
.product-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.product-name { font-family: 'Bebas Neue', sans-serif; font-size: 26px; letter-spacing: .03em; line-height: 1.1; }
.product-brand { color: var(--muted); font-size: 13px; margin-top: 3px; }
.product-desc  { font-size: 13px; color: var(--muted); line-height: 1.6; margin-bottom: 14px; }

.info-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(130px,1fr)); gap: 8px; }
.info-item { background: var(--card2); border: 1px solid var(--border); border-radius: var(--radius-xs); padding: 9px 11px; }
.info-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 3px; }
.info-value { font-size: 12px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nutri-ring { width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-direction: column; flex-shrink: 0; }
.nutri-letter { font-family: 'Bebas Neue', sans-serif; font-size: 22px; line-height: 1; color: #fff; }
.nutri-label  { font-size: 8px; color: rgba(255,255,255,.7); text-transform: uppercase; }

/* ============================================================
   TABS
   ============================================================ */
.tabs-section { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.tabs-nav { display: flex; overflow-x: auto; border-bottom: 1px solid var(--border); scrollbar-width: none; }
.tabs-nav::-webkit-scrollbar { display: none; }

.tab-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 12px 16px; background: none; border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted); font-family: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer; white-space: nowrap; transition: color .16s, border-color .16s;
}
.tab-btn i { font-size: 15px; }
.tab-btn:hover { color: var(--fg); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-pane { display: none; padding: 20px; }
.tab-pane.active { display: block; }

.ingredients-list { display: flex; flex-wrap: wrap; gap: 6px; }
.ingredient-chip { padding: 4px 10px; border-radius: 20px; background: var(--card2); border: 1px solid var(--border); font-size: 12px; color: var(--fg); }
.ingredient-chip.allergen { border-color: var(--red-bd); color: var(--red); background: var(--red-bg); }

.nutrition-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.nutrition-table tr:not(:last-child) td { border-bottom: 1px solid var(--border); }
.nutrition-table td { padding: 9px 0; }
.nutrition-table td:last-child { text-align: right; color: var(--muted); }

.origin-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(150px,1fr)); gap: 12px; }
.origin-card { background: var(--card2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; text-align: center; }
.origin-flag { font-size: 28px; margin-bottom: 7px; }
.origin-name { font-weight: 600; font-size: 14px; }
.origin-lbl  { font-size: 11px; color: var(--muted); margin-top: 3px; }

.raw-json { background: var(--card2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; font-family: monospace; font-size: 12px; color: var(--muted); white-space: pre-wrap; word-break: break-word; max-height: 360px; overflow-y: auto; }

/* ============================================================
   ENTREPRISE HERO
   ============================================================ */
.ent-hero { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 16px; }
.ent-hero-top { display: flex; gap: 20px; padding: 24px; align-items: flex-start; }

.ent-logo-wrap { width: 72px; height: 72px; flex-shrink: 0; background: var(--card2); border-radius: 14px; border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 30px; overflow: hidden; }
.ent-logo-wrap img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.ent-header { flex: 1; min-width: 0; }
.ent-name { font-family: 'Bebas Neue', sans-serif; font-size: 30px; letter-spacing: .02em; line-height: 1; }
.ent-legal { font-size: 13px; color: var(--muted); margin-top: 3px; }
.ent-desc  { font-size: 13px; color: var(--muted); line-height: 1.65; }

.ent-score-ring { width: 64px; height: 64px; border-radius: 50%; border: 2.5px solid var(--purple); display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0; }
.ent-score-val { font-family: 'Bebas Neue', sans-serif; font-size: 24px; line-height: 1; color: var(--purple); }
.ent-score-lbl { font-size: 9px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }

.revenue-bar { display: flex; gap: 3px; margin-top: 7px; }
.revenue-seg { height: 6px; flex: 1; border-radius: 3px; background: var(--border-h); }
.revenue-seg.filled { background: var(--purple); }

.ent-info-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(140px,1fr)); border-top: 1px solid var(--border); }
.ent-info-item { padding: 13px 18px; border-right: 1px solid var(--border); }
.ent-info-item:last-child { border-right: none; }
.ent-info-label { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 3px; }
.ent-info-value { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.products-mini-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(120px,1fr)); gap: 10px; }
.product-mini-card { background: var(--card2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; text-align: center; cursor: pointer; transition: border-color .16s; }
.product-mini-card:hover { border-color: var(--accent); }
.product-mini-card img { width: 56px; height: 56px; object-fit: contain; margin-bottom: 7px; }
.product-mini-name { font-size: 11px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nutri-chip { display: inline-flex; width: 22px; height: 22px; border-radius: 50%; align-items: center; justify-content: center; font-family: 'Bebas Neue', sans-serif; font-size: 11px; color: #fff; margin-top: 5px; }

.subs-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(170px,1fr)); gap: 8px; }
.sub-card { display: flex; align-items: center; gap: 10px; background: var(--card2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 11px; cursor: pointer; transition: border-color .16s; }
.sub-card:hover { border-color: var(--purple); }
.sub-logo { width: 34px; height: 34px; border-radius: 7px; background: var(--card); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; overflow: hidden; }
.sub-logo img { width: 100%; height: 100%; object-fit: contain; }
.sub-name { font-size: 13px; font-weight: 600; }

/* ============================================================
   RESULTS LIST
   ============================================================ */
.results-list { display: flex; flex-direction: column; gap: 10px; }
.result-card { display: flex; gap: 14px; align-items: center; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; cursor: pointer; transition: border-color .16s, background .16s, transform .14s; }
.result-card:hover { border-color: var(--purple); background: var(--purple-bg); transform: translateX(3px); }
.result-logo { width: 46px; height: 46px; border-radius: 10px; background: var(--card2); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; overflow: hidden; }
.result-logo img { width: 100%; height: 100%; object-fit: contain; padding: 5px; }
.result-info { flex: 1; min-width: 0; }
.result-name { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-legal { font-size: 12px; color: var(--muted); margin-top: 2px; }
.result-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.result-arrow { color: var(--muted); font-size: 18px; flex-shrink: 0; transition: color .16s; }
.result-card:hover .result-arrow { color: var(--purple); }

.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 20px; }
.page-btn { width: 34px; height: 34px; border-radius: var(--radius-sm); background: var(--card); border: 1px solid var(--border); color: var(--muted); font-family: inherit; font-size: 13px; cursor: pointer; transition: all .16s; display: flex; align-items: center; justify-content: center; }
.page-btn:hover:not(:disabled) { border-color: var(--purple); color: var(--purple); }
.page-btn.active { background: var(--purple-bg); border-color: var(--purple); color: var(--purple); font-weight: 600; }
.page-btn:disabled { opacity: .35; cursor: default; }

/* ============================================================
   ERROR BOX
   ============================================================ */
.error-box { display: flex; align-items: flex-start; gap: 14px; background: var(--red-bg); border: 1px solid var(--red-bd); border-radius: var(--radius); padding: 20px; }
.error-box i { font-size: 28px; color: var(--red); flex-shrink: 0; margin-top: 2px; }
.error-box-title { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.error-box-text  { font-size: 13px; color: var(--muted); line-height: 1.5; }

/* ============================================================
   HISTORIQUE
   ============================================================ */
.history-title { font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin-bottom: 9px; }
.history-list  { display: flex; flex-direction: column; gap: 6px; }
.history-item { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 13px; cursor: pointer; transition: background .15s, border-color .15s; }
.history-item:hover { background: var(--card2); border-color: var(--border-h); }
.history-thumb, .history-logo { width: 36px; height: 36px; border-radius: 7px; background: var(--card2); object-fit: contain; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 16px; overflow: hidden; }
.history-logo img, .history-thumb img { width: 100%; height: 100%; object-fit: contain; }
.history-name  { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-brand, .history-sub { font-size: 11px; color: var(--muted); margin-top: 1px; }

/* ============================================================
   TOAST
   ============================================================ */
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(16px); background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 10px 20px; font-size: 13px; font-weight: 500; pointer-events: none; opacity: 0; transition: opacity .22s, transform .22s; z-index: 999; white-space: nowrap; max-width: 90vw; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============================================================
   MOBILE GRILLE PADS
   ============================================================ */
.mob-product-header { text-align: center; padding: 16px 16px 6px; }
.mob-product-name { font-family: 'Bebas Neue', sans-serif; font-size: 24px; letter-spacing: .03em; line-height: 1.1; }
.mob-product-brand { font-size: 12px; color: var(--muted); margin-top: 2px; }

.mob-grid { display: grid; grid-template-columns: repeat(3,1fr); grid-template-rows: repeat(3,1fr); gap: 8px; padding: 10px; aspect-ratio: 1/1; max-width: 380px; margin: 0 auto; }

.mob-pad { background: var(--card); border: 1.5px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; cursor: pointer; padding: 6px 4px; position: relative; overflow: hidden; transition: border-color .16s, transform .13s; -webkit-tap-highlight-color: transparent; }
.mob-pad::before { content: ''; position: absolute; inset: 0; background: var(--pad-color,var(--accent)); opacity: 0; transition: opacity .15s; }
.mob-pad:active  { transform: scale(0.93); }
.mob-pad:hover   { border-color: var(--pad-color,var(--accent)); }
.mob-pad:hover::before  { opacity: 0.06; }
.mob-pad:active::before { opacity: 0.1; }

.mob-pad i { font-size: 22px; position: relative; z-index: 1; color: var(--pad-color,var(--muted2)); }
.mob-pad-label { font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); text-align: center; position: relative; z-index: 1; line-height: 1.2; }

.mob-grid-center { background: var(--card2); border: 1.5px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.mob-grid-center img { width: 100%; height: 100%; object-fit: contain; }
.mob-grid-center i { font-size: 36px; color: var(--border-h); }
.mob-nutri-chip { position: absolute; bottom: 5px; left: 50%; transform: translateX(-50%); padding: 2px 8px; border-radius: 20px; font-family: 'Bebas Neue', sans-serif; font-size: 13px; color: #fff; letter-spacing: .05em; }

/* ============================================================
   MODAUX BOTTOM SHEET
   ============================================================ */
.mob-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0); z-index: 500; display: flex; align-items: flex-end; pointer-events: none; transition: background .22s; }
.mob-modal-overlay.open { background: rgba(0,0,0,.55); pointer-events: all; backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.mob-modal-sheet { width: 100%; background: var(--surface); border-radius: 18px 18px 0 0; border-top: 1px solid var(--border); max-height: 82vh; display: flex; flex-direction: column; transform: translateY(100%); transition: transform .28s cubic-bezier(.32,.72,0,1); }
.mob-modal-overlay.open .mob-modal-sheet { transform: translateY(0); }
.mob-modal-handle { width: 32px; height: 4px; background: var(--border-h); border-radius: 2px; margin: 11px auto 0; flex-shrink: 0; }
.mob-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 18px 11px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.mob-modal-title { font-family: 'Bebas Neue', sans-serif; font-size: 19px; letter-spacing: .04em; }
.mob-modal-close { background: var(--card2); border: 1px solid var(--border); color: var(--muted); width: 30px; height: 30px; border-radius: 50%; font-size: 15px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: color .15s; }
.mob-modal-close:hover { color: var(--fg); }
.mob-modal-body { padding: 16px 18px 28px; overflow-y: auto; flex: 1; }
.mob-modal-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.mob-modal-row:last-child { border-bottom: none; }
.mob-modal-lbl { color: var(--muted); flex-shrink: 0; font-size: 12px; }

/* ============================================================
   SKELETON
   ============================================================ */
@keyframes skelPulse { 0%,100%{opacity:.35} 50%{opacity:.7} }
.skel { background: var(--border-h); border-radius: var(--radius-xs); animation: skelPulse 1.4s infinite; }

/* ============================================================
   RESPONSIVE — tablette portrait (< 900px)
   ============================================================ */
@media (max-width: 900px) {
  main { padding: 28px 20px 64px; max-width: 100%; }
  .result-hero { grid-template-columns: 190px 1fr; }
  .page-intro h1 { font-size: clamp(30px,6vw,48px); }
  .ent-info-grid { grid-template-columns: repeat(3,1fr); }
}

/* ============================================================
   RESPONSIVE — mobile paysage (< 768px)
   ============================================================ */
@media (max-width: 768px) {
  header { padding: 0 16px; height: 52px; }
  main   { padding: 20px 16px 60px; }
  .status-pill { display: none; }

  .result-hero { grid-template-columns: 1fr; }
  .product-gallery { border-right: none; border-bottom: 1px solid var(--border); padding: 14px; }
  .product-main-img { aspect-ratio: 16/7; }
  .product-info { padding: 16px; }
  .product-name { font-size: 22px; }

  .ent-hero-top { gap: 14px; padding: 18px; }
  .ent-name { font-size: 24px; }
  .ent-info-grid { grid-template-columns: repeat(2,1fr); }
  .ent-info-item:nth-child(even) { border-right: none; }

  /* Grille pads en paysage : peut etre plus large */
  .mob-grid { max-width: 420px; }
}

/* ============================================================
   RESPONSIVE — mobile portrait (< 480px)
   ============================================================ */
@media (max-width: 480px) {
  header { padding: 0 12px; height: 50px; }
  .logo-text { font-size: 19px; }
  .logo-v    { display: none; }
  .nav-tab .nav-tab-label { display: none; }
  .nav-tab { padding: 6px 10px; }

  main { padding: 14px 12px 54px; }
  .page-intro { margin-bottom: 18px; }
  .page-intro h1 { font-size: clamp(26px,9vw,36px); }
  .page-intro p  { font-size: 13px; }

  /* Mode cards compactes */
  .mode-grid { gap: 6px; margin-bottom: 14px; }
  .mode-card { padding: 10px 8px; }
  .mode-card-icon { width: 34px; height: 34px; font-size: 16px; margin-bottom: 7px; border-radius: 9px; }
  .mode-card-title { font-size: 11px; margin-bottom: 0; }
  .mode-card-desc  { display: none; }

  /* Panel compact */
  .panel-body   { padding: 12px; }
  .panel-header { padding: 10px 12px; }
  .search-row   { gap: 7px; }
  .field        { min-width: 0; }
  .btn          { padding: 10px 12px; font-size: 12px; }
  .btn i        { font-size: 14px; }

  /* Champs texte empiles verticalement */
  #p-panel-text .search-row { flex-direction: column; }
  #p-panel-text .btn,
  #e-panel-name .btn { width: 100%; justify-content: center; }

  /* Hero produit */
  .result-hero { border-radius: var(--radius-sm); }
  .product-main-img { aspect-ratio: 4/3; }
  .product-name { font-size: 20px; }
  .info-grid { grid-template-columns: repeat(2,1fr); gap: 6px; }
  .info-item { padding: 7px 9px; }
  .info-label { font-size: 9px; }
  .info-value { font-size: 11px; }

  /* Tabs compacts : icones seules */
  .tab-btn { padding: 10px 11px; font-size: 12px; }
  .tab-btn .tab-label { display: none; }
  .tab-pane { padding: 13px 11px; }

  /* Entreprise hero compact */
  .ent-hero-top { padding: 13px 12px; gap: 11px; }
  .ent-logo-wrap { width: 52px; height: 52px; border-radius: 10px; font-size: 22px; }
  .ent-name { font-size: 20px; }
  .ent-info-grid { grid-template-columns: repeat(2,1fr); }
  .ent-info-item { padding: 10px 11px; border-right: none; border-bottom: 1px solid var(--border); }
  .ent-info-item:nth-child(odd) { border-right: 1px solid var(--border); }
  .ent-info-item:nth-last-child(1),
  .ent-info-item:nth-last-child(2) { border-bottom: none; }

  /* Results */
  .result-card { padding: 11px 12px; gap: 10px; border-radius: var(--radius-sm); }
  .result-logo { width: 38px; height: 38px; }
  .result-name  { font-size: 13px; }
  .result-legal { font-size: 11px; }

  /* Historique */
  .history-item { padding: 8px 10px; gap: 8px; }
  .history-thumb, .history-logo { width: 30px; height: 30px; }
  .history-name { font-size: 12px; }

  /* Grille pads compacte */
  .mob-grid { gap: 6px; padding: 8px; max-width: 320px; }
  .mob-pad i { font-size: 18px; }
  .mob-pad-label { font-size: 8px; }

  /* Toast */
  #toast { bottom: 14px; font-size: 12px; padding: 8px 15px; }
}

@media print {
  header, #toast, .mob-modal-overlay { display: none; }
  main { padding: 0; }
}























