.map-page { height: 100dvh; overflow: hidden; font-size: 13px; }
.map-header { height: 86px; padding: 0 27px; display: flex; align-items: center; justify-content: space-between; gap: 22px; border-bottom: 1px solid var(--line); }
.map-brand { display: flex; gap: 13px; align-items: center; text-decoration: none; font-size: 24px; font-weight: 650; color: var(--ink); }
.map-brand small { display: block; font-size: 10px; font-weight: 400; color: var(--muted); }
.map-heading h1 { font-size: 22px; line-height: 1.5; font-weight: 600; }
.map-heading p { font-size: 10px; color: var(--muted); margin-top: 2px; }
.map-header-actions { display: flex; align-items: center; gap: 8px; }
.map-layout { display: grid; grid-template-columns: 340px minmax(0,1fr); height: calc(100dvh - 86px); }
.point-panel { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: #fbfcfb; }
.point-panel-head { padding: 23px 22px 17px; border-bottom: 1px solid var(--line); }
.point-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.point-title h2 { font-size: 17px; font-weight: 600; }
.point-title > span { color: var(--accent); font-size: 11px; white-space: nowrap; }
.map-date-label { display: block; font-size: 10px; color: var(--muted); margin: 15px 0 5px; }
#route-day { width: 100%; background: white; border: 1px solid #d5e0db; border-radius: 5px; padding: 9px; color: var(--ink); font-size: 12px; }
#point-list { flex: 1; overflow-y: auto; min-height: 90px; padding: 5px 12px 14px; scrollbar-width: thin; }
.map-day-group { margin-top: 9px; border: 0; }
.map-day-group summary { position: sticky; top: -5px; z-index: 1; padding: 11px 8px; background: #fbfcfb; font-size: 11px; }
.map-day-group summary small { font-weight: 400; color: var(--muted); margin-left: 7px; }
.map-point-row { display: flex; gap: 11px; padding: 10px; width: 100%; border: 0; background: transparent; border-radius: 5px; text-align: left; align-items: flex-start; }
.map-point-row:hover, .map-point-row[aria-pressed="true"] { background: #e8f1ed; }
.point-number { display: grid; place-items: center; height: 24px; width: 24px; flex: 0 0 24px; border: 1px solid #b7cdc3; border-radius: 50%; font-size: 10px; color: var(--accent); font-variant-numeric: tabular-nums; background: white; }
.point-text { min-width: 0; }
.point-text strong { font-size: 12px; font-weight: 500; display: block; overflow-wrap: anywhere; }
.point-text small { color: var(--muted); font-size: 10px; display: block; margin-top: 3px; }
.point-extra .point-number { border-style: dashed; color: #9b574c; }
#point-detail { border-top: 1px solid #cfddd5; padding: 18px 22px; max-height: 36%; overflow-y: auto; background: white; }
#point-detail:empty { display: none; }
.point-detail-top { display: flex; justify-content: space-between; gap: 10px; align-items: start; }
#point-detail h3 { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
#point-detail p { color: var(--muted); font-size: 11px; line-height: 1.9; margin-top: 9px; }
#point-detail .point-state { color: #985645; font-size: 10px; margin-top: 4px; }
#point-detail .text-actions { margin-top: 12px; gap: 12px; }
.map-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.map-toolbar { padding: 12px 20px; display: flex; justify-content: space-between; align-items: center; gap: 15px; border-bottom: 1px solid var(--line); }
.map-tools, .fuel-toggle { display: flex; align-items: center; gap: 7px; }
.fuel-toggle { white-space: nowrap; font-size: 11px; color: #8a5719; cursor: pointer; }
.fuel-toggle input { accent-color: #a96c22; }
.fuel-toggle svg { width: 16px; height: 16px; }
.fuel-pin { width: 24px; height: 24px; display: grid; place-items: center; border: 2px solid white; border-radius: 50%; background: #a5681c; color: white; box-shadow: 0 1px 4px #0003; padding: 0; font-size: 10px; }
#route-map .fuel-pin svg { width: 16px; height: 16px; }
.fuel-cluster { background: #fff5e5; border-color: #a5681c; color: #855015; }
#fuel-panel { border-top: 1px solid var(--line); padding: 8px 18px; flex-shrink: 0; }
#fuel-panel summary { display: flex; gap: 8px; align-items: center; font-size: 12px; }
#fuel-panel summary svg { width: 16px; height: 16px; color: #a5681c; }
#fuel-count { margin-left: auto; color: #a5681c; }
#fuel-list { max-height: 150px; overflow-y: auto; margin-top: 7px; }
.fuel-row { display: block; width: 100%; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 9px 0; text-align: left; font-size: 11px; }
.fuel-row small { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; }
.fuel-status-row { display: flex; align-items: center; gap: 8px; }
#fuel-status { color: #8a5719; font-size: 10px; margin-top: 5px; }
.fuel-status-row .icon-button { width: 28px; height: 28px; flex-shrink: 0; }
.route-popup { max-width: 270px; overflow-wrap: anywhere; }
.map-scopes { display: flex; gap: 18px; align-items: center; }
.map-scopes button { border: 0; background: none; border-bottom: 2px solid transparent; padding: 7px 0; font-size: 12px; color: var(--muted); }
.map-scopes button[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); font-weight: 600; }
#route-map { position: relative; flex: 1; min-height: 240px; background: #eef2ef; isolation: isolate; font: inherit; }
#route-map svg { width: auto; height: auto; }
.map-loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--muted); padding: 30px; text-align: center; }
.amap-pin { position: relative; display: block; border: 0; background: none; padding: 0; width: 28px; height: 28px; }
.route-marker { width: 28px; height: 28px; background: white; border: 2px solid var(--accent); color: var(--accent); border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 650; box-shadow: 0 2px 5px #153b2829; }
.route-marker.pending { border-style: dashed; }
.route-cluster { position: relative; display: grid; width: 38px; height: 38px; padding: 0; place-items: center; background: #176b62; color: white; border: 4px solid #cce0d8; border-radius: 50%; font-size: 12px; font-weight: 650; box-shadow: 0 1px 5px #19372d24; }
.route-cluster small { position: absolute; left: 50%; transform: translateX(-50%); top: 37px; padding: 3px 7px; font-size: 10px; font-weight: 500; color: #263e34; background: #fffffff2; white-space: nowrap; border-radius: 3px; }
.cluster-short { display: none; }
.route-label { position: absolute; top: 32px; left: 50%; transform: translateX(-50%); white-space: normal; width: max-content; max-width: 150px; border: 0; box-shadow: 0 1px 3px #20382d18; color: #263e34; background: #ffffffed; padding: 3px 7px; font-size: 11px; }
.route-label:before { display: none; }
.route-label small { color: var(--muted); font-size: 9px; padding-left: 5px; }
.route-popup strong { display: block; font-size: 13px; margin-bottom: 8px; }
.route-popup p { font-size: 10px; color: var(--muted); margin: 5px 0 8px; }
.route-popup button { display: block; padding: 7px 0; color: var(--accent); border: 0; background: none; text-align: left; width: 100%; font-size: 11px; }
.route-popup { max-height: 220px; overflow-y: auto; }
.map-bottom { border-top: 1px solid var(--line); padding: 13px 20px 10px; background: white; }
.map-legend { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 10px; }
.map-legend > span { display: inline-flex; gap: 7px; align-items: center; }
.map-legend > span:before { content: ''; width: 20px; border-top: 3px solid var(--accent); }
.map-legend .legend-shuttle:before { border-top: 3px dashed #346baa; }
.map-legend .legend-rideshare:before { border-color: #b97832; border-top-style: dashed; }
.map-legend .legend-team:before { border-color: #ad627f; }
.map-legend .legend-flight:before { border-top: 2px dotted #7a718f; }
.map-legend .legend-optional:before { border-top: 2px dashed #a95d49; }
.map-legend label { display: flex; gap: 5px; align-items: center; color: #9b574c; }
.map-legend input { accent-color: #a9604d; margin: 0; }
#map-status { margin-top: 9px; color: var(--muted); font-size: 10px; }
.map-flight-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 10px 20px; background: #f4f7f5; font-size: 10px; color: var(--muted); }
.map-flight-summary svg { height: 12px; width: 12px; }
@media (max-width: 1000px) { .map-layout { grid-template-columns: 290px minmax(0,1fr); } .map-header { padding: 0 18px; } .map-brand { font-size: 20px; } .map-scopes { gap: 12px; } }
@media (max-width: 780px) {
  .map-page { height: auto; overflow: auto; }
  .map-header { height: auto; min-height: 112px; display: grid; grid-template-columns: 1fr auto; padding: 14px 17px; gap: 12px; }
  .map-brand { grid-column: 1; grid-row: 1; font-size: 18px; gap: 8px; }
  .map-brand small { display: inline; margin-left: 5px; }
  .map-header-actions { grid-column: 2; grid-row: 1; }
  .map-heading { grid-column: 1 / -1; }
  .map-heading h1 { font-size: 20px; }
  .map-heading p { font-size: 10px; }
  .map-layout { display: flex; flex-direction: column-reverse; height: auto; }
  .map-main { height: 640px; max-height: 78dvh; min-height: 510px; }
  .map-toolbar { padding: 10px 15px; gap: 8px; }
  .map-toolbar { flex-wrap: wrap; }
  .map-tools { margin-left: auto; }
  .map-main { height: 700px; max-height: none; }
  .map-scopes { gap: 12px; }
  .map-scopes button { font-size: 11px; }
  .map-bottom { padding: 11px 16px; }
  .map-legend { gap: 7px 13px; font-size: 9px; }
  .map-flight-summary { padding: 9px 16px; font-size: 9px; gap: 3px 6px; }
  .map-flight-summary svg { display: none; }
  .point-panel { border-right: 0; border-top: 1px solid var(--line); }
  .point-panel-head { padding: 20px; }
  #point-list { max-height: 550px; overflow-y: auto; padding: 5px 14px 15px; }
  #point-detail { max-height: none; order: -1; padding: 20px; }
  .route-label { font-size: 10px; max-width: 100px; }
  #route-map[data-overview="true"] .route-label, #route-map[data-overview="true"] .route-cluster:not(.primary) small { display: none; }
  .cluster-long { display: none; }
  .cluster-short { display: inline; }
  .route-cluster.primary small { top: auto; bottom: 37px; }
  .map-header .return-picker button { font-size: 10px; padding: 5px 6px; }
}
@media (max-width: 360px) { .map-header { padding: 13px; } .map-brand small { display: none; } .map-header-actions { gap: 4px; } .map-scopes { gap: 9px; } .map-scopes button { font-size: 10px; } }
@media print {
  .map-page { overflow: visible; height: auto; }
  .map-header { height: 80px; }
  .map-header-actions, .map-toolbar, #point-detail, .amap-toolbar { display: none !important; }
  .map-layout { display: flex; flex-direction: column-reverse; height: auto; }
  .map-main { height: 690px; max-height: none; break-inside: avoid; }
  #route-map { min-height: 490px; }
  #point-list { overflow: visible; max-height: none; }
  .point-panel { display: block; }
  .map-point-row { break-inside: avoid; }
  .point-panel-head select { display: none; }
}
