:root {
      --bg: #F7F7F5;
      --surface: #FFFFFF;
      --surface-btn: #EFEFE9;
      --text: #000000;
      --text-muted: #4A4A46;
      --border: #D8D8D0;
      --border-strong: #000000;
      --yellow: #FFC40C;
      --yellow-halo: 0 0 0 3px rgba(255, 196, 12, 0.20);
      --header-h: 76px;
      --radius-card: 20px;
      --radius-pill: 9999px;
      --font-display: 'Plus Jakarta Sans', sans-serif;
      --font-sans: 'Inter', sans-serif;
      --font-mono: 'JetBrains Mono', monospace;
    }

    html[data-theme="dark"] {
      --bg: #000000;
      --surface: #0E0E0E;
      --surface-btn: #141414;
      --text: #FFFFFF;
      --text-muted: #B8B8B2;
      --border: #262626;
      --border-strong: #FFFFFF;
    }

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

    html {
      font-family: var(--font-sans);
      font-size: 16px;
      line-height: 1.65;
      background-color: var(--bg);
      color: var(--text);
      -webkit-font-smoothing: antialiased;
    }

    body {
      margin: 0;
      background-color: var(--bg);
      color: var(--text);
      overflow-x: clip;
      min-height: 100vh;
      display: flex;
      flex-direction: column;
    }

    :focus-visible { outline: 2px solid var(--yellow); outline-offset: 3px; }

    h1, h2, h3, h4 {
      font-family: var(--font-display);
      font-weight: 800;
      letter-spacing: -0.025em;
      line-height: 1.15;
      margin: 0;
    }

    p { margin: 0; max-width: 72ch; }

    #bgCanvas {
      position: fixed;
      inset: 0;
      width: 100%;
      height: 100%;
      pointer-events: none;
      z-index: 0;
    }

    .site-header {
      position: sticky;
      top: 0;
      z-index: 40;
      height: var(--header-h);
      background-color: var(--surface);
      border-bottom: 1px solid var(--border);
    }

    .header-inner {
      max-width: 1360px;
      height: 100%;
      margin: 0 auto;
      padding-inline: 20px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
    }

    .brand {
      display: flex;
      align-items: center;
      gap: 12px;
      min-width: 0;
      text-decoration: none;
      color: var(--text);
    }

    .brand-logo { width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0; display: block; }
    .brand-text { display: flex; flex-direction: column; min-width: 0; }
    .brand-title { font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; letter-spacing: -0.025em; line-height: 1.15; }
    .brand-sub { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

    .header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

    button, .btn {
      font-family: var(--font-mono);
      font-weight: 700;
      font-size: 0.78rem;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      background-color: var(--surface-btn);
      color: var(--text);
      border: 1.5px solid var(--border);
      border-radius: var(--radius-pill);
      padding: 10px 18px;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      text-decoration: none;
      transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease, transform 0.12s ease;
      white-space: nowrap;
    }

    button:hover:not(:disabled), .btn:hover { border-color: var(--border-strong); }
    button:active:not(:disabled), .btn:active { transform: translateY(1px); }
    button:disabled { opacity: 0.5; cursor: not-allowed; }

    .btn-primary {
      min-height: 50px;
      padding: 12px 24px;
      background-color: var(--yellow);
      color: #000000;
      border: 2px solid #000000;
    }

    .btn-primary:hover:not(:disabled) { background-color: #000000; color: var(--yellow); border-color: var(--yellow); }

    .btn-secondary {
      min-height: 50px;
      padding: 12px 24px;
      background-color: var(--surface-btn);
      color: var(--text);
      border: 2px solid var(--border-strong);
    }

    .btn-secondary:hover:not(:disabled) { background-color: var(--text); color: var(--surface); }

    .btn-chip { min-height: 38px; padding: 6px 14px; font-size: 0.72rem; }
    .btn-chip.is-active, .btn-chip[aria-selected="true"] {
      background-color: var(--yellow);
      color: #000000;
      border-color: #000000;
    }

    main {
      position: relative;
      z-index: 1;
      flex: 1;
      width: 100%;
      max-width: 1360px;
      margin: 0 auto;
      padding: 32px 20px 64px;
    }

    .hero {
      margin-bottom: 28px;
      display: flex;
      flex-wrap: wrap;
      align-items: flex-end;
      justify-content: space-between;
      gap: 16px;
    }

    .hero-eyebrow {
      display: inline-block;
      font-family: var(--font-mono);
      font-weight: 700;
      font-size: 0.75rem;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      background-color: var(--yellow);
      color: #000000;
      padding: 4px 12px;
      border-radius: var(--radius-pill);
      border: 1.5px solid #000000;
      margin-bottom: 12px;
    }

    .hero h1 { font-size: clamp(1.9rem, 3.6vw, 2.85rem); margin-bottom: 8px; }
    .hero-desc { color: var(--text-muted); font-size: 1rem; }

    .workspace-grid {
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      gap: 24px;
      align-items: stretch;
    }

    .col-main, .col-sidebar {
      min-width: 0;
      display: flex;
      flex-direction: column;
      gap: 24px;
    }

    /* Météo & Simulateur en premier sur mobile (< 1024px) */
    .col-sidebar { order: -1; }

    @media (min-width: 1024px) {
      main { padding: 40px 48px 72px; }
      .header-inner { padding-inline: 48px; }
      .workspace-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
      .col-sidebar { order: 0; }
    }

    @media (min-width: 768px) and (max-width: 1023px) {
      main { padding: 32px 32px 64px; }
      .header-inner { padding-inline: 32px; }
    }

    .card {
      background-color: var(--surface);
      border: 1.5px solid var(--border);
      border-radius: var(--radius-card);
      padding: 24px;
      min-width: 0;
      transition: border-color 0.16s ease, box-shadow 0.16s ease;
    }

    .card.is-open { border: 2px solid var(--yellow); box-shadow: var(--yellow-halo); }

    .card-head {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 18px;
    }

    .card-title-group { display: flex; align-items: center; gap: 10px; min-width: 0; }

    .badge {
      font-family: var(--font-mono);
      font-weight: 700;
      font-size: 0.72rem;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      padding: 4px 10px;
      border-radius: var(--radius-pill);
      background-color: var(--surface-btn);
      color: var(--text);
      border: 1.5px solid var(--border);
    }

    .badge-yellow { background-color: var(--yellow); color: #000000; border-color: #000000; }

    .chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }

    .search-row {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      margin-bottom: 14px;
    }

    .text-input {
      flex: 1;
      min-width: 180px;
      min-height: 48px;
      padding: 10px 18px;
      border-radius: var(--radius-pill);
      border: 1.5px solid var(--border);
      background-color: var(--bg);
      color: var(--text);
      font-family: var(--font-sans);
      font-size: 0.96rem;
    }

    .stats-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 12px;
      align-items: stretch;
    }

    .stat-box {
      background-color: var(--bg);
      border: 1.5px solid var(--border);
      border-radius: 14px;
      padding: 16px;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      min-width: 0;
    }

    .stat-box.is-highlight { background-color: var(--yellow); color: #000000; border-color: #000000; }
    .stat-label { font-family: var(--font-mono); font-weight: 700; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.85; }
    .stat-value { font-family: var(--font-display); font-weight: 800; font-size: 1.65rem; letter-spacing: -0.025em; line-height: 1.15; margin-top: 6px; }
    .stat-sub { font-size: 0.82rem; color: var(--text-muted); margin-top: 4px; }
    .stat-box.is-highlight .stat-sub { color: #000000; opacity: 0.85; }

    /* Liste stations */
    .stations-list { display: flex; flex-direction: column; gap: 12px; }

    .station-card {
      background-color: var(--bg);
      border: 1.5px solid var(--border);
      border-radius: 16px;
      padding: 16px 18px;
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      justify-content: space-between;
      gap: 14px;
      min-width: 0;
    }

    .station-card.is-best { border: 2px solid var(--yellow); }
    .station-info { min-width: 0; flex: 1 1 240px; }
    .station-title { font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; }
    .station-addr { font-size: 0.9rem; color: var(--text-muted); margin-top: 2px; }
    .station-meta { font-family: var(--font-mono); font-size: 0.7rem; text-transform: uppercase; color: var(--text-muted); margin-top: 6px; display: flex; flex-wrap: wrap; gap: 8px; }

    .station-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
    .station-price {
      font-family: var(--font-display);
      font-weight: 800;
      font-size: 1.45rem;
      background-color: var(--surface);
      border: 1.5px solid var(--border);
      border-radius: 12px;
      padding: 8px 14px;
    }
    .station-card.is-best .station-price { background-color: var(--yellow); color: #000000; border-color: #000000; }

    /* Simulateur & Jauge de zone */
    .sim-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }

    .zone-gauge-wrap {
      margin-top: 14px;
      padding: 14px 16px;
      background-color: var(--bg);
      border: 1.5px solid var(--border);
      border-radius: 14px;
    }

    .zone-gauge-labels {
      display: flex;
      justify-content: space-between;
      gap: 8px;
      font-family: var(--font-mono);
      font-weight: 700;
      font-size: 0.7rem;
      text-transform: uppercase;
      margin-bottom: 8px;
    }

    .zone-gauge-track {
      position: relative;
      height: 12px;
      background-color: var(--surface-btn);
      border: 1.5px solid var(--border-strong);
      border-radius: 9999px;
      overflow: hidden;
    }

    .zone-gauge-bar {
      position: absolute;
      left: 0;
      top: 0;
      bottom: 0;
      background-color: var(--yellow);
      width: 50%;
      transition: width 0.25s ease;
    }

    .json-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

    /* FAQ */
    .faq-section { margin-top: 48px; }
    .faq-head { margin-bottom: 20px; }
    .faq-head h2 { font-size: clamp(1.5rem, 2.8vw, 2.1rem); margin-top: 10px; }
    .faq-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }

    @media (min-width: 900px) {
      .faq-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
    }

    .faq-item { background-color: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-card); overflow: hidden; }
    .faq-item.is-open { border: 2px solid var(--yellow); box-shadow: var(--yellow-halo); }
    .faq-trigger {
      width: 100%; border-radius: 0; border: 0; background-color: var(--surface-btn); color: var(--text);
      padding: 18px 20px; text-align: left; justify-content: space-between; white-space: normal;
      font-family: var(--font-display); font-weight: 800; font-size: 1rem; text-transform: none; letter-spacing: -0.01em; line-height: 1.35;
    }
    .faq-item.is-open .faq-trigger { background-color: var(--yellow); color: #000000; }
    .faq-icon { font-family: var(--font-mono); font-weight: 700; font-size: 1rem; flex-shrink: 0; }
    .faq-panel { display: none; padding: 18px 20px; color: var(--text-muted); font-size: 0.96rem; line-height: 1.65; border-top: 1px solid var(--border); }
    .faq-item.is-open .faq-panel { display: block; }

    .toast {
      position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 16px);
      background-color: #000000; color: #FFFFFF; border: 2px solid var(--yellow); border-radius: var(--radius-pill);
      padding: 10px 20px; font-family: var(--font-mono); font-weight: 700; font-size: 0.78rem; text-transform: uppercase;
      opacity: 0; pointer-events: none; transition: opacity 0.2s ease, transform 0.2s ease; z-index: 60;
      max-width: calc(100vw - 32px); text-align: center;
    }
    .toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

    .site-footer {
      position: relative; z-index: 1; background-color: #000000; color: #FFFFFF;
      border-top: 2px solid var(--yellow); padding: 28px 20px;
    }
    .footer-inner { max-width: 1360px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
    .footer-links { display: flex; flex-wrap: wrap; gap: 10px; }
    .footer-link {
      background-color: #141414; color: #FFFFFF; border: 1.5px solid #333333; border-radius: var(--radius-pill);
      padding: 8px 16px; font-family: var(--font-mono); font-weight: 700; font-size: 0.75rem; text-transform: uppercase; text-decoration: none;
    }
    .footer-link:hover { border-color: var(--yellow); color: var(--yellow); }

    .header-nav { display: none; align-items: center; gap: 8px; }
    @media (min-width: 768px) { .header-nav { display: flex; } }
    .nav-pill { min-height: 38px; padding: 6px 14px; font-size: 0.72rem; }
    .nav-pill.is-active { background-color: var(--yellow); color: #000000; border-color: #000000; }

    .guides-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: stretch; }
    @media (min-width: 900px) { .guides-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
    .guide-card { display: flex; flex-direction: column; justify-content: space-between; gap: 18px; height: 100%; }
    .guide-card h2 { font-size: 1.3rem; margin-top: 10px; }
    .guide-card p { color: var(--text-muted); margin-top: 8px; font-size: 0.96rem; }

    .article-shell { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
    @media (min-width: 1024px) { .article-shell { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); } }
    .article-body { display: flex; flex-direction: column; gap: 18px; }
    .article-body h2 { font-size: clamp(1.35rem, 2.4vw, 1.75rem); margin-top: 8px; }
    .article-body p, .article-body li { color: var(--text-muted); font-size: 1rem; line-height: 1.65; }
    .article-body ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }

    .table-wrap { width: 100%; overflow-x: auto; border: 1.5px solid var(--border); border-radius: 14px; background-color: var(--bg); }
    .data-table { width: 100%; border-collapse: collapse; font-size: 0.94rem; text-align: left; }
    .data-table th, .data-table td { padding: 12px 16px; border-bottom: 1px solid var(--border); }
    .data-table th { font-family: var(--font-mono); font-weight: 700; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.04em; background-color: var(--surface-btn); color: var(--text); }
    .data-table tr:last-child td { border-bottom: 0; }

    @media (max-width: 439px) {
      .brand-sub { display: none; }
      .stats-grid { grid-template-columns: minmax(0, 1fr); }
      .card { padding: 18px; }
    }
