  :root {
    --bg: #f7f5ef;
    --panel: #fff;
    --ink: #1c1a17;
    --muted: #6b6862;
    --line: #e4e0d6;
    --green: #2e8b7a;
    --greendark: #1f6053;
    --accent: #b5491f;
    --accent-soft: #f3e3db;
    --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  }

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

  body {
    font-family: var(--font);
    color: var(--ink);
    background: var(--bg);
    height: 100vh;
    overflow: hidden
  }

  .app {
    display: grid;
    grid-template-columns: 300px 1fr;
    height: 100vh
  }

  .panel {
    background: var(--panel);
    padding: 10px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 18px
  }

  header h1 {
    font-size: 17px;
    font-weight: 600;
    line-height: 1.3
  }

  header p {
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px
  }

  .block-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    margin-bottom: 10px;
    font-weight: 600
  }

  .yearwrap {
    background: var(--accent-soft);
    border: 1px solid #e8cfc2;
    border-radius: 10px;
    padding: 14px 16px
  }

  .yearrow {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 8px
  }

  .yearnum {
    font-size: 30px;
    font-weight: 700;
    color: var(--accent);
    font-variant-numeric: tabular-nums
  }

  .yearcount {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.4;
    background: #f1efe8;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 10px
  }

  .yearcount-deps {
    display: block;
    margin-top: 4px;
    color: var(--ink)
  }

  input[type=range] {
    width: 100%;
    accent-color: var(--accent);
    cursor: pointer
  }

  .playrow {
    display: flex;
    gap: 8px;
    margin-top: 10px
  }

  .playrow button {
    flex: 1;
    border: 1px solid #dcae9b;
    background: #fff;
    color: var(--accent);
    border-radius: 7px;
    padding: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer
  }

  .playrow button:hover {
    background: var(--accent);
    color: #fff
  }

  .legend-item {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13px;
    padding: 5px 6px;
    border-radius: 6px;
    cursor: pointer;
    user-select: none
  }

  .legend-item:hover {
    background: #f1efe8
  }

  .legend-item.off {
    /* Le nom du réseau doit rester lisible même décoché : on ne fait
       plus fondre toute la ligne dans l'opacité (illisible sur fond
       clair), seule l'icône se désature ci-dessous. */
    opacity: 1
  }

  .legend-item.off svg {
    opacity: .4
  }

  .legend-item.off .nm {
    color: var(--muted)
  }

  .legend-item .nm {
    flex: 1
  }

  #legend.locked .legend-item {
    cursor: not-allowed;
    pointer-events: none;
    opacity: .6
  }

  .legend-item--all {
    border-bottom: 1px solid var(--line);
    margin-bottom: 4px;
    padding-bottom: 9px
  }

  .backbtn {
    display: none;
    align-items: center;
    gap: 6px;
    background: var(--green);
    color: #fff;
    border: none;
    border-radius: 7px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    justify-content: center
  }

  .backbtn:hover {
    background: var(--greendark)
  }

  .modehint {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.5
  }

  #map {
    height: 100vh
  }

  .foot {
    font-size: 11px;
    color: var(--muted);
    line-height: 1.5;
    border-top: 1px solid var(--line);
    padding-top: 14px;
    margin-top: auto
  }

  .dep-marker,
  .poi-marker {
    background: none !important;
    border: none !important
  }

  .dep-label {
    background: var(--green);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 5px 5px 0 0;
    white-space: nowrap;
    text-align: center;
    line-height: 1.3;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .2)
  }

  .dep-count {
    background: #fff;
    color: var(--ink);
    font-size: 13px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 0 0 5px 5px;
    text-align: center;
    border: 1px solid var(--green);
    border-top: none;
    font-variant-numeric: tabular-nums
  }

  .dep-pin {
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 11px solid var(--greendark);
    margin: 0 auto
  }

  .leaflet-popup-content-wrapper {
    border-radius: 10px
  }

  .leaflet-popup-content {
    text-align: start !important;
    font-family: var(--font);
    font-size: 13px;
    line-height: 1.5;
    margin: 12px 14px;
    min-width: 210px !important;
  }

  .pc-head {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding-bottom: 9px;
    border-bottom: 1px solid #eee;
    margin-bottom: 9px
  }

  .pc-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.25
  }

  .pc-net {
    font-size: 12px;
    color: var(--muted);
    margin-top: 1px
  }

  .pc-row {
    display: flex;
    gap: 8px;
    margin: 5px 0;
    align-items: flex-start
  }

  .pc-ico {
    color: var(--green);
    flex-shrink: 0;
    width: 15px;
    text-align: center;
    font-weight: 700
  }

  .pc-val {
    flex: 1
  }

  .pc-tag {
    display: inline-block;
    background: #198754;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    margin-top: 6px
  }

  @media(max-width:720px) {
    .app {
      grid-template-columns: 1fr;
      grid-template-rows: auto 1fr
    }

    .panel {
      max-height: 46vh
    }
  }
