:root {
  /* charte vigil.ai 2026-04-27 — DARK + accent blanc neutre (mode dark de la charte fournie) */
  --bg: #0a0a0b;            /* fond noir profond */
  --bg-2: #131316;           /* surface 2 (cards) */
  --bg-3: #1c1c20;           /* surface 3 (hover) */
  --line: #26262c;           /* bordure subtile */
  --line-2: #3a3a42;         /* bordure plus visible */
  --fg: #ececea;             /* off-white */
  --fg-dim: #a8a8a3;         /* texte secondaire */
  --fg-mute: #7A7A75;        /* texte tertiaire — bumped pour WCAG AA 4.94:1 */
  --accent: #ffffff;         /* blanc neutre (accent) */
  --accent-ink: #0a0a0b;     /* texte sur accent (noir) */

  /* alias pour compat avec classes existantes (mapping ancien -> nouveau) */
  --card: var(--bg-2);
  --card-2: var(--bg-3);
  --accent-light: #f5f5f3;
  --accent-dark: #d4d4cf;
  --success: #4ADE80;  /* bumped de #198754 — WCAG AA 11.6:1 sur fond sombre */
  --danger: #D45050;   /* bumped de #c0392b — WCAG AA 4.89:1 sur fond sombre */
  --warning: #d97706;
  --text: var(--fg);
  --text-muted: var(--fg-dim);
  --border: var(--line);
  --shadow: 0 8px 24px rgba(17, 17, 18, 0.06);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --radius: 14px;
  --radius-sm: 10px;

  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --serif: "Instrument Serif", "Times New Roman", serif;
  --sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --ff-display: var(--serif);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01","cv11";
}

/* grain pattern subtil sur tout le body (z-index négatif pour rester sous le contenu) */
body::before {
  content: "";
  position: fixed; inset: 0;
  background-image:
    radial-gradient(circle at 20% 10%, rgba(17, 17, 18, 0.03), transparent 45%),
    radial-gradient(circle at 90% 80%, rgba(17, 17, 18, 0.02), transparent 50%);
  pointer-events: none;
  z-index: -1;
}

/* headings → instrument serif italic */
h1, h2, h3, .display, .auth-title, .lb-h1, .lb-h2 {
  font-family: var(--serif);
  
  font-weight: 400;
  letter-spacing: -0.01em;
}

/* mono pour timestamps, ids, labels techniques */
code, pre, .mono, .timestamp, .ts, .meta-mono {
  font-family: var(--mono);
}

/* ======== BRAND MARK (logo carré lime + point noir + halo pulse) ======== */
.brand-mark {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(17, 17, 18, 0.12), 0 0 28px -8px var(--accent);
  font-size: 0;
}
.brand-mark::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent-ink);
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 12px;
  border: 1px solid color-mix(in oklab, var(--accent) 50%, transparent);
  animation: brand-pulse 2.4s ease-out infinite;
  pointer-events: none;
}
@keyframes brand-pulse {
  0% { transform: scale(.9); opacity: .8; }
  100% { transform: scale(1.5); opacity: 0; }
}
/* override pour le logo original qui avait un font-size, hidden child text */
.logo.brand-mark, .lb-logo.brand-mark { font-size: 0; }
.lb-logo.brand-mark { width: 26px; height: 26px; }

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-2);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ========== COMMON ========== */
.hidden {
  display: none !important;
}

.view-container {
  width: 100%;
  min-height: 100vh;
}

/* ========== LANDING PAGE ========== */

/* --------- TOP NAVIGATION --------- */
.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
  background: rgba(10, 15, 28, 0.7);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  font-weight: 800;
  font-size: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.brand:hover {
  opacity: 0.8;
}

.brand .logo {
  font-size: 28px;
}

.accent {
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 30px;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--text);
}

/* --------- BUTTONS --------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn:hover:not(:disabled) {
  transform: translateY(-2px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn.primary {
  background: var(--accent);
  color: var(--accent-ink);
  border: 1px solid color-mix(in oklab, var(--accent) 80%, white);
}
.btn.primary:hover {
  background: color-mix(in oklab, var(--accent) 88%, white);
}

.btn.secondary {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn.danger {
  background: var(--danger);
  color: white;
}

.btn.large {
  padding: 14px 32px;
  font-size: 16px;
}

.btn.full-width {
  width: 100%;
}

/* --------- HERO SECTION --------- */
.hero-section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 60px 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero-content h1 {
  font-size: 56px;
  font-weight: 800;
  line-height: 1.1;
  margin: 0 0 24px;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 18px;
  color: var(--text-muted);
  margin: 0 0 32px;
  line-height: 1.6;
}

.hero-cta {
  display: flex;
  gap: 16px;
  margin-bottom: 40px;
}

.hero-trust {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 14px;
  color: var(--text-muted);
}

.hero-visual {
  display: flex;
  justify-content: center;
}

.hero-card {
  background: var(--card);
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  width: 100%;
  max-width: 380px;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--card-2);
  border-bottom: 1px solid var(--border);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot.red {
  background: #ff5f57;
}

.dot.yellow {
  background: #febc2e;
}

.dot.green {
  background: #28c840;
}

.card-title {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--success);
}

.card-body {
  padding: 24px;
}

.fake-video {
  font-size: 64px;
  text-align: center;
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg-2) 100%);
  padding: 40px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.alert-preview {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}

.alert-item {
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--bg-2);
  color: var(--text-muted);
}

.alert-item.critical {
  background: rgba(239, 68, 68, 0.15);
  color: #E05555;
  border-left: 3px solid var(--danger);
  padding-left: 9px;
}

/* --------- HOW IT WORKS --------- */
.how-it-works {
  max-width: 1400px;
  margin: 80px auto 0;
  padding: 60px 40px;
  text-align: center;
}

.how-it-works h2 {
  font-size: 42px;
  font-weight: 800;
  margin-bottom: 16px;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  margin-top: 48px;
}

.step {
  text-align: center;
}

.step-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.step h3 {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 12px;
}

.step p {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
}

/* --------- SCENARIOS SHOWCASE --------- */
.scenarios-showcase {
  max-width: 1400px;
  margin: 0 auto;
  padding: 60px 40px;
}

.scenarios-showcase h2 {
  font-size: 42px;
  font-weight: 800;
  margin-bottom: 8px;
  text-align: center;
}

.section-subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 48px;
}

.scenarios-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.scenario-showcase-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px 24px;
  text-align: center;
  transition: all 0.3s;
}

.scenario-showcase-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.scenario-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.scenario-showcase-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 8px;
}

.scenario-showcase-card p {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
}

/* --------- PRICING --------- */
.pricing-section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 60px 40px;
}

.pricing-section h2 {
  font-size: 42px;
  font-weight: 800;
  margin-bottom: 8px;
  text-align: center;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 48px;
}

.pricing-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all 0.3s;
}

.pricing-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.pricing-card.featured {
  border-color: var(--accent);
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.2);
  transform: scale(1.05);
}

.plan-badge {
  position: absolute;
  top: -12px;
  left: 24px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--success) 100%);
  color: white;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}

.plan-name {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 8px;
}

.plan-price {
  font-size: 42px;
  font-weight: 800;
  color: var(--accent);
  margin: 8px 0;
}

.plan-period {
  font-size: 16px;
  color: var(--text-muted);
  font-weight: 400;
}

.plan-camera {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  flex-grow: 1;
}

.plan-features li {
  padding: 8px 0;
  font-size: 14px;
  color: var(--text-muted);
}

/* --------- SHOP --------- */
.shop-section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 60px 40px;
}

.shop-section h2 {
  font-size: 42px;
  font-weight: 800;
  margin-bottom: 8px;
  text-align: center;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 48px;
}

.shop-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all 0.3s;
}

.shop-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.shop-icon {
  font-size: 48px;
  margin-bottom: 16px;
  text-align: center;
}

.shop-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}

.shop-badge.green {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}

.shop-badge.blue {
  background: rgba(59, 130, 246, 0.15);
  color: #1e40af;
}

.shop-badge.gold {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.shop-badge.red {
  background: rgba(239, 68, 68, 0.15);
  color: #E05555;
}

.shop-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 8px;
}

.shop-pitch {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 12px;
}

.shop-specs {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--text-muted);
}

.shop-specs li {
  padding: 4px 0;
}

.shop-price {
  font-size: 24px;
  font-weight: 800;
  color: var(--accent);
  margin: 16px 0;
}

/* --------- SUPPORT --------- */
.support-section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 60px 40px;
}

.support-section h2 {
  font-size: 42px;
  font-weight: 800;
  margin-bottom: 8px;
  text-align: center;
}

.support-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 32px;
  margin-top: 48px;
}

.support-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  text-align: center;
}

.support-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.support-card h3 {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 12px;
}

.support-card p {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 16px;
}

.support-contact {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
}

/* --------- FOOTER --------- */
.landing-footer {
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: 48px 40px 24px;
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  margin-bottom: 32px;
}

.footer-section h4 {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 12px;
}

.footer-section p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

.footer-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-section ul li {
  margin-bottom: 8px;
}

.footer-section ul a {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-section ul a:hover {
  color: var(--text);
}

.footer-bottom {
  max-width: 1400px;
  margin: 0 auto;
  text-align: center;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}

/* ========== DASHBOARD ========== */

.dashboard-wrapper {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
  gap: 0;
}

/* --------- SIDEBAR --------- */
.dashboard-sidebar {
  background: var(--card);
  border-right: 1px solid var(--border);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow-y: auto;
}

.sidebar-brand {
  font-weight: 800;
  font-size: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text);
  transition: opacity 0.2s;
}

.sidebar-brand:hover {
  opacity: 0.8;
}

.sidebar-brand .logo {
  font-size: 24px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
}

.nav-item:hover {
  background: var(--card-2);
  color: var(--text);
}

.nav-item.active {
  background: var(--accent);
  color: var(--accent-ink);
}

.nav-icon {
  font-size: 18px;
}

/* --------- DASHBOARD MAIN --------- */
.dashboard-main {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.dashboard-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 40px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.dashboard-topbar h1 {
  font-size: 28px;
  font-weight: 700;
  margin: 0;
}

.status-indicator {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.status-indicator.offline {
  background: rgba(239, 68, 68, 0.15);
  color: #F87171; /* bumped de #8f1d14 — WCAG AA sur fond rouge sombre */
}

.status-indicator.online {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}

.dashboard-pages {
  padding: 40px;
  flex-grow: 1;
}

.dashboard-page {
  display: none;
}

.dashboard-page.active {
  display: block;
}

.page-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  margin-bottom: 24px;
}

.page-card h2 {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 24px;
}

.page-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 16px;
}

/* --------- FORMS --------- */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-hint {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

.form-hint code {
  background: var(--bg-2);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  margin-bottom: 20px;
}

.checkbox-label input {
  width: auto;
}

.button-group {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.result-message {
  display: none;
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 13px;
  margin-top: 12px;
}

.result-message.success {
  display: block;
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.result-message.error {
  display: block;
  background: rgba(239, 68, 68, 0.15);
  color: #F87171; /* bumped de #8f1d14 — WCAG AA 6.5:1 */
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.result-message.info {
  display: block;
  background: rgba(59, 130, 246, 0.12);
  color: #93C5FD; /* bumped de #1e3a8a — WCAG AAA 10.5:1 */
  border: 1px solid rgba(59, 130, 246, 0.3);
}

/* --------- CAMERA PAGE --------- */
.preview-container {
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 20px;
}

.preview-image {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: contain;
  background: #000;
}

.preview-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--warning);
  background: rgba(146, 64, 14, 0.06);
  font-weight: 500;
}

/* --------- SURVEILLANCE PAGE --------- */
.surveillance-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.surveillance-controls {
  display: flex;
  gap: 12px;
}

.scenarios-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.scenario-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--card-2);
  border-radius: 6px;
  font-size: 13px;
}

.live-feed-container {
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 20px;
  position: relative;
}

.live-image {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: contain;
  background: #000;
}

.live-timestamp {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.72);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--bg-3);
  letter-spacing: 0.02em;
}

.real-time-log {
  background: var(--bg-2);
  border-radius: 8px;
  padding: 16px;
  max-height: 400px;
  overflow-y: auto;
  min-height: 200px;
}

.log-empty {
  color: var(--text-muted);
  text-align: center;
  padding: 32px 16px;
}

.log-entry {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.log-entry:last-child {
  border-bottom: none;
}

.log-entry.critical {
  color: var(--danger);
  font-weight: 600;
}

.log-entry.warning {
  color: var(--warning);
  font-weight: 600;
}

.log-entry time {
  color: var(--text-muted);
  display: block;
  font-size: 11px;
  margin-bottom: 4px;
}

/* --------- ALERTS PAGE --------- */
.alerts-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.alert-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 48px 24px;
}

.alert-card {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.alert-image {
  width: 120px;
  height: 80px;
  object-fit: cover;
  background: #000;
}

.alert-content {
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.alert-title {
  font-weight: 600;
  margin: 0 0 4px;
  font-size: 14px;
}

.alert-title.critical {
  color: #F87171; /* bumped de #8f1d14 — WCAG AA 6.36:1 sur --card-2 */
}

.alert-title.warning {
  color: var(--warning);
}

.alert-summary {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 4px;
}

.alert-meta {
  font-size: 12px;
  color: var(--text-muted);
}

/* --------- SUBSCRIPTION PAGE --------- */
.subscription-status {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 32px;
  margin-bottom: 24px;
}

.plan-info h3 {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 8px;
}

.plan-info p {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0 0 16px;
}

.plan-price-display {
  font-size: 32px;
  font-weight: 800;
  color: var(--accent);
}

.plan-price-display span {
  font-size: 16px;
  font-weight: 500;
}

.upgrade-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.upgrade-option {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
}

.upgrade-option h3 {
  font-size: 18px;
  margin: 0 0 8px;
}

.upgrade-option p {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 12px;
}

.upgrade-option ul {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  text-align: left;
}

.upgrade-option li {
  font-size: 13px;
  color: var(--text-muted);
  padding: 4px 0;
}

/* --------- SCENARIOS SELECTION --------- */
.scenarios-selection {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.scenario-checkbox {
  background: var(--card-2);
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.scenario-checkbox:hover {
  border-color: var(--accent);
}

.scenario-checkbox.selected {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(16, 185, 129, 0.1) 100%);
  border-color: var(--accent);
}

.scenario-checkbox input {
  display: none;
}

.scenario-emoji {
  font-size: 32px;
  margin-bottom: 8px;
}

.scenario-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

/* ========== DETECTION SECTION (Settings) ========== */

/* --- Sous-titres de section --- */
.detection-sub-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* --- Badge "optionnel" --- */
.optional-badge {
  font-size: 11px;
  font-weight: 600;
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid var(--border);
  letter-spacing: 0.3px;
}

/* --- Séparateur entre les deux sous-sections --- */
#panel-prompt {
  border-top: 1px solid var(--border);
  padding-top: 24px;
}

/* --- Scenario cards grid --- */
.scenario-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}

/* --- Individual scenario card --- */
.scenario-card {
  background: var(--card-2);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 18px 14px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  position: relative;
  user-select: none;
}

.scenario-card:hover {
  border-color: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.15);
}

.scenario-card.active {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(16, 185, 129, 0.1) 100%);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 4px 16px rgba(59, 130, 246, 0.2);
}


.scenario-card-emoji {
  font-size: 36px;
  line-height: 1;
}

.scenario-card-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  line-height: 1.3;
}

.scenario-card-desc {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.4;
}

/* --- iOS-style toggle on card --- */
.scenario-toggle-wrap {
  position: absolute;
  top: 10px;
  right: 10px;
}

.scenario-toggle {
  position: relative;
  width: 32px;
  height: 18px;
  display: inline-block;
}

.scenario-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.scenario-toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 18px;
  transition: 0.2s;
  cursor: pointer;
}

.scenario-toggle-slider::before {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--bg-2);
  border-radius: 50%;
  left: 3px;
  top: 3px;
  transition: 0.2s;
}

.scenario-toggle input:checked + .scenario-toggle-slider {
  background: var(--accent);
}

.scenario-toggle input:checked + .scenario-toggle-slider::before {
  transform: translateX(14px);
}

/* ========== MINORITY REPORT TOGGLE ========== */

.minority-report-toggle {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.08) 0%, rgba(59, 130, 246, 0.06) 100%);
  border: 1px solid rgba(124, 58, 237, 0.3);
  border-radius: 12px;
  padding: 16px 20px;
}

.minority-report-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.minority-report-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.minority-report-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.minority-report-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.minority-report-warning {
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 8px;
  font-size: 12px;
  color: var(--warning);
  line-height: 1.5;
}

.minority-report-warning code {
  background: rgba(245, 158, 11, 0.15);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: monospace;
}

/* ========== MÉMOIRE CONTEXTUELLE ========== */

.memory-card {
  border-color: rgba(59, 130, 246, 0.3);
  background: linear-gradient(135deg, var(--card) 0%, rgba(59, 130, 246, 0.04) 100%);
}

.memory-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.memory-header h2 {
  margin-bottom: 0;
}

/* Toggle on/off mémoire */
.memory-toggle-wrap {
  position: relative;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
  cursor: pointer;
  margin-top: 4px;
}

.memory-toggle-wrap input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.memory-toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 26px;
  transition: 0.25s;
}

.memory-toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  background: var(--bg-2);
  border-radius: 50%;
  left: 4px;
  top: 4px;
  transition: 0.25s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.memory-toggle-wrap input:checked + .memory-toggle-slider {
  background: var(--accent);
}

.memory-toggle-wrap input:checked + .memory-toggle-slider::before {
  transform: translateX(22px);
}

/* Barre de statut */
.memory-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 16px;
}

.memory-next {
  font-weight: 600;
  color: var(--accent-light);
  font-size: 12px;
}

/* Boutons actions mémoire */
.memory-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1200px) {
  .hero-section {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 40px 32px;
  }

  .hero-content h1 {
    font-size: 42px;
  }

  .steps-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .pricing-card.featured {
    transform: scale(1);
  }

  .support-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .scenario-cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}

@media (max-width: 768px) {
  .topnav {
    padding: 16px 20px;
    flex-direction: column;
    gap: 16px;
  }

  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    width: 100%;
  }

  .hero-content h1 {
    font-size: 32px;
  }

  .hero-cta {
    flex-direction: column;
  }

  .dashboard-wrapper {
    grid-template-columns: 1fr;
  }

  .dashboard-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 16px;
    flex-direction: row;
    overflow-x: auto;
    gap: 12px;
  }

  .sidebar-nav {
    flex-direction: row;
    gap: 4px;
  }

  .nav-item {
    padding: 8px 12px;
    font-size: 12px;
  }

  .dashboard-topbar {
    padding: 16px 20px;
  }

  .dashboard-pages {
    padding: 20px;
  }

  .page-card {
    padding: 20px;
  }

  .footer-content {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

  .scenarios-cards-grid,
  .shop-grid {
    grid-template-columns: 1fr;
  }

  .alert-card {
    grid-template-columns: 80px 1fr;
  }

  .alert-image {
    width: 80px;
    height: 60px;
  }
}

@media (max-width: 480px) {
  .scenario-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .topnav {
    padding: 12px 16px;
  }

  .brand {
    font-size: 20px;
  }

  .nav-links {
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }

  .nav-links a,
  .nav-links button {
    width: 100%;
    text-align: center;
  }

  .hero-section {
    padding: 32px 16px;
  }

  .hero-content h1 {
    font-size: 24px;
  }

  .hero-trust {
    flex-direction: column;
    gap: 8px;
  }

  .how-it-works,
  .scenarios-showcase,
  .pricing-section,
  .shop-section,
  .support-section {
    padding: 40px 16px;
  }

  .steps-grid,
  .scenarios-cards-grid,
  .pricing-grid,
  .shop-grid,
  .support-grid,
  .footer-content {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    padding-top: 16px;
  }

  .dashboard-topbar h1 {
    font-size: 20px;
  }

  .surveillance-header {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }

  .surveillance-controls {
    width: 100%;
  }

  .surveillance-controls .btn {
    flex: 1;
  }
}

/* ========== AUTH VIEW ========== */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  box-shadow: var(--shadow);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 24px;
  justify-content: center;
  margin-bottom: 24px;
}

.auth-brand .logo {
  font-size: 28px;
}

.auth-brand .accent {
  color: var(--accent-light);
}

.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.auth-tab {
  flex: 1;
  padding: 10px 0;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
}

.auth-tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.signup-plan-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--card-2);
  border: 1px solid rgba(230, 126, 34, 0.35);
  border-radius: 10px;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 18px;
}
.signup-plan-badge.hidden { display: none; }
.signup-plan-badge .signup-plan-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.signup-plan-badge strong { color: var(--accent-dark); }
.signup-plan-badge a {
  margin-left: auto;
  color: var(--accent-dark);
  text-decoration: underline;
  font-size: 12px;
  font-weight: 600;
}
.signup-plan-badge a:hover { color: var(--accent); }

.auth-form.hidden {
  display: none;
}

.auth-form .form-group {
  margin-bottom: 16px;
}

.auth-form .result-message {
  margin-top: 12px;
  min-height: 20px;
}

/* QW.1 — cases à cocher consentement RGPD (signup) */
.auth-consent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.auth-consent:last-of-type {
  border-bottom: none;
  margin-bottom: 16px;
}
.auth-consent input[type="checkbox"] {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent);
  cursor: pointer;
}
.auth-consent a {
  color: var(--text-muted);
  text-decoration: underline;
}
.auth-consent a:hover {
  color: var(--text);
}

/* ========== SIDEBAR USER BLOCK ========== */
.sidebar-user {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.sidebar-user-email {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
  word-break: break-all;
}

/* ========== DISCOVER MODAL ========== */
.discover-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.discover-modal.hidden {
  display: none;
}

.discover-modal-content {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
}

.discover-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}

.discover-modal-header h3 {
  margin: 0;
  font-size: 18px;
}

.discover-modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 0 6px;
}

.discover-modal-close:hover {
  color: var(--text);
}

.discover-modal-body {
  padding: 22px;
}

.discover-cam-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.discover-cam-item:hover {
  border-color: var(--accent);
  transform: translateX(2px);
}

.discover-cam-info {
  flex: 1;
  min-width: 0;
}

.discover-cam-ip {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
  color: var(--text);
  font-weight: 600;
}

.discover-cam-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.discover-cam-brand {
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.discover-cam-brand.unknown {
  background: var(--border);
  color: var(--text-muted);
}

/* ============ Onboarding wizard ============ */
.ob-step {
  flex:1;
  padding:8px 12px;
  background:rgba(255,255,255,0.05);
  border-radius:6px;
  text-align:center;
  font-size:13px;
  color:var(--bg-2);
  border:1px solid rgba(255,255,255,0.08);
}
.ob-step.done {
  background:rgba(34,197,94,0.12);
  color:#22c55e;
  border-color:rgba(34,197,94,0.3);
}
.ob-step.active {
  background:rgba(59,130,246,0.15);
  color:#60a5fa;
  border-color:rgba(59,130,246,0.4);
  font-weight:600;
}
.ob-panel {
  padding:20px;
  background:rgba(255,255,255,0.02);
  border-radius:12px;
}
.ob-panel.hidden { display:none; }
#ob-checks li {
  padding:8px 0;
  font-size:14px;
}
#ob-checks li.ok::before { content:"✅ "; }

/* --------- CONFORMITÉ PAGE --------- */
.conformite-docs {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.conformite-doc {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 20px;
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  align-items: start;
  box-shadow: var(--shadow-sm);
}
.conformite-doc-icon {
  font-size: 40px;
  line-height: 1;
  text-align: center;
}
.conformite-doc-body h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
}
.conformite-doc-body p {
  margin: 0 0 14px;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}
.conformite-doc-body .btn { margin-top: 4px; }
.conformite-doc-note {
  background: rgba(245, 158, 11, 0.06);
  border-color: rgba(245, 158, 11, 0.3);
}
.conformite-doc-note ul { color: var(--text-muted); font-size: 13px; margin: 0; }
.conformite-doc-note ul strong { color: var(--text); }
@media (max-width: 680px) {
  .conformite-doc { grid-template-columns: 1fr; text-align: center; }
  .conformite-doc-icon { font-size: 48px; }
}

/* ========== overrides direction b — correctifs ciblés ========== */
/* plus de rgba(255,255,255) sur fond clair → on remappe vers un brun doux transparent */
.ob-panel, .ob-step {
  /* ces classes ne sont plus utilisées (ancien wizard) mais au cas où */
  color: var(--text);
}
.preview-container {
  background: var(--bg-2);
  border-color: var(--border);
}
.dashboard-sidebar,
.dashboard-main,
body {
  color: var(--text);
}
.dashboard-topbar {
  background: var(--bg);
  border-bottom-color: var(--border);
}
/* status-indicator.offline et .online définis plus haut (lignes ~894-901) */

/* ========== onboarding v2 : écran post-paiement avec lien rtmp ========== */
.lb-onboard-wrap {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.lb-onboard-hero {
  text-align: center;
  padding: 8px 0 4px;
}
.lb-onboard-kicker {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-dark);
  background: var(--card-2);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.lb-onboard-title {
  font-family: var(--ff-display);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 12px;
}
.lb-onboard-lede {
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.55;
  max-width: 640px;
  margin: 0 auto;
}

.lb-onboard-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 30px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.lb-onboard-card h3 {
  font-family: var(--ff-display);
  font-size: 22px;
  font-weight: 600;
  margin: 0;
  color: var(--text);
  letter-spacing: -0.01em;
}
.lb-onboard-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.55;
}
.lb-onboard-card-accent {
  background: linear-gradient(180deg, var(--bg-2) 0%, var(--bg-3) 100%);
  border-color: rgba(230, 126, 34, 0.25);
  text-align: center;
  align-items: center;
}
.lb-onboard-card-accent h3 { text-align: center; }
.lb-onboard-card-accent p  { text-align: center; max-width: 480px; }
.lb-onboard-card-icon {
  font-size: 32px;
  line-height: 1;
  margin-bottom: 4px;
}
.lb-onboard-card-lede {
  font-size: 16px !important;
}
.lb-onboard-pay-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 6px;
}

/* carte du lien rtmp */
.lb-stream-card {
  background: linear-gradient(180deg, #fff 0%, var(--bg-2) 100%);
  border-color: rgba(230, 126, 34, 0.25);
}
.lb-stream-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.lb-stream-title-wrap { flex: 1 1 auto; }
.lb-stream-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-dark);
  margin-bottom: 6px;
}
.lb-stream-card h2,
.lb-stream-card h3 {
  font-family: var(--ff-display);
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* badge statut (dot + label) */
.lb-stream-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s;
}
.lb-stream-status .lb-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warning);
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.18);
  animation: lb-pulse 1.6s ease-in-out infinite;
}
.lb-stream-status[data-status="active"] {
  background: rgba(25, 135, 84, 0.1);
  border-color: rgba(25, 135, 84, 0.35);
  color: var(--success);
}
.lb-stream-status[data-status="active"] .lb-dot {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.2);
  animation: none;
}
.lb-stream-status[data-status="error"] {
  background: rgba(192, 57, 43, 0.1);
  border-color: rgba(192, 57, 43, 0.35);
  color: #E05555;
}
.lb-stream-status[data-status="error"] .lb-dot {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.2);
  animation: none;
}
@keyframes lb-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.55; transform: scale(0.9); }
}

/* bloc url rtmp */
.lb-stream-url-wrap {
  display: flex;
  align-items: stretch;
  gap: 10px;
  background: var(--fg);
  border-radius: var(--radius-sm);
  padding: 6px;
  margin: 4px 0 6px;
}
.lb-stream-url {
  flex: 1 1 auto;
  font-family: 'SF Mono', 'Monaco', 'Menlo', 'Courier New', monospace;
  font-size: 14px;
  color: var(--bg-3);
  padding: 12px 14px;
  overflow-x: auto;
  white-space: nowrap;
  letter-spacing: 0.02em;
  user-select: all;
}
.lb-stream-url-wrap .btn {
  flex: 0 0 auto;
  padding: 10px 18px;
  white-space: nowrap;
}
.lb-stream-tip {
  font-size: 13px;
  color: var(--text-muted);
  margin: 4px 0 0;
  line-height: 1.5;
}
.lb-stream-tip-muted {
  font-size: 12px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}

/* form label variant */
.lb-form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
  margin-top: 4px;
}

/* guide amcrest numéroté */
.lb-guide-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.lb-guide-steps li {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 14px;
  align-items: flex-start;
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
}
.lb-guide-step-n {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.lb-guide-steps li strong { color: var(--text); }

/* telegram row dans onboarding */
.lb-onboard-tg-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 4px;
}

/* état "copié" */
.btn.is-copied {
  background: var(--success) !important;
  color: #fff !important;
  border-color: var(--success) !important;
}

/* responsive onboarding */
@media (max-width: 640px) {
  .lb-onboard-wrap { gap: 20px; }
  .lb-onboard-card { padding: 22px 20px; }
  .lb-stream-url { font-size: 12.5px; padding: 10px 12px; }
  .lb-stream-url-wrap { flex-direction: column; }
  .lb-stream-url-wrap .btn { width: 100%; }
  .lb-onboard-pay-actions { flex-direction: column; }
  .lb-onboard-pay-actions .btn { width: 100%; }
}

/* ============================================================
   pivot cloud : grille marques + modale connect (2026-04-25)
   ============================================================ */

/* recherche marques */
.lb-providers-search-wrap { margin: 12px 0 8px; }
.lb-providers-search {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  background: var(--card);
  color: var(--text);
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.lb-providers-search:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.15);
}

.lb-providers-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 24px 0 12px;
}
.lb-providers-section-title-muted { opacity: 0.7; }

/* grille de marques */
.lb-providers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.lb-providers-grid-muted .lb-provider-card { opacity: 0.55; }

.lb-provider-card {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  text-align: center;
}
.lb-provider-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.lb-provider-card-active { border-color: var(--accent-light); }
.lb-provider-card-coming_soon { cursor: pointer; }
.lb-provider-card-coming_soon:hover { border-color: var(--accent-light); }
.lb-provider-card-disabled { cursor: not-allowed; }
.lb-provider-card-disabled:hover {
  border-color: var(--border);
  transform: none;
  box-shadow: none;
}

.lb-provider-logo {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  background: var(--card-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--accent-dark);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.lb-provider-logo[data-logo="ezviz"] {
  background: linear-gradient(135deg, #0066cc, #003d80);
  color: #fff;
}
.lb-provider-logo[data-logo="imou"] {
  background: linear-gradient(135deg, #f56500, #c43d00);
  color: #fff;
}
.lb-provider-logo[data-logo="reolink"] {
  background: linear-gradient(135deg, #2e7d32, #1b5e20);
  color: #fff;
}
.lb-provider-logo[data-logo="nest"] {
  background: linear-gradient(135deg, #4285f4, #1a73e8);
  color: #fff;
}
.lb-provider-logo[data-logo="ring"] {
  background: linear-gradient(135deg, #2196f3, #1565c0);
  color: #fff;
}
.lb-provider-logo[data-logo="arlo"] {
  background: linear-gradient(135deg, #00b8d4, #0097a7);
  color: #fff;
}
.lb-provider-logo[data-logo="blink"] {
  background: linear-gradient(135deg, #424242, #212121);
  color: #fff;
}
.lb-provider-logo[data-logo="eufy"] {
  background: linear-gradient(135deg, #ffc107, #ff8f00);
  color: #fff;
}
.lb-provider-logo[data-logo="tapo"] {
  background: linear-gradient(135deg, #7c4dff, #512da8);
  color: #fff;
}
.lb-provider-logo[data-logo="wyze"] {
  background: linear-gradient(135deg, #00bcd4, #00838f);
  color: #fff;
}

.lb-provider-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.lb-provider-status {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.lb-provider-card-active .lb-provider-status {
  color: var(--success);
}
.lb-provider-card-coming_soon .lb-provider-status {
  color: var(--warning);
}

/* ============= templates de prompts custom (page settings) ============= */
.prompt-templates-wrap {
  margin: 0 0 14px;
  padding: 14px 16px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.prompt-templates-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.prompt-templates-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.prompt-templates-cat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.prompt-templates-cat-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: capitalize;
  margin: 0 0 2px;
}
.prompt-templates-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.prompt-template-chip {
  padding: 6px 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  transition: all 160ms ease;
  white-space: nowrap;
}
.prompt-template-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}
.prompt-template-chip-active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* ============= modale ============= */
.lb-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.lb-modal.hidden { display: none; }
.lb-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
}
.lb-modal-card {
  position: relative;
  background: var(--card);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}
.lb-modal-card-sm { max-width: 420px; }
.lb-modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: transparent;
  border: none;
  font-size: 28px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 6px 10px;
  border-radius: 8px;
  transition: background 0.2s;
}
.lb-modal-close:hover {
  background: var(--card-2);
  color: var(--text);
}

.lb-modal-header { margin-bottom: 20px; }
.lb-modal-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}
.lb-modal-brand-logo {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.lb-modal-brand-logo[data-provider="ezviz"] {
  background: linear-gradient(135deg, #0066cc, #003d80);
  color: #fff;
}
.lb-modal-brand-logo[data-provider="imou"] {
  background: linear-gradient(135deg, #f56500, #c43d00);
  color: #fff;
}
.lb-modal-brand-logo[data-provider="reolink"] {
  background: linear-gradient(135deg, #2e7d32, #1b5e20);
  color: #fff;
}
.lb-modal-brand-logo[data-provider="nest"] {
  background: linear-gradient(135deg, #4285f4, #1a73e8);
  color: #fff;
}
.lb-modal-header h3 {
  margin: 0;
  font-size: 20px;
  color: var(--text);
}
.lb-modal-subtitle {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 14px;
}

.lb-modal-body { display: flex; flex-direction: column; gap: 16px; }
.lb-modal-help {
  background: var(--card-2);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.55;
}
.lb-modal-help strong { color: var(--text); display: block; margin-bottom: 4px; }
.lb-modal-help code {
  background: var(--bg-2);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--text);
}
.lb-modal-help em { font-style: normal; font-weight: 600; color: var(--text); }

.lb-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 8px;
}
.lb-modal-actions .btn { min-width: 120px; }

.lb-modal-icon-warn {
  font-size: 48px;
  text-align: center;
  margin-bottom: 12px;
}

/* ============= boutons lb-btn (global, pour les modales hors landing) ============= */
/* note : les versions scopées #landing-view.landing-b .lb-btn-* dans style-landing.css
   ne s'appliquent que dans la landing. ces versions globales sont utilisées par les
   modales (modal-cam-test, modal-order-box, etc.) qui vivent au niveau racine du dom. */
.lb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.2;
}
.lb-btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 6px 16px -4px rgba(230, 126, 34, 0.45);
}
.lb-btn-primary:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -4px rgba(230, 126, 34, 0.5);
}
.lb-btn-secondary {
  background: var(--bg-2);
  color: var(--fg);
  border: 2px solid var(--accent);
}
.lb-btn-secondary:hover {
  background: var(--bg-2)1e6;
  border-color: var(--accent-dark);
  color: var(--accent-dark);
}
.lb-btn-ghost {
  background: var(--bg-2);
  color: var(--fg);
  border: 1px solid rgba(0, 0, 0, 0.18);
}
.lb-btn-ghost:hover {
  background: var(--bg);
  border-color: rgba(0, 0, 0, 0.4);
}
.lb-btn-lg { padding: 14px 28px; font-size: 16px; }
.lb-btn-xl { padding: 16px 32px; font-size: 17px; }

/* ============= page caméras : carte "connecter compte cloud" ============= */
.lb-cloud-connect-card {
  margin-bottom: 16px;
}
.lb-cloud-connect-head {
  margin-bottom: 14px;
}
.lb-cloud-providers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}
.lb-cloud-provider-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
  text-align: left;
  transition: all 160ms ease;
  width: 100%;
}
.lb-cloud-provider-btn:hover:not(.lb-cloud-provider-btn-disabled) {
  border-color: var(--accent);
  background: var(--card);
}
.lb-cloud-provider-btn-disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.lb-cloud-provider-logo {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
}
.lb-cloud-provider-info {
  flex: 1;
  min-width: 0;
}
.lb-cloud-provider-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}
.lb-cloud-provider-status {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.lb-cloud-provider-cta {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  flex-shrink: 0;
}

/* ============= modal connecter ezviz (cloud user) ============= */
.lb-ezviz-success {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 12px;
  margin-bottom: 14px;
}
.lb-ezviz-success-icon {
  font-size: 28px;
  line-height: 1;
}
.lb-ezviz-success-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.lb-ezviz-success-text strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.lb-ezviz-success-text span {
  font-size: 12px;
  color: var(--text-muted);
}
.lb-ezviz-cams {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
}
.lb-ezviz-cam {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.lb-ezviz-cam-icon {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}
.lb-ezviz-cam-info {
  flex: 1;
  min-width: 0;
}
.lb-ezviz-cam-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lb-ezviz-cam-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ============= modal test de compatibilité caméra (plan c) ============= */
.lb-camtest-step.hidden { display: none; }
.lb-camtest-icon {
  font-size: 48px;
  text-align: center;
  margin-bottom: 8px;
}
.lb-camtest-sub {
  text-align: center;
  font-size: 15px;
  color: var(--text-muted);
  margin: 0 0 16px;
}
.lb-camtest-brand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
  margin: 0 0 14px;
}
.lb-camtest-brand-card {
  padding: 14px 8px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  text-align: center;
  font-family: inherit;
  color: var(--text);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.lb-camtest-brand-card:hover {
  border-color: var(--accent);
  background: var(--card);
  transform: translateY(-2px);
}
.lb-camtest-brand-emoji {
  font-size: 22px;
  line-height: 1;
}
.lb-camtest-brand-label {
  font-size: 13px;
  font-weight: 600;
}
.lb-camtest-finehint {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}
.lb-camtest-result {
  text-align: center;
  padding: 24px 20px;
  border-radius: 16px;
  margin-bottom: 14px;
}
.lb-camtest-result-rtmp_ok,
.lb-camtest-result-cloud_ok {
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.3);
}
.lb-camtest-result-closed {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.lb-camtest-result-unknown {
  background: rgba(17, 17, 18, 0.05);
  border: 1px solid rgba(17, 17, 18, 0.18);
}
.lb-camtest-result-icon {
  font-size: 44px;
  line-height: 1;
  margin-bottom: 6px;
}
.lb-camtest-result h3 {
  margin: 4px 0 2px;
  font-size: 20px;
  font-weight: 700;
}
.lb-camtest-brand-name {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-weight: 600;
}
.lb-camtest-result-note {
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
  margin: 0 0 18px;
}
.lb-camtest-result-cta {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.lb-camtest-result-cta .lb-btn { width: 100%; }
.lb-camtest-result-cta a.lb-btn { text-align: center; text-decoration: none; }
.lb-camtest-back {
  display: block;
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  padding: 8px;
  transition: color 160ms ease;
}
.lb-camtest-back:hover { color: var(--accent); }

/* nouveaux statuts (refonte hero 2026-04-26) */
.lb-camtest-result-supported,
.lb-camtest-result-supported_amazon {
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.3);
}
.lb-camtest-result-coming_soon {
  background: rgba(250, 204, 21, 0.08);
  border: 1px solid rgba(250, 204, 21, 0.3);
}

/* badge "Compatible immédiat" sur les marques mises en avant */
.lb-camtest-brand-card-featured {
  border: 2px solid var(--accent) !important;
  background: rgba(17, 17, 18, 0.04);
  position: relative;
}
.lb-camtest-brand-badge {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* lead capture form (coming_soon) */
.lb-camtest-leadform {
  margin-top: 14px;
  padding: 14px;
  background: var(--bg-2);
  border-radius: 12px;
  text-align: left;
}
.lb-camtest-leadform-label {
  display: block;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 8px;
  font-weight: 500;
}
.lb-camtest-leadform-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.lb-camtest-leadform-input {
  flex: 1 1 180px;
  min-width: 0;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-2);
  color: var(--text);
  font-family: inherit;
}
.lb-camtest-leadform-input:focus {
  outline: 2px solid rgba(17, 17, 18, 0.18);
  border-color: var(--accent);
}
.lb-camtest-leadform-result {
  font-size: 13px;
  margin-top: 8px;
  min-height: 18px;
}
.lb-camtest-leadform-result.success { color: #16a34a; font-weight: 600; }
.lb-camtest-leadform-result.error { color: #dc2626; font-weight: 600; }
.lb-camtest-leadform-result.info { color: var(--text-muted); }

/* ============= hero camtest (lead-magnet en hero, refonte 2026-04-26) ============= */
.lb-hero-camtest-card {
  background: var(--bg-2)fff;
  border-radius: 20px;
  padding: 28px 26px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.10), 0 4px 12px rgba(15, 23, 42, 0.05);
  border: 1px solid rgba(15, 23, 42, 0.06);
  max-width: 480px;
  width: 100%;
  justify-self: end;
  animation: lb-camtest-fadein 320ms ease;
}
.lb-camtest-hero-step.hidden { display: none; }
.lb-camtest-hero-step {
  animation: lb-camtest-fadein 300ms ease;
}
.lb-camtest-hero-head {
  text-align: center;
  margin-bottom: 16px;
}
.lb-camtest-hero-icon {
  font-size: 36px;
  line-height: 1;
  margin-bottom: 6px;
}
.lb-camtest-hero-title {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 700;
  color: var(--text, #1e293b);
  letter-spacing: -0.01em;
}
.lb-camtest-hero-sub {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted, #64748b);
}
.lb-camtest-hero-finehint {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted, #64748b);
  margin: 12px 0 0;
}
.lb-camtest-brand-grid-hero {
  grid-template-columns: repeat(4, 1fr);
}
.lb-hero-tertiary {
  display: inline-block;
  margin-top: 18px;
  font-size: 14px;
  color: var(--text-muted, #64748b);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.lb-hero-tertiary:hover { color: var(--accent); }
.lb-hero-trust {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  margin-top: 8px;
}

@keyframes lb-camtest-fadein {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 880px) {
  .lb-hero-camtest-card {
    justify-self: stretch;
    max-width: 100%;
    padding: 22px 18px;
  }
  .lb-camtest-brand-grid-hero {
    grid-template-columns: repeat(2, 1fr);
  }
  .lb-camtest-hero-title { font-size: 20px; }
}

/* ============= modal commander la vigil box (plan b) ============= */
.lb-orderbox-icon {
  font-size: 56px;
  text-align: center;
  margin-bottom: 8px;
}
.lb-orderbox-sub {
  text-align: center;
  font-size: 15px;
  color: var(--text-muted);
  margin: 0 0 18px;
  line-height: 1.5;
}
.lb-orderbox-features {
  list-style: none;
  padding: 0;
  margin: 0 0 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.lb-orderbox-features li {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  color: var(--text);
  line-height: 1.45;
}
.lb-orderbox-features li strong {
  color: var(--accent);
  font-weight: 700;
}
.lb-orderbox-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.lb-orderbox-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.lb-orderbox-input {
  width: 100%;
  padding: 14px 16px;
  font-size: 15px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-family: inherit;
  transition: border-color 160ms ease;
}
.lb-orderbox-input:focus {
  outline: none;
  border-color: var(--accent);
}
.lb-orderbox-fineprint {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 8px 0 0;
}

/* ============= page mes caméras ============= */
.lb-camera-empty {
  text-align: center;
  padding: 40px 20px;
}
.lb-camera-empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}
.lb-camera-empty h2 { margin: 0 0 8px; }
.lb-camera-empty .form-hint { max-width: 420px; margin: 0 auto 24px; }

.lb-cameras-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.lb-cameras-header h2 { margin: 0 0 4px; }

.lb-cameras-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.lb-cam-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  background: var(--card-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  flex-wrap: wrap;
}
.lb-cam-row-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1;
}
.lb-cam-row-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.lb-cam-row-info { min-width: 0; }
.lb-cam-row-name {
  font-weight: 600;
  color: var(--text);
  font-size: 15px;
  margin-bottom: 2px;
}
.lb-cam-row-meta {
  font-size: 12.5px;
  color: var(--text-muted);
  font-family: ui-monospace, 'SF Mono', monospace;
}
.lb-cam-row-cloud {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.lb-cam-cloud-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(59, 130, 246, 0.12);
  color: #1e40af;
  padding: 3px 8px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  cursor: help;
}
.lb-cam-cloud-last {
  font-size: 12px;
  color: var(--success);
  font-weight: 500;
}
.lb-cam-cloud-pending {
  font-size: 12px;
  color: var(--warning);
  font-weight: 500;
}
.lb-cam-encrypted-banner {
  flex-basis: 100%;
  margin-top: 14px;
  padding: 18px 20px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(245, 158, 11, 0.04));
  border-left: 4px solid #f59e0b;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
}
.lb-cam-encrypted-banner strong { color: #b45309; }
.lb-cam-encrypted-banner em { font-style: italic; }
.lb-cam-encrypted-header { margin-bottom: 14px; }
.lb-cam-encrypted-title {
  font-size: 16px;
  font-weight: 700;
  color: #b45309;
  margin-bottom: 4px;
}
.lb-cam-encrypted-tagline {
  font-size: 13px;
  color: var(--text);
  opacity: 0.85;
}
.lb-cam-encrypted-banner-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 14px 0;
}
.lb-cam-encrypted-step {
  position: relative;
  padding: 14px 12px 12px;
  background: var(--bg-2);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 8px;
  text-align: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.lb-cam-encrypted-step:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
}
.lb-cam-encrypted-step-emoji {
  font-size: 28px;
  line-height: 1;
  margin-bottom: 6px;
}
.lb-cam-encrypted-step-num {
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 11px;
  font-weight: 700;
  color: #b45309;
  background: rgba(245, 158, 11, 0.15);
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.lb-cam-encrypted-step-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.lb-cam-encrypted-step-text {
  font-size: 12px;
  color: var(--text);
  opacity: 0.75;
  line-height: 1.4;
}
.lb-cam-encrypted-note {
  margin-top: 10px;
  padding: 12px 14px;
  background: var(--bg-2);
  border-radius: 6px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text);
}
.lb-cam-encrypted-help-link {
  display: inline-block;
  margin-top: 8px;
  color: #b45309;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(180, 83, 9, 0.3);
}
.lb-cam-encrypted-help-link:hover {
  border-bottom-color: #b45309;
}
@media (max-width: 720px) {
  .lb-cam-encrypted-banner-steps {
    grid-template-columns: 1fr;
  }
}

.lb-cam-row-just-added {
  animation: lb-cam-flash 2.5s ease-out;
  border-radius: 12px;
}
@keyframes lb-cam-flash {
  0%   { background-color: rgba(59, 130, 246, 0); }
  15%  { background-color: rgba(59, 130, 246, 0.22); }
  100% { background-color: rgba(59, 130, 246, 0); }
}
.lb-cam-row-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.lb-ezviz-howitworks {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
  background: rgba(59, 130, 246, 0.08);
  border-left: 3px solid #3b82f6;
  padding: 10px 14px;
  border-radius: 6px;
  margin: 12px 0;
}
.lb-ezviz-howitworks strong { color: var(--text); }
.lb-ezviz-howitworks em { font-style: italic; color: var(--text); }

.lb-cam-status {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 999px;
}
.lb-cam-status[data-status="online"] {
  background: rgba(15, 81, 50, 0.12);
  color: var(--success);
}
.lb-cam-status[data-status="offline"] {
  background: rgba(146, 64, 14, 0.12);
  color: var(--warning);
}
.lb-cam-status[data-status="error"] {
  background: rgba(143, 29, 20, 0.12);
  color: var(--danger, #D45050);
}
.lb-cam-status[data-status="unknown"] {
  background: var(--bg-2);
  color: var(--text-muted);
}

.lb-modal-sub {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.55;
  margin: 0 0 18px 0;
}


.btn-sm {
  padding: 5px 10px !important;
  font-size: 12px !important;
  border-radius: 6px !important;
}
.btn.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.btn.ghost:hover {
  background: var(--card-2);
  color: var(--text);
}

/* responsive */
@media (max-width: 640px) {
  .lb-modal-card { padding: 24px 20px; max-height: 95vh; }
  .lb-modal-actions { flex-direction: column-reverse; }
  .lb-modal-actions .btn { width: 100%; }
  .lb-providers-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .lb-cam-row { flex-direction: column; align-items: stretch; }
  .lb-cam-row-actions { justify-content: space-between; }
}

/* ========== multi-cam : sélecteur global + mosaïque NVR (v42) ========== */
.cam-selector-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
}
.cam-selector-wrap.hidden { display: none !important; }
.cam-selector-label { color: var(--text-muted); white-space: nowrap; }
.cam-selector {
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 4px;
}
.cam-selector:focus { outline: none; }

.cam-active-name {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent, #b45309);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
}

.alerts-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.alerts-filter-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--card-2, var(--card));
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
}

.cams-mosaic {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 12px;
}
.cam-tile {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--card);
  display: flex;
  flex-direction: column;
}
.cam-tile-img-wrap {
  aspect-ratio: 16 / 9;
  background: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bg-2);
  font-size: 13px;
  text-align: center;
  padding: 8px;
}
.cam-tile-img-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam-tile-body { padding: 10px 12px; }
.cam-tile-name { font-weight: 600; font-size: 14px; margin: 0 0 4px; }
.cam-tile-meta { font-size: 12px; color: var(--text-muted); margin: 0 0 6px; }
.cam-tile-verdict { font-size: 12px; line-height: 1.4; }

.lb-cam-row-actions .btn-rename { padding: 4px 10px; font-size: 12px; }

/* ============ REFONTE UX 2026-04-26 ============ */

/* HOME PAGE */
/* ===== Disclaimer médico-légal sur la page Accueil ===== */
.home-disclaimer-card {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 18px;
  background: linear-gradient(180deg, rgba(245,158,11,0.08), rgba(245,158,11,0.03));
  border: 1px solid rgba(245,158,11,0.40);
  border-left: 4px solid var(--warning, #f59e0b);
}
.home-disclaimer-icon {
  font-size: 22px; line-height: 1;
  flex: 0 0 auto;
}
.home-disclaimer-text {
  font-size: 13px; color: var(--fg);
  font-family: "Inter", var(--sans);
  line-height: 1.55;
}
.home-disclaimer-text strong { color: var(--warning, #f59e0b); }

/* Disclaimer permanent en pied de dashboard (sticky) */
.dashboard-footer-disclaimer {
  background: rgba(245,158,11,0.08);
  border-top: 1px solid rgba(245,158,11,0.30);
  border-bottom: 1px solid rgba(245,158,11,0.30);
  padding: 10px 18px;
  font-size: 12.5px;
  color: var(--fg);
  font-family: "Inter", var(--sans);
  line-height: 1.45;
  text-align: center;
}
.dashboard-footer-disclaimer strong { color: var(--warning, #f59e0b); }

/* ===== Mode présent / absent ===== */
.home-mode-card {
  padding: 18px 22px;
  background: linear-gradient(180deg, rgba(74, 222, 128, 0.06), transparent);
  border: 1px solid rgba(74, 222, 128, 0.30);
  transition: background .2s, border-color .2s;
}
.home-mode-card[data-mode="away"] {
  background: linear-gradient(180deg, rgba(248, 113, 113, 0.10), transparent);
  border-color: rgba(248, 113, 113, 0.45);
}
.home-mode-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.home-mode-text { flex: 1; min-width: 200px; }
.home-mode-title {
  font-family: "Instrument Serif", var(--serif), serif;
  font-size: 22px; font-weight: 500; color: var(--fg);
  letter-spacing: 0.01em;
}
.home-mode-title #home-mode-current { font-style: italic; color: #4ade80; }
.home-mode-card[data-mode="away"] .home-mode-title #home-mode-current { color: #f87171; }
.home-mode-sub {
  font-size: 13.5px; color: var(--fg-mute);
  margin-top: 4px;
  font-family: "Inter", var(--sans);
  line-height: 1.45;
}
.home-mode-toggle-wrap {
  display: inline-flex;
  background: var(--bg-2, #18181b);
  border-radius: 999px;
  padding: 4px;
  gap: 2px;
}
.home-mode-btn {
  background: transparent; border: 0; cursor: pointer;
  padding: 8px 16px; border-radius: 999px;
  font-size: 13px; font-weight: 600;
  font-family: "Inter", var(--sans);
  color: var(--fg-mute);
  transition: background .15s, color .15s;
}
.home-mode-btn:hover { color: var(--fg); }
.home-mode-btn.active {
  background: var(--card, #27272a);
  color: var(--fg);
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.home-mode-card[data-mode="home"] .home-mode-btn.active { color: #4ade80; }
.home-mode-card[data-mode="away"] .home-mode-btn.active { color: #f87171; }

/* ===== Widget consommation Gemini (cap billing) ===== */
.home-usage-card { padding: 18px 22px; }
.home-usage-card[data-state="warn"] {
  background: linear-gradient(180deg, rgba(245,158,11,0.05), transparent);
  border-color: rgba(245,158,11,0.30);
}
.home-usage-card[data-state="over"] {
  background: linear-gradient(180deg, rgba(248,113,113,0.07), transparent);
  border-color: rgba(248,113,113,0.45);
}
.home-usage-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 12px; gap: 10px;
}
.home-usage-meta { font-size: 12px; color: var(--fg-mute); font-family: "Inter", var(--sans); }
.home-usage-bar-wrap {
  height: 10px; background: var(--bg-2, #18181b);
  border-radius: 5px; overflow: hidden;
  margin-bottom: 12px;
}
.home-usage-bar {
  width: var(--p, 0%);
  height: 100%;
  background: linear-gradient(90deg, #4ade80, #4ade80);
  transition: width .4s ease;
}
.home-usage-card[data-state="mid"] .home-usage-bar {
  background: linear-gradient(90deg, #4ade80, #facc15);
}
.home-usage-card[data-state="warn"] .home-usage-bar {
  background: linear-gradient(90deg, #facc15, #f59e0b);
}
.home-usage-card[data-state="over"] .home-usage-bar {
  background: linear-gradient(90deg, #f87171, #ef4444);
}
.home-usage-text {
  font-size: 13px; color: var(--fg-mute);
  font-family: "Inter", var(--sans);
  line-height: 1.5;
}

/* ===== Heatmap activité par heure ===== */
.home-heatmap-card { padding: 18px 22px; }
.home-heatmap-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 14px; gap: 10px;
}
.home-heatmap-meta { font-size: 12px; color: var(--fg-mute); font-family: "Inter", var(--sans); }
.home-heatmap-grid {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  gap: 3px;
  align-items: end;
  height: 80px;
  margin-bottom: 12px;
}
.hm-cell {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  height: 100%;
  cursor: help;
  --i: 0;
}
.hm-bar {
  width: 100%;
  background: rgba(74, 222, 128, calc(0.15 + var(--i) * 0.85));
  border-radius: 3px 3px 0 0;
  height: calc(8% + var(--i) * 92%);
  transition: background .15s;
}
.hm-cell:hover .hm-bar { background: #4ade80; }
.hm-cell.is-peak .hm-bar { background: #facc15; }
.hm-label {
  font-size: 9px; color: var(--fg-mute);
  font-family: "Inter", var(--sans);
  margin-top: 3px;
  display: none;
}
.hm-cell:nth-child(6n+1) .hm-label,
.hm-cell:nth-child(24) .hm-label { display: block; }
.home-heatmap-summary { font-size: 13px; color: var(--fg-mute); font-family: "Inter", var(--sans); }

/* ===== Plage horaire dans cam settings ===== */
.cam-hours-row {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
}
.cam-hours-row .cam-settings-label { margin: 0; min-width: auto; }
.cam-hours-select {
  flex: 0 0 auto; width: auto; min-width: 92px;
}
.cam-hours-hint {
  font-size: 12px; color: var(--fg-mute);
  margin-top: 6px;
  font-family: "Inter", var(--sans);
}

.home-status-card { padding: 18px 22px; }
.home-status-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.home-status-info { display: flex; align-items: center; gap: 14px; }
.home-status-dot {
  width: 14px; height: 14px; border-radius: 50%;
  box-shadow: 0 0 0 4px var(--bg-2);
}
.home-status-dot.online { background: #16a34a; box-shadow: 0 0 0 4px rgba(22,163,74,0.18); }
.home-status-dot.offline { background: #9ca3af; }
.home-status-dot.warning { background: var(--warning, #f59e0b); box-shadow: 0 0 0 4px rgba(245,158,11,0.20); }
.home-status-title { font-weight: 700; font-size: 16px; color: var(--text); }
.home-status-sub { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
/* warning state : EZVIZ déconnecté → carte bordée orange + bouton primary qui devient warning */
.home-status-card.is-warning {
  border-color: rgba(245,158,11,0.55);
  background: linear-gradient(180deg, rgba(245,158,11,0.06), transparent);
}
.home-status-card.is-warning .btn.primary {
  background: var(--warning, #f59e0b);
  color: #0b0b0c;
  border-color: var(--warning, #f59e0b);
}
.home-status-card.is-warning .btn.primary:hover { filter: brightness(1.07); }

.home-cams-grid {
  display: grid; gap: 16px;
  grid-template-columns: 1fr;
}
.home-cams-grid.multi {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.home-cam-tile {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden; cursor: pointer;
  transition: transform .15s ease, border-color .15s ease;
  position: relative;
}
.home-cam-tile:hover { transform: translateY(-2px); border-color: var(--accent); }
.home-cam-tile-img {
  width: 100%; aspect-ratio: 16/9; object-fit: cover;
  background: var(--bg-2); display: block;
}
.home-cam-tile-img.large { aspect-ratio: 16/10; }
.home-cam-tile-body { padding: 12px 14px; }
.home-cam-tile-name { font-weight: 600; color: var(--text); margin-bottom: 4px; }
.home-cam-tile-meta { font-size: 12px; color: var(--text-muted); }
/* état stale : cam encore visible mais session EZVIZ KO */
.home-cam-tile.is-stale .home-cam-tile-img { opacity: 0.55; filter: grayscale(0.3); }
.home-cam-tile.is-stale { border-color: rgba(245,158,11,0.45); }
.home-cam-tile.is-stale:hover { border-color: var(--warning, #f59e0b); }
.home-cam-tile-overlay {
  position: absolute; left: 10px; right: 10px; top: 10px;
  background: rgba(245,158,11,0.92); color: #0b0b0c;
  font-family: "Inter", var(--sans);
  font-size: 12px; font-weight: 600;
  padding: 6px 10px; border-radius: 8px;
  text-align: center;
  pointer-events: none;
}

.home-alerts-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}
.home-alerts-link { color: var(--accent); text-decoration: none; font-weight: 600; font-size: 14px; }
.home-alerts-link:hover { text-decoration: underline; }
.home-alerts-list { display: flex; flex-direction: column; gap: 10px; }
.home-alert-item {
  display: flex; gap: 12px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--card);
}
.home-alert-icon { font-size: 22px; }
.home-alert-body { flex: 1; min-width: 0; }
.home-alert-title { font-weight: 600; color: var(--text); font-size: 14px; }
.home-alert-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* SETTINGS TABS */
.settings-tabs {
  display: flex; gap: 4px; margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.settings-tab {
  background: transparent; border: none; padding: 12px 18px;
  cursor: pointer; font-weight: 600; font-size: 14px;
  color: var(--text-muted); border-bottom: 3px solid transparent;
  white-space: nowrap; transition: all .15s;
}
.settings-tab:hover { color: var(--text); }
.settings-tab.active {
  color: var(--accent); border-bottom-color: var(--accent);
}
.settings-tab-panel { display: none; }
.settings-tab-panel.active { display: block; }

/* AUTOSAVE INDICATOR */
.autosave-indicator {
  display: inline-block; margin-left: 8px;
  font-size: 12px; font-weight: 600;
  opacity: 0; transition: opacity .25s ease;
  color: #16a34a;
}
.autosave-indicator.visible { opacity: 1; }
.autosave-indicator.saving { color: var(--text-muted); }

/* WARNING AVANCÉ */
.advanced-warning-card {
  border: 1px solid #f59e0b !important;
  background: rgba(245, 158, 11, 0.08) !important;
}
.advanced-warning {
  display: flex; gap: 14px; align-items: flex-start;
}
.advanced-warning-icon { font-size: 28px; line-height: 1; }
.advanced-warning-text strong {
  display: block; color: #b45309; font-size: 16px; margin-bottom: 4px;
}
.advanced-warning-text p {
  margin: 0; color: var(--text); font-size: 14px; line-height: 1.5;
}

/* FOOTER GLOBAL DASHBOARD */
.dashboard-footer {
  margin-top: 32px; padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-2);
}
.dashboard-footer-inner {
  display: flex; gap: 18px; flex-wrap: wrap;
  font-size: 12px; color: var(--text-muted);
  justify-content: center; align-items: center;
}
.dashboard-footer-inner a {
  color: var(--text-muted); text-decoration: none;
}
.dashboard-footer-inner a:hover {
  color: var(--accent); text-decoration: underline;
}

/* BOTTOM-NAV MOBILE */
.bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--card);
  border-top: 1px solid var(--border);
  z-index: 100;
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.06);
}
.bottom-nav-btn {
  display: flex; flex-direction: column; align-items: center;
  gap: 2px; padding: 6px 12px; min-width: 56px;
  text-decoration: none; color: var(--text-muted);
  font-size: 11px; font-weight: 500;
}
.bottom-nav-btn.active { color: var(--accent); }
.bottom-nav-icon { font-size: 22px; line-height: 1; }
.bottom-nav-add-circle {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 300; line-height: 1;
  box-shadow: 0 4px 12px rgba(230, 126, 34, 0.4);
  margin-top: -10px;
}
.bottom-nav-add { padding: 0 12px; }

@media (max-width: 768px) {
  .bottom-nav { display: flex; }
  .dashboard-main { padding-bottom: 80px; }
  .dashboard-sidebar { display: none; }
  .dashboard-footer { margin-bottom: 70px; }
}

/* ALERTS — refondues 2026-04-26 */
.alerts-day-header {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-muted);
  margin: 18px 0 8px; padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.alert-card-clickable {
  cursor: pointer; transition: transform .12s ease, border-color .12s ease;
}
.alert-card-clickable:hover {
  transform: translateY(-1px); border-color: var(--accent);
}
.alerts-load-more {
  display: block; margin: 18px auto;
}
/* Modal alert detail */
.lb-modal-card-lg { max-width: 720px; }
.alert-modal-img {
  width: 100%; max-height: 60vh; object-fit: contain;
  border-radius: 10px; background: var(--bg-2);
}
.alert-modal-img-placeholder {
  width: 100%; height: 280px; background: var(--bg-2);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 64px; color: var(--text-muted);
}

/* ============================================================
   BANNER abonnement par caméra (topbar dashboard)
   ============================================================ */
.cam-billing-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  margin: 14px 24px 0;
  background: linear-gradient(135deg, rgba(217,119,6,0.10), rgba(217,119,6,0.04));
  border: 1px solid rgba(217,119,6,0.32);
  border-radius: var(--radius);
  color: var(--fg);
}
.cam-billing-banner.hidden { display: none; }
.cam-billing-banner.is-trial {
  background: linear-gradient(135deg, rgba(74,222,128,0.10), rgba(74,222,128,0.04));
  border-color: rgba(74,222,128,0.32);
}
.cam-billing-banner.is-expired {
  background: linear-gradient(135deg, rgba(248,113,113,0.10), rgba(248,113,113,0.04));
  border-color: rgba(248,113,113,0.40);
}
.cam-billing-banner-icon {
  font-size: 18px;
  color: var(--warning);
  flex: none;
}
.cam-billing-banner.is-trial .cam-billing-banner-icon { color: var(--success); }
.cam-billing-banner.is-expired .cam-billing-banner-icon { color: var(--danger); }
.cam-billing-banner-text { flex: 1; min-width: 0; }
.cam-billing-banner-title {
  font-weight: 600; font-size: 14.5px;
  color: var(--fg); margin-bottom: 2px;
}
.cam-billing-banner-sub {
  font-size: 13px; color: var(--fg-dim);
}
.cam-billing-banner button { white-space: nowrap; flex: none; }

@media (max-width: 700px) {
  .cam-billing-banner { flex-direction: column; align-items: flex-start; }
  .cam-billing-banner button { width: 100%; }
}

/* ============================================================
   Liste abonnements per-cam (page Mon abonnement)
   ============================================================ */
.billing-cams-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 10px;
}
.billing-cam-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.billing-cam-info { flex: 1; min-width: 0; }
.billing-cam-name {
  font-weight: 600; font-size: 15px; color: var(--fg);
  margin-bottom: 4px;
}
.billing-cam-detail { font-size: 13px; color: var(--fg-dim); }
.billing-cam-cta { flex: none; }
.billing-state {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.02em;
  background: var(--bg-3); color: var(--fg-dim);
  margin-right: 6px;
}
.billing-state-active        { background: rgba(74,222,128,0.16); color: #4ade80; }
.billing-state-trial         { background: rgba(74,222,128,0.10); color: #4ade80; }
.billing-state-trial_expired { background: rgba(248,113,113,0.14); color: #f87171; }
.billing-state-expired       { background: rgba(248,113,113,0.14); color: #f87171; }
.billing-state-none          { background: rgba(168,168,163,0.14); color: var(--fg-dim); }
.billing-state-admin_bypass  { background: rgba(255,255,255,0.10); color: var(--fg); }

@media (max-width: 700px) {
  .billing-cam-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .billing-cam-cta button { width: 100%; }
}

/* ============================================================
   PAGE MES CAMÉRAS — liste verticale, 1 carte/cam, accordéon réglages
   ============================================================ */
.cams-vertical-list {
  display: flex; flex-direction: column; gap: 16px;
  margin: 16px 24px 40px;
}
.cams-header-card {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  margin: 16px 24px 0;
  padding: 18px 22px;
}
.cams-header-card h2 { margin: 0 0 4px; font-size: 22px; font-family: var(--serif);  font-weight: 400; }
.cams-header-card .form-hint { margin: 0; }

.cams-empty {
  text-align: center; padding: 50px 20px;
}
.cams-empty h2 {
  font-family: var(--serif);  font-weight: 400;
  font-size: 26px; margin-bottom: 10px;
}

/* card par cam */
.cam-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .15s;
}
.cam-card:hover { border-color: var(--line-2); }

.cam-card-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px;
  padding: 18px 22px 14px;
  border-bottom: 1px dashed var(--line);
}
.cam-card-info { flex: 1; min-width: 0; }
.cam-card-name {
  font-family: var(--serif);  font-weight: 400;
  font-size: 22px; line-height: 1.2;
  color: var(--fg);
  margin-bottom: 8px;
}
.cam-card-state {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
}
.cam-card-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--bg-3); color: var(--fg-dim);
}
.cam-card-badge-active  { background: rgba(74,222,128,0.16); color: #4ade80; }
.cam-card-badge-trial   { background: rgba(74,222,128,0.10); color: #4ade80; }
.cam-card-badge-expired { background: rgba(248,113,113,0.14); color: #f87171; }
.cam-card-badge-none    { background: rgba(168,168,163,0.14); color: var(--fg-dim); }
.cam-card-badge-detail  { font-size: 12.5px; color: var(--fg-mute); }
.cam-card-actions { flex: none; }

.cam-card-body {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 18px;
  padding: 16px 22px;
}
.cam-card-snapshot {
  position: relative;
  aspect-ratio: 16/9;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-3);
  border: 1px solid var(--line);
}
.cam-card-snap-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam-card-snap-empty {
  position: absolute; inset: 0;
  display: none; align-items: center; justify-content: center;
  color: var(--fg-mute); font-size: 13px; padding: 20px; text-align: center;
}
.cam-card-summary {
  display: flex; flex-direction: column; gap: 14px;
  align-self: center;
}
.cam-summary-line {
  display: flex; flex-direction: column; gap: 3px;
  line-height: 1.4;
}
.cam-summary-key {
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--fg-mute);
}
.cam-summary-val { color: var(--fg); font-size: 14.5px; line-height: 1.45; }
.cam-summary-muted { color: var(--fg-mute);  font-size: 13.5px; }
.cam-summary-error { color: #f87171; }

.cam-card-toggle {
  width: 100%;
  background: transparent;
  border: none;
  border-top: 1px solid var(--line);
  padding: 14px 22px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--fg-dim);
  cursor: pointer;
  text-align: center;
  transition: background .15s, color .15s;
  letter-spacing: 0.02em;
}
.cam-card-toggle:hover { background: var(--bg-3); color: var(--fg); }

.cam-card-settings {
  padding: 26px 28px 28px;
  border-top: 1px solid var(--line);
  background: var(--bg);
  display: flex; flex-direction: column; gap: 28px;
}
.cam-card-settings.hidden { display: none; }

/* sections internes */
.cam-settings-section {
  display: flex; flex-direction: column; gap: 12px;
}
.cam-settings-section-title {
  font-family: var(--serif);  font-weight: 400;
  font-size: 18px; color: var(--fg);
  margin: 0;
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
}
.cam-settings-section-hint {
  font-family: var(--sans); font-style: normal; font-size: 12.5px;
  color: var(--fg-mute); font-weight: 400;
}

.cam-settings-block { display: flex; flex-direction: column; gap: 6px; }
.cam-settings-label {
  font-size: 12px; font-weight: 600;
  color: var(--fg-dim); letter-spacing: 0.04em;
  text-transform: uppercase;
}
.cam-settings-input, .cam-settings-textarea {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 14px;
  color: var(--fg);
  font-family: inherit;
  font-size: 14.5px;
  width: 100%;
  box-sizing: border-box;
  transition: border-color .12s, background .12s;
}
.cam-settings-textarea { font-family: var(--mono); font-size: 12.5px; resize: vertical; min-height: 96px; line-height: 1.5; }
.cam-settings-input:focus, .cam-settings-textarea:focus {
  outline: none; border-color: var(--fg-dim); background: var(--bg-3);
}

/* scenarios chips : grille uniforme 3 cols, emoji + label, font Inter */
.cam-scenario-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  font-family: "Inter", var(--sans);
}
.cam-scenario-chip {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  min-height: 60px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  border-radius: 12px;
  font-family: "Inter", var(--sans);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .12s;
  user-select: none;
  line-height: 1.25;
}
.cam-scenario-chip:hover {
  background: var(--bg-3);
  border-color: var(--line-2);
  transform: translateY(-1px);
}
.cam-scenario-chip input {
  position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none;
}
.cam-scenario-emoji {
  flex: none;
  font-size: 20px;
  line-height: 1;
  display: inline-block;
  filter: grayscale(0.05);
}
.cam-scenario-label {
  flex: 1; min-width: 0;
  color: var(--fg-dim);
  /* autoriser le wrap sur 2 lignes max, plus d'ellipsis qui coupe les labels longs */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.cam-scenario-chip.is-checked .cam-scenario-label,
.cam-scenario-chip:has(input:checked) .cam-scenario-label {
  color: var(--fg);
}
/* check indicator à droite (subtle, plus discret que la grosse case à cocher) */
.cam-scenario-chip::after {
  content: '';
  position: absolute;
  top: 50%; right: 14px;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  border: 1.5px solid var(--line-2);
  border-radius: 50%;
  background: transparent;
  transition: background .15s, border-color .15s;
  flex: none;
}
.cam-scenario-chip.is-checked::after,
.cam-scenario-chip:has(input:checked)::after {
  background: var(--fg);
  border-color: var(--fg);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M3.5 8.5l3 3 6-7' stroke='%230a0a0b' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 13px 13px;
}
.cam-scenario-chip.is-checked,
.cam-scenario-chip:has(input:checked) {
  background: rgba(255,255,255,0.04);
  border-color: var(--fg);
}
/* padding-right pour ne pas chevaucher le check indicator */
.cam-scenario-chip { padding-right: 44px; }

/* destinataires Telegram : avatar rond + nom */
.cam-tg-recipients {
  display: flex; flex-wrap: wrap; gap: 10px;
}
.cam-tg-chip {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 14px 6px 6px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
  color: var(--fg);
  position: relative;
}
.cam-tg-chip::before {
  content: attr(data-initials);
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--fg);
  color: var(--accent-ink);
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.04em;
  display: inline-flex; align-items: center; justify-content: center;
  flex: none;
}
.cam-tg-empty {
  font-size: 13.5px; color: var(--fg-mute); 
}
.cam-tg-advanced {
  margin-top: 6px;
  font-size: 13px;
}
.cam-tg-advanced summary {
  cursor: pointer; color: var(--fg-mute);
  padding: 6px 0;
  list-style: none;
}
.cam-tg-advanced summary::-webkit-details-marker { display: none; }
.cam-tg-advanced summary:hover { color: var(--fg); }
.cam-tg-advanced[open] summary { color: var(--fg); margin-bottom: 10px; }
.cam-tg-advanced .cam-settings-block { margin-top: 10px; }

/* ✕ retirer un destinataire */
.cam-tg-chip-remove {
  background: none; border: none; cursor: pointer;
  color: var(--fg-mute); font-size: 11px;
  padding: 0 0 0 8px; line-height: 1;
  opacity: 0.6; transition: opacity 0.15s, color 0.15s;
}
.cam-tg-chip-remove:hover { opacity: 1; color: #E05555; }

/* "+ Ajouter" bouton */
.cam-tg-add-btn {
  font-size: 13px; padding: 7px 14px;
  background: var(--bg-2); border: 1px solid var(--line);
  color: var(--fg); border-radius: 6px; cursor: pointer;
  transition: border-color 0.15s;
}
.cam-tg-add-btn:hover { border-color: var(--fg-mute); }

/* Panel partage inline */
.cam-tg-add-panel {
  margin-top: 10px; padding: 14px 14px 12px;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 8px;
}
.cam-tg-add-panel.hidden { display: none; }
.cam-tg-share-btns {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px;
}
.cam-tg-share-btns .btn, .cam-tg-share-btns a.btn {
  font-size: 13px; padding: 8px 14px;
  text-decoration: none; display: inline-flex;
  align-items: center; gap: 6px;
}

/* Message limite atteinte */
.cam-tg-limit { color: var(--fg-mute); font-size: 13px; }

/* ===== Bouton "Tester l'IA maintenant" + résultat ===== */
.cam-test-now-btn {
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: "Inter", var(--sans);
  background: var(--bg-2, #18181b);
  border: 1px solid var(--line, #27272a);
  color: var(--fg);
  cursor: pointer;
}
.cam-test-now-btn:hover { border-color: var(--accent, #fff); }
.cam-test-now-btn:disabled { opacity: 0.6; cursor: progress; }
.cam-test-result {
  margin-top: 14px;
  font-family: "Inter", var(--sans);
  font-size: 13px;
}
.cam-test-result:empty { display: none; }
.cam-test-meta {
  font-size: 12px; color: var(--fg-mute);
  margin-bottom: 10px;
}
.cam-test-empty {
  padding: 14px;
  background: rgba(74, 222, 128, 0.08);
  border: 1px solid rgba(74, 222, 128, 0.30);
  border-radius: 8px;
  color: #4ade80;
}
.cam-test-list { display: flex; flex-direction: column; gap: 8px; }
.cam-test-item {
  background: var(--bg-2, #18181b);
  border-radius: 8px;
  padding: 12px 14px;
}
.cam-test-item-head {
  display: flex; gap: 10px; align-items: center;
  margin-bottom: 6px;
  font-weight: 600;
}
.cam-test-item-head code {
  background: rgba(255,255,255,0.06);
  padding: 2px 8px; border-radius: 4px;
  font-size: 11.5px;
  font-family: "JetBrains Mono", monospace;
  color: var(--fg-mute);
}
.cam-test-item-summary { color: var(--fg); font-size: 13.5px; }
.cam-test-item-details {
  color: var(--fg-mute); font-size: 12.5px; margin-top: 4px;
  font-style: italic;
}
.cam-test-error {
  padding: 12px;
  background: rgba(248, 113, 113, 0.10);
  border: 1px solid rgba(248, 113, 113, 0.40);
  border-radius: 8px;
  color: #f87171;
}

/* bandeau "EZVIZ déconnecté" en tête de la liste des cams */
.cams-ezviz-banner {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 20px;
  margin-bottom: 18px;
  background: linear-gradient(180deg, rgba(245,158,11,0.10), rgba(245,158,11,0.04));
  border: 1px solid rgba(245,158,11,0.55);
  border-radius: 14px;
  flex-wrap: wrap;
}
.cams-ezviz-banner-text {
  flex: 1; min-width: 240px;
  font-size: 14px; color: var(--fg);
  font-family: "Inter", var(--sans);
  line-height: 1.45;
}
.cams-ezviz-banner-text strong { color: var(--warning, #f59e0b); }
.cams-ezviz-banner-btn {
  background: var(--warning, #f59e0b);
  color: #0b0b0c;
  border-color: var(--warning, #f59e0b);
  padding: 11px 22px;
  font-weight: 600;
}
.cams-ezviz-banner-btn:hover { filter: brightness(1.07); }

/* footer : bouton enregistrer + auto-save status + delete link */
.cam-settings-footer {
  display: flex; align-items: center; gap: 16px;
  flex-wrap: wrap;
  margin-top: 6px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
}
.cam-save-explicit-btn {
  padding: 11px 22px;
  font-size: 14px;
  font-weight: 600;
  font-family: "Inter", var(--sans);
  letter-spacing: 0.01em;
}
.cam-save-explicit-btn:disabled { opacity: .65; cursor: progress; }
.cam-settings-footer .cam-settings-delete-link { margin-left: auto; }
.cam-settings-autosave {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px;
  color: var(--fg-mute);
  font-family: "Inter", var(--sans);
  transition: color .2s;
}
.cam-settings-autosave::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--fg-mute);
  display: inline-block;
  transition: background .2s, box-shadow .2s;
}
.cam-settings-autosave[data-state="saving"] { color: var(--fg-dim); }
.cam-settings-autosave[data-state="saving"]::before {
  background: var(--warning);
  animation: cam-save-pulse 1s ease-in-out infinite;
}
.cam-settings-autosave[data-state="saved"] { color: #4ade80; }
.cam-settings-autosave[data-state="saved"]::before {
  background: #4ade80;
  box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.16);
}
.cam-settings-autosave[data-state="error"] { color: #f87171; }
.cam-settings-autosave[data-state="error"]::before { background: #f87171; }
@keyframes cam-save-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}
.cam-settings-result { font-size: 13px; flex: 1; }
.cam-settings-result.is-success { color: #4ade80; }
.cam-settings-result.is-error   { color: #f87171; }
.cam-settings-result.is-warning { color: var(--warning); }
.cam-settings-delete-link {
  background: none; border: none; cursor: pointer;
  color: var(--fg-mute); font-family: inherit;
  font-size: 13px; text-decoration: underline;
  text-underline-offset: 3px; padding: 4px 0;
  transition: color .12s;
}
.cam-settings-delete-link:hover { color: #f87171; }

.cam-settings-loader {
  padding: 28px; text-align: center; color: var(--fg-mute); font-size: 13px;
}

@media (max-width: 900px) {
  .cam-scenario-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .cam-card-header { flex-direction: column; }
  .cam-card-body { grid-template-columns: 1fr; }
  .cam-card-actions button { width: 100%; }
  .cam-scenario-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   TOGGLE surveillance active / en pause (header cam card)
   ============================================================ */
.cam-toggle {
  display: inline-flex; align-items: center; gap: 10px;
  cursor: pointer;
  user-select: none;
  font-family: "Inter", var(--sans);
  font-size: 13px; font-weight: 500;
  color: var(--fg-dim);
  padding: 8px 14px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: background .15s, border-color .15s, color .15s;
}
.cam-toggle:hover { background: var(--line); border-color: var(--line-2); }
.cam-toggle input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.cam-toggle-slider {
  position: relative;
  width: 32px; height: 18px;
  background: var(--line-2);
  border-radius: 999px;
  flex: none;
  transition: background .2s;
}
.cam-toggle-slider::before {
  content: '';
  position: absolute;
  left: 2px; top: 2px;
  width: 14px; height: 14px;
  background: var(--fg);
  border-radius: 50%;
  transition: transform .2s, background .2s;
}
.cam-toggle:has(input:checked) .cam-toggle-slider {
  background: #4ade80;
}
.cam-toggle:has(input:checked) .cam-toggle-slider::before {
  transform: translateX(14px);
  background: #0a0a0b;
}
.cam-toggle:has(input:checked) {
  color: var(--fg);
}
.cam-toggle-label { line-height: 1; }

/* badge "En pause" */
.cam-card-badge-paused {
  background: rgba(217, 119, 6, 0.16);
  color: var(--warning);
}
/* card en pause : snapshot grayscale + dim */
.cam-card.is-paused .cam-card-snapshot {
  filter: grayscale(0.85) opacity(0.55);
}
.cam-card.is-paused .cam-card-name {
  color: var(--fg-dim);
}

/* ============================================================
   PAGE ADMIN — édition prompts + scénarios
   ============================================================ */
.nav-item-admin {
  margin-top: 18px;
  padding-top: 16px !important;
  border-top: 1px dashed var(--line);
  color: var(--fg-mute) !important;
  font-size: 13px !important;
}
.nav-item-admin::before { content: 'Admin · '; color: var(--fg-mute); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; display: block; margin-bottom: 4px; opacity: 0.6; }

.admin-card { display: flex; flex-direction: column; gap: 12px; }
.admin-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.admin-header h2 { margin: 0 0 6px; font-size: 22px; font-family: var(--serif); font-weight: 400; }
.admin-header .form-hint { margin: 0; max-width: 720px; }
.admin-actions { display: flex; gap: 10px; flex-wrap: wrap; flex: none; }

.admin-save-result { font-size: 13px; min-height: 18px; }
.admin-save-result.is-success { color: #4ade80; }
.admin-save-result.is-error { color: #f87171; }
.admin-save-result.is-warning { color: var(--warning); }

.admin-section-title {
  font-family: var(--serif); font-size: 20px; font-weight: 400;
  margin: 0 0 6px; color: var(--fg);
}
.admin-textarea {
  width: 100%; box-sizing: border-box;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.5;
  background: var(--bg-2); color: var(--fg);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 14px; resize: vertical; min-height: 120px;
}
.admin-textarea:focus { outline: none; border-color: var(--fg-dim); background: var(--bg-3); }

.admin-scenarios-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 8px; flex-wrap: wrap;
}

.admin-scenario {
  border: 1px solid var(--line);
  background: var(--bg-2);
  border-radius: 12px;
  padding: 16px;
  margin-top: 12px;
  display: flex; flex-direction: column; gap: 12px;
}
.admin-scenario-row {
  display: grid;
  grid-template-columns: 100px 1.5fr 1fr 1fr 90px;
  gap: 10px; align-items: center;
}
.admin-scenario-row input,
.admin-scenario-row select {
  background: var(--bg); color: var(--fg);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 12px;
  font-family: "Inter", var(--sans); font-size: 13.5px;
  width: 100%; box-sizing: border-box;
}
.admin-scenario-row input:focus,
.admin-scenario-row select:focus { outline: none; border-color: var(--fg-dim); }
.admin-scenario-row .admin-field-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--fg-mute);
  display: block; margin-bottom: 4px;
}
.admin-scenario-prompt-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--fg-mute);
}
.admin-scenario-prompt {
  font-family: var(--mono); font-size: 12px; line-height: 1.5;
  background: var(--bg); color: var(--fg);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 12px; resize: vertical; min-height: 80px;
  width: 100%; box-sizing: border-box;
}
.admin-scenario-prompt:focus { outline: none; border-color: var(--fg-dim); }

.admin-scenario-actions {
  display: flex; justify-content: flex-end; gap: 8px;
}
.admin-scenario-delete {
  background: none; border: none; cursor: pointer;
  color: var(--fg-mute); font-size: 12.5px; font-family: inherit;
  text-decoration: underline; text-underline-offset: 3px; padding: 2px 0;
}
.admin-scenario-delete:hover { color: #f87171; }

@media (max-width: 900px) {
  .admin-scenario-row { grid-template-columns: 1fr 1fr; }
}

/* Auto-save indicator (admin page) */
.admin-save-result {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; padding: 6px 0;
  font-family: "Inter", var(--sans);
  color: var(--fg-mute);
  transition: color .2s;
}
.admin-save-result::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--fg-mute);
  display: inline-block;
}
.admin-save-result[data-state="saving"] { color: var(--fg-dim); }
.admin-save-result[data-state="saving"]::before {
  background: var(--warning);
  animation: cam-save-pulse 1s ease-in-out infinite;
}
.admin-save-result[data-state="saved"] { color: #4ade80; }
.admin-save-result[data-state="saved"]::before {
  background: #4ade80;
  box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.16);
}
.admin-save-result[data-state="error"] { color: #f87171; }
.admin-save-result[data-state="error"]::before { background: #f87171; }

/* Test result block (admin) */
.admin-test-result {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  font-family: "Inter", var(--sans);
  font-size: 13.5px;
  color: var(--fg);
  line-height: 1.5;
}
.admin-test-result.is-loading {
  color: var(--fg-dim);
  font-style: italic;
}
.admin-test-result.is-error {
  background: rgba(248, 113, 113, 0.08);
  border-color: rgba(248, 113, 113, 0.4);
  color: #f87171;
}
.admin-test-result.is-done {
  background: var(--bg);
  border-color: var(--line-2);
}
.admin-test-head {
  display: flex; align-items: center; gap: 14px;
  flex-wrap: wrap;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px dashed var(--line);
  font-size: 14px;
}
.admin-test-meta {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--fg-mute);
  font-family: var(--mono);
}
.admin-test-summary, .admin-test-details {
  margin: 4px 0;
  font-size: 13px;
}
.admin-test-summary strong, .admin-test-details strong {
  color: var(--fg-mute);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  margin-right: 8px;
}

/* Delete button visible dans header de chaque cam card */
.cam-card-delete-btn {
  background: transparent;
  color: var(--fg-mute);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  font-family: "Inter", var(--sans);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.cam-card-delete-btn:hover {
  background: rgba(248, 113, 113, 0.08);
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.4);
}

/* ====================================================================== */
/* === M9 — Animations + transitions IB                                 === */
/* Tokens consommés depuis dashboard-tokens.css. Aucune :root.           */
/* Tous les @keyframes ont prefers-reduced-motion fallback.              */
/* ====================================================================== */

/* --- Stagger reveal au mount (grilles AlertCard, CamCard list) -------- */
.ib-stagger > * {
  opacity: 0;
  transform: translateY(8px);
  animation: ib-reveal 280ms ease forwards;
}
.ib-stagger > *:nth-child(1) { animation-delay: 0ms; }
.ib-stagger > *:nth-child(2) { animation-delay: 80ms; }
.ib-stagger > *:nth-child(3) { animation-delay: 160ms; }
.ib-stagger > *:nth-child(4) { animation-delay: 240ms; }
.ib-stagger > *:nth-child(5) { animation-delay: 320ms; }
/* Items 6+ : reveal en lot après le 5ème pour éviter FOUC perçu (review M9 HIGH). */
.ib-stagger > *:nth-child(n+6) { animation-delay: 400ms; }
@keyframes ib-reveal {
  to { opacity: 1; transform: translateY(0); }
}

/* --- Toast slide-in 200ms -------------------------------------------- */
.ib-toast {
  background: var(--ib-surface-2);
  border: 1px solid var(--ib-border);
  border-left: 3px solid var(--ib-data);
  color: var(--ib-text);
  font-family: var(--ib-ff-sans);
  font-size: 13px;
  padding: var(--ib-sp-3) var(--ib-sp-4);
  animation: ib-toast-slide 200ms ease forwards;
}
.ib-toast[data-tone="success"] { border-left-color: var(--ib-vital); }
.ib-toast[data-tone="warn"]    { border-left-color: var(--ib-sev-warn); }
.ib-toast[data-tone="error"]   { border-left-color: var(--ib-alert); }
@keyframes ib-toast-slide {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- Skeleton shimmer (loading states) ------------------------------- */
.ib-skeleton {
  background: linear-gradient(90deg,
    var(--ib-surface) 0%,
    var(--ib-surface-2) 50%,
    var(--ib-surface) 100%);
  background-size: 200% 100%;
  border: 1px solid var(--ib-border);
  border-radius: 0;
  animation: ib-shimmer 1.4s ease-in-out infinite;
  min-height: 24px;
}
.ib-skeleton-card {
  /* Aligné sur la hauteur réelle d'une CamCard rendue (~280px) pour éviter
     le layout-jump quand le skeleton est remplacé par le contenu (review M9). */
  height: 280px;
  margin-bottom: var(--ib-sp-3);
}
.ib-skeleton-line {
  height: 12px;
  margin-bottom: var(--ib-sp-2);
  width: 80%;
}
.ib-skeleton-line[data-w="40"] { width: 40%; }
.ib-skeleton-line[data-w="60"] { width: 60%; }
.ib-skeleton-line[data-w="100"] { width: 100%; }
@keyframes ib-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* --- Reduced motion fallback : neutralise toutes les animations IB ---- */
@media (prefers-reduced-motion: reduce) {
  .ib-stagger > * {
    animation: none;
    opacity: 1;
    transform: none;
  }
  .ib-toast {
    animation: none;
  }
  .ib-skeleton {
    animation: none;
    background: var(--ib-surface-2);
  }
  /* Cohérence : neutralise aussi les pulses M4 si user préfère reduced. */
  .ib-vital-led,
  .ib-led-alert {
    animation: none;
  }
  /* Snapshot saturate transitions (M5/M6) : conserve l'état final mais
     supprime la transition pour éviter le mouvement perçu. */
  .cam-card-ib-snap-img,
  .alert-card-ib-img {
    transition: none;
  }
  /* M8 heart monitor : neutralise les transitions hover background/border (review). */
  .ib-event-detector {
    transition: none;
  }
}

/* ====================================================================== */
/* === M5 — CamCard Instrument Bulletin                                === */
/* Tokens consommés depuis dashboard-tokens.css (M4) — AUCUNE redéclaration */
/* de :root ici. Toutes les valeurs viennent de --ib-* déjà définis.       */
/* ====================================================================== */

/* --- Wrapper carte ---------------------------------------------------- */
.cam-card-ib {
  background: var(--ib-surface);
  border: 1px solid var(--ib-border);
  border-left: 3px solid var(--ib-vital);
  margin-bottom: var(--ib-sp-4);
  font-family: var(--ib-ff-sans);
  color: var(--ib-text);
  transition: border-color 200ms ease;
}
.cam-card-ib.is-paused {
  border-left-color: var(--ib-text-faint);
  opacity: 0.72;
}
.cam-card-ib:hover {
  border-color: var(--ib-border-hi);
}

/* Override : la classe `cam-card` legacy (conservée pour les selectors JS
   `.closest('.cam-card')`) ajoute son propre border-radius/padding/box-shadow.
   Cette règle compound (specificity 0,2,0 vs 0,1,0) reset au flat IB. */
.cam-card.cam-card-ib {
  padding: 0;
  box-shadow: none;
  border-radius: 0;
}

/* --- Header ----------------------------------------------------------- */
.cam-card-ib-header {
  display: flex;
  align-items: baseline;
  gap: var(--ib-sp-3);
  padding: var(--ib-sp-3) var(--ib-sp-4);
  border-bottom: 1px solid var(--ib-border);
  background: var(--ib-surface-2);
}
.cam-card-ib-id {
  font-size: 11px;
  color: var(--ib-text-faint);
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.cam-card-ib-name {
  flex: 1;
  font-family: var(--ib-ff-serif);
  font-size: 18px;
  font-weight: 500;
  color: var(--ib-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cam-card-ib-status {
  display: flex;
  align-items: center;
  gap: var(--ib-sp-2);
}
.cam-card-ib-paused-label {
  font-family: var(--ib-ff-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ib-text-faint);
}

/* --- Body ------------------------------------------------------------- */
.cam-card-ib-body {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: var(--ib-sp-4);
  padding: var(--ib-sp-4);
}
.cam-card-ib-data {
  font-size: 13px;
  color: var(--ib-text);
}
.cam-card-ib-data .ib-eyebrow:not(:first-child) {
  margin-top: var(--ib-sp-3);
}
.cam-card-ib-state-line {
  font-size: 13px;
  line-height: 1.4;
}
.cam-card-ib-last-alarm {
  font-size: 12px;
  color: var(--ib-text-mute);
}
.cam-card-ib-scenarios {
  font-family: var(--ib-ff-mono);
  font-size: 12px;
  color: var(--ib-text-mute);
  line-height: 1.5;
}
.cam-card-ib-scenarios-empty   { color: var(--ib-text-faint); font-style: italic; }
.cam-card-ib-scenarios-more    { color: var(--ib-text-faint); }
.cam-card-ib-scenarios-loading { color: var(--ib-text-faint); }

/* --- Snapshot (filtre saturate IB telemetry) -------------------------- */
.cam-card-ib-snapshot {
  position: relative;
  margin: 0;
  background: var(--ib-bg);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--ib-border);
}
.cam-card-ib-snap-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.4) brightness(0.95);
  transition: filter 200ms ease;
  display: block;
}
.cam-card-ib-snapshot:hover .cam-card-ib-snap-img,
.cam-card-ib:focus-within .cam-card-ib-snap-img {
  filter: saturate(1) brightness(1);
}
.cam-card-ib-snap-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ib-ff-mono);
  font-size: 11px;
  color: var(--ib-text-faint);
  text-align: center;
  padding: var(--ib-sp-3);
}
.cam-card-ib-snap-caption {
  position: absolute;
  bottom: 0;
  right: 0;
  padding: var(--ib-sp-1) var(--ib-sp-2);
  background: rgba(10, 14, 20, 0.7);
  color: var(--ib-text-mute);
  font-size: 10px;
  letter-spacing: 0.08em;
}

/* --- Footer (toggle + CTA + delete) ----------------------------------- */
.cam-card-ib-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ib-sp-3);
  padding: var(--ib-sp-3) var(--ib-sp-4);
  border-top: 1px solid var(--ib-border);
  background: var(--ib-surface-2);
}

/* Toggle ACTIVE / PAUSE — slider plat IB */
.cam-toggle-ib {
  display: inline-flex;
  align-items: center;
  gap: var(--ib-sp-2);
  cursor: pointer;
  user-select: none;
}
.cam-toggle-ib input { position: absolute; opacity: 0; pointer-events: none; }
.cam-toggle-ib-slider {
  width: 32px; height: 16px;
  background: var(--ib-border);
  position: relative;
  transition: background 200ms ease;
}
.cam-toggle-ib-slider::before {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 12px; height: 12px;
  background: var(--ib-text);
  transition: left 200ms ease;
}
.cam-toggle-ib input:checked + .cam-toggle-ib-slider { background: var(--ib-vital); }
.cam-toggle-ib input:checked + .cam-toggle-ib-slider::before { left: 18px; }
.cam-toggle-ib-label {
  font-size: 11px;
  color: var(--ib-text-mute);
  letter-spacing: 0.1em;
}
.cam-toggle-ib:focus-within .cam-toggle-ib-slider {
  box-shadow: var(--ib-focus-ring);
}

/* Bouton "MODIFIER RÉGLAGES" */
.cam-card-ib-toggle {
  font-family: var(--ib-ff-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ib-data);
  background: transparent;
  border: 1px solid var(--ib-border);
  padding: var(--ib-sp-2) var(--ib-sp-3);
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
}
.cam-card-ib-toggle:hover { background: var(--ib-hover-bg); border-color: var(--ib-border-hi); }
.cam-card-ib-toggle:focus-visible { outline: none; box-shadow: var(--ib-focus-ring); }

/* Bouton supprimer (touch target ≥36px sans gonfler le visuel) */
.cam-card-ib-delete {
  margin-left: auto;
  min-width: 36px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  color: var(--ib-text-faint);
  background: transparent;
  border: 1px solid var(--ib-border);
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease, background 150ms ease;
}
.cam-card-ib-delete:hover {
  color: var(--ib-alert);
  border-color: var(--ib-alert);
  background: var(--ib-alert-dim);
}
.cam-card-ib-delete:focus-visible { outline: none; box-shadow: var(--ib-focus-ring); }

/* --- Settings panel --------------------------------------------------- */
.cam-card-ib-settings {
  padding: var(--ib-sp-4);
  border-top: 1px solid var(--ib-border);
}
.cam-card-ib-settings.hidden { display: none; }

/* --- Mobile (≤700px) — stack vertical --------------------------------- */
@media (max-width: 700px) {
  .cam-card-ib-body { grid-template-columns: 1fr; }
  .cam-card-ib-header { padding: var(--ib-sp-2) var(--ib-sp-3); gap: var(--ib-sp-2); }
  .cam-card-ib-name { font-size: 16px; }
  .cam-card-ib-footer { gap: var(--ib-sp-2); padding: var(--ib-sp-2) var(--ib-sp-3); }
  .cam-card-ib-snapshot { aspect-ratio: 4 / 3; }  /* moins haut sur mobile portrait */
}

/* ====================================================================== */
/* === M7 — Sidebar + BottomNav + Forms IB                              === */
/* Tokens consommés depuis dashboard-tokens.css. AUCUNE :root, AUCUN     */
/* nouveau token, fonts uniquement Geist/Newsreader/JetBrains Mono.       */
/* ====================================================================== */

/* --- Sidebar ---------------------------------------------------------- */
.ib-sidebar {
  background: var(--ib-surface);
  border-right: 1px solid var(--ib-border);
  font-family: var(--ib-ff-sans);
  color: var(--ib-text);
}
.ib-sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--ib-sp-2);
  padding: var(--ib-sp-4);
  border-bottom: 1px solid var(--ib-border);
  cursor: pointer;
}
.ib-sidebar-brand-name {
  font-family: var(--ib-ff-serif);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.ib-sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: var(--ib-sp-3) 0;
}
.ib-sidebar-item {
  display: flex;
  align-items: center;
  gap: var(--ib-sp-3);
  padding: var(--ib-sp-3) var(--ib-sp-4);
  text-decoration: none;
  color: var(--ib-text-mute);
  border-left: 3px solid transparent;
  transition: background 150ms ease, color 150ms ease, border-left-color 150ms ease;
}
.ib-sidebar-item:hover {
  background: var(--ib-hover-bg);
  color: var(--ib-text);
}
.ib-sidebar-item.active {
  color: var(--ib-text);
  border-left-color: var(--ib-vital);
  background: var(--ib-active-bg);
}
.ib-sidebar-item:focus-visible {
  outline: none;
  box-shadow: var(--ib-focus-ring);
}
.ib-sidebar-item-num {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ib-text-faint);
  min-width: 36px;
}
.ib-sidebar-item-label {
  font-family: var(--ib-ff-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
}
.ib-sidebar-item-admin .ib-sidebar-item-num,
.ib-sidebar-item-admin .ib-sidebar-item-label {
  color: var(--ib-sev-warn);
}
.ib-sidebar-user {
  margin-top: auto;
  padding: var(--ib-sp-3) var(--ib-sp-4);
  border-top: 1px solid var(--ib-border);
  display: flex;
  flex-direction: column;
  gap: var(--ib-sp-2);
}
.ib-sidebar-user-email {
  font-size: 11px;
  color: var(--ib-text-mute);
  letter-spacing: 0.04em;
  word-break: break-all;
}

/* --- BottomNav (mobile) ----------------------------------------------- */
.ib-bottomnav {
  background: var(--ib-surface);
  border-top: 1px solid var(--ib-border);
}
.ib-bottomnav-btn {
  color: var(--ib-text-mute);
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: var(--ib-sp-3) var(--ib-sp-2);
  transition: color 150ms ease, background 150ms ease;
}
.ib-bottomnav-btn:hover,
.ib-bottomnav-btn.active {
  color: var(--ib-text);
  background: var(--ib-hover-bg);
}
.ib-bottomnav-btn:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--ib-data);
}
.ib-bottomnav-label {
  font-size: 10px;
  letter-spacing: 0.1em;
}
.ib-bottomnav-add-square {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  background: var(--ib-data);
  color: var(--ib-bg);
  font-family: var(--ib-ff-mono);
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
  border: 1px solid var(--ib-data);
  /* Le selector .ib-bottomnav-add-square supplante le legacy `bottom-nav-add-circle`
     qui faisait un border-radius 50% — ici on reste flat IB. */
  border-radius: 0;
}
.ib-bottomnav-add:hover .ib-bottomnav-add-square {
  filter: brightness(1.15);
}

/* --- Boutons IB unifiés ---------------------------------------------- */
.ib-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--ib-sp-2);
  font-family: var(--ib-ff-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  padding: var(--ib-sp-3) var(--ib-sp-5);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  background: transparent;
  color: var(--ib-text);
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}
.ib-btn:focus-visible { outline: none; box-shadow: var(--ib-focus-ring); }
.ib-btn-primary {
  background: var(--ib-data);
  color: var(--ib-bg);
  border-color: var(--ib-data);
}
/* Hover : conserve la teinte data, opacity légère pour feedback visuel sans
   dériver vers le vital green (qui implique "validation/go", pas hover). */
.ib-btn-primary:hover {
  background: var(--ib-data);
  border-color: var(--ib-data);
  filter: brightness(1.15);
}
.ib-btn-secondary {
  background: transparent;
  color: var(--ib-text);
  border-color: var(--ib-border);
}
.ib-btn-secondary:hover {
  background: var(--ib-hover-bg);
  border-color: var(--ib-border-hi);
}
.ib-btn-danger {
  background: transparent;
  color: var(--ib-alert);
  border-color: var(--ib-alert);
}
.ib-btn-danger:hover {
  background: var(--ib-alert-dim);
}
.ib-btn-large {
  padding: var(--ib-sp-4) var(--ib-sp-6);
  font-size: 13px;
}
.ib-btn-full {
  width: 100%;
}

/* --- Inputs / selects / textarea unifiés ------------------------------ */
.ib-input,
.ib-select,
.ib-textarea {
  width: 100%;
  font-family: var(--ib-ff-sans);
  font-size: 14px;
  color: var(--ib-text);
  background: var(--ib-surface-2);
  border: 1px solid var(--ib-border);
  padding: var(--ib-sp-2) var(--ib-sp-3);
  transition: border-color 150ms ease, background 150ms ease;
}
.ib-input::placeholder,
.ib-textarea::placeholder { color: var(--ib-text-faint); }
.ib-input:hover,
.ib-select:hover,
.ib-textarea:hover { border-color: var(--ib-border-hi); }
.ib-input:focus-visible,
.ib-select:focus-visible,
.ib-textarea:focus-visible {
  outline: none;
  border-color: var(--ib-data);
  box-shadow: var(--ib-focus-ring);
}
.ib-textarea { font-family: var(--ib-ff-mono); font-size: 13px; line-height: 1.5; }
.ib-label {
  display: block;
  font-family: var(--ib-ff-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ib-text-faint);
  margin-bottom: var(--ib-sp-1);
  text-transform: uppercase;
}

/* --- Mobile (≤700px) — sidebar full-width sur petites tailles --------- */
@media (max-width: 900px) {
  /* La sidebar est probablement déjà cachée par les règles existantes en mobile,
     les tokens IB ne changent pas la visibility. */
}

/* ====================================================================== */
/* === M6 — AlertCard + AlertModal Instrument Bulletin                 === */
/* Tokens consommés depuis dashboard-tokens.css (M4).                    */
/* AUCUNE :root redéclarée. Aucun nouveau token.                         */
/* ====================================================================== */

/* --- AlertCard ------------------------------------------------------- */
.alert-card-ib {
  display: grid;
  grid-template-columns: 96px 1fr;
  grid-template-rows: auto auto;
  gap: var(--ib-sp-2) var(--ib-sp-3);
  padding: var(--ib-sp-3) var(--ib-sp-4);
  background: var(--ib-surface);
  border: 1px solid var(--ib-border);
  margin-bottom: var(--ib-sp-3);
  font-family: var(--ib-ff-sans);
  color: var(--ib-text);
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease;
}
.alert-card-ib:hover {
  border-color: var(--ib-border-hi);
  background: var(--ib-hover-bg);
}
.alert-card-ib:focus-visible {
  outline: none;
  box-shadow: var(--ib-focus-ring);
}
.alert-card-ib-header {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--ib-sp-3);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ib-text-faint);
}
.alert-card-ib-id { color: var(--ib-text-faint); }
.alert-card-ib-sev {
  font-size: 11px;
  letter-spacing: 0.12em;
  padding: 2px 7px;
  border: 1px solid var(--ib-sev-info);
  color: var(--ib-sev-info);
}
.alert-card-ib-sev[data-sev="warn"]     { border-color: var(--ib-sev-warn);    color: var(--ib-sev-warn); }
.alert-card-ib-sev[data-sev="critical"] { border-color: var(--ib-sev-critical); color: var(--ib-sev-critical); background: var(--ib-sev-critical-dim); }
.alert-card-ib-time {
  margin-left: auto;
  color: var(--ib-text-mute);
}
.alert-card-ib-figure {
  margin: 0;
  aspect-ratio: 16 / 9;
  background: var(--ib-bg);
  overflow: hidden;
  border: 1px solid var(--ib-border);
}
.alert-card-ib-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.5);
  transition: filter 200ms ease;
  display: block;
}
.alert-card-ib:hover .alert-card-ib-img { filter: saturate(1); }
.alert-card-ib-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--ib-text-faint);
}
.alert-card-ib-body {
  display: flex;
  flex-direction: column;
  gap: var(--ib-sp-1);
  min-width: 0;
}
.alert-card-ib-summary {
  margin: 0;
  font-family: var(--ib-ff-serif);
  font-size: 16px;
  font-weight: 500;
  color: var(--ib-text);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.alert-card-ib-cam {
  font-size: 11px;
  color: var(--ib-text-mute);
  letter-spacing: 0.06em;
}

/* Severity border-left override (utilities ib-border-left-sev déjà défini en M4) */
.alert-card-ib[data-sev="info"]     { border-left: 3px solid var(--ib-sev-info); }
.alert-card-ib[data-sev="warn"]     { border-left: 3px solid var(--ib-sev-warn); }
.alert-card-ib[data-sev="critical"] { border-left: 3px solid var(--ib-sev-critical); }

@media (max-width: 700px) {
  .alert-card-ib { grid-template-columns: 1fr; }
  .alert-card-ib-figure { aspect-ratio: 16 / 9; height: auto; }
  .alert-card-ib-time { margin-left: 0; }
}

/* --- AlertModal ------------------------------------------------------- */
.alert-modal-ib .alert-modal-ib-card {
  background: var(--ib-surface);
  border: 1px solid var(--ib-border);
  border-radius: 0;
  font-family: var(--ib-ff-sans);
  color: var(--ib-text);
  max-width: 1080px;
  width: min(92vw, 1080px);
}
.alert-modal-ib-close {
  color: var(--ib-text-mute);
  background: transparent;
  border: 1px solid var(--ib-border);
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
}
.alert-modal-ib-close:hover {
  color: var(--ib-alert);
  border-color: var(--ib-alert);
}
.alert-modal-ib-body {
  padding: var(--ib-sp-5) var(--ib-sp-6);
}
.alert-modal-ib-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--ib-sp-3);
  padding-bottom: var(--ib-sp-3);
  margin-bottom: var(--ib-sp-4);
  border-bottom: 1px solid var(--ib-border);
  font-size: 12px;
}
.alert-modal-ib-id { color: var(--ib-text-faint); letter-spacing: 0.08em; }
.alert-modal-ib-sev {
  font-size: 11px;
  letter-spacing: 0.12em;
  padding: 2px 8px;
  border: 1px solid var(--ib-sev-info);
  color: var(--ib-sev-info);
}
.alert-modal-ib-sev[data-sev="warn"]     { border-color: var(--ib-sev-warn);    color: var(--ib-sev-warn); }
.alert-modal-ib-sev[data-sev="critical"] { border-color: var(--ib-sev-critical); color: var(--ib-sev-critical); background: var(--ib-sev-critical-dim); }
.alert-modal-ib-time { margin-left: auto; color: var(--ib-text-mute); }
.alert-modal-ib-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: var(--ib-sp-5);
}
.alert-modal-ib-figure {
  margin: 0;
  background: var(--ib-bg);
  border: 1px solid var(--ib-border);
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
.alert-modal-ib-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.alert-modal-ib-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ib-text-faint);
  letter-spacing: 0.1em;
  font-size: 12px;
}
.alert-modal-ib-report { display: flex; flex-direction: column; }
.alert-modal-ib-cam { font-size: 12px; color: var(--ib-text-mute); margin: 0; }
.alert-modal-ib-summary {
  font-family: var(--ib-ff-serif);
  font-size: 22px;
  font-weight: 500;
  margin: 0;
  color: var(--ib-text);
  line-height: 1.3;
}
.alert-modal-ib-details {
  margin: 0;
  color: var(--ib-text);
  line-height: 1.55;
  font-size: 14px;
}
@media (max-width: 800px) {
  .alert-modal-ib-grid { grid-template-columns: 1fr; }
  .alert-modal-ib-time { margin-left: 0; }
  .alert-modal-ib-body { padding: var(--ib-sp-4); }
}

/* ====================================================================== */
/* === M5.5 — CamCard state badge + detail (IB tokens)                 === */
/* Cohérent avec _camStateBadge / _camCardCta refactorés.                */
/* ====================================================================== */
.cam-card-ib-state-badge {
  display: inline-block;
  font-family: var(--ib-ff-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  padding: 2px 8px;
  border: 1px solid var(--ib-text-faint);
  color: var(--ib-text-faint);
  background: transparent;
  vertical-align: middle;
}
.cam-card-ib-state-badge[data-state="active"] {
  color: var(--ib-vital);
  border-color: var(--ib-vital);
}
.cam-card-ib-state-badge[data-state="trial"] {
  color: var(--ib-data);
  border-color: var(--ib-data);
}
.cam-card-ib-state-badge[data-state="expired"] {
  color: var(--ib-alert);
  border-color: var(--ib-alert);
}
.cam-card-ib-state-badge[data-state="none"] {
  color: var(--ib-text-faint);
  border-color: var(--ib-border);
}
.cam-card-ib-state-detail {
  font-size: 11px;
  color: var(--ib-text-mute);
  margin-left: var(--ib-sp-2);
}

/* ====================================================================== */
/* === M8 — Heart monitor sticky 24h                                   === */
/* Sticky sous topbar dashboard, visible sur toutes pages.              */
/* SVG path généré dynamiquement par renderHeartMonitor() côté JS.      */
/* ====================================================================== */
.ib-event-detector {
  display: flex;
  align-items: center;
  gap: var(--ib-sp-3);
  padding: var(--ib-sp-2) var(--ib-sp-4);
  background: var(--ib-surface-2);
  border-bottom: 1px solid var(--ib-border);
  font-family: var(--ib-ff-sans);
  cursor: pointer;
  position: sticky;
  top: 0;
  z-index: 5;
  transition: background 150ms ease, border-color 150ms ease;
}
.ib-event-detector:hover {
  background: var(--ib-hover-bg);
}
.ib-event-detector:focus-visible {
  outline: none;
  box-shadow: var(--ib-focus-ring);
}
.ib-event-detector-eyebrow {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ib-text-faint);
  white-space: nowrap;
}
.ib-event-detector-svg {
  flex: 1;
  height: 32px;
  display: block;
}
.ib-event-detector-baseline {
  fill: none;
  stroke: var(--ib-border);
  stroke-width: 1;
  stroke-dasharray: 2 3;
}
.ib-event-detector-pulses {
  fill: none;
  stroke: var(--ib-data);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ib-event-detector-count {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ib-text-mute);
  white-space: nowrap;
}
@media (max-width: 700px) {
  .ib-event-detector {
    padding: var(--ib-sp-1) var(--ib-sp-3);
    gap: var(--ib-sp-2);
  }
  .ib-event-detector-svg { height: 24px; }
  .ib-event-detector-eyebrow,
  .ib-event-detector-count { font-size: 10px; }
}

/* ====================================================================== */
/* === M-Hotfix — "Mot de passe oublié ?" + magic-link par email      === */
/* Tokens consommés depuis dashboard-tokens.css. AUCUNE :root.           */
/* ====================================================================== */

.auth-forgot-link {
  margin-top: var(--ib-sp-1);
  margin-bottom: var(--ib-sp-2);
  text-align: right;
  font-size: 12px;
}
.ib-link-mono {
  font-family: var(--ib-ff-mono);
  font-size: 11px;
  color: var(--ib-data);
  text-decoration: none;
  letter-spacing: 0.06em;
  transition: color 150ms ease;
}
.ib-link-mono:hover {
  text-decoration: underline;
  color: var(--ib-text);
}
.ib-link-mono:focus-visible {
  outline: none;
  box-shadow: var(--ib-focus-ring);
}

.auth-forgot-title {
  font-family: var(--ib-ff-serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--ib-text);
  margin: 0 0 var(--ib-sp-2) 0;
}
.auth-forgot-subtitle {
  color: var(--ib-text-mute);
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 var(--ib-sp-4) 0;
}

/* Result inline (succès / info neutre anti-énumération) */
#forgot-result {
  margin-top: var(--ib-sp-3);
  padding: var(--ib-sp-3);
  font-size: 13px;
  line-height: 1.5;
  color: var(--ib-text);
  background: var(--ib-surface-2);
  border-left: 3px solid var(--ib-vital);
  border-radius: 0;
}
#forgot-result.error {
  border-left-color: var(--ib-alert);
  color: var(--ib-text);
}
#forgot-result:empty {
  display: none;
  padding: 0;
  margin: 0;
}

/* ===== FEEDBACK HUMAIN SUR ALERTES ===== */
.alert-feedback-btns {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.alert-feedback-btn {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid var(--line-2);
  background: var(--bg-3);
  color: var(--fg);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  line-height: 1.4;
}
.alert-feedback-btn:hover:not(:disabled) {
  background: var(--bg);
  border-color: var(--accent);
}
.alert-feedback-btn:disabled {
  opacity: 0.45;
  cursor: default;
}
.alert-feedback-label {
  font-size: 12px;
  margin-top: 8px;
  color: var(--fg-dim);
}
.alert-feedback-label-true {
  color: var(--success);
}
.alert-feedback-label-false {
  color: var(--fg-mute);
}
.alert-feedback-error {
  font-size: 11px;
  color: var(--danger);
  margin-left: 8px;
}


/* system-notices (zone interdite, erreurs) */
#system-notices { padding: 0 0 4px; }
.system-notice { padding: 10px 14px; border-radius: 6px; font-size: 0.88rem; margin-bottom: 8px; line-height: 1.5; }
.system-notice-warn { background: rgba(255,200,0,0.10); border-left: 3px solid #ffcc00; color: var(--ib-fg, #e8e8e8); }
.system-notice-error { background: rgba(255,80,80,0.10); border-left: 3px solid #ff5050; color: var(--ib-fg, #e8e8e8); }

/* test-now — snapshot + observation Gemini */
.cam-test-snapshot-wrap { margin-bottom: 10px; }
.cam-test-snapshot-img { width: 100%; max-width: 480px; border-radius: 6px; border: 1px solid var(--line-2); display: block; }
.cam-test-gemini-block { background: var(--bg-3); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; margin-bottom: 8px; font-size: 0.83rem; display: flex; flex-direction: column; gap: 6px; }
.cam-test-gemini-row { display: flex; gap: 8px; align-items: flex-start; }
.cam-test-gemini-label { color: var(--fg-mute); min-width: 130px; flex-shrink: 0; font-size: 0.8rem; padding-top: 1px; }
.cam-test-gemini-val { color: var(--fg); line-height: 1.5; }
.cam-test-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 0.78rem; font-weight: 600; }
.cam-test-badge-alert { background: rgba(251,146,60,0.15); color: #fb923c; border: 1px solid rgba(251,146,60,0.3); }
.cam-test-badge-ok { background: rgba(74,222,128,0.10); color: var(--success); border: 1px solid rgba(74,222,128,0.25); }

/* ============================================================ */
/* a11y WCAG 2.1 AA — focus-visible global (audit 2026-05-06)   */
/* fix bug critical : --ib-focus-ring était utilisé sans être   */
/* défini → focus invisible au clavier sur tout le dashboard.   */
/* ============================================================ */
:root {
  --ib-focus-ring: 0 0 0 3px rgba(184, 106, 72, 0.45), 0 0 0 1px #B86A48;
}

/* règle globale défensive : tout élément interactif qui n'a    */
/* pas son focus-visible custom récupère un outline visible     */
/* (terracotta, contraste AA sur tous fonds Bois & Lin).        */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible,
[role="link"]:focus-visible,
[tabindex]:focus-visible,
summary:focus-visible {
  outline: 2px solid #B86A48;
  outline-offset: 2px;
  border-radius: 4px;
}

/* respect pref utilisateur "réduire le mouvement" pour le focus */
@media (prefers-reduced-motion: reduce) {
  *:focus-visible { transition: none !important; }
}
