/* Identité visuelle Chiffrex (kit v1, novembre 2026) : tokens et composants partagés, accent Loyers = brique */
:root {
  --ink: #0F1A2B;
  --paper: #F6F4EF;
  --sand: #EFECE4;
  --line: #E2DDD1;
  --rule: #C9C3B4;
  --muted: #4A5568;
  --accent: #E2543A;       /* Loyers : brique (décoratif : trait, puce, point, remplissages) */
  --accent-text: #B93A22;  /* brique lisible en texte / fond de bouton avec texte blanc */
  --blue: #1E3FE0;
  --accent-soft: #FBE6DF;  /* fond brique très clair (barres, surlignage) */
}

html, body { max-width: 100vw; }
[hidden] { display: none !important; }
body.cx-body { margin: 0; }
body.cx-body *, body.cx-body *::before, body.cx-body *::after { box-sizing: border-box; }
body.cx-body {
  background: var(--paper); color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif; -webkit-font-smoothing: antialiased;
}
body.cx-body * { font-family: inherit; }
body.cx-body h1, body.cx-body h2, body.cx-body h3, body.cx-body .cx-display, body.cx-body .cx-h2 { font-family: 'Host Grotesk', 'Inter', sans-serif; }

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--blue); outline-offset: 2px;
}

.cx-container { max-width: 1248px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }

/* Bandeau réseau */
.cx-network { background: var(--ink); }
.cx-network-inner { display: flex; flex-wrap: wrap; align-items: center; column-gap: 22px; padding-top: 2px; padding-bottom: 2px; }
.cx-network-link { display: inline-flex; align-items: center; gap: 7px; padding: 6px 0; font-size: 13px; line-height: 1.3; font-weight: 500; color: #C9D0DC; text-decoration: none; border-bottom: 2px solid transparent; }
.cx-network-link:hover { color: #fff; }
.cx-network-link[aria-current="page"] { color: #fff; font-weight: 700; border-bottom-color: #fff; }
.cx-pill { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex-shrink: 0; }

/* En-tête */
.cx-header { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 900; }
.cx-header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding-top: 14px; padding-bottom: 14px; }
.cx-logo { display: inline-flex; align-items: center; }
.cx-logo img { height: 24px; width: auto; display: block; }
.cx-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 22px; }
.cx-nav-link { color: var(--ink); font-size: 15px; font-weight: 500; padding: 10px 0; text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; }
.cx-nav-link:hover { border-bottom-color: var(--accent); }
.cx-nav-link[aria-current="page"] { font-weight: 700; border-bottom-color: var(--ink); }
.cx-user { font-size: 14px; font-weight: 600; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Boutons */
.cx-btn, .cx-btn-outline, .cx-btn-accent {
  display: inline-flex; align-items: center; justify-content: center; font-weight: 600; text-decoration: none; cursor: pointer;
  border-radius: 12px; border: 1.5px solid var(--ink); transition: background-color .15s, color .15s; white-space: nowrap; line-height: 1.2;
}
.cx-btn { background: var(--ink); color: #fff; padding: 15px 22px; font-size: 17px; }
.cx-btn:hover { background: #1d2a40; color: #fff; }
.cx-btn-outline { background: transparent; color: var(--ink); padding: 13px 20px; font-size: 16px; }
.cx-btn-outline:hover { background: var(--ink); color: #fff; }
.cx-btn-accent { background: var(--accent-text); border-color: var(--accent-text); color: #fff; padding: 13px 22px; font-size: 16px; }
.cx-btn-accent:hover { background: #962D19; border-color: #962D19; color: #fff; }
.cx-btn-sm { padding: 9px 14px; font-size: 15px; border-radius: 10px; }

/* Surtitre, titres */
.cx-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-family: 'JetBrains Mono', ui-monospace, monospace !important; font-size: 13px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.cx-eyebrow::before { content: ''; width: 10px; height: 10px; border-radius: 3px; background: var(--accent); flex-shrink: 0; }
.cx-eyebrow-dark { color: #C9D0DC; }
.cx-display { font-weight: 800; line-height: .95; letter-spacing: -0.04em; color: var(--ink); }
.cx-dot { color: var(--accent); }
.cx-h2 { font-weight: 700; font-size: clamp(24px, 3vw, 34px); line-height: 1.1; letter-spacing: -0.025em; color: var(--ink); }
.cx-mono { font-family: 'JetBrains Mono', ui-monospace, monospace !important; }

/* Cartes */
.cx-card { background: #fff; border: 1px solid var(--line); border-radius: 20px; }
.cx-kpi { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.cx-kpi-label { font-size: 13px; color: var(--muted); font-weight: 500; }
.cx-kpi-value { font-family: 'Host Grotesk', sans-serif !important; font-weight: 800; font-size: 28px; letter-spacing: -0.02em; line-height: 1.1; color: var(--ink); margin-top: 6px; }
.cx-link { font-weight: 600; color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.cx-link:hover { color: var(--accent-text); }

/* Recherche de l'en-tête (Ctrl K / ⌘ K) */
.cx-hsearch { position: relative; flex: 1 1 260px; max-width: 340px; }
.cx-hsearch input { width: 100%; font-size: 14px; padding: 9px 58px 9px 34px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
.cx-hsearch input:hover, .cx-hsearch input:focus { border-color: var(--ink); }
.cx-hsearch input::placeholder { color: #6B7280; }
.cx-hsearch-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted); pointer-events: none; }
.cx-hsearch kbd { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font-family: 'JetBrains Mono', ui-monospace, monospace !important; font-size: 10px; color: var(--muted); background: var(--sand); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; pointer-events: none; }
.cx-hsearch-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; min-width: 260px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgb(15 26 43 / .14); max-height: 340px; overflow-y: auto; z-index: 950; }
.cx-hsearch-results a { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 14px; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 600; }
.cx-hsearch-results a:last-child { border-bottom: 0; }
.cx-hsearch-results a:hover, .cx-hsearch-results a.is-active { background: var(--paper); }
.cx-hsearch-results small { font-family: 'JetBrains Mono', ui-monospace, monospace !important; font-size: 11px; font-weight: 400; color: var(--muted); white-space: nowrap; }
.cx-hsearch-empty { padding: 12px 14px; font-size: 14px; color: var(--muted); }

/* Fil d'Ariane */
.cx-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding-top: 24px; font-family: 'JetBrains Mono', ui-monospace, monospace !important; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.cx-crumbs a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--rule); }
.cx-crumbs a:hover { border-bottom-color: var(--ink); }
.cx-crumbs-sep { color: var(--rule); }

/* En-tête de fiche (commune, département, comparateur) */
.cx-page-head { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; align-items: start; padding-top: 40px; padding-bottom: 48px; }
.cx-page-head-main { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.cx-page-title { font-size: clamp(36px, 4.6vw, 64px); margin: 0; overflow-wrap: anywhere; }
.cx-page-lead { margin: 0; font-size: 19px; line-height: 1.5; color: #2D3748; max-width: 620px; }
.cx-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.cx-kpis { display: flex; flex-direction: column; gap: 14px; }
.cx-kpi-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
.cx-kpi-bar { display: block; width: 28px; height: 4px; border-radius: 2px; background: var(--accent); margin-bottom: 12px; }
.cx-kpi-card .cx-kpi-value { font-size: 30px; line-height: 1; margin: 0; white-space: nowrap; }
.cx-kpi-card .cx-kpi-unit { font-size: 16px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.cx-kpi-card .cx-kpi-label { font-size: 14px; margin: 8px 0 0; }

/* Panneau de contenu et son titre à carré brique */
.cx-panel { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 28px; min-width: 0; }
.cx-panel-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 20px; margin-bottom: 22px; }
.cx-panel-head .cx-panel-title { margin-bottom: 0; }
.cx-panel-title { display: flex; align-items: flex-start; gap: 12px; font-size: 22px; font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; color: var(--ink); margin: 0 0 22px; }
.cx-panel-title::before { content: ''; width: 10px; height: 10px; border-radius: 3px; background: var(--accent); flex-shrink: 0; margin-top: 8px; }
.cx-panel-note { font-size: 14px; line-height: 1.5; color: var(--muted); margin: 18px 0 0; }
.cx-section { margin-top: 64px; padding-top: 40px; border-top: 1px solid var(--line); }
.cx-section > .cx-h2 { margin: 0 0 28px; }
.cx-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.cx-stack { display: flex; flex-direction: column; gap: 24px; }
.cx-prose p { font-size: 16px; line-height: 1.7; color: #2D3748; margin: 0 0 14px; }
.cx-prose p:last-child { margin-bottom: 0; }
.cx-prose strong { color: var(--ink); }

/* Tableaux de données */
.cx-table-wrap { overflow-x: auto; margin: 0 -4px; }
.cx-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 15px; font-variant-numeric: tabular-nums; }
.cx-table th { padding: 12px; font-family: 'JetBrains Mono', ui-monospace, monospace !important; font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border-bottom: 2px solid var(--ink); white-space: nowrap; }
.cx-table td { padding: 12px; border-bottom: 1px solid var(--line); color: #2D3748; vertical-align: middle; }
.cx-table tbody tr { transition: background-color .15s; }
.cx-table tbody tr:hover { background: var(--paper); }
.cx-table tbody tr:last-child td { border-bottom: 0; }
.cx-table tr.is-current td { background: var(--paper); font-weight: 600; color: var(--ink); }
.cx-table a { color: var(--ink); font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--rule); }
.cx-table a:hover { border-bottom-color: var(--accent); }
.cx-table .cx-num, .cx-table th.cx-num { text-align: right; }
.cx-rank { width: 40px; font-family: 'JetBrains Mono', ui-monospace, monospace !important; font-size: 13px; color: #8A93A3 !important; text-align: center; }
.cx-num { font-weight: 600; color: var(--ink) !important; white-space: nowrap; }
.cx-bar { display: block; height: 4px; border-radius: 2px; background: var(--sand); margin-top: 6px; overflow: hidden; }
.cx-bar > i { display: block; height: 100%; background: var(--accent); border-radius: 2px; }

/* Puces, tuiles, évolution */
.cx-chip { display: inline-block; background: var(--sand); color: var(--muted); font-family: 'JetBrains Mono', ui-monospace, monospace !important; font-size: 11px; letter-spacing: .04em; padding: 3px 8px; border-radius: 6px; vertical-align: middle; }
.cx-badge { display: inline-flex; align-items: center; gap: 6px; font-family: 'JetBrains Mono', ui-monospace, monospace !important; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--muted); }
.cx-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.cx-tile { display: block; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; text-decoration: none; transition: border-color .15s; min-width: 0; }
.cx-tile:hover { border-color: var(--ink); }
.cx-tile-title { display: block; font-size: 15px; font-weight: 500; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-tile-sub { display: block; font-family: 'JetBrains Mono', ui-monospace, monospace !important; font-size: 11px; color: #8A93A3; margin-top: 2px; }
.cx-net-card { display: flex; flex-direction: column; gap: 6px; background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--c, var(--ink)); border-radius: 16px; padding: 18px 20px; text-decoration: none; color: var(--ink); transition: border-color .15s; }
.cx-net-card:hover { border-color: var(--ink); border-top-color: var(--c, var(--ink)); }
.cx-net-card strong { font-family: 'Host Grotesk', 'Inter', sans-serif !important; font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.cx-net-card span { font-size: 14px; line-height: 1.5; color: var(--muted); }
.cx-net-card em { font-style: normal; font-size: 14px; font-weight: 600; margin-top: 4px; }
/* Loyers : une hausse est défavorable au locataire (brique), une baisse en encre secondaire */
.cx-up { color: var(--accent-text) !important; font-weight: 600; }
.cx-down { color: var(--muted) !important; font-weight: 600; }

/* Contrôles segmentés (type de bien, vues) */
.cx-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; background: #fff; padding: 4px; border-radius: 12px; border: 1px solid var(--line); }
.cx-seg-btn { padding: 8px 14px; font-size: 13px; font-weight: 600; border-radius: 8px; color: var(--muted); text-decoration: none; white-space: nowrap; border: 0; background: transparent; cursor: pointer; transition: background-color .15s, color .15s; }
.cx-seg-btn:hover { color: var(--ink); }
.cx-seg-btn[aria-current="true"], .cx-seg-btn[aria-pressed="true"], .cx-seg-btn.is-active { background: var(--ink); color: #fff; }
.cx-select { padding: 9px 34px 9px 12px; font-size: 14px; font-weight: 600; color: var(--ink); background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%230F1A2B' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 12px center; border: 1px solid var(--line); border-radius: 10px; appearance: none; -webkit-appearance: none; cursor: pointer; }
.cx-select:hover { border-color: var(--ink); }

/* Questions fréquentes */
.cx-faqs { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.cx-faq { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 24px; }
.cx-faq h3 { font-size: 17px; font-weight: 700; line-height: 1.3; color: var(--ink); margin: 0 0 8px; }
.cx-faq p { font-size: 15px; line-height: 1.6; color: var(--muted); margin: 0; }

/* Bloc rapport PDF (encre) */
.cx-report { background: var(--ink); color: #C9D0DC; border-radius: 20px; padding: 24px 28px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px 24px; }
.cx-report h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; color: #fff; margin: 6px 0 0; }
.cx-report p { margin: 6px 0 0; font-size: 15px; line-height: 1.5; max-width: 38em; }

/* Emplacement publicitaire dans le contenu */
.cx-ad { margin: 32px 0; }
.cx-ad:empty, .cx-ad .gam-slot:empty { min-height: 0; }

.cx-empty { padding: 28px; text-align: center; color: var(--muted); font-size: 15px; background: var(--paper); border: 1px dashed var(--rule); border-radius: 14px; }
.cx-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 1024px) {
  .cx-page-head { grid-template-columns: 1fr; gap: 28px; }
  .cx-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
  .cx-grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .cx-panel { padding: 20px; }
  .cx-report { padding: 20px; }
  .cx-page-head { padding-top: 28px; padding-bottom: 36px; }
  .cx-page-lead { font-size: 17px; }
  .cx-section { margin-top: 48px; padding-top: 32px; }
  .cx-hsearch { order: 3; flex-basis: 100%; max-width: none; }
}

/* Pied de page */
.cx-footer { background: var(--ink); color: #C9D0DC; margin-top: 64px; }
.cx-footer-grid { display: grid; grid-template-columns: minmax(240px, 1.6fr) repeat(2, minmax(130px, 1fr)); gap: 40px; padding-top: 56px; padding-bottom: 40px; }
.cx-footer h2 { font-family: 'Inter', sans-serif !important; font-size: 13px; font-weight: 600; color: #fff; margin: 0 0 12px; letter-spacing: 0; }
.cx-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; font-size: 15px; }
.cx-footer a { color: inherit; text-decoration: none; }
.cx-footer a:hover { color: #fff; text-decoration: underline; }
.cx-footer p { margin: 0; font-size: 15px; line-height: 1.5; }
.cx-footer-brand { display: flex; flex-direction: column; gap: 14px; max-width: 340px; }
.cx-footer-brand img { height: 28px; width: auto; align-self: flex-start; }
.cx-footer-legal { border-top: 1px solid #2A3547; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; padding-top: 20px; padding-bottom: 28px; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12px; line-height: 1.6; }
.cx-footer-legal a { text-decoration: underline; text-underline-offset: 2px; }

@media (max-width: 720px) {
  .cx-footer-grid { grid-template-columns: 1fr 1fr; gap: 32px 24px; }
  .cx-footer-brand { grid-column: 1 / -1; }
  .cx-logo img { height: 22px; }
  .cx-nav { gap: 4px 16px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
