/* Ajustements d'interface des versions 1.1 à 1.3. */

.app-version {
  padding: 0 10px 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.version-pill {
  display: inline-block;
  margin-left: 6px;
  padding: 4px 7px;
  border-radius: 99px;
  background: var(--soft);
  color: var(--brand);
  font-size: 10px;
  vertical-align: middle;
}

.delete-list {
  color: var(--danger);
  background: #fff0ef !important;
  border-color: #f0cfcc !important;
}

.delete-list:disabled {
  cursor: not-allowed;
  opacity: .42;
}

.search-line,
.search-box,
.search-line label {
  min-width: 0;
}

.search-box {
  width: 100%;
  overflow: hidden;
}

.search-box input {
  flex: 1;
  width: auto;
  min-width: 0;
  background: transparent;
}

.search-line label input,
.search-line label select {
  width: 100%;
  min-width: 0;
}

.suggestion {
  cursor: pointer;
}

.suggestion:focus-visible {
  position: relative;
  z-index: 1;
  outline: 3px solid rgba(38, 122, 104, .2);
  outline-offset: -3px;
}

.custom-suggestion {
  background: #edf7f3;
  border-bottom-color: #d5e8e2;
}

.custom-suggestion:hover,
.custom-suggestion:focus-visible {
  background: #dff1ea;
}

.custom-icon {
  background: var(--brand);
  color: #fff;
  font-size: 24px;
  font-weight: 600;
}

.search-status {
  padding: 13px 16px;
  color: var(--muted);
  text-align: center;
  font-size: 11px;
}

.empty.compact {
  padding: 24px 18px;
  border: 0;
  border-radius: 0;
}

@media (min-width: 721px) {
  .app {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  .sidebar {
    padding: 20px 12px;
    font-size: 14px;
  }

  .brand {
    padding: 0 8px 20px;
    font-size: 20px;
  }

  .nav button {
    min-height: 44px;
    padding: 0 10px;
  }

  .topbar {
    height: 68px;
    padding: 0 22px;
  }

  .content {
    width: 100%;
    max-width: 1240px;
    padding: 24px 30px;
  }

  .page-head {
    margin-bottom: 18px;
  }

  .page-head h1 {
    margin-bottom: 7px;
    font-size: clamp(30px, 3vw, 40px);
  }

  .page-head p {
    font-size: 14px;
  }

  .search-panel {
    position: relative;
    z-index: 10;
    padding: 14px;
    border-radius: 17px;
  }

  .search-line {
    grid-template-columns: minmax(260px, 1fr) 92px 116px;
    align-items: end;
    gap: 9px;
  }

  .search-box {
    height: 44px;
    border-radius: 11px;
    font-size: 21px;
  }

  .search-line input,
  .search-line select {
    height: 44px;
  }

  .search-panel > small {
    margin: 8px 2px 0;
    font-size: 11px;
  }

  .search-results {
    position: absolute;
    top: calc(100% - 2px);
    right: 14px;
    left: 14px;
    z-index: 30;
    max-height: min(430px, 55vh);
    margin: 0;
    overflow: auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 18px 42px rgba(26, 63, 55, .16);
  }

  .suggestion {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    min-height: 62px;
    padding: 8px 10px;
  }

  .suggestion .product-icon {
    width: 42px;
    height: 42px;
  }

  .section-title {
    margin: 18px 0 9px;
  }

  .section-title h2 {
    font-size: 22px;
  }

  .empty {
    padding: 36px 18px;
  }
}

@media (max-width: 980px) and (min-width: 721px) {
  .search-line {
    grid-template-columns: minmax(240px, 1fr) 88px 110px;
  }

}

@media (max-width: 720px) {
  .content {
    padding-top: 18px;
  }

  .page-head {
    margin-bottom: 16px;
  }

  .page-head h1 {
    font-size: 30px;
  }

  .search-panel {
    padding: 13px;
    border-radius: 17px;
  }

  .search-line {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 9px;
  }

  .search-box {
    grid-column: 1 / -1;
  }

  .search-line label:last-of-type {
    grid-column: auto;
  }

  .search-results {
    margin-top: 12px;
    border: 1px solid var(--line);
    border-radius: 13px;
  }

  .suggestion {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    padding: 9px;
  }

  .suggestion .retailer {
    grid-column: 2;
    justify-self: start;
  }

}

/* Identité ELYAKO Market et historique global — version 1.8. */
:root {
  --ink: #2b1b10;
  --muted: #79695d;
  --brand: #9a511c;
  --brand2: #c97830;
  --soft: #fbefe3;
  --bg: #f7f3ee;
  --line: #e4d7cb;
  --shadow: 0 18px 50px rgba(52, 28, 12, .11);
}
.sidebar { background: #070504; border-right-color: #2e2018; }
.brand { min-height: 92px; padding: 0 4px 18px; }
.brand img { display: block; width: 100%; height: 78px; object-fit: contain; border-radius: 14px; }
.nav button { color: #cbbbad; }
.nav button:hover { color: #fff; background: #21150e; }
.nav button.active { color: #fff; background: linear-gradient(135deg, #7d3f16, #b96727); }
.nav em { background: #fff; color: #6f3713; }
.sync-state, .app-version { color: #bca99b; }
.topbar { border-bottom-color: #e2d3c6; box-shadow: 0 5px 18px rgba(52, 28, 12, .04); }
.primary, .buy { background: linear-gradient(135deg, #844417, #bc6a29); }
.filters button.active, .search-filter-row button.active { background: #92501f; }
.mobile-brand { display: none; align-items: center; gap: 7px; font-weight: 900; }
.mobile-brand img { width: 38px; height: 38px; border-radius: 11px; }
.market-banner { height: 124px; margin: -8px 0 24px; overflow: hidden; background: #000; border: 1px solid #2c1d14; border-radius: 22px; box-shadow: 0 14px 32px rgba(42, 22, 10, .18); }
.market-banner img { display: block; width: 100%; height: 100%; object-fit: contain; }
.auth-screen { background: radial-gradient(circle at 25% 15%, #7b3c15 0, transparent 34%), linear-gradient(145deg, #050403, #1a100b); }
.auth-card { width: min(480px, 100%); background: #100b08; border-color: #3f281a; color: #fff; }
.auth-logo { display: block; width: 100%; max-height: 190px; object-fit: contain; margin-bottom: 8px; border-radius: 16px; }
.auth-card > p, .auth-card small, .auth-card .stack label { color: #cfbeb1; }
.auth-card input { color: #2b1b10; background: #fff; }
.global-history-toolbar { display: grid; grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(150px, 220px)); gap: 9px; margin-bottom: 14px; }
.usage-context { display: inline-block; margin-top: 5px; padding: 4px 8px; background: #fff4e8; color: #744018; border-radius: 8px; font-size: 10px; }
.locked-note { display: block; margin-top: 5px; color: #9a7357; font-size: 9px; font-weight: 750; }
.global-history-row { border-left: 4px solid #b96525; }

@media (max-width: 1120px) and (min-width: 721px) {
  .space-control { grid-template-columns: minmax(120px, 1fr) 42px 42px; }
  .list-control { grid-template-columns: minmax(120px, 1fr) 42px 42px 42px; }
  .global-history-toolbar { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; }
  .mobile-brand { display: flex; }
  .selectors { order: 3; flex-basis: 100%; }
  .profile { margin-left: auto; }
  .space-control { grid-template-columns: minmax(0, 1fr) 38px 38px; }
  .list-control { grid-template-columns: minmax(0, 1fr) 38px 38px 38px; }
  .market-banner { height: 76px; margin: -6px 0 18px; border-radius: 15px; }
  .global-history-toolbar { grid-template-columns: 1fr; }
  .auth-logo { max-height: 145px; }
}

/* Gestion administrative des produits — version 1.6. */
.search-filter-row {
  position: sticky; top: 0; z-index: 2; display: flex; gap: 6px; padding: 9px;
  overflow-x: auto; background: #f7faf9; border-bottom: 1px solid var(--line);
}
.search-filter-row button { flex: 0 0 auto; min-height: 30px; padding: 0 11px; background: #fff; color: var(--muted); border: 1px solid var(--line); font-size: 10px; }
.search-filter-row button.active { background: var(--brand); color: #fff; }
.history-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, 260px); gap: 10px; margin-bottom: 14px; }
.history-products { display: grid; gap: 8px; }
.history-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) 74px auto; gap: 12px; align-items: center; padding: 11px; background: #fff; border: 1px solid var(--line); border-radius: 15px; }
.usage-count { text-align: center; }
.usage-count strong, .usage-count span { display: block; }
.usage-count strong { font-size: 20px; }
.usage-count span { color: var(--muted); font-size: 9px; }
.history-settings { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
.category-chips { max-height: 250px; overflow: auto; }
.product-editor { width: min(620px, calc(100% - 24px)); max-height: calc(100vh - 24px); padding: 0; overflow: auto; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 25px 70px rgba(16,48,41,.25); }
.product-editor::backdrop { background: rgba(15,35,31,.5); backdrop-filter: blur(3px); }
.product-editor form { padding: 22px; }
.dialog-head, .dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-head h2, .dialog-head p { margin: 0; }
.dialog-head p { margin-top: 4px; color: var(--muted); font-size: 11px; }
.dialog-close { min-width: 42px; padding: 0; font-size: 24px; background: var(--soft); }
.editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.product-editor fieldset { border: 1px solid var(--line); border-radius: 12px; }
.product-editor legend { padding: 0 5px; color: var(--muted); font-size: 11px; font-weight: 800; }
.checkbox-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.checkbox-grid label { display: flex; align-items: center; gap: 6px; color: var(--ink); }
.checkbox-grid input { width: 18px; height: 18px; }
.editor-preview { min-height: 54px; display: flex; align-items: center; gap: 10px; padding: 8px; background: var(--soft); border-radius: 12px; }
.dialog-actions { justify-content: flex-end; }

/* Maisons, catégories et gestion des accès — version 1.7. */
.selectors { display: flex; align-items: center; gap: 14px; min-width: 0; }
.space-control { display: flex; align-items: center; gap: 9px; min-width: 0; }
.space-control small { color: var(--muted); font-weight: 800; }
.space-control select { min-width: 145px; border: 0; background: #f5f8f7; font-weight: 850; }
.space-control button { width: 42px; padding: 0; background: #f5f8f7; border: 1px solid var(--line); }
.category-select { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; font-weight: 800; }
.category-select select { min-width: 210px; height: 38px; }
.course-category { display: grid; gap: 7px; }
.course-category h3 { margin: 8px 4px 0; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.product-content { display: block; margin-top: 3px; color: var(--ink); font-size: 11px; }
.history-actions, .user-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.history-actions .mini, .user-actions .mini { white-space: nowrap; }
.stack-panels { display: grid; align-content: start; gap: 16px; }
.user-row { grid-template-columns: 40px minmax(160px, 1fr) auto minmax(190px, auto); }
.user-identity { min-width: 0; }
.user-identity small { overflow-wrap: anywhere; }
.role-badge { display: inline-block; margin-top: 5px; padding: 3px 7px; color: var(--brand); background: var(--soft); border-radius: 99px; font-size: 9px; font-weight: 850; }

@media (max-width: 1120px) and (min-width: 721px) {
  .topbar { align-items: flex-start; height: auto; min-height: 76px; padding-top: 10px; padding-bottom: 10px; }
  .selectors { align-items: stretch; }
  .space-control, .list-control { display: grid; grid-template-columns: minmax(120px, 1fr) 42px 42px; gap: 6px; }
  .space-control small, .list-control small { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .history-toolbar, .history-settings, .editor-grid { grid-template-columns: 1fr; }
  .history-row { grid-template-columns: 46px minmax(0, 1fr) auto; }
  .history-actions { grid-column: 2 / -1; }
  .selectors { flex: 1; display: grid; gap: 5px; }
  .space-control, .list-control { display: grid; grid-template-columns: minmax(0, 1fr) 38px 38px; gap: 5px; }
  .space-control small, .list-control small { display: none; }
  .space-control select, .list-control select { width: 100%; min-width: 0; max-width: none; height: 38px; }
  .space-control button, .list-control button { width: 38px; min-height: 38px; }
  .category-select { margin-top: 9px; align-items: stretch; flex-direction: column; }
  .category-select select { width: 100%; min-width: 0; }
  .user-row { grid-template-columns: 38px minmax(0, 1fr) auto; }
  .user-row > select, .user-actions { grid-column: 2 / -1; width: 100%; }
  .user-actions { justify-content: flex-start; }
  .checkbox-grid { grid-template-columns: repeat(2, 1fr); }
  .product-editor { width: calc(100% - 16px); max-height: calc(100vh - 16px); }
}

@media (max-width: 1120px) and (min-width: 721px) {
  .space-control { grid-template-columns: minmax(120px, 1fr) 42px 42px; }
  .list-control { grid-template-columns: minmax(120px, 1fr) 42px 42px 42px; }
}

@media (max-width: 720px) {
  .space-control { grid-template-columns: minmax(0, 1fr) 38px 38px; }
  .list-control { grid-template-columns: minmax(0, 1fr) 38px 38px 38px; }
}

/* Navigation mobile et réglages globaux — version 1.9. */
@media (max-width: 720px) {
  .topbar {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    padding: calc(9px + env(safe-area-inset-top)) 12px 11px;
    gap: 9px 10px;
    background: #fffaf5;
  }
  .mobile-brand { grid-column: 1; min-width: 0; }
  .mobile-brand img { width: 42px; height: 42px; border-radius: 50%; background: #000; }
  .mobile-brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .profile { grid-column: 2; margin: 0; }
  .selectors {
    grid-column: 1 / -1;
    order: initial;
    display: grid;
    width: 100%;
    gap: 8px;
  }
  .space-control, .list-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) repeat(3, 44px);
    align-items: center;
    gap: 6px;
    padding: 8px;
    background: #f5ece4;
    border: 1px solid #e2d3c6;
    border-radius: 14px;
  }
  .space-control { grid-template-columns: minmax(0, 1fr) repeat(3, 44px); }
  .space-control small, .list-control small {
    display: block;
    grid-column: 1 / -1;
    padding: 0 3px;
    color: #7a5a43;
    font-size: 10px;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: .08em;
  }
  .space-control select, .list-control select {
    width: 100%;
    min-width: 0;
    max-width: none;
    height: 44px;
    padding: 0 34px 0 12px;
    border: 1px solid #d7c4b5;
    border-radius: 11px;
    background-color: #fff;
    font-size: 16px;
    font-weight: 850;
  }
  .space-control button, .list-control button {
    width: 44px;
    min-height: 44px;
    padding: 0;
    border-color: #d7c4b5;
    background: #fff;
    font-size: 18px;
  }
}

/* Import assisté générique et suppression protégée — version 1.13. */
.danger-icon { color: #a72828; }
.product-import-panel p { color: var(--muted); }
.import-actions { display: flex; flex-wrap: wrap; gap: 9px; margin: 14px 0 10px; }
.file-button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 16px; color: #fff; background: #744018; border-radius: 11px; font-size: 11px; font-weight: 850; cursor: pointer; }
.file-button input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.replace-option { display: flex; flex-direction: row; align-items: center; gap: 8px; color: var(--muted); }
.replace-option input { width: 18px; height: 18px; }
.import-result { display: grid; gap: 3px; margin-top: 10px; padding: 10px 12px; color: #664326; background: #fff4e8; border: 1px solid #eed6c0; border-radius: 11px; }
.product-assistant { width: min(760px, calc(100% - 24px)); }
.assistant-source { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; }
.assistant-image-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.camera-file-button { background: #5b5048; }
.crop-area { display: grid; place-items: center; gap: 6px; padding: 10px; background: #f4eee9; border-radius: 14px; }
.crop-area canvas { display: block; max-width: 100%; max-height: 520px; background: #fff; border-radius: 8px; touch-action: none; cursor: crosshair; }
.crop-area small { color: var(--muted); text-align: center; }
.product-assistant textarea { width: 100%; resize: vertical; }
.duplicate-warning { display: grid; gap: 4px; padding: 10px; color: #862c22; background: #fff0ed; border: 1px solid #efc5be; border-radius: 11px; }
.duplicate-warning span { display: block; font-size: 10px; }
.barcode-scanner { width: min(560px, calc(100% - 24px)); padding: 22px; }
.scanner-frame { position: relative; min-height: 240px; overflow: hidden; background: #090706; border-radius: 15px; }
.scanner-frame video { display: block; width: 100%; min-height: 240px; object-fit: cover; }
.scanner-frame span { position: absolute; inset: 25% 8%; border: 3px solid #ff8a32; border-radius: 14px; box-shadow: 0 0 0 999px rgba(0,0,0,.35); }
.destructive-warning { padding: 12px; color: #8a211b; background: #fff0ed; border: 1px solid #efc5be; border-radius: 12px; font-weight: 750; }
.danger-dialog { width: min(520px, calc(100% - 24px)); }

@media (max-width: 720px) {
  .assistant-source, .product-assistant .editor-grid { grid-template-columns: 1fr; }
  .assistant-image-actions, .assistant-image-actions .file-button { width: 100%; }
  .import-actions > *, .file-button { width: 100%; }
  .space-control { grid-template-columns: minmax(0, 1fr) repeat(3, 44px); }
  .crop-area canvas { max-height: 410px; }
}

/* Quantités, tris et emplacement du stock — version 1.14. */
.sort-controls { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.sort-controls > label:not(.category-select), .toolbar-select { display: grid; gap: 4px; color: var(--muted); font-size: 10px; font-weight: 800; }
.sort-controls select, .toolbar-select select { min-width: 210px; height: 38px; }
.toolbar-right { justify-content: flex-end; }
.stepper .qty-inline { width: 58px; min-width: 58px; height: 36px; padding: 0 6px; border: 0; border-radius: 0; box-shadow: none; text-align: center; font-size: 13px; font-weight: 850; color: var(--ink); background: #fff; }
.stepper .qty-inline:focus { box-shadow: inset 0 0 0 2px rgba(38,122,104,.18); }
.stepper .stepper-unit { min-width: auto; padding: 0 7px 0 1px; text-align: left; font-size: 10px; color: var(--muted); font-weight: 800; white-space: nowrap; }
.stock-settings { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.date-meta { display: block; margin-top: 4px; color: #8b6b54; font-size: 10px; }
.admin-contact-note { display: block; margin-top: 5px; color: #8b6b54; font-size: 9px; line-height: 1.35; font-weight: 700; }
.history-toolbar { grid-template-columns: minmax(0, 1fr) minmax(160px, 230px) minmax(180px, 260px); }
.global-history-toolbar { grid-template-columns: minmax(220px, 1fr) repeat(4, minmax(140px, 210px)); }

@media (max-width: 900px) {
  .stock-settings { grid-template-columns: 1fr 1fr; }
  .global-history-toolbar { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .sort-controls { display: grid; grid-template-columns: 1fr; width: 100%; margin-top: 10px; }
  .sort-controls select, .toolbar-select, .toolbar-select select { width: 100%; min-width: 0; }
  .toolbar { flex-direction: column; }
  .stock-settings { grid-template-columns: 1fr; }
  .history-toolbar, .global-history-toolbar { grid-template-columns: 1fr; }
  .stepper .qty-inline { width: 54px; min-width: 54px; }
}

/* Scan code-barres depuis la liste de courses — version 1.17. */
.barcode-search-btn {
  flex: 0 0 46px;
  width: 46px;
  min-height: 40px;
  padding: 0;
  border-radius: 10px;
  background: #fff1e5;
  color: #9b4d10;
  border: 1px solid #f0d1b7;
  font-size: 23px;
  line-height: 1;
}
.barcode-search-btn:hover { background: #ffe4cf; }
.barcode-search-btn:disabled { opacity: .4; cursor: not-allowed; }

.barcode-scanner {
  width: min(520px, calc(100% - 24px));
  padding: 0;
  overflow: hidden;
  border-radius: 24px;
}
.barcode-scanner .barcode-shell { display: grid; gap: 14px; padding: 18px; }
.barcode-scanner .barcode-head { align-items: flex-start; }
.barcode-scanner .barcode-head h2 { font-size: 24px; line-height: 1.05; }
.barcode-scanner .barcode-head p { max-width: 360px; font-size: 12px; line-height: 1.4; }
.scanner-camera-area { display: grid; gap: 8px; }
.scanner-frame {
  position: relative;
  min-height: 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #090706;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.08);
}
.scanner-frame video { display: block; width: 100%; height: 100%; min-height: 0; object-fit: cover; }
.scanner-guide {
  position: absolute;
  left: 7%;
  right: 7%;
  top: 36%;
  height: 28%;
  border: 3px solid #ff8a32;
  border-radius: 15px;
  box-shadow: 0 0 0 999px rgba(0,0,0,.38), 0 0 18px rgba(255,138,50,.25);
  overflow: hidden;
}
.scanner-guide i {
  position: absolute;
  left: 5%;
  right: 5%;
  top: 50%;
  height: 2px;
  background: #ffb06f;
  box-shadow: 0 0 8px #ff8a32;
  animation: barcode-scan-line 1.7s ease-in-out infinite;
}
@keyframes barcode-scan-line { 0%,100% { transform: translateY(-42px); opacity: .4; } 50% { transform: translateY(42px); opacity: 1; } }
.scanner-camera-label {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  padding: 6px 10px;
  white-space: nowrap;
  border-radius: 99px;
  color: #fff;
  background: rgba(0,0,0,.55);
  font-size: 10px;
  font-weight: 800;
}
.scanner-help { color: var(--muted); text-align: center; font-size: 10px; line-height: 1.4; }
.barcode-status { padding: 9px 11px; border-radius: 11px; background: #fff4e8; color: #73451f; font-size: 11px; font-weight: 750; }
.barcode-manual { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
.barcode-manual input { width: 100%; }
.barcode-result { display: grid; gap: 13px; padding-top: 2px; }
.barcode-result-title { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.barcode-result-title > span { font-weight: 900; color: var(--ink); }
.barcode-result-title small { color: var(--muted); text-align: right; }
.barcode-product-card { display: grid; grid-template-columns: 58px minmax(0,1fr); gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.barcode-product-card .product-icon { width: 58px; height: 58px; }
.barcode-product-card strong, .barcode-product-card small { display: block; }
.barcode-product-card small { margin-top: 4px; color: var(--muted); line-height: 1.35; }
.barcode-new-name { display: grid; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 800; }
.barcode-image-block { display: grid; gap: 8px; padding: 12px; background: #faf7f4; border-radius: 14px; }
.barcode-image-block > span { font-size: 11px; font-weight: 850; color: var(--ink); }
.barcode-image-block > span small { color: var(--muted); font-weight: 650; }
.barcode-image-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.barcode-image-actions .file-button { min-height: 38px; padding: 0 12px; }
.barcode-image-actions .secondary-file { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.barcode-image-preview { min-height: 58px; display: grid; place-items: center; overflow: hidden; border: 1px dashed #dccbbd; border-radius: 12px; color: var(--muted); background: #fff; font-size: 10px; }
.barcode-image-preview img { display: block; width: 100%; max-height: 170px; object-fit: contain; background: #fff; }
.barcode-result-actions { display: flex; justify-content: flex-end; gap: 8px; }

@media (max-width: 720px) {
  .search-box { padding-right: 6px; }
  .barcode-search-btn { flex-basis: 44px; width: 44px; }
  .barcode-scanner { width: calc(100% - 18px); max-height: calc(100vh - 18px); border-radius: 22px; }
  .barcode-scanner .barcode-shell { padding: 14px; gap: 11px; }
  .barcode-scanner .barcode-head h2 { font-size: 21px; }
  .scanner-frame { aspect-ratio: 1 / 1; max-height: 48vh; }
  .scanner-guide { left: 6%; right: 6%; top: 39%; height: 22%; }
  .scanner-camera-label { bottom: 9px; }
  .barcode-manual { grid-template-columns: 1fr; }
  .barcode-image-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .barcode-image-actions .file-button { width: 100%; padding: 0 8px; text-align: center; }
  .barcode-result-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .barcode-result-actions button { width: 100%; }
}


/* Identité code-barres — v1.20 */
.barcode-new-name small { color: var(--muted); font-size: 10px; font-weight: 650; line-height: 1.35; }
.barcode-identity-box { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; padding: 11px; border: 1px solid #ead9ca; border-radius: 13px; background: #fffaf5; }
.barcode-identity-box > small { grid-column: 1 / -1; color: var(--muted); font-size: 10px; line-height: 1.35; }
.barcode-identity-box.compact { grid-template-columns: 1fr; }
.barcode-identity-box.compact > div { display: grid; gap: 2px; padding: 7px 9px; border-radius: 10px; background: #fff; }
.barcode-identity-box.compact span { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.barcode-identity-box.compact strong { overflow-wrap: anywhere; font-size: 12px; }
@media (max-width: 720px) { .barcode-identity-box { grid-template-columns: 1fr; } .barcode-identity-box > small { grid-column: 1; } }

/* Fiche code-barres unifiée et formulaires mobiles scrollables — v1.20 */
.barcode-fields { display: grid; gap: 10px; }
.barcode-fields > label, .barcode-fields .editor-grid > label { display: grid; gap: 5px; }
.barcode-scanner .barcode-shell {
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding-bottom: max(18px, env(safe-area-inset-bottom));
}
.product-editor form {
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: max(22px, calc(12px + env(safe-area-inset-bottom)));
}
.product-editor .dialog-actions,
.barcode-scanner .barcode-result-actions {
  position: sticky;
  bottom: 0;
  z-index: 8;
  margin: 0 -4px -4px;
  padding: 10px 4px max(4px, env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, rgba(255,255,255,.9), #fff 28%);
}
.editor-preview { max-height: 190px; overflow: hidden; }
.editor-preview .product-icon { width: min(150px, 45vw); height: min(150px, 45vw); }
.editor-preview .product-icon img { width: 100%; height: 100%; object-fit: contain; }
.product-assistant .crop-area canvas { max-height: min(46dvh, 420px); }
.barcode-image-preview img { max-height: min(24dvh, 180px); }

@media (max-width: 720px) {
  .product-editor { max-height: calc(100dvh - 12px); }
  .product-editor form { max-height: calc(100dvh - 12px); padding: 14px; padding-bottom: max(16px, calc(10px + env(safe-area-inset-bottom))); }
  .barcode-scanner .barcode-shell { max-height: calc(100dvh - 12px); padding: 14px; padding-bottom: max(14px, calc(8px + env(safe-area-inset-bottom))); }
  .barcode-fields .editor-grid { grid-template-columns: 1fr; }
  .barcode-image-preview img { max-height: 150px; }
  .product-editor .dialog-actions, .barcode-scanner .barcode-result-actions { padding-bottom: max(8px, env(safe-area-inset-bottom)); }
}
