/* ==========================================================================
   monsport.fr — css/tools.css (lot OUTILS, 2026-10-01) : calculateurs /outils/, quiz
   /quel-sport-pour-moi/, plans /plans-entrainement/. Chargé après style.css (header.php).
   Toutes les classes sont préfixées tl- (jamais ad-, ads-, banner-, sponsored). Mobile-first 360 px.
   ========================================================================== */

/* ---------- Communs ---------- */
.tl-grid-cards, .tl-mini, .tl-plan-list, .tl-reco-list, .tl-sess-list { list-style: none; margin: 0; padding: 0; }
.tl-kicker { margin: 2px 0 0; }
.tl-two { display: grid; gap: 28px; }
@media (min-width: 960px) { .tl-two { grid-template-columns: minmax(0, 1fr) 360px; gap: 48px; align-items: start; } }
.tl-health { margin: 0 0 8px; }
.tl-single .main > * + * { margin-top: 32px; }
.tl-single .main > .section { margin-bottom: 0; }

/* ---------- Carte de l'outil : formulaire + résultat ---------- */
.tl-tool { padding: 18px; }
@media (min-width: 720px) { .tl-tool { padding: 26px; } }
.tl-tool-grid { display: grid; gap: 20px; }
@media (min-width: 900px) { .tl-tool-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 28px; align-items: start; } }
.tl-form-intro { margin: 0; color: var(--ink-2); font-size: .96rem; }
.tl-input { position: relative; }
.tl-input.has-unit .input { padding-right: 76px; }
.tl-unit { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: .86rem; font-weight: 700; color: var(--ink-3); pointer-events: none; }
.input[aria-invalid="true"] { border-color: var(--orange-ink); background: #FFF7F3; }
.tl-seg { max-width: 100%; }
.tl-seg span { padding: 8px 12px; }
@media (min-width: 400px) { .tl-seg span { padding: 8px 16px; } }

.tl-result { min-width: 0; }
.tl-result .rb-value { overflow-wrap: anywhere; }
.tl-rb-sub { margin: 8px 0 0; color: var(--on-dark); font-size: 1rem; }
.tl-rb-sub b { color: var(--volt); }
.tl-result.is-error .rb-value { color: var(--on-dark-2); }
.tl-result.is-error .rb-note { color: #FFD9C9; }
.tl-result .table { font-size: .9rem; }
.tl-result .table th[scope="row"] { font-weight: 600; white-space: nowrap; }
.tl-result .table td:last-child:not(.num) { min-width: 9em; }
.tl-result .table small { color: var(--on-dark-2); font-weight: 400; }
.tl-use-m { display: none; }
@media (max-width: 599px) {
  .tl-tool { padding: 14px; }
  .tl-tool .result-box, .tl-vma-card { padding: 16px; }
  .tl-tool .tl-result { margin: 0 -14px -14px; border-radius: 0 0 var(--r) var(--r); }
  .tl-result .table, .tl-zones .table { font-size: .84rem; }
  .tl-result .table-compact th, .tl-result .table-compact td, .tl-zones .table-compact th, .tl-zones .table-compact td { padding: 7px 8px; }
  .tl-result .table .tl-use { display: none; }
  .tl-use-m { display: block; font-size: .78rem; font-weight: 400; color: var(--on-dark-2); white-space: normal; }
  .tl-result .table th[scope="row"] { white-space: normal; }
  .tl-result .table thead th, .tl-zones .table thead th { white-space: normal; letter-spacing: .04em; }
  .tl-result .table td.num { white-space: normal; }
  .tl-result .table-compact th, .tl-result .table-compact td { padding: 7px 6px; }
}
.tl-row-ref th, .tl-row-ref td { color: var(--volt) !important; font-weight: 700; }

.tl-article { max-width: none; }
.tl-article h2 { margin-top: 0; }

/* ---------- FAQ (stl_faq) ---------- */
.tl-faq { display: grid; gap: 10px; }
.tl-faq-item { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm); }
.tl-faq-item summary {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px;
  font-weight: 700; cursor: pointer; list-style: none;
}
.tl-faq-item summary::-webkit-details-marker { display: none; }
.tl-faq-ico { color: var(--orange-ink); transition: transform .2s var(--ease); }
.tl-faq-item[open] .tl-faq-ico { transform: rotate(45deg); }
.tl-faq-item[open] summary { border-bottom: 1px solid var(--line); }
.tl-faq-a { padding: 12px 16px 2px; color: var(--ink-2); }

/* ---------- Colonne latérale (stl_tool_aside) ---------- */
.tl-mini li + li { border-top: 1px solid var(--line); }
.tl-mini a { display: flex; align-items: center; gap: 10px; padding: 10px 2px; text-decoration: none; font-weight: 600; }
.tl-mini a:hover { color: var(--orange-ink); }
.tl-mini-ico { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--paper-2); flex: none; }
.tl-mini-go { margin-left: auto; color: var(--ink-3); }
.tl-aside-feat { height: auto; }
.tl-card-sm { padding: 18px; }
.tl-card-sm .cf-title { font-size: 1.2rem; }

/* ---------- Quiz ---------- */
.tl-quiz-wrap { max-width: 920px; }
.tl-quiz { display: grid; gap: 18px; }
.tl-q { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
@media (min-width: 720px) { .tl-q { padding: 22px 24px; } }
.tl-q legend { display: flex; align-items: baseline; gap: 10px; float: left; width: 100%; margin-bottom: 14px; font: 700 1.08rem/1.3 var(--f-text); }
.tl-q legend + * { clear: both; }
.tl-q-num { flex: none; font: 800 .95rem/1 var(--f-display); background: var(--volt); color: var(--ink); padding: .3em .5em; border-radius: var(--r-xs); letter-spacing: .04em; }
.tl-q .radio-cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); }
.tl-q.is-missing { border-color: var(--orange-ink); box-shadow: 0 0 0 3px var(--orange-soft); }
.tl-quiz-bar { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px; background: var(--navy); color: var(--on-dark); border-radius: var(--r); box-shadow: var(--sh-3); }
.tl-quiz-bar .btn { --focus: var(--volt); }
.tl-quiz-bar .tl-reset { --fg: var(--on-dark); --bd: rgba(245, 244, 239, .35); }
.tl-quiz-bar .tl-reset:hover { --fg: var(--volt); --bd: var(--volt); }
.tl-progress { flex: 1 1 140px; min-width: 0; }
.tl-progress-txt { margin: 0 0 6px; font-size: .88rem; color: var(--on-dark-2); }
.tl-progress-bar { height: 6px; border-radius: 3px; background: rgba(245, 244, 239, .15); overflow: hidden; }
.tl-progress-bar i { display: block; height: 100%; width: 0; background: var(--volt); transition: width .25s var(--ease); }
.tl-quiz-msg { margin: 0; font-size: .9rem; color: #FFD9C9; flex-basis: 100%; }
.tl-quiz-msg:empty { display: none; }

.tl-quiz-res { scroll-margin-top: calc(var(--hdr-h) + 16px); }
.tl-quiz-res:focus { outline: none; }
.tl-reco-list { display: grid; gap: 16px; }
@media (min-width: 900px) { .tl-reco-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tl-reco { position: relative; display: flex; flex-direction: column; gap: 10px; height: 100%; padding: 20px; background: var(--card);
  border: 1px solid var(--line); border-top: 5px solid var(--fam, var(--orange)); border-radius: var(--r); box-shadow: var(--sh-1); }
.tl-reco-top { display: flex; align-items: center; gap: 12px; }
.tl-reco-rank { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--ink); color: var(--volt); font: 800 1.3rem/1 var(--f-display); }
.tl-reco h3 { margin: 0; font: 800 1.6rem/1 var(--f-display); text-transform: uppercase; overflow-wrap: anywhere; }
.tl-reco-match { margin: 2px 0 0; font-size: .82rem; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; }
.tl-reco-p { margin: 0; color: var(--ink-2); }
.tl-reco-why { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .93rem; }
.tl-reco-why li { display: flex; gap: 8px; align-items: flex-start; }
.tl-reco-why .ico { color: var(--ok); margin-top: .15em; width: 1.1em; height: 1.1em; }
.tl-reco-go { margin-top: auto; display: flex; flex-wrap: wrap; gap: 8px; padding-top: 6px; }
.tl-others { margin-top: 18px; }

/* ---------- Plans ---------- */
.tl-plan-dist + .tl-plan-dist { margin-top: 40px; }
.tl-plan-list { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.tl-plan-card .cf-title { font-size: 1.5rem; }
.tl-plan-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.tl-plan-meta li { font-size: .82rem; font-weight: 600; padding: 3px 9px; border-radius: var(--r-pill); background: var(--paper-2); color: var(--ink-2); }
.tl-lvl { display: inline-flex; gap: 3px; vertical-align: middle; }
.tl-lvl i { width: 7px; height: 14px; border-radius: 2px; background: var(--line-2); }
.tl-lvl i.on { background: var(--orange); }

.tl-plan-top { display: grid; gap: 20px; }
@media (min-width: 900px) { .tl-plan-top { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start; } }
.tl-vma-form { display: grid; gap: 12px; }
.tl-vma-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.tl-vma-row .field { flex: 1 1 160px; }
.tl-zones .table td:last-child { white-space: nowrap; }
.tl-zone-pace { font-weight: 700; font-variant-numeric: tabular-nums; }

.tl-weeks { width: 100%; border-collapse: collapse; }
.tl-weeks thead th { background: var(--ink); color: #fff; font: 700 .76rem/1.2 var(--f-text); text-transform: uppercase; letter-spacing: .08em; text-align: left; padding: 10px 14px; }
.tl-weeks tbody > tr > * { padding: 14px; border-bottom: 1px solid var(--line); vertical-align: top; text-align: left; }
.tl-weeks tbody > tr:last-child > * { border-bottom: 0; }
.tl-week-h { width: 170px; }
.tl-week-n { display: block; font: 800 1.5rem/1 var(--f-display); text-transform: uppercase; }
.tl-week-ph { display: inline-block; margin-top: 6px; font-size: .78rem; font-weight: 700; padding: 3px 8px; border-radius: var(--r-pill); background: var(--paper-2); }
.tl-week-vol { display: block; margin-top: 6px; font-size: .85rem; color: var(--ink-3); font-weight: 500; }
.tl-wk-recup { background: #F3F8FF; } .tl-wk-recup .tl-week-ph { background: #DCEBFF; color: #134B95; }
.tl-wk-taper { background: var(--volt-soft); } .tl-wk-taper .tl-week-ph { background: var(--volt); }
.tl-wk-race { background: var(--orange-soft); } .tl-wk-race .tl-week-ph { background: var(--orange); color: var(--ink); }
.tl-sess-list { display: grid; gap: 10px; counter-reset: sess; }
.tl-sess { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; }
.tl-sess::before { counter-increment: sess; content: counter(sess); grid-row: span 3; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--paper-3); font: 700 .8rem/1 var(--f-text); }
.tl-sess-t { font-weight: 700; }
.tl-sess-t small { font-weight: 600; color: var(--ink-3); margin-left: 4px; }
.tl-sess-q::before { background: var(--ink); color: var(--volt); }
.tl-sess-sl::before { background: var(--fam-eau); color: #fff; }
.tl-sess-race::before { background: var(--orange); color: var(--ink); }
.tl-sess-txt { color: var(--ink-2); font-size: .93rem; }
.tl-pace { font-size: .84rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.tl-pace b { color: var(--orange-ink); }
@media (max-width: 719px) {
  .tl-weeks thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tl-weeks, .tl-weeks tbody, .tl-weeks tr, .tl-weeks tbody > tr > * { display: block; width: 100%; }
  .tl-weeks tbody > tr { border-bottom: 2px solid var(--line-2); }
  .tl-weeks tbody > tr > * { border-bottom: 0; padding: 12px 14px; }
  .tl-weeks .tl-week-h { padding-bottom: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
  .tl-week-ph, .tl-week-vol { margin-top: 0; }
}
.tl-plan-nav { display: grid; gap: 16px; }
@media (min-width: 720px) { .tl-plan-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* 2026-10-01 (retour Tom) : sexe / âge / taille — sélecteur et bloc « facultatif » */
.tl-sex { border: 0; margin: 0; padding: 0; min-width: 0; }
.tl-sex legend { padding: 0; margin-bottom: 6px; font-weight: 700; font-size: .93rem; }
.tl-sex .seg label { position: relative; cursor: pointer; }
.tl-sex .seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.tl-sex .seg span { display: inline-block; border-radius: var(--r-pill); font-weight: 600; }
.tl-sex .seg input:checked + span { background: var(--ink); color: var(--volt); }
.tl-sex .seg input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 1px; }
.tl-optional { display: grid; gap: 14px; padding: 14px 16px; border: 1px dashed var(--line-2); border-radius: var(--r); background: var(--paper); }
.tl-opt-t { margin: 0; font-size: .86rem; font-weight: 700; color: var(--ink-2); }
