@import url(https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap);
/* PvPilot Studio — minimal style aligned with my.pvpilot.fr (Inter, blue primary) */

:root {
  /* Palette PvPilot (alignée my.pvpilot.fr) */
  --pv-yellow: #ffd30b;
  --pv-yellow-soft: #ffe999;
  --pv-yellow-bg: #fffbe6;
  --pv-yellow-dark: #e6be0a;
  --pv-yellow-muted: #8e7923;
  --pv-yellow-text: #eab308;
  --pv-bg: #fbf5f1;       /* warm sand */
  --pv-card: #ffffff;
  --pv-border: rgba(0, 0, 0, .08);
  --pv-black: #1c1c1c;
  /* Aliases */
  --blue-50:  var(--pv-yellow-bg);
  --blue-100: var(--pv-yellow-soft);
  --blue-500: var(--pv-yellow);
  --blue-600: var(--pv-yellow);
  --blue-700: var(--pv-yellow-dark);
  --slate-50: var(--pv-bg);
  --slate-100: #efe7df;
  --slate-200: var(--pv-border);
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: rgba(28, 28, 28, .55);
  --slate-600: rgba(28, 28, 28, .65);
  --slate-700: rgba(28, 28, 28, .8);
  --slate-800: var(--pv-black);
  --slate-900: var(--pv-black);
  --green-500: #10b981;
  --amber-500: #f59e0b;
  --red-500: #ef4444;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: none;
  --shadow: none;
  --shadow-lg: none;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--slate-800);
  background: var(--slate-50);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; color: var(--slate-900); font-weight: 600; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.05rem; }
p { margin: 0; color: var(--slate-500); }
small { color: var(--slate-500); }

/* Top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--pv-bg);
  border-bottom: 1px solid var(--pv-border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--pv-yellow-text);
  font-size: 1.05rem;
}
.brand em { font-style: normal; color: rgba(28, 28, 28, .55); font-weight: 400; margin-left: 4px; }
.topbar-actions { display: flex; gap: 18px; align-items: center; }
.topbar-actions .nav-link {
  font-size: .9rem;
  font-weight: 500;
  color: rgba(28, 28, 28, .65);
  text-decoration: none;
  transition: color .15s;
}
.topbar-actions .nav-link:hover { color: var(--pv-black); }
.topbar-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 10px;
  background: var(--pv-yellow);
  color: var(--pv-black);
  font-weight: 500;
  font-size: .9rem;
  text-decoration: none;
  border: 0;
  transition: background .2s ease;
}
.topbar-actions .btn:hover { background: var(--pv-yellow-dark); }
.topbar-actions .btn i { font-size: 1rem; }

/* ---- Écrans d'auth (rendus par common/auth.js) --------------------------- */
.auth-main {
  min-height: calc(100vh - 220px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.auth-card {
  background: #fff;
  border-radius: var(--radius, 16px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, .06);
  padding: 40px 32px;
  max-width: 460px;
  width: 100%;
  text-align: center;
}
.auth-logo {
  margin-bottom: 16px;
}
.auth-card h1 {
  font-size: 1.6rem;
  margin: 0 0 12px;
  color: var(--pv-black, #111);
}
.auth-lead {
  font-size: 1rem;
  color: var(--slate-700, #334155);
  margin: 0 0 20px;
  line-height: 1.5;
}
.auth-note {
  font-size: .88rem;
  color: #b91c1c;
  background: rgba(220, 38, 38, .06);
  border-left: 3px solid #dc2626;
  padding: 10px 12px;
  border-radius: 6px;
  margin: 0 0 20px;
  text-align: left;
}
.auth-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 12px;
  background: var(--pv-yellow, #ffd30b);
  color: var(--pv-black, #111);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  transition: background .2s ease, transform .1s ease;
  min-width: 200px;
}
.auth-cta:hover { background: var(--pv-yellow-dark, #eebf00); }
.auth-cta:active { transform: translateY(1px); }
.auth-help {
  font-size: .88rem;
  color: var(--slate-600, #64748b);
  margin: 20px 0 0;
}
.auth-help a {
  color: var(--pv-black, #111);
  font-weight: 600;
}

/* User badge + logout — injectés par common/auth.js */
.topbar-actions .user-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-right: 12px;
  border-right: 1px solid rgba(0, 0, 0, .08);
  margin-right: 4px;
}
.topbar-actions .user-badge {
  font-size: .82rem;
  font-weight: 600;
  color: var(--slate-700, #334155);
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--pv-yellow-soft, #fff6c9);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar-actions .user-logout {
  font-size: .82rem;
}

@media (max-width: 640px) {
  .topbar-actions .user-badge { max-width: 100px; }
  .topbar-actions .user-logout { display: inline; }
  .topbar { padding: 10px 12px; gap: 8px; }
  .brand { font-size: .95rem; gap: 8px; min-width: 0; }
  .brand img { width: 28px; height: 28px; }
  .brand em { display: none; }
  .topbar-actions { gap: 12px; flex-shrink: 0; }
  .topbar-actions .nav-link { display: none; }
  .topbar-actions .user-logout { display: inline; }
  .topbar-actions .btn span { display: none; }
  .topbar-actions .btn { padding: 8px 12px; }
}

/* Layout */
main {
  max-width: 920px;
  margin: 0 auto;
  padding: 24px 16px 80px;
}
.hero { margin-bottom: 24px; }
.hero p { margin-top: 6px; max-width: 60ch; }

.footer {
  text-align: center;
  padding: 16px;
  color: var(--slate-400);
  font-size: .85rem;
  border-top: 1px solid var(--slate-200);
}

/* Step card */
.step {
  background: transparent;
  border: 1px solid var(--pv-border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.step-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}
.step-num {
  flex: 0 0 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--blue-50);
  color: var(--slate-800);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: .9rem;
}
.step-num.done { background: var(--green-500); color: #fff; }
.step-head h2 { margin-bottom: 2px; }

/* Grids */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 640px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); gap: 8px; }
}
@media (max-width: 380px) {
  .grid-3 { grid-template-columns: 1fr; }
}

/* Choice cards (radio) */
.choices { display: grid; gap: 12px; }
.choice { display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice-card {
  border: 1px solid var(--pv-border);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
  background: transparent;
  transition: all .15s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.choice-card .icon {
  width: 36px;
  height: 36px;
  font-size: 32px;
  line-height: 36px;
  color: var(--slate-400);
  transition: color .15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.choice-card i.icon { font-style: normal; }
.choice-card strong { color: var(--slate-800); font-weight: 600; }
.choice input:checked + .choice-card {
  border-color: var(--pv-yellow);
  background: transparent;
  box-shadow: none;
}
.choice input:checked + .choice-card .icon { color: var(--pv-dark); }
.choice:hover .choice-card { border-color: var(--pv-yellow-soft); }

/* Fields */
.sub {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 640px) { .sub { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 4px; }
.field > span { font-size: .85rem; color: var(--slate-600); font-weight: 500; }
.field input, .field select {
  border: 1px solid var(--pv-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font: inherit;
  background: transparent;
  color: var(--slate-800);
  width: 100%;
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--blue-500);
  box-shadow: none;
}
.input-suffix {
  display: flex;
  align-items: center;
  border: 1px solid var(--pv-border);
  border-radius: var(--radius-sm);
  background: transparent;
  overflow: hidden;
}
.input-suffix input { border: 0; padding: 10px 12px; flex: 1; background: transparent; }
.input-suffix span {
  padding: 0 12px;
  color: var(--slate-500);
  background: transparent;
  border-left: 1px solid var(--pv-border);
  align-self: stretch;
  display: grid;
  place-items: center;
  font-size: .85rem;
}

/* Counters / Boards list */
.counters { display: flex; flex-direction: column; gap: 10px; }
.counter-row, .board-row {
  display: grid;
  gap: 8px;
  align-items: center;
  background: transparent;
  border: 1px solid var(--pv-border);
  border-radius: var(--radius-sm);
  padding: 10px;
}
.counter-row { grid-template-columns: 1fr 130px 36px; }
.board-row   { grid-template-columns: 1fr 130px 90px 180px 36px; }
.board-row.main {
  background: transparent;
  border-color: var(--pv-yellow);
}
.board-row .main-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 2px;
}
.board-row .main-label .tag {
  background: var(--pv-yellow);
  color: var(--pv-black);
  font-size: .7rem;
  font-weight: 400;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.board-row .main-label strong { color: var(--slate-800); font-weight: 600; }
.counter-row select, .counter-row input,
.board-row select, .board-row input {
  border: 1px solid var(--pv-border);
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
  background: transparent;
  min-width: 0;
}
.counter-row .del, .board-row .del {
  width: 36px; height: 36px;
  border: 0;
  background: transparent;
  color: var(--slate-400);
  border-radius: 6px;
  cursor: pointer;
}
.counter-row .del:hover, .board-row .del:hover {
  color: var(--red-500); background: #fef2f2;
}
.board-row .del-placeholder { width: 36px; height: 36px; }
.pv-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 10px;
  border: 1px solid var(--pv-border);
  border-radius: 999px;
  background: transparent;
  font-size: .8rem;
  font-weight: 600;
  color: var(--slate-600);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: border-color .15s, background .15s;
}
.pv-toggle:has(input:checked) {
  border-color: var(--pv-yellow);
  background: transparent;
  color: var(--pv-black);
}
.pv-toggle-label { line-height: 1; }
.pv-toggle-switch {
  position: relative;
  width: 34px;
  height: 18px;
  flex-shrink: 0;
}
.pv-toggle-switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}
.pv-toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--slate-300);
  border-radius: 999px;
  transition: background .18s ease;
  pointer-events: none;
}
.pv-toggle-slider::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
  transition: transform .18s ease;
}
.pv-toggle input:checked + .pv-toggle-slider { background: var(--blue-600); }
.pv-toggle input:checked + .pv-toggle-slider::before { transform: translateX(16px); }
.pv-toggle.locked { cursor: default; opacity: .85; }
.pv-toggle.locked .pv-toggle-switch input { cursor: not-allowed; }

@media (max-width: 600px) {
  .board-row { grid-template-columns: 1fr 1fr 36px; }
  .board-row > [name="bbreaker"] { grid-column: 1 / -1; }
  .board-row > .pv-toggle { grid-column: 1 / -1; justify-content: space-between; }
  .board-row.main .main-label { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .counter-row { grid-template-columns: 1fr 1fr 36px; }
}

.add-btn {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: var(--pv-yellow-soft);
  color: var(--pv-black);
  padding: 8px 16px;
  border-radius: 8px;
  font: inherit;
  font-weight: 400;
  font-size: .875rem;
  cursor: pointer;
  transition: background .2s ease;
}
.add-btn:hover { background: var(--pv-yellow); }
.add-btn i { font-size: 1rem; }

/* Presets */
.presets-wrap { display: flex; flex-direction: column; gap: 20px; }
.preset-group { display: flex; flex-direction: column; gap: 10px; }
.preset-group-title {
  margin: 0;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--slate-500);
  padding-left: 4px;
}
.presets { gap: 12px; }
.preset {
  border: 1px solid var(--pv-border);
  border-radius: var(--radius-sm);
  background: transparent;
  transition: all .15s ease;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-self: start;
}
.preset.active {
  border-color: var(--pv-yellow);
  background: transparent;
  box-shadow: none;
}
.preset.locked .preset-head { cursor: default; }
.preset.locked::after {
  content: "🔒";
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: .75rem;
  opacity: .55;
}
.preset.locked { position: relative; }
.preset-head {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 10px;
  align-items: center;
  padding: 12px;
}
.preset-head .icon {
  width: 24px; height: 24px;
  font-size: 20px;
  line-height: 24px;
  color: var(--slate-400);
  transition: color .15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-style: normal;
}
.preset.active .preset-head .icon { color: var(--blue-700); }
.preset-text { display: flex; flex-direction: column; min-width: 0; }
.preset-text strong { font-size: .92rem; font-weight: 600; color: var(--slate-800); line-height: 1.2; }
.preset.active .preset-text strong { color: var(--slate-800); }
.preset-text small { font-size: .75rem; line-height: 1.2; margin-top: 2px; }
.preset-head .qty {
  display: none;
  align-items: center;
  gap: 4px;
  background: #fff;
  border: 1px solid var(--blue-100);
  border-radius: 999px;
  padding: 2px;
  grid-column: 1 / -1;
  justify-self: flex-start;
  margin-top: 6px;
}
.preset.active .preset-head .qty { display: inline-flex; }
.preset-head .qty button {
  width: 24px; height: 24px; border: 0;
  background: var(--blue-50); color: var(--slate-800);
  border-radius: 50%; cursor: pointer; font-weight: 700;
}
.preset-head .qty button:hover { background: var(--blue-100); }
.preset-head .qty span { min-width: 18px; text-align: center; font-weight: 600; font-size: .85rem; color: var(--slate-800); }

@media (max-width: 640px) {
  .preset-head {
    grid-template-columns: 32px 1fr;
  }
}

.preset-options {
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(255, 211, 11, .35);
  background: transparent;
}
.preset.active .preset-options { display: flex; }
.preset.active .preset-options.empty { display: none; }
.preset-options .opt {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .8rem;
  color: var(--slate-600);
  cursor: pointer;
}
.preset-options .opt select {
  flex: 1;
  border: 1px solid var(--pv-border);
  border-radius: 6px;
  padding: 4px 6px;
  font: inherit;
  font-size: .8rem;
  background: transparent;
}
.preset-options .opt-mesure input[type="checkbox"] {
  accent-color: var(--blue-600);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* Legacy Loads (compat) */
.loads { gap: 10px; }
.load {
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-sm);
  padding: 12px 8px;
  background: #fff;
  text-align: center;
  cursor: pointer;
  transition: all .15s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  user-select: none;
}
.load .icon { width: 36px; height: 36px; color: var(--slate-400); transition: color .15s; }
.load strong { font-size: .9rem; font-weight: 600; color: var(--slate-700); }
.load small { font-size: .75rem; line-height: 1.2; }
.load.active {
  border-color: var(--pv-yellow);
  background: var(--blue-50);
  box-shadow: none;
}
.load.active .icon, .load.active strong { color: var(--slate-800); }
.load .qty {
  margin-top: 4px;
  display: none;
  align-items: center;
  gap: 4px;
  background: #fff;
  border: 1px solid var(--blue-100);
  border-radius: 999px;
  padding: 2px;
}
.load.active .qty { display: inline-flex; }
.load .qty button {
  width: 24px; height: 24px; border: 0;
  background: var(--blue-50); color: var(--slate-800);
  border-radius: 50%; cursor: pointer; font-weight: 700;
}
.load .qty button:hover { background: var(--blue-100); }
.load .qty span { min-width: 18px; text-align: center; font-weight: 600; font-size: .85rem; color: var(--slate-800); }

/* Toggle cards (battery / EV) */
.toggle-card {
  border: 1px solid var(--pv-border);
  border-radius: var(--radius-sm);
  background: transparent;
  overflow: hidden;
  transition: border-color .15s;
}
.toggle-card.on { border-color: var(--pv-yellow); box-shadow: none; }
.toggle-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
}
.toggle-head .icon { width: 30px; height: 30px; flex-shrink: 0; color: var(--slate-400); }
.toggle-card.on .toggle-head .icon { color: var(--blue-600); }
.toggle-head > div:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.toggle-head strong { color: var(--slate-800); font-size: .95rem; }
.toggle-head small { font-size: .8rem; }
.toggle-body {
  border-top: 1px solid var(--pv-border);
  padding: 14px;
  display: none;
  background: transparent;
}
.toggle-card.on .toggle-body { display: block; }

/* Switch */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span {
  position: absolute; inset: 0;
  background: var(--slate-300);
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s;
}
.switch span::before {
  content: "";
  position: absolute;
  width: 18px; height: 18px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform .15s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.switch input:checked + span { background: var(--blue-600); }
.switch input:checked + span::before { transform: translateX(20px); }

/* Stepper */
.stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  background: #fff;
  overflow: hidden;
  width: fit-content;
}
.stepper button {
  width: 36px; height: 40px;
  border: 0; background: var(--slate-50);
  font-size: 1.2rem; font-weight: 600; color: var(--slate-700);
  cursor: pointer;
}
.stepper button:hover { background: var(--slate-100); color: var(--blue-600); }
.stepper input {
  width: 48px;
  text-align: center;
  border: 0;
  border-left: 1px solid var(--slate-200);
  border-right: 1px solid var(--slate-200);
  padding: 10px 0;
  font: inherit;
  font-weight: 600;
  -moz-appearance: textfield;
}
.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Buttons (style my.pvpilot.fr : pilule jaune pleine) */
button.primary, button.ghost, a.ghost, a.primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 8px;
  padding: 8px 16px;
  font: inherit;
  font-weight: 400;
  font-size: .875rem;
  cursor: pointer;
  border: 0;
  transition: background .2s ease;
  text-decoration: none;
}
button.primary, a.primary {
  background: var(--pv-yellow);
  color: var(--pv-black);
}
button.primary:hover, a.primary:hover { background: var(--pv-yellow-dark); }
button.ghost, a.ghost {
  background: var(--pv-yellow-soft);
  color: var(--pv-black);
}
button.ghost:hover, a.ghost:hover { background: var(--pv-yellow); }
button.ghost i, a.ghost i { font-size: 1rem; }

.actions-bar {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
}
.actions-bar.end { justify-content: flex-end; flex-wrap: wrap; }
.actions-bar button.primary { padding: 14px 24px; font-size: 1rem; }

/* Result */
.result {
  background: transparent;
  border: 1px solid var(--pv-border);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 24px;
  box-shadow: var(--shadow);
  animation: slideIn .25s ease;
}
.result.hidden { display: none; }
@keyframes slideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.bom { display: flex; flex-direction: column; gap: 18px; }
.bom-board {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--pv-border);
  border-radius: var(--radius-sm);
  padding: 12px 12px 14px;
  background: transparent;
}
.bom-board-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--slate-200);
}
.bom-board-head strong {
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--slate-700);
}
.bom-board-sub {
  font-size: .82rem;
  color: var(--slate-500);
  font-weight: 500;
}
.bom-board-list { display: flex; flex-direction: column; gap: 8px; }
.bom-item {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  background: transparent;
  border: 1px solid var(--pv-border);
  border-radius: var(--radius-sm);
}
.bom-item .ic {
  width: 48px; height: 48px;
  border-radius: 10px;
  background: var(--pv-yellow-bg);
  color: var(--pv-yellow-dark);
  display: grid; place-items: center;
}
.bom-item .ic svg { width: 28px; height: 28px; }
.bom-item .info strong { display: block; color: var(--slate-900); font-size: .98rem; }
.bom-item .info small { display: block; color: var(--slate-500); margin-top: 2px; }
.bom-item .qty-badge {
  background: var(--pv-yellow);
  color: var(--pv-black);
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 400;
  font-size: 1rem;
  min-width: 48px;
  text-align: center;
}
.bom-item .qty-price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.bom-item .price-line {
  font-size: .85rem;
  font-weight: 600;
  color: var(--slate-600);
}

.notes {
  margin-top: 16px;
  padding: 14px;
  background: #fff8e6;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  color: #78350f;
}
.notes:empty { display: none; }
.notes ul { margin: 6px 0 0; padding-left: 20px; }
.notes li + li { margin-top: 4px; }

/* Bloc client (visible et imprimable) */
.client-block {
  margin-top: 18px;
  padding: 14px;
  border: 1px dashed var(--slate-300);
  border-radius: var(--radius-sm);
  background: var(--slate-50);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: end;
}
.client-block .client-meta {
  grid-column: 1 / -1;
  text-align: right;
  font-size: .8rem;
  color: var(--slate-500);
}
.client-block .field input {
  border: 1px solid var(--pv-border);
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
  background: transparent;
  color: var(--slate-800);
  width: 100%;
}
.client-block .field input:focus {
  outline: none;
  border-color: var(--blue-500);
  box-shadow: none;
}
@media (max-width: 640px) { .client-block { grid-template-columns: 1fr; } }

.disclaimer {
  margin: 18px 0 0;
  padding: 10px 14px;
  border-left: 3px solid var(--slate-300);
  background: transparent;
  color: var(--slate-500);
  font-size: .78rem;
  line-height: 1.45;
  font-style: italic;
}

/* Elements switchés écran/PDF */
.print-only { display: none; }
.order-print { display: none; }

/* Print */
@media print {
  @page { margin: 16mm 14mm; }
  .topbar, .footer, form, .actions-bar, .screen-only, .modal-overlay { display: none !important; }
  body { background: #fff; color: #111; font-size: 11pt; }
  main { padding: 0; max-width: none; }
  .result { box-shadow: none; border: 0; padding: 0; margin: 0; }

  .print-only { display: block; }

  /* Mode bon de commande : on masque la recommandation et on affiche la commande */
  body.print-order .result { display: none !important; }
  body.print-order .order-print { display: block; }
  .order-print .print-header { display: flex; }
  .order-print-address p { margin: 4px 0 0; white-space: pre-line; font-size: 11pt; }
  .order-print-address.is-empty { display: none; }
  .order-print-table { width: 100%; border-collapse: collapse; font-size: 11pt; margin-bottom: 8px; }
  .order-print-table th, .order-print-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
  }
  .order-print-table th {
    font-weight: 600;
    color: #555;
    font-size: 9pt;
    text-transform: uppercase;
    letter-spacing: .04em;
  }
  .order-print-table td.num, .order-print-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
  .order-print-table tr.total td {
    font-weight: 700;
    font-size: 12pt;
    border-bottom: 0;
    border-top: 2px solid var(--pv-dark);
    padding-top: 12px;
  }

  /* En-tête compte-rendu */
  .print-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--pv-yellow);
    margin-bottom: 18px;
  }
  .print-header img { flex: 0 0 56px; }
  .print-header h1 {
    margin: 0;
    font-size: 18pt;
    font-weight: 700;
    color: var(--pv-dark);
  }
  .print-header p {
    margin: 4px 0 0;
    color: #444;
    font-size: 11pt;
  }
  .print-header p:empty { display: none; }

  .print-intro p {
    margin: 0 0 16px;
    color: #333;
    line-height: 1.5;
  }

  .print-h {
    font-size: 12pt;
    font-weight: 700;
    color: var(--pv-dark);
    margin: 18px 0 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid #ddd;
  }
  /* #notesTitle visibility piloté par JS (syncNotesTitle) */

  /* BOM sobre */
  .bom-item {
    background: #fff !important;
    border: 0 !important;
    border-bottom: 1px solid #e5e7eb !important;
    border-radius: 0 !important;
    padding: 10px 0 !important;
    page-break-inside: avoid;
  }
  .bom-item .ic {
    background: var(--pv-yellow-bg) !important;
    color: var(--pv-dark) !important;
  }
  .bom-item .qty-badge {
    background: var(--pv-dark) !important;
    color: #fff !important;
  }
  .bom-item .price-line { color: #555 !important; font-weight: 600; }

  /* Notes en print : style compte-rendu */
  .notes {
    margin-top: 8px;
    background: #fffaeb !important;
    border-color: #fde68a !important;
    color: #553c0a !important;
    font-size: 10pt;
  }

  /* Bloc client : masqué à l'impression, les infos sont dans l'en-tête */
  .client-block { display: none !important; }

  .print-footer {
    margin-top: 28px;
    padding-top: 10px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
    color: #888;
    font-size: 9pt;
  }
  .print-footer strong { color: var(--pv-dark); }
}

/* ---------- Modal commande ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 28, 28, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  animation: fadeIn .15s ease;
}
.modal-overlay[hidden] { display: none; }
body.modal-open { overflow: hidden; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }

.modal {
  background: var(--pv-bg);
  border-radius: 14px;
  border: 1px solid var(--pv-border);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow: auto;
  animation: popIn .2s ease;
  display: flex;
  flex-direction: column;
}
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px 12px;
}
.modal-head h2 { font-size: 1.15rem; margin: 0; }
.modal-head p { font-size: .85rem; color: rgba(28,28,28,.55); margin-top: 4px; }
.modal-close {
  background: transparent;
  border: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: rgba(28,28,28,.55);
  cursor: pointer;
  flex-shrink: 0;
  font-size: 1rem;
}
.modal-close:hover { background: rgba(0,0,0,.05); color: var(--pv-black); }
.modal-body { padding: 8px 22px 18px; display: flex; flex-direction: column; gap: 18px; }
.modal-foot {
  padding: 14px 22px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--pv-border);
  background: transparent;
}

/* Quantity stepper */
.order-qty {
  display: inline-flex;
  align-items: center;
  gap: 0;
  background: var(--pv-yellow-soft);
  border-radius: 12px;
  padding: 4px;
  align-self: flex-start;
}
.order-qty-btn {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--pv-black);
  font-size: 1.2rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s;
}
.order-qty-btn:hover { background: rgba(0,0,0,.06); }
#orderQty {
  width: 70px;
  height: 36px;
  border: 0;
  background: transparent;
  text-align: center;
  font-size: .9rem;
  font-weight: 500;
  color: rgba(28,28,28,.6);
  -moz-appearance: textfield;
}
#orderQty::-webkit-outer-spin-button,
#orderQty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.order-qty-label {
  padding: 0 14px 0 6px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--pv-black);
}

.order-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.order-shortcuts button {
  border: 0;
  background: transparent;
  color: rgba(28,28,28,.65);
  padding: 6px 12px;
  border-radius: 999px;
  font: inherit;
  font-size: .8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.order-shortcuts button:hover {
  background: var(--pv-yellow-soft);
  color: var(--pv-black);
}
.order-shortcuts button.is-active {
  background: var(--pv-yellow);
  color: var(--pv-black);
}

/* Progress bar */
.order-progress {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.order-progress-head {
  display: flex;
  justify-content: space-between;
  font-size: .8rem;
  color: rgba(28,28,28,.7);
  font-weight: 500;
}
.order-progress-head span:first-child { color: var(--pv-black); }
.order-progress-bar {
  position: relative;
  height: 12px;
  background: rgba(0,0,0,.06);
  border-radius: 999px;
  cursor: pointer;
  touch-action: none;
  user-select: none;
}
.order-progress-fill {
  position: absolute;
  inset: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--pv-yellow-soft), var(--pv-yellow));
  border-radius: 999px;
  width: 0%;
  transition: width .15s ease;
  pointer-events: none;
}
.order-progress-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--pv-yellow);
  transform: translate(-50%, -50%);
  transition: left .15s ease, transform .15s ease;
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.order-progress-bar:hover .order-progress-thumb,
.order-progress-bar.is-dragging .order-progress-thumb {
  transform: translate(-50%, -50%) scale(1.1);
}
.order-progress-bar.is-dragging .order-progress-fill { transition: none; }
.order-progress-bar.is-dragging .order-progress-thumb { transition: none; }
.order-progress.max .order-progress-fill { background: var(--pv-yellow); }

.order-progress-marks {
  position: relative;
  height: 18px;
  margin-top: 6px;
}
.order-progress-marks button {
  position: absolute;
  top: 0;
  background: transparent;
  border: 0;
  font: inherit;
  font-size: .72rem;
  color: rgba(28,28,28,.45);
  padding: 2px 4px;
  cursor: pointer;
  transition: color .15s;
  transform: translateX(-50%);
  white-space: nowrap;
}
.order-progress-marks button:nth-child(1) { left: 0%; transform: none; }
.order-progress-marks button:nth-child(2) { left: 16.667%; }
.order-progress-marks button:nth-child(3) { left: 33.333%; }
.order-progress-marks button:nth-child(4) { left: 50%; }
.order-progress-marks button:nth-child(5) { left: 66.667%; }
.order-progress-marks button:nth-child(6) { left: 83.333%; }
.order-progress-marks button:nth-child(7) { left: 100%; transform: translateX(-100%); }
.order-progress-marks button:hover { color: var(--pv-black); }
.order-progress-marks button.is-active { color: var(--pv-yellow-text); font-weight: 600; }

.order-tip {
  background: var(--pv-yellow-bg);
  border: 1px solid var(--pv-yellow-soft);
  color: var(--pv-black);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: .85rem;
  line-height: 1.5;
}

.order-shipping .field { width: 100%; }
.order-shipping textarea {
  border: 1px solid var(--pv-border);
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
  background: transparent;
  color: var(--slate-800);
  width: 100%;
  resize: vertical;
  min-height: 64px;
}
.order-shipping textarea:focus {
  outline: none;
  border-color: var(--blue-500);
  box-shadow: none;
}
.order-address-warning {
  margin: 10px 0 0;
  padding: 10px 14px;
  background: var(--pv-yellow-bg);
  border: 1px solid var(--pv-yellow);
  border-left: 4px solid var(--pv-yellow-dark);
  border-radius: 8px;
  color: var(--pv-black);
  font-size: .88rem;
  font-weight: 500;
  line-height: 1.4;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: order-warning-pop .25s ease-out;
}
.order-address-warning[hidden] { display: none; }
.order-address-warning i {
  flex-shrink: 0;
  color: var(--pv-yellow-dark);
  font-size: 1.15rem;
}
@keyframes order-warning-pop {
  from { transform: translateY(-4px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Summary */
.order-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 18px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--pv-border);
  border-radius: 10px;
  background: transparent;
}
.order-summary > div { display: flex; flex-direction: column; gap: 2px; }
.order-summary dt { font-size: .75rem; color: rgba(28,28,28,.55); font-weight: 500; }
.order-summary dd { margin: 0; font-size: .95rem; font-weight: 500; color: var(--pv-black); }
.order-summary-total dt { color: var(--pv-yellow-text); }
.order-summary-total dd { font-size: 1.15rem; font-weight: 600; }

@media (max-width: 600px) {
  .modal { border-radius: 12px; }
  .order-summary { grid-template-columns: 1fr; }
}

/* Styles spécifiques à l'outil Analyser — s'appuient sur les tokens de
   src/web/common/style.css (variables --pv-*). Aucune nouvelle palette. */

.hint {
  font-size: .85rem;
  color: var(--slate-600, #64748b);
  margin: 8px 4px 0;
  min-height: 1em;
}

.analyser-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: var(--pv-yellow-soft, #fff6c9);
  border-radius: var(--radius, 16px);
  padding: 24px 28px;
  margin: 24px 0;
}
.analyser-hero-main { display: flex; flex-direction: column; gap: 4px; }
.analyser-hero-value {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  color: var(--pv-black, #111);
  line-height: 1.1;
}
.analyser-hero-label {
  font-size: .95rem;
  color: var(--slate-700, #334155);
  font-weight: 500;
}
.analyser-hero-side { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.analyser-badge {
  display: flex; flex-direction: column; align-items: center;
  gap: 2px;
  padding: 8px 14px;
  border-radius: var(--radius-sm, 10px);
  background: #fff;
  min-width: 88px;
}
.analyser-badge-label { font-size: .75rem; color: var(--slate-600, #64748b); }
.analyser-badge-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--pv-black, #111);
}
.analyser-badge[data-grade="A"] .analyser-badge-value { color: #0f9d58; }
.analyser-badge[data-grade="B"] .analyser-badge-value { color: #4caf50; }
.analyser-badge[data-grade="C"] .analyser-badge-value { color: #cddc39; }
.analyser-badge[data-grade="D"] .analyser-badge-value { color: #ffc107; }
.analyser-badge[data-grade="E"] .analyser-badge-value { color: #ff9800; }
.analyser-badge[data-grade="F"] .analyser-badge-value { color: #ff5722; }
.analyser-badge[data-grade="G"] .analyser-badge-value { color: #b71c1c; }

.analyser-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.analyser-card {
  background: #fff;
  border-radius: var(--radius, 16px);
  padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.analyser-card h3 {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--pv-black, #111);
}
.analyser-hint {
  font-size: .8rem;
  color: var(--slate-600, #64748b);
  margin: 0 0 10px;
}
.analyser-rows { display: flex; flex-direction: column; gap: 6px; }
.analyser-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 4px 0;
  border-bottom: 1px dashed rgba(0,0,0,.06);
  font-size: .92rem;
}
.analyser-row:last-child { border-bottom: none; }
.analyser-row span { color: var(--slate-700, #334155); }
.analyser-row strong { color: var(--pv-black, #111); font-weight: 600; }

.disclaimer {
  font-size: .78rem;
  color: var(--slate-600, #64748b);
  margin-top: 24px;
  padding: 12px 16px;
  border-left: 3px solid var(--pv-yellow, #ffd30b);
  background: rgba(255, 211, 11, 0.06);
  line-height: 1.5;
}

@media (max-width: 640px) {
  .analyser-hero { flex-direction: column; align-items: flex-start; text-align: left; }
  .analyser-hero-side { align-items: flex-start; }
}

/* required styles */

.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer {
	position: absolute;
	left: 0;
	top: 0;
	}
.leaflet-container {
	overflow: hidden;
	}
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow {
	-webkit-user-select: none;
	   -moz-user-select: none;
	        user-select: none;
	  -webkit-user-drag: none;
	}
/* Prevents IE11 from highlighting tiles in blue */
.leaflet-tile::selection {
	background: transparent;
}
/* Safari renders non-retina tile on retina better with this, but Chrome is worse */
.leaflet-safari .leaflet-tile {
	image-rendering: -webkit-optimize-contrast;
	}
/* hack that prevents hw layers "stretching" when loading new tiles */
.leaflet-safari .leaflet-tile-container {
	width: 1600px;
	height: 1600px;
	-webkit-transform-origin: 0 0;
	}
.leaflet-marker-icon,
.leaflet-marker-shadow {
	display: block;
	}
/* .leaflet-container svg: reset svg max-width decleration shipped in Joomla! (joomla.org) 3.x */
/* .leaflet-container img: map is broken in FF if you have max-width: 100% on tiles */
.leaflet-container .leaflet-overlay-pane svg {
	max-width: none !important;
	max-height: none !important;
	}
.leaflet-container .leaflet-marker-pane img,
.leaflet-container .leaflet-shadow-pane img,
.leaflet-container .leaflet-tile-pane img,
.leaflet-container img.leaflet-image-layer,
.leaflet-container .leaflet-tile {
	max-width: none !important;
	max-height: none !important;
	width: auto;
	padding: 0;
	}

.leaflet-container img.leaflet-tile {
	/* See: https://bugs.chromium.org/p/chromium/issues/detail?id=600120 */
	mix-blend-mode: plus-lighter;
}

.leaflet-container.leaflet-touch-zoom {
	-ms-touch-action: pan-x pan-y;
	touch-action: pan-x pan-y;
	}
.leaflet-container.leaflet-touch-drag {
	-ms-touch-action: pinch-zoom;
	/* Fallback for FF which doesn't support pinch-zoom */
	touch-action: none;
	touch-action: pinch-zoom;
}
.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom {
	-ms-touch-action: none;
	touch-action: none;
}
.leaflet-container {
	-webkit-tap-highlight-color: transparent;
}
.leaflet-container a {
	-webkit-tap-highlight-color: rgba(51, 181, 229, 0.4);
}
.leaflet-tile {
	filter: inherit;
	visibility: hidden;
	}
.leaflet-tile-loaded {
	visibility: inherit;
	}
.leaflet-zoom-box {
	width: 0;
	height: 0;
	-moz-box-sizing: border-box;
	     box-sizing: border-box;
	z-index: 800;
	}
/* workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=888319 */
.leaflet-overlay-pane svg {
	-moz-user-select: none;
	}

.leaflet-pane         { z-index: 400; }

.leaflet-tile-pane    { z-index: 200; }
.leaflet-overlay-pane { z-index: 400; }
.leaflet-shadow-pane  { z-index: 500; }
.leaflet-marker-pane  { z-index: 600; }
.leaflet-tooltip-pane   { z-index: 650; }
.leaflet-popup-pane   { z-index: 700; }

.leaflet-map-pane canvas { z-index: 100; }
.leaflet-map-pane svg    { z-index: 200; }

.leaflet-vml-shape {
	width: 1px;
	height: 1px;
	}
.lvml {
	behavior: url(#default#VML);
	display: inline-block;
	position: absolute;
	}


/* control positioning */

.leaflet-control {
	position: relative;
	z-index: 800;
	pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
	pointer-events: auto;
	}
.leaflet-top,
.leaflet-bottom {
	position: absolute;
	z-index: 1000;
	pointer-events: none;
	}
.leaflet-top {
	top: 0;
	}
.leaflet-right {
	right: 0;
	}
.leaflet-bottom {
	bottom: 0;
	}
.leaflet-left {
	left: 0;
	}
.leaflet-control {
	float: left;
	clear: both;
	}
.leaflet-right .leaflet-control {
	float: right;
	}
.leaflet-top .leaflet-control {
	margin-top: 10px;
	}
.leaflet-bottom .leaflet-control {
	margin-bottom: 10px;
	}
.leaflet-left .leaflet-control {
	margin-left: 10px;
	}
.leaflet-right .leaflet-control {
	margin-right: 10px;
	}


/* zoom and fade animations */

.leaflet-fade-anim .leaflet-popup {
	opacity: 0;
	-webkit-transition: opacity 0.2s linear;
	   -moz-transition: opacity 0.2s linear;
	        transition: opacity 0.2s linear;
	}
.leaflet-fade-anim .leaflet-map-pane .leaflet-popup {
	opacity: 1;
	}
.leaflet-zoom-animated {
	-webkit-transform-origin: 0 0;
	    -ms-transform-origin: 0 0;
	        transform-origin: 0 0;
	}
svg.leaflet-zoom-animated {
	will-change: transform;
}

.leaflet-zoom-anim .leaflet-zoom-animated {
	-webkit-transition: -webkit-transform 0.25s cubic-bezier(0,0,0.25,1);
	   -moz-transition:    -moz-transform 0.25s cubic-bezier(0,0,0.25,1);
	        transition:         transform 0.25s cubic-bezier(0,0,0.25,1);
	}
.leaflet-zoom-anim .leaflet-tile,
.leaflet-pan-anim .leaflet-tile {
	-webkit-transition: none;
	   -moz-transition: none;
	        transition: none;
	}

.leaflet-zoom-anim .leaflet-zoom-hide {
	visibility: hidden;
	}


/* cursors */

.leaflet-interactive {
	cursor: pointer;
	}
.leaflet-grab {
	cursor: -webkit-grab;
	cursor:    -moz-grab;
	cursor:         grab;
	}
.leaflet-crosshair,
.leaflet-crosshair .leaflet-interactive {
	cursor: crosshair;
	}
.leaflet-popup-pane,
.leaflet-control {
	cursor: auto;
	}
.leaflet-dragging .leaflet-grab,
.leaflet-dragging .leaflet-grab .leaflet-interactive,
.leaflet-dragging .leaflet-marker-draggable {
	cursor: move;
	cursor: -webkit-grabbing;
	cursor:    -moz-grabbing;
	cursor:         grabbing;
	}

/* marker & overlays interactivity */
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-image-layer,
.leaflet-pane > svg path,
.leaflet-tile-container {
	pointer-events: none;
	}

.leaflet-marker-icon.leaflet-interactive,
.leaflet-image-layer.leaflet-interactive,
.leaflet-pane > svg path.leaflet-interactive,
svg.leaflet-image-layer.leaflet-interactive path {
	pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
	pointer-events: auto;
	}

/* visual tweaks */

.leaflet-container {
	background: #ddd;
	outline-offset: 1px;
	}
.leaflet-container a {
	color: #0078A8;
	}
.leaflet-zoom-box {
	border: 2px dotted #38f;
	background: rgba(255,255,255,0.5);
	}


/* general typography */
.leaflet-container {
	font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
	font-size: 12px;
	font-size: 0.75rem;
	line-height: 1.5;
	}


/* general toolbar styles */

.leaflet-bar {
	box-shadow: 0 1px 5px rgba(0,0,0,0.65);
	border-radius: 4px;
	}
.leaflet-bar a {
	background-color: #fff;
	border-bottom: 1px solid #ccc;
	width: 26px;
	height: 26px;
	line-height: 26px;
	display: block;
	text-align: center;
	text-decoration: none;
	color: black;
	}
.leaflet-bar a,
.leaflet-control-layers-toggle {
	background-position: 50% 50%;
	background-repeat: no-repeat;
	display: block;
	}
.leaflet-bar a:hover,
.leaflet-bar a:focus {
	background-color: #f4f4f4;
	}
.leaflet-bar a:first-child {
	border-top-left-radius: 4px;
	border-top-right-radius: 4px;
	}
.leaflet-bar a:last-child {
	border-bottom-left-radius: 4px;
	border-bottom-right-radius: 4px;
	border-bottom: none;
	}
.leaflet-bar a.leaflet-disabled {
	cursor: default;
	background-color: #f4f4f4;
	color: #bbb;
	}

.leaflet-touch .leaflet-bar a {
	width: 30px;
	height: 30px;
	line-height: 30px;
	}
.leaflet-touch .leaflet-bar a:first-child {
	border-top-left-radius: 2px;
	border-top-right-radius: 2px;
	}
.leaflet-touch .leaflet-bar a:last-child {
	border-bottom-left-radius: 2px;
	border-bottom-right-radius: 2px;
	}

/* zoom control */

.leaflet-control-zoom-in,
.leaflet-control-zoom-out {
	font: bold 18px 'Lucida Console', Monaco, monospace;
	text-indent: 1px;
	}

.leaflet-touch .leaflet-control-zoom-in, .leaflet-touch .leaflet-control-zoom-out  {
	font-size: 22px;
	}


/* layers control */

.leaflet-control-layers {
	box-shadow: 0 1px 5px rgba(0,0,0,0.4);
	background: #fff;
	border-radius: 5px;
	}
.leaflet-control-layers-toggle {
	background-image: url(images/layers.png);
	width: 36px;
	height: 36px;
	}
.leaflet-retina .leaflet-control-layers-toggle {
	background-image: url(images/layers-2x.png);
	background-size: 26px 26px;
	}
.leaflet-touch .leaflet-control-layers-toggle {
	width: 44px;
	height: 44px;
	}
.leaflet-control-layers .leaflet-control-layers-list,
.leaflet-control-layers-expanded .leaflet-control-layers-toggle {
	display: none;
	}
.leaflet-control-layers-expanded .leaflet-control-layers-list {
	display: block;
	position: relative;
	}
.leaflet-control-layers-expanded {
	padding: 6px 10px 6px 6px;
	color: #333;
	background: #fff;
	}
.leaflet-control-layers-scrollbar {
	overflow-y: scroll;
	overflow-x: hidden;
	padding-right: 5px;
	}
.leaflet-control-layers-selector {
	margin-top: 2px;
	position: relative;
	top: 1px;
	}
.leaflet-control-layers label {
	display: block;
	font-size: 13px;
	font-size: 1.08333em;
	}
.leaflet-control-layers-separator {
	height: 0;
	border-top: 1px solid #ddd;
	margin: 5px -10px 5px -6px;
	}

/* Default icon URLs */
.leaflet-default-icon-path { /* used only in path-guessing heuristic, see L.Icon.Default */
	background-image: url(images/marker-icon.png);
	}


/* attribution and scale controls */

.leaflet-container .leaflet-control-attribution {
	background: #fff;
	background: rgba(255, 255, 255, 0.8);
	margin: 0;
	}
.leaflet-control-attribution,
.leaflet-control-scale-line {
	padding: 0 5px;
	color: #333;
	line-height: 1.4;
	}
.leaflet-control-attribution a {
	text-decoration: none;
	}
.leaflet-control-attribution a:hover,
.leaflet-control-attribution a:focus {
	text-decoration: underline;
	}
.leaflet-attribution-flag {
	display: inline !important;
	vertical-align: baseline !important;
	width: 1em;
	height: 0.6669em;
	}
.leaflet-left .leaflet-control-scale {
	margin-left: 5px;
	}
.leaflet-bottom .leaflet-control-scale {
	margin-bottom: 5px;
	}
.leaflet-control-scale-line {
	border: 2px solid #777;
	border-top: none;
	line-height: 1.1;
	padding: 2px 5px 1px;
	white-space: nowrap;
	-moz-box-sizing: border-box;
	     box-sizing: border-box;
	background: rgba(255, 255, 255, 0.8);
	text-shadow: 1px 1px #fff;
	}
.leaflet-control-scale-line:not(:first-child) {
	border-top: 2px solid #777;
	border-bottom: none;
	margin-top: -2px;
	}
.leaflet-control-scale-line:not(:first-child):not(:last-child) {
	border-bottom: 2px solid #777;
	}

.leaflet-touch .leaflet-control-attribution,
.leaflet-touch .leaflet-control-layers,
.leaflet-touch .leaflet-bar {
	box-shadow: none;
	}
.leaflet-touch .leaflet-control-layers,
.leaflet-touch .leaflet-bar {
	border: 2px solid rgba(0,0,0,0.2);
	background-clip: padding-box;
	}


/* popup */

.leaflet-popup {
	position: absolute;
	text-align: center;
	margin-bottom: 20px;
	}
.leaflet-popup-content-wrapper {
	padding: 1px;
	text-align: left;
	border-radius: 12px;
	}
.leaflet-popup-content {
	margin: 13px 24px 13px 20px;
	line-height: 1.3;
	font-size: 13px;
	font-size: 1.08333em;
	min-height: 1px;
	}
.leaflet-popup-content p {
	margin: 17px 0;
	margin: 1.3em 0;
	}
.leaflet-popup-tip-container {
	width: 40px;
	height: 20px;
	position: absolute;
	left: 50%;
	margin-top: -1px;
	margin-left: -20px;
	overflow: hidden;
	pointer-events: none;
	}
.leaflet-popup-tip {
	width: 17px;
	height: 17px;
	padding: 1px;

	margin: -10px auto 0;
	pointer-events: auto;

	-webkit-transform: rotate(45deg);
	   -moz-transform: rotate(45deg);
	    -ms-transform: rotate(45deg);
	        transform: rotate(45deg);
	}
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
	background: white;
	color: #333;
	box-shadow: 0 3px 14px rgba(0,0,0,0.4);
	}
.leaflet-container a.leaflet-popup-close-button {
	position: absolute;
	top: 0;
	right: 0;
	border: none;
	text-align: center;
	width: 24px;
	height: 24px;
	font: 16px/24px Tahoma, Verdana, sans-serif;
	color: #757575;
	text-decoration: none;
	background: transparent;
	}
.leaflet-container a.leaflet-popup-close-button:hover,
.leaflet-container a.leaflet-popup-close-button:focus {
	color: #585858;
	}
.leaflet-popup-scrolled {
	overflow: auto;
	}

.leaflet-oldie .leaflet-popup-content-wrapper {
	-ms-zoom: 1;
	}
.leaflet-oldie .leaflet-popup-tip {
	width: 24px;
	margin: 0 auto;

	-ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";
	filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678);
	}

.leaflet-oldie .leaflet-control-zoom,
.leaflet-oldie .leaflet-control-layers,
.leaflet-oldie .leaflet-popup-content-wrapper,
.leaflet-oldie .leaflet-popup-tip {
	border: 1px solid #999;
	}


/* div icon */

.leaflet-div-icon {
	background: #fff;
	border: 1px solid #666;
	}


/* Tooltip */
/* Base styles for the element that has a tooltip */
.leaflet-tooltip {
	position: absolute;
	padding: 6px;
	background-color: #fff;
	border: 1px solid #fff;
	border-radius: 3px;
	color: #222;
	white-space: nowrap;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
	pointer-events: none;
	box-shadow: 0 1px 3px rgba(0,0,0,0.4);
	}
.leaflet-tooltip.leaflet-interactive {
	cursor: pointer;
	pointer-events: auto;
	}
.leaflet-tooltip-top:before,
.leaflet-tooltip-bottom:before,
.leaflet-tooltip-left:before,
.leaflet-tooltip-right:before {
	position: absolute;
	pointer-events: none;
	border: 6px solid transparent;
	background: transparent;
	content: "";
	}

/* Directions */

.leaflet-tooltip-bottom {
	margin-top: 6px;
}
.leaflet-tooltip-top {
	margin-top: -6px;
}
.leaflet-tooltip-bottom:before,
.leaflet-tooltip-top:before {
	left: 50%;
	margin-left: -6px;
	}
.leaflet-tooltip-top:before {
	bottom: 0;
	margin-bottom: -12px;
	border-top-color: #fff;
	}
.leaflet-tooltip-bottom:before {
	top: 0;
	margin-top: -12px;
	margin-left: -6px;
	border-bottom-color: #fff;
	}
.leaflet-tooltip-left {
	margin-left: -6px;
}
.leaflet-tooltip-right {
	margin-left: 6px;
}
.leaflet-tooltip-left:before,
.leaflet-tooltip-right:before {
	top: 50%;
	margin-top: -6px;
	}
.leaflet-tooltip-left:before {
	right: 0;
	margin-right: -12px;
	border-left-color: #fff;
	}
.leaflet-tooltip-right:before {
	left: 0;
	margin-left: -12px;
	border-right-color: #fff;
	}

/* Printing */

@media print {
	/* Prevent printers from removing background-images of controls. */
	.leaflet-control {
		-webkit-print-color-adjust: exact;
		print-color-adjust: exact;
		}
	}

/* Styles spécifiques à l'outil Dimensionner. Cartes Leaflet + graphes.
   Réutilise les tokens de src/web/common/style.css. */

.dim-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 24px;
}
@media (max-width: 960px) {
  .dim-layout { grid-template-columns: 1fr; }
}

.dim-controls, .dim-results {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px;
  background: #fff;
  border-radius: var(--radius, 16px);
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

.dim-field-group { display: flex; flex-direction: column; gap: 8px; }
.dim-suggestions {
  display: none;
  flex-direction: column;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: var(--radius-sm, 10px);
  overflow: hidden;
  max-height: 200px;
  overflow-y: auto;
}
.dim-suggestions.is-open { display: flex; }
.dim-suggestion {
  padding: 8px 12px;
  cursor: pointer;
  font-size: .9rem;
  border-bottom: 1px solid rgba(0,0,0,.05);
}
.dim-suggestion:last-child { border-bottom: none; }
.dim-suggestion:hover { background: var(--pv-yellow-soft, #fff6c9); }
.hint {
  font-size: .82rem;
  color: var(--slate-600, #64748b);
  margin: 0;
}

/* Carte Leaflet */
.dim-map {
  height: 320px;
  border-radius: var(--radius-sm, 10px);
  overflow: hidden;
  z-index: 0;
}

/* Sliders */
.dim-sliders {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dim-slider label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: .88rem;
  color: var(--slate-700, #334155);
  margin-bottom: 4px;
}
.dim-slider label output {
  color: var(--pv-black, #111);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.dim-slider input[type="range"] {
  width: 100%;
  accent-color: var(--pv-yellow, #ffd30b);
}

/* Résultats côté droit */
.dim-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.dim-hero-block {
  background: var(--pv-yellow-soft, #fff6c9);
  border-radius: var(--radius-sm, 10px);
  padding: 16px 18px;
}
.dim-hero-value {
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  font-weight: 700;
  color: var(--pv-black, #111);
  line-height: 1.1;
}
.dim-hero-label {
  font-size: .78rem;
  color: var(--slate-700, #334155);
  margin-top: 4px;
}

.dim-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
@media (max-width: 480px) {
  .dim-kpis { grid-template-columns: 1fr 1fr; }
}
.dim-kpi {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: var(--radius-sm, 10px);
  background: rgba(0,0,0,.02);
  min-height: 62px;
}
.dim-kpi-label {
  font-size: .72rem;
  color: var(--slate-600, #64748b);
  text-transform: uppercase;
  letter-spacing: .03em;
}
.dim-kpi-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--pv-black, #111);
  font-variant-numeric: tabular-nums;
}

.dim-chart-wrap {
  background: rgba(0,0,0,.02);
  border-radius: var(--radius-sm, 10px);
  padding: 14px 16px;
}
.dim-chart-wrap h3 {
  margin: 0 0 8px;
  font-size: .9rem;
  font-weight: 600;
  color: var(--slate-700, #334155);
}

.dim-status {
  font-size: .82rem;
  color: var(--slate-600, #64748b);
  margin: 0;
  padding: 8px 12px;
  border-radius: var(--radius-sm, 10px);
  background: rgba(0,0,0,.02);
}
.dim-status.is-error {
  background: rgba(220, 38, 38, .08);
  color: #991b1b;
}

.disclaimer {
  font-size: .78rem;
  color: var(--slate-600, #64748b);
  margin-top: 24px;
  padding: 12px 16px;
  border-left: 3px solid var(--pv-yellow, #ffd30b);
  background: rgba(255, 211, 11, 0.06);
  line-height: 1.5;
}

