:root {
  --stran-bsc-orange: #E8720C;
  --stran-bsc-orange-dark: #B85A09;
  --stran-bsc-accent: #14a3a6;
  --stran-bsc-accent-dark: #0f8a8d;
  --stran-bsc-bouton-bg: #AED500;
  --stran-bsc-bouton-texte: #23330a;
  --stran-bsc-bouton-chargement-bg: #cccccc;
  --stran-bsc-bouton-chargement-texte: #555555;
  --stran-bsc-lien-aide: #AED500;
  --stran-bsc-tab-text: #FFFFFF;
  --stran-bsc-tab-text-active: #B85A09;
  --stran-bsc-text: #2B1400;
  --stran-bsc-border: #F3D3AE;
  --stran-bsc-bg-soft: #FFF3E7;
}

.stran-bsc-widget {
  max-width: 560px;
  margin: 0 auto;
  box-sizing: border-box;
}
.stran-bsc-widget *,
.stran-bsc-widget *::before,
.stran-bsc-widget *::after {
  box-sizing: border-box;
}

/* --- Carte principale (orange) --- */
.stran-bsc-card {
  background: var(--stran-bsc-orange);
  border-radius: 22px;
  padding: 26px;
  color: #fff;
  box-shadow: 0 14px 32px rgba(184, 90, 9, 0.25);
}

/* --- Titre commun, au-dessus des onglets --- */
.stran-bsc-common-title {
  color: #fff;
  font-size: 19px;
  font-weight: 800;
  margin: 0 0 14px;
}

/* --- Onglets --- */
.stran-bsc-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 18px;
}
.stran-bsc-tab {
  flex: 1;
  text-align: center;
  padding: 10px 6px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: var(--stran-bsc-tab-text);
  cursor: pointer;
  border: none;
  background: transparent;
  font-family: inherit;
}
.stran-bsc-tab.is-active {
  background: #fff;
  color: var(--stran-bsc-tab-text-active);
}

.stran-bsc-panel[hidden] {
  display: none;
}

/* --- Textes d'info sur fond orange --- */
.stran-bsc-hint {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.92);
  margin: 0 0 10px;
}

/* --- Champ de saisie --- */
.stran-bsc-field {
  margin-bottom: 12px;
}
.stran-bsc-field-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
  font-style: italic;
}
.stran-bsc-aide-toggle {
  font-size: 12.5px;
  color: var(--stran-bsc-lien-aide) !important;
  text-decoration: underline;
  white-space: nowrap;
}
.stran-bsc-ocr-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.stran-bsc-ocr-badge {
  display: block;
  width: 26px;
  height: 26px;
  border-radius: 6px;
}
.stran-bsc-ocr-bulle {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  width: 190px;
  background: #2B1400;
  color: #fff;
  font-size: 11.5px;
  font-weight: 400;
  font-style: normal;
  line-height: 1.35;
  padding: 8px 10px;
  border-radius: 8px;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease;
  z-index: 5;
  pointer-events: none;
}
.stran-bsc-ocr-toggle:hover .stran-bsc-ocr-bulle,
.stran-bsc-ocr-toggle:focus-visible .stran-bsc-ocr-bulle {
  opacity: 1;
  visibility: visible;
}
.stran-bsc-field label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
  color: #fff;
}
.stran-bsc-widget input[type="text"] {
  width: 100%;
  padding: 14px 16px;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  color: var(--stran-bsc-text);
  background: rgba(255, 255, 255, 0.95);
  text-align: center;
  transition: box-shadow 0.15s ease, background 0.15s ease;
}
.stran-bsc-widget input[type="text"]:focus {
  outline: none;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.55);
}

.stran-bsc-aide-image-popup {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
}

/* --- Bouton --- */
.stran-bsc-widget button[type="submit"] {
  display: block;
  width: 100%;
  padding: 14px 20px;
  font-size: 15px;
  font-family: inherit;
  font-weight: 700;
  color: var(--stran-bsc-bouton-texte);
  background-color: var(--stran-bsc-bouton-bg);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: filter 0.15s ease;
}
.stran-bsc-widget button[type="submit"]:hover {
  filter: brightness(0.95);
}
.stran-bsc-widget button[type="submit"]:disabled {
  background-color: var(--stran-bsc-bouton-chargement-bg);
  color: var(--stran-bsc-bouton-chargement-texte);
  cursor: not-allowed;
}

/* --- Popup de résultats --- */
.stran-bsc-overlay {
  position: fixed;
  inset: 0;
  background: rgba(43, 20, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}
.stran-bsc-overlay[hidden] {
  display: none;
}

.stran-bsc-panel-window {
  background: #fff;
  border-radius: 16px;
  max-width: 460px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.stran-bsc-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 18px;
  background: #f0f0f0;
}
.stran-bsc-panel-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.stran-bsc-ocr-badge--grand {
  width: 34px;
  height: 34px;
}
@media (min-width: 601px) {
  .stran-bsc-ocr-toggle--aide {
    display: none;
  }
}
.stran-bsc-panel-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--stran-bsc-text);
}
.stran-bsc-panel-close {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background: var(--stran-bsc-bg-soft);
  color: var(--stran-bsc-text);
  font-size: 15px;
  cursor: pointer;
}
.stran-bsc-panel-close:hover {
  background: #ffe4c7;
}

.stran-bsc-panel-body {
  padding: 12px 18px 16px;
  overflow-y: auto;
}

/* --- Contenu du résultat (dans la popup) --- */
.stran-bsc-resume-block {
  background-color: #e6f5f5;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 14px;
}

.stran-bsc-resume {
  display: flex !important;
  align-items: flex-start;
  justify-content: center;
  column-gap: 16px;
  row-gap: 8px;
  flex-wrap: nowrap;
}

.stran-bsc-resume-text {
  flex: 0 1 auto;
  min-width: 0;
  font-size: 17px;
}
.stran-bsc-resume-text p {
  margin: 0 0 7px;
}

.stran-bsc-resume-vignette {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
}

.stran-bsc-vignette {
  display: block !important;
  width: 110px !important;
  max-width: 110px !important;
  height: auto !important;
  border-radius: 4px;
}

.stran-bsc-vignette-placeholder {
  width: 110px;
  height: 70px;
  background-color: #d5e9e9;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  font-weight: 700;
  font-size: 1em;
}

/* --- Pastille de statut --- */
.stran-bsc-badge {
  display: inline-block;
  padding: 2px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85em;
}
.stran-bsc-badge--vert {
  background-color: #2e7d32;
  color: #fff;
}
.stran-bsc-badge--rouge {
  background-color: #c62828;
  color: #fff;
}
.stran-bsc-badge--bleu {
  background-color: #1565c0;
  color: #fff;
}
.stran-bsc-badge--gris {
  background-color: #6e6e6e;
  color: #fff;
}

.stran-bsc-reserve {
  display: block;
  margin: 8px 0 0;
  font-style: italic;
  font-size: 0.9em;
  color: #666;
}

.stran-bsc-table {
  width: 100%;
  max-width: 100%;
  margin: 0 0 10px;
  border-collapse: collapse;
}
.stran-bsc-table th,
.stran-bsc-table td {
  text-align: center !important;
  padding: 8px 10px;
  font-size: 13.5px;
}
.stran-bsc-table th {
  background: var(--stran-bsc-accent);
  color: #fff;
}
.stran-bsc-table tbody tr:nth-child(even) {
  background: var(--stran-bsc-bg-soft);
}
.stran-bsc-table td:first-child {
  font-weight: normal !important;
}

.stran-bsc-mention-controle {
  font-style: italic;
  font-size: 0.85em;
  color: #666;
  margin: 10px 0 0;
}

.stran-bsc-maj {
  font-size: 0.75em;
  font-style: italic;
  color: #888;
  margin: 8px 0 0;
  text-align: center;
}

.stran-bsc-erreur {
  color: #b3261e;
}

/* --- Popup OCR (lecture automatique) --- */
.stran-bsc-ocr-avertissement {
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12.5px;
  color: #6b5900;
  margin: 0 0 14px;
}

.stran-bsc-ocr-camera {
  position: relative;
  background: #111;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.stran-bsc-ocr-video,
.stran-bsc-ocr-apercu {
  width: 100%;
  height: auto;
  max-height: 55vh;
  display: block;
}
.stran-bsc-ocr-video[hidden],
.stran-bsc-ocr-apercu[hidden],
.stran-bsc-ocr-canvas[hidden],
.stran-bsc-ocr-guide[hidden] {
  display: none !important;
}

.stran-bsc-ocr-guide {
  box-sizing: border-box;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 70%;
  height: 32%;
  transform: translate(-50%, -50%);
  border: 3px solid var(--stran-bsc-bouton-bg);
  border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.stran-bsc-ocr-guide-label {
  transform: translateY(120%);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.55);
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.stran-bsc-ocr-zoom {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--stran-bsc-text);
}
.stran-bsc-ocr-zoom input[type="range"] {
  flex: 1;
}

.stran-bsc-ocr-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
}
.stran-bsc-widget-btn {
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 700;
  border: none;
  border-radius: 999px;
  background: #14a3a6;
  color: #fff;
  cursor: pointer;
}
.stran-bsc-widget-btn:hover {
  background: #0f8a8d;
}
.stran-bsc-widget-btn:disabled {
  background: #cccccc;
  color: #666;
  cursor: not-allowed;
}

.stran-bsc-ocr-status {
  font-size: 12.5px;
  color: #555;
  min-height: 18px;
  margin: 0;
}

@media (min-width: 601px) {
  .stran-bsc-ocr-toggle {
    display: none;
  }
}

@media (max-width: 560px) {
  .stran-bsc-card {
    padding: 18px;
    border-radius: 16px;
  }
}
