  :root {
    --bg:      #faf8f4;
    --sur:     #ffffff;
    --sur2:    #f1ede5;
    --bdr:     #e8e3d8;
    --bdr2:    #d8d1c2;
    --txt:     #292419;
    --txt2:    #6f6754;
    --txt3:    #a39a83;
    --acc:     #c07a08;
    --sky:     #0369a1;
    --grn:     #047857;
    --red:     #dc2626;
    --pur:     #6d28d9;
    --mono:    'JetBrains Mono', monospace;
    --sans:    'Rajdhani', system-ui, sans-serif;
  }

  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

  body {
    background: var(--bg);
    background-image: radial-gradient(ellipse 80% 50% at 50% -10%, rgba(192,122,8,.06) 0%, transparent 60%);
    color: var(--txt);
    font-family: var(--sans);
    font-size: 14px;
    display: flex;
    height: 100vh;
    overflow: hidden;
    letter-spacing: .01em;
  }

  /* ── SIDEBAR ── */
  .sidebar {
    width: 164px;
    background: var(--sur);
    border-right: 1px solid var(--bdr);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: relative;
    transition: width .22s cubic-bezier(.4,0,.2,1);
    overflow: hidden;
  }
  .sidebar.collapsed { width: 48px; }
  .sidebar.collapsed .sidebar-logo { padding: 12px 0; align-items: center; justify-content: center; }
  .sidebar.collapsed .sidebar-logo-text,
  .sidebar.collapsed .sidebar-logo-sub { display: none; }
  .sidebar.collapsed .nav-item { justify-content: center; padding: 10px 0; gap: 0; }
  .sidebar.collapsed .nav-label,
  .sidebar.collapsed .nav-badge { display: none; }
  .sidebar.collapsed .sidebar-toggle-btn { align-self: center; }
  .sidebar-toggle-btn {
    background: none; border: none; cursor: pointer;
    color: var(--txt3); font-size: 11px;
    padding: 3px 5px; border-radius: 4px;
    transition: color .15s, background .15s;
    flex-shrink: 0; line-height: 1;
    align-self: flex-end; margin-top: 6px;
  }
  .sidebar-toggle-btn:hover { color: var(--txt); background: var(--sur2); }
  .sidebar::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 1px; height: 100%;
    background: linear-gradient(to bottom, transparent 10%, var(--acc) 40%, var(--sky) 70%, transparent 90%);
    opacity: .3;
  }
  .sidebar-logo {
    padding: 18px 16px 16px;
    border-bottom: 1px solid var(--bdr);
    display: flex;
    flex-direction: column;
    transition: padding .22s;
  }
  .sidebar-logo-text {
    font-family: var(--sans);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    background: linear-gradient(130deg, var(--acc) 30%, var(--sky));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: block;
    line-height: 1;
  }
  .sidebar-logo-sub {
    font-size: 9px;
    color: var(--txt3);
    text-transform: uppercase;
    letter-spacing: .18em;
    margin-top: 4px;
    display: block;
  }
  .sidebar-nav { flex: 1; padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; }
  .sidebar-bottom { padding: 8px; border-top: 1px solid var(--bdr); }
  .nav-item {
    width: 100%;
    display: flex; align-items: center; gap: 9px;
    padding: 9px 10px;
    background: none; border: none;
    border-radius: 6px;
    color: var(--txt2);
    font-family: var(--sans);
    font-size: 13px; font-weight: 500;
    letter-spacing: .03em;
    cursor: pointer; text-align: left;
    transition: all .15s;
    position: relative;
  }
  .nav-item:hover { background: var(--sur2); color: var(--txt); }
  .nav-item.active { background: rgba(192,122,8,.09); color: var(--acc); }
  .nav-item.active::before {
    content: '';
    position: absolute; left: 0; top: 25%; bottom: 25%;
    width: 2px;
    background: var(--acc);
    border-radius: 2px;
  }
  .nav-icon { font-size: 14px; flex-shrink: 0; }
  .nav-label { flex: 1; }
  .nav-badge {
    background: var(--acc); color: #fff;
    font-size: 9px; font-weight: 700;
    padding: 1px 5px; border-radius: 8px;
    min-width: 16px; text-align: center;
  }

  /* ── MAIN ── */
  .main { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }
  .main::-webkit-scrollbar { width: 5px; }
  .main::-webkit-scrollbar-track { background: var(--bg); }
  .main::-webkit-scrollbar-thumb { background: var(--bdr2); border-radius: 3px; }
  .tab-section { display: none; flex: 1; }
  .tab-section.active { display: flex; flex-direction: column; animation: fadeIn .18s ease; }
  .section-header {
    padding: 18px 24px 16px;
    border-bottom: 1px solid var(--bdr);
    background: linear-gradient(to right, rgba(192,122,8,.05), transparent 60%);
  }
  .section-header h2 {
    font-size: 19px; font-weight: 700;
    letter-spacing: .08em; text-transform: uppercase;
  }
  .section-header p { color: var(--txt2); font-size: 12px; margin-top: 3px; }
  .section-body { padding: 20px 24px 32px; flex: 1; }

  /* ── STAT CARDS ── */
  .stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 24px; }
  .stat-card {
    background: var(--sur);
    border-radius: 8px; padding: 16px;
    border: 1px solid var(--bdr);
    border-top: 2px solid var(--acc);
    box-shadow: 0 1px 3px rgba(41,36,25,.05);
    position: relative; overflow: hidden;
  }
  .stat-card::before {
    content: '';
    position: absolute; top: 0; right: 0;
    width: 70px; height: 70px;
    background: radial-gradient(circle, rgba(192,122,8,.07) 0%, transparent 70%);
  }
  .stat-card .stat-label { color: var(--txt3); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 8px; }
  .stat-card .stat-value { font-family: var(--mono); font-size: 24px; font-weight: 600; color: var(--txt); line-height: 1; }
  .stat-card .stat-sub { font-size: 11px; color: var(--txt2); margin-top: 6px; }

  /* ── SEARCH BAR ── */
  .search-bar {
    background: var(--sur);
    padding: 14px 24px;
    border-bottom: 1px solid var(--bdr);
    display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap;
  }
  .field label { display: block; color: var(--txt3); font-size: 9px; margin-bottom: 5px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; }
  .field input, .field select {
    background: var(--sur); border: 1px solid var(--bdr2);
    border-radius: 6px; padding: 7px 10px;
    color: var(--txt); font-family: var(--sans); font-size: 13px; outline: none;
    transition: border-color .15s, box-shadow .15s;
  }
  .field input:focus, .field select:focus {
    border-color: var(--acc);
    box-shadow: 0 0 0 2px rgba(192,122,8,.15);
  }
  .field select { width: 150px; cursor: pointer; }
  .field input { width: 120px; }
  .field input.input-sm { width: 72px; }
  .year-range { display: flex; align-items: center; gap: 6px; }
  input[type=number]::-webkit-inner-spin-button { opacity: .4; }

  /* ── TOGGLES SITES ── */
  .toggles { display: flex; gap: 6px; flex-wrap: wrap; }
  .toggle {
    border: none; border-radius: 4px;
    padding: 5px 10px;
    font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: .04em;
    cursor: pointer; opacity: .38; transition: opacity .15s, transform .1s;
  }
  .toggle.on { opacity: 1; }
  .toggle:hover { transform: translateY(-1px); }

  /* ── FILTER BAR ── */
  .filter-bar {
    background: rgba(255,255,255,.65);
    padding: 8px 24px;
    border-bottom: 1px solid var(--bdr);
    display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  }
  .filter-bar select, .filter-bar input {
    background: var(--sur); border: 1px solid var(--bdr);
    border-radius: 5px; padding: 5px 8px;
    color: var(--txt); font-family: var(--sans); font-size: 12px; outline: none;
  }
  .filter-bar select:focus, .filter-bar input:focus { border-color: var(--acc); }
  .filter-count { margin-left: auto; color: var(--txt2); font-size: 11px; white-space: nowrap; font-family: var(--mono); }

  /* ── BUTTONS ── */
  .btn {
    border: none; border-radius: 6px; padding: 8px 16px;
    font-family: var(--sans); font-size: 13px; font-weight: 600;
    letter-spacing: .05em; text-transform: uppercase;
    cursor: pointer; transition: all .15s;
  }
  .btn:hover { opacity: .85; transform: translateY(-1px); }
  .btn:active { transform: translateY(0); }
  .btn-primary { background: var(--acc); color: #fff; }
  .btn-secondary { background: var(--sur2); color: var(--txt); border: 1px solid var(--bdr2); }
  .btn-danger { background: transparent; color: var(--red); border: 1px solid rgba(220,38,38,.35); }
  .btn-danger:hover { background: rgba(220,38,38,.07); }
  .btn-sm { padding: 5px 10px; font-size: 11px; }
  .btn-compare { background: var(--pur); color: #fff; display: none; }

  /* ── RESULTS HEADER ── */
  .results-meta {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 24px; flex-wrap: wrap;
    background: rgba(192,122,8,.04);
    border-bottom: 1px solid var(--bdr);
  }
  .count { font-family: var(--mono); font-weight: 600; font-size: 14px; color: var(--acc); }
  .age { color: var(--txt2); font-size: 11px; }
  .site-badges { display: flex; gap: 6px; flex-wrap: wrap; }
  .site-badge { font-size: 10px; padding: 2px 8px; border-radius: 3px; font-weight: 600; letter-spacing: .04em; }
  .btn-refresh {
    margin-left: auto;
    background: none; border: 1px solid var(--bdr2);
    color: var(--txt2); border-radius: 6px;
    padding: 5px 10px; font-family: var(--sans); font-size: 11px; font-weight: 600;
    cursor: pointer; transition: all .15s;
  }
  .btn-refresh:hover { color: var(--txt); border-color: var(--acc); }
  .btn-clear-results {
    background: none; border: 1px solid rgba(220,38,38,.3);
    color: var(--red); border-radius: 6px;
    padding: 5px 10px; font-family: var(--sans); font-size: 11px; font-weight: 600;
    cursor: pointer; transition: all .15s;
  }
  .btn-clear-results:hover { background: rgba(220,38,38,.06); }

  /* ── TABLE ── */
  .table-wrap { padding: 0 20px 16px; overflow-x: auto; }
  table { width: 100%; border-collapse: collapse; font-size: 13px; }
  thead tr { background: var(--sur2); }
  thead th {
    padding: 9px 10px;
    color: var(--txt3); font-family: var(--sans); font-weight: 700;
    font-size: 10px; text-transform: uppercase; letter-spacing: .1em;
    text-align: left; border-bottom: 2px solid var(--bdr2); white-space: nowrap;
    position: sticky; top: 0; background: var(--sur2); z-index: 1;
  }
  thead th:first-child { border-radius: 6px 0 0 0; }
  thead th:last-child  { border-radius: 0 6px 0 0; }
  thead th.sortable { cursor: pointer; user-select: none; }
  thead th.sortable:hover { color: var(--txt2); }
  thead th.sorted { color: var(--acc); }
  tbody tr { border-bottom: 1px solid rgba(216,209,194,.45); transition: background .1s; }
  tbody tr:nth-child(even) { background: rgba(246,243,236,.6); }
  tbody tr:hover { background: rgba(192,122,8,.07) !important; }
  td { padding: 7px 10px; vertical-align: middle; line-height: 1.3; }
  td.price { font-family: var(--mono); color: var(--grn); font-weight: 700; font-size: 13px; }
  .lien a {
    color: var(--sky); text-decoration: none; font-size: 11px;
    padding: 2px 8px; border: 1px solid rgba(3,105,161,.3); border-radius: 3px;
    transition: all .15s;
  }
  .lien a:hover { background: rgba(3,105,161,.07); border-color: var(--sky); }
  .badge { font-size: 10px; padding: 2px 8px; border-radius: 3px; font-weight: 600; letter-spacing: .04em; white-space: nowrap; }
  .btn-fav { background: none; border: none; cursor: pointer; font-size: 13px; padding: 2px 4px; opacity: .28; transition: opacity .15s, transform .15s; }
  .btn-fav:hover { opacity: .7; transform: scale(1.2); }
  .btn-fav.active { opacity: 1; }
  input[type=checkbox] { cursor: pointer; width: 13px; height: 13px; accent-color: var(--acc); }

  /* ── COMPARE PANEL ── */
  .compare-panel {
    margin: 0 24px 24px;
    background: var(--sur); border: 1px solid rgba(109,40,217,.25);
    border-top: 2px solid var(--pur);
    border-radius: 8px; overflow: hidden; display: none;
    box-shadow: 0 1px 3px rgba(41,36,25,.05);
  }
  .compare-panel.visible { display: block; }
  .compare-header { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--bdr); }
  .compare-header h3 { font-size: 13px; color: var(--pur); font-weight: 600; letter-spacing: .04em; }
  .compare-grid { overflow-x: auto; padding: 12px 16px; }
  .compare-grid table { font-size: 11px; }
  .compare-grid th { color: var(--txt2); padding: 4px 10px; font-weight: 500; text-align: center; }
  .compare-grid td { padding: 5px 10px; border-bottom: 1px solid var(--bg); }
  .compare-grid td.label { color: var(--txt3); font-size: 10px; text-transform: uppercase; text-align: left; }
  .compare-grid td.best { color: var(--grn); font-weight: 600; }

  /* ── SPINNER / EMPTY ── */
  .spinner { display: none; padding: 48px; text-align: center; color: var(--txt2); font-size: 13px; }
  .spinner.active { display: block; }
  .empty-msg { display: none; padding: 48px; text-align: center; color: var(--txt3); font-style: italic; }

  /* ── CONSOLE (reste sombre : look terminal) ── */
  .console-wrap { margin: 0 24px 24px; }
  .console-wrap summary { cursor: pointer; color: var(--txt3); font-size: 11px; user-select: none; padding: 4px 0; }
  .console-wrap summary:hover { color: var(--txt2); }
  .console-box {
    background: #16140e; border: 1px solid var(--bdr2);
    border-radius: 6px; padding: 10px 14px; margin-top: 6px;
    font-family: var(--mono); font-size: 11px; line-height: 1.7;
    max-height: 200px; overflow-y: auto;
  }
  .log-url { color: #38bdf8; }
  .log-ok  { color: #34d399; }
  .log-warn{ color: #fbbf24; }
  .log-err { color: #f87171; }
  .log-info{ color: #8a8676; }

  /* ── HISTORIQUE / FAVORIS TABLE ── */
  .data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
  .data-table th { padding: 10px 10px; color: var(--txt3); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; text-align: left; border-bottom: 1px solid var(--bdr2); }
  .data-table td { padding: 9px 10px; border-bottom: 1px solid rgba(216,209,194,.5); vertical-align: middle; }
  .data-table tr:hover td { background: rgba(192,122,8,.04); }

  /* ── STATS ── */
  .charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .chart-card { background: var(--sur); border-radius: 8px; padding: 16px; border: 1px solid var(--bdr); box-shadow: 0 1px 3px rgba(41,36,25,.05); }
  .chart-card h3 { font-size: 10px; color: var(--txt3); text-transform: uppercase; letter-spacing: .1em; font-weight: 600; margin-bottom: 12px; }
  .chart-card canvas { width: 100%; }

  /* ── PARAMÈTRES ── */
  .settings-section { background: var(--sur); border-radius: 8px; padding: 16px; border: 1px solid var(--bdr); box-shadow: 0 1px 3px rgba(41,36,25,.05); margin-bottom: 16px; }
  .settings-section h3 { font-size: 12px; font-weight: 700; margin-bottom: 12px; color: var(--txt); text-transform: uppercase; letter-spacing: .06em; }
  .setting-row { display: flex; align-items: center; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--bg); }
  .setting-row:last-child { border-bottom: none; }
  .setting-label { color: var(--txt2); font-size: 13px; }
  .toggle-switch { position: relative; width: 36px; height: 20px; }
  .toggle-switch input { opacity: 0; width: 0; height: 0; }
  .toggle-switch .slider { position: absolute; cursor: pointer; inset: 0; background: var(--bdr2); border-radius: 20px; transition: .2s; }
  .toggle-switch input:checked + .slider { background: var(--acc); }
  .toggle-switch .slider::before { content: ""; position: absolute; width: 14px; height: 14px; left: 3px; top: 3px; background: white; border-radius: 50%; transition: .2s; box-shadow: 0 1px 2px rgba(41,36,25,.25); }
  .toggle-switch input:checked + .slider::before { transform: translateX(16px); }
  input[type=range] { width: 120px; accent-color: var(--acc); }
  .tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
  .tag { background: var(--sur2); color: var(--txt2); padding: 4px 10px; border-radius: 4px; font-size: 11px; display: flex; align-items: center; gap: 5px; border: 1px solid var(--bdr); }
  .tag-remove { cursor: pointer; color: var(--txt3); font-size: 12px; }
  .tag-remove:hover { color: var(--red); }
  .input-add { display: flex; gap: 6px; margin-top: 8px; }
  .input-add input { background: var(--sur); border: 1px solid var(--bdr2); border-radius: 5px; padding: 6px 10px; color: var(--txt); font-family: var(--sans); font-size: 12px; outline: none; flex: 1; }

  @keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }
  @keyframes fadeIn { from{opacity:0;transform:translateY(5px)} to{opacity:1;transform:translateY(0)} }

/* ── Engine toggle ── */
.engine-btn {
  border: none; padding: 7px 12px;
  font-family: var(--sans); font-size: 11px; font-weight: 600;
  letter-spacing: .04em; cursor: pointer;
  background: var(--sur); color: var(--txt2);
  transition: all .15s; white-space: nowrap;
}
.engine-btn + .engine-btn { border-left: 1px solid var(--bdr2); }
.engine-btn.active { background: var(--acc); color: #fff; }
.engine-btn:not(.active):hover { background: var(--sur2); color: var(--txt); }

/* ── Avis IA par annonce ── */
.ai-pill {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 2px 7px; border-radius: 10px;
  font-size: 11px; cursor: help; user-select: none;
}

/* ── AI Analysis content ─────────────────────────────────────── */
.ai-section {
  font-size: 13px; font-weight: 700; color: var(--acc, #c07a08);
  margin: 20px 0 8px; padding-bottom: 5px;
  border-bottom: 2px solid var(--acc, #c07a08); letter-spacing: .03em;
}
.ai-h2 { font-size: 15px; font-weight: 700; color: #1d4ed8; margin: 14px 0 6px; }
.ai-h3 { font-size: 13px; font-weight: 700; color: #0369a1; margin: 12px 0 5px; }
.ai-h4 { font-size: 12px; font-weight: 700; color: #1d4ed8; margin: 10px 0 4px; }
.ai-p  { margin: 5px 0; line-height: 1.7; color: var(--txt, #292419); font-size: 13px; }
.ai-ul { margin: 6px 0 6px 20px; padding: 0; list-style: disc; }
.ai-li { margin: 4px 0; line-height: 1.6; font-size: 13px; color: var(--txt, #292419); }
#search-ai-content a { color: #0369a1; text-decoration: underline; }
#search-ai-content code { background: #f0ece4; border-radius: 3px; padding: 1px 4px; font-size: 12px; }

.ai-table-wrap {
  overflow-x: auto; margin: 14px 0;
  border-radius: 8px; border: 1px solid #e2ddd0;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.ai-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ai-table thead th {
  padding: 9px 14px; background: #fdf0d5; color: #92400e;
  border-bottom: 2px solid #f5c07a; text-align: left;
  white-space: nowrap; font-weight: 700; font-size: 11px;
  text-transform: uppercase; letter-spacing: .04em;
}
.ai-table td {
  padding: 8px 14px; border-bottom: 1px solid #f0ece4;
  color: var(--txt, #292419); line-height: 1.5; vertical-align: top;
}
.ai-table tr:last-child td { border-bottom: none; }
.ai-row-alt td { background: #faf8f4; }

/* Ad note status badges */
.note-badge { display:inline-block;padding:1px 6px;border-radius:4px;font-size:10px;font-weight:600 }
.note-badge-a_appeler { background:#dbeafe;color:#1e40af }
.note-badge-inspecte  { background:#dcfce7;color:#15803d }
.note-badge-reserve   { background:#fef9c3;color:#854d0e }
.note-badge-ecarte    { background:#fee2e2;color:#dc2626 }

/* ════════════════════════════════════════════════════════════════
   MOBILE  (≤ 768px)
   Sidebar → barre d'onglets basse · tableaux → fiches annonce
   Desktop inchangé : tout vit dans cette media query.
   ════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

  html, body { max-width: 100vw; overflow-x: hidden; }
  body { display: block; height: auto; min-height: 100vh; overflow-y: auto; }
  .main {
    height: auto; overflow: visible;
    padding-bottom: calc(78px + env(safe-area-inset-bottom));
  }

  /* ── Barre d'onglets basse ── */
  .sidebar, .sidebar.collapsed {
    position: fixed; bottom: 0; left: 0; right: 0; top: auto;
    width: 100%; height: auto;
    flex-direction: row; align-items: stretch;
    border-right: none; border-top: 1px solid var(--bdr);
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(8px);
    z-index: 100; overflow: visible;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -4px 18px rgba(41,36,25,.09);
  }
  .sidebar::after { display: none; }
  .sidebar-logo, .sidebar.collapsed .sidebar-logo { display: none; }
  .sidebar-toggle-btn { display: none; }
  .sidebar-nav, .sidebar.collapsed .sidebar-nav {
    flex-direction: row; flex: 1; padding: 4px 0 4px 4px; gap: 0;
  }
  .sidebar-bottom { border-top: none; padding: 4px 4px 4px 0; display: flex; }
  .nav-item, .sidebar.collapsed .nav-item {
    flex-direction: column; justify-content: center; gap: 3px;
    padding: 6px 2px; min-height: 52px; border-radius: 8px;
  }
  .sidebar-nav .nav-item { flex: 1; min-width: 0; }
  .sidebar-bottom .nav-item { width: 50px; }
  .nav-icon { font-size: 17px; }
  .nav-label, .sidebar.collapsed .nav-label {
    display: block; flex: none;
    font-size: 8px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    max-width: 100%;
  }
  .nav-item.active::before { display: none; }
  .nav-badge, .sidebar.collapsed .nav-badge {
    position: absolute; top: 2px; right: calc(50% - 19px);
  }

  /* ── Sections ── */
  .section-header { padding: 14px 14px 12px; }
  .section-header h2 { font-size: 16px; }
  .section-body { padding: 14px 12px 24px; }

  /* Blocs radar (marges inline à écraser) */
  #radar-search { margin: 12px 10px 0 !important; }
  #radar-watch, #radar-multi-watch { margin: 12px 10px !important; }

  /* ── Stat cards : 2 colonnes ── */
  .stat-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px; }
  .stat-card { padding: 12px 14px; }
  .stat-card .stat-value { font-size: 20px; }

  /* ── Formulaire recherche : empilé pleine largeur ── */
  .search-bar { padding: 12px; flex-direction: column; align-items: stretch; gap: 10px; }
  .search-bar .field { width: 100%; }
  .field input, .field select { width: 100%; }
  .field input.input-sm { width: 100%; }
  .year-range input { flex: 1; }
  .search-bar .btn-primary { width: 100%; padding: 12px; font-size: 14px; }
  .toggle { padding: 8px 12px; }

  /* Anti-zoom iOS : tout champ < 16px déclenche un zoom au focus */
  input:not([type=checkbox]):not([type=range]), select, textarea {
    font-size: 16px !important;
  }

  /* ── Barre de filtres : défilement horizontal ── */
  .filter-bar {
    flex-wrap: nowrap; overflow-x: auto;
    padding: 8px 12px; -webkit-overflow-scrolling: touch;
  }
  .filter-bar select, .filter-bar input { flex-shrink: 0; }
  .filter-count { margin-left: 8px; }

  .results-meta { padding: 10px 12px; }
  #compare-bar { padding: 0 12px 8px !important; }
  .compare-panel { margin: 0 10px 16px; }
  .console-wrap { margin: 0 10px 16px; }
  #search-ai-wrap { padding: 0 12px 20px !important; }
  #ai-tooltip { max-width: 92vw !important; }

  /* ── Tableaux → fiches annonce ─────────────────────────────
     Chaque <tr> devient une carte compacte sur 3 lignes :
     1) case à cocher / titre / favori
     2) prix + caractéristiques en texte fil (pas de puces, un
        "·" sépare les valeurs, celles absentes sont masquées)
     3) source + avis IA (gauche) · lien + actions (droite)
     Le passage à la ligne est forcé par un filler invisible
     (tr::after, order:1) plutôt que par une largeur fixe. */
  .table-wrap { padding: 0 10px 12px; overflow-x: visible; }
  .table-wrap table, .data-table { display: block; }
  .table-wrap thead, .data-table thead { display: none; }
  .table-wrap tbody, .data-table tbody {
    display: flex; flex-direction: column; gap: 8px;
  }
  .table-wrap tbody tr, .data-table tbody tr {
    display: flex; flex-wrap: wrap; align-items: center;
    row-gap: 5px; column-gap: 6px;
    background: var(--sur) !important;
    border: 1px solid var(--bdr);
    border-left: 3px solid var(--acc);
    border-radius: 9px;
    padding: 9px 11px;
    box-shadow: 0 1px 3px rgba(41,36,25,.06);
  }
  .table-wrap tbody td, .data-table tbody td {
    border: none; background: none; padding: 0;
    font-size: 12px; color: var(--txt2); line-height: 1.35;
  }
  /* Fillers pleine-largeur invisibles : forcent chaque groupe
     (titre / prix+carac. / source+actions) sur sa propre ligne,
     même quand son contenu est court et laisserait sinon de la
     place pour le groupe suivant sur la même ligne. */
  .table-wrap tbody tr::before, .data-table tbody tr::before {
    content: ""; order: -1; flex: 0 0 100%; height: 0;
  }
  .table-wrap tbody tr::after, .data-table tbody tr::after {
    content: ""; order: 1; flex: 0 0 100%; height: 0;
  }

  /* Ligne 1 : case à cocher */
  .table-wrap td:has(> input[type=checkbox]) { order: -4; }
  .table-wrap input[type=checkbox] { width: 17px; height: 17px; }

  /* Ligne 1 : titre */
  #tbody td:nth-child(2),
  #w-tbody td:first-child,
  #mw-tbody td:first-child,
  #favoris-tbody td:first-child,
  #historique-tbody td:first-child {
    order: -3; flex: 1 1 60%;
    font-size: 13.5px; font-weight: 600; color: var(--txt);
    white-space: normal !important;
    max-width: none !important; overflow: visible !important;
  }

  /* Ligne 1 : étoile favori */
  .table-wrap td:has(.btn-fav), .table-wrap td:has(.fav-star) { order: -2; }
  .btn-fav { font-size: 17px; padding: 2px 3px; }
  .fav-star { font-size: 17px; }

  /* Ligne 2 : prix — mono vert, en tête de ligne */
  .table-wrap td.price, .data-table td.price {
    order: 0; font-family: var(--mono); font-weight: 700;
    color: var(--grn); font-size: 16px; margin-right: 2px;
  }
  #historique-tbody td.price { font-size: 13px; }

  /* Ligne 2 : caractéristiques — texte fil, "·" entre valeurs,
     valeurs absentes masquées (pas de puce vide "—") */
  .table-wrap td.spec, .data-table td.spec { order: 0; }
  .table-wrap td.spec ~ td.spec::before,
  .data-table td.spec ~ td.spec::before {
    content: "·"; margin-right: 6px; color: var(--bdr2);
  }
  .table-wrap td.v-empty, .data-table td.v-empty { display: none; }

  /* Ligne 3 gauche : source + avis IA */
  .table-wrap td:has(.badge), .data-table td:has(.badge),
  .table-wrap td:has(.site-badge),
  .table-wrap td.ia-cell, .table-wrap td.meta, .data-table td.meta {
    order: 2;
  }

  /* Ligne 3 droite : lien + actions, poussés à droite */
  .table-wrap td.lien, .data-table td.lien,
  .table-wrap td:has(.ad-link) { order: 6; margin-left: auto; }
  .lien a { padding: 5px 11px; font-size: 11.5px; border-radius: 6px; }
  .ad-link {
    color: var(--sky); text-decoration: none; font-size: 11.5px;
    padding: 5px 11px; border: 1px solid rgba(3,105,161,.3); border-radius: 6px;
  }
  .table-wrap td:has(.btn-margin),
  .table-wrap td:has(.btn-note) { order: 7; }
  .data-table td:has(.btn-danger),
  .data-table td:last-child { order: 7; margin-left: auto; }

  /* ── Graphiques : 1 colonne ── */
  .charts-grid { grid-template-columns: 1fr; }
  .charts-grid .chart-card { grid-column: auto !important; }

  /* ── Paramètres / clients ── */
  .setting-row { flex-wrap: wrap; gap: 6px; }
  #client-form [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }

  /* Cibles tactiles */
  .btn { padding: 10px 16px; }
  .btn-sm { padding: 8px 12px; font-size: 11px; }
  .btn-refresh, .btn-clear-results { padding: 8px 12px; }
}

/* Confort : animations coupées si demandé par l'OS */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}
