:root {
  font: 16px/1.55 "Segoe UI", system-ui, sans-serif;
  color: #20362d;
  background: #f5f6f1;
  --green: #1c5944;
  --dark: #162c26;
  --muted: #53675e;
  --line: #dbe3d9;
  --paper: #fff;
}
* { box-sizing: border-box; }
body, h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
a { color: var(--green); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #b47732; outline-offset: 3px; }
h1, h2 { font-family: Georgia, serif; font-weight: 500; line-height: 1.04; }
h1 { font-size: clamp(2.65rem, 6vw, 5.75rem); letter-spacing: -.055em; }
h2 { font-size: clamp(1.95rem, 4vw, 2.8rem); letter-spacing: -.045em; }
h3 { font-size: 1.05rem; }
small, .muted { color: var(--muted); }
small { font-size: .875rem; }
[hidden] { display: none !important; }
.layout { min-height: 100dvh; display: grid; grid-template-columns: 15rem minmax(0, 1fr); }
aside { background: var(--dark); color: white; padding: 1.5rem 1rem; display: flex; flex-direction: column; gap: 1.5rem; position: sticky; top: 0; height: 100dvh; overflow: auto; }
.brand { display: flex; align-items: center; gap: .65rem; font-size: 1.16rem; font-weight: 750; letter-spacing: -.04em; }
.brand-icon { width: 2.45rem; height: 2.45rem; border-radius: .8rem; display: grid; place-items: center; color: var(--dark); background: #bddc9d; }
.trip-selector { display: grid; gap: .45rem; }
.trip-selector select { color: #fff; background: #233d34; border-color: #456055; }
.rail-btn, nav button { color: #d6e6d9; background: transparent; border: 0; text-align: left; }
nav { display: grid; gap: .25rem; }
nav button { display: flex; align-items: center; gap: .7rem; border-radius: .65rem; padding: .68rem .8rem; white-space: nowrap; }
nav button:hover, nav button[aria-current="page"] { background: #355345; color: white; }
.nav-icon { width: 1.35em; text-align: center; }
.account { display: flex; justify-content: space-between; gap: .5rem; align-items: center; margin-top: auto; }
.account strong { overflow-wrap: anywhere; }
main { width: min(100%, 82rem); margin: 0 auto; padding: clamp(1rem, 3vw, 2.65rem); min-width: 0; }
.hero { min-height: clamp(19rem, 39vw, 29rem); display: flex; align-items: end; border-radius: 1.35rem;
  padding: clamp(1.3rem, 5vw, 3.3rem); color: white; background: linear-gradient(0deg, #11271fe8, #142d2844 75%), url('/hero.jpg') 50% 55% / cover, #36574b; }
.hero .eyebrow { margin-bottom: .55rem; }
.eyebrow { font-size: .875rem; letter-spacing: .08em; font-weight: 750; text-transform: uppercase; }
.hero p:last-child { margin-top: .6rem; color: #e2ebdb; }
.heading, .section-head, .row, .actions { display: flex; align-items: center; gap: .75rem; }
.heading, .section-head { justify-content: space-between; flex-wrap: wrap; }
.heading { margin: .7rem 0 1.45rem; }
.section-head { margin-bottom: .85rem; }
.heading p { margin-top: .5rem; }
.actions { flex-wrap: wrap; }
.grid, .cards, .gallery { display: grid; gap: 1rem; }
.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cards { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 1rem 0; }
.card, .panel { border: 1px solid var(--line); border-radius: 1rem; background: var(--paper); padding: clamp(.9rem, 2vw, 1.25rem); min-width: 0; overflow-wrap: anywhere; }
.card.metric { display: grid; gap: .25rem; align-content: start; }
.metric strong { font: 1.9rem Georgia, serif; }
.metric button { justify-self: start; }
.list { display: grid; gap: .65rem; }
.list > .empty { padding: 1rem 0; }
.row { justify-content: space-between; flex-wrap: wrap; }
.row > div:first-child, .row > label:first-child { flex: 1; min-width: 9rem; }
.row label { display: flex; align-items: center; gap: .6rem; overflow-wrap: anywhere; }
.done span { text-decoration: line-through; color: var(--muted); }
.tag { display: inline-block; font-size: .875rem; font-weight: 650; border-radius: 999px; padding: .16rem .6rem; background: #e7efdc; color: #2c5039; }
.btn { background: var(--green); color: white; border: 1px solid transparent; border-radius: .6rem; padding: .57rem .85rem; font-weight: 650; display: inline-block; text-decoration: none; }
.btn:hover { background: #154332; }
.btn.subtle { background: #eef3ea; color: #224838; }
.btn.subtle:hover { background: #dcebd8; }
.btn.danger { background: #f8e9e5; color: #793931; }
.btn:disabled { opacity: .65; cursor: wait; }
.people { display: flex; flex-wrap: wrap; gap: .55rem; margin: .7rem 0; }
.person { display: inline-flex; align-items: center; gap: .4rem; background: #edf2e8; padding: .25rem .6rem .25rem .25rem; border-radius: 2rem; }
.initial { border-radius: 50%; background: #c5dfae; width: 1.75rem; height: 1.75rem; text-align: center; font-weight: 700; }
.notes { white-space: pre-wrap; }
.map { height: clamp(20rem, 62vh, 38rem); border-radius: 1rem; background: #dbe8da; margin: .85rem 0; overflow: hidden; }
.map-fallback { margin: 1.2rem; }
.waypoint-marker { border: 2px solid #fff; border-radius: 50%; width: 28px; height: 28px; background: #226447; color: white; display: grid; place-items: center; padding: 0; box-shadow: 0 1px 6px #0007; }
.waypoint-marker.water { background: #226689; }
.route-days { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: .85rem; }
.total-route { margin-bottom: .65rem; background: #f5efe4; border-color: #e4d8c4; }
.practical { display: grid; gap: .85rem; }
.practical-row { display: grid; grid-template-columns: 2.35rem minmax(0, 1fr); gap: .65rem; align-items: start; }
.practical-row + .practical-row { padding-top: .85rem; border-top: 1px solid var(--line); }
.practical-row p { color: var(--muted); }
.practical-row .btn { margin-top: .45rem; }
.practical-icon { height: 2.35rem; display: grid; place-items: center; background: #edf2e8; border-radius: .65rem; }
.stays { gap: 1.5rem; }
.stay-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: .75rem; }
.stay-card { display: flex; flex-direction: column; align-items: flex-start; }
.stay-card .section-head { width: 100%; }
.stay-card address { font-style: normal; margin: .65rem 0 .4rem; }
.stay-links { padding-top: .75rem; margin-top: auto; }
.tag.option { background: #f4ead9; color: #674525; }
.route-swatch { width: .9rem; height: .9rem; flex: 0 0 auto; border-radius: 50%; background: var(--route-color); }
.water-filter { margin: .7rem 0; }
.maplibregl-popup-content { color: #20362d; font-size: .9rem; }
.maplibregl-popup-content p { margin: .3rem 0 .6rem; }
.gallery { grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
.gallery figure { margin: 0; padding: 0; overflow: hidden; }
.gallery img { display: block; width: 100%; aspect-ratio: 4/3; object-fit: cover; background: #e2e9df; }
.gallery figcaption { padding: 1rem; }
.gallery .actions { margin-top: .7rem; }
input:not([type="checkbox"]), select, textarea { width: 100%; min-width: 0; border: 1px solid #abbcb1; border-radius: .55rem; padding: .55rem .6rem; background: white; color: #20362d; }
select { appearance: none; padding-right: 2.1rem; background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%237a9282' stroke-width='2'/%3E%3C/svg%3E"); background-position: right .65rem center; background-repeat: no-repeat; }
input[type="checkbox"] { width: 1.15rem; height: 1.15rem; margin: .15rem; accent-color: var(--green); flex: 0 0 auto; }
textarea { resize: vertical; }
label.field { display: grid; gap: .25rem; font-weight: 600; }
label.field:has(input[type="checkbox"]) { display: flex; align-items: center; }
dialog { width: min(34rem, calc(100% - 2rem)); max-height: calc(100dvh - 2rem); overflow: auto; margin: auto; border: 1px solid var(--line); border-radius: 1rem; padding: 1.35rem; color: inherit; }
dialog::backdrop { background: #14281dc4; }
dialog form, .login form { display: grid; gap: .9rem; }
#status { position: fixed; z-index: 5; bottom: 1rem; right: 1rem; max-width: calc(100% - 2rem); padding: .8rem 1rem; border-radius: .7rem; background: var(--dark); color: white; box-shadow: 0 3px 20px #0003; }
.login { min-height: 100dvh; display: grid; place-content: center; gap: 1rem; padding: 1.2rem; background: linear-gradient(#18372acb, #162c26), url('/hero.jpg') center/cover; }
.login .brand { color: white; }
.login .panel { width: min(26rem, 100%); padding: 1.5rem; }
.login h1 { font-size: 3.1rem; }
.loading { padding: 2rem; }
@media (max-width: 780px) {
  .layout { display: block; }
  aside { height: auto; position: relative; padding: .75rem 1rem; gap: .7rem; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .brand { grid-row: 1; }
  .account { grid-row: 1; grid-column: 2; margin: 0; }
  .trip-selector, nav { grid-column: 1 / -1; }
  .trip-selector { grid-template-columns: minmax(0, 1fr) auto; }
  nav { display: flex; overflow: auto; }
  nav button { padding: .55rem .65rem; }
}
@media (max-width: 540px) {
  .grid { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr 1fr; gap: .5rem; }
  .cards .metric:last-child { grid-column: 1 / -1; }
  .hero { min-height: 16rem; }
}
