/* =========================================================
   ImmoCopilot – app.css (unifiée)
   Thèmes : clair (défaut) + sombre via body.theme-dark
   Typo : system-ui stack
   Composants : boutons, cartes, tableaux, formulaires,
   sections, grilles, KPI, badges/pills, overlay, progress,
   upload, sélection, auth, admin, billing, maintenance.
   ========================================================= */

/* ---------- Variables & Reset ---------- */
:root {
  --bg:#ffffff; --fg:#1f2937; --muted:#6b7280;
  --brand:#2563eb; --brand-2:#1d4ed8; --line:#e5e7eb; --card:#f9fafb;
  --ok:#16a34a; --warn:#d97706; --err:#dc2626;
  --radius:14px;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0;font:16px/1.5 system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Arial,sans-serif;background:var(--bg);color:var(--fg);overflow-x:clip}
img{max-width:100%;height:auto}
a{color:var(--brand);text-decoration:none}
a:hover{text-decoration:underline}

/* ---------- Utilitaires ---------- */
.wrap{max-width:1100px;margin:0 auto;padding:16px;overflow-x:hidden;}
h1{margin:0 0 12px}
.small{font-size:12px;color:#666}
.muted{opacity:.75}
.hidden{display:none!important}
.full{width:100%}
.text-right{text-align:right}
.visually-hidden{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,1px,1px);white-space:nowrap;border:0}
.container{max-width:1100px;margin:0 auto;width:100%}
.row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.list{margin:0;padding-left:18px}
.h1,.h2,.h3,.h4{margin:0 0 10px;font-weight:700;line-height:1.25}
.h1{font-size:1.55rem}
.h2{font-size:1.3rem}
.h3{font-size:1.1rem}
.h4{font-size:1rem}
.num{font-size:1rem;font-weight:600;line-height:1.3;font-variant-numeric:tabular-nums}
.form-row{display:flex;gap:10px;flex-wrap:wrap}
.form-group{display:flex;flex-direction:column;gap:6px;min-width:0}

.banner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:10px;
  margin-top:8px;
  padding:10px 12px;
  border:1px solid #d1d5db;
  border-radius:10px;
  background:#f8fafc;
}
.banner--warning{
  border-color:#fdba74;
  background:#fff7ed;
  color:#7c2d12;
}
.banner-main{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.banner-runner-row{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.runner-indicator{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:18px;
  height:18px;
  border-radius:999px;
  border:1px solid #cbd5e1;
  background:#fff;
  cursor:help;
}
.runner-indicator-dot{
  width:8px;
  height:8px;
  border-radius:50%;
  background:#94a3b8;
  box-shadow:0 0 0 1px rgba(148,163,184,.25);
  flex:0 0 auto;
}
.runner-indicator.is-ok{
  border-color:#86efac;
  background:#f0fdf4;
  color:#14532d;
}
.runner-indicator.is-ok .runner-indicator-dot{
  background:#16a34a;
  box-shadow:0 0 0 2px rgba(22,163,74,.2);
}
.runner-indicator.is-running{
  border-color:#93c5fd;
  background:#eff6ff;
  color:#1e3a8a;
}
.runner-indicator.is-running .runner-indicator-dot{
  background:#2563eb;
  box-shadow:0 0 0 2px rgba(37,99,235,.2);
}
.runner-indicator.is-warning{
  border-color:#fdba74;
  background:#fff7ed;
  color:#9a3412;
}
.runner-indicator.is-warning .runner-indicator-dot{
  background:#ea580c;
  box-shadow:0 0 0 2px rgba(234,88,12,.2);
}
.runner-indicator.is-error{
  border-color:#fca5a5;
  background:#fef2f2;
  color:#991b1b;
}
.runner-indicator.is-error .runner-indicator-dot{
  background:#dc2626;
  box-shadow:0 0 0 2px rgba(220,38,38,.2);
}
.runner-indicator.is-unknown{
  border-color:#cbd5e1;
  background:#f8fafc;
  color:#334155;
}
.runner-indicator.is-unknown .runner-indicator-dot{
  background:#64748b;
  box-shadow:0 0 0 2px rgba(100,116,139,.2);
}
@media (max-width:900px){
  .banner{
    align-items:flex-start;
  }
}

/* ---------- Blocs génériques ---------- */
.section{border:1px solid #ddd;border-radius:10px;padding:12px;margin:12px 0;background:#fff}
.card{background:#fff;border:1px solid #ddd;border-radius:12px;padding:16px}
.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.grid2{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:12px;
}
.document-stack{
  display:grid;
  grid-template-columns:1fr;
  gap:12px;
}
.bien-document-component{
  display:block;
  width:100%;
  min-width:0;
}
.bien-document-component > div:first-child{
  width:100%;
  min-width:0;
}
.card-h{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin:0 0 10px;
}
.card-b{
  padding:0;
}
.immo-disclosure-summary{
  cursor:pointer;
  list-style:none;
  justify-content:flex-start;
  text-align:left;
}
.immo-disclosure-summary > :last-child:not(:first-child){
  margin-left:auto;
}
.immo-disclosure-summary::-webkit-details-marker{
  display:none;
}
.immo-disclosure-summary::before{
  content:"▸";
  display:inline-block;
  margin-right:8px;
  color:#64748b;
  font-size:13px;
  line-height:1;
  transform:rotate(0deg);
  transition:transform .15s ease;
}
details[open] > .immo-disclosure-summary::before{
  transform:rotate(90deg);
}
.immo-disclosure-chevron{
  display:inline-block;
  color:#64748b;
  line-height:1;
  transform:rotate(0deg);
  transition:transform .15s ease;
}
.immo-disclosure-toggle.is-open .immo-disclosure-chevron,
details[open] > summary .immo-disclosure-chevron{
  transform:rotate(90deg);
}
.immo-disclosure-toggle--plain{
  appearance:none;
  border:0;
  background:none;
  padding:0;
  margin:0;
  color:inherit;
  font:inherit;
  cursor:pointer;
}
.immo-disclosure-toggle--plain:focus-visible{
  outline:2px solid #93c5fd;
  outline-offset:2px;
  border-radius:4px;
}
.mandat-subtabs{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin:0 0 12px;
}
.mandat-subtab{
  border:1px solid #d1d5db;
  background:#fff;
  color:#111827;
  border-radius:999px;
  padding:8px 14px;
  font-size:14px;
  cursor:pointer;
}
.mandat-subtab.is-active{
  background:#0f766e;
  border-color:#0f766e;
  color:#fff;
}
.mandat-panel[hidden]{
  display:none !important;
}
@media (max-width:900px){
  .grid2{
    grid-template-columns:1fr;
  }
}
/* =========================================================
   HEADER (Public + App) – Marque, Nav, Burger
   ========================================================= */
.app-header { background:#fff; border-bottom:1px solid var(--line); }
body.theme-dark .app-header { background:#0b1222; border-bottom:1px solid #1f2937; }

/* En desktop, les sous-menus admin doivent pouvoir déborder sans être coupés */
@media (min-width:901px){
  .app-header{
    overflow:visible;
  }
  .app-header .wrap,
  .app-header .header-row,
  .app-header .topbar,
  .app-header .topbar-group{
    overflow:visible;
  }
  .app-header .topbar-group[open]{
    z-index:130;
  }
  .app-header .topbar-submenu{
    z-index:140;
  }
}

/* ---------- Ligne principale ---------- */
.header-row{
  display:flex;
  align-items:center;
  justify-content:flex-start;  /* remplace space-between */
  gap:16px;                    /* vous pouvez garder 12px si vous préférez */
  padding:12px 0;
  flex-wrap:wrap; 
  min-width:0;             /* très bien pour le mobile */
}

/* ---------- Marque / Logo global ---------- */
.brand {
  display:inline-flex; align-items:center; gap:6px; font-weight:700; font-size:1.1rem; color:var(--fg);
  text-decoration:none; letter-spacing:0.3px; flex-shrink:0;
}
.brand:hover{opacity:.9;text-decoration:none}
body.theme-dark .brand{color:#93c5fd}
body.theme-dark .brand:hover{opacity:.85;text-decoration:none}

.nav{
  display:flex;
  align-items:center;
  gap:16px;
  flex-wrap:wrap;
}

.brand{
  white-space:nowrap;
}

.header-home-link{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:40px;
  height:40px;
  border:1px solid var(--line);
  border-radius:12px;
  color:var(--fg);
  background:#fff;
  text-decoration:none;
  flex:0 0 auto;
}
.header-home-link:hover{
  text-decoration:none;
  border-color:var(--brand);
  color:var(--brand);
}
.header-home-link svg{
  width:20px;
  height:20px;
  stroke:currentColor;
  stroke-width:2;
  fill:none;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.header-home-link.is-active{
  border-color:var(--brand);
  color:#fff;
  background:var(--brand);
}

.burger{
  margin-left:auto;
  flex:0 0 auto;
}

/* ---------- Topbar navigation ---------- */
.topbar{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  flex-wrap:wrap;
  gap:6px;
  flex:0 0 auto;
  min-width:0;
}

.topbar a.btn, .topbar a.btn-strong { margin:0; }

#entries-menu-link,
#buyer-search-menu-link{
  position:relative;
  overflow:visible;
}
.entries-menu-count{
  position:absolute;
  z-index:1;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:20px;
  height:20px;
  padding:0 6px;
  border:2px solid #fff;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
  line-height:1;
  pointer-events:auto;
}
.entries-menu-count--new{ top:-9px; left:3px; background:#2563eb; color:#fff; }
#buyer-search-menu-link .entries-menu-count--new{ top:-9px; right:-9px; left:auto; }
.entries-menu-count--pending{ top:-9px; right:3px; background:#dc2626; color:#fff; }
.entries-menu-count--to-complete{ bottom:-9px; left:3px; background:#f59e0b; color:#111827; }
.entries-menu-count--gmail{ right:3px; bottom:-9px; background:#0369a1; color:#fff; }
.entries-menu-count[hidden]{ display:none !important; }
body.theme-dark .entries-menu-count{ border-color:#0f172a; }

.bug-unread-count{
  position:absolute;
  top:-2px;
  right:-3px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:17px;
  height:17px;
  padding:0 4px;
  border-radius:99px;
  background:#dc2626;
  color:#fff;
  font-size:11px;
  font-weight:700;
}
.bug-unread-count[hidden]{ display:none !important; }

/* ---------- Groupes menu admin (dropdown) ---------- */
.topbar-group{
  position:relative;
}

.topbar-group > summary{
  list-style:none;
  cursor:pointer;
}

.topbar-group > summary::-webkit-details-marker{
  display:none;
}

.topbar-group > summary::after{
  content:none;
}

.topbar-submenu{
  position:absolute;
  top:calc(100% + 6px);
  left:0;
  min-width:220px;
  display:flex;
  flex-direction:column;
  gap:6px;
  padding:8px;
  border:1px solid var(--line);
  border-radius:10px;
  background:var(--card);
  box-shadow:0 8px 20px rgba(0,0,0,.14);
  z-index:35;
}

.topbar-submenu-heading{
  margin:6px 4px 0;
  padding-top:6px;
  border-top:1px solid var(--line);
  color:var(--muted);
  font-size:.78rem;
  font-weight:700;
  text-transform:uppercase;
}

.topbar-submenu-heading:first-child{
  margin-top:0;
  padding-top:0;
  border-top:0;
}

.topbar-group:not([open]) .topbar-submenu{
  display:none;
}

body.theme-dark .topbar-submenu{
  border-color:#334155;
  background:#0f172a;
}

.dashboard-home{
  display:block;
}
.dashboard-home__header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}
.dashboard-home__actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.dashboard-filters{
  display:flex;
  gap:12px;
  align-items:flex-end;
  flex-wrap:wrap;
  margin-top:16px;
}
.dashboard-kpis{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(160px, 1fr));
  gap:12px;
  margin:10px 0 14px;
}
.dashboard-kpis--stock{
  padding:10px 12px;
  border:1px solid #dbeafe;
  border-radius:14px;
  background:linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}
.dashboard-kpis--cumul{
  padding:10px 12px;
  border:1px solid #fde68a;
  border-radius:14px;
  background:linear-gradient(180deg, #fffdf5 0%, #ffffff 100%);
}
.dashboard-kpis--market{
  padding:10px 12px;
  border:1px solid #d1d5db;
  border-radius:14px;
  background:linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}
.dashboard-kpi{
  border:1px solid var(--line);
  border-radius:12px;
  padding:12px 14px;
  background:var(--card);
}
.dashboard-kpi--market{
  border-color:#cbd5e1;
}
.dashboard-kpi--total{
  border-color:#93c5fd;
  background:linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
  box-shadow:inset 0 0 0 1px rgba(37,99,235,.08);
}
.dashboard-kpi__label{
  color:var(--muted);
  font-size:.86rem;
  margin-bottom:4px;
}
.dashboard-kpi--total .dashboard-kpi__label{
  color:#1d4ed8;
  font-weight:700;
}
.dashboard-kpi__value{
  font-size:1.35rem;
  font-weight:700;
  line-height:1.2;
}
.dashboard-kpi--total .dashboard-kpi__value{
  color:#1e3a8a;
}
.dashboard-kpi--total-cumul{
  border-color:#fcd34d;
  background:linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%);
  box-shadow:inset 0 0 0 1px rgba(245,158,11,.10);
}
.dashboard-kpi--total-cumul .dashboard-kpi__label{
  color:#b45309;
}
.dashboard-kpi--total-cumul .dashboard-kpi__value{
  color:#92400e;
}
.dashboard-kpi--total-market{
  border-color:#94a3b8;
  background:linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
  box-shadow:inset 0 0 0 1px rgba(71,85,105,.08);
}
.dashboard-kpi--total-market .dashboard-kpi__label{
  color:#475569;
}
.dashboard-kpi--total-market .dashboard-kpi__value{
  color:#0f172a;
}
.dashboard-section-title{
  margin:18px 0 10px;
  font-weight:700;
}
.dashboard-panel{
  margin-top:16px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
  overflow:hidden;
}
.dashboard-panel--stock{
  border-color:#bfdbfe;
  box-shadow:inset 4px 0 0 #60a5fa;
}
.dashboard-panel--cumul{
  border-color:#fde68a;
  box-shadow:inset 4px 0 0 #f59e0b;
}
.dashboard-panel--market{
  border-color:#cbd5e1;
  box-shadow:inset 4px 0 0 #64748b;
}
.dashboard-panel__summary{
  display:flex;
  align-items:center;
  gap:8px;
  cursor:pointer;
  list-style:none;
  padding:14px 16px;
  font-weight:700;
  user-select:none;
}
.dashboard-panel--stock .dashboard-panel__summary{
  background:linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
}
.dashboard-panel--cumul .dashboard-panel__summary{
  background:linear-gradient(180deg, #fffbeb 0%, #ffffff 100%);
}
.dashboard-panel--market .dashboard-panel__summary{
  background:linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}
.dashboard-panel__badge{
  margin-left:auto;
  display:inline-flex;
  align-items:center;
  padding:3px 9px;
  border-radius:999px;
  font-size:.75rem;
  font-weight:700;
  letter-spacing:.02em;
  border:1px solid transparent;
}
.dashboard-panel__badge--stock{
  background:#dbeafe;
  color:#1d4ed8;
  border-color:#93c5fd;
}
.dashboard-panel__badge--cumul{
  background:#fef3c7;
  color:#b45309;
  border-color:#fcd34d;
}
.dashboard-panel__badge--market{
  background:#e2e8f0;
  color:#475569;
  border-color:#cbd5e1;
}
.dashboard-panel__summary::-webkit-details-marker{
  display:none;
}
.dashboard-panel__body{
  padding:0 16px 16px;
}
.dashboard-panel__toolbar{
  display:flex;
  justify-content:flex-end;
  gap:8px;
  margin-bottom:12px;
}
.dashboard-view-switch{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.dashboard-view{
  display:none;
}
.dashboard-view--active{
  display:block;
}
.dashboard-table-wrap{
  width:100%;
  overflow:auto;
}
.dashboard-table{
  width:100%;
  min-width:860px;
  border-collapse:collapse;
  font-size:.95rem;
}
.dashboard-table th,
.dashboard-table td{
  padding:10px 12px;
  border-bottom:1px solid var(--line);
  text-align:left;
  white-space:nowrap;
}
.dashboard-table thead th{
  position:sticky;
  top:0;
  background:#fff;
  z-index:1;
}
.dashboard-table__total-col{
  background:#f8fafc;
  font-weight:700;
}
.dashboard-chart{
  width:100%;
}
.dashboard-chart canvas{
  display:block;
  width:100%;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
}
.dashboard-chart__legend{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  margin-top:10px;
}
.dashboard-chart__legend-item{
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-size:.9rem;
  color:var(--fg);
}
.dashboard-chart__legend-dot{
  width:10px;
  height:10px;
  border-radius:999px;
  display:inline-block;
}
body.theme-dark .dashboard-panel--stock{
  border-color:#1d4ed8;
  box-shadow:inset 4px 0 0 #60a5fa;
}
body.theme-dark .dashboard-panel--cumul{
  border-color:#b45309;
  box-shadow:inset 4px 0 0 #f59e0b;
}
body.theme-dark .dashboard-panel--stock .dashboard-panel__summary{
  background:linear-gradient(180deg, rgba(30,64,175,.20) 0%, rgba(15,23,42,0) 100%);
}
body.theme-dark .dashboard-panel--cumul .dashboard-panel__summary{
  background:linear-gradient(180deg, rgba(180,83,9,.22) 0%, rgba(15,23,42,0) 100%);
}
body.theme-dark .dashboard-table__total-col{
  background:rgba(148,163,184,.10);
}
body.theme-dark .dashboard-kpis--stock{
  border-color:#1d4ed8;
  background:linear-gradient(180deg, rgba(30,64,175,.12) 0%, rgba(15,23,42,.02) 100%);
}
body.theme-dark .dashboard-kpis--cumul{
  border-color:#b45309;
  background:linear-gradient(180deg, rgba(180,83,9,.14) 0%, rgba(15,23,42,.02) 100%);
}
body.theme-dark .dashboard-kpis--market{
  border-color:#475569;
  background:linear-gradient(180deg, rgba(71,85,105,.16) 0%, rgba(15,23,42,.02) 100%);
}
body.theme-dark .dashboard-kpi--total-cumul{
  border-color:#b45309;
  background:linear-gradient(180deg, rgba(245,158,11,.18) 0%, rgba(180,83,9,.14) 100%);
}
body.theme-dark .dashboard-kpi--total-cumul .dashboard-kpi__label{
  color:#fbbf24;
}
body.theme-dark .dashboard-kpi--total-cumul .dashboard-kpi__value{
  color:#fde68a;
}
body.theme-dark .dashboard-kpi--market{
  border-color:#475569;
}
body.theme-dark .dashboard-kpi--total-market{
  border-color:#64748b;
  background:linear-gradient(180deg, rgba(148,163,184,.18) 0%, rgba(71,85,105,.18) 100%);
}
body.theme-dark .dashboard-kpi--total-market .dashboard-kpi__label{
  color:#cbd5e1;
}
body.theme-dark .dashboard-kpi--total-market .dashboard-kpi__value{
  color:#f8fafc;
}
body.theme-dark .dashboard-panel--market{
  border-color:#475569;
  box-shadow:inset 4px 0 0 #94a3b8;
}
body.theme-dark .dashboard-panel--market .dashboard-panel__summary{
  background:linear-gradient(180deg, rgba(71,85,105,.20) 0%, rgba(15,23,42,0) 100%);
}
body.theme-dark .dashboard-panel__badge--stock{
  background:rgba(37,99,235,.20);
  color:#bfdbfe;
  border-color:#60a5fa;
}
body.theme-dark .dashboard-panel__badge--cumul{
  background:rgba(245,158,11,.20);
  color:#fde68a;
  border-color:#f59e0b;
}
body.theme-dark .dashboard-panel__badge--market{
  background:rgba(148,163,184,.16);
  color:#e2e8f0;
  border-color:#64748b;
}

body.theme-dark .topbar-submenu-heading{
  border-color:#334155;
  color:#94a3b8;
}

/* ---------- Zone utilisateur ---------- */
.user-greet{
  display:flex;
  align-items:center;
  gap:8px;
  color:var(--muted);
  font-size:.95rem;
  white-space:nowrap;

  /* pour éviter que le texte fasse disparaître le bouton logout */
  min-width:0;
}

.user-greet__text{
  min-width:0;
  max-width:min(40vw, 360px);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.user-greet .wave{ line-height:1; }

body.theme-dark .user-greet{ color:#9ca3af; }

@media (max-width:900px){
  .user-greet{ font-size:.9rem; }
}
@media (max-width:900px){
  .user-greet span,
  .user-greet strong{
    display:none;
  }
}



/* ---------- Icône de déconnexion ---------- */
.logout-icon{
  font-size:1.2rem;
   justify-content:center;
  color:var(--muted);
  display:inline-flex;
  align-items:center;
  text-decoration:none;
  transition:color .2s ease, transform .2s ease;
  flex:0 0 auto;   /* ne se compresse jamais dans le flex */
}

.logout-icon-svg{
  width:20px;
  height:20px;
  display:block;
}


.logout-icon:hover{
  color:var(--fg);
  transform:rotate(15deg);
  text-decoration:none;
}


body.theme-dark .logout-icon{ color:#9ca3af; }
body.theme-dark .logout-icon:hover{ color:#e5e7eb; text-decoration:none; }

.header-google-sync{
  display:inline-flex;
  align-items:center;
  flex:0 0 auto;
}
.header-google-sync--topbar{
  margin-left:6px;
}
.header-google-sync-feedback{
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}
.header-icon-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:36px;
  height:36px;
  border-radius:999px;
  border:1px solid var(--line);
  background:transparent;
  color:var(--brand);
  cursor:pointer;
  padding:0;
  transition:background .15s ease, color .15s ease, border-color .15s ease, opacity .15s ease;
}
.header-icon-btn:hover{
  background:rgba(37,99,235,.08);
}
.header-icon-btn:focus{
  outline:2px solid rgba(59,130,246,.45);
  outline-offset:2px;
}
.header-icon-btn:disabled{
  opacity:.6;
  cursor:wait;
}
.header-icon-btn__svg{
  width:18px;
  height:18px;
}
.header-icon-btn.is-busy .header-icon-btn__svg{
  animation:headerSyncSpin 1s linear infinite;
}
@keyframes headerSyncSpin{
  from{ transform:rotate(0deg); }
  to{ transform:rotate(360deg); }
}
body.theme-dark .header-icon-btn{
  border-color:#1f2937;
  color:#93c5fd;
}

/* ---------- Burger ---------- */
.burger{ display:none; position:relative; width:26px; height:22px; background:none; border:none; cursor:pointer; padding:0; z-index:20; margin-left:auto;
}
.burger span{ display:block; position:absolute; height:3px; width:100%; left:0; background:var(--fg); border-radius:3px; opacity:1; transition:all .25s ease; }
.burger span:nth-child(1){top:0;} .burger span:nth-child(2){top:9px;} .burger span:nth-child(3){top:18px;}
.burger.open span:nth-child(1){top:9px;transform:rotate(45deg);} .burger.open span:nth-child(2){opacity:0;}
.burger.open span:nth-child(3){top:9px;transform:rotate(-45deg);}
body.theme-dark .burger span{ background:#e5e7eb }

/* ---------- Responsive menu ---------- */
@media (max-width:900px){

  .burger{
    display:block;
  }

  .topbar{
    order:10;
    flex-basis:100%;
    display:flex;
    flex-direction:column;
    align-items:flex-start;

    background:var(--card);
    border-radius:10px;
    margin-top:10px;
    padding:0 12px;

    overflow:hidden;
    max-height:0;
    opacity:0;
    pointer-events:none;

    transition:max-height .3s ease, opacity .25s ease, padding .25s ease;
  }

.topbar.open{
  max-height:80vh;
  opacity:1;
  pointer-events:auto;
  padding:12px;
  overflow-y:auto;
}


  .topbar a{
  width:100%;
  margin:4px 0;
  text-align:center;
  justify-content:center;
}

  .topbar-group{
    width:100%;
  }

  .topbar-group > summary{
    width:100%;
    text-align:center;
    justify-content:center;
  }

  .topbar-submenu{
    position:static;
    width:100%;
    min-width:0;
    margin-top:4px;
    border:none;
    box-shadow:none;
    border-radius:0;
    background:transparent;
    padding:0;
  }

  /* bloc user admin sur sa ligne */
  .admin-header .header-user-block{
    order:5;
    width:100%;
    justify-content:flex-end;
  }
}

/* Masquer le titre admin sur petits écrans */
@media (max-width:900px){
  .admin-title{
    display:none;
  }
}



/* ---------- Flash messages ---------- */
.flash-container{margin:12px 0;}
.flash{ padding:10px 14px; border-radius:8px; margin-bottom:8px; }
.flash.info{background:#e0f2fe;border:1px solid #bae6fd;color:#0c4a6e;}
.flash.ok{background:#ecfdf5;border:1px solid #bbf7d0;color:#14532d;}
.flash.err{background:#fef2f2;border:1px solid #fecaca;color:#7f1d1d;}
/* Alias : certaines vues utilisent .flash error au lieu de .flash.err */
.flash.error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #7f1d1d;
}
.card .flash.error,
.card .flash.err {
  margin-top: 12px;
  margin-bottom: 12px;
  font-weight: 500; /* un peu plus visible */
}
/* ---------- Hero ---------- */
.hero{padding:48px 0 28px;text-align:left;}
.hero h1{margin:0 0 8px;font-size:32px;line-height:1.2;}
.hero p{margin:0 0 18px;color:var(--muted);}
.hero .wrap{max-width:980px;}
.cta{display:flex;gap:12px;flex-wrap:wrap;margin-top:12px;}
.cta .btn,.cta .btn-strong{margin:0;}

/* =========================================================
   BOUTONS & FORMULAIRES
   ========================================================= */
.btn{
  display:inline-flex;align-items:center;justify-content:center;
  height:40px;line-height:1;margin:4px;padding:8px 12px;border:1px solid #bbb;border-radius:10px;
  appearance:none;font:inherit;
  text-decoration:none;color:var(--fg);background:#fff;cursor:pointer;
}
.btn:hover{background:#f6f6f6}
.btn:focus{outline:2px solid var(--brand);outline-offset:2px}
.btn-strong{
  display:inline-block;margin:4px;padding:8px 14px;border:1px solid var(--brand);border-radius:10px;
  font-weight:500;background:var(--brand);color:#fff;cursor:pointer;
}
.btn-strong:hover{background:var(--brand-2);border-color:var(--brand-2)}
.btn.primary,
.btn-primary{
  background:var(--brand);
  border-color:var(--brand);
  color:#fff;
}
.btn.primary:hover,
.btn-primary:hover{
  background:var(--brand-2);
  border-color:var(--brand-2);
  color:#fff;
}
.btn-secondary{
  background:#f8fafc;
  border-color:#cbd5e1;
  color:#0f172a;
}
.btn-secondary:hover{
  background:#eef2f7;
}
.btn-success{
  background:#16a34a;
  border-color:#16a34a;
  color:#fff;
}
.btn-success:hover{
  background:#15803d;
  border-color:#15803d;
}
.btn-danger,
.btn.danger{
  background:#dc2626;
  border-color:#dc2626;
  color:#fff;
}
.btn-danger:hover,
.btn.danger:hover{
  background:#b91c1c;
  border-color:#b91c1c;
}
.btn.warn{
  background:#f59e0b;
  border-color:#f59e0b;
  color:#111827;
}
.btn.warn:hover{
  background:#d97706;
  border-color:#d97706;
  color:#fff;
}
.btn-small{
  height:34px;
  padding:6px 10px;
  font-size:.85rem;
  border-radius:8px;
}

.btn-warning {
  background-color: #d9534f;   /* rouge doux type Bootstrap danger */
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .2s ease;
}

.btn-warning:hover {
  background-color: #c9302c;
}

.header-user-block{
  margin-left:auto;
  display:flex;
  align-items:center;
  gap:10px;
  overflow: visible;
}


/* ----- Jauge crédits IA ----- */
.ai-credit-meter {
  display: flex;
  align-items: center;
  min-width: 28px;
  max-width: 44px;
}

.ai-credit-bar {
  width: 100%;
  min-width: 0;
  max-width: none;
  height: 6px;
  background: #e8e8e8;
  border-radius: 999px;
  overflow: hidden;
}

.ai-credit-fill {
  height: 100%;
  width: 0;
  transition: width .25s ease;
}

/* Niveaux qualitatifs */
.ai-credit-meter--empty  .ai-credit-fill { width: 0%;   background:#d9534f; }
.ai-credit-meter--low    .ai-credit-fill { width:25%;   background:#d9534f; }
.ai-credit-meter--medium .ai-credit-fill { width:50%;   background:#f0ad4e; }
.ai-credit-meter--ok     .ai-credit-fill { width:80%;   background:#5cb85c; }
.ai-credit-meter--full   .ai-credit-fill { width:100%;  background:#3c763d; }

@media (max-width:900px){
  .ai-credit-meter{
    min-width:25px;
    max-width:40px;
  }

  .ai-credit-bar{
    min-width:25px;
    max-width:40px;
  }
}


input[type=text],input[type=search],input[type=number],input[type=email],
input[type=password],textarea,select{
  width:100%;padding:10px 12px;border-radius:8px;border:1px solid #cbd5e1;background:#fff;color:#111;font-size:1rem;
}
input:focus,textarea:focus,select:focus{ outline:2px solid var(--brand); border-color:var(--brand); }
label{font-size:.9rem;color:#374151}

/* États désactivés (centralisés, non dupliqués) */
button.btn:disabled,
button.btn[disabled]{
  opacity:.5; cursor:not-allowed!important; filter:grayscale(.6); transition:opacity .2s ease;
}
button.btn:disabled:hover,
button.btn[disabled]:hover{
  background-color:inherit; color:inherit; box-shadow:none; transform:none;
}
button.btn.primary:disabled,
button.btn.primary[disabled]{ background-color:#ccc; border-color:#bbb; color:#777; }
.btn.is-disabled,
.btn[aria-disabled="true"]{
  opacity:.45;
  cursor:not-allowed;
  pointer-events:none;
  background:#f8fafc;
  color:#94a3b8;
  border-color:#d1d5db;
}

/* =========================================================
   TABLEAUX, BADGES, NOTICES
   ========================================================= */
table{width:100%;border-collapse:separate;border-spacing:0;background:#fff;border:1px solid #e5e7eb;border-radius:14px;overflow:hidden;}
th,td{padding:12px 10px;border-bottom:1px solid #e5e7eb;font-size:.95rem;text-align:left;vertical-align:top;}
th{background:#f8fafc;color:#334155;}
tr:last-child td{border-bottom:none;}
.table-responsive{
  width:100%;
  overflow-x:auto;
  overflow-y:hidden;
  -webkit-overflow-scrolling:touch;
}
.table-responsive > table{
  min-width:680px;
}
.table-responsive.table-responsive--auto > table{
  min-width:0;
}
.table-group th{
  background:#f1f5f9;
  font-weight:700;
}
.pill,.badge,.chip{ display:inline-block;padding:4px 10px;border-radius:999px;font-size:.8rem;border:1px solid #cbd5e1;background:#f3f4f6;color:#374151; }
.badge-ok{background:#e8f8ee;color:#246b3d;border-color:#9fd6b7;}
.badge-warn{background:#fff6e5;color:#8a5b00;border-color:#f1d59a;}
.projection-state-badge{
  display:inline-flex;
  align-items:center;
  border:1px solid transparent;
  border-radius:999px;
  padding:3px 8px;
  font-size:.78rem;
  font-weight:700;
  line-height:1.2;
  white-space:nowrap;
}
.projection-state-badge--fresh{background:#dcfce7;color:#166534;border-color:#86efac;}
.projection-state-badge--stale{background:#f1f5f9;color:#475569;border-color:#cbd5e1;}
.projection-state-badge--queued{background:#fef3c7;color:#92400e;border-color:#fcd34d;}
.projection-state-badge--running{background:#dbeafe;color:#1d4ed8;border-color:#93c5fd;}
.projection-state-badge--failed{background:#fee2e2;color:#991b1b;border-color:#fca5a5;}
.projection-snapshot-badges{display:flex;gap:6px;flex-wrap:wrap;margin-top:6px;}
.projection-status-item,.projection-snapshot-item{display:inline-flex;align-items:center;gap:5px;}
.projection-status-item[hidden],.projection-snapshot-item[hidden]{display:none !important;}
body.theme-dark .projection-state-badge--fresh{background:#123524;color:#bbf7d0;border-color:#166534;}
body.theme-dark .projection-state-badge--stale{background:#1e293b;color:#cbd5e1;border-color:#475569;}
body.theme-dark .projection-state-badge--queued{background:#3b2f10;color:#fde68a;border-color:#a16207;}
body.theme-dark .projection-state-badge--running{background:#172554;color:#bfdbfe;border-color:#1d4ed8;}
body.theme-dark .projection-state-badge--failed{background:#3b0d0d;color:#fecaca;border-color:#991b1b;}
.notice{padding:8px 12px;border-radius:10px;}
.notice.ok{background:#effaf0;border:1px solid #bfe6c5;color:#225f2b;}
.notice.err{background:#fff2f0;border:1px solid #f2b5ad;color:#7a1e12;}

/* =========================================================
   BLOCS SPÉCIFIQUES
   ========================================================= */
.grid.cards3{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:16px;}
.section.biensenveloppe{background:#fafafa;border-color:#ddd;}
textarea.publi{min-height:110px;font-family:inherit;line-height:1.35;}
.kpis{display:flex;gap:12px;flex-wrap:wrap;margin:8px 0;}
.kpi{background:#fff;border:1px solid #eee;border-radius:10px;padding:8px 12px;}

/* Upload photos */
.box{background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:16px;}
#drop{border:2px dashed #cbd5e1;border-radius:12px;padding:22px;text-align:center;background:#fafafa;}
#drop.drag{background:#eef2ff;border-color:var(--brand);}

/* Helpers pour le composant d’upload (classes ajoutées par le partial) */
.zone-import{ margin-top:1rem; text-align:center; }
.actions-upload{ margin-top:1rem; text-align:center; }

/* =========================================================
   AUTH
   ========================================================= */
.auth-header { padding:16px 0; background:#0b1222; border-bottom:1px solid #1f2937; }
.auth-nav { display:flex; justify-content:space-between; align-items:center; max-width:1100px; margin:0 auto; padding:0 16px; }
.auth-brand { font-weight:600; font-size:1.1rem; color:#93c5fd; text-decoration:none; }
.auth-brand:hover{text-decoration:underline;}
.auth-return { color:#93c5fd; text-decoration:none; font-size:0.95rem; }
.auth-return:hover{text-decoration:underline;}

.auth-container{min-height:100vh;display:flex;align-items:center;justify-content:center;}
.auth-card{border-radius:16px;padding:32px;width:100%;max-width:420px;box-shadow:0 10px 30px rgba(0,0,0,.35);}
body.theme-dark .auth-card{background:#111827;border:1px solid #1f2937;}
.auth-card label{display:block;font-size:.9rem;color:#cbd5e1;margin:0 0 .35rem;}
.auth-card input[type=text],.auth-card input[type=email],.auth-card input[type=password]{
  width:100%;padding:10px 12px;border-radius:8px;border:1px solid #334155;background:#1e293b;color:#f1f5f9;font-size:1rem;
}
.auth-card input:focus{outline:2px solid #3b82f6;border-color:#3b82f6;}
.auth-card .btn,.auth-card .btn-strong,.auth-card button{
  width:100%;margin-top:12px;padding:10px 14px;font-size:1rem;font-weight:500;border-radius:10px;border:1px solid var(--brand);
  background:var(--brand);color:#fff;cursor:pointer;transition:background .15s,border-color .15s;
}
.auth-card button:hover,.auth-card .btn-strong:hover{ background:var(--brand-2); border-color:var(--brand-2); }
.auth-title{font-size:1.4rem;margin-bottom:1.5rem;text-align:center;color:#93c5fd;}
.auth-err{color:#fca5a5;text-align:center;}
.auth-ok{color:#86efac;text-align:center;}
.auth-link{color:#93c5fd;text-decoration:none;font-size:.9rem;text-align:center;display:block;margin-top:10px;}
.auth-link:hover{text-decoration:underline;}

/* Consentement RGPD */
.form-consent{ margin:12px 0 16px; font-size:.85rem; color:#cbd5e1; line-height:1.4; }
.form-consent a{ color:#93c5fd; text-decoration:underline; }
.form-consent input[type="checkbox"]{ margin-right:6px; vertical-align:middle; }

/* =========================================================
   THÈME SOMBRE
   ========================================================= */
body.theme-dark{
  --bg:#0f172a; --fg:#e5e7eb; --muted:#9aa2b1; --line:#1f2937; --card:#111827;
  background:var(--bg);color:var(--fg);
}
body.theme-dark .wrap a{color:#93c5fd;}
body.theme-dark .card,body.theme-dark .section,body.theme-dark table{ background:#111827;border-color:#1f2937;color:#e5e7eb; }
body.theme-dark th{background:#0b1222;color:#cbd5e1;border-bottom:1px solid #1f2937;}
body.theme-dark .btn,body.theme-dark input,body.theme-dark select,body.theme-dark textarea{ background:#1e293b;color:#e5e7eb;border:1px solid #334155; }
body.theme-dark .btn:hover{background:#253244;}
body.theme-dark .notice.ok{background:#052e1b;border-color:#14532d;color:#86efac;}
body.theme-dark .notice.err{background:#3b0d0d;border-color:#7f1d1d;color:#fca5a5;}
body.theme-dark .pill{border-color:#334155;}
body.theme-dark .badge,body.theme-dark .chip{background:#0b1222;border-color:#334155;color:#cbd5e1;}

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer { border-top:1px solid var(--line); background:var(--bg); color:var(--fg); margin-top:48px; font-size:.95rem; }
.site-foot {
  display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px;
  padding:20px 16px; max-width:1100px; margin:0 auto;
}
.site-foot-left{ color:var(--muted); }
.site-foot-nav{ display:flex; flex-wrap:wrap; align-items:center; gap:14px; }
.site-foot-nav a{ color:var(--brand); text-decoration:none; transition:color .2s ease, text-decoration .2s ease; }
.site-foot-nav a:hover{ text-decoration:underline; }
body.theme-dark .site-footer{ background:#0b1222; border-top:1px solid #1f2937; color:#cbd5e1; }
body.theme-dark .site-foot-left{ color:#9ca3af; }
body.theme-dark .site-foot-nav a{ color:#93c5fd; }
body.theme-dark .site-foot-nav a:hover{ text-decoration:underline; }
@media (max-width:900px){
  .site-foot{ flex-direction:column; align-items:center; text-align:center; gap:8px; }
  .site-foot-nav{ justify-content:center; }
}

/* =========================================================
   Accessibilité / Animations légères
   ========================================================= */
.progress{ width:100%; height:8px; background:var(--line); border-radius:6px; overflow:hidden; margin-bottom:6px; }
.progress-bar{ height:100%; background:var(--primary, #3b82f6); width:0%; transition:width .3s ease; }
body.theme-dark .progress{ background:#1f2937; }
body.theme-dark .progress-bar{ background:#60a5fa; }
@media (prefers-reduced-motion: reduce){
  .progress > div{ transition:none; }
  .overlay, .btn, input, select, textarea { transition:none; }
}

/* ---------- Onglets Bien ---------- */
.tabs{
  display:flex;
  gap:8px;
  border-bottom:1px solid var(--line);
  margin:12px auto 16px;
  padding:0 16px 8px;
}
.tabs-stack{ display:flex; flex-direction:column; gap:4px; margin:12px auto 16px; }
.tabs-row{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.tabs-row--top{
  justify-content:space-between;
  gap:28px;
  width:100%;
  flex-wrap:nowrap;
}
.tabs-row--bottom{ justify-content:flex-start; }
.tabs-group{ display:flex; align-items:center; gap:8px; flex-wrap:nowrap; min-width:0; }
.tabs-row--top .tabs-group{ flex:0 0 auto; }
.tabs-stack .tabs{ margin:0 auto; }
.tabs-row--single{
  justify-content:space-between;
  align-items:center;
  gap:12px;
  width:100%;
  flex-wrap:nowrap;
  overflow-x:auto;
  scrollbar-width:none;
}
.tabs-row--single::-webkit-scrollbar{ display:none; }
.tabs-row--single .tabs-group{
  flex:0 0 auto;
}
.tab{
  display:inline-flex; align-items:center; gap:6px; padding:8px 12px; border:1px solid transparent; border-radius:10px 10px 0 0;
  text-decoration:none; color:var(--fg); background:#fff; transition:background .2s, color .2s, border-color .2s;
}
.tab:hover{ background:#f8fafc; }
.tab.active{ border-color:var(--line); border-bottom-color:#fff; background:#f2f4f6; font-weight:600; }
.tab--core{
  background:#eff6ff;
  border-color:#bfdbfe;
  color:#1e3a8a;
}
.tab--core:hover{ background:#dbeafe; }
.tab--core.active{
  background:#dbeafe;
  border-color:#60a5fa;
  border-bottom-color:#dbeafe;
  color:#1d4ed8;
}
.tab--middle{
  background:#ecfdf5;
  border-color:#bbf7d0;
  color:#065f46;
}
.tab--middle:hover{ background:#d1fae5; }
.tab--middle.active{
  background:#d1fae5;
  border-color:#34d399;
  border-bottom-color:#d1fae5;
  color:#047857;
}
.tab--stage{
  background:#fff3df;
  border-color:#f6bd60;
  color:#9a4f00;
}
.tab--stage:hover{ background:#ffe2b7; }
.tab--stage.active{
  background:#ffd69a;
  border-color:#e99820;
  border-bottom-color:#ffd69a;
  color:#8a4300;
}

body.theme-dark .tab{ background:#0f172a; color:#e5e7eb; }
body.theme-dark .tab:hover{ background:#1a2236; }
body.theme-dark .tab.active{ background:#1e293b; border-color:#334155; border-bottom-color:#1e293b; }
body.theme-dark .tab--core{
  background:#172554;
  border-color:#1d4ed8;
  color:#dbeafe;
}
body.theme-dark .tab--core:hover{ background:#1e3a8a; }
body.theme-dark .tab--core.active{
  background:#1d4ed8;
  border-color:#60a5fa;
  border-bottom-color:#1d4ed8;
  color:#eff6ff;
}
body.theme-dark .tab--middle{
  background:#064e3b;
  border-color:#10b981;
  color:#d1fae5;
}
body.theme-dark .tab--middle:hover{ background:#065f46; }
body.theme-dark .tab--middle.active{
  background:#047857;
  border-color:#34d399;
  border-bottom-color:#047857;
  color:#ecfdf5;
}
body.theme-dark .tab--stage{
  background:#7c2d12;
  border-color:#fb923c;
  color:#ffedd5;
}
body.theme-dark .tab--stage:hover{ background:#9a3412; }
body.theme-dark .tab--stage.active{
  background:#c2410c;
  border-color:#fdba74;
  border-bottom-color:#c2410c;
  color:#fff7ed;
}
/* ---------- Sous-onglets Description ---------- */
.bien-desc-subtabs{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.bien-desc-subtab{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  margin:0;
  gap:8px;
  height:38px;
  appearance:none;
  -webkit-appearance:none;
  font:inherit;
  text-decoration:none;
  cursor:pointer;
  box-sizing:border-box;
  border-color:#d1d5db;
  background:#f8fafc;
  color:#111827;
  font-weight:500;
}
.bien-desc-subtab:hover{
  background:#eef2ff;
  border-color:#cbd5e1;
}
.bien-desc-subtab.is-active{
  background:#ecf3ff;
  border-color:#93c5fd;
  color:#0f172a;
}
.bien-desc-subtab-num{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:1.6rem;
  height:1.6rem;
  padding:0 .36rem;
  border-radius:999px;
  border:1px solid #60a5fa;
  background:#bfdbfe;
  color:#1e3a8a;
  font-size:.78rem;
  font-weight:800;
  line-height:1;
}
.bien-desc-subtab.is-active .bien-desc-subtab-num{
  border-color:#1d4ed8;
  background:#2563eb;
  color:#ffffff;
}
.bien-desc-subtab-label{
  white-space:nowrap;
}
.bien-desc-subtab-dot{
  width:.5rem;
  height:.5rem;
  border-radius:999px;
  display:inline-block;
  background:#9ca3af;
  border:1px solid #6b7280;
}
.bien-desc-subtab.has-data .bien-desc-subtab-dot{
  background:#22c55e;
  border-color:#15803d;
}
.bien-desc-subtab.has-data{
  border-color:#a7f3d0;
}
.bien-desc-subtab.no-data{
  border-style:dashed;
}
.bien-desc-mo-badge,
.fin-source-badge{
  display:inline-flex;
  align-items:center;
  padding:3px 9px;
  border-radius:999px;
  background:#eff6ff;
  color:#1d4ed8;
  border:1px solid #93c5fd;
  font-size:.74rem;
  font-weight:700;
  line-height:1.2;
}
body.theme-dark .bien-desc-subtab-dot{
  background:#6b7280;
  border-color:#4b5563;
}
body.theme-dark .bien-desc-subtab.has-data .bien-desc-subtab-dot{
  background:#22c55e;
  border-color:#4ade80;
}
body.theme-dark .bien-desc-subtab.has-data{
  border-color:#166534;
}
body.theme-dark .bien-desc-mo-badge,
body.theme-dark .fin-source-badge{
  background:#172554;
  color:#bfdbfe;
  border-color:#1d4ed8;
}
.fin-pilot-grid{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  gap:12px;
  align-items:start;
}
.fin-pilot-field{
  border:1px solid #dbeafe;
  border-radius:12px;
  padding:12px;
  background:#f8fbff;
}
.fin-pilot-field[data-fin-source-state="manual"]{
  border-color:#fbbf24;
  background:#fffbeb;
}
.fin-pilot-field[data-fin-source-state="obsolete"]{
  border-color:#fdba74;
  background:#fff7ed;
}
.fin-pilot-field-head{
  display:flex;
  justify-content:flex-start;
  align-items:flex-start;
  gap:10px;
  margin-bottom:8px;
}
.fin-pilot-field-label-line{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.fin-pilot-info{
  width:18px;
  min-width:18px;
  height:18px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  border:1px solid #cbd5e1;
  color:#64748b;
  background:#fff;
  cursor:help;
  text-decoration:none;
}
.fin-pilot-info svg{
  width:12px;
  height:12px;
  stroke:currentColor;
  stroke-width:2;
  fill:none;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.fin-pilot-info:hover{
  color:#1d4ed8;
  border-color:#93c5fd;
  background:#eff6ff;
}
.financier-layout-main{
  display:grid;
  grid-template-columns:minmax(0,2fr) minmax(0,1fr);
  gap:12px;
}
.fin-pilot-input-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:8px;
  align-items:center;
}
.fin-pilot-doc-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:8px;
  align-items:start;
}
.fin-pilot-doc-row > .js-bien-document{
  min-width:0;
}
.fin-pilot-document-label{
  font-weight:700;
  color:#0f172a;
  letter-spacing:.01em;
}
.fin-pilot-input-row > input[data-simple-field-input]{
  min-width:0;
}
.fin-pilot-field-helper{
  margin-top:6px;
  padding:8px 10px;
  border:1px solid #dbeafe;
  border-radius:10px;
  background:#f8fbff;
}
.fin-pilot-field-helper[hidden]{
  display:none !important;
}
.fin-pilot-helper-label{
  display:flex;
  align-items:center;
  gap:6px;
  margin-bottom:6px;
  color:#475569;
  font-size:12px;
  line-height:1.2;
}
.fin-pilot-helper-label strong{
  color:#1e3a8a;
  font-weight:600;
}
.fin-pilot-helper-select{
  width:100%;
  min-width:0;
}
.fin-pilot-helper-caption{
  margin-top:6px;
  color:#64748b;
  font-size:12px;
  line-height:1.3;
}
.simple-field-actions{
  display:inline-flex;
  align-items:center;
  gap:6px;
  justify-self:end;
  flex-wrap:nowrap;
}
.simple-field-action-btn{
  width:30px;
  min-width:30px;
  height:30px;
}
.simple-field-action-btn[data-simple-field-action="edit"]{
  background:#eff6ff;
  color:#1d4ed8;
  border-color:#93c5fd;
}
.simple-field-action-btn[data-simple-field-action="save"]{
  background:#ecfdf5;
  color:#047857;
  border-color:#86efac;
}
.simple-field-action-btn[data-simple-field-action="cancel"]{
  background:#f8fafc;
  color:#475569;
  border-color:#cbd5e1;
}
.simple-field-action-btn[data-simple-field-action="revert"]{
  background:#fff7ed;
  color:#b45309;
  border-color:#fdba74;
}
.fin-pilot-icon-btn{
  width:34px;
  min-width:34px;
  height:34px;
  padding:0;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:1rem;
  line-height:1;
  border-radius:999px;
}
.fin-pilot-icon-btn svg{
  width:18px;
  height:18px;
  stroke:currentColor;
  stroke-width:2.25;
  fill:none;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.fin-pilot-icon-btn--reset{
  background:#fff7ed;
  color:#b45309;
  border-color:#fdba74;
}
.fin-pilot-icon-btn--reset:hover{
  background:#ffedd5;
  border-color:#f59e0b;
}
.fin-pilot-icon-btn.is-disabled,
.fin-pilot-icon-btn[disabled]{
  opacity:.5;
}
.fin-pilot-icon-btn.is-loading{
  opacity: 1;
  color: #1d4ed8;
  border-color: #93c5fd;
  background: #eff6ff;
}
.fin-pilot-icon-btn.is-loading svg{
  animation: immo-spin 0.95s linear infinite;
}
.fin-pilot-doc-field[data-generated-content-busy="1"] [data-generated-content-feedback]{
  color:#1d4ed8;
  font-weight:600;
}
@keyframes immo-spin{
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.fin-source-badge--manual{
  background:#fff7ed;
  color:#b45309;
  border-color:#fdba74;
}
.fin-source-badge--ai{
  background:#eff6ff;
  color:#1d4ed8;
  border-color:#93c5fd;
}
.fin-pilot-value-line{
  margin-top:8px;
}
.fin-pilot-warning{
  margin-top:8px;
}
body.theme-dark .fin-pilot-field{
  background:#0f172a;
  border-color:#1e3a8a;
}
body.theme-dark .fin-pilot-field[data-fin-source-state="manual"]{
  background:#2b2111;
  border-color:#b45309;
}
body.theme-dark .fin-pilot-field[data-fin-source-state="obsolete"]{
  background:#2a1708;
  border-color:#c2410c;
}
body.theme-dark .fin-source-badge--manual{
  background:#2b2111;
  color:#fdba74;
  border-color:#b45309;
}
body.theme-dark .fin-source-badge--ai{
  background:#172554;
  color:#bfdbfe;
  border-color:#1d4ed8;
}
body.theme-dark .fin-pilot-info{
  background:#0f172a;
  color:#94a3b8;
  border-color:#334155;
}
body.theme-dark .fin-pilot-info:hover{
  background:#172554;
  color:#bfdbfe;
  border-color:#1d4ed8;
}
body.theme-dark .simple-field-action-btn[data-simple-field-action="edit"]{
  background:#172554;
  color:#bfdbfe;
  border-color:#1d4ed8;
}
body.theme-dark .simple-field-action-btn[data-simple-field-action="save"]{
  background:#052e16;
  color:#bbf7d0;
  border-color:#22c55e;
}
body.theme-dark .simple-field-action-btn[data-simple-field-action="cancel"]{
  background:#0f172a;
  color:#cbd5e1;
  border-color:#334155;
}
body.theme-dark .simple-field-action-btn[data-simple-field-action="revert"]{
  background:#2b2111;
  color:#fdba74;
  border-color:#b45309;
}
body.theme-dark .fin-pilot-icon-btn--reset{
  background:#2b2111;
  color:#fdba74;
  border-color:#b45309;
}
body.theme-dark .fin-pilot-icon-btn--reset:hover{
  background:#3b2a14;
  border-color:#f59e0b;
}
@media (max-width:900px){
  .financier-layout-main{
    grid-template-columns:1fr;
  }
  .fin-pilot-grid{
    grid-template-columns:1fr;
  }
}
body.theme-dark .bien-desc-subtab{
  border-color:#334155;
  background:#111827;
  color:#e5e7eb;
}
body.theme-dark .bien-desc-subtab:hover{
  background:#1f2937;
  border-color:#475569;
}
body.theme-dark .bien-desc-subtab.is-active{
  background:#1e293b;
  border-color:#60a5fa;
  color:#f8fafc;
}
body.theme-dark .bien-desc-subtab-num{
  border-color:#3b82f6;
  background:#1d4ed8;
  color:#dbeafe;
}
body.theme-dark .bien-desc-subtab.is-active .bien-desc-subtab-num{
  border-color:#60a5fa;
  background:#3b82f6;
  color:#ffffff;
}

/* ---------- Titre sous les onglets ---------- */
.bien-subtitle-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  margin:4px 16px 16px;
}
.bien-subtitle-identity{
  display:flex;
  align-items:center;
  gap:12px;
  flex:1 1 auto;
  min-width:0;
}
.bien-subtitle{ font-size:1.25rem; font-weight:600; color:var(--fg); margin:0; }
.bien-subtitle{ min-width:0; }
.bien-subtitle-main{
  font-size:1.25rem;
  font-weight:600;
  line-height:1.25;
}
.bien-subtitle-meta{
  margin-top:2px;
  font-size:.875rem;
  line-height:1.3;
  font-weight:400;
  color:var(--muted);
}
.bien-subtitle-extra{
  margin-top:2px;
  font-size:.875rem;
  line-height:1.3;
  font-weight:400;
  color:var(--muted);
}
.bien-subtitle-extra-label{
  margin-right:6px;
}
.bien-subtitle-extra-sep{
  display:inline-block;
  margin:0 6px;
  color:var(--muted);
}
.bien-subtitle-extra-link{
  color:var(--muted);
  text-decoration:underline;
  text-underline-offset:2px;
}
.bien-subtitle-extra-link:hover{
  color:var(--fg);
}
.bien-subtitle-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  flex-wrap:wrap;
  margin-left:auto;
}
.bien-subtitle-status{
  flex:0 1 280px;
  min-width:220px;
}
.bien-photo-slot{
  display:flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
  width:72px;
  height:72px;
  border:1px solid var(--line);
  border-radius:10px;
  overflow:hidden;
  background:#f3f4f6;
  color:var(--fg);
  text-decoration:none;
}
.bien-photo-slot:hover{
  text-decoration:none;
  border-color:#cbd5e1;
}
.bien-photo-slot img{
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
}
.bien-photo-slot--subtitle{
  width:104px;
  height:72px;
  min-width:104px;
  box-shadow:0 1px 2px rgba(15,23,42,.06);
}
.bien-photo-slot--list{
  width:84px;
  height:56px;
  border-radius:8px;
}
.bien-photo-slot--list img{
  width:100%;
  height:100%;
  object-fit:cover;
}
.bien-photo-slot--upload{
  background:#eff6ff;
  color:var(--brand-2);
  font-size:12px;
  font-weight:600;
  line-height:1.1;
  padding:8px;
  text-align:center;
}
.bien-photo-slot--upload:hover{
  background:#dbeafe;
  color:var(--brand-2);
}
.bien-photo-slot-copy{
  display:flex;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  gap:3px;
  max-width:100%;
}
.bien-photo-slot-icon{
  font-size:18px;
  line-height:1;
}

.selection-grid .media-thumb{
  height:132px;
  overflow:hidden;
}

.selection-grid .media-thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
}

/* ---------- Runner UI ---------- */
#runner_zone{ font-size:.9rem; line-height:1.35; }
#runner_zone pre.log{
  font-size:.85rem; line-height:1.3; padding:6px 10px; max-height:400px; overflow-y:auto;
  border-radius:8px; background:var(--card); border:1px solid var(--line);
}
#runner_zone .row.text-muted{ font-size:.85rem; color:var(--muted); }
#runner_zone .btn{ font-size:.85rem; padding:4px 10px; }


.btn.job-not-started {
  background: #e5e5e5;
  color: #333;
}

.btn.job-running {
  background: #1976d2;
  color: #fff;
}

.btn.job-done {
  background: #2e7d32;
  color: #fff;
}

.btn.job-partial {
  background: #f9a825;
  color: #000;
}

.btn.job-error {
  background: #c62828;
  color: #fff;
}

.admin-header {
    background:#1f2937;
    color:#fff;
}

.admin-header .btn-back-app {
    margin-right:20px;
    color:#fff;
    text-decoration:none;
}

.admin-header .nav-admin a {
    margin:0 10px;
    color:#d1d5db;
}

.admin-header .nav-admin a:hover {
    color:#fff;
}

.admin-title {
    font-weight:bold;
    font-size:1.2rem;
}

.user-box {
    margin-left:20px;
}

.admin-layout .admin-header {
  background: #111827;
  color: #f9fafb;
}

.admin-header .brand span {
  color: #f9fafb;
}

.topbar-admin .btn {
  margin-right: 6px;
}

.admin-user-block {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-user-block .btn-light {
  background: #e5e7eb;
  color: #111827;
}
input.input {
    font-size: 15px;
    padding: 8px;
}

/* === Normalisation des champs dans l'admin === */
.admin-layout input.admin-input,
.admin-layout select.admin-input,
.admin-layout textarea.admin-input {
  display: block;
  width: 100%;
  box-sizing: border-box;

  font-size: 15px !important;
  line-height: 1.4;
  padding: 8px 10px !important;

  border-radius: 8px !important;
  border: 1px solid #334155 !important;
  background-color: #0f172a !important;
  color: #e5e7eb !important;

  outline: none;
}

.admin-layout input.admin-input:focus,
.admin-layout select.admin-input:focus,
.admin-layout textarea.admin-input:focus {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.35);
}

/* --- Mode sombre : bouton actif (menu admin/app) --- */
.theme-dark .btn-strong {
    background: #2563eb !important; /* Bleu propre et lisible */
    color: #ffffff !important;
    border-color: #1d4ed8 !important;
}

.theme-dark .btn-strong:hover {
    background: #1d4ed8 !important;
    color: #ffffff !important;
}

.pre-box {
    background:#0f172a;
    padding:12px;
    border:1px solid #334155;
    border-radius:6px;
    white-space:pre-wrap;     /* <-- autorise le retour à la ligne */
    word-break:break-word;    /* <-- coupe les mots si nécessaire */
    overflow-x:auto;          /* <-- garde un scroll horizontal si besoin */
    font-family: Consolas, monospace;
    font-size:14px;
}
.copy-meta-btn {
    background: transparent !important;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    margin-left: 4px;
    opacity: 0.8;
    padding: 2px 4px;
    color: inherit; /* hérite du thème dark */
}

.copy-meta-btn:hover {
    opacity: 1;
}

/* -------- Dashboard connexions (admin/auth_log.php) -------- */
.admin-select-small {
  padding: 4px 8px;
  font-size: 0.9rem;
  border-radius: 999px;
  border: 1px solid #4b5563;
  background: #020617;
  color: #e5e7eb;
}

.stat-card {
  flex: 1 1 140px;
  min-width: 140px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #020617;
  border: 1px solid #1f2937;
}
.stat-card .stat-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #9ca3af;
}
.stat-card .stat-value {
  font-size: 1.4rem;
  font-weight: 600;
  margin-top: 4px;
}
.stat-card .stat-sub {
  font-size: 0.8rem;
  color: #9ca3af;
}
.stat-card.stat-ok {
  border-color: #16a34a;
}
.stat-card.stat-err {
  border-color: #dc2626;
}

.auth-chart-wrapper {
  margin-top: 16px;
  padding-top: 8px;
  border-top: 1px solid #1f2937;
}

.auth-chart-bars {
  display: flex;
  gap: 6px;
  align-items: flex-end;
  min-height: 140px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.auth-chart-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 22px;
  font-size: 0.7rem;
  color: #9ca3af;
}

.auth-chart-bar-total {
  width: 100%;
  border-radius: 999px 999px 2px 2px;
  background: #111827;
  position: relative;
  overflow: hidden;
  min-height: 8px;
}

.auth-chart-bar-ok {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #22c55e;
}

.auth-chart-bar-label {
  margin-top: 4px;
  white-space: nowrap;
}

/* Conteneur global de la sélection */
#selection-root {
  margin-top: 8px;
}

/* Grille des cartes photos */
.selection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  align-items: flex-start;
}
/* Carte média : fond, bordure, texte plus petit */
.media-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-size: 0.8rem;          /* 👈 texte plus petit dans toute la carte */
}

/* Zone vignette */
.media-thumb {
  width: 100%;
  background: #f3f4f6;
}

.media-thumb img {
  display: block;
  width: 100%;
  height: auto;
}

/* Infos texte */
.media-info {
  padding: 6px 8px;
}

.media-title {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.media-view-angle {
  font-size: 0.7rem;
  color: #9ca3af;
  font-style: italic;
  margin-bottom: 2px;
}

.media-caption {
  font-size: 0.75rem;
  color: #4b5563;
  margin-bottom: 4px;
}

.media-qa {
  font-size: 0.7rem;
  color: #6b7280;
  margin-bottom: 4px;
}

.media-meta {
  font-size: 0.9rem;
  color: #6b7280;
  margin-bottom: 4px;
}

.media-tags,
.media-issues {
  margin-top: 2px;
}

.media-tags .tag,
.media-issues .issue {
  display: inline-block;
  font-size: 0.7rem;
  padding: 2px 4px;
  border-radius: 999px;
  margin-right: 3px;
  margin-bottom: 2px;
}

.media-tags .tag {
  background: #eff6ff;
  color: #1d4ed8;
}

.media-issues .issue {
  background: #fef2f2;
  color: #b91c1c;
}

/* Barre des versions */
.media-versions,
.media-piece {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;        /* un peu plus compact */
  font-size: 0.75rem;     /* ⬅️ plus petit */
  color: #6b7280;         /* gris discret */
}

.media-versions label,
.media-piece label {
  font-weight: 500;       /* moins marqué */
  font-size: 0.75rem;     /* ⬅️ plus petit */
  white-space: nowrap;
}

.media-versions select,
.media-piece select {
  flex: 1;
  min-width: 0;
  padding: 1px 4px;       /* plus fin */
  font-size: 0.75rem;     /* ⬅️ aligné avec le label */
  color: #374151;
}

.media-actions .btn-flag{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 10px;
  font-size:0.85rem;
  border-radius:8px;
  border:1px solid #d1d5db;
  background:#fff;
  color:#374151;
  cursor:pointer;
}

/* Icône par défaut : inactif */
.media-actions .btn-flag::before{
  content:"⏺";
  font-size:0.9rem;
}

.btn-select.is-active{
  border-color:#2563eb;
  background:#dbeafe;
  color:#1d4ed8;
  font-weight:600;
}
.btn-select.is-active::before{
  content:"✅";
}
.btn-web.is-active{
  border-color:#2563eb;
  background:#dbeafe;
  color:#1d4ed8;
  font-weight:600;
}
.btn-web.is-active::before{
  content:"🌐";
}
.btn-discard.is-active{
  border-color:#f97316;
  background:#ffedd5;
  color:#9a3412;
  font-weight:600;
}
.btn-discard.is-active::before{
  content:"🗑";
}
.media-actions {
  display: flex;
  flex-wrap: nowrap;      /* ⛔ jamais de retour à la ligne */
  gap: 6px;
  align-items: center;
}

.media-actions .btn-flag {
  min-width: 20px;       /* ajuste si besoin */
  white-space: nowrap;   /* empêche le texte de casser */
  text-align: center;
  font-size: 0.8rem;
}
.media-actions .btn-flag.is-active {
  font-weight: 600; /* au lieu de 700 */
}

.selection-filters{
  margin:10px 0 12px;
  padding:10px;
  border:1px solid #e5e7eb;
  border-radius:10px;
  background:#fff;
  overflow-x:auto;
}
.selection-filters .filters-row{
  display:grid;
  grid-template-columns:minmax(120px,1fr) minmax(200px,1.3fr) minmax(120px,1fr) auto;
  gap:10px;
  align-items:end;
  min-width:640px;
}
.selection-filters .filters-item{
  display:flex;
  flex-direction:column;
  gap:4px;
  font-size:.75rem;
  color:#6b7280;
  white-space:nowrap;
}
.selection-filters select,
.selection-filters input{
  padding:6px 8px;
  font-size:.85rem;
  border:1px solid #d1d5db;
  border-radius:8px;
  color:#111827;
}
.selection-filters .filters-item--toggle{
  align-items:flex-start;
}
#filter-text{
  max-width:320px;
  font-size:.8rem;
  padding:3px 6px;
}
.filters-state{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:nowrap;
}
.filters-state label{
  font-size:.72rem;
  line-height:1.1;
  display:inline-flex;
  align-items:center;
  gap:4px;
  white-space:nowrap;
}
.filters-state input[type="checkbox"]{
  transform:scale(.9);
}
/* Toggle détails (classe posée sur <html>) */
.selection-hide-details .media-details{
  display:none !important;
}

.media-card.is-draggable { cursor: grab; }
.media-card.is-dragging { opacity: .6; cursor: grabbing; }
.media-card.is-drop-target { outline: 2px dashed #60a5fa; outline-offset: 4px; }

.media-thumb { position: relative; }

.drag-handle{
  position:absolute;
  top:6px;
  left:6px;                 /* ou right:6px, choisissez un seul */
  z-index:3;

  display:inline-flex;      /* ✅ évite le comportement block */
  align-items:center;
  justify-content:center;
  width:auto;               /* ✅ n’étire pas */
  max-width:max-content;

  background: rgba(255,255,255,.85);
  border:1px solid #d1d5db;
  border-radius:8px;
  padding:2px 6px;
  font-size:.85rem;
  line-height:1;

  cursor:grab;
  user-select:none;
}

.media-card.is-dragging .drag-handle { cursor: grabbing; }

/* Barre d’onglets – compacte */
.media-version-tabs{
  display:flex;
  gap:0;                 /* onglets collés */
  margin:0 0 1px 0;      /* espace réduit avec l’image */
}

/* Onglet – compact */
.media-tab{
  appearance:none;
  border:1px solid #e5e7eb;
  border-right:0;        /* fusion visuelle */
  background:#f9fafb;
  color:#6b7280;
  font-size:0.65rem;     /* plus petit */
  line-height:1;
  padding:4px 6px;       /* hauteur réduite */
  cursor:pointer;
  border-radius:0;
}

/* Arrondis uniquement aux extrémités */
.media-tab:first-child{
  border-top-left-radius:6px;
  border-bottom-left-radius:6px;
}
.media-tab:last-child{
  border-right:1px solid #e5e7eb;
  border-top-right-radius:6px;
  border-bottom-right-radius:6px;
}

/* Hover discret */
.media-tab:hover{
  background:#f3f4f6;
  color:#374151;
}

/* Onglet actif – visible mais sobre */
.media-tab.is-active{
  background:#111827;
  color:#ffffff;
  border-color:#111827;
  z-index:1; /* évite le chevauchement des bordures */
}

/* Désactivé */
.media-tab.is-disabled{
  opacity:.45;
  cursor:not-allowed;
}


.ia-enh-dlg{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 10000;
}
.ia-enh-dlg__box{
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%,-50%);
  background: #fff;
  border-radius: 12px;
  width: min(720px, 92vw);
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  padding: 14px 16px;
}
.ia-enh-dlg__head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
  margin-bottom:10px;
}
.ia-enh-dlg__title{ font-weight: 700; }
.ia-enh-dlg__sub{ font-size: .85rem; color:#6b7280; margin-top:2px; }
.ia-enh-dlg__close{
  border:0; background:transparent; cursor:pointer;
  font-size: 1rem; line-height:1;
  padding: 6px 8px;
}
.ia-enh-dlg__label{ font-size:.85rem; color:#374151; margin-bottom:6px; }
.ia-enh-dlg__textarea{
  width:100%;
  box-sizing:border-box;
  border:1px solid #d1d5db;
  border-radius:10px;
  padding:10px;
  font-family: inherit;
}
.ia-enh-dlg__row{ margin: 10px 0; }
.ia-enh-dlg__opt{
  display:block;
  font-size:.9rem;
  color:#111827;
  margin:6px 0;
}
.ia-enh-dlg__foot{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  margin-top: 12px;
}

.media-version-tabbar{
  display:flex;
  align-items:flex-end;
  gap:6px;
  margin:0 0 4px 0;
}

.media-ia-btn{
  font-size:.72rem;
  padding:2px 6px;
  line-height:1;
  border:1px solid #d1d5db;
  border-radius:6px;
  background:#fff;
  cursor:pointer;
}
/* =========================
   IA avancée — Panel (modal)
   Scope: .ia-enh-dlg
   ========================= */

.ia-enh-dlg{
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0,0,0,.45);
  display: none;
  padding: 18px;
  box-sizing: border-box;
}

.ia-enh-dlg__box{
  max-width: 980px;               /* ✅ plus large */
  width: min(980px, 96vw);
  margin: 0 auto;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0,0,0,.25);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
}

/* Header */
.ia-enh-dlg__head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(0,0,0,.10);
}

.ia-enh-dlg__title{ font-size: 16px; line-height: 1.2; font-weight: 800; }
.ia-enh-dlg__sub{ font-size: 12px; opacity: .8; margin-top: 2px; }

.ia-enh-dlg__close{
  border: 1px solid rgba(0,0,0,.12);
  background: rgba(0,0,0,.04);
  border-radius: 10px;
  padding: 4px 8px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.ia-enh-dlg__close:hover{ background: rgba(0,0,0,.07); }

/* =========================
   Compare (2 colonnes)
   HTML: .ia-enh-compare / .ia-enh-compare__col
   ========================= */

.ia-enh-compare{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 12px 14px 10px;
}

@media (max-width:900px){
  .ia-enh-compare{ grid-template-columns: 1fr; }
}

.ia-enh-compare__col{
  display: grid;
  gap: 6px;
}

.ia-enh-base-label{
  font-size: 12px;
  font-weight: 700;
  opacity: .85;
  margin: 0;
}

/* ✅ Cadres (rectangles larges, base = résultat) */
.ia-enh-base-img,
.ia-enh-result-wrap{
  width: 100%;
  height: 200px;                 /* hauteur identique */
  box-sizing: border-box;        /* bordure incluse */
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 10px;
  background: rgba(0,0,0,.03);
  overflow: hidden;
  position: relative;
  padding: 0;
  line-height: 0;                /* évite tout débordement vertical */
}

/* ✅ Images : photo entière, sans recadrage */
.ia-enh-base-img,
.ia-enh-result-img{
  width: auto;
  height: 200px;
  object-fit: contain;           /* affiche la photo complète */
  display: block;
}

/* Wrapper résultat */
.ia-enh-result-wrap{
  display: grid;
  place-items: center;
}
.ia-enh-result-msg{
  white-space: pre-line;
}

/* ✅ Overlay loading — n’impacte pas la hauteur du cadre */
.ia-enh-result-overlay{
  position: absolute;
  inset: 0;                      /* couvre exactement le cadre */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  padding: 0;                    /* ⚠️ pas de padding (évite +2/4px visuels) */
  margin: 0;
  box-sizing: border-box;

  font-size: 12px;
  line-height: 1.2;
  text-align: center;

  background: rgba(255,255,255,.55);
  pointer-events: none;          /* clics ignorés */
}
/* Spinner */
.ia-enh-spinner{
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,.2);
  border-top-color: rgba(0,0,0,.6);
  animation: iaSpin 0.8s linear infinite;
}

@keyframes iaSpin { to { transform: rotate(360deg); } }

/* Mode loading : grisé */
.ia-enh-result-wrap.is-loading{
  filter: grayscale(1);
  opacity: .75;
}

/* =========================
   Body (prompt + options)
   ========================= */

.ia-enh-dlg__body{
  padding: 10px 14px 12px;
  display: grid;
  gap: 10px;
}

.ia-enh-dlg__row{ display: grid; gap: 0px; }
.ia-enh-dlg__label{ font-size: 12px; font-weight: 700; opacity: .85; }

.ia-enh-dlg__textarea{
  width: 100%;
  box-sizing: border-box;
  font-size: 12px;
  line-height: 1.25;
  padding: 8px 10px;
  border: 1px solid rgba(0,0,0,.16);
  border-radius: 10px;
  background: #fff;
  resize: vertical;
  min-height: 46px;
}

.ia-enh-row--compact .ia-enh-dlg__opt{
  font-size: 12px;
  line-height: 1.2;
  margin: 3px 0;
  display:flex;
  gap:8px;
  align-items:flex-start;
}
.ia-enh-row--compact .ia-enh-dlg__opt input{ margin-top: 2px; }

/* =========================
   Footer (buttons)
   ========================= */

.ia-enh-dlg__foot{
  padding: 10px 14px;
  border-top: 1px solid rgba(0,0,0,.10);
  display:flex;
  justify-content:flex-end;
  gap:10px;
}

.ia-enh-dlg .btn{
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid rgba(0,0,0,.18);
  background: rgba(0,0,0,.04);
  color: inherit;
}

.ia-enh-dlg .btn:hover,
.ia-enh-dlg .btn:focus-visible{
  background: rgba(0,0,0,.07);
  color: inherit;
  outline: none;
}

.ia-enh-dlg .btn.btn-ghost{
  background: transparent;
  border: 1px solid rgba(0,0,0,.18);
}

.ia-enh-dlg .btn.btn-primary{
  background: #2563eb;
  border: 1px solid #2563eb;
  color: #fff;
}

.ia-enh-dlg .btn.btn-primary:hover,
.ia-enh-dlg .btn.btn-primary:focus-visible{
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff !important;
}

.ia-enh-dlg .btn.btn-primary.is-loading{
  opacity: .75;
  cursor: wait;
}

.ia-enh-dlg.is-busy{
  cursor: wait;
}

.ia-enh-dlg.is-busy button{
  pointer-events: none;
  opacity: .6;
}

/* =========================
   Overlay défilement selection / piece
   THEME CLAIR (viewer uniquement)
   ========================= */

.sel-viewer{
  position:fixed;
  inset:0;
  z-index:9999;
}

/* backdrop conservé sombre */
.sel-viewer__backdrop{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.65);
}

/* BOÎTE PRINCIPALE */
.sel-viewer__box{
  position:absolute;
  inset:18px;
  background:#ffffff;                /* ⬅️ fond clair */
  border-radius:12px;
  display:flex;
  flex-direction:column;
  color:#111827;                     /* ⬅️ texte sombre */
  box-shadow:0 18px 60px rgba(0,0,0,.25);
}

/* HEADER */
.sel-viewer__head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:10px 12px;
  border-bottom:1px solid #e5e7eb;
}

.sel-viewer__title{
  font-weight:600;
}

.sel-viewer__sub{
  font-size:12px;
  color:#6b7280;
}

/* OUTILS HEADER */
.sel-viewer__tools{
  display:flex;
  gap:8px;
  align-items:center;
}

.sel-viewer__counter{
  font-size:12px;
  color:#6b7280;
}

/* BODY */
.sel-viewer__body{
  display:grid;
  grid-template-columns:48px 1fr 48px 360px;
  gap:10px;
  flex:1;
  min-height:0;
  padding:10px;
}

/* IMAGE */
.sel-viewer__main{
  min-width:0;
  min-height:0;
  display:flex;
  align-items:center;
  justify-content:center;
}

.sel-viewer__imgwrap{
  width:100%;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}

.sel-viewer__imgwrap img{
  max-width:100%;
  max-height:100%;
  object-fit:contain;
}

/* NAVIGATION */
.sel-viewer__nav{
  background:transparent;
  border:0;
  color:#111827;
  font-size:44px;
  opacity:.55;
  cursor:pointer;
}

.sel-viewer__nav:hover{
  opacity:.9;
}

/* COLONNE DROITE */
.sel-viewer__side{
  min-width:0;
  min-height:0;
  overflow:auto;
  border-left:1px solid #e5e7eb;
  padding-left:10px;
}

.sel-viewer__tabbar{
  margin-bottom:10px;
}

.sel-viewer__flags{
  display:flex;
  gap:8px;
  margin:10px 0;
}

.sel-viewer__toggle{
  display:flex;
  gap:8px;
  align-items:center;
  margin:10px 0;
  color:#111827;
}

/* DETAILS */
.sel-viewer__details{
  color:#111827;
}

/* =========================================================
   Boutons de MODE – overlay viewer UNIQUEMENT
   ========================================================= */

/* Base */
#selViewer .sel-viewer__tools .btn[data-act^="mode-"]{
  background-color:#ffffff;      /* blanc */
  border:1px solid #d1d5db;
  color:#000000;                 /* TEXTE NOIR TOUJOURS */
  box-shadow:none;
}

/* Mode actif : fond bleu clair UNIQUEMENT */
#selViewer .sel-viewer__tools .btn[data-act^="mode-"].is-active{
  background-color:#b6d2ff;      /* bleu clair */
  border-color:#3b82f6;
  color:#000000;
}

/* Mode désactivé */
#selViewer .sel-viewer__tools .btn[data-act^="mode-"].is-disabled,
#selViewer .sel-viewer__tools .btn[data-act^="mode-"]:disabled{
  background-color:#f3f4f6;      /* gris */
  border-color:#e5e7eb;
  color:#6b7280;
  cursor:not-allowed;
  pointer-events:none;
}

/* Hover léger */
#selViewer .sel-viewer__tools
.btn[data-act^="mode-"]:not(.is-active):not(:disabled):hover{
  background-color:#f9fafb;
}

/* =========================
   Overlay viewer – typographie caption / détails
   ========================= */

/* Caption : même taille que les détails actuels (base) */
#selViewer .sel-viewer__details .media-caption{
  font-size: 14px;
  line-height: 1.35;
  font-weight: 500;
  margin-bottom: 6px;
}

/* Détails : plus petit */
#selViewer .sel-viewer__details .media-small,
#selViewer .sel-viewer__details .tag{
  font-size: 12px;
  line-height: 1.3;
}

/* Tags un peu plus compacts visuellement */
#selViewer .sel-viewer__details .media-tags{
  margin-top: 6px;
}

/* =========================
   Overlay viewer – barre outils : pas de retour à la ligne
   ========================= */

#selViewer .sel-viewer__tools{
  flex-wrap: nowrap;          /* pas de wrap */
  white-space: nowrap;        /* pas de retour ligne */
}

#selViewer .sel-viewer__tools .btn[data-act^="mode-"]{
  white-space: nowrap;        /* texte bouton sur 1 ligne */
}

/* Réserver une largeur pour le select pièces, même quand “inactif” */
#selViewer .sel-viewer__piece{
  min-width: 170px;           /* ajuste si besoin (170–220) */
}

#selViewer .sel-viewer__piece.is-disabled:disabled{
  opacity: .65;
  cursor: not-allowed;
}


/* ===== Menu Compte (dropdown icône) ===== */
.acct-menu{
  position:relative;
  display:inline-flex;
  align-items:center;
  margin:0 6px;
  flex:0 0 auto;
}
.acct-menu__btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:36px;
  height:36px;
  border-radius:999px;
  border:1px solid var(--line);
  background:transparent;
  color:inherit;
  cursor:pointer;
  padding:0;
}
.acct-menu__btn:hover{
  background:rgba(37,99,235,.08);
}
.acct-menu__btn:focus{
  outline:2px solid rgba(59,130,246,.45);
  outline-offset:2px;
}
.acct-menu__icon{
  width:18px;
  height:18px;
  fill:var(--brand);
  transition:fill .15s ease;
}
.acct-menu__btn.is-active{
  background:var(--brand);
  border-color:var(--brand);
}
.acct-menu__btn.is-active .acct-menu__icon{
  fill:#ffffff;
}
.acct-menu__drop{
  position:fixed;
  top:0;
  left:0;
  min-width:220px;
  max-width:min(280px, calc(100vw - 16px));
  background:var(--bg);
  border:1px solid var(--line);
  border-radius:12px;
  box-shadow:0 10px 30px rgba(0,0,0,.12);
  padding:6px;
  display:none;
  z-index:4000;
  max-height:min(70vh, 320px);
  overflow:auto;
  transform-origin:top right;
}
.acct-menu.is-open .acct-menu__drop{
  display:block;
}
.acct-menu__item{
  display:block;
  padding:10px;
  border-radius:10px;
  color:inherit;
  text-decoration:none;
  font-size:.95rem;
}
.acct-menu__item:hover{
  background:rgba(0,0,0,.04);
  text-decoration:none;
}
body.theme-dark .acct-menu__drop{
  background:#0b1222;
  border-color:#1f2937;
  box-shadow:0 10px 30px rgba(0,0,0,.35);
}
body.theme-dark .acct-menu__btn{
  border-color:#1f2937;
}
body.theme-dark .acct-menu__item:hover{
  background:rgba(255,255,255,.06);
}

/* ---------- Landing publique ---------- */
body.landing-public{
  background:#f8fafc;
  color:#0f172a;
  scroll-behavior:smooth;
}
body.landing-public main{
  display:block;
}
body.landing-public .wrap{
  max-width:1180px;
}
.landing-public .landing-section{
  padding:64px 0;
}
.landing-public .landing-section + .landing-section{
  border-top:1px solid #e5e7eb;
}
.landing-public .landing-section--tinted{
  background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%);
}
.landing-public .landing-section--soft{
  background:#fbfdff;
}
.landing-public .landing-section--tools{
  background:#ffffff;
}
.landing-public .landing-section-heading{
  display:flex;
  align-items:flex-start;
  gap:18px;
  margin-bottom:28px;
}
.landing-public .landing-section-heading--compact{
  margin-bottom:20px;
}
.landing-public .landing-section-number{
  width:36px;
  height:36px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  background:#dbeafe;
  color:#1d4ed8;
  font-weight:800;
  font-size:1rem;
  flex:0 0 auto;
}
.landing-public .landing-section-heading h2,
.landing-public .landing-final h2{
  margin:0 0 10px;
  font-size:clamp(1.85rem,2vw + 1rem,2.7rem);
  line-height:1.08;
  color:#0f172a;
}
.landing-public .landing-section-heading p,
.landing-public .landing-lead,
.landing-public .landing-subtitle,
.landing-public .landing-usage-card p,
.landing-public .landing-feature-card p,
.landing-public .landing-tool-card p,
.landing-public .landing-contrast-card p,
.landing-public .landing-time-card p{
  margin:0;
  color:#475569;
  line-height:1.7;
}
.landing-public .landing-subtitle{
  margin-bottom:6px;
  color:#1d4ed8;
  font-weight:700;
}

.landing-public .landing-hero{
  background:
    radial-gradient(circle at top right,rgba(37,99,235,.10),transparent 26%),
    linear-gradient(180deg,#ffffff 0%,#f8fbff 100%);
}
.landing-public .landing-hero .wrap{
  max-width:1320px;
}
.landing-public .landing-hero__grid{
  display:grid;
  grid-template-columns:minmax(420px,4fr) minmax(520px,5fr);
  gap:40px;
  align-items:center;
}
.landing-public .landing-hero__content h1{
  margin:0 0 12px;
  font-size:clamp(2.9rem,5vw,4.7rem);
  line-height:.95;
  letter-spacing:-.03em;
  color:#0f172a;
}
.landing-public .landing-hero__subtitle{
  margin-bottom:18px;
  font-size:clamp(1.5rem,2vw,2.3rem);
  line-height:1.12;
  color:#2563eb;
  font-weight:800;
}
.landing-public .landing-lead{
  max-width:640px;
  font-size:1.08rem;
}
.landing-public .landing-hero__cta{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  margin:28px 0 18px;
}
.landing-public .landing-hero__tagline{
  color:#1d4ed8;
  font-weight:700;
  font-size:.98rem;
}
.landing-public .landing-hero__visual{
  min-width:0;
}
.landing-public .landing-hero-diagram{
  position:relative;
  display:grid;
  grid-template-columns:minmax(112px,124px) auto minmax(250px,.95fr) auto minmax(112px,124px);
  gap:16px;
  align-items:center;
  padding:26px;
  border:1px solid #dbe3ef;
  border-radius:28px;
  background:#ffffff;
  box-shadow:0 18px 44px rgba(15,23,42,.06);
  max-width:690px;
  margin-left:auto;
}
.landing-public .landing-hero-diagram__caption,
.landing-public .landing-panel__title{
  margin-bottom:10px;
  color:#1e293b;
  font-size:.95rem;
  font-weight:800;
}
.landing-public .landing-hero-diagram__arrow,
.landing-public .landing-flow-arrow,
.landing-public .landing-step-arrow{
  color:#2563eb;
  font-size:1.8rem;
  font-weight:700;
  line-height:1;
}
.landing-public .landing-stack-card,
.landing-public .landing-panel{
  border:1px solid #dbe3ef;
  border-radius:22px;
  background:#ffffff;
  box-shadow:0 12px 30px rgba(15,23,42,.04);
}
.landing-public .landing-stack-card{
  display:flex;
  flex-direction:column;
  gap:8px;
  padding:12px;
}
.landing-public .landing-stack-card span{
  display:block;
  padding:9px 10px;
  border-radius:14px;
  background:#f8fafc;
  border:1px solid #e2e8f0;
  color:#0f172a;
  font-weight:600;
  font-size:.88rem;
  line-height:1.22;
  text-align:center;
  overflow-wrap:anywhere;
  word-break:break-word;
}
.landing-public .landing-truth-box{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  min-height:180px;
  padding:26px 18px;
  border-radius:28px;
  background:linear-gradient(145deg,#2563eb 0%,#1d4ed8 100%);
  box-shadow:0 20px 45px rgba(37,99,235,.35);
  color:#ffffff;
  text-align:center;
  font-weight:900;
  font-size:1.55rem;
  line-height:1.12;
  letter-spacing:.01em;
}
.landing-public .landing-truth-box__title{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:2px;
  font-size:inherit;
}
.landing-public .landing-truth-box__result{
  display:flex;
  flex-direction:column;
  gap:5px;
  margin-top:16px;
  font-size:.72rem;
  line-height:1.22;
  font-weight:700;
  color:#dbeafe;
  letter-spacing:0;
}
.landing-public .landing-truth-box__result span{
  position:relative;
  display:block;
  padding-left:14px;
}
.landing-public .landing-truth-box__result span::before{
  content:"✓";
  position:absolute;
  left:0;
  top:0;
  color:#86efac;
  font-weight:900;
}
.landing-public .landing-truth-box--large{
  min-width:280px;
  min-height:220px;
}
.landing-public .landing-hero-diagram__facts,
.landing-public .landing-truth-center__meta{
  display:inline-flex;
  justify-content:center;
  align-items:center;
  gap:8px;
  margin-top:16px;
  padding:10px 14px;
  border:1px solid #dbe3ef;
  border-radius:999px;
  background:#ffffff;
  color:#475569;
  font-size:.92rem;
}
.landing-public .landing-hero-diagram__facts{
  grid-column:1 / -1;
  justify-self:center;
}
.landing-public .landing-hero-diagram__description{
  grid-column:1 / -1;
  max-width:560px;
  margin:14px auto 0;
  color:#475569;
  font-size:.7rem;
  line-height:1.65;
  text-align:center;
}
.landing-public .landing-hero-diagram__description strong{
  display:block;
  margin-bottom:8px;
  color:#0f172a;
  font-size:1rem;
  line-height:1.25;
  font-weight:800;
}
.landing-public .landing-hero-diagram__description p{
  margin:0;
}

.landing-public .landing-truth-flow{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto minmax(280px,.9fr) auto minmax(0,1fr);
  gap:18px;
  align-items:center;
}
.landing-public .landing-panel{
  padding:22px;
}
.landing-public .landing-pill-grid{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}
.landing-public .landing-pill{
  display:inline-flex;
  align-items:center;
  padding:9px 12px;
  border-radius:999px;
  background:#eff6ff;
  color:#1d4ed8;
  font-size:.93rem;
  font-weight:700;
}
.landing-public .landing-truth-center{
  display:flex;
  flex-direction:column;
  align-items:center;
  min-width:0;
}
.landing-public .landing-check-list{
  list-style:none;
  padding:0;
  margin:0;
}
.landing-public .landing-check-list li{
  position:relative;
  padding-left:28px;
  color:#0f172a;
  line-height:1.65;
}
.landing-public .landing-check-list li + li{
  margin-top:9px;
}
.landing-public .landing-check-list li::before{
  content:"✓";
  position:absolute;
  left:0;
  top:0;
  color:#16a34a;
  font-weight:800;
}
.landing-public .landing-check-list--spacious li + li{
  margin-top:11px;
}

.landing-public .landing-pipeline{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto minmax(0,1fr) auto minmax(0,1fr) auto minmax(0,1fr);
  gap:18px;
  align-items:stretch;
}
.landing-public .landing-step-card{
  position:relative;
  display:flex;
  flex-direction:column;
  gap:16px;
  padding:22px;
  border:1px solid #dbe3ef;
  border-radius:24px;
  background:#ffffff;
  box-shadow:0 16px 34px rgba(15,23,42,.05);
}
.landing-public .landing-step-card__index{
  width:34px;
  height:34px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  background:#dbeafe;
  color:#1d4ed8;
  font-size:.95rem;
  font-weight:800;
}
.landing-public .landing-step-card h3,
.landing-public .landing-usage-card h3,
.landing-public .landing-feature-card h3,
.landing-public .landing-tool-card h3,
.landing-public .landing-contrast-card h3{
  margin:0;
  color:#0f172a;
  font-size:1.1rem;
}
.landing-public .landing-step-card p{
  margin:0;
  color:#475569;
  line-height:1.65;
}
.landing-public .landing-drive-shot{
  border:1px solid #dbe3ef;
  border-radius:20px;
  overflow:hidden;
  background:#f8fafc;
}
.landing-public .landing-drive-shot__bar{
  display:flex;
  align-items:center;
  gap:8px;
  padding:12px 14px;
  background:#ffffff;
  border-bottom:1px solid #e2e8f0;
  color:#0f172a;
}
.landing-public .landing-drive-shot__dot{
  width:9px;
  height:9px;
  border-radius:999px;
  display:inline-block;
}
.landing-public .landing-drive-shot__dot--green{ background:#22c55e; }
.landing-public .landing-drive-shot__dot--yellow{ background:#f59e0b; }
.landing-public .landing-drive-shot__dot--red{ background:#ef4444; }
.landing-public .landing-drive-shot__crumbs{
  padding:12px 14px 0;
  color:#475569;
  font-size:.9rem;
}
.landing-public .landing-file-list,
.landing-public .landing-folder-tree{
  list-style:none;
  margin:0;
  padding:12px 14px 16px;
}
.landing-public .landing-file-list li,
.landing-public .landing-folder-tree div{
  padding:8px 0;
  border-bottom:1px solid #e2e8f0;
  color:#0f172a;
  font-size:.95rem;
  overflow-wrap:anywhere;
  word-break:break-word;
}
.landing-public .landing-file-list li:last-child,
.landing-public .landing-folder-tree div:last-child{
  border-bottom:none;
}
.landing-public .landing-file-list--compact{
  padding-top:0;
}
.landing-public .landing-fact-sheet{
  border:1px solid #dbe3ef;
  border-radius:20px;
  background:#f8fafc;
  padding:12px 16px;
}
.landing-public .landing-fact-sheet > div{
  display:flex;
  align-items:flex-start;
  justify-content:flex-start;
  flex-direction:column;
  gap:0;
  padding:10px 0;
  border-bottom:1px solid #e2e8f0;
}
.landing-public .landing-fact-sheet > div:last-child{
  border-bottom:none;
}
.landing-public .landing-fact-sheet span{
  color:#475569;
}
.landing-public .landing-fact-sheet strong{
  color:#0f172a;
  text-align:left;
  max-width:100%;
  white-space:normal;
  overflow-wrap:anywhere;
  word-break:break-word;
}
.landing-public .landing-fact-sheet__source{
  align-items:flex-start;
}
.landing-public .landing-inline-note{
  margin-top:24px;
  padding:14px 18px;
  border:1px solid #dbeafe;
  border-radius:18px;
  background:#eff6ff;
  color:#1d4ed8;
  text-align:center;
  font-weight:700;
}

.landing-public .landing-usage-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:16px;
}
.landing-public .landing-usage-card,
.landing-public .landing-feature-card,
.landing-public .landing-tool-card{
  padding:22px;
  border:1px solid #dbe3ef;
  border-radius:22px;
  background:#ffffff;
  box-shadow:0 14px 30px rgba(15,23,42,.04);
}
.landing-public .landing-usage-card{
  min-height:172px;
}
.landing-public .landing-usage-card p{
  margin-top:10px;
}

.landing-public .landing-feature-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:16px;
}
.landing-public .landing-feature-card p{
  margin-top:10px;
}

.landing-public .landing-dual-grid{
  display:grid;
  grid-template-columns:minmax(0,.95fr) minmax(0,1.05fr);
  gap:22px;
}
.landing-public .landing-contrast-card,
.landing-public .landing-time-card{
  padding:28px;
  border:1px solid #dbe3ef;
  border-radius:28px;
  background:#ffffff;
  box-shadow:0 18px 40px rgba(15,23,42,.05);
}
.landing-public .landing-contrast-list{
  display:grid;
  gap:12px;
  margin-bottom:18px;
}
.landing-public .landing-contrast-list > div{
  padding:16px 18px;
  border:1px solid #e2e8f0;
  border-radius:18px;
  background:#f8fafc;
  color:#0f172a;
  font-weight:700;
}
.landing-public .landing-contrast-highlight{
  padding:22px;
  border-radius:22px;
  background:linear-gradient(145deg,#2563eb 0%,#1d4ed8 100%);
  color:#ffffff;
  text-align:center;
  font-size:1.3rem;
  font-weight:900;
  line-height:1.25;
}
.landing-public .landing-quote-box{
  margin-top:22px;
  padding:22px;
  border-radius:22px;
  background:#eff6ff;
  color:#1d4ed8;
}
.landing-public .landing-quote-box strong{
  display:block;
  margin-bottom:10px;
  font-size:1.35rem;
  line-height:1.25;
}
.landing-public .landing-quote-box p{
  color:#1e3a8a;
}

.landing-public .landing-tools-grid{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:16px;
}
.landing-public .landing-tool-card p{
  margin-top:10px;
}

.landing-public .landing-final{
  border-top:none;
  background:linear-gradient(135deg,#1d4ed8 0%,#1e40af 100%);
}
.landing-public .landing-final__grid{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(280px,.8fr);
  gap:28px;
  align-items:center;
}
.landing-public .landing-final__content{
  color:#ffffff;
}
.landing-public .landing-final__eyebrow{
  margin-bottom:10px;
  font-size:1.15rem;
  font-weight:700;
  color:#bfdbfe;
}
.landing-public .landing-final h2{
  color:#ffffff;
  font-size:clamp(2.4rem,3.2vw,4rem);
}
.landing-public .landing-final__trust{
  margin:0 0 22px;
  color:#dbeafe;
  font-size:1.1rem;
}
.landing-public .landing-final__cta{
  margin-bottom:20px;
}
.landing-public .landing-final__signature{
  color:#dbeafe;
  font-weight:700;
}
.landing-public .landing-final__visual{
  position:relative;
  min-height:280px;
}
.landing-public .landing-final__house{
  position:absolute;
  right:38px;
  bottom:10px;
  width:220px;
  height:165px;
  display:flex;
  flex-direction:column;
  justify-content:flex-start;
  gap:12px;
  padding:34px 18px 18px;
  border-radius:28px 28px 18px 18px;
  background:
    linear-gradient(180deg,rgba(255,255,255,.28),rgba(255,255,255,.08)),
    linear-gradient(145deg,#1e3a8a,#0f172a);
  box-shadow:0 24px 50px rgba(2,6,23,.35);
}
.landing-public .landing-final__house::before{
  content:"";
  position:absolute;
  left:0;
  right:0;
  top:-50px;
  height:58px;
  background:#af1e1e;
  clip-path:polygon(50% 0,100% 100%,0 100%);
  border-radius:12px;
}
.landing-public .landing-final__house::after{
  content:none;
}
.landing-public .landing-final__panel{
  display:flex;
  align-items:center;
  min-height:32px;
  padding:8px 12px 8px 30px;
  border-radius:14px;
  background:linear-gradient(90deg,rgba(191,219,254,.95),rgba(219,234,254,.78));
  color:#0f172a;
  font-size:.88rem;
  font-weight:700;
  line-height:1.2;
  position:relative;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.22);
}
.landing-public .landing-final__panel::before{
  content:"✓";
  position:absolute;
  left:12px;
  top:50%;
  transform:translateY(-50%);
  color:#16a34a;
  font-weight:900;
}
.landing-public .landing-final__panel--one{
  margin-left:20px;
}
.landing-public .landing-final__panel--two{
  margin-right:18px;
}
.landing-public .landing-final__panel--three{
  margin-left:8px;
}

@media (max-width:900px){
  .landing-public .landing-pipeline{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .landing-public .landing-step-arrow{
    display:none;
  }
  .landing-public .landing-usage-grid{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
  .landing-public .landing-feature-grid{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
  .landing-public .landing-tools-grid{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
}

@media (max-width:900px){
  .landing-public .landing-hero__grid,
  .landing-public .landing-dual-grid,
  .landing-public .landing-final__grid{
    grid-template-columns:1fr;
  }
  .landing-public .landing-hero-diagram,
  .landing-public .landing-truth-flow{
    grid-template-columns:1fr;
  }
  .landing-public .landing-hero-diagram__arrow,
  .landing-public .landing-flow-arrow{
    transform:rotate(90deg);
    justify-self:center;
  }
  .landing-public .landing-truth-box--large{
    min-width:0;
    width:100%;
  }
  .landing-public .landing-usage-grid,
  .landing-public .landing-feature-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}

@media (max-width:900px){
  .landing-public .landing-section{
    padding:46px 0;
  }
  .landing-public .landing-section-heading{
    gap:14px;
  }
  .landing-public .landing-section-number{
    width:30px;
    height:30px;
    font-size:.9rem;
  }
  .landing-public .landing-hero__content h1{
    font-size:2.6rem;
  }
  .landing-public .landing-hero__subtitle{
    font-size:1.45rem;
  }
  .landing-public .landing-hero-diagram__description{
    font-size:.7rem;
  }
  .landing-public .landing-hero-diagram__description strong{
    font-size:.94rem;
  }
  .landing-public .landing-truth-box__result{
    font-size:.68rem;
  }
  .landing-public .landing-pipeline,
  .landing-public .landing-usage-grid,
  .landing-public .landing-feature-grid,
  .landing-public .landing-tools-grid{
    grid-template-columns:1fr;
  }
  .landing-public .landing-step-card,
  .landing-public .landing-usage-card,
  .landing-public .landing-feature-card,
  .landing-public .landing-tool-card,
  .landing-public .landing-contrast-card,
  .landing-public .landing-time-card{
    padding:18px;
  }
  .landing-public .landing-fact-sheet > div{
    align-items:flex-start;
    flex-direction:column;
  }
  .landing-public .landing-final__visual{
    min-height:240px;
  }
  .landing-public .landing-final__house{
    right:22px;
    width:178px;
    height:140px;
  }
  .landing-public .landing-final__house{
    gap:8px;
    padding:24px 12px 12px;
  }
  .landing-public .landing-final__panel{
    min-height:26px;
    padding:6px 10px 6px 26px;
    font-size:.74rem;
  }
  .landing-public .landing-final__panel::before{
    left:10px;
  }
  .landing-public .landing-final__panel--one,
  .landing-public .landing-final__panel--two,
  .landing-public .landing-final__panel--three{
    margin-left:0;
    margin-right:0;
  }
}

/* ---------- Responsive PC / Mobile ---------- */
@media (max-width:900px){
  .wrap{
    padding:12px;
  }
  .section{
    margin:10px 0;
    padding:12px;
  }
  .card{
    padding:12px;
  }
  .grid{
    gap:12px;
  }
  .grid[style*="grid-template-columns"]{
    grid-template-columns:1fr !important;
  }
  .section[style*="grid-template-columns"]{
    grid-template-columns:1fr !important;
  }
  .card-h{
    align-items:flex-start;
    flex-wrap:wrap;
  }
  .header-row{
    gap:10px;
    padding:10px 0;
  }
  .header-google-sync--topbar{
    margin-left:auto;
  }
  .header-user-block{
    order:4;
    width:100%;
    margin-left:0;
    justify-content:flex-end;
    gap:8px;
  }
  .tabs,
  .tabs-group{
    width:100%;
    overflow-x:auto;
    padding-bottom:8px;
    scrollbar-width:thin;
  }
  .tabs{
    padding-left:0;
    padding-right:0;
  }
  .tabs > *,
  .tabs-group > *{
    flex:0 0 auto;
  }
  .table-responsive > table{
    min-width:620px;
  }
  .table-responsive.table-responsive--auto > table{
    min-width:max-content;
  }
  .admin-layout .table-responsive > table{
    min-width:700px;
  }
  .form-row{
    flex-direction:column;
    align-items:stretch;
  }
  .form-row .form-group{
    width:100%;
  }
  .row > .btn,
  .row > .btn-strong{
    max-width:100%;
  }
  .selection-filters .filters-row{
    display:flex;
    flex-direction:column;
    min-width:0;
    align-items:stretch;
  }
  .selection-filters .filters-item{
    width:100%;
    white-space:normal;
  }
  #filter-text{
    max-width:none;
  }
  .filters-state{
    flex-wrap:wrap;
  }
  .page-medias .media-subnav{
    flex-direction:column;
    align-items:stretch !important;
    gap:10px !important;
  }
  .page-medias .media-subnav .tabs{
    width:100%;
  }
  .page-medias .media-subnav .tab{
    flex:1 1 calc(50% - 8px);
    justify-content:center;
    text-align:center;
  }
  .page-medias .media-subnav-actions{
    width:100%;
  }
  .page-medias .media-subnav-actions .btn{
    width:100%;
    margin:0;
  }
  .page-medias .selection-grid{
    grid-template-columns:repeat(auto-fill,minmax(160px,1fr));
    gap:10px;
  }
  .page-medias .media-actions{
    flex-wrap:wrap;
  }
  .page-medias .media-actions .btn-flag{
    flex:1 1 calc(50% - 6px);
  }
  .page-description .bien-desc-subtab{
    flex:1 1 calc(50% - 8px);
    min-height:38px;
    height:auto;
  }
  .page-description .bien-desc-subtab-label{
    white-space:normal;
  }
  .page-description .bien-subtitle-row{
    margin:4px 0 12px;
  }
  .page-description #formDiscovery .row{
    justify-content:stretch !important;
  }
  .page-description #formDiscovery .btn-strong{
    width:100%;
    margin:0;
  }
  .page-discovery #btnStartDiscovery,
  .page-discovery #btnFinalizeSession{
    width:100%;
    margin:0;
  }
  .page-discovery #discoveryActions .row{
    align-items:stretch;
  }
  .page-discovery #discoveryActions .row .btn{
    width:100%;
    margin:0;
  }
  .page-discovery .runner-summary-metrics{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .acct-menu__drop{
    min-width:200px;
    max-width:calc(100vw - 12px);
  }
}
