.map-guide[hidden] { display: none !important; }

.map-guide {
    --map-guide-safe-top: 80px;
    position: fixed;
    inset: 0;
    z-index: 32000;
    display: grid;
    place-items: center;
    padding: var(--map-guide-safe-top) 18px 18px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    transition: padding-top 280ms cubic-bezier(.22, 1, .36, 1);
}

body.page-map.map-topbar-collapsed .map-guide {
    --map-guide-safe-top: 18px;
}

.map-guide__backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(15, 23, 42, .56);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: default;
}

.map-guide__dialog {
    position: relative;
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr) auto;
    width: min(1160px, calc(100vw - 36px));
    height: min(880px, calc(100dvh - var(--map-guide-safe-top) - 18px));
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .85);
    border-radius: 28px;
    background: #f8fafc;
    box-shadow: 0 34px 100px rgba(15, 23, 42, .36);
    outline: none;
    animation: map-guide-enter .28s cubic-bezier(.22, 1, .36, 1);
}

@keyframes map-guide-enter {
    from { opacity: 0; transform: translateY(18px) scale(.975); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.map-guide__header {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) 42px;
    align-items: center;
    gap: 14px;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #edf1f5;
    background: rgba(255, 255, 255, .98);
}

.map-guide__brand {
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    border-radius: 18px;
    background: linear-gradient(145deg, #ff7a2f, #f45518);
    color: #fff;
    box-shadow: 0 12px 28px rgba(249, 115, 22, .26);
}

.map-guide__brand svg { width: 28px; height: 28px; }
.map-guide__eyebrow { display: block; margin-bottom: 3px; color: #f25d20; font-size: 9px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.map-guide__header h2 { margin: 0; color: #111827; font-size: clamp(20px, 2vw, 28px); font-weight: 950; letter-spacing: -.035em; line-height: 1.05; }
.map-guide__header p { margin: 5px 0 0; color: #64748b; font-size: 12px; font-weight: 650; }

.map-guide__close {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #f8fafc;
    color: #64748b;
    font-size: 24px;
    line-height: 1;
    transition: .2s ease;
}
.map-guide__close:hover { border-color: #fed7aa; background: #fff7ed; color: #ea580c; }

.map-guide__search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: #fff;
}
.map-guide__search svg { width: 19px; height: 19px; flex: 0 0 auto; color: #94a3b8; }
.map-guide__search input { width: 100%; height: 40px; min-width: 0; border: 1px solid #e6eaf0; border-radius: 13px; background: #f8fafc; padding: 0 42px 0 14px; color: #172033; font-size: 12px; font-weight: 700; outline: 0; }
.map-guide__search input:focus { border-color: #fb923c; background: #fff; box-shadow: 0 0 0 3px rgba(251, 146, 60, .13); }
.map-guide__search button { position: absolute; right: 34px; width: 27px; height: 27px; border: 0; border-radius: 9px; background: #eef2f7; color: #94a3b8; font-size: 18px; }
.map-guide__search button:hover { color: #f97316; }

.map-guide__tabs {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    padding: 0 24px 12px;
    border-bottom: 1px solid #e6eaf0;
    background: #fff;
    scrollbar-width: none;
}
.map-guide__tabs::-webkit-scrollbar { display: none; }
.map-guide__tabs button { flex: 0 0 auto; border: 1px solid transparent; border-radius: 11px; background: transparent; padding: 9px 13px; color: #64748b; font-size: 10px; font-weight: 850; white-space: nowrap; transition: .18s ease; }
.map-guide__tabs button:hover { background: #f8fafc; color: #172033; }
.map-guide__tabs button.is-active { border-color: #fed7aa; background: #fff7ed; color: #ea580c; }

.map-guide__content { overflow-y: auto; overscroll-behavior: contain; padding: 24px; scrollbar-color: #cbd5e1 transparent; }
.map-guide__panel { display: grid; gap: 18px; max-width: 1080px; margin: 0 auto; }
.map-guide__panel[hidden] { display: none !important; }
.map-guide__empty { margin: 40px auto; color: #64748b; font-size: 13px; font-weight: 800; text-align: center; }

.map-guide__hero,
.map-guide__planner-intro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    overflow: hidden;
    border-radius: 22px;
    background: linear-gradient(125deg, #172033, #24344e);
    padding: 24px;
    color: #fff;
    box-shadow: 0 16px 38px rgba(15, 23, 42, .14);
}
.map-guide__hero span,
.map-guide__planner-intro span { color: #fdba74; font-size: 9px; font-weight: 900; letter-spacing: .15em; text-transform: uppercase; }
.map-guide__hero h3,
.map-guide__planner-intro h3 { margin: 5px 0 7px; font-size: 22px; font-weight: 950; letter-spacing: -.03em; }
.map-guide__hero p,
.map-guide__planner-intro p { max-width: 680px; margin: 0; color: #cbd5e1; font-size: 12px; font-weight: 600; line-height: 1.55; }
.map-guide__hero-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.map-guide__hero button,
.map-guide__planner-intro button { min-height: 40px; border: 1px solid rgba(255,255,255,.16); border-radius: 12px; background: rgba(255,255,255,.1); padding: 0 14px; color: #fff; font-size: 10px; font-weight: 850; white-space: nowrap; }
.map-guide__hero button:last-child,
.map-guide__planner-intro button { border-color: #f97316; background: #f97316; }
.map-guide__hero button:hover,
.map-guide__planner-intro button:hover { transform: translateY(-1px); filter: brightness(1.05); }

.map-guide__section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-top: 4px; }
.map-guide__section-head > div > span { color: #f97316; font-size: 8px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.map-guide__section-head h3 { margin: 3px 0 0; color: #172033; font-size: 17px; font-weight: 950; letter-spacing: -.02em; }
.map-guide__section-head p { max-width: 520px; margin: 0; color: #718096; font-size: 10px; font-weight: 650; line-height: 1.45; text-align: right; }
.map-guide__section-head > strong { color: #64748b; font-size: 10px; }

.map-guide__cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.map-guide__cards--four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.map-guide__card { position: relative; min-height: 150px; border: 1px solid #e8edf3; border-radius: 18px; background: #fff; padding: 18px; box-shadow: 0 7px 20px rgba(15,23,42,.035); }
.map-guide__number { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 10px; background: #fff1e8; color: #f25d20; font-size: 10px; }
.map-guide__card h4 { margin: 14px 0 7px; color: #172033; font-size: 13px; font-weight: 900; }
.map-guide__card p { margin: 0; color: #64748b; font-size: 10px; font-weight: 600; line-height: 1.5; }

.map-guide__profile-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.map-guide__profile-grid article { display: flex; align-items: center; gap: 12px; min-height: 86px; border: 1px solid #e8edf3; border-radius: 17px; background: #fff; padding: 13px; }
.map-guide__profile-grid i { display: grid; width: 42px; height: 42px; flex: 0 0 auto; place-items: center; border-radius: 14px; background: #f1f5f9; color: #475569; font-size: 14px; font-style: normal; font-weight: 950; }
.map-guide__profile-grid i.is-official,.map-guide__profile-grid i.is-hiking { background: #ecfdf3; color: #15803d; }
.map-guide__profile-grid i.is-mountain { background: #fff1e8; color: #c2410c; }
.map-guide__profile-grid i.is-weather { background: #eff6ff; color: #2563eb; }
.map-guide__profile-grid i.is-3d { background: #fff7ed; color: #ea580c; font-size: 10px; }
.map-guide__profile-grid h4 { margin: 0 0 4px; color: #172033; font-size: 11px; font-weight: 900; }
.map-guide__profile-grid p { margin: 0; color: #64748b; font-size: 9px; font-weight: 600; line-height: 1.42; }

.map-guide__progress { height: 7px; overflow: hidden; border-radius: 999px; background: #e8edf3; }
.map-guide__progress i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #fb923c, #f45b1f); transition: width .3s ease; }
.map-guide__checklist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.map-guide__checklist label { display: flex; align-items: center; gap: 10px; min-height: 44px; border: 1px solid #e8edf3; border-radius: 13px; background: #fff; padding: 0 13px; color: #475569; font-size: 10px; font-weight: 750; cursor: pointer; }
.map-guide__checklist input { width: 17px; height: 17px; accent-color: #f97316; }

.map-guide__legend-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.map-guide__legend-grid article { display: flex; align-items: center; gap: 13px; min-height: 82px; border: 1px solid #e8edf3; border-radius: 16px; background: #fff; padding: 13px; }
.map-guide__legend-grid article > i { flex: 0 0 84px; }
.map-guide__legend-grid h4 { margin: 0 0 4px; color: #172033; font-size: 10px; font-weight: 900; }
.map-guide__legend-grid p { margin: 0; color: #64748b; font-size: 9px; font-weight: 600; line-height: 1.42; }
.map-guide__line { position: relative; display: block; width: 84px; height: 18px; font-style: normal; }
.map-guide__line::before,.map-guide__line::after { content: ""; position: absolute; top: 50%; right: 0; left: 0; transform: translateY(-50%); border-radius: 999px; }
.map-guide__line.is-route::before { height: 9px; background: #fff; box-shadow: 0 0 0 1px #d7dce3; }
.map-guide__line.is-route::after { height: 5px; background: #ff641f; }
.map-guide__line.is-casing::before { height: 9px; background: #fff; box-shadow: 0 0 0 1px #d7dce3; }
.map-guide__line.is-casing::after { height: 3px; background: #64748b; }
.map-guide__line.is-alternative::after { height: 4px; background: repeating-linear-gradient(90deg,#2563eb 0 8px,transparent 8px 14px); }
.map-guide__line.is-direct::after { height: 3px; background: repeating-linear-gradient(90deg,#111827 0 5px,transparent 5px 9px); }
.map-guide__line.is-arrow { display: flex; align-items: center; justify-content: center; color: #f97316; font-size: 22px; font-weight: 900; letter-spacing: 7px; }
.map-guide__line.is-arrow::before,.map-guide__line.is-arrow::after { display: none; }
.map-guide__line.is-highway::before { height: 8px; background: #f7e4bf; box-shadow: 0 0 0 1px #c99252; }
.map-guide__line.is-highway::after { height: 3px; background: #dfa258; }
.map-guide__line.is-local-road::before { height: 7px; background: #d4cabd; }
.map-guide__line.is-local-road::after { height: 4px; background: #fff; }
.map-guide__line.is-trail::after { height: 2px; background: repeating-linear-gradient(90deg,#87583e 0 7px,transparent 7px 11px); }
.map-guide__line.is-contour::after { height: 1.5px; background: #b98956; }
.map-guide__line.is-water::after { height: 2px; background: #5ba8e8; }
.map-guide__line.is-park::before { top: 1px; bottom: 1px; height: auto; transform: none; border-radius: 4px; background: rgba(54,184,102,.18); }
.map-guide__line.is-park::after { height: 2px; background: repeating-linear-gradient(90deg,#237748 0 6px,transparent 6px 10px); }
.map-guide__line.is-selected::before { height: 9px; background: rgba(249,115,22,.18); }
.map-guide__line.is-selected::after { height: 4px; background: #f97316; }
.map-guide__distance { display: inline-grid; flex: 0 0 auto !important; min-width: 50px; min-height: 24px; place-items: center; border: 1px solid #334155; border-radius: 8px; background: #fff; padding: 0 7px; color: #172033; font-size: 9px; font-style: normal; font-weight: 900; }

.map-guide__surface-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.map-guide__surface-grid article { display: flex; align-items: center; gap: 11px; min-height: 58px; border: 1px solid #e8edf3; border-radius: 14px; background: #fff; padding: 10px 12px; }
.map-guide__surface-grid i { display: block; width: 54px; height: 6px; flex: 0 0 auto; border-radius: 999px; background: var(--surface); }
.map-guide__surface-grid i.is-dash-short { background: repeating-linear-gradient(90deg,var(--surface) 0 7px,transparent 7px 11px); }
.map-guide__surface-grid i.is-dash-long { background: repeating-linear-gradient(90deg,var(--surface) 0 11px,transparent 11px 15px); }
.map-guide__surface-grid i.is-dash-earth { background: repeating-linear-gradient(90deg,var(--surface) 0 13px,transparent 13px 18px); }
.map-guide__surface-grid i.is-dot { background: repeating-linear-gradient(90deg,var(--surface) 0 4px,transparent 4px 8px); }
.map-guide__surface-grid b { display: block; margin-bottom: 3px; color: #172033; font-size: 9px; font-weight: 900; }
.map-guide__surface-grid span { display: block; color: #64748b; font-size: 8px; font-weight: 650; }

.map-guide__terrain-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.map-guide__terrain-grid article { display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto; column-gap: 9px; align-items: center; min-height: 62px; border: 1px solid #e8edf3; border-radius: 14px; background: #fff; padding: 9px; }
.map-guide__terrain-grid i { grid-row: 1 / 3; width: 34px; height: 34px; border: 1px solid rgba(15,23,42,.06); border-radius: 10px; }
.map-guide__terrain-grid i.is-forest { background: #c6dcb3; }
.map-guide__terrain-grid i.is-meadow { background: #e3edc6; }
.map-guide__terrain-grid i.is-rock { background: #d9d6cf; }
.map-guide__terrain-grid i.is-glacier { background: linear-gradient(135deg,#edf8fb,#cfe8ef); }
.map-guide__terrain-grid i.is-wetland { background-color: #cfdfc2; background-image: repeating-linear-gradient(45deg,transparent 0 6px,rgba(75,143,112,.28) 6px 7px); }
.map-guide__terrain-grid i.is-city { background: #f2efe8; }
.map-guide__terrain-grid b { color: #172033; font-size: 9px; font-weight: 900; }
.map-guide__terrain-grid span { color: #64748b; font-size: 7.5px; font-weight: 650; }

.map-guide__symbol-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.map-guide__symbol-grid article { display: grid; grid-template-columns: 42px minmax(0,1fr); grid-template-rows: auto auto; column-gap: 10px; align-items: center; min-height: 67px; border: 1px solid #e8edf3; border-radius: 15px; background: #fff; padding: 10px; }
.map-guide__symbol-grid i { grid-row: 1 / 3; display: grid; width: 42px; height: 42px; place-items: center; border: 2px solid #fff; border-radius: 50%; color: #fff; box-shadow: 0 2px 8px rgba(15,23,42,.18); }
.map-guide__symbol-grid i.is-purple { background: #8b5cf6; }
.map-guide__symbol-grid i.is-orange { background: #f97316; }
.map-guide__symbol-grid i.is-blue { background: #3b82f6; }
.map-guide__symbol-grid i.is-green { background: #49b65f; }
.map-guide__symbol-grid i.is-yellow { background: #eab308; }
.map-guide__symbol-grid i.is-gray { background: #64748b; }
.map-guide__symbol-grid i.is-red { background: #dc2626; }
.map-guide__symbol-grid svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.map-guide__symbol-grid b { color: #172033; font-size: 9px; font-weight: 900; }
.map-guide__symbol-grid span { color: #64748b; font-size: 7.5px; font-weight: 650; line-height: 1.3; }
.map-guide__pin { display: grid; width: 34px !important; height: 34px; flex-basis: 34px !important; place-items: center; border: 2px solid #fff; border-radius: 50%; color: #fff; font-size: 10px; font-style: normal; font-weight: 950; box-shadow: 0 2px 9px rgba(15,23,42,.2); }
.map-guide__pin.is-start { background: #16a34a; }
.map-guide__pin.is-finish { background: #ef4444; }
.map-guide__pin.is-via { background: #f97316; }

.map-guide__steps { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.map-guide__steps li { display: grid; grid-template-columns: 38px minmax(0,1fr); gap: 12px; border: 1px solid #e8edf3; border-radius: 16px; background: #fff; padding: 13px; }
.map-guide__steps li > b { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 13px; background: #fff1e8; color: #f25d20; font-size: 11px; }
.map-guide__steps h4 { margin: 1px 0 4px; color: #172033; font-size: 11px; font-weight: 900; }
.map-guide__steps p { margin: 0; color: #475569; font-size: 9.5px; font-weight: 650; line-height: 1.45; }
.map-guide__steps small { display: block; margin-top: 5px; color: #94a3b8; font-size: 8px; font-weight: 650; }
.map-guide__tool-grid { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 8px; }
.map-guide__tool-grid article { display: flex; align-items: center; gap: 9px; min-height: 58px; border: 1px solid #e8edf3; border-radius: 14px; background: #fff; padding: 9px; }
.map-guide__tool-grid kbd { display: grid; min-width: 31px; height: 31px; place-items: center; border: 1px solid #dbe1e8; border-bottom-width: 3px; border-radius: 9px; background: #f8fafc; color: #334155; padding: 0 5px; font-size: 9px; font-weight: 900; }
.map-guide__tool-grid b { display: block; color: #172033; font-size: 9px; font-weight: 900; }
.map-guide__tool-grid span { display: block; margin-top: 2px; color: #64748b; font-size: 7px; font-weight: 650; line-height: 1.3; }
.map-guide__warning { display: flex; align-items: flex-start; gap: 12px; border: 1px solid #fed7aa; border-radius: 16px; background: #fff7ed; padding: 14px; }
.map-guide__warning b { flex: 0 0 auto; border-radius: 8px; background: #f97316; padding: 5px 8px; color: #fff; font-size: 8px; text-transform: uppercase; }
.map-guide__warning p { margin: 1px 0 0; color: #9a3412; font-size: 9px; font-weight: 650; line-height: 1.5; }

.map-guide__faq { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.map-guide__faq details { align-self: start; border: 1px solid #e8edf3; border-radius: 15px; background: #fff; overflow: hidden; }
.map-guide__faq summary { position: relative; padding: 14px 42px 14px 14px; color: #172033; font-size: 10px; font-weight: 850; line-height: 1.35; cursor: pointer; list-style: none; }
.map-guide__faq summary::-webkit-details-marker { display: none; }
.map-guide__faq summary::after { content: "+"; position: absolute; top: 50%; right: 14px; display: grid; width: 22px; height: 22px; place-items: center; border-radius: 8px; background: #f1f5f9; color: #64748b; font-size: 15px; transform: translateY(-50%); }
.map-guide__faq details[open] summary::after { content: "−"; background: #fff1e8; color: #f25d20; }
.map-guide__faq details[open] summary { border-bottom: 1px solid #eef2f6; }
.map-guide__faq p { margin: 0; padding: 13px 14px 15px; color: #64748b; font-size: 9.5px; font-weight: 600; line-height: 1.55; }

.map-guide__footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid #e6eaf0; background: #fff; padding: 12px 24px; }
.map-guide__footer > span { color: #94a3b8; font-size: 8px; font-weight: 700; }
.map-guide__footer kbd { border: 1px solid #dbe1e8; border-bottom-width: 2px; border-radius: 6px; background: #f8fafc; padding: 2px 5px; color: #475569; }
.map-guide__footer > div { display: flex; gap: 8px; }
.map-guide__footer button { min-height: 34px; border: 1px solid #e2e8f0; border-radius: 10px; background: #fff; padding: 0 12px; color: #64748b; font-size: 8px; font-weight: 850; }
.map-guide__footer button.is-primary { border-color: #f97316; background: #f97316; color: #fff; }

.map-guide [data-map-guide-searchable][hidden] { display: none !important; }
body.map-guide-open { overflow: hidden; }
body.map-guide-open .trailtrack-ai { visibility: hidden; }

@media (max-width: 900px) {
    .map-guide__cards--four,.map-guide__symbol-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .map-guide__profile-grid,.map-guide__legend-grid,.map-guide__surface-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .map-guide__terrain-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
    .map-guide__tool-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 767px) {
    .map-guide { --map-guide-safe-top: 0px; padding: 0; }
    .map-guide__dialog { width: 100vw; height: 100dvh; border: 0; border-radius: 0; }
    .map-guide__header { grid-template-columns: 42px minmax(0,1fr) 38px; gap: 10px; padding: 12px 14px 10px; }
    .map-guide__brand { width: 42px; height: 42px; border-radius: 14px; }
    .map-guide__brand svg { width: 23px; height: 23px; }
    .map-guide__header p { display: none; }
    .map-guide__header h2 { font-size: 19px; }
    .map-guide__close { width: 38px; height: 38px; }
    .map-guide__search { padding: 9px 14px; }
    .map-guide__search button { right: 24px; }
    .map-guide__tabs { padding: 0 14px 9px; }
    .map-guide__content { padding: 14px; }
    .map-guide__hero,.map-guide__planner-intro { align-items: flex-start; flex-direction: column; padding: 18px; }
    .map-guide__hero h3,.map-guide__planner-intro h3 { font-size: 19px; }
    .map-guide__hero-actions { width: 100%; }
    .map-guide__hero-actions button { flex: 1; }
    .map-guide__section-head { align-items: flex-start; flex-direction: column; gap: 5px; }
    .map-guide__section-head p { text-align: left; }
    .map-guide__cards--four,.map-guide__profile-grid,.map-guide__legend-grid,.map-guide__surface-grid,.map-guide__symbol-grid,.map-guide__faq { grid-template-columns: 1fr; }
    .map-guide__terrain-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .map-guide__checklist { grid-template-columns: 1fr; }
    .map-guide__footer { padding: 10px 14px; }
    .map-guide__footer > span,.map-guide__footer [data-map-guide-reset-progress] { display: none; }
    .map-guide__footer > div,.map-guide__footer button.is-primary { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .map-guide { transition: none; }
    .map-guide__dialog { animation: none; }
    .map-guide * { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
