:root{
  --muted:#c0ccd2;
  --readable-surface:#081d27;
  --readable-surface-2:#0c2631;
  --readable-line:rgba(166,222,229,.24);
  --readable-text:#f6fafb;
  --readable-muted:#c0ccd2;
}

body{font-size:16px}
body .main{color:var(--readable-text)}
body .main h1,
body .main h2,
body .main h3,
body .main h4,
body .main strong{color:var(--readable-text)}
body .meta,
body .section-head p,
body .stat .l{color:var(--readable-muted);line-height:1.5}
body .field label{color:#c9d6dc;font-size:13px;line-height:1.35}
body .input,
body .select,
body .textarea{
  color:var(--readable-text);
  border-color:var(--readable-line);
  background:#0a202a;
}
body .input::placeholder,
body .textarea::placeholder{color:#91a5ae;opacity:1}
body .input:disabled,
body .select:disabled,
body .textarea:disabled{color:#d7e2e6;background:#102a35;opacity:1}
body .btn-soft,
body .btn-dark{color:#f3f8fa;border-color:rgba(255,255,255,.15);background:#17313c}
body .btn-danger{color:#ffdbe0;border:1px solid rgba(255,108,128,.28);background:#4b1d29}
body :focus-visible{outline:3px solid rgba(255,105,126,.78);outline-offset:3px}

body .stat,
body .card,
body .catalog-toolbar,
body .terrain-finder,
body .run,
body .change,
body .choice,
body .drop{
  color:var(--readable-text);
  border-color:var(--readable-line);
  background:linear-gradient(145deg,rgba(8,29,39,.96),rgba(5,20,28,.94));
  backdrop-filter:blur(24px) saturate(1.08);
}
body .modal{
  color:var(--readable-text);
  border:1px solid rgba(166,222,229,.24);
  background:linear-gradient(145deg,#081d27,#061923);
}
body .notice{color:#bdeaff;background:#113747;border:1px solid rgba(111,205,239,.16)}
body .notice.warning{color:#ffdc8d;background:#3b3017;border-color:rgba(255,203,94,.2)}
body .notice.danger{color:#ffb8c2;background:#451c27;border-color:rgba(255,105,126,.22)}
body #hCodePreview{color:var(--readable-text);background:#102a35!important}

/* Panneau du connecteur local Ubiflow. */
body #view-settings .robot-connection-card{background:linear-gradient(145deg,rgba(8,29,39,.98),rgba(5,20,28,.97))}
body #view-settings .robot-step{
  color:var(--readable-text);
  border-color:var(--readable-line);
  background:linear-gradient(145deg,#102d39,#0a222c)!important;
  box-shadow:0 12px 30px rgba(0,7,12,.22),inset 0 1px 0 rgba(255,255,255,.04);
}
body #view-settings .robot-step-number{color:#fff;background:linear-gradient(145deg,#ff5b67,#c9122d)}
body #view-settings .robot-step p,
body #view-settings .robot-step .meta{color:#c5d2d7!important}
body #view-settings .robot-step a{color:#f6fafb;text-decoration-color:rgba(255,255,255,.58)}

/* Mediatheque et variantes. */
body .modal .media-upload{
  margin:16px 0 18px;
  padding:18px;
  color:var(--readable-text);
  border:1px solid var(--readable-line);
  background:linear-gradient(145deg,#102d39,#0a222c)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.04),0 14px 34px rgba(0,7,12,.2);
}
body .modal .media-upload .field label{color:#d3dfe3;font-size:13px;letter-spacing:.075em}
body .modal .media-upload .input,
body .modal .media-upload .select{color:#f8fbfc;border-color:var(--readable-line);background:#081d27}
body .modal .media-upload .input::file-selector-button{
  margin-right:10px;
  padding:8px 11px;
  color:#fff;
  border:1px solid rgba(255,255,255,.16);
  border-radius:9px;
  background:#344952;
}
body .modal .media-upload .select option{color:#f8fbfc;background:#0b2029}
body .modal .media-upload label.row{min-height:36px;color:#edf5f7;font-size:15px;font-weight:650}
body .modal .media-upload input[type="checkbox"]{width:18px;height:18px;accent-color:#ff5369}
body .modal .variant-chip{color:#edf5f7;border-color:var(--readable-line);background:#102a35!important}
body .modal .variant-chip.off{color:#b9c7cd;opacity:.8}
body .modal .media-card{
  color:var(--readable-text);
  border-color:var(--readable-line);
  background:linear-gradient(155deg,#102a35,#0a2029)!important;
  box-shadow:0 12px 28px rgba(0,7,12,.24);
}
body .modal .media-card.primary{border-color:rgba(255,83,105,.72);outline-color:rgba(255,83,105,.16)}
body .modal .media-thumb{color:#c9d7dd;background:#081923!important}
body .modal .media-body h4{color:#f8fbfc;font-size:14px;line-height:1.35}
body .modal .media-body .meta{color:#c5d2d7;line-height:1.45}
body .modal .media-actions .btn-soft{color:#edf5f7;background:#17313c;border-color:rgba(255,255,255,.14)}
body .modal .media-actions .btn-danger{color:#ffdbe0;background:#4b1d29;border-color:rgba(255,108,128,.28)}

/* Historique, packs et campagnes. */
body .history-card,
body .campaign-card,
body .mh-card,
body .cycle-row{
  color:var(--readable-text);
  border-color:var(--readable-line);
  background:linear-gradient(145deg,#0d2934,#081f29)!important;
  box-shadow:0 12px 30px rgba(0,7,12,.22);
}
body .history-card .meta,
body .campaign-card .meta,
body .mh-card .meta,
body .cycle-row .meta{color:#c3d0d5}
body .history-ref,
body .selected-counter{color:#8cddfb!important}
body .pack-builder,
body .recurrence-box{
  color:var(--readable-text);
  border-color:var(--readable-line);
  background:linear-gradient(145deg,#102d39,#0a222c)!important;
}
body .selector-box{color:var(--readable-text);border-color:var(--readable-line);background:#081d27!important}
body .selector-row:hover{background:#143440!important}
body .selector-row small{color:#c0ccd2!important}
body .campaign-kpi,
body .day-pills label{color:var(--readable-text);background:#143440!important}
body .campaign-progress{background:#263f49!important}

/* Terrains, filtres et tableau. */
body .terrain-kind-btn,
body .plot-filter-panel,
body .plot-pill,
body .plot-group,
body .plot-group-head,
body .plot-count,
body .plot-chevron,
body .plot-empty{
  color:var(--readable-text);
  border-color:var(--readable-line);
  background:#0c2631!important;
}
body .terrain-kind-btn span,
body .plot-results,
body .plot-place .commune,
body .plot-place .developer,
body .terrain-sync-state{color:#c0ccd2!important}
body .terrain-sync-state strong,
body .plot-place .dev,
body .plot-table .price-cell,
body .plot-table .lot-cell{color:var(--readable-text)!important}
body .plot-table thead th{color:#bdcbd1;background:#102c37!important;border-color:var(--readable-line)}
body .plot-table tbody td{border-color:rgba(166,222,229,.13)}
body .plot-table tbody tr:hover{background:#12313c!important}
body .plot-pill.active{color:#fff}

/* Mini-carte. */
body #maapMiniMapCard{color:var(--readable-text);border-color:var(--readable-line);background:#081d27!important}
body #maapMiniMapCard .mm-head{border-color:var(--readable-line)}
body #maapMiniMapCard .mm-sub,
body #maapMiniMapCard .mm-legend{color:#c0ccd2}
body #maapMiniMapCard .mm-icon{color:#f3f8fa;background:#17313c}
body #maapMiniMapEmpty{color:#d4dfe3;background:rgba(8,29,39,.96)!important}

/* Navigation stable : le menu reste vertical sans rail anime ni debordement lateral. */
body .sidebar{
  overflow-x:hidden!important;
  overflow-y:auto;
  scrollbar-width:none;
}
body .sidebar::-webkit-scrollbar{display:none}
body .sidebar::after{display:none}
body .nav button:hover{transform:none}

/* Un module ancien impose un gris sombre aux libelles des filtres. */
body #view-create .terrain-finder .field label{
  color:#c9d6dc!important;
  font-size:13px!important;
  line-height:1.35!important;
}

/* Cartes de sélection terrain + maison : contraste fort et état choisi explicite. */
body #view-create .choice-list{scrollbar-color:#46616c #071923}
body #view-create .choice{
  width:100%;
  min-height:82px;
  color:#f6fafb!important;
  text-align:left;
  appearance:none;
  border:1px solid rgba(166,222,229,.24)!important;
  background:linear-gradient(145deg,#0d2a35,#081e28)!important;
  box-shadow:0 11px 28px rgba(0,7,12,.2),inset 0 1px 0 rgba(255,255,255,.045);
}
body #view-create .choice.terrain-lotissement{
  border-left:5px solid #ff6578!important;
  background:linear-gradient(100deg,rgba(119,27,43,.54),#0d2a35 22%,#081e28)!important;
}
body #view-create .choice.terrain-diffus{
  border-left:5px solid #45dda3!important;
  background:linear-gradient(100deg,rgba(20,100,76,.48),#0d2a35 22%,#081e28)!important;
}
body #view-create .choice strong{color:#fff!important;font-size:15px;line-height:1.35}
body #view-create .choice .meta{color:#c7d5da!important;font-size:13px;line-height:1.48}
body #view-create .choice:hover:not(:disabled){
  transform:translateY(-2px);
  border-color:rgba(255,115,132,.68)!important;
  box-shadow:0 16px 38px rgba(0,7,12,.3),0 0 0 2px rgba(255,83,105,.08);
}
body #view-create .choice.selected{
  border-color:#ff7184!important;
  background:linear-gradient(110deg,rgba(159,31,55,.76),#12313d 30%,#09202a)!important;
  box-shadow:0 0 0 4px rgba(255,83,105,.18),0 18px 42px rgba(0,7,12,.34)!important;
}
body #view-create .choice:disabled{
  cursor:not-allowed;
  opacity:1;
  border-color:rgba(255,177,86,.28)!important;
  background:linear-gradient(145deg,#2c281f,#17252a)!important;
}
body #view-create .choice:disabled strong{color:#f7e8c8!important}
body #view-create .choice:disabled .meta{color:#d1c4a9!important}
body #view-create .choice-check,
body #view-create .smart-fit-badge{
  display:inline-flex;
  align-items:center;
  gap:5px;
  padding:5px 8px;
  border-radius:999px;
  font-size:11px;
  font-weight:850;
  line-height:1;
  white-space:nowrap;
}
body #view-create .choice-check{color:#fff;background:#e72f4b;box-shadow:0 0 16px rgba(255,83,105,.28)}
body #view-create .smart-fit-badge{color:#bffbe5;background:rgba(36,151,110,.3);border:1px solid rgba(91,232,180,.2)}
body #view-create .smart-fit-badge.warning{color:#ffe2a0;background:rgba(143,101,25,.35);border-color:rgba(255,203,94,.2)}
body #view-create .smart-fit-badge.blocked{color:#ffdfa7;background:rgba(116,75,19,.48);border-color:rgba(255,190,82,.24)}
body #view-create .choice-smart-badges{display:flex;align-items:center;justify-content:flex-end;gap:6px;flex-wrap:wrap}
body #view-create .composer-smart-hint{
  display:flex;
  align-items:flex-start;
  gap:11px;
  margin:-1px 0 12px;
  padding:12px 14px;
  color:#d8e7eb;
  border:1px solid rgba(97,210,220,.2);
  border-radius:15px;
  background:linear-gradient(135deg,rgba(13,56,67,.88),rgba(8,34,44,.9));
}
body #view-create .composer-smart-hint::before{content:"✦";color:#6fe3d4;font-size:17px;line-height:1.25}
body #view-create .composer-smart-hint strong{display:block;color:#fff;font-size:14px}
body #view-create .composer-smart-hint span{display:block;margin-top:2px;color:#bed0d6;font-size:12px;line-height:1.45}

@media(max-width:620px){
  body #view-create .choice{min-height:76px}
  body #view-create .choice-smart-badges{justify-content:flex-start}
}

@media(max-width:620px){
  body{font-size:15px}
  body .modal .media-upload{padding:14px}
  body .modal .media-grid{grid-template-columns:1fr}
  body .modal .media-thumb{height:180px}
  body #view-settings .robot-step{padding:14px}
}
