.rm-route-control a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    color: #142019;
}
.rm-route-control a.is-active { background: #386b4f; color: #fff; }
.rm-route-control a:focus-visible { outline: 3px solid rgba(56,107,79,.35); outline-offset: 2px; }
.rm-route-planning-active { cursor: crosshair; }
.rm-route-point-icon-wrap { background: transparent; border: 0; }
.rm-route-point-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(20,32,25,.38);
    color: #fff;
    font: 800 12px/1 system-ui, sans-serif;
}
.rm-route-waypoint-icon { width: 34px; border-radius: 7px; }
.rm-route-planner {
    position: fixed;
    top: 98px;
    left: 20px;
    z-index: 1090;
    display: none;
    width: min(380px, calc(100vw - 40px));
    max-height: calc(100vh - 124px);
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(20,32,25,.14);
    border-radius: 18px;
    box-shadow: 0 16px 44px rgba(20,32,25,.24);
    color: #142019;
}
.rm-route-planner.is-open { display: flex; flex-direction: column; }
.rm-route-planner > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 18px 18px 12px;
}
.rm-route-planner h2 { margin: 0; font-size: 1.42rem; }
.rm-route-kicker { display: block; margin-bottom: 2px; color: #68786f; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.rm-route-planner > header button { border: 0; background: transparent; color: #68786f; cursor: pointer; font-size: 1.8rem; line-height: 1; }
.rm-route-tabs { display: flex; gap: 5px; padding: 0 18px 12px; border-bottom: 1px solid #e2ddd2; }
.rm-route-tabs button { border: 0; border-radius: 999px; padding: 7px 13px; background: #f5f1e7; color: #68786f; cursor: pointer; font-weight: 750; }
.rm-route-tabs button.is-active { background: #386b4f; color: #fff; }
.rm-route-metadata { display: grid; gap: 8px; padding: 11px; border: 1px solid #e2ddd2; border-radius: 12px; background: #f7f4ec; }
.rm-route-metadata h3 { margin: 0; color: #68786f; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; }
.rm-route-metadata label { display: grid; gap: 4px; color: #68786f; font-size: .68rem; font-weight: 750; }
.rm-route-metadata textarea, .rm-route-metadata select { box-sizing: border-box; width: 100%; border: 1px solid #d9d3c6; border-radius: 8px; padding: 7px 8px; background: #fff; color: #142019; font: inherit; }
.rm-route-metadata textarea { resize: vertical; line-height: 1.35; }
.rm-route-metadata textarea:focus, .rm-route-metadata select:focus { border-color: #386b4f; outline: 2px solid rgba(56,107,79,.16); }
.rm-route-difficulty-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rm-route-editor, .rm-route-saved { min-height: 0; overflow-y: auto; padding: 15px 18px; }
.rm-route-name-label { display: grid; gap: 5px; color: #68786f; font-size: .78rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.rm-route-name-label input, .rm-route-point-copy input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #d9d3c6;
    border-radius: 8px;
    background: #fff;
    color: #142019;
}
.rm-route-name-label input { padding: 9px 10px; font-size: 1rem; }
.rm-route-visibility { display: grid; gap: 5px; margin: 10px 0 4px; color: #68786f; font-size: .72rem; font-weight: 750; }
.rm-route-visibility > span { letter-spacing: .04em; text-transform: uppercase; }
.rm-route-visibility > div { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 10px; background: #f5f1e7; }
.rm-route-visibility button { border: 0; border-radius: 7px; padding: 7px 9px; background: transparent; color: #68786f; cursor: pointer; font-weight: 750; }
.rm-route-visibility button.is-active { background: #386b4f; color: #fff; }
.rm-route-visibility small { font-weight: 500; line-height: 1.35; }
.rm-route-sharing-options { display: grid; gap: 7px; margin: 8px 0 12px; padding: 10px; border: 1px solid #ddd6c8; border-radius: 12px; background: #fbf9f4; color: #68786f; font-size: .72rem; font-weight: 750; }
.rm-route-sharing-options[hidden] { display: none; }
.rm-route-share-access { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 10px; background: #f0ece2; }
.rm-route-share-access button { border: 0; border-radius: 7px; padding: 7px 8px; background: transparent; color: #68786f; font-weight: 750; cursor: pointer; }
.rm-route-share-access button.is-active { background: #386b4f; color: #fff; }
.rm-route-sharing-options label { display: grid; gap: 4px; }
.rm-route-sharing-options textarea, .rm-route-sharing-options input { width: 100%; box-sizing: border-box; border: 1px solid #d9d3c6; border-radius: 8px; padding: 8px; background: #fff; color: #142019; font: inherit; font-weight: 500; }
.rm-route-share-link { display: grid; grid-template-columns: 1fr auto auto; gap: 6px; align-items: end; }
.rm-route-share-link button { min-height: 34px; border: 1px solid #d9d3c6; border-radius: 8px; background: #fff; color: #142019; font-weight: 750; cursor: pointer; }
@media (max-width: 560px) { .rm-route-share-link { grid-template-columns: 1fr 1fr; } .rm-route-share-link label { grid-column: 1 / -1; } }
.rm-route-summary { display: flex; justify-content: space-between; gap: 12px; margin: 10px 0; color: #68786f; font-size: .82rem; }
.rm-route-summary strong { color: #142019; }
.rm-route-elevation { margin: 10px 0 12px; padding: 10px; border: 1px solid #e2ddd2; border-radius: 12px; background: #f7f4ec; }
.rm-route-elevation h3 { margin: 0 0 7px; color: #68786f; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; }
.rm-route-elevation svg { display: block; width: 100%; height: 86px; overflow: visible; }
.rm-route-elevation svg polygon { fill: rgba(56,107,79,.16); }
.rm-route-elevation svg polyline { fill: none; stroke: #386b4f; stroke-width: 3; vector-effect: non-scaling-stroke; }
.rm-route-elevation-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 7px; font-size: .72rem; font-weight: 750; }
.rm-route-elevation-stats span { display: grid; gap: 1px; }
.rm-route-elevation-stats small { color: #68786f; font-size: .62rem; font-weight: 650; text-transform: uppercase; }
.rm-route-elevation-empty { margin: 0; color: #68786f; font-size: .76rem; line-height: 1.35; }
.rm-route-placement-mode {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin: 0 0 10px;
    padding: 4px;
    border-radius: 10px;
    background: #f5f1e7;
}
.rm-route-placement-mode button {
    border: 0;
    border-radius: 7px;
    padding: 7px 9px;
    background: transparent;
    color: #68786f;
    cursor: pointer;
    font-weight: 750;
}
.rm-route-placement-mode button.is-active { background: #386b4f; color: #fff; }
.rm-route-placement-mode { margin-top: -2px; }
.rm-route-primary-actions, .rm-route-footer-actions, .rm-route-photo-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.rm-route-primary-actions button, .rm-route-footer-actions button, .rm-route-photo-actions button, .rm-saved-route-row > button {
    border: 1px solid #d9d3c6;
    border-radius: 8px;
    background: #fff;
    color: #142019;
    cursor: pointer;
    padding: 7px 10px;
    font-weight: 700;
}
.rm-route-primary-actions button:disabled, .rm-route-footer-actions button:disabled, .rm-route-photo-actions button:disabled { cursor: default; opacity: .45; }
.rm-route-primary-actions button.is-active, .rm-route-footer-actions button.is-primary { border-color: #386b4f; background: #386b4f; color: #fff; }
.rm-route-color-row { display: flex; gap: 8px; margin: 13px 0; }
.rm-route-color-row button { width: 25px; height: 25px; border: 3px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px rgba(20,32,25,.25); cursor: pointer; }
.rm-route-color-row button[aria-pressed="true"] { box-shadow: 0 0 0 3px #142019; }
.rm-route-section { margin-top: 13px; }
.rm-route-section + .rm-route-section { padding-top: 13px; border-top: 1px solid #d9d3c6; }
.rm-route-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 2px 7px; }
.rm-route-section-heading h3 { display: flex; align-items: center; gap: 7px; margin: 0; color: #142019; font-size: .82rem; letter-spacing: .02em; }
.rm-route-section-heading h3 span { min-width: 22px; border-radius: 999px; background: #e8e3d7; color: #68786f; font-size: .67rem; line-height: 22px; text-align: center; }
.rm-route-section-heading small { color: #68786f; font-size: .66rem; font-weight: 700; }
.rm-route-section-heading small span { font-size: .85rem; }
.rm-route-points, .rm-route-waypoints {
    display: grid;
    gap: 7px;
    overflow-y: auto;
    padding: 7px;
    border: 1px solid #e2ddd2;
    border-radius: 12px;
    background: #fff;
    scrollbar-color: #9b9385 #f5f1e7;
    scrollbar-width: thin;
}
.rm-route-points { max-height: 230px; }
.rm-route-waypoints { max-height: 165px; }
.rm-route-points::-webkit-scrollbar, .rm-route-waypoints::-webkit-scrollbar { width: 9px; }
.rm-route-points::-webkit-scrollbar-track, .rm-route-waypoints::-webkit-scrollbar-track { border-radius: 999px; background: #f5f1e7; }
.rm-route-points::-webkit-scrollbar-thumb, .rm-route-waypoints::-webkit-scrollbar-thumb { border: 2px solid #f5f1e7; border-radius: 999px; background: #9b9385; }
.rm-route-section.is-scrollable .rm-route-points, .rm-route-section.is-scrollable .rm-route-waypoints { border-color: #bdb5a7; box-shadow: inset 0 -10px 14px -14px rgba(20,32,25,.65); }
.rm-route-points:focus-visible, .rm-route-waypoints:focus-visible { outline: 2px solid #386b4f; outline-offset: 2px; }
.rm-route-waypoint-row { border: 1px dashed rgba(20,32,25,.22); background: #fffaf1; }
.rm-route-waypoint-number { flex-basis: 30px; width: 30px; border-radius: 6px; }
.rm-route-point-row { display: flex; align-items: center; gap: 9px; padding: 8px; border-radius: 10px; background: #f7f4ec; }
.rm-route-point-number { display: flex; flex: 0 0 26px; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; color: #fff; font-size: .72rem; font-weight: 800; }
.rm-route-point-copy { flex: 1; min-width: 0; }
.rm-route-point-copy label { display: block; }
.rm-route-point-edit-label { display: block; margin: 0 0 1px 5px; color: #68786f; font-size: .58rem; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.rm-route-point-copy input { border-color: transparent; padding: 3px 5px; background: transparent; font-weight: 700; }
.rm-route-point-copy input:hover, .rm-route-point-copy input:focus { border-color: #bdb5a7; background: #fff; outline: none; }
.rm-route-waypoint-description { margin-top: 5px; }
.rm-route-waypoint-description textarea { display: block; width: 100%; resize: vertical; border: 1px solid transparent; border-radius: 7px; padding: 5px; background: transparent; color: #142019; font: inherit; font-size: .72rem; line-height: 1.35; }
.rm-route-waypoint-description textarea:hover, .rm-route-waypoint-description textarea:focus { border-color: #bdb5a7; background: #fff; outline: none; }
.rm-route-point-copy small { display: block; padding-left: 5px; color: #68786f; font-size: .7rem; }
.rm-route-point-details span { display: block; }
.rm-route-point-details span + span { margin-top: 1px; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.rm-route-waypoint-photo-button { margin: 5px 0 0 5px; border: 1px solid #bdb5a7; border-radius: 7px; padding: 4px 8px; background: #fff; color: #386b4f; cursor: pointer; font-size: .67rem; font-weight: 750; }
.rm-route-waypoint-photo-button:hover, .rm-route-waypoint-photo-button:focus-visible { border-color: #386b4f; background: #edf5ef; }
.rm-route-waypoint-photo-button:disabled { cursor: not-allowed; opacity: .5; }
.rm-route-point-row > button { border: 0; background: transparent; color: #a13f2f; cursor: pointer; font-size: 1.2rem; }
.rm-route-empty, .rm-route-list-message { margin: 12px 0; color: #68786f; font-size: .86rem; text-align: center; }
.rm-route-safety { margin: 13px 0; color: #68786f; font-size: .73rem; line-height: 1.45; }
.rm-route-provider { margin: -5px 0 13px; color: #68786f; font-size: .68rem; line-height: 1.4; }
.rm-route-provider a { color: #2c5f7c; }
.rm-route-footer-bar { display: flex; align-items: center; justify-content: space-between; gap: 7px; padding-top: 9px; border-top: 1px solid #e2ddd2; }
.rm-route-footer-actions { flex: 0 0 auto; justify-content: flex-end; }
.rm-route-photo-actions { flex: 0 0 auto; justify-content: flex-start; }
.rm-route-footer-bar button { padding: 7px 8px; white-space: nowrap; font-size: .7rem; }
.rm-route-status { margin: 0; padding: 10px 18px; border-top: 1px solid #e2ddd2; background: #f7f4ec; color: #68786f; font-size: .78rem; }
.rm-route-status[data-kind="success"] { color: #386b4f; }
.rm-route-status[data-kind="error"], .rm-route-list-message.is-error { color: #a13f2f; }
.rm-saved-route-row { display: grid; grid-template-columns: 1fr auto auto auto; gap: 6px; align-items: center; padding: 8px 0; border-bottom: 1px solid #e2ddd2; }
.rm-saved-route-open { display: flex; align-items: center; gap: 9px; min-width: 0; border: 0; background: transparent; color: #142019; cursor: pointer; text-align: left; }
.rm-saved-route-open > span:last-child { min-width: 0; }
.rm-saved-route-open strong, .rm-saved-route-open small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rm-saved-route-open small { color: #68786f; }
.rm-saved-route-swatch { flex: 0 0 12px; width: 12px; height: 36px; border-radius: 6px; }
.rm-saved-route-row > button { padding: 6px 7px; font-size: .72rem; }
.rm-saved-route-row > button.is-danger { color: #a13f2f; }
.rm-saved-route-row > button.rm-saved-route-delete { display: inline-flex; align-items: center; justify-content: center; width: 38px; min-height: 38px; padding: 7px; }
.rm-saved-route-row > button.rm-saved-route-delete:hover, .rm-saved-route-row > button.rm-saved-route-delete:focus-visible { border-color: #a13f2f; background: #fff5f2; }
.rm-my-tracks-group + .rm-my-tracks-group { margin-top: 18px; }
.rm-my-tracks-group h3 { margin: 0 0 4px; color: #68786f; font-size: .76rem; letter-spacing: .05em; text-transform: uppercase; }
.rm-saved-gpx-row { grid-template-columns: minmax(0, 1fr) auto auto; }
.rm-saved-gpx-row .rm-saved-route-open { grid-column: 1 / -1; }
.rm-saved-gpx-row [data-edit-gpx-route] { justify-self: start; }
.rm-saved-route-swatch.is-gpx { background: repeating-linear-gradient(135deg, #2c5f7c 0 5px, #fff 5px 8px); }

.rm-trip-photo-modal {
    position: fixed;
    inset: 0;
    z-index: 1400;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(20, 32, 25, .58);
}
.rm-trip-photo-dialog {
    display: flex;
    flex-direction: column;
    width: min(720px, 100%);
    max-height: min(86vh, 820px);
    overflow: hidden;
    border-radius: 18px;
    background: #fff;
    color: #142019;
    box-shadow: 0 22px 70px rgba(20, 32, 25, .38);
}
.rm-trip-photo-dialog > header, .rm-trip-photo-dialog > footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; }
.rm-trip-photo-dialog > header { border-bottom: 1px solid #e2ddd2; }
.rm-trip-photo-dialog > header h2 { margin: 0; font-size: 1.35rem; }
.rm-trip-photo-dialog > header button { border: 0; background: transparent; color: #68786f; cursor: pointer; font-size: 1.8rem; }
.rm-trip-photo-dialog > footer { justify-content: flex-end; border-top: 1px solid #e2ddd2; }
.rm-trip-photo-dialog > footer button { border: 1px solid #d9d3c6; border-radius: 8px; padding: 8px 13px; background: #fff; color: #142019; cursor: pointer; font-weight: 750; }
.rm-trip-photo-dialog > footer button.is-primary { border-color: #386b4f; background: #386b4f; color: #fff; }
.rm-trip-photo-body { min-height: 0; overflow-y: auto; padding: 18px 20px; }
.rm-trip-photo-drop { display: grid; gap: 4px; padding: 28px 18px; border: 2px dashed #9b9385; border-radius: 14px; background: #f7f4ec; cursor: pointer; text-align: center; }
.rm-trip-photo-drop.is-dragging, .rm-trip-photo-drop:focus { border-color: #386b4f; background: #edf5ef; outline: none; }
.rm-trip-photo-drop span, .rm-trip-photo-help, .rm-trip-photo-group small { color: #68786f; }
.rm-trip-photo-help { margin: 9px 2px 17px; font-size: .78rem; line-height: 1.45; }
.rm-trip-photo-group { display: grid; grid-template-columns: minmax(120px, 1fr) 1.2fr; gap: 10px 16px; margin-top: 12px; padding: 14px; border: 1px solid #e2ddd2; border-radius: 14px; background: #fffaf1; }
.rm-trip-photo-group > div:nth-child(2) { align-self: center; }
.rm-trip-photo-group strong, .rm-trip-photo-group small { display: block; }
.rm-trip-photo-group small.is-warning { margin-top: 3px; color: #9a5a16; font-weight: 700; }
.rm-trip-photo-group label { display: grid; gap: 4px; color: #68786f; font-size: .72rem; font-weight: 750; }
.rm-trip-photo-group select, .rm-trip-photo-group input { width: 100%; box-sizing: border-box; border: 1px solid #d9d3c6; border-radius: 7px; padding: 7px; background: #fff; color: #142019; }
.rm-trip-photo-thumbs { display: flex; gap: 6px; overflow-x: auto; grid-row: span 2; }
.rm-trip-photo-thumbs img { width: 68px; height: 68px; flex: 0 0 68px; border-radius: 8px; object-fit: cover; }

[hidden].rm-trip-photo-modal { display: none; }

@media (max-width: 700px) {
    .rm-route-planner {
        top: auto;
        right: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        max-height: min(68vh, 620px);
        border-radius: 20px 20px 0 0;
    }
    .rm-route-points { max-height: 165px; }
    .rm-route-difficulty-fields { grid-template-columns: 1fr; }
    .rm-trip-photo-modal { align-items: end; padding: 0; }
    .rm-trip-photo-dialog { max-height: 90vh; border-radius: 20px 20px 0 0; }
    .rm-trip-photo-group { grid-template-columns: 1fr; }
    .rm-trip-photo-thumbs { grid-row: auto; }
}
