/* Pages de calcul du site (docs/website/) : exemples (decouvrir.html) et
   essai avec ses propres villes (essayer.html). Même rendu des résultats
   sur les deux. */

  /* ---- en-tête de page ---- */
  .page-hero{padding:56px 0 28px;}
  .page-hero h1{font-size:clamp(2rem, 4.2vw, 3rem); font-weight:600; line-height:1.08; margin-top:14px;}
  .page-hero h1 em{font-style:normal; color:var(--brand-text);}
  .page-hero .lede{margin-top:16px; font-size:1.1rem; color:var(--ink-soft); max-width:58ch;}
  /* Essayer : à quoi ça sert, en trois lignes (retour utilisateur 2026-09-30). */
  .page-hero .try-how{margin:18px 0 0; padding-left:1.3em; max-width:62ch; color:var(--ink-soft);}
  .page-hero .try-how li{margin-top:8px;}
  .page-hero .try-how b{color:var(--ink);}
  .page-hero .actions{margin-top:24px; display:flex; gap:14px; flex-wrap:wrap; align-items:center;}

  /* ---- essai libre ---- */
  .try{padding:8px 0 0; scroll-margin-top:86px;} /* en-tête collant */
  .try-card{
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:8px;
    padding:30px 30px 26px;
    box-shadow:var(--shadow);
  }
  @media (max-width:600px){ .try-card{padding:22px 18px;} }
  .try-card h2{font-size:clamp(1.4rem, 2.8vw, 1.9rem); font-weight:600; margin-top:8px;}
  .try-lede{color:var(--ink-soft); margin-top:10px; max-width:62ch;}
  .try-form{margin-top:20px;}
  .try-rows{display:flex; flex-direction:column; gap:10px;}
  .try-row{
    display:grid;
    grid-template-columns:1fr 170px 84px 84px 40px;
    gap:10px; align-items:center;
  }
  @media (max-width:760px){
    /* Deux lignes par personne, pas trois : le formulaire reste atteignable
       sans faire défiler longuement sur un téléphone. */
    .try-row{
      grid-template-columns:1fr 96px 40px;
      grid-template-areas:'ville ville retirer' 'mode places personnes';
      row-gap:8px;
      padding-bottom:10px; border-bottom:1px dashed var(--border);
    }
    .try-row:last-child{border-bottom:none;}
    .try-row.no-seats{grid-template-areas:'ville ville retirer' 'mode mode personnes';}
    .try-row .try-city{grid-area:ville;}
    .try-row .try-mode{grid-area:mode;}
    .try-row .try-seats{grid-area:places;}
    .try-row .try-people{grid-area:personnes;}
    .try-row .try-remove{grid-area:retirer;}
  }
  .try-row input, .try-row select{
    font:inherit; font-size:0.95rem; color:var(--ink);
    background:var(--band); border:1px solid var(--border); border-radius:8px;
    padding:11px 12px; width:100%; min-width:0;
  }
  .try-row input::placeholder{color:var(--ink-soft); opacity:.85;}
  .try-row input:invalid{border-color:var(--brand);}
  .try-seats[hidden]{display:none !important;}
  .try-remove{
    background:transparent; border:1px solid var(--border); border-radius:8px;
    width:40px; height:40px; cursor:pointer; color:var(--ink-soft);
    font-size:1.2rem; line-height:1; flex-shrink:0;
  }
  .try-remove:hover{border-color:var(--brand); color:var(--brand-text);}
  .try-remove:disabled{opacity:.3; cursor:default;}
  .try-row{position:relative;}
  .try-row .try-district-hint{grid-column:1 / -1; margin:0; font-size:.85rem; color:var(--ink-soft);}
  /* Propositions de communes pendant la frappe (ADR-123) : une liste sous
     le champ, positionnée en JS sur la largeur exacte du champ. */
  .try-suggest{
    position:absolute; z-index:30; margin:0; padding:6px 0; list-style:none;
    background:var(--surface); border:1px solid var(--border); border-radius:8px;
    box-shadow:var(--shadow); max-height:320px; overflow-y:auto;
  }
  .try-suggest[hidden]{display:none;}
  .try-suggest li{
    display:flex; flex-direction:column; gap:1px; padding:8px 14px; cursor:pointer;
    font-size:0.95rem; line-height:1.3;
  }
  .try-suggest li[aria-selected="true"], .try-suggest li:hover{background:var(--band);}
  .try-suggest .s-detail{font-size:.8rem; color:var(--ink-soft);}
  .try-suggest .s-empty{cursor:default; color:var(--ink-soft); font-size:.88rem;}
  .try-bar{
    display:flex; justify-content:space-between; align-items:flex-end;
    gap:16px; flex-wrap:wrap; margin-top:16px;
  }
  .try-time{font-size:0.86rem; font-weight:600; color:var(--ink-soft); display:block;}
  .try-time input{
    display:block; margin-top:5px;
    font:inherit; font-size:0.95rem; color:var(--ink);
    background:var(--band); border:1px solid var(--border); border-radius:8px;
    padding:9px 12px;
  }
  .try-time small{display:block; font-weight:400; margin-top:4px; font-size:0.76rem;}
  .try-submit{margin-top:22px; display:flex; align-items:center; gap:16px; flex-wrap:wrap;}
  /* Pondération par personne (ADR-134) : n'apparaît que si quelqu'un a
     déclaré venir à plusieurs — sans famille, ce réglage ne change rien. */
  .try-weighting{
    display:flex; gap:10px; align-items:flex-start;
    font-size:0.86rem; color:var(--ink-soft); margin-top:4px; max-width:60ch;
  }
  .try-weighting[hidden]{display:none !important;}
  .try-weighting input{margin-top:2px; flex-shrink:0;}
  .people-tag{
    display:inline-block; margin-left:6px; padding:1px 6px; border-radius:8px;
    background:var(--band); border:1px solid var(--border);
    font-size:.78rem; font-weight:700; color:var(--ink-soft); vertical-align:middle;
  }
  .try-status{font-size:0.92rem; font-weight:600; color:var(--ink-soft);}
  .try-status.error{color:var(--brand-text);}
  .try-card .notice{margin-top:16px;}

  /* ---- scénario ---- */
  .scenario{padding:24px 0 0;}
  .scenario-card{
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:8px;
    padding:30px 30px 26px;
    box-shadow:var(--shadow);
  }
  @media (max-width:600px){ .scenario-card{padding:22px 18px;} }
  .scenario-top{display:flex; justify-content:space-between; gap:18px; align-items:flex-start; flex-wrap:wrap;}
  .scenario-card h2{font-size:clamp(1.5rem, 3vw, 2.1rem); font-weight:600; margin-top:8px;}
  .scenario-card .pitch{color:var(--ink-soft); margin-top:10px; font-size:1.02rem; max-width:62ch;}
  .scenario-meta{
    font-family:'Karla', sans-serif; font-variant-numeric:tabular-nums;
    font-size:0.76rem; color:var(--ink-soft);
    display:flex; gap:14px; flex-wrap:wrap; margin-top:14px;
  }
  .participants{display:flex; flex-wrap:wrap; gap:10px; margin-top:20px;}
  .participant{
    display:flex; align-items:center; gap:10px;
    background:var(--band);
    border:1px solid var(--border);
    border-radius:8px;
    padding:8px 12px 8px 8px;
    font-size:0.9rem;
  }
  .avatar{
    width:34px; height:34px; border-radius:50%;
    background:var(--p1); color:var(--on-person);
    display:flex; align-items:center; justify-content:center;
    font-family:'Archivo', 'Karla', sans-serif; font-stretch:112%; font-weight:800; font-size:0.9rem;
    flex-shrink:0;
  }
  .participant b{display:block; line-height:1.2;}
  .participant small{color:var(--ink-soft); display:block; line-height:1.3;}
  .participant small svg{width:14px; height:14px; vertical-align:-2px; stroke:var(--brand-text);}

  /* ---- résultats ---- */
  .results{padding:34px 0 0;}
  .results-grid{display:grid; grid-template-columns:1.05fr 0.95fr; gap:22px; align-items:start;}
  @media (max-width:900px){ .results-grid{grid-template-columns:1fr;} }
  .proposals{display:flex; flex-direction:column; gap:14px;}
  .proposal{
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:8px;
    padding:20px 22px;
    cursor:pointer;
    transition:border-color .15s ease, transform .15s ease, box-shadow .15s ease;
    text-align:left; width:100%;
  }
  .proposal:hover{border-color:var(--brand);}
  .proposal.selected{border-color:var(--brand); border-width:2px;}
  .proposal-head{display:flex; align-items:center; gap:14px;}
  .rank{
    width:34px; height:34px; border-radius:50%; flex-shrink:0;
    /* `--brand-text` et non `--brand` : le numéro est du texte (ADR-102). */
    background:var(--brand-text); color:var(--on-action);
    display:flex; align-items:center; justify-content:center;
    font-family:'Karla', sans-serif; font-variant-numeric:tabular-nums; font-weight:600; font-size:0.9rem;
  }
  .proposal.selected .rank{background:var(--ink); color:var(--bg);}
  .proposal h3{font-size:1.35rem; font-weight:600; line-height:1.15;}
  .proposal .badges{display:flex; flex-wrap:wrap; gap:6px; margin-top:6px;}
  .stats{
    display:grid; grid-template-columns:repeat(4, 1fr); gap:8px;
    margin-top:16px;
  }
  @media (max-width:520px){ .stats{grid-template-columns:repeat(2, 1fr);} }
  .stat{background:var(--band); border-radius:8px; padding:8px 10px;}
  .stat small{display:block; font-family:'Karla', sans-serif; font-variant-numeric:tabular-nums; font-size:0.66rem; letter-spacing:0.08em; color:var(--ink-soft);}
  .stat b{font-family:'Archivo', 'Karla', sans-serif; font-size:1.05rem; font-weight:600;}
  .plans{margin-top:14px; border-top:1px solid var(--border); padding-top:8px; display:none;}
  .proposal.selected .plans{display:block;}
  .plan{display:flex; gap:12px; padding:8px 0; border-bottom:1px dashed var(--border); font-size:0.92rem; align-items:flex-start;}
  .plan:last-child{border-bottom:none;}
  .plan .avatar{width:28px; height:28px; font-size:0.8rem;}
  .plan-body{flex:1; min-width:0;}
  .plan-body b{display:block;}
  .plan-body span{color:var(--ink-soft); font-size:0.88rem; display:block;}
  .plan-time{font-family:'Karla', sans-serif; font-variant-numeric:tabular-nums; font-size:0.86rem; white-space:nowrap; padding-top:2px;}
  .plan-time.longest{color:var(--ink); font-weight:800;}
  .hint{font-size:0.82rem; color:var(--ink-soft); margin-top:10px;}

  .map-col{position:sticky; top:84px;}
  @media (max-width:900px){ .map-col{position:static; order:-1;} }
  #map{
    height:440px; border-radius:8px; border:1px solid var(--border);
    background:var(--band); z-index:0;
  }
  @media (max-width:900px){ #map{height:320px;} }
  .legend{display:flex; gap:16px; flex-wrap:wrap; font-size:0.8rem; color:var(--ink-soft); margin-top:10px;}
  .legend i{display:inline-block; width:10px; height:10px; border-radius:50%; margin-right:6px; vertical-align:-1px;}
  .legend i.o{background:var(--ink);}
  .legend i.d{background:var(--brand);}
  .legend i.l{width:22px; height:0; border-top:2px dashed var(--brand); border-radius:0; vertical-align:2px;}
  .legend i.z{background:var(--brand-soft); border:2px solid var(--brand); width:12px; height:12px;}
  .zone-note{
    display:flex; align-items:flex-start; gap:10px; margin-top:16px;
    padding:10px 14px; border-radius:8px;
    background:var(--brand-soft); color:var(--ink); font-size:0.92rem;
  }
  .zone-note b{color:var(--brand-text);}
  .zone-note svg{width:18px; height:18px; flex:none; margin-top:2px; color:var(--brand-text);}
  .leaflet-container{font-family:'Karla', sans-serif;}
  .origin-label{
    background:var(--surface); color:var(--ink); border:1px solid var(--border);
    border-radius:8px; padding:2px 7px; font-size:0.76rem; font-weight:600;
    box-shadow:none;
  }
  .origin-label::before{display:none;}
  .dest-pin{
    width:30px; height:30px; border-radius:50%;
    background:var(--brand); color:var(--on-action);
    border:3px solid var(--surface);
    display:flex; align-items:center; justify-content:center;
    font-family:'Karla', sans-serif; font-variant-numeric:tabular-nums; font-weight:600; font-size:0.85rem;
  }
  .dest-pin.selected{background:var(--poster); color:var(--on-poster); border:5px solid var(--ring); transform:scale(1.15);}

  /* ---- vote ---- */
  .vote-section{padding:40px 0 20px;}
  .vote-card{
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:8px;
    padding:34px 32px;
    box-shadow:var(--shadow);
    max-width:760px; margin:0 auto;
    text-align:center;
  }
  @media (max-width:600px){ .vote-card{padding:26px 18px;} }
  .vote-card h2{font-size:clamp(1.5rem, 3vw, 2rem); margin-top:8px;}
  .vote-card .why{color:var(--ink-soft); margin-top:10px; max-width:52ch; margin-left:auto; margin-right:auto;}
  .vote-buttons{display:flex; gap:14px; justify-content:center; flex-wrap:wrap; margin-top:24px;}
  .vote-btn{
    border:2px solid var(--border); background:var(--surface);
    border-radius:8px; padding:16px 26px; min-width:180px;
    font-weight:700; font-size:1.05rem; cursor:pointer;
    display:inline-flex; align-items:center; justify-content:center; gap:10px;
    transition:border-color .15s ease, transform .15s ease, background .15s ease;
  }
  .vote-btn svg{width:22px; height:22px;}
  .vote-btn:hover{transform:translateY(-2px);}
  .vote-btn[data-verdict="bien"]:hover, .vote-btn[data-verdict="bien"].chosen{border-color:var(--brand); background:var(--brand-soft); color:var(--brand-text);}
  .vote-btn[data-verdict="pas_bien"]:hover, .vote-btn[data-verdict="pas_bien"].chosen{border-color:var(--brand); background:var(--brand-soft); color:var(--brand-text);}
  .vote-btn:disabled{cursor:default; transform:none; opacity:.6;}
  .vote-btn.chosen:disabled{opacity:1;}
  .vote-more{margin-top:18px; text-align:left; border:1px solid var(--border); border-radius:8px; padding:4px 18px;}
  .vote-more summary{cursor:pointer; padding:12px 0; font-weight:600; font-size:0.95rem; list-style:none; display:flex; justify-content:space-between; align-items:center;}
  .vote-more summary::-webkit-details-marker{display:none;}
  .vote-more summary::after{content:'+'; font-family:'Karla', sans-serif; font-variant-numeric:tabular-nums; color:var(--brand-text); font-size:1.2rem;}
  .vote-more[open] summary::after{content:'−';}
  .vote-more label{display:block; font-size:0.9rem; font-weight:600; margin:8px 0 14px;}
  .vote-more select, .vote-more textarea{
    display:block; width:100%; margin-top:6px;
    font:inherit; font-size:0.95rem; color:var(--ink);
    background:var(--band); border:1px solid var(--border); border-radius:8px;
    padding:10px 12px;
  }
  .vote-more textarea{min-height:84px; resize:vertical;}
  .vote-status{margin-top:18px; font-weight:600; min-height:1.5em;}
  .vote-tally{margin-top:6px; color:var(--ink-soft); font-size:0.92rem;}
  .tally-bar{height:8px; border-radius:8px; background:var(--brand-soft); overflow:hidden; max-width:360px; margin:10px auto 0;}
  .tally-bar i{display:block; height:100%; background:var(--brand); border-radius:8px;}

  /* ---- autres scénarios ---- */
  .all-scenarios{padding:36px 0 30px;}
  .browse-title{font-size:clamp(1.3rem, 2.4vw, 1.7rem); font-weight:600; margin-top:8px;}
  .browse-help{color:var(--ink-soft); font-size:0.95rem; margin-top:6px;}
  .filters{display:flex; flex-wrap:wrap; gap:8px; margin-top:18px;}
  .filter{
    font-size:0.84rem; font-weight:600;
    border:1px solid var(--border); background:transparent; border-radius:8px;
    padding:7px 14px; color:var(--ink-soft); cursor:pointer;
  }
  .filter:hover{border-color:var(--brand); color:var(--ink);}
  .filter[aria-pressed="true"]{background:var(--ink); border-color:var(--ink); color:var(--bg);}
  .chips{display:flex; flex-wrap:wrap; gap:10px; margin-top:16px;}
  .chip{
    text-decoration:none; font-size:0.88rem; font-weight:600;
    border:1px solid var(--border); background:var(--surface); border-radius:8px;
    padding:8px 14px; color:var(--ink-soft);
  }
  .chip:hover{border-color:var(--brand); color:var(--ink);}
  .chip.current{border-color:var(--brand); color:var(--brand-text); background:var(--brand-soft);}

  .state{padding:60px 0; text-align:center; color:var(--ink-soft);}

/* ---- attente d'un calcul : le groupe converge (ADR-184) ---- */
.waiting{padding:24px 0 56px; text-align:center;}
.waiting svg{width:220px; height:220px; display:block; margin:0 auto;}
.waiting line{
  stroke:var(--brand); stroke-width:3; stroke-linecap:round;
  stroke-dasharray:1; stroke-dashoffset:1;
  animation:pousse 3.2s ease-out infinite; animation-delay:var(--d);
}
@keyframes pousse{
  0%{stroke-dashoffset:1; opacity:1;}
  30%{stroke-dashoffset:0;}
  85%{stroke-dashoffset:0; opacity:1;}
  100%{stroke-dashoffset:0; opacity:0;}
}
.waiting .ring{
  fill:none; stroke:var(--ring); stroke-width:7;
  transform-box:fill-box; transform-origin:center;
  animation:respire 3.2s ease-in-out infinite;
}
@keyframes respire{0%,100%{transform:scale(1);} 50%{transform:scale(1.04);}}
.waiting text{
  font:800 13px 'Archivo', sans-serif; font-stretch:112%;
  fill:var(--on-person); text-anchor:middle; dominant-baseline:central;
}
.waiting-title{
  margin-top:18px; font-family:'Archivo', sans-serif; font-stretch:112%;
  font-weight:700; font-size:1.2rem;
}
.waiting-sub{margin-top:4px; font-size:0.9rem; color:var(--ink-soft);}
.waiting .nudge{max-width:46ch; margin:32px auto 0; animation:apparait .6s ease-out;}
.waiting .nudge p{color:var(--ink-soft); margin-top:4px;}
.waiting .nudge .nudge-title{color:var(--ink); font-weight:700;}
.waiting .nudge .btn-secondary{margin-top:6px;}
@keyframes apparait{from{opacity:0;} to{opacity:1;}}
/* Mouvement réduit : image fixe, lignes à mi-chemin. */
@media (prefers-reduced-motion: reduce){
  .waiting line{stroke-dashoffset:0.4;}
}

/* Situer la ville proposée (ADR-189). */
.proposal .where{margin:2px 0 6px; font-size:0.9rem; color:var(--ink-soft);}
