/* ---------- Saisie manuelle de distance ---------- */
.manual-toggle {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 5px;
  margin-top: -5px;
  padding: 5px 2px;
  font-size: 13px; color: var(--muted);
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line);
}
.manual-toggle svg { width: 14px; height: 14px; }
.manual-box {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 4px;
  padding: 11px;
  box-shadow: var(--shadow);
}
.manual-box.featured { border: 2px solid var(--green); box-shadow: 0 0 0 4px rgba(127, 127, 127, 0.12); }
.manual-head { display: flex; justify-content: space-between; align-items: center; }
.manual-opt { font-size: 11px; color: var(--muted); background: var(--chip); padding: 2px 8px; border-radius: 999px; }
.manual-help { margin: 0; font-size: 12px; line-height: 15px; color: var(--muted); }

.stepper { display: grid; grid-template-columns: 54px 1fr 54px; gap: 8px; align-items: stretch; }
.step {
  min-height: 50px; border-radius: 4px;
  background: var(--slate); color: #fff;
  font-family: var(--display); font-size: 22px; font-weight: 600; line-height: 1;
}
.step-val {
  display: flex; align-items: baseline; justify-content: center; gap: 4px;
  border-radius: 4px; background: var(--chip); border: 1.5px solid var(--line);
  padding: 4px 8px;
}
.step-val:focus-within { border-color: var(--green); }
.step-val input {
  width: 100%; min-width: 0;
  border: 0; background: transparent; outline: none;
  text-align: right;
  font-family: var(--display); font-size: 28px; font-weight: 600; line-height: 46px; letter-spacing: -0.02em;
  color: var(--ink);
}
.step-val input::placeholder { color: var(--muted-2); }
.step-val span { font-family: var(--display); font-size: 16px; font-weight: 600; color: var(--muted); flex: none; width: 40%; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; }
.quick button {
  min-height: 40px; padding: 0 11px; border-radius: 4px;
  background: var(--chip); border: 1.5px solid var(--line);
  font-family: var(--display); font-size: 14px; font-weight: 600;
}
.link-btn { min-height: 40px; color: var(--muted); font-weight: 500; }

/* ---------- Espace statistiques ---------- */
.segmented.three { grid-template-columns: repeat(3, 1fr); margin-top: 0; }
#stats-scope { margin-top: 0; }
.stats-body { display: flex; flex-direction: column; gap: 11px; }
.scope-note { margin: 0; font-size: 12px; color: var(--muted); }
.stats-h { font-size: 17px; line-height: 24px; font-weight: 600; letter-spacing: -0.01em; margin-top: 8px; }

.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.stat-tile {
  background: var(--card); border: 1.5px solid var(--line); border-radius: 4px;
  padding: 9px 11px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.viz-card .stat-tile { background: var(--canvas); box-shadow: none; }
.t-label { font-size: 12px; color: var(--muted); line-height: 15px; }
.t-value { font-family: var(--display); font-size: 22px; font-weight: 600; line-height: 33px; letter-spacing: -0.02em; }
.t-value small { font-size: 13px; color: var(--muted); margin-left: 2px; }
.t-sub { font-size: 11px; color: var(--muted); line-height: 14px; }

.viz-card {
  background: var(--card); border: 1.5px solid var(--line); border-radius: 4px;
  padding: 12px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 9px;
}
.viz-card header h3 { margin: 0; font-family: var(--display); font-size: 15px; font-weight: 600; line-height: 21px; }
.viz-card header p { margin: 2px 0 0; font-size: 12px; line-height: 15px; color: var(--muted); }
.viz-card h4 { margin: 5px 0 -4px; font-family: var(--display); font-size: 13px; font-weight: 600; }
.viz-foot { margin: 0; font-size: 11px; color: var(--muted); }
.viz-empty { margin: 0; padding: 14px 9px; text-align: center; color: var(--muted); background: var(--canvas); border-radius: 4px; font-size: 13px; }
.viz-scroll { overflow-x: auto; }

.chart { display: block; width: 100%; height: auto; overflow: visible; stroke: none; fill: none; }
.chart text { font-family: var(--body); stroke: none; }
.chart .tick { font-size: 10px; fill: #677169; font-variant-numeric: tabular-nums; }
.chart .axis-lbl { font-size: 11px; font-weight: 500; fill: #677169; }
.chart .axis-lbl.off { fill: #A8B8AC; }
.chart .axis-val { font-family: var(--display); font-size: 13px; font-weight: 600; fill: #111713; }
.chart .row-lbl { font-family: var(--display); font-size: 12px; font-weight: 600; fill: #111713; }
.chart .row-lbl.small { font-size: 11px; font-weight: 500; fill: #677169; }
.chart .row-val, .chart .cap-val, .chart .end-val { font-family: var(--display); font-size: 12px; font-weight: 600; fill: #111713; }
.chart .hit { fill: transparent; stroke: none; cursor: pointer; outline: none; }
.chart circle.hit.hot, .chart circle.hit:focus-visible { stroke: #111713; stroke-width: 1.5; stroke-opacity: 0.35; }
.chart rect.hit.hot, .chart rect.hit:focus-visible { fill: rgba(0, 0, 0, 0.04); }

.legend { display: flex; flex-wrap: wrap; gap: 5px 12px; font-size: 12px; color: #677169; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.key { display: inline-block; background: var(--c); flex: none; }
.key.dot { width: 9px; height: 9px; border-radius: 50%; }
.key.line { width: 14px; height: 3px; border-radius: 2px; }

.qrows { display: flex; flex-direction: column; gap: 6px; }
.qrow { display: grid; grid-template-columns: 63px 1fr 39px; align-items: center; gap: 8px; }
.qname { font-family: var(--display); font-weight: 600; font-size: 13px; }
.qpct { font-family: var(--display); font-weight: 600; font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; }
.qseg { display: flex; gap: 2px; height: 13px; }
.qseg span { border-radius: 4px; min-width: 4px; cursor: pointer; outline: none; }
.qseg span.hot, .qseg span:focus-visible { filter: brightness(1.12); box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.25); }
.qseg.thin { height: 9px; }

.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -12px; padding: 0 12px 2px; }
.chips::-webkit-scrollbar { display: none; }
.chips button {
  flex: none; min-height: 34px; padding: 0 11px; border-radius: 999px;
  background: var(--chip); border: 1.5px solid var(--line);
  font-family: var(--display); font-weight: 600; font-size: 13px; color: var(--muted);
}
.chips button.on { background: var(--slate); border-color: var(--slate); color: #FFFFFF; }

.table-wrap { overflow-x: auto; margin: 0 -4px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table th, .data-table td { padding: 6px 5px; text-align: right; border-bottom: 1px solid var(--line); }
.data-table thead th { font-family: var(--display); font-size: 10px; font-weight: 600; letter-spacing: 0.06em; color: var(--muted); }
.data-table th[scope="row"], .data-table thead th:first-child { text-align: left; font-family: var(--display); font-weight: 600; }
.data-table tbody tr:last-child th, .data-table tbody tr:last-child td { border-bottom: 0; }

.viz-tip {
  position: fixed; z-index: 60; pointer-events: none;
  display: flex; flex-direction: column; gap: 1px;
  max-width: 240px;
  padding: 6px 9px; border-radius: 4px;
  background: var(--slate); color: #DCE2DC;
  font-size: 11px; line-height: 14px;
  box-shadow: 0 10px 24px -8px rgba(0, 0, 0, 0.5);
}
.viz-tip strong { font-family: var(--display); font-size: 14px; line-height: 19px; color: #fff; }
.small-note { font-size: 12px; line-height: 15px; margin-top: -4px; }
