/* =============================================================================
   DEEPSTACK OS — DIFFUSION — ONGLET LEBONCOIN (préfixe dlbc-)
   [LBC_DIRECT_2026-09-30] Mobile first (375 px), variables DeepStack (--surface, --text…)
   ============================================================================= */
.dlbc { display: flex; flex-direction: column; gap: 14px; padding: 14px 16px 40px; max-width: 1240px; margin: 0 auto; color: var(--text, #18181b); }
.dlbc-busy { pointer-events: none; opacity: .7; transition: opacity .15s; }

/* bandeau */
.dlbc-bandeau { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--radius, 10px); background: var(--warning-light, #faf4ea); color: var(--text, #18181b); font-size: .8125rem; line-height: 1.4; border: 1px solid color-mix(in srgb, var(--warning, #c78f3d) 30%, transparent); }
.dlbc-bandeau i, .dlbc-bandeau svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--warning, #c78f3d); margin-top: 1px; }

/* synthèse */
.dlbc-synthese { display: flex; flex-direction: column; gap: 12px; padding: 14px; background: var(--surface, #fff); border: 1px solid var(--border, #ebebef); border-radius: var(--radius-lg, 14px); box-shadow: var(--shadow-sm); }
.dlbc-synthese-titre { font-weight: 700; font-size: 1rem; }
.dlbc-synthese-sous { font-size: .8125rem; color: var(--text-muted, #71717a); margin-top: 6px; }
.dlbc-barre { height: 8px; border-radius: 99px; background: var(--surface-2, #f4f4f6); overflow: hidden; margin-top: 8px; }
.dlbc-barre > span { display: block; height: 100%; border-radius: 99px; background: #ff6e14; transition: width .3s; }
.dlbc-barre--fine { height: 5px; margin-top: 6px; }

/* champs */
.dlbc-champ { display: flex; flex-direction: column; gap: 6px; font-size: .8125rem; color: var(--text-muted, #71717a); }
.dlbc-champ > span { font-weight: 600; letter-spacing: .02em; text-transform: uppercase; font-size: .6875rem; }
.dlbc-champ small { text-transform: none; font-weight: 400; letter-spacing: 0; }
.dlbc-champ input[type=text], .dlbc-champ input[type=number], .dlbc-select, .dlbc-recherche input {
  font-size: 16px; padding: 10px 12px; min-height: 44px; border: 1px solid var(--border, #ebebef); border-radius: var(--radius-sm, 7px);
  background: var(--surface, #fff); color: var(--text, #18181b); width: 100%; box-sizing: border-box; font-family: inherit; }
.dlbc-champ input:focus, .dlbc-select:focus, .dlbc-recherche input:focus { outline: 2px solid color-mix(in srgb, var(--primary, #5b6abf) 45%, transparent); outline-offset: 1px; border-color: var(--primary, #5b6abf); }
.dlbc-champ--inline { flex-direction: row; align-items: center; gap: 10px; flex-wrap: wrap; }
.dlbc-champ--inline > span { text-transform: none; font-size: .875rem; font-weight: 500; color: var(--text, #18181b); }
.dlbc-champ--inline .dlbc-select { width: auto; min-width: 150px; }
.dlbc-champ--duo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dlbc-champ--duo label { display: flex; flex-direction: column; gap: 6px; }
.dlbc-champ--duo label > span { font-weight: 600; letter-spacing: .02em; text-transform: uppercase; font-size: .6875rem; }
fieldset.dlbc-champ { border: 0; padding: 0; margin: 0; }
fieldset.dlbc-champ legend { font-weight: 600; letter-spacing: .02em; text-transform: uppercase; font-size: .6875rem; padding: 0; margin-bottom: 6px; }
.dlbc-cases { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.dlbc-case { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; font-size: .875rem; color: var(--text, #18181b); cursor: pointer; }
.dlbc-case input { position: absolute; opacity: 0; width: 0; height: 0; }
.dlbc-case span { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--text-faint, #a1a1aa); display: inline-flex; align-items: center; justify-content: center; background: var(--surface, #fff); transition: all .12s; }
.dlbc-case input:checked + span { background: var(--primary, #5b6abf); border-color: var(--primary, #5b6abf); }
.dlbc-case input:checked + span::after { content: ''; width: 6px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.dlbc-case input:focus-visible + span { outline: 2px solid var(--primary, #5b6abf); outline-offset: 2px; }

/* tuiles comptes */
.dlbc-comptes { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 1fr); gap: 10px; overflow-x: auto; padding-bottom: 4px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.dlbc-tuile { scroll-snap-align: start; text-align: left; padding: 12px; border: 1.5px solid var(--border, #ebebef); border-radius: var(--radius-lg, 14px); background: var(--surface, #fff); cursor: pointer; font-family: inherit; color: var(--text, #18181b); min-height: 44px; transition: border-color .15s, box-shadow .15s; }
.dlbc-tuile:hover { border-color: var(--text-faint, #a1a1aa); }
.dlbc-tuile--active { border-color: #ff6e14; box-shadow: 0 0 0 3px rgba(255, 110, 20, .18); }
.dlbc-tuile-nom { font-weight: 700; font-size: .9375rem; display: flex; align-items: center; gap: 6px; }
.dlbc-tuile-dep { font-size: .6875rem; font-weight: 700; color: #ff6e14; background: rgba(255, 110, 20, .12); border-radius: 6px; padding: 1px 6px; }
.dlbc-tuile-compte { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; }
.dlbc-tuile-compte span { font-size: .875rem; font-weight: 500; color: var(--text-muted, #71717a); }
.dlbc-tuile-sous { font-size: .75rem; color: var(--text-muted, #71717a); margin-top: 6px; }

/* compte */
.dlbc-compte { background: var(--surface, #fff); border: 1px solid var(--border, #ebebef); border-radius: var(--radius-lg, 14px); box-shadow: var(--shadow-sm); overflow: hidden; }
.dlbc-compte-tete { display: flex; flex-direction: column; gap: 12px; padding: 14px; border-bottom: 1px solid var(--border, #ebebef); }
.dlbc-compte-id h2 { margin: 0; font-size: 1.125rem; font-weight: 800; letter-spacing: -.01em; }
.dlbc-compte-id h2 small { font-weight: 500; color: var(--text-muted, #71717a); font-size: .8125rem; margin-left: 6px; }
.dlbc-compte-meta { font-size: .8125rem; color: var(--text-muted, #71717a); margin-top: 2px; }
.dlbc-compte-meta em { color: var(--warning, #c78f3d); font-style: normal; }
.dlbc-compte-nombre { font-size: 1.75rem; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.dlbc-compte-nombre span { font-size: 1rem; font-weight: 500; color: var(--text-muted, #71717a); }
.dlbc-compte-sous { font-size: .75rem; color: var(--text-muted, #71717a); margin-top: 6px; }
.dlbc-compte-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dlbc-compte-actions .dv2-btn { min-height: 40px; }
.dlbc-switch { display: inline-flex; align-items: center; gap: 8px; font-size: .8125rem; font-weight: 600; cursor: pointer; min-height: 40px; }
.dlbc-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.dlbc-switch span { width: 40px; height: 22px; border-radius: 99px; background: var(--text-faint, #a1a1aa); position: relative; transition: background .15s; flex-shrink: 0; }
.dlbc-switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
.dlbc-switch input:checked + span { background: var(--success, #3d9a6e); }
.dlbc-switch input:checked + span::after { left: 21px; }
.dlbc-switch input:focus-visible + span { outline: 2px solid var(--primary, #5b6abf); outline-offset: 2px; }

/* règles */
.dlbc-regles { padding: 14px; border-bottom: 1px solid var(--border, #ebebef); background: var(--surface-2, #f4f4f6); }
.dlbc-regles-grille { display: grid; grid-template-columns: 1fr; gap: 14px; }
.dlbc-regles-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.dlbc-regles-actions .dv2-btn { min-height: 44px; }

/* segments et outils */
.dlbc-segments { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--border, #ebebef); }
.dlbc-seg { min-height: 46px; border: 0; background: transparent; font-family: inherit; font-size: .8125rem; font-weight: 600; color: var(--text-muted, #71717a); cursor: pointer; border-bottom: 2px solid transparent; padding: 0 6px; }
.dlbc-seg b { font-weight: 800; color: var(--text, #18181b); margin-left: 4px; }
.dlbc-seg--active { color: #ff6e14; border-bottom-color: #ff6e14; }
.dlbc-outils { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border, #ebebef); }
.dlbc-recherche { position: relative; }
.dlbc-recherche i, .dlbc-recherche svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-faint, #a1a1aa); }
.dlbc-recherche input { padding-left: 36px; }
.dlbc-chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.dlbc-chip { flex-shrink: 0; min-height: 36px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--border, #ebebef); background: var(--surface, #fff); color: var(--text-muted, #71717a); font-family: inherit; font-size: .8125rem; font-weight: 600; cursor: pointer; }
.dlbc-chip--active { background: var(--text, #18181b); color: var(--surface, #fff); border-color: var(--text, #18181b); }
.dlbc-chips-sep { width: 1px; background: var(--border, #ebebef); margin: 4px 4px; flex-shrink: 0; }
.dlbc-outils-droite { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dlbc-compteur { font-size: .8125rem; color: var(--text-muted, #71717a); }
.dv2-btn--sm { min-height: 36px; font-size: .8125rem; padding: 0 12px; }

/* lignes */
.dlbc-liste { display: flex; flex-direction: column; }
.dlbc-ligne { display: grid; grid-template-columns: auto 64px 1fr; grid-template-areas: 'coche vignette corps' 'coche vignette prix'; gap: 4px 12px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border, #ebebef); cursor: pointer; }
.dlbc-ligne:hover { background: var(--surface-2, #f4f4f6); }
.dlbc-ligne--ko .dlbc-titre { color: var(--text-muted, #71717a); }
.dlbc-coche { grid-area: coche; display: flex; align-items: center; min-width: 44px; min-height: 44px; justify-content: center; }
.dlbc-coche input { position: absolute; opacity: 0; width: 0; height: 0; }
.dlbc-coche span { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--text-faint, #a1a1aa); background: var(--surface, #fff); display: inline-flex; align-items: center; justify-content: center; transition: all .12s; }
.dlbc-coche input:checked + span { background: #ff6e14; border-color: #ff6e14; }
.dlbc-coche input:checked + span::after { content: ''; width: 7px; height: 12px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) translate(-1px, -1px); }
.dlbc-coche input:focus-visible + span { outline: 2px solid var(--primary, #5b6abf); outline-offset: 2px; }
.dlbc-vignette { grid-area: vignette; width: 64px; height: 48px; border-radius: 8px; overflow: hidden; background: var(--surface-2, #f4f4f6); display: flex; align-items: center; justify-content: center; color: var(--text-faint, #a1a1aa); }
.dlbc-vignette img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dlbc-corps { grid-area: corps; min-width: 0; }
.dlbc-titre { font-weight: 700; font-size: .9375rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dlbc-version { font-weight: 500; color: var(--text-muted, #71717a); font-size: .8125rem; }
.dlbc-sous { font-size: .75rem; color: var(--text-muted, #71717a); margin-top: 2px; }
.dlbc-etats { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-top: 4px; font-size: .75rem; }
.dlbc-etat { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; }
.dlbc-etat i, .dlbc-etat svg { width: 13px; height: 13px; }
.dlbc-etat--ok { color: var(--success, #3d9a6e); }
.dlbc-etat--ko { color: var(--danger, #c75050); }
.dlbc-mode { color: var(--text-muted, #71717a); }
.dlbc-mode--main { color: #ff6e14; font-weight: 700; }
.dlbc-mode--motif { color: var(--text-faint, #a1a1aa); font-style: italic; }
.dlbc-autres { color: var(--text-muted, #71717a); }
.dlbc-prix { grid-area: prix; font-weight: 800; font-size: .9375rem; letter-spacing: -.01em; }
.dlbc-ligne > .dv2-btn { grid-column: 1 / -1; justify-self: start; }
.dlbc-plus { margin: 12px 14px; min-height: 44px; border-radius: var(--radius-sm, 7px); border: 1px dashed var(--border, #ebebef); background: transparent; color: var(--primary, #5b6abf); font-family: inherit; font-weight: 600; font-size: .875rem; cursor: pointer; }

/* détail (panneau) */
.dlbc-voile { position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 9998; }
.dlbc-detail { position: fixed; z-index: 9999; left: 0; right: 0; bottom: 0; max-height: 92vh; background: var(--surface, #fff); color: var(--text, #18181b); border-radius: 16px 16px 0 0; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; }
.dlbc-detail-tete { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border, #ebebef); }
.dlbc-detail-tete h3 { margin: 0; font-size: 1.0625rem; font-weight: 800; }
.dlbc-fermer { width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--surface-2, #f4f4f6); color: var(--text, #18181b); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.dlbc-detail-corps { overflow-y: auto; padding: 14px 16px 24px; }
.dlbc-detail-corps h4 { margin: 16px 0 6px; font-size: .6875rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted, #71717a); }
.dlbc-detail-corps h4 small { text-transform: none; letter-spacing: 0; font-weight: 400; }
.dlbc-photos { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.dlbc-photos img { height: 96px; width: 128px; object-fit: cover; border-radius: 8px; flex-shrink: 0; background: var(--surface-2, #f4f4f6); }
.dlbc-detail-statut { margin-top: 12px; font-weight: 700; font-size: .9375rem; }
.dlbc-detail-statut.ok { color: var(--success, #3d9a6e); }
.dlbc-detail-statut.ko { color: var(--danger, #c75050); }
.dlbc-detail-liste { margin: 6px 0 0; padding-left: 18px; font-size: .8125rem; }
.dlbc-detail-liste.ko { color: var(--danger, #c75050); }
.dlbc-detail-liste.warn { color: var(--warning, #c78f3d); }
.dlbc-detail-titre { margin: 0; font-weight: 700; }
.dlbc-detail-texte { white-space: pre-wrap; font-family: inherit; font-size: .8125rem; line-height: 1.5; margin: 0; padding: 12px; background: var(--surface-2, #f4f4f6); border-radius: var(--radius-sm, 7px); max-height: 40vh; overflow: auto; }
.dlbc-json { margin-top: 16px; font-size: .8125rem; }
.dlbc-json summary { cursor: pointer; font-weight: 600; min-height: 40px; display: flex; align-items: center; }
.dlbc-json pre { font-size: .75rem; padding: 12px; background: var(--surface-2, #f4f4f6); border-radius: var(--radius-sm, 7px); overflow: auto; max-height: 50vh; }

/* écrans larges */
@media (min-width: 720px) {
  .dlbc { padding: 20px 24px 60px; }
  .dlbc-synthese { flex-direction: row; align-items: center; justify-content: space-between; }
  .dlbc-synthese-jauge { flex: 1; max-width: 640px; }
  .dlbc-comptes { grid-auto-flow: row; grid-template-columns: repeat(6, 1fr); overflow: visible; }
  .dlbc-compte-tete { flex-direction: row; align-items: center; }
  .dlbc-compte-id { flex: 1; }
  .dlbc-compte-jauge { width: 200px; }
  .dlbc-regles-grille { grid-template-columns: repeat(2, 1fr); }
  .dlbc-outils { flex-direction: row; align-items: center; flex-wrap: wrap; }
  .dlbc-recherche { flex: 1; min-width: 240px; }
  .dlbc-outils-droite { margin-left: auto; }
  .dlbc-ligne { grid-template-columns: auto 72px 1fr auto; grid-template-areas: 'coche vignette corps prix'; }
  .dlbc-vignette { width: 72px; height: 54px; }
  .dlbc-prix { min-width: 90px; text-align: right; }
  .dlbc-ligne > .dv2-btn { grid-column: auto; }
  .dlbc-detail { left: auto; top: 0; bottom: 0; width: min(640px, 92vw); max-height: none; border-radius: 16px 0 0 16px; }
}
@media (min-width: 1100px) { .dlbc-regles-grille { grid-template-columns: repeat(3, 1fr); } }
