:root {
  --ink: #26241f;
  --paper: #f3ecdd;
  --surface: #fbf6ea;
  --alpine: #3f5b43;
  --alpine-dark: #2d4330;
  --terracotta: #b5572f;
  --terracotta-dark: #8f4324;
  --line: #ded2b4;
  --muted: #7a7260;
  --danger: #8b4038;
  --radius: 10px;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0; color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif; line-height: 1.55;
  background-color: var(--paper);
  background-image: radial-gradient(color-mix(in srgb, var(--ink) 5%, transparent) .6px, transparent .6px);
  background-size: 14px 14px;
}
a { color: inherit; text-underline-offset: 3px; }
header { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: 16px clamp(20px, 5vw, 72px); border-bottom: 1px solid var(--line); background: rgba(251,246,234,.97); }
.brand { text-decoration: none; display: flex; flex-direction: column; flex: 0 0 auto; }
.brand strong { font-family: Georgia, serif; font-size: 1.45rem; font-weight: 500; font-style: italic; }
.brand span { font-family: var(--mono); font-size: .66rem; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
nav { display: flex; gap: 20px; align-items: center; }
nav a, .link { font-family: var(--mono); text-decoration: none; font-size: .78rem; letter-spacing: .03em; text-transform: uppercase; white-space: nowrap; position: relative; }
nav a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: -6px; height: 2px; background: var(--terracotta); transition: right .18s ease; }
nav a:hover::after { right: 0; }
nav form { margin: 0; }
main { max-width: 1440px; margin: auto; padding: clamp(28px, 5vw, 72px); }
footer { display: flex; justify-content: space-between; gap: 20px; padding: 28px clamp(20px, 5vw, 72px); color: var(--muted); border-top: 1px solid var(--line); font-size: .82rem; }
h1, h2 { font-family: Georgia, serif; font-weight: 400; line-height: 1.08; text-wrap: balance; }
h1 { font-size: clamp(2.5rem, 6vw, 5.6rem); margin: .2em 0; }
h2 { font-size: 1.65rem; }
.hero { position: relative; max-width: 850px; padding: 3vw 0 5vw; }
.hero.compact { padding-bottom: 2vw; }
.hero > p:last-child { font-size: 1.15rem; color: var(--muted); max-width: 650px; }
.eyebrow { font-family: var(--mono); font-size: .72rem; letter-spacing: .15em; color: var(--terracotta-dark); font-weight: 700; text-transform: uppercase; }
.eyebrow::before { content: "\2756  "; }

input, select, textarea { display: block; width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--ink); font: inherit; margin-top: 5px; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid color-mix(in srgb, var(--alpine) 35%, transparent); outline-offset: 2px; }
input[type="checkbox"] { display: inline-block; width: auto; margin-right: 8px; }
button, .button { display: inline-block; border: 0; border-radius: 3px; background: var(--alpine); color: var(--surface); padding: 13px 22px; text-decoration: none; font: inherit; font-weight: 600; letter-spacing: .01em; cursor: pointer; text-align: center; position: relative; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
button::after, .button::after { content: ""; position: absolute; inset: 3px; border: 1px solid color-mix(in srgb, var(--surface) 35%, transparent); border-radius: 2px; pointer-events: none; }
button:hover, .button:hover { background: var(--alpine-dark); transform: translateY(-1px); box-shadow: 0 8px 20px color-mix(in srgb, var(--alpine) 30%, transparent); }
button:active, .button:active { transform: translateY(0); }
button:disabled { opacity: .6; cursor: wait; transform: none; box-shadow: none; }
.secondary { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.secondary::after { display: none; }
.secondary:hover { background: var(--surface); box-shadow: 0 6px 16px rgba(30,30,25,.06); }
.danger { background: var(--danger); }
.link { background: none; color: inherit; padding: 0; border-radius: 0; }
.link::after { display: none; }
.link:hover { background: none; transform: none; box-shadow: none; }
.wide { width: 100%; margin-top: 10px; }
.stack { display: grid; gap: 14px; }
.stack p { margin: 0; }
.stack label, .filters label, .moderation label { font-size: .78rem; color: var(--muted); }
.helptext { display: block; font-size: .75rem; color: var(--muted); }
.errorlist { color: var(--danger); margin: 4px 0; padding-left: 20px; }
.form-status { min-height: 1.5rem; color: var(--alpine-dark); font-weight: 600; }
.messages { position: sticky; top: 0; z-index: 1001; max-width: 760px; margin: 12px auto; padding: 0 20px; }
.messages p { background: var(--surface); border: 1px solid var(--line); padding: 12px 16px; box-shadow: 0 8px 24px rgba(30,30,25,.08); }

.browse-hero { padding-bottom: clamp(30px, 4vw, 56px); }
.filters { padding: 20px; background: var(--surface); border: 1px solid #ebe8df; border-radius: 18px; margin-bottom: 32px; box-shadow: rgba(0,0,0,.02) 0 0 0 1px, rgba(0,0,0,.04) 0 4px 16px; }
.filter-primary { display: grid; grid-template-columns: minmax(240px, 2fr) minmax(150px, .8fr) minmax(170px, .9fr) auto; gap: 14px; align-items: end; }
.filters label > span:first-child { display: block; font-size: .75rem; color: var(--muted); font-weight: 650; margin-bottom: 6px; }
.filters input, .filters select { margin-top: 0; }
.filters button { min-height: 47px; }
.advanced-filters { margin-top: 16px; padding-top: 14px; border-top: 1px solid #efede7; }
.advanced-filters summary { width: max-content; color: var(--alpine-dark); font-size: .84rem; font-weight: 700; cursor: pointer; }
.filter-secondary { display: grid; grid-template-columns: repeat(5, minmax(130px, 1fr)); gap: 14px; padding-top: 16px; }
.input-unit { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); overflow: hidden; }
.input-unit:focus-within { outline: 3px solid color-mix(in srgb, var(--alpine) 35%, transparent); outline-offset: 2px; }
.input-unit input { border: 0; outline: 0; min-width: 0; }
.input-unit > span { padding-right: 12px; color: var(--muted); font-size: .8rem; }
.results-bar { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px 24px; margin-bottom: 20px; }
.results-bar > div:first-child { display: flex; align-items: baseline; gap: 10px; }
.results-bar > div:first-child span, #location-status { color: var(--muted); font-size: .84rem; }
.results-actions { display: flex; align-items: center; gap: 16px; }
.results-actions > a { color: var(--muted); font-size: .84rem; }
.location-button { padding: 10px 14px; }
#location-status { grid-column: 1 / -1; min-height: 0; }
.browse { background: transparent; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(18px, 2vw, 28px); }
.card { min-width: 0; display: flex; flex-direction: column; text-decoration: none; background: var(--surface); border: 1px solid #ebe8df; border-radius: 18px; overflow: hidden; box-shadow: rgba(0,0,0,.02) 0 0 0 1px, rgba(0,0,0,.04) 0 2px 8px; transition: transform .18s ease, box-shadow .18s ease; }
.card:hover { transform: translateY(-2px); box-shadow: rgba(0,0,0,.03) 0 0 0 1px, rgba(0,0,0,.08) 0 10px 28px; }
.card-media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #eeece5; }
.card-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.card:hover .card-media img { transform: scale(1.015); }
.card-placeholder { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); background: #eeece5; }
.card-placeholder strong { font-family: Georgia, serif; color: #5d625b; font-size: 1.2rem; font-weight: 500; }
.card-placeholder span { font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; }
.recommended-badge { position: absolute; top: 14px; left: 14px; padding: 7px 10px; border-radius: 999px; background: rgba(255,255,255,.94); color: var(--ink); font-size: .7rem; font-weight: 750; box-shadow: 0 2px 10px rgba(0,0,0,.1); }
.card-body { display: flex; flex: 1; flex-direction: column; padding: 20px; }
.card-labels { min-height: 27px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.difficulty-badge { --grade: var(--muted); display: inline-flex; align-items: center; gap: 6px; width: max-content; padding: 4px 10px 4px 7px; border-radius: 999px; color: var(--ink); background: var(--surface); border: 1px solid color-mix(in srgb, var(--terracotta) 55%, var(--line)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--terracotta) 18%, transparent); font-family: var(--mono); font-size: .66rem; letter-spacing: .04em; line-height: 1; font-weight: 700; text-transform: uppercase; }
.difficulty-badge i { width: 8px; height: 8px; border-radius: 50%; background: var(--grade); box-shadow: 0 0 0 2px color-mix(in srgb, var(--grade) 18%, transparent); }
.difficulty-easy { --grade: #287a45; }
.difficulty-moderate { --grade: #2465a6; }
.difficulty-hard { --grade: #ba3a34; }
.difficulty-expert { --grade: #252522; }
.review-status { color: var(--muted); font-size: .7rem; }
.card h2 { margin: 14px 0 4px; font-size: clamp(1.45rem, 2vw, 1.75rem); }
.route-type { margin: 0 0 18px; color: var(--muted); font-size: .8rem; }
.card-metrics { display: grid; grid-template-columns: repeat(3, 1fr); margin: auto 0 18px; padding: 14px 0; border-top: 1px solid #efede7; border-bottom: 1px solid #efede7; }
.card-metrics div { min-width: 0; padding-right: 8px; }
.card-metrics dt { color: var(--muted); font-size: .66rem; text-transform: uppercase; letter-spacing: .06em; }
.card-metrics dd { margin: 2px 0 0; font-size: .9rem; font-weight: 700; white-space: nowrap; }
.card-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 5px 12px; color: var(--muted); font-size: .78rem; }
.card-footer .rating { color: var(--ink); }
.card .drive-estimate { color: var(--alpine-dark); font-weight: 700; }
.empty { grid-column: 1 / -1; padding: clamp(32px, 6vw, 72px); text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; }
.empty p { color: var(--muted); }

.detail { max-width: 1240px; margin: auto; }
.detail-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 28px; }
.detail-head h1 { font-size: clamp(2.6rem, 6vw, 5rem); }
.gallery { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: 10px; overflow-x: auto; margin: 24px 0; }
.gallery img { width: 100%; height: 380px; object-fit: cover; border-radius: var(--radius); }
.stats { display: grid; grid-template-columns: repeat(6, 1fr); border: 1px solid var(--line); background: var(--surface); margin: 28px 0; border-radius: var(--radius); overflow: hidden; }
.stats div { padding: 20px; border-right: 1px solid var(--line); }
.stats div:last-child { border: 0; }
.stats strong, .stats span { display: block; }
.stats strong { font-size: 1.15rem; font-family: Georgia, serif; }
.stats span { color: var(--muted); font-size: .68rem; font-family: var(--mono); text-transform: uppercase; letter-spacing: .05em; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(340px, .8fr); gap: clamp(30px, 6vw, 80px); }
.prose { max-width: 70ch; }
.estimate, .moderation { margin: 24px 0; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.estimate p { margin-bottom: 4px; }
.estimate small { color: var(--muted); }
blockquote { margin: 12px 0; padding: 16px 18px; background: var(--surface); border-left: 3px solid var(--alpine); }
blockquote small { display: block; color: var(--muted); margin-top: 6px; }
.inline-form { display: inline; }
.inline-form button { font-size: inherit; color: var(--danger); text-decoration: underline; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }
.directions { margin: 18px 0; }
.directions a { display: inline-block; margin: 0 12px 8px 0; color: var(--alpine-dark); font-weight: 700; }
.moderation { display: grid; gap: 12px; }

.map-card, .elevation-card, .weather-card { margin: 0 0 18px; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.hike-map { height: 280px; width: 100%; }
.leaflet-container { font-family: inherit; }
.elevation-card, .weather-card { padding: 18px; }
.elevation-card h2, .weather-card h2 { font-size: .95rem; font-family: inherit; font-weight: 700; margin: 0 0 12px; }
.elevation-chart { width: 100%; height: 120px; display: block; }
.weather-now { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.weather-now strong { font-size: 1.8rem; font-family: Georgia, serif; }
.weather-now span { color: var(--muted); font-size: .82rem; }
.weather-days { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.weather-day { display: flex; flex-direction: column; gap: 3px; padding: 10px 8px; background: var(--paper); border-radius: 8px; text-align: center; }
.weather-day span { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.weather-day strong { font-size: .88rem; }
.weather-day small { font-size: .68rem; color: var(--muted); line-height: 1.3; }
.weather-widget .muted { color: var(--muted); font-size: .85rem; margin: 0; }
.weather-widget small.muted { display: block; margin-top: 12px; font-size: .72rem; }

.narrow, .auth { max-width: 720px; margin: 30px auto; padding: clamp(22px, 5vw, 48px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.auth { max-width: 520px; }
.narrow h1, .auth h1 { font-size: clamp(2.3rem, 5vw, 4rem); }

.auth-shell { display: grid; grid-template-columns: 1.05fr 1fr; max-width: 980px; margin: clamp(20px, 5vw, 56px) auto; border-radius: 22px; overflow: hidden; box-shadow: 0 24px 64px rgba(30,30,25,.09); border: 1px solid var(--line); background: var(--surface); }
.auth-visual { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; padding: clamp(28px, 4vw, 48px); background: linear-gradient(165deg, var(--alpine) 0%, var(--alpine-dark) 100%); color: white; }
.auth-visual-top strong { display: block; font-family: Georgia, serif; font-size: 1.5rem; font-weight: 500; }
.auth-visual-top span { display: block; margin-top: 4px; font-size: .78rem; opacity: .78; letter-spacing: .03em; }
.auth-visual-art { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 62%; z-index: 0; }
.auth-visual-quote { position: relative; z-index: 1; margin: 0; padding: 0; border: 0; background: none; color: inherit; font-family: Georgia, serif; font-size: 1.3rem; font-style: italic; line-height: 1.35; max-width: 320px; }
.auth-card { padding: clamp(32px, 5vw, 56px); display: flex; flex-direction: column; justify-content: center; }
.auth-card h1 { font-size: clamp(2.1rem, 4vw, 2.7rem); margin: .25em 0 .6em; }
.auth-card .muted { color: var(--muted); }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--muted); font-size: .78rem; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.google-button { display: flex; align-items: center; justify-content: center; gap: 10px; }
.auth-foot { margin: 20px 0 0; font-size: .88rem; color: var(--muted); text-align: center; }
@media (max-width: 760px) {
  .auth-shell { grid-template-columns: 1fr; margin: 16px auto; max-width: 560px; }
  .auth-visual { padding: 24px clamp(22px, 5vw, 40px); gap: 16px; }
  .auth-visual-art { display: none; }
  .auth-visual-quote { font-size: 1.05rem; max-width: none; }
  .auth-card { padding: clamp(26px, 5vw, 40px); }
}
.photo-manage { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-bottom: 24px; }
.photo-manage img { width: 100%; height: 130px; object-fit: cover; border-radius: 6px; }
.mini-card strong { display: block; color: var(--alpine); }
.photo-manage strong { display: block; color: var(--alpine); }

.user-admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.user-admin-card { display: flex; flex-direction: column; gap: 14px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.user-admin-fields { gap: 10px; }
.user-admin-fields label { font-size: .78rem; color: var(--muted); }
.user-admin-role { display: flex; align-items: end; gap: 10px; padding-top: 12px; border-top: 1px solid #efede7; }
.user-admin-role label { flex: 1; font-size: .78rem; color: var(--muted); }
.user-admin-role button { white-space: nowrap; }
.user-admin-footer { padding-top: 10px; border-top: 1px solid #efede7; text-align: right; }
.user-admin-footer .muted { color: var(--muted); font-size: .82rem; }
.user-admin-footer button.danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); padding: 8px 14px; font-size: .82rem; }
.user-admin-footer button.danger:hover { background: var(--danger); color: white; }

.library-section { padding: 24px 0; border-top: 1px solid var(--line); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { padding: 16px 18px; background: var(--surface); border: 1px dashed var(--line); border-radius: 6px; }
.stat-card strong { display: block; font-family: Georgia, serif; font-size: 1.9rem; }
.stat-card span { font-family: var(--mono); font-size: .66rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.stat-lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.stat-list { padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.stat-list h3 { margin: 0 0 10px; font-family: var(--mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--terracotta-dark); }
.stat-row { display: flex; justify-content: space-between; gap: 14px; padding: 7px 0; border-bottom: 1px dashed var(--line); text-decoration: none; font-size: .88rem; }
.stat-row:last-child { border: 0; }
.bulk-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.bulk-bar select { width: auto; margin: 0; }
.bulk-bar button { padding: 10px 16px; }
.mini-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.mini-card { display: flex; flex-direction: column; gap: 6px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; }
.mini-card span { color: var(--muted); font-size: .84rem; }
.table-wrap { overflow: auto; background: var(--surface); border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }

/* Browse page: compact route-first cards, with photography only when it exists. */
.browse-hero { position: relative; max-width: 760px; padding: 42px 0 44px; }
.browse-hero::before {
  content: ""; position: absolute; top: -10px; right: -60px; width: 320px; height: 320px; z-index: -1; pointer-events: none;
  background-image: repeating-radial-gradient(circle at 30% 35%, transparent 0, transparent 16px, color-mix(in srgb, var(--alpine) 22%, transparent) 17px, color-mix(in srgb, var(--alpine) 22%, transparent) 18px);
  -webkit-mask-image: radial-gradient(circle, black 55%, transparent 80%);
  mask-image: radial-gradient(circle, black 55%, transparent 80%);
}
.browse-hero h1 { font-family: Georgia, serif; font-style: italic; font-weight: 500; font-size: clamp(2.6rem, 5vw, 4.4rem); letter-spacing: -.01em; line-height: 1.02; }
.browse-hero > p:last-child { max-width: 590px; font-size: 1.05rem; }
.filters { padding: 16px; border-radius: 14px; margin-bottom: 26px; box-shadow: none; }
.filter-primary { grid-template-columns: minmax(320px, 1.7fr) minmax(150px, .6fr) minmax(180px, .75fr); gap: 12px; }
.search-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.search-control button { min-width: 88px; }
.advanced-filters { margin-top: 12px; padding-top: 11px; }
.results-bar { margin-bottom: 16px; }
.cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; counter-reset: trail; }
.card { display: block; position: relative; border-radius: 3px; border-style: dashed; box-shadow: 0 1px 0 rgba(0,0,0,.02); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; counter-increment: trail; }
.card::before {
  content: "Trail No. " counter(trail, decimal-leading-zero); position: absolute; top: 10px; right: 12px; z-index: 2;
  font-family: var(--mono); font-size: .62rem; letter-spacing: .05em; color: var(--surface); background: color-mix(in srgb, var(--ink) 78%, var(--terracotta) 15%);
  padding: 3px 7px; border-radius: 2px;
}
.card.has-photo::before { background: color-mix(in srgb, var(--ink) 55%, transparent); backdrop-filter: blur(2px); }
.card:hover { transform: translateY(-3px); border-color: var(--terracotta); box-shadow: 0 14px 32px rgba(30,30,25,.09); }
.card.has-photo { display: grid; grid-template-columns: 168px minmax(0, 1fr); }
.card-media { aspect-ratio: auto; min-height: 100%; }
.card-body { padding: 20px; }
.card-labels > div { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.recommended-label { color: var(--terracotta-dark); font-size: .7rem; font-weight: 700; font-family: var(--mono); text-transform: uppercase; letter-spacing: .03em; }
.card h2 { font-family: Georgia, serif; margin: 13px 0 2px; font-size: 1.3rem; font-weight: 500; font-style: italic; line-height: 1.2; letter-spacing: 0; }
.route-type { margin-bottom: 14px; }
.card-metrics { margin-bottom: 13px; padding: 11px 0; border-top-style: dashed; border-bottom-style: dashed; }
.card-metrics dt { font-family: var(--mono); }
.card-footer { min-height: 19px; }

@media (max-width: 1100px) {
  .filter-primary { grid-template-columns: 1fr 1fr; }
  .search-control { grid-column: 1 / -1; }
  .filter-secondary { grid-template-columns: repeat(3, 1fr); }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .stats div:nth-child(3) { border-right: 0; }
  .stats div:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 900px) {
  header { align-items: flex-start; }
  .brand span { display: none; }
  nav { gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
  .filter-secondary { grid-template-columns: 1fr 1fr; }
  .results-bar { grid-template-columns: 1fr; }
  .results-actions { justify-content: flex-start; }
  .detail-grid { grid-template-columns: 1fr; }
  .gallery img { height: 280px; }
}
@media (max-width: 600px) {
  main { padding: 0 16px 36px; }
  header { min-height: 68px; padding: 12px 16px; }
  .brand strong { font-size: 1.2rem; }
  nav { font-size: .8rem; }
  nav a, .link { font-size: .8rem; }
  .browse-hero { padding: 30px 0 26px; }
  .browse-hero .eyebrow { font-size: .62rem; }
  .browse-hero h1 { margin: 10px 0 9px; font-size: 2.15rem; line-height: 1.02; }
  .browse-hero > p:last-child { margin: 0; font-size: .9rem; line-height: 1.45; }
  .filters { margin: 0 0 22px; padding: 13px; border-radius: 12px; }
  .filter-primary { grid-template-columns: 1fr 1fr; gap: 10px; }
  .search-control { grid-column: 1 / -1; }
  .search-control button { min-width: 76px; padding-inline: 12px; }
  .filters input, .filters select { min-height: 44px; padding: 9px 10px; font-size: .9rem; }
  .filters label > span:first-child { margin-bottom: 4px; font-size: .68rem; }
  .advanced-filters { margin-top: 11px; }
  .advanced-filters summary { min-height: 32px; display: flex; align-items: center; }
  .filter-secondary { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
  .results-bar { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 8px 12px; margin-bottom: 14px; }
  .results-bar > div:first-child { display: block; }
  .results-bar > div:first-child span { display: none; }
  .results-actions { display: flex; align-items: center; flex-direction: row; gap: 8px; }
  .results-actions > a { order: 2; }
  .location-button { min-height: 40px; padding: 8px 11px; font-size: .8rem; }
  #location-status { width: 100%; }
  .card, .card.has-photo { display: block; border-radius: 12px; }
  .card-media { min-height: 0; aspect-ratio: 16 / 7; }
  .card-body { padding: 16px; }
  .card h2 { margin-top: 11px; font-size: 1.14rem; }
  .route-type { margin-bottom: 11px; }
  .card-metrics { margin-bottom: 10px; padding: 10px 0; }
  .card-metrics dt { font-size: .6rem; }
  .card-metrics dd { font-size: .82rem; }
  .difficulty-badge { padding: 5px 8px; }
  .detail-head { display: block; }
  .detail-head .button { margin-top: 12px; }
  .detail-grid { gap: 25px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats div, .stats div:nth-child(3) { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .stats div:nth-child(even) { border-right: 0; }
  .stats div:nth-last-child(-n+2) { border-bottom: 0; }
  .gallery img { height: 220px; }
  footer { display: block; }
}
@media (max-width: 350px) {
  .filter-primary { grid-template-columns: 1fr; }
  .search-control { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
