/* Map-first workspace. One icon rail per edge; context opens only on demand. */
.trip-page { position:relative; }
.trip-page-header { min-height:70px;padding:10px 125px 10px 16px;gap:12px;align-items:center; }
.trip-back { display:grid;place-items:center;min-width:40px;width:40px;height:40px;border-radius:8px; }
.trip-back:hover { background:#edf2ee; }
.trip-page-title h1 { font-size:18px;margin:0 0 3px; }
.trip-page-title p { font-size:11px; }
.trip-page-account { display:none; }
.trip-page-tabs { position:absolute;top:15px;right:16px;z-index:40;min-height:40px;padding:3px;gap:2px;border:0;border-radius:10px;background:#edf2ee; }
.trip-page-tabs button { display:grid;place-items:center;align-self:auto;width:40px;height:36px;padding:0;border:0;border-radius:7px; }
.trip-page-tabs button[aria-selected=true] { background:white;box-shadow:0 1px 4px #173d2912; }
.route-editor-workspace { display:block; }
.route-editor-map-wrap { height:100%; }
.route-map-tools,.route-view-tools { position:absolute;z-index:700;top:16px;display:flex;gap:4px;pointer-events:auto; }
.route-map-tools { left:16px;right:auto;flex-wrap:nowrap; }
.route-view-tools { right:16px;flex-direction:column; }
.map-icon-bar { padding:4px;background:white;border:1px solid #e0e7df;border-radius:12px;box-shadow:0 3px 16px #153e271a; }
.route-editor .map-icon { position:relative;display:inline-grid;place-items:center;flex-shrink:0;width:44px;height:44px;min-width:44px;min-height:44px;padding:0;border:0;background:white;box-shadow:none;border-radius:8px;color:#31523c; }
.route-editor .map-icon:hover:not(:disabled) { background:#f0f5f0; }
.route-editor .map-icon[aria-pressed=true],.route-editor .map-icon[aria-expanded=true],.route-editor .primary-icon { background:#1d5036;color:white; }
.route-editor .map-icon[aria-pressed=true]:hover,.route-editor .primary-icon:hover { background:#173f2c; }
.map-icon svg { pointer-events:none; }
.route-history-tools { display:flex;gap:4px;margin:0;padding-left:4px;border-left:1px solid #e1e8e1; }
.route-editor button:disabled { opacity:.35; }
.route-panel-toggle { position:relative;top:auto;z-index:auto;font:inherit; }
.route-editor-panel { display:block;position:absolute;z-index:800;top:16px;right:82px;bottom:auto;left:auto;width:300px;max-height:calc(100% - 110px);overflow:auto;background:white;border:1px solid #dce6dc;border-radius:12px;box-shadow:0 6px 28px #123c2726; }
.route-popover-head { position:sticky;top:0;z-index:1;height:auto;min-height:54px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:6px 8px 6px 18px;border-bottom:1px solid #edf1ec;background:white; }
.route-popover-head h3 { margin:0;font:650 13px system-ui;color:#254b34; }
.route-editor-panel-content { display:block; }
.route-editor-panel-content>section { padding:16px 18px;border:0; }
.route-editor-panel .route-layers { padding:0;border:0; }
.route-layers label { font-size:12px; }
.route-layers .fuel-company-label { display:block;margin:8px 0 14px;color:#6c8171;font-size:11px; }
.fuel-company-label select { display:block;width:100%;height:42px;margin-top:6px;padding:8px;background:#f7faf7;color:#21482f;border:1px solid #dae4da;border-radius:7px;font-size:13px; }
.route-point-total { display:block;color:#7b8c7e;font-size:11px;margin-bottom:10px; }
.route-point-list { max-height:250px; }
.route-distance { position:absolute;z-index:600;bottom:18px;left:18px;max-width:min(340px,calc(100% - 160px));padding:11px 16px;background:#fffffff5;border:1px solid #dce6dc;border-radius:12px;box-shadow:0 3px 16px #153e271a; }
.route-distance strong { margin:0;font-size:23px;letter-spacing:-.7px;line-height:1.3; }
.route-distance small { display:block;margin-top:3px;font-size:10px; }
.route-distance p { font-size:11px;margin:8px 0 0; }
.route-preview-retry { min-height:36px;font-size:11px; }
.route-selected-tools { z-index:650;top:78px;left:16px;padding:3px 4px 3px 12px;font-size:11px;border:1px solid #e1e8e1;box-shadow:0 2px 10px #173d2914; }
.route-selected-tools .map-icon { width:36px;min-width:36px;height:36px;min-height:36px; }
.route-selected-tools svg { width:16px;height:16px; }
.route-map-hint { z-index:650;bottom:90px;left:18px;max-width:320px;padding:9px 12px;font-size:11px;border:1px solid #e1e8e1; }
.route-editor-footer { position:absolute;z-index:750;bottom:18px;right:78px;display:flex;gap:10px;padding:0;border:0;background:none; }
.route-editor-footer>span { display:none; }
.route-editor-footer>div { display:flex;gap:6px; }
.route-editor-footer button { box-shadow:0 3px 12px #153e271a; }
.route-editor-footer .route-save { display:flex;align-items:center;gap:7px;min-height:44px;padding:10px 15px;border-radius:9px; }
.route-editor-footer .route-save span { font:600 12px system-ui; }
.route-help-details p { font-size:12px;line-height:1.7;color:#647c6b;margin:0 0 16px; }
.route-help-details p svg { width:16px;height:16px;vertical-align:middle; }
.route-legend-road,.route-legend-gps { display:inline-block;width:20px;margin-right:6px;vertical-align:middle;border-top:3px solid #1e8154; }
.route-legend-gps { border-color:#66756d;border-top-style:dashed; }
.route-help-details .route-reset { display:flex;align-items:center;gap:8px;margin:0;font-size:11px; }
.route-help-details .route-reset svg { width:16px;height:16px; }
.map-icon::after { content:attr(aria-label);position:absolute;right:calc(100% + 10px);top:50%;transform:translateY(-50%);display:none;white-space:nowrap;background:#173b2c;color:white;font:500 11px system-ui;padding:7px 10px;border-radius:5px;pointer-events:none;z-index:1500; }
.map-icon:hover::after,.map-icon:focus-visible::after,.map-icon.show-tip::after { display:block; }
.route-map-tools .map-icon::after { left:0;right:auto;top:calc(100% + 9px);transform:none; }
@media(max-width:800px) {
 .trip-page-header { min-height:64px;padding:8px 105px 8px 8px;gap:6px; }
 .trip-page-title h1 { font-size:15px; }
 .trip-page-title p { font-size:10px; }
 .trip-back { min-width:32px;width:32px; }
 .trip-menu { min-width:36px;width:36px; }
 .trip-page-tabs { top:12px;right:8px;min-height:36px; }
 .trip-page-tabs button { width:36px;height:32px; }
 .route-map-tools,.route-view-tools { top:12px; }
 .route-map-tools { left:12px;flex-direction:column; }
 .route-view-tools { right:12px; }
 .map-icon-bar { padding:3px;border-radius:11px;gap:2px; }
 .route-history-tools { flex-direction:column;padding:3px 0 0;border-left:0;border-top:1px solid #e1e8e1;gap:2px; }
 .route-editor-panel { top:12px;right:72px;width:min(300px,calc(100% - 84px));max-height:calc(100% - 104px);border-radius:11px; }
 .route-editor-panel-content { display:block; }
 .route-selected-tools { top:auto;bottom:85px;left:12px; }
 .route-map-hint { left:72px;bottom:90px;max-width:calc(100% - 88px);font-size:10px; }
 .route-distance { left:12px;bottom:16px;padding:9px 12px;max-width:calc(100% - 140px); }
 .route-distance strong { font-size:21px; }
 .route-distance small { font-size:9px; }
 .route-editor-footer { bottom:16px;right:12px; }
 .route-editor-footer .map-icon { width:40px;min-width:40px; }
 .route-editor-footer .route-save { padding:10px 12px; }
 .is-editing .route-distance { max-width:calc(100% - 176px); }
 .route-editor-map .leaflet-bottom { bottom:80px; }
 .route-map-tools .map-icon::after { left:calc(100% + 10px);top:50%;transform:translateY(-50%); }
}
@media(max-height:480px) {
 .route-map-tools,.route-history-tools { flex-direction:row;border:0;padding-left:0; }
 .route-view-tools { flex-direction:row; }
 .route-map-tools { max-width:55%;flex-wrap:wrap; }
 .route-editor-panel { top:68px;right:12px;max-height:calc(100% - 135px); }
}
.fuel-cluster .fuel-marker-content { overflow:visible; }
.fuel-cluster { border:2px solid white;outline:2px solid #30754e;box-shadow:0 2px 9px #173b2930; }
.fuel-cluster-count { position:absolute;z-index:2;right:-10px;top:-10px;min-width:20px;height:20px;padding:0 4px;display:grid;place-items:center;border-radius:12px;border:2px solid white;background:#245e3e;color:white;font:700 10px system-ui; }

/* The selected-point action follows the actual point, including pan and zoom. */
.route-selected-tools { top:0;bottom:auto;left:0;transform:translate(-50%,-100%);border-radius:10px;gap:4px;max-width:130px; }
.route-selected-tools::after { content:'';position:absolute;left:calc(50% + var(--point-arrow,0px));bottom:-6px;transform:translateX(-50%) rotate(45deg);width:10px;height:10px;border-right:1px solid #e1e8e1;border-bottom:1px solid #e1e8e1;background:white; }
.route-selected-tools.below-point { transform:translate(-50%,40px); }
.route-selected-tools.below-point::after { top:-6px;bottom:auto;transform:translateX(-50%) rotate(225deg); }
.route-selected-tools .map-icon { z-index:1;color:#9e4635; }

/* Compact controls, direct header actions, comfortable touch targets. */
.route-editor .map-icon { width:40px;height:40px;min-width:40px;min-height:40px;color:#173e2a; }
.map-icon svg,.trip-page-tabs svg { width:17px;height:17px;stroke-width:1.9; }
.route-editor .primary-icon,.route-editor .map-icon[aria-pressed=true],.route-editor .map-icon[aria-expanded=true] { color:white; }
.map-icon-bar { gap:2px;padding:3px;border-color:#c8d6c9;box-shadow:0 2px 10px #153e2720; }
.route-map-tools [data-mode=move] { display:none!important; }
.route-control-point>span { width:24px;height:24px;font-size:10px;border-color:#235f40;box-shadow:0 1px 4px #102f2633; }
.route-control-point.selected>span { background:#164e34;outline:2px solid #164e34;border:2px solid white; }
.route-selected-tools .map-icon { color:#a02e24;background:#fff1ee; }
.route-secondary-actions { display:flex;align-items:center;gap:6px;padding-top:12px;border-top:1px solid #e6ece6;margin-top:14px; }
.trip-actions-host { margin-left:auto;min-width:0; }
.trip-header-tools { display:flex;align-items:center;gap:8px; }
.header-fuel-button { display:grid;place-items:center;width:40px;height:40px;flex-shrink:0;border:1px solid #cedace;background:white;border-radius:8px;color:#244f36;cursor:pointer; }
.header-fuel-button svg { width:17px;height:17px;stroke-width:1.9; }
.header-fuel-button[aria-pressed=true] { background:#e9f3eb;border-color:#83ad8d;color:#174c30; }
.trip-header-tools>select { min-width:130px;max-width:180px;height:40px;padding:7px 10px;border:1px solid #cedace;border-radius:8px;background:#f8fbf8;color:#214b32;font-size:11px; }
.trip-header-tools .route-editor-footer { position:static;display:flex;gap:0; }
.trip-header-tools .route-editor-footer>div { display:flex;gap:6px; }
.trip-header-tools .route-editor-footer button { min-height:40px;padding:9px 13px;border-radius:8px;box-shadow:none;font:600 12px system-ui;cursor:pointer; }
.trip-header-tools .route-save { display:flex;align-items:center;gap:6px;background:#174c31;color:white;border:1px solid #174c31; }
.trip-header-tools .route-save svg { width:16px;height:16px; }
.trip-header-tools .route-cancel { border:1px solid #cedace;background:white;color:#40634b; }
.trip-header-tools button:disabled { opacity:.4;cursor:default; }
.trip-header-tools :focus-visible { outline:3px solid #399461;outline-offset:2px; }
@media(max-width:800px) {
 .trip-page-header { flex-wrap:wrap;padding:8px;gap:6px; }
 .trip-page-title { padding-right:95px; }
 .trip-actions-host { flex-basis:100%;margin:2px 0 0; }
 .trip-header-tools { gap:6px; }
 .trip-header-tools .route-editor-footer { margin-left:auto; }
 .trip-header-tools>select { flex:1;min-width:90px;max-width:170px;width:100%; }
 .trip-header-tools .route-editor-footer button { padding:9px 10px;font-size:11px; }
 .route-editor .map-icon { width:44px;height:44px;min-width:44px;min-height:44px; }
 .route-distance,.is-editing .route-distance { max-width:calc(100% - 80px); }
 .route-editor-map .leaflet-bottom { bottom:16px; }
 .route-map-tools,.route-view-tools { top:10px; }
 .route-selected-tools .map-icon { width:36px;height:36px;min-width:36px;min-height:36px; }
}
