:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #17211b;
  background: #eef3ef;
}

.activity-pause-marker { stroke:#9aa59e; stroke-width:1; stroke-dasharray:3 4; pointer-events:none; }

.sport-estimates { display:grid; grid-template-columns:repeat(4, minmax(0, 1fr)); gap:8px; margin:0; }.sport-estimates[hidden] { display:none; }.sport-estimates span { display:grid; gap:3px; padding:9px 10px; border:1px solid #dfe8e0; border-radius:9px; background:#f7faf8; }.sport-estimates strong { color:#17211b; font-size:14px; white-space:nowrap; }.sport-estimates small { color:#69766e; font-size:11px; line-height:1.2; } @media (max-width:600px) { .sport-estimates { grid-template-columns:repeat(2, minmax(0, 1fr)); } }
.sport-discipline-tabs { display:flex; gap:6px; }.sport-discipline-tabs button { border:1px solid #dfe8e0; border-radius:8px; padding:8px 11px; background:#fff; color:#69766e; font:inherit; font-size:13px; font-weight:800; cursor:pointer; }.sport-discipline-tabs button.is-active { border-color:#176b44; background:#eef5f0; color:#176b44; }
.settings-detected-inline { display:flex; align-items:baseline; gap:5px; }.settings-detected-inline small { color:#829087; font-size:11px; font-weight:500; }

#settingsBikePanel .settings-zone-group { margin-top:18px; }
#settingsSportForm[data-sport-discipline="bike"] > .settings-zone-group { display:none !important; }

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { overflow: hidden; }
button { font: inherit; }
.account-dialog { border: 0; border-radius: 18px; padding: 0; width: min(420px, calc(100vw - 32px)); box-shadow: 0 20px 70px rgba(0,0,0,.28); }
.account-dialog::backdrop { background: rgba(20,31,24,.45); }
.account-form { position: relative; display: grid; gap: 14px; padding: 30px; }
.account-form h2 { font-size: 22px; }.account-form p { margin: 0; color: #5d6b62; }
.account-form label { display: grid; gap: 6px; font-size: 13px; font-weight: 700; color: #385042; }
.account-form input { width: 100%; border: 1px solid #cbd9cf; border-radius: 10px; padding: 11px; font: inherit; }
.profile-fields { display: grid; gap: 12px; border: 0; padding: 0; margin: 0; }.profile-fields legend { font-size: 15px; font-weight: 800; color: #17211b; padding: 0; }
.account-menu-wrap { position: relative; align-self: center; justify-self: end; margin-right: 18px; }.account-menu-wrap .topbar-account { margin: 0; }.account-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 3000; width: 210px; padding: 6px; border: 1px solid #dfe8e0; border-radius: 10px; background: #fff; box-shadow: 0 10px 25px rgba(0,0,0,.12); }.account-menu-identity { display:flex; align-items:center; gap:9px; margin: 5px 9px 7px; padding-bottom: 8px; border-bottom: 1px solid #e4ece6; }.account-menu-name { margin: 0; color: #17211b; font-size: 13px; font-weight: 800; }.account-menu-avatar { width:32px; height:32px; border-radius:50%; object-fit:cover; }.avatar-initials { display:inline-grid; place-items:center; flex:none; border-radius:50%; background:#dfe5e1; color:#176b44; font-weight:800; letter-spacing:.04em; }.avatar-initials-small { width:32px; height:32px; font-size:11px; }.avatar-initials-large { width:96px; height:96px; font-size:28px; }.avatar-initials[hidden], .account-menu-avatar[hidden], .settings-avatar-preview[hidden] { display:none; }.account-menu button { display: block; width: 100%; padding: 9px; border: 0; border-radius: 7px; background: transparent; text-align: left; cursor: pointer; }.account-menu button:hover { background: #eef5f0; }#logoutMenuBtn { margin-top: 4px; background: #f7e8e5; color: #8b3026; }#logoutMenuBtn:hover { background: #f1d7d2; }
.settings-card { max-width: 620px; }.settings-form { display: grid; gap: 13px; margin-top: 24px; }.settings-form label { display: grid; gap: 6px; color: #385042; font-size: 13px; font-weight: 700; }.settings-form input { border: 1px solid #cbd9cf; border-radius: 10px; padding: 11px; font: inherit; }.settings-section { margin-top: 34px; padding-top: 24px; border-top: 1px solid #dfe8e0; }.settings-section h2 { margin-bottom: 12px; font-size: 18px; }.settings-section .button { width: auto; }.danger-zone .danger { background: #8b3026; color: #fff; }
.settings-tabs { display:flex; gap:6px; margin-top:22px; padding-bottom:8px; border-bottom:1px solid #dfe8e0; }.settings-tabs button { border:0; border-bottom:2px solid transparent; padding:9px 14px 8px; background:transparent; color:#69766e; font:inherit; font-size:14px; font-weight:800; cursor:pointer; }.settings-tabs button:hover { color:#176b44; }.settings-tabs button.is-active { border-bottom-color:#176b44; color:#176b44; }
.settings-form[hidden], #view-parametres .settings-section[hidden], .settings-apps-panel[hidden] { display:none !important; }
.settings-form small { color:#69766e; font-weight:400; }.settings-avatar-preview { width:96px; height:96px; border-radius:50%; object-fit:cover; border:2px solid #dfe8e0; }
.settings-avatar-row { display:flex; align-items:center; gap:14px; }.delete-avatar-btn { width:auto; border:0; border-radius:8px; padding:7px 10px; background:#f7e8e5; color:#8b3026; font:inherit; font-size:12px; font-weight:700; cursor:pointer; }.delete-avatar-btn:hover { background:#f1d7d2; }
.settings-email-field { display:grid; gap:4px; margin:0 0 14px; padding:10px 12px; border-left:3px solid #176b44; background:#eef5f0; color:#385042; font-size:12px; }.settings-email-field strong { color:#17211b; font-size:14px; overflow-wrap:anywhere; }
.settings-sport-form { margin-top:20px; padding-top:0; border-top:0; }.settings-form-intro { margin:0; color:#69766e; font-size:13px; }.settings-field-grid { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:13px; }.settings-zone-group { display:grid; gap:9px; margin:3px 0 0; padding:14px; border:1px solid #dfe8e0; border-radius:12px; }.settings-zone-group legend { padding:0 5px; color:#17211b; font-size:14px; font-weight:800; }.settings-zone-group small { color:#69766e; font-size:12px; }.settings-zone-grid { display:grid; grid-template-columns:repeat(5, minmax(0, 1fr)); gap:8px; }.settings-zone-grid label { min-width:0; }.settings-zone-grid input { min-width:0; width:100%; box-sizing:border-box; }.settings-sport-form .button { justify-self:start; }
.settings-zone-mode { display:grid; gap:9px; margin:0; padding:14px; border:1px solid #dfe8e0; border-radius:12px; }.settings-zone-mode legend { padding:0 5px; color:#17211b; font-size:14px; font-weight:800; }.settings-zone-mode label { display:flex; align-items:center; gap:8px; cursor:pointer; }.settings-zone-mode input { accent-color:#176b44; }.settings-zone-mode small { color:#69766e; font-size:12px; font-weight:400; }.settings-zone-group input:disabled { color:#385042; border-color:#dfe8e0; background:#f4f7f5; opacity:1; }
.settings-apps-panel { display:grid; gap:12px; margin-top:24px; }.settings-apps-panel h2 { margin:0; font-size:18px; }.settings-apps-panel > p { margin:0 0 4px; color:#69766e; font-size:13px; }.settings-app-card { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:15px; border:1px solid #dfe8e0; border-left:3px solid #176b44; border-radius:10px; background:#fff; }.settings-app-card h3 { margin:0 0 4px; color:#17211b; font-size:15px; }.settings-app-card p { margin:0; color:#69766e; font-size:12px; }.settings-app-card > span { flex:none; color:#176b44; font-size:12px; font-weight:800; }.settings-app-action { display:grid; justify-items:end; gap:7px; }.settings-app-action span { color:#176b44; font-size:12px; font-weight:800; }.settings-app-action .button { width:auto; padding:7px 10px; font-size:12px; }.settings-app-card.is-muted { border-left-color:#cbd9cf; }.settings-app-card.is-muted > span { color:#829087; }
@media (max-width:600px) { .settings-field-grid { grid-template-columns:1fr; }.settings-zone-grid { grid-template-columns:repeat(2, minmax(0, 1fr)); } }
.dialog-actions { display:flex; justify-content:flex-end; gap:8px; }.dialog-actions .button { width:auto; }.dialog-actions .danger { background:#8b3026; color:#fff; }
.delete-reason { display:grid; gap:9px; margin:0; padding:0; border:0; color:#385042; font-size:13px; }.delete-reason legend { margin-bottom:5px; font-weight:800; }.delete-reason label { display:flex; align-items:center; gap:8px; cursor:pointer; }
.account-form .delete-reason input[type="radio"] { width:auto; margin:0; padding:0; accent-color:#176b44; }
.dialog-close { position: absolute; top: 10px; right: 12px; border: 0; background: transparent; font-size: 27px; cursor: pointer; color: #607066; }
.account-error { min-height: 18px; color: #a33329 !important; font-size: 13px; }.settings-success { min-height:18px; margin:0; color:#176b44 !important; font-size:13px; font-weight:700; }.account-mode { border: 0; background: none; color: #176b44; cursor: pointer; text-decoration: underline; }
.route-library { width: min(760px, calc(100vw - 32px)); }.saved-route { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 10px; padding: 12px 0 12px 12px; border-left: 3px solid #176b44; border-top: 1px solid #e1e9e3; text-align: left; }.saved-route-open { display:flex; align-items:center; justify-content:space-between; gap:16px; flex: 1; border: 0; padding: 0; background: transparent; text-align: left; cursor: pointer; color: #17211b; }.saved-route-info { min-width:0; }.saved-route-open strong { color: #17211b; }.saved-route-open:hover { background: transparent; }.saved-route-open:hover strong { color: #176b44; text-decoration: underline; }.saved-route p { font-size: 13px; }.route-thumbnail { width:120px; height:50px; flex:none; }.route-thumbnail polyline { fill:none; stroke:#176b44; stroke-width:2.5; stroke-linecap:round; stroke-linejoin:round; }.delete-route-btn { border: 0; color: #8b3026; background: transparent; padding: 8px 10px; border-radius: 8px; cursor: pointer; }.delete-route-btn:hover { background: #f7e8e5; }

.route-thumbnail { margin-right: 60px; border: 0; border-radius: 0; }
.saved-route { align-items: stretch; }.saved-route-open { align-self: stretch; }.route-thumbnail { height: auto; min-height: 50px; align-self: stretch; }.delete-route-btn { align-self: center; }
.saved-route { padding-top: 0; padding-bottom: 0; }.saved-route-open { min-height: 74px; }.saved-route-info { padding: 12px 0; }.route-thumbnail { min-height: 74px; height: 100%; border-radius: 0; }
.saved-route-actions { display:grid; gap:4px; align-self:center; }.export-route-btn { border:0; border-radius:8px; padding:7px 10px; background:#e9f2ec; color:#176b44; font:inherit; font-size:12px; font-weight:700; cursor:pointer; white-space:nowrap; }.export-route-btn:hover { background:#d9eadf; }
.saved-route-actions .delete-route-btn { font-size:12px; font-weight:700; }
.activity-library-title { display:flex; align-items:baseline; justify-content:space-between; gap:18px; }.activity-library-title h1 { margin:0; }.activity-import-bar { display:flex; gap:12px; flex:none; }.activity-import-link { border:0; padding:0; background:transparent; color:#829087; font:inherit; font-size:13px; text-decoration:underline; text-underline-offset:3px; cursor:pointer; white-space:nowrap; }.activity-import-link:hover { color:#176b44; }.activity-row { cursor:default; }.activity-row .route-thumbnail { margin-right:60px; }.activity-row small { color:#69766e; font-size:12px; }
.activity-details-dialog { width:min(800px, calc(100vw - 32px)); }.activity-details-form { min-width:0; gap:16px; }.activity-details-form h2 { margin:0; padding-right:60px; }.activity-details-actions { position:absolute; top:13px; right:43px; z-index:2; }.activity-menu-btn { width:30px; height:30px; border:0; border-radius:8px; background:transparent; color:#607066; font-size:23px; line-height:20px; cursor:pointer; }.activity-menu-btn:hover { background:#eef5f0; color:#176b44; }.activity-menu { position:absolute; right:0; top:34px; width:190px; padding:5px; border:1px solid #dfe8e0; border-radius:10px; background:#fff; box-shadow:0 10px 25px rgba(0,0,0,.14); }.activity-menu button { width:100%; padding:9px; border:0; border-radius:7px; background:transparent; color:#385042; text-align:left; cursor:pointer; }.activity-menu button:hover { background:#eef5f0; }.activity-menu .activity-menu-danger { color:#8b3026; }.activity-menu .activity-menu-danger:hover { background:#f7e8e5; }.activity-details-stats { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:10px; margin:0; }.activity-details-stats div { padding:11px 12px; border-radius:10px; background:#eef5f0; }.activity-details-stats dt { color:#66746c; font-size:12px; }.activity-details-stats dd { margin:3px 0 0; color:#17211b; font-weight:800; }.activity-details-map { height:360px; border:1px solid #dfe8e0; border-radius:12px; overflow:hidden; background:#eef3ef; }
.activity-splits { min-width:0; max-width:100%; }.activity-splits h3 { margin:0 0 12px; font-size:16px; }.activity-splits-chart { min-width:0; max-width:100%; border-bottom:1px solid #dfe8e0; }.activity-splits-scroll { width:100%; max-width:100%; min-width:0; overflow-x:auto; }.activity-splits-track { position:relative; display:grid; grid-template-columns:repeat(var(--chart-columns, 20), minmax(32px, 1fr)); gap:5px; width:var(--chart-width, 100%); min-height:182px; padding:8px 4px 0; }.activity-average-line { position:absolute; z-index:1; top:0; right:0; left:0; height:1px; background:#c43a31; pointer-events:none; }.activity-split-column { position:relative; z-index:2; display:grid; grid-template-rows:20px 134px 22px; align-items:end; justify-items:center; min-width:0; }.activity-split-value { transform:translateY(-7px); color:#5c6b62; font-size:10px; white-space:nowrap; }.activity-split-tooltip { display:none; position:absolute; z-index:3; top:max(0px, calc(8px + 20px + 134px - var(--bar-height) - 29px)); padding:4px 6px; border-radius:6px; background:#17211b; color:#fff; font-size:10px; font-weight:700; white-space:nowrap; box-shadow:0 3px 10px rgba(0,0,0,.18); }.activity-split-column:hover .activity-split-tooltip { display:block; }.activity-split-bar { width:min(26px, 78%); align-self:end; border-radius:7px 7px 2px 2px; background:#176b44; }.activity-split-label { align-self:start; padding-top:5px; color:#536159; font-size:12px; font-weight:700; }
.activity-elevation { min-width:0; max-width:100%; }.activity-elevation h3 { margin:0 0 10px; font-size:16px; }.activity-elevation-scroll { width:100%; max-width:100%; min-width:0; overflow-x:auto; }.activity-elevation-chart { min-width:0; min-height:170px; color:#69766e; font-size:13px; }.activity-elevation-chart svg { display:block; max-width:100%; }.activity-elevation-chart text { fill:#69766e; font-size:10px; }.activity-elevation-chart polygon { fill:rgba(23,107,68,.14); }.activity-elevation-chart polyline { fill:none; stroke:#176b44; stroke-width:2.5; stroke-linecap:round; stroke-linejoin:round; }.activity-elevation-chart #activityElevationHoverLine { stroke:#176b44; stroke-width:1; stroke-dasharray:3 3; }.activity-elevation-chart #activityElevationHoverDot { fill:#176b44; stroke:#fff; stroke-width:2; }.activity-elevation-chart #activityElevationHoverBox, .activity-elevation-chart #activityElevationHoverDistanceBox { fill:#17211b; }.activity-elevation-chart #activityElevationHoverText, .activity-elevation-chart #activityElevationHoverDistanceText { fill:#fff; font-size:11px; font-weight:750; }
.activity-metric-charts { min-width:0; max-width:100%; display:grid; gap:18px; }.activity-metric-chart { min-width:0; }.activity-metric-heading { display:flex; justify-content:flex-start; align-items:baseline; gap:12px; margin-bottom:8px; }.activity-metric-heading h3 { margin:0; font-size:16px; }.activity-metric-heading span { color:#69766e; font-size:12px; white-space:nowrap; }.activity-metric-svg { min-width:320px; }.activity-metric-svg svg { display:block; }.activity-metric-svg text { fill:#69766e; font-size:10px; }.activity-metric-svg polyline { fill:none; stroke:#176b44; stroke-width:2.5; stroke-linecap:round; stroke-linejoin:round; }.activity-metric-average-line { display:none; stroke:#c43a31; stroke-width:1; stroke-dasharray:4 4; }.activity-metric-hover-line { stroke:#176b44; stroke-width:1; stroke-dasharray:3 3; }.activity-metric-hover-dot { fill:#176b44; stroke:#fff; stroke-width:2; }.activity-metric-hover-box { fill:#17211b; }.activity-metric-hover-text { fill:#fff !important; font-size:11px !important; font-weight:750; }
.activity-splits, .activity-pace-chart, .activity-elevation, .activity-metric-chart { padding:14px; border:1px solid #dfe8e0; border-radius:12px; background:#fff; }.activity-splits-chart { border-bottom:0; }.activity-metric-svg svg { width:100%; height:170px; }
.activity-splits-track, .activity-elevation-chart, .activity-metric-svg { box-sizing:border-box; }
.activity-splits-scroll, .activity-elevation-scroll { overflow:hidden; }
.activity-chart-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:10px; }.activity-chart-heading h3 { margin:0; font-size:16px; }.activity-chart-expand-btn { width:26px; height:26px; border:0; border-radius:7px; background:transparent; color:#66746c; font-size:19px; line-height:1; cursor:pointer; }.activity-chart-expand-btn:hover { color:#176b44; background:#eef5f0; }
.activity-splits-chart { border:0; }.activity-splits-scroll { max-height:336px; overflow-y:auto; padding-right:4px; }.activity-splits-track { position:relative; display:grid; grid-template-columns:1fr; gap:4px; width:100%; min-height:0; padding:0; }.activity-average-line { display:block; position:absolute; z-index:20; top:0; right:auto; bottom:0; width:2px; height:auto; border:0; background:repeating-linear-gradient(to bottom, #c43a31 0 6px, transparent 6px 10px); pointer-events:none; }.activity-split-column { display:grid; grid-template-columns:34px 48px minmax(0,1fr) 84px 58px; grid-template-rows:30px; gap:8px; align-items:center; justify-items:stretch; min-height:30px; }.activity-split-label { grid-column:1; grid-row:1; padding:0; align-self:center; color:#536159; font-size:12px; text-align:right; }.activity-split-value { grid-column:2; grid-row:1; transform:none; align-self:center; color:#5c6b62; font-size:11px; text-align:right; }.activity-split-duration { grid-column:4; grid-row:1; align-self:center; color:#69766e; font-size:10px; text-align:right; white-space:nowrap; font-variant-numeric:tabular-nums; }.activity-split-heart-rate { grid-column:5; grid-row:1; align-self:center; color:#69766e; font-size:10px; text-align:right; white-space:nowrap; }.activity-split-bar { grid-column:3; grid-row:1; align-self:center; width:var(--bar-width); height:14px !important; border-radius:3px; position:relative; }.activity-split-tooltip { top:50%; left:94px; transform:translateY(-50%); }
.activity-metric-heading { position:relative; padding-right:32px; }.activity-metric-heading .activity-chart-expand-btn { position:absolute; top:-4px; right:0; }.activity-chart-dialog { width:min(1120px, calc(100vw - 32px)); max-width:none; height:min(760px, calc(100vh - 32px)); }.activity-chart-dialog-form { min-height:100%; box-sizing:border-box; }.activity-chart-dialog-content > .activity-splits, .activity-chart-dialog-content > .activity-pace-chart, .activity-chart-dialog-content > .activity-elevation, .activity-chart-dialog-content > .activity-metric-chart { min-height:0; padding:0; border:0; box-shadow:none; }.activity-chart-dialog-content .activity-splits-scroll { max-height:calc(100vh - 150px); }.activity-chart-dialog-content .activity-elevation-chart, .activity-chart-dialog-content .activity-metric-svg { width:100% !important; }.activity-chart-dialog-content .activity-elevation-chart svg, .activity-chart-dialog-content .activity-metric-svg svg { height:560px; }.activity-chart-dialog-content .activity-metric-average-line { display:block; }.activity-chart-dialog-content .activity-chart-expand-btn { display:none; }
@media (max-width: 600px) { .activity-library-title { align-items:flex-start; flex-direction:column; gap:8px; } .activity-row .route-thumbnail { margin-right:0; } }
@media (max-width: 600px) { .activity-details-stats { grid-template-columns:1fr; }.activity-details-map { height:280px; } }

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

.sidebar {
  padding: 24px;
  background: #fbfdfb;
  border-right: 1px solid #dfe8e0;
  overflow-y: auto;
  z-index: 1000;
}

.brand { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.brand-mark {
  width: 50px; height: 50px; border-radius: 15px;
  display: grid; place-items: center;
  background: #176b44; color: white; font-weight: 800; letter-spacing: .04em;
}
h1 { margin: 0; font-size: 22px; }
.brand p { margin: 4px 0 0; color: #69766e; font-size: 14px; }
h2 { margin: 0; font-size: 15px; }

.toolbar { display: grid; gap: 8px; margin-bottom: 16px; }
.button {
  width: 100%; border: 0; border-radius: 12px; padding: 11px 13px;
  cursor: pointer; font-weight: 700; transition: transform .12s ease, opacity .12s ease, background .12s ease;
}
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { opacity: .42; cursor: not-allowed; }
.button.primary { background: #176b44; color: #fff; }
.button.import { background: #17211b; color: #fff; }
.button.secondary { background: #e9f2ec; color: #244d38; }
.button.danger { background: #f7e8e5; color: #8b3026; }
.button.loop { background: #edf2ff; color: #284f9e; }
.button.loop.active { background: #284f9e; color: white; }
.export { margin-top: 18px; }

.stats-card {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  background: #eef5f0; border-radius: 16px; padding: 15px; margin-bottom: 16px;
}
.stats-card > div { display: flex; flex-direction: column; gap: 4px; }
.stat-label { font-size: 12px; color: #718078; text-transform: uppercase; letter-spacing: .06em; }
.stats-card strong { font-size: 20px; }

.elevation-card {
  border: 1px solid #e1e9e3;
  border-radius: 16px;
  padding: 14px;
  background: white;
  margin-bottom: 22px;
}
.elevation-chart {
  margin-top: 10px;
  min-height: 280px;
  height: 280px;
  border-radius: 10px;
  overflow: hidden;
  background: #f7faf8;
  display: grid;
  place-items: center;
}
.elevation-chart svg { display: block; width: 100%; height: 100%; }
.grid-line { stroke: #dfe8e1; stroke-width: 1; }
.axis-label { fill: #748179; font-size: 12px; }
.elevation-area { fill: rgba(23, 107, 68, .13); }
.elevation-line { fill: none; stroke: #176b44; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.elevation-legend { display: flex; justify-content: space-between; color: #718078; font-size: 11px; margin-top: 7px; }

.instructions { margin-bottom: 22px; }
.instructions ol { margin: 10px 0 0; padding-left: 20px; color: #5d6b62; font-size: 13px; line-height: 1.55; }

.panel-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.status { font-size: 12px; color: #6b776f; background: #eef1ee; padding: 5px 8px; border-radius: 999px; }
.status.loading { color: #7a5d11; background: #fff4c7; }
.status.error { color: #8b3026; background: #f9e5e2; }

.waypoint-list { display: grid; gap: 8px; }
.waypoint-item {
  display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center;
  padding: 10px; border: 1px solid #e1e9e3; border-radius: 12px; background: white;
}
.waypoint-index {
  width: 28px; height: 28px; border-radius: 50%; background: #176b44; color: white;
  display: grid; place-items: center; font-weight: 800; font-size: 12px;
}
.waypoint-coords { font-size: 12px; color: #69766e; }
.icon-button { border: 0; background: transparent; color: #8b3026; cursor: pointer; font-size: 18px; }
.empty-state { color: #819087; font-size: 13px; margin: 4px 0; padding: 10px; text-align: center; }
.fine-print { color: #87938c; font-size: 11px; line-height: 1.45; margin: 14px 0 0; }

.map-wrap { position: relative; min-width: 0; }
#map { width: 100%; height: 100%; background: #dce7de; }
.map-tip {
  position: absolute; left: 50%; top: 18px; transform: translateX(-50%); z-index: 500;
  background: rgba(18, 29, 22, .88); color: white; padding: 9px 13px; border-radius: 999px;
  font-size: 13px; pointer-events: none; box-shadow: 0 5px 20px rgba(0,0,0,.13);
}

.custom-marker { background: transparent; border: none; }
.custom-marker div {
  width: 28px; height: 28px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg);
  background: #176b44; border: 3px solid white; box-shadow: 0 2px 8px rgba(0,0,0,.28);
}
.custom-marker span {
  position: absolute; inset: 0; display: grid; place-items: center; color: white; font-size: 11px;
  font-weight: 800; transform: translateY(-1px);
}

@media (max-width: 760px) {
  body { overflow: auto; }
  .app-shell { grid-template-columns: 1fr; grid-template-rows: auto 70vh; height: auto; }
  .sidebar { border-right: 0; border-bottom: 1px solid #dfe8e0; }
}

.elevation-hit-area { cursor: crosshair; touch-action: none; }
.elevation-hover-line { stroke: #17211b; stroke-width: 1.5; stroke-dasharray: 4 4; opacity: .65; }
.elevation-hover-dot { fill: #176b44; stroke: #fff; stroke-width: 2.5; }
.elevation-hover-box { fill: rgba(23, 33, 27, .92); }
.elevation-hover-text { fill: #fff; font-size: 11px; font-weight: 700; }


.place-search { margin-bottom: 14px; position: relative; }
.search-row { display: grid; grid-template-columns: 1fr 44px; gap: 7px; }
.search-row input { width: 100%; min-width: 0; border: 1px solid #d8e2da; border-radius: 12px; padding: 11px 12px; background: #fff; color: #17211b; font: inherit; outline: none; }
.search-row input:focus { border-color: #176b44; box-shadow: 0 0 0 3px rgba(23,107,68,.10); }
.search-button { border: 0; border-radius: 12px; background: #e9f2ec; color: #176b44; font-size: 23px; cursor: pointer; }
.search-results { margin-top: 7px; border: 1px solid #dfe8e0; border-radius: 12px; background: #fff; overflow: hidden; box-shadow: 0 8px 22px rgba(20,40,28,.10); }
.search-result { display: block; width: 100%; border: 0; border-bottom: 1px solid #edf1ee; background: #fff; padding: 9px 11px; text-align: left; cursor: pointer; color: #253129; font: inherit; font-size: 12px; line-height: 1.35; }
.search-result:last-child { border-bottom: 0; }
.search-result:hover { background: #f0f6f2; }
.search-message { padding: 9px 11px; color: #718078; font-size: 12px; }
.custom-marker.marker-label { width: auto !important; height: 34px !important; }
.custom-marker.marker-label div { display: none; }
.custom-marker.marker-label span { position: relative; inset: auto; display: block; transform: none; white-space: nowrap; background: #176b44; color: #fff; border: 3px solid #fff; border-radius: 999px; padding: 5px 9px; font-size: 11px; font-weight: 800; box-shadow: 0 2px 8px rgba(0,0,0,.28); }
.elevation-hit-area { cursor: pointer; }

/* Points de passage superposés au profil altimétrique */
.elevation-waypoint-line { stroke: rgba(40, 79, 158, .28); stroke-width: 1; stroke-dasharray: 2 3; }
.elevation-waypoint-dot { fill: #284f9e; stroke: #fff; stroke-width: 2; }
.elevation-waypoint-label { fill: #284f9e; font-size: 10px; font-weight: 800; paint-order: stroke; stroke: #fff; stroke-width: 3px; stroke-linejoin: round; }


/* Profil altimétrique grand format */
.elevation-heading-actions { display: flex; align-items: center; gap: 8px; }
.elevation-expand-btn {
  border: 1px solid #d7e2da; background: #f4f8f5; color: #244d38;
  border-radius: 9px; padding: 5px 8px; font: inherit; font-size: 11px;
  font-weight: 700; cursor: pointer; white-space: nowrap;
}
.elevation-expand-btn:hover { background: #e9f2ec; }
.elevation-card.expanded {
  position: fixed; z-index: 1800; left: 390px; right: 24px; bottom: 24px;
  margin: 0; padding: 18px; box-shadow: 0 18px 60px rgba(15, 35, 22, .28);
  border-color: #cfdcd2;
}
.elevation-card.expanded .elevation-chart { height: 200px; min-height: 200px; }
.elevation-card.expanded .elevation-legend { font-size: 12px; }
@media (max-width: 760px) {
  .elevation-chart { height: 230px; min-height: 230px; }
  .elevation-card.expanded { left: 12px; right: 12px; bottom: 12px; top: 12px; overflow: auto; }
  .elevation-card.expanded .elevation-chart { height: 200px; min-height: 200px; }
}

.details-toggle {
  display: inline-flex;
  align-items: center;
  margin-top: .4rem;
  padding: .35rem .65rem;
  border: 1px solid rgba(127,127,127,.35);
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: .9rem;
  cursor: pointer;
}
.details-toggle:hover { background: rgba(127,127,127,.08); }
.details-content[hidden] { display: none !important; }
.details-content { margin-top: .65rem; }


/* Mode Route / Point à point */
.routing-mode-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #dfe8e0;
  border-radius: 12px;
  background: #fff;
}
.routing-mode-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.routing-mode-copy strong { font-size: 13px; }
.routing-mode-copy span { font-size: 11px; color: #718078; }

.ios-switch {
  position: relative;
  width: 48px;
  height: 28px;
  flex: 0 0 auto;
  cursor: pointer;
}
.ios-switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.ios-switch-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #c9d1cc;
  transition: background .18s ease;
}
.ios-switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.24);
  transition: transform .18s ease;
}
.ios-switch input:checked + .ios-switch-track { background: #176b44; }
.ios-switch input:checked + .ios-switch-track::after { transform: translateX(20px); }
.ios-switch input:focus-visible + .ios-switch-track {
  outline: 3px solid rgba(23,107,68,.20);
  outline-offset: 2px;
}

/* Étapes repliables */
.waypoints-heading { gap: 10px; }
.waypoints-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  padding: 3px 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.waypoints-chevron {
  display: inline-block;
  font-size: 20px;
  line-height: 1;
  transform: translateY(-1px);
}
.waypoint-list[hidden] { display: none !important; }


/* Sélecteur de fond de carte, en haut à droite de la carte */
.map-view-leaflet-control {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 10px;
  padding: 7px 9px;
  border-radius: 9px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 1px 5px rgba(0, 0, 0, .24);
  backdrop-filter: blur(4px);
}
.map-view-leaflet-control label {
  font-size: 12px;
  font-weight: 800;
  color: #33423a;
}
.map-view-leaflet-control select {
  border: 1px solid #cbd5ce;
  border-radius: 7px;
  background: #fff;
  padding: 5px 7px;
  font: inherit;
  font-size: 12px;
  color: #26332c;
  cursor: pointer;
}



/* Sélecteur Route / Trail / Point à point */
.routing-mode-three {
  align-items: center;
}
.routing-mode-three .routing-mode-copy {
  flex: 0 0 auto;
}
.routing-segmented {
  display: inline-flex;
  align-items: stretch;
  gap: 3px;
  padding: 3px;
  border-radius: 11px;
  background: #edf1ee;
  min-width: 0;
}
.routing-mode-btn {
  border: 0;
  border-radius: 8px;
  background: transparent;
  padding: 7px 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  color: #56635b;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.routing-mode-btn:hover {
  background: rgba(255,255,255,.65);
}
.routing-mode-btn.active,
.routing-mode-btn[aria-pressed="true"] {
  background: #fff;
  color: #176b44;
  box-shadow: 0 1px 4px rgba(0,0,0,.13);
}
.routing-mode-btn:focus-visible {
  outline: 3px solid rgba(23,107,68,.20);
  outline-offset: 1px;
}
@media (max-width: 760px) {
  .routing-mode-three {
    align-items: stretch;
    flex-direction: column;
  }
  .routing-segmented {
    width: 100%;
  }
  .routing-mode-btn {
    flex: 1 1 0;
    padding-left: 5px;
    padding-right: 5px;
  }
}


/* Trois modes de déplacement */
.routing-mode-three .routing-segmented {
  flex-wrap: nowrap;
}
@media (max-width: 900px) {
  .routing-mode-three {
    align-items: stretch;
    flex-direction: column;
  }
  .routing-mode-three .routing-segmented {
    width: 100%;
  }
  .routing-mode-three .routing-mode-btn {
    flex: 1 1 0;
  }
}


/* Bloc Tracé : libellé en haut, sélecteur pleine largeur en dessous */
.routing-mode-control.routing-mode-three {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.routing-mode-copy-full {
  min-width: 0;
}

.routing-mode-copy-full strong,
.routing-mode-copy-full span {
  display: block;
}

.routing-mode-three .routing-segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  gap: 3px;
}

.routing-mode-three .routing-mode-btn {
  min-width: 0;
  width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.15;
  text-align: center;
  padding: 8px 6px;
}

@media (max-width: 520px) {
  .routing-mode-three .routing-mode-btn {
    font-size: 11px;
    padding-left: 4px;
    padding-right: 4px;
  }
}

@media (max-width: 360px) {
  .routing-mode-three .routing-segmented {
    grid-template-columns: 1fr;
  }

  .routing-mode-three .routing-mode-btn {
    min-height: 40px;
  }
}


/* Indicateur de calcul d'itinéraire */
.route-loading-indicator {
  position: absolute;
  left: 50%;
  top: 14px;
  transform: translateX(-50%);
  z-index: 900;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  max-width: calc(100% - 28px);
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: #1f2a24;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.16);
  pointer-events: none;
  box-sizing: border-box;
}

.route-loading-indicator[hidden] {
  display: none !important;
}

.route-loading-spinner {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  border: 2px solid rgba(23, 107, 68, 0.22);
  border-top-color: #176b44;
  border-radius: 50%;
  animation: route-loading-spin 0.8s linear infinite;
}

@keyframes route-loading-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .route-loading-spinner {
    animation: none;
    border-top-color: #176b44;
  }
}

@media (max-width: 520px) {
  .route-loading-indicator {
    top: 10px;
    font-size: 12px;
    padding: 9px 12px;
  }
}

/* Sélecteur 4 modes : 2 × 2 */
.routing-mode-three .routing-segmented { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.routing-mode-three .routing-mode-btn { min-height: 42px; }
@media (max-width: 360px) { .routing-mode-three .routing-segmented { grid-template-columns: repeat(2, minmax(0, 1fr)); } }


/* Alerte de compatibilité du mode, toujours visible près du titre Tracé */
.routing-mode-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.routing-mode-warning {
  font-size: 11px;
  line-height: 1.2;
  font-weight: 700;
  color: #8b3026;
  background: #f9e5e2;
  border-radius: 999px;
  padding: 4px 7px;
}

.routing-mode-warning[hidden] {
  display: none !important;
}

/* Bandeau EXTRALE — structure de navigation uniquement, sans modifier les outils existants */
.topbar {
  height: 64px;
  display: grid;
  grid-template-columns: 365px 1fr auto;
  align-items: stretch;
  background: #fbfdfb;
  border-bottom: 1px solid #dfe8e0;
  position: relative;
  z-index: 1600;
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 24px;
  color: #17211b;
  text-decoration: none;
  border-right: 1px solid #dfe8e0;
}
.topbar-logo {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: #176b44;
}
.topbar-logo svg { width: 27px; height: 21px; }
.topbar-logo path {
  fill: none;
  stroke: #fff;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.topbar-wordmark {
  font-size: 20px;
  font-weight: 850;
  letter-spacing: .075em;
}
.topbar-nav {
  display: flex;
  align-items: stretch;
  padding-left: 18px;
}
.topbar-nav-item {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 750;
  color: #176b44;
}
.topbar-nav-item.active::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: #176b44;
}
.topbar-tagline {
  display: flex;
  align-items: center;
  padding: 0 24px;
  color: #718078;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}
.app-shell { height: calc(100vh - 64px); }

@media (max-width: 760px) {
  .topbar {
    height: 58px;
    grid-template-columns: auto 1fr;
  }
  .topbar-brand {
    padding: 0 14px;
    border-right: 0;
  }
  .topbar-logo { width: 32px; height: 32px; border-radius: 10px; }
  .topbar-wordmark { font-size: 17px; }
  .topbar-nav { justify-content: flex-end; padding-left: 0; padding-right: 8px; }
  .topbar-nav-item { padding: 0 9px; font-size: 13px; }
  .topbar-nav-item.active::after { left: 9px; right: 9px; }
  .topbar-tagline { display: none; }
  .app-shell { height: auto; }
}

/* Navigation principale EXTRALE */
.topbar { grid-template-columns: 365px minmax(0, 1fr) auto; }
.topbar-brand-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.topbar-slogan { color: #718078; font-size: 11px; font-weight: 650; letter-spacing: 0; white-space: nowrap; }
.topbar-nav { min-width: 0; justify-content: flex-start; padding-left: 8px; }
.topbar-nav-item { border: 0; background: transparent; cursor: pointer; color: #536159; white-space: nowrap; }
.topbar-nav-item:hover { color: #176b44; background: #f3f8f4; }
.topbar-nav-item.active { color: #176b44; }
.topbar-account {
  align-self: center; margin: 0 18px 0 10px; border: 1px solid #176b44; border-radius: 10px;
  background: #176b44; color: #fff; padding: 9px 13px; font: inherit; font-size: 13px;
  font-weight: 750; cursor: pointer; white-space: nowrap;
}
.simple-view { height: calc(100vh - 64px); background: #eef3ef; padding: 48px; overflow: auto; }
.simple-view-card { max-width: 760px; margin: 50px auto; padding: 36px; border: 1px solid #dfe8e0; border-radius: 18px; background: #fbfdfb; }
.simple-view-card h1 { font-size: 28px; margin-bottom: 10px; }
.simple-view-card p { color: #69766e; margin: 0; }
.app-view[hidden] { display: none !important; }
@media (max-width: 1100px) {
  .topbar { grid-template-columns: 280px minmax(0, 1fr) auto; }
  .topbar-brand { padding: 0 14px; }
  .topbar-nav-item { padding: 0 9px; font-size: 12px; }
  .topbar-nav-item.active::after { left: 9px; right: 9px; }
  .topbar-account { margin-right: 10px; padding: 8px 10px; font-size: 12px; }
}
@media (max-width: 760px) {
  .topbar { height: auto; min-height: 58px; grid-template-columns: 1fr auto; grid-template-rows: 58px auto; }
  .topbar-brand { grid-column: 1; grid-row: 1; }
  .topbar-slogan { font-size: 9px; }
  .topbar-account { grid-column: 2; grid-row: 1; margin: 0 10px 0 4px; }
  .account-menu-wrap { grid-column: 2; grid-row: 1; margin-right: 10px; }
  .account-menu-wrap .topbar-account { margin: 0; }
  .topbar-nav { grid-column: 1 / -1; grid-row: 2; overflow-x: auto; justify-content: flex-start; border-top: 1px solid #edf1ee; padding: 0 8px; }
  .topbar-nav-item { min-height: 44px; }
  .simple-view { height: auto; min-height: 70vh; padding: 20px; }
  .simple-view-card { margin: 20px auto; padding: 24px; }
}
/* Génération automatique : complément minimal.
   La structure reprend les classes existantes de Créer / Modifier. */
#view-generation #generationMap { position:absolute; inset:0; }
#view-generation .map-wrap { position:relative; }
#view-generation #generationDistance { width:100%; box-sizing:border-box; padding:10px 12px; border:1px solid #d9dee5; border-radius:8px; background:#fff; }
#view-generation #generationResults .button { width:100%; text-align:left; }

#view-generation .generation-distance-row { display:grid; gap:8px; }
#view-generation #generationCustomDistanceWrap { display:flex; align-items:center; gap:8px; }
#view-generation #generationCustomDistance { width:100%; box-sizing:border-box; padding:10px 12px; border:1px solid #d9dee5; border-radius:8px; background:#fff; }


/* === Génération automatique — même langage visuel que Créer / Modifier === */
#view-generation #generationMap { width:100%; height:100%; background:#dce7de; }
.generation-distance-control { display:grid; gap:8px; }
.generation-distance-presets { display:grid; grid-template-columns:repeat(7,1fr); gap:5px; }
.generation-distance-btn {
  border:1px solid #d7e1da; background:#fff; color:#244d38; border-radius:9px;
  padding:8px 2px; font-weight:800; cursor:pointer;
}
.generation-distance-btn:hover, .generation-distance-btn.active {
  background:#176b44; color:#fff; border-color:#176b44;
}
.generation-distance-input-row { display:flex; align-items:center; gap:8px; }
#generationDistanceInput {
  width:100%; box-sizing:border-box; border:1px solid #d7e1da; border-radius:10px;
  padding:10px 12px; font:inherit; font-weight:700; background:#fff;
}
.generation-actions { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:12px; }
.generation-proposal-bar {
  position:absolute; z-index:520; left:50%; bottom:22px; transform:translateX(-50%);
  display:flex; gap:8px; padding:8px; border-radius:14px;
  background:rgba(255,255,255,.94); box-shadow:0 5px 22px rgba(0,0,0,.16);
  backdrop-filter:blur(5px);
}
.generation-proposal-btn {
  border:1px solid #d8e2da; border-radius:10px; background:#fff; color:#244d38;
  padding:10px 16px; font-weight:800; cursor:pointer; white-space:nowrap;
}
.generation-proposal-btn:disabled { opacity:.42; cursor:default; }
.generation-proposal-btn.active { background:#176b44; color:#fff; border-color:#176b44; }
.generation-profile-hover-label { font-size:11px; fill:#26352c; }
@media (max-width:760px) {
  .generation-distance-presets { grid-template-columns:repeat(4,1fr); }
  .generation-proposal-bar { bottom:12px; max-width:calc(100% - 20px); overflow-x:auto; }
}


/* === Correctifs UI génération === */
#view-generation .generation-distance-line {
  display:flex;
  align-items:center;
  gap:5px;
  width:100%;
  flex-wrap:nowrap;
}
#view-generation .generation-distance-line .generation-distance-btn {
  flex:0 0 31px;
  width:31px;
  min-width:31px;
  height:34px;
  padding:0;
}
#view-generation .generation-distance-line #generationDistanceInput {
  flex:1 1 54px;
  min-width:48px;
  height:34px;
  padding:0 7px;
  text-align:center;
}
#view-generation .generation-distance-unit {
  flex:0 0 auto;
  font-weight:700;
}
#view-generation .generation-actions {
  grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  align-items:stretch;
}
#view-generation .generation-actions .button {
  width:100%;
  min-width:0;
  height:42px;
  margin:0;
  padding:0 8px;
  display:flex;
  align-items:center;
  justify-content:center;
  box-sizing:border-box;
}
#view-generation .generation-proposal-bar {
  position:absolute;
  z-index:520;
  left:50%;
  bottom:22px;
  transform:translateX(-50%);
  display:flex;
  gap:8px;
  padding:0;
  background:none;
  box-shadow:none;
  backdrop-filter:none;
  border:0;
  pointer-events:none;
}
#view-generation .generation-proposal-btn {
  pointer-events:auto;
  box-shadow:0 4px 14px rgba(0,0,0,.18);
}
@media (max-width:760px) {
  #view-generation .generation-distance-line { gap:3px; }
  #view-generation .generation-distance-line .generation-distance-btn {
    flex-basis:28px; width:28px; min-width:28px;
  }
  #view-generation .generation-proposal-bar {
    bottom:12px;
    max-width:calc(100% - 20px);
  }
}

/* Champ distance : trois chiffres visibles, sans modifier les autres styles. */
#view-generation .generation-distance-line #generationDistanceInput { flex: 1 0 76px; min-width: 76px; padding: 0 4px; font-variant-numeric: tabular-nums; }
#view-generation .generation-distance-line .generation-distance-btn { flex: 1 1 27px; width: auto; min-width: 27px; }
