/* styles.css */
html,
body {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    /* Prevent scrolling */
    font-family: 'Roboto', sans-serif;
    background: #fff;
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-sizing: border-box;
    z-index: 100;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.logo-container img {
    height: 40px;
    /* Adjust based on SVG aspect ratio */
    display: block;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* More = secondary app-nav: ghost icon button, lighter than the primary MAPS */
.more-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1.5px solid rgba(0, 0, 0, 0.18);
    border-radius: 8px;
    cursor: pointer;
}

.more-btn:active {
    background: rgba(0, 0, 0, 0.05);
}

.more-btn svg {
    display: block;
}

.maps-btn {
    background: #000000;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
}

/* Modal */
.modal-backdrop {
    display: none;
    /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 300;
    align-items: center;
    justify-content: center;
    overscroll-behavior: none;
}

.modal-backdrop.visible {
    display: flex;
}

.modal-content {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    position: relative;
    max-width: 80%;
    width: 80%;
    max-height: 90%;
    overflow: hidden;
    /* Allow touch events on buttons while preventing scroll */
    overscroll-behavior: none;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.modal-content h2,
.modal-content h3 {
    font-size: 1.3rem;
    margin-top: 10px;
    margin-bottom: 20px;
}

.modal-close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    background: none;
    border: none;
    font-weight: bold;
    color: #000000;
    z-index: 10;
}

/* Generic modal image (e.g. about page) */
.modal-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin-top: 20px;
}

/* About Text Specific */
.modal-content.text-content {
    text-align: left;
}

/* How to Test modal — longer than About, allow scroll on small phones */
.modal-content.howto-content {
    max-height: 85vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.howto-content .howto-list {
    margin: 8px 0 12px;
    padding-left: 24px;
}

.howto-content .howto-list li {
    margin: 6px 0;
    line-height: 1.5;
}

.howto-content .howto-subhead {
    font-size: 1.05rem;
    margin: 18px 0 8px;
    text-align: left;
}

.howto-content code {
    background: #f0f0f0;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 0.95em;
}

/* Install Prompt Modal */
.modal-content.install-prompt-content {
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-content.install-prompt-content h2 {
    color: #ff0000;
    margin-bottom: 16px;
    text-align: center;
}

.modal-content.install-prompt-content h3 {
    color: #000000;
    font-size: 1.1rem;
    margin: 20px 0 10px;
}

.modal-content.install-prompt-content p {
    margin: 12px 0;
    line-height: 1.6;
}

.install-instructions {
    background: #f0f0f0;
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
}

.install-instructions ol {
    margin: 12px 0;
    padding-left: 24px;
}

.install-instructions li {
    margin: 8px 0;
    line-height: 1.6;
}

.install-note {
    background: #e3f2fd;
    border-left: 4px solid #000000;
    padding: 12px;
    margin: 16px 0;
    font-size: 0.95rem;
}

/* PWA Install Tip (top-right of Maps modal in browser mode) */
.pwa-install-tip {
    display: none;
    position: absolute;
    top: 50px;
    right: 10px;
    width: 300px;
    background: #fff;
    border: 2px solid #000000;
    border-radius: 8px;
    padding: 15px 20px 15px 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    z-index: 15;
    text-align: left;
    font-size: 16px;
    line-height: 1.4;
}

.pwa-install-tip.visible {
    display: block;
}

.install-tip-close {
    position: absolute;
    top: 5px;
    right: 8px;
    background: none;
    border: none;
    font-size: 25px;
    cursor: pointer;
    font-weight: bold;
    color: #666;
    line-height: 1;
    padding: 3px 5px;
}

.pwa-install-tip h4 {
    margin: 0 0 8px 0;
    color: #000000;
    font-size: 18px;
    font-weight: 700;
}

.pwa-install-tip p {
    margin: 0 0 8px 0;
    font-size: 16px;
}

.pwa-install-tip ol {
    margin: 0;
    padding-left: 22px;
}

.pwa-install-tip li {
    margin: 5px 0;
    line-height: 1.5;
    font-size: 15px;
}

/* Legend Specific: inline rows, modal shrink-wraps to content */
.modal-content.legend-content {
    width: 360px;
    max-width: 86vw;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.legend-content .legend-rows {
    width: 100%;
    box-sizing: border-box;
}

.legend-content .legend-row {
    display: grid;
    grid-template-columns: 1.5rem 64px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 8px 2px;
    text-align: left;
}

.legend-content .legend-row + .legend-row {
    border-top: 1px solid #eee;
}

.legend-content .lg-letter {
    font-weight: 700;
    font-size: 1.2rem;
    text-align: center;
    line-height: 1;
    font-family: ui-monospace, Menlo, Consolas, monospace;
}

.legend-content .lg-swatch {
    display: flex;
    flex-direction: column;
    gap: 3px;
    align-items: flex-start;
}

.legend-content .lg-swatch svg {
    display: block;
}

.legend-content .lg-label {
    font-weight: 600;
    font-size: 0.98rem;
    line-height: 1.2;
    min-width: 0;
}

/* Welcome Card (first visit) */
.welcome-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 200;
    align-items: center;
    justify-content: center;
}

.welcome-overlay.visible {
    display: flex;
}

.welcome-card {
    background: #fff;
    border-radius: 14px;
    padding: 30px 26px;
    max-width: 430px;
    width: 92%;
    text-align: left;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.welcome-card h2 {
    font-size: 1.7rem;
    color: #000000;
    margin: 0 0 18px;
    text-align: center;
}

.welcome-card p {
    font-size: 18px;
    line-height: 1.5;
    color: #333;
    margin: 0 0 16px;
}

.welcome-got-it-btn {
    display: block;
    width: 100%;
    background: #000000;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 14px;
    font-family: 'Roboto', sans-serif;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 20px;
}

/* Map Container */
#map {
    position: fixed;
    top: 60px;
    bottom: 0;
    left: 0;
    right: 0;
}

/* Move bottom-right controls up and away from edge for easier tapping */
#map .maplibregl-ctrl-bottom-right {
    right: 12px;
    bottom: 80px;
}

/* Legend control button — match Mapbox GL control appearance */
#legend-btn,
#more-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 29px;
    height: 29px;
    padding: 0;
    border: none;
    background: #fff;
    cursor: pointer;
}

/* More menu modal — small sheet with About + Send feedback */
.modal-content.more-content {
    max-width: 320px;
    width: 80%;
    padding: 24px 20px 20px;
    text-align: center;
}

.modal-content.more-content h3 {
    margin: 0 0 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.more-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.more-menu-item {
    width: 100%;
    padding: 14px 16px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    color: #000000;
    background: #fff;
    border: 2px solid #000000;
    border-radius: 8px;
    cursor: pointer;
}

.more-menu-item:active {
    background: #000000;
    color: #fff;
}

/* MAPS Modal */
.maps-modal-content {
    max-width: 360px;
    width: 90%;
    padding: 24px 20px 32px;
    text-align: center;
}

.maps-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin: 0 0 24px;
    color: #000000;
}

.maps-nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.maps-nav-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 16px;
    background: #fff;
    border: 2px solid #000000;
    border-radius: 6px;
    font-family: 'Roboto', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: #000000;
    cursor: pointer;
    text-align: left;
}

.maps-nav-btn:disabled {
    cursor: default;
    opacity: 0.85;
}

.maps-nav-btn svg {
    flex-shrink: 0;
}

/* Content Page (About) */
.page-content {
    margin-top: 80px;
    /* Below header */
    padding: 20px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Maps Sub-screens */
.maps-subscreen-content {
    max-width: 90%;
    width: 90%;
    max-height: 85vh;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.modal-back-btn {
    position: absolute;
    top: 12px;
    left: 15px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
}

.maps-subscreen-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 4px;
    color: #000000;
    text-align: center;
}

.maps-subscreen-subtitle {
    font-size: 0.8rem;
    color: #999;
    text-align: center;
    margin: 0 0 16px;
    line-height: 1.4;
}

/* Maps Nearby */
.nearby-regions-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 80px;
}

.loading-text {
    text-align: center;
    color: #666;
    margin-top: 20px;
}

/* Fallback notice when location unavailable */
.fallback-notice {
    background: #f0f0f0;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    text-align: center;
}

.fallback-notice p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* Loading spinner */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 60px 20px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top-color: #000000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.region-card {
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.region-card-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.region-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
}

.region-size {
    font-size: 0.9rem;
    color: #666;
}

.region-distance {
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 4px;
}

.download-btn {
    background: #000000;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 10px 16px;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.download-btn:disabled {
    cursor: not-allowed;
}

/* Download button states */
.download-btn.downloading {
    --progress: 0%;
    background: linear-gradient(to right, #666 var(--progress), #e0e0e0 var(--progress));
    color: #fff;
}

.download-btn.downloading span {
    position: relative;
    z-index: 1;
    color: #fff;
}

.download-btn.saved {
    background: #000000;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
}

.download-btn.saved .open-btn {
    flex: 1;
    padding: 12px 16px;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
}

.download-btn.saved .delete-btn {
    padding: 10px 12px;
    color: #ff0000;
    font-weight: 700;
    font-size: 18px;
    cursor: pointer;
    border-left: 1px solid #ddd;
}

.download-btn.saved .open-btn:hover {
    background: #222;
}

.download-btn.saved .delete-btn:hover {
    background: #ffebee;
}

/* Bottom bar download classes removed - all download progress now happens in-button */

/* Maps View - Split Screen Layout */
.maps-view-content {
    max-width: 95%;
    width: 95%;
    height: 85vh;
    max-height: 85vh;
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow: visible; /* Override .modal-content's overflow: hidden to enable child scrolling */
}

.maps-view-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 16px;
    color: #000000;
    text-align: center;
    flex-shrink: 0;
}

.maps-view-split-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    gap: 16px;
}

.maps-view-map-half {
    position: relative;
    width: 100%;
    flex: 0 0 45%;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #000000;
}

.maps-view-regions-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
}

.maps-view-region-card {
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 16px;
    margin: 0 12px 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.maps-view-region-card:last-child {
    margin-bottom: 16px;
}

.maps-view-region-card:hover {
    border-color: #000000;
}

.maps-view-region-card.selected {
    border-color: #000000;
    background: #f0f0ff;
}

.maps-view-card-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

/* Collapsible Attribution Control */
.attribution-control {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, .1);
    font-size: 11px;
    line-height: 1.4;
    display: flex;
    align-items: center;
    flex-direction: row-reverse;
}

.attribution-toggle {
    background: none;
    border: none;
    cursor: pointer;
    width: 29px;
    height: 29px;
    padding: 0;
    color: #333;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.attribution-text {
    display: none;
    color: #666;
    font-size: 10px;
    line-height: 1.3;
    padding: 4px 0 4px 8px;
    white-space: nowrap;
}

.attribution-control.expanded .attribution-text {
    display: block;
}

/* ── Custom Area Download Screen ─────────────────────────────────── */
.custom-download-content {
    max-width: 95%;
    width: 95%;
    height: 90vh;
    max-height: 90vh;
    padding: 10px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow: hidden;
}

.custom-download-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.custom-back-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000000;
    flex-shrink: 0;
}

.custom-download-content .custom-download-title {
    font-size: 1rem;
    font-weight: 700;
    color: #000000;
    margin: 0;
    white-space: nowrap;
    line-height: 1.2;
}

.custom-name-row {
    flex-shrink: 0;
}

.custom-area-name-input {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s;
}

.custom-area-name-input:focus {
    border-color: #000000;
}

.custom-area-name-input.input-error {
    border-color: #ff0000;
}

.custom-area-name-input.input-error::placeholder {
    color: #ff0000;
}

.custom-map-wrapper {
    flex: 1;
    min-height: 0;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #000000;
}

.custom-map-container {
    width: 100%;
    height: 100%;
}

/* Dashed blue rectangle overlay — matches "+ Download Custom Area" card style */
.custom-bbox-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    height: 50%;
    border: 3px dashed #000000;
    background: rgba(0, 0, 255, 0.12);
    pointer-events: none;
    z-index: 10;
    box-sizing: border-box;
}

/* Crosshair at center */
.custom-crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    pointer-events: none;
    z-index: 11;
}

.custom-crosshair::before,
.custom-crosshair::after {
    content: '';
    position: absolute;
    background: #000000;
}

.custom-crosshair::before {
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    transform: translateY(-50%);
}

.custom-crosshair::after {
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    transform: translateX(-50%);
}

/* Estimate text */
.custom-estimate {
    text-align: center;
    font-size: 14px;
    color: #666;
    flex-shrink: 0;
    min-height: 20px;
}

/* Download action button */
.custom-download-action-btn {
    flex-shrink: 0;
    margin-bottom: 24px;
}

/* "Download Custom Area" card in region list */
.custom-area-card {
    background: #fff;
    border: 2px dashed #000000;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.custom-area-card:hover {
    background: #f0f0ff;
}

.custom-area-card-text {
    color: #000000;
    font-weight: 700;
    font-size: 15px;
}

.empty-maps-message {
    text-align: center;
    color: #999;
    font-size: 14px;
    padding: 24px 16px;
    line-height: 1.5;
}

/* Map Title Overlay (for opened saved maps) */
.map-title-overlay {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #000000;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 16px;
    z-index: 200;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    cursor: pointer;
}

/* Version badge — bottom-left, subtle, safe-area aware */
.app-version {
    position: fixed;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    left: calc(16px + env(safe-area-inset-left, 0px));
    padding: 3px 8px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    font-family: 'Roboto', sans-serif;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.3px;
    z-index: 50;
    pointer-events: none;
    user-select: none;
}

/* Zoom-level readout chip — docked at the very TOP of the bottom-right control
   rail (added last → top, since MapLibre stacks bottom-right controls upward).
   Non-interactive (pointer-events:none), dark translucent, 29px wide to align
   with the control buttons below it. */
.jt-zoom-ctrl {
    pointer-events: none;
}
.jt-zoom-chip {
    width: 29px;
    height: 22px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Roboto', sans-serif;
    font-size: 11px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.2px;
    user-select: none;
}

/* Trail Inspect Bottom Sheet (feature #5) — slides up from the bottom on
   trail tap. Sits below modals (z-index 300) so MAPS/More cover it. */
#trail-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 250;
    display: flex;
    justify-content: center;
    pointer-events: none; /* only the card is interactive; map stays usable */
    transform: translateY(110%);
    transition: transform 0.22s ease;
}

#trail-sheet.visible {
    transform: translateY(0);
}

.trail-sheet-card {
    pointer-events: auto;
    background: #fff;
    width: 100%;
    max-width: 480px;
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.18);
    padding: 8px 20px calc(20px + env(safe-area-inset-bottom, 0px));
    position: relative;
    font-family: 'Roboto', sans-serif;
    max-height: 55vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.trail-sheet-handle {
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: #d0d0d0;
    margin: 4px auto 10px;
}

.trail-sheet-close {
    position: absolute;
    top: 8px;
    right: 14px;
    font-size: 24px;
    line-height: 1;
    background: none;
    border: none;
    font-weight: bold;
    color: #000000;
    cursor: pointer;
    z-index: 2;
}

#trail-sheet-title {
    font-size: 1.25rem;
    margin: 0 28px 4px 0;
    text-align: left;
    color: #000;
}

#trail-sheet-body {
    text-align: left;
}

.trail-row {
    margin: 12px 0 0;
}

.trail-row-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    margin-bottom: 3px;
}

.trail-row-value {
    font-size: 0.98rem;
    color: #222;
    line-height: 1.45;
}

.trail-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.trail-chip {
    display: inline-block;
    background: #f0f0f0;
    border-radius: 12px;
    padding: 3px 10px;
    font-size: 0.85rem;
    color: #222;
}

.trail-note {
    margin-top: 10px;
    font-size: 0.85rem;
    color: #b00;
}

.trail-osm-btn {
    display: block;
    width: max-content;
    max-width: 100%;
    margin: 18px auto 0; /* shrink-wrap + center, not full-bleed to screen edge */
    box-sizing: border-box;
    padding: 13px 30px;
    background: #000000;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: 'Roboto', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

/* External-link arrow — inline SVG (not a unicode glyph) so it renders as a
   crisp thick white arrow on both desktop and iOS, instead of iOS turning
   the ↗ character into an emoji tile. */
.trail-osm-arrow {
    width: 15px;
    height: 15px;
    margin-left: 10px;
    vertical-align: -2px;
    fill: none;
    stroke: #fff;
    stroke-width: 2.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Apple-style heading cone on the user-location dot (drawn by wireUserHeading
   in index.html — MapLibre has no native heading control). Hidden until we have
   both a position and a device-orientation heading; fades in/out. */
.jt-heading-cone-wrap {
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease;
    will-change: opacity;
}
.jt-heading-cone-wrap.visible {
    opacity: 1;
}
.jt-heading-cone {
    display: block;
}