/* ── Thème par univers (allées = rouge DM, clôtures = jaune DM, piscines = bleu DM) ── */
:root {
  --dm-primary: #e0332a;
  --dm-primary-dark: #c02017;
  --dm-primary-contrast: #fff;
  --dm-tint: #fef2f2;
  --dm-focus-ring: rgba(224,51,42,0.1);
  --dm-accent: #00a94f;
  --dm-link: #e0332a;
}
body.theme-cloture {
  --dm-primary: #ffcb00;
  --dm-primary-dark: #eab500;
  --dm-primary-contrast: #3d3f34;
  --dm-tint: #fff8dc;
  --dm-focus-ring: rgba(255,203,0,0.25);
  --dm-accent: #a7c10c;
  --dm-link: #7d940e;
}
body.theme-piscine {
  --dm-primary: #0077bc;
  --dm-primary-dark: #005a8c;
  --dm-primary-contrast: #fff;
  --dm-tint: #e6f3f9;
  --dm-focus-ring: rgba(0,119,188,0.15);
  --dm-accent: #24b9d5;
  --dm-link: #0077bc;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-family: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-size: 16px; color: #353535; background: #f4f4f4; }
h1, h2, h3, .navbar-brand { font-family: "Bitter", Georgia, serif; }
a { color: var(--dm-link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Container ── */
.container { max-width: 960px; margin: 0 auto; padding: 24px 16px; }

/* ── Navbar (charte Daniel Moquet : fond blanc, rouge #e0332a, vert #00a94f) ── */
.navbar { background: #fff; color: #353535; padding: 0 16px; border-bottom: 3px solid var(--dm-primary); box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.navbar-inner { max-width: 960px; margin: 0 auto; display: flex; align-items: center; height: 62px; gap: 24px; }
.navbar-brand { display: flex; align-items: center; }
.navbar-brand:hover { text-decoration: none; }
.brand-hz { height: 54px; width: auto; display: block; margin: -6px 0; }
/* le SVG clôtures a moins de marge interne (encre 73 % vs 58 %) — hauteur réduite pour une encre visuelle égale */
body.theme-cloture .brand-hz { height: 43px; margin: 0; }
/* le SVG piscines n'a aucune marge interne (encre 100 % du viewBox) — même encre visuelle (~32px) que les deux autres */
body.theme-piscine .brand-hz { height: 32px; margin: 0; }
.navbar-links { display: flex; gap: 4px; align-self: stretch; align-items: stretch; }
.navbar-links a { color: #4d4d4d; font-size: 14px; font-weight: 700; display: flex; align-items: center; padding: 0 12px; border-bottom: 3px solid transparent; margin-bottom: -3px; }
.navbar-links a:hover { color: #353535; text-decoration: none; background: #f4f4f4; }
/* Onglet actif : le texte reste gris foncé (12:1) car aucune couleur d'univers
   ne passe le contraste AA en 14px gras — le jaune clôtures plafonne à 1,9:1.
   L'identité d'univers passe par le fond teinté et le soulignement. */
.navbar-links a.active { color: #353535; background: var(--dm-tint); border-bottom-color: var(--dm-primary-dark); }
.navbar-links a.active:hover { background: var(--dm-tint); }
/* Historique et Admin sont transverses aux univers : marquage neutre, jamais
   la couleur de l'univers courant. */
.navbar-links a.nav-generic.active { color: #353535; background: #e8e8e8; border-bottom-color: #8c8c8c; }
.navbar-links a.nav-generic.active:hover { background: #e8e8e8; }

.subcategory-title { font-size: 15px; font-weight: 600; color: #444; margin: 18px 0 10px; }
.subcategory-title:first-of-type { margin-top: 0; }
.navbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.navbar-user { font-size: 13px; color: #717171; }
.btn-logout { background: none; border: 1px solid #d6d6d6; color: #4d4d4d; padding: 4px 12px; border-radius: 4px; font-size: 13px; cursor: pointer; }
.btn-logout:hover { border-color: var(--dm-link); color: var(--dm-link); }

/* ── Flash ── */
.flash { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; font-size: 14px; }
.flash-notice { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }
.flash-alert { background: #fbe9e7; color: #c62828; border: 1px solid #ffccbc; }

/* ── Auth pages ── */
.auth-wrapper { display: flex; justify-content: center; align-items: center; min-height: 80vh; }
.auth-card { background: #fff; border-radius: 12px; box-shadow: 0 2px 12px rgba(0,0,0,0.08); padding: 40px; width: 100%; max-width: 420px; }
.auth-card h1 { font-size: 24px; margin-bottom: 4px; text-align: center; }
.auth-card .subtitle { font-size: 14px; color: #888; text-align: center; margin-bottom: 24px; }
.auth-card .brand { font-size: 16px; font-weight: 700; color: #e0332a; text-align: center; display: block; margin-bottom: 16px; }
.auth-logo { display: block; width: 150px; margin: 0 auto 20px; }

/* ── Forms ── */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; color: #333; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 15px;
  transition: border-color 0.15s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--dm-primary); box-shadow: 0 0 0 2px var(--dm-focus-ring);
}
.form-errors { background: #fbe9e7; border: 1px solid #ffccbc; border-radius: 6px; padding: 12px 16px; margin-bottom: 16px; font-size: 14px; color: #c62828; }
.form-errors ul { margin: 4px 0 0 16px; }

/* ── Buttons ── */
.btn { display: inline-block; padding: 10px 20px; border-radius: 6px; font-size: 15px; font-weight: 600; cursor: pointer; border: none; text-align: center; transition: background 0.15s; }
.btn-primary { background: var(--dm-primary); color: var(--dm-primary-contrast); }
.btn-primary:hover { background: var(--dm-primary-dark); text-decoration: none; }
.btn-secondary { background: #eee; color: #333; }
.btn-secondary:hover { background: #ddd; }

.auth-card .btn-primary { width: 100%; }
.btn-generate { width: 100%; }

/* ── Links under forms ── */
.auth-links { text-align: center; margin-top: 16px; font-size: 13px; color: #888; }
.auth-links a { color: var(--dm-link); }

/* ── Visualizer ── */
.visualizer h1 { margin-bottom: 24px; }
.viz-section { background: #fff; border-radius: 10px; padding: 24px; margin-bottom: 16px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.viz-section h2 { font-size: 16px; color: #666; margin-bottom: 16px; }
.hidden { display: none !important; }

/* Upload zone */
.upload-zone { border: 2px dashed #ddd; border-radius: 10px; padding: 40px 20px; text-align: center; transition: border-color 0.2s, background 0.2s; }
.upload-zone:hover, .upload-zone.dragover { border-color: var(--dm-primary); background: var(--dm-tint); }
.upload-zone.has-image { border-style: solid; border-color: #ccc; padding: 12px; }
.upload-placeholder { color: #999; }
.upload-placeholder p { font-size: 15px; margin: 12px 0 4px; font-weight: 600; color: #333; }
.upload-placeholder span { font-size: 12px; }
.upload-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 14px 0 8px; }
.upload-preview { max-width: 100%; max-height: 400px; border-radius: 8px; display: block; margin: 0 auto; }

/* Products grid */
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; }
.product-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 8px; border: 2px solid #eee; border-radius: 10px; background: #fff; cursor: pointer; transition: all 0.15s; }
.product-card:hover { border-color: #ccc; background: #fafafa; }
.product-card.selected { border-color: var(--dm-primary); background: var(--dm-tint); }
.product-icon { width: 36px; height: 36px; }
.product-icon svg { width: 100%; height: 100%; }
.product-name { font-size: 11px; font-weight: 600; text-align: center; line-height: 1.2; color: #333; }

/* Variants */
.variant-group { margin-bottom: 16px; }
.variant-group h3 { font-size: 13px; font-weight: 600; color: #666; margin-bottom: 8px; }
.variants-row { display: flex; flex-wrap: wrap; gap: 8px; }
.variant-chip { display: flex; align-items: center; gap: 6px; padding: 6px 12px; border: 2px solid #eee; border-radius: 20px; background: #fff; cursor: pointer; transition: all 0.15s; font-size: 13px; }
.variant-chip:hover { border-color: #ccc; }
.variant-chip.selected { border-color: var(--dm-primary); background: var(--dm-tint); }
.variant-swatch { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(0,0,0,0.1); flex-shrink: 0; }
.variant-label { color: #333; }

/* Actions */
.viz-actions { margin-top: 8px; }
.btn-generate { font-size: 16px; padding: 14px 24px; }
.btn-generate:disabled { background: #ccc; cursor: not-allowed; }

/* ── Generation result ── */
.generation-page { max-width: 700px; margin: 0 auto; }
.generation-header { margin-bottom: 20px; }
.generation-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.badge { display: inline-block; background: #f0f0f0; padding: 4px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; color: #333; }
.generation-date { font-size: 13px; color: #888; }

/* Loading */
.generation-loading { text-align: center; padding: 60px 20px; }
.generation-loading p { font-size: 16px; font-weight: 600; margin-top: 16px; }
.generation-loading span { font-size: 13px; color: #888; }
.spinner { width: 40px; height: 40px; border: 3px solid #eee; border-top-color: var(--dm-primary); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Compare slider */
.compare-container { position: relative; overflow: hidden; border-radius: 10px; user-select: none; -webkit-user-select: none; }
.compare-container img { display: block; width: 100%; }
.compare-before { position: relative; z-index: 1; }
.compare-after { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 2; clip-path: inset(0 0 0 50%); }
.compare-slider { position: absolute; top: 0; left: 50%; width: 4px; height: 100%; z-index: 3; cursor: ew-resize; transform: translateX(-50%); }
.compare-slider-line { width: 2px; height: 100%; background: #fff; margin: 0 auto; box-shadow: 0 0 4px rgba(0,0,0,0.3); }
.compare-slider-button { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 40px; height: 40px; background: var(--dm-primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.compare-labels { display: flex; justify-content: space-between; padding: 8px 4px 0; font-size: 13px; color: #888; font-weight: 600; }

/* Timing & download */
.generation-timing { text-align: center; font-size: 13px; color: #888; margin-top: 12px; }
.generation-download { text-align: center; margin-top: 16px; }
.generation-download .btn { width: auto; }
.generation-actions { display: flex; gap: 12px; margin-top: 24px; justify-content: center; }
.generation-actions .btn { width: auto; }

/* Error */
.generation-error { text-align: center; padding: 40px 20px; }
.generation-error p { font-size: 16px; font-weight: 600; color: #c62828; margin-bottom: 8px; }
.error-detail { font-size: 13px; color: #888; display: block; margin-bottom: 16px; }
.generation-error .btn { width: auto; }

/* ── History page ── */
.history-page { }
.history-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.history-header h1 { margin: 0; }
.btn-sm { padding: 6px 14px; font-size: 13px; }

/* Filters */
.history-filters { background: #fff; border-radius: 10px; padding: 16px; margin-bottom: 16px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.filters-row { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.filter-group { flex: 1; min-width: 140px; }
.filter-input, .filter-select { width: 100%; padding: 8px 10px; border: 1px solid #ddd; border-radius: 6px; font-size: 13px; }
.filter-input:focus, .filter-select:focus { outline: none; border-color: var(--dm-primary); }
.filter-date { min-width: 120px; }
.filter-actions { display: flex; gap: 8px; align-items: center; }
.btn-link { font-size: 13px; color: var(--dm-link); background: none; border: none; cursor: pointer; padding: 0; }
.btn-link:hover { text-decoration: underline; }

/* Results count */
.history-count { font-size: 13px; color: #888; margin-bottom: 12px; }

/* Generations list (history) */
.generations-list { display: grid; gap: 12px; }
.generation-card { display: flex; gap: 16px; background: #fff; border-radius: 10px; padding: 16px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); text-decoration: none; color: inherit; transition: box-shadow 0.15s; }
.generation-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.1); text-decoration: none; }
.generation-card-images { flex-shrink: 0; }
.generation-card-thumb { width: 90px; height: 90px; border-radius: 8px; object-fit: cover; display: block; }
.generation-card-placeholder { background: #f5f5f7; display: flex; align-items: center; justify-content: center; }
.generation-card-body { flex: 1; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.generation-card-top { display: flex; justify-content: space-between; align-items: start; gap: 8px; }
.generation-card-products { font-size: 14px; margin-bottom: 2px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.generation-card-client { font-size: 13px; color: #555; margin-top: 2px; }
.generation-card-meta { font-size: 12px; color: #888; margin-top: 4px; display: flex; gap: 4px; }
.generation-card-status { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 8px; height: fit-content; white-space: nowrap; }

/* Suppression depuis la liste : le formulaire est un frère du lien de carte
   (form imbriqué dans <a> = HTML invalide), positionné en bas à droite pour
   ne pas recouvrir le badge de statut, lui en haut à droite. */
.generation-card-wrap { position: relative; }
.generation-card-delete-form { position: absolute; right: 10px; bottom: 10px; margin: 0; }
.generation-card-delete {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0;
  background: #fff; border: 1px solid #e0e0e0; border-radius: 8px;
  color: #aaa; font-size: 13px; line-height: 1; cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.generation-card-delete:hover { color: #c62828; border-color: #c62828; background: #fbe9e7; }
.generation-card-delete:focus-visible { outline: 2px solid #c62828; outline-offset: 2px; }
/* Réserve la place du bouton pour qu'aucun texte ne passe dessous. */
.generation-card-client, .generation-card-meta { padding-right: 44px; }
.status-completed { background: #e8f5e9; color: #2e7d32; }
.status-pending, .status-processing { background: #fff3e0; color: #e65100; }
.status-failed { background: #fbe9e7; color: #c62828; }

/* Empty state */
.history-empty { text-align: center; padding: 60px 20px; color: #888; }
.history-empty p { font-size: 15px; margin: 12px 0 16px; }

/* Pagination */
.pagination { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 24px; padding: 16px 0; }
.pagination-link { font-size: 14px; color: var(--dm-link); font-weight: 600; }
.pagination-link:hover { text-decoration: underline; }
.pagination-info { font-size: 13px; color: #888; }

/* Generation show header */
.generation-header-top { display: flex; justify-content: space-between; align-items: center; }
.generation-client-info { margin-top: 12px; background: #f9f9f9; padding: 12px 16px; border-radius: 8px; font-size: 14px; }
.generation-client-info p { margin-bottom: 4px; }
.generation-client-info p:last-child { margin-bottom: 0; }

/* Delete button */
.btn-danger { background: #fff; color: #c62828; border: 1px solid #e0e0e0; }
.btn-danger:hover { background: #fbe9e7; border-color: #c62828; }

/* Form row */
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }
.form-input { width: 100%; padding: 10px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; }
.form-input:focus { outline: none; border-color: var(--dm-primary); box-shadow: 0 0 0 2px var(--dm-focus-ring); }
.form-textarea { width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; font-family: inherit; min-height: 100px; resize: vertical; line-height: 1.5; }
.form-textarea:focus { outline: none; border-color: var(--dm-primary); box-shadow: 0 0 0 2px var(--dm-focus-ring); }
.form-textarea::placeholder { color: #999; }
.variants-label { font-size: 13px; font-weight: 600; color: #666; margin: 16px 0 8px; }
.optional-label { font-size: 12px; font-weight: 400; color: #999; }

/* ── Responsive ── */
/* Navbar mobile : les onglets défilent horizontalement (sans wrap ni débordement
   de page), le nom d'utilisateur est masqué, Déconnexion reste accessible. */
@media (max-width: 700px) {
  .navbar { padding: 0 10px; }
  .navbar-inner { gap: 10px; height: 56px; }
  .brand-hz { height: 40px; margin: -4px 0; }
  body.theme-cloture .brand-hz { height: 32px; margin: 0; }
  body.theme-piscine .brand-hz { height: 24px; margin: 0; }
  .navbar-user { display: none; }
  .navbar-links { flex: 1; min-width: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .navbar-links::-webkit-scrollbar { display: none; }
  .navbar-links a { padding: 0 8px; font-size: 13px; white-space: nowrap; }
  .navbar-right { margin-left: 0; flex-shrink: 0; }
  .btn-logout { padding: 4px 10px; white-space: nowrap; }
}

@media (max-width: 600px) {
  .auth-card { padding: 24px 20px; margin: 16px; }
  .navbar-user { display: none; }
  .products-grid { grid-template-columns: repeat(3, 1fr); }
  .generation-card { flex-direction: column; }
  .generation-card-thumb { width: 100%; height: 160px; }
  .filters-row { flex-direction: column; }
  .filter-group { min-width: 100%; }
  .history-header { flex-direction: column; gap: 12px; align-items: stretch; }
  .form-row { flex-direction: column; }
  .generation-header-top { flex-direction: column; gap: 8px; }
}

/* ── Admin — Reference images ── */
.admin-page { max-width: 960px; margin: 0 auto; }
.admin-header { margin-bottom: 24px; }
.admin-header h1 { font-size: 22px; margin-bottom: 6px; }
.admin-subtitle { color: #666; font-size: 14px; line-height: 1.5; }
.admin-subtitle small { color: #999; font-size: 12px; }

.admin-product { background: #fff; border-radius: 10px; padding: 20px; margin-bottom: 16px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.admin-product-header { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.admin-product-title { font-size: 18px; color: #1a1a2e; flex: 1; margin-bottom: 0; }
.admin-product-title--off { color: #999; }
.admin-type-badge {
  display: inline-block; margin-left: 8px; padding: 2px 8px;
  font-size: 11px; font-weight: 600; color: #555;
  background: #eee; border-radius: 10px; vertical-align: middle;
}
.admin-visibility-hint { color: #666; font-size: 13px; margin: 14px 0 4px; }

.toggle-form { display: inline-flex; }
.toggle-switch {
  position: relative; width: 44px; height: 24px; flex: 0 0 44px;
  border: none; border-radius: 12px; background: #c4c4c4;
  cursor: pointer; padding: 0; transition: background 0.15s ease;
}
.toggle-switch.on { background: #2a9d2f; }
.toggle-knob {
  position: absolute; top: 2px; left: 2px; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: left 0.15s ease;
}
.toggle-switch.on .toggle-knob { left: 22px; }
.admin-product-delete { background: none; border: none; color: #999; cursor: pointer; font-size: 13px; padding: 2px 6px; line-height: 1; }
.admin-product-delete:hover { color: #e0332a; }
.admin-product-delete form { margin: 0; padding: 0; display: inline; }

.admin-variants { display: flex; flex-direction: column; gap: 16px; }
.admin-variant { padding-top: 12px; border-top: 1px solid #eee; }
.admin-variant:first-child { border-top: none; padding-top: 0; }
.admin-variant-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.admin-variant-header h3 { font-size: 15px; font-weight: 600; flex: 1; }
.admin-swatch { display: inline-block; width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(0,0,0,0.1); flex-shrink: 0; }
.admin-count { font-size: 12px; color: #999; }
.admin-variant-delete { background: none; border: none; color: #999; cursor: pointer; font-size: 13px; padding: 2px 6px; line-height: 1; }
.admin-variant-delete:hover { color: #e0332a; }
.admin-variant-delete form { margin: 0; padding: 0; display: inline; }

.admin-add-product { background: #fff; border-radius: 10px; padding: 16px 20px; margin-bottom: 16px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.admin-add-product summary { cursor: pointer; font-weight: 600; font-size: 14px; color: #1a1a2e; }
.admin-add-product .admin-form { margin-top: 14px; }

.admin-add-variant { margin-top: 16px; padding-top: 12px; border-top: 1px solid #eee; }
.admin-add-variant summary { cursor: pointer; font-weight: 600; font-size: 13px; color: #666; }
.admin-add-variant .admin-form { margin-top: 12px; }

.admin-form-checks { align-items: center; margin-bottom: 16px; }
.admin-check { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 400; color: #333; }
.admin-check input { width: auto; }

.ref-panel { background: #fafafa; border-radius: 8px; padding: 12px; }
.ref-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-bottom: 12px; }
.ref-thumb { position: relative; aspect-ratio: 1 / 1; border-radius: 6px; overflow: hidden; background: #eee; }
.ref-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ref-thumb-fallback { display: flex; align-items: center; justify-content: center; height: 100%; font-size: 24px; color: #999; }
.ref-thumb-delete { position: absolute; top: 4px; right: 4px; background: rgba(0,0,0,0.7); color: #fff; border: none; width: 24px; height: 24px; border-radius: 50%; cursor: pointer; font-size: 12px; line-height: 1; padding: 0; display: flex; align-items: center; justify-content: center; }
.ref-thumb-delete:hover { background: #e0332a; }
.ref-thumb-delete form { margin: 0; padding: 0; }

.ref-empty { color: #999; font-size: 13px; font-style: italic; padding: 8px 4px 12px; }

.ref-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ref-upload-label { flex: 1; min-width: 200px; display: inline-block; cursor: pointer; }
.ref-upload-label input[type="file"] { display: block; width: 100%; font-size: 13px; padding: 6px 0; }
.ref-upload-text { display: none; }

@media (max-width: 600px) {
  .admin-product { padding: 16px; }
  .ref-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 6px; }
  .ref-form { flex-direction: column; align-items: stretch; }
  .ref-upload-label { min-width: 0; }
}

/* ── Zone editor ── */
.preview-wrap { position: relative; display: inline-block; max-width: 100%; }
.zone-canvas { position: absolute; inset: 0; pointer-events: none; touch-action: none; border-radius: 8px; }
.zone-canvas.drawing { pointer-events: auto; cursor: crosshair; }
.zone-canvas.selectable { pointer-events: auto; touch-action: auto; }

.zone-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.zone-toolbar .active { background: var(--dm-primary); color: var(--dm-primary-contrast); border-color: var(--dm-primary); }
.zone-drawing-actions { display: inline-flex; gap: 6px; }
.zone-hint { color: #999; font-size: 12px; margin-top: 6px; }
.btn-reset { color: #e0332a; background: #fff; border: 1px solid #f3c2ca; }
.btn-reset:hover { background: #fef2f2; }

.zone-picker { background: #fafafa; border: 1px solid #eee; border-radius: 10px; padding: 16px; margin-top: 14px; }
.zone-picker-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.zone-picker-header h3 { font-size: 15px; font-weight: 600; flex: 1; }
.zone-remove { background: none; border: none; color: #e0332a; cursor: pointer; font-size: 13px; }

.seam-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.seam-item { background: #fff; border: 1px solid #ddd; border-radius: 14px; padding: 3px 10px; font-size: 13px; }
.seam-remove { background: none; border: none; cursor: pointer; color: #999; }
.seam-remove:hover { color: #e0332a; }

@media (max-width: 600px) {
  .zone-toolbar { gap: 6px; }
  .zone-picker { padding: 12px; }
}

.border-type-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.border-type-card { padding: 8px 14px; }
