@font-face {
    font-family: Inter;
    src: url("../fonts/InterVariable.woff2") format("woff2");
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
}

:root {
    color-scheme: light;
    --green: #234638;
    --green-deep: #17362c;
    --green-light: #e7eee8;
    --cream: #f5f0e5;
    --paper: #fffcf4;
    --red: #a5483c;
    --gold: #c49a52;
    --ink: #30332f;
    --muted: #6d716a;
    --line: #ded8cb;
    --walk-sheet-collapsed-height: clamp(72px, 14dvh, 95px);
    --shadow: 0 16px 42px rgb(35 70 56 / 10%);
    font-family: Inter, "Avenir Next", Avenir, "Segoe UI", sans-serif;
    background: var(--cream);
    color: var(--ink);
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    min-height: 100%;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    background: radial-gradient(ellipse at 86% 2%, rgb(196 154 82 / 12%), transparent 25rem),
    var(--cream);
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    font: inherit;
}

button:focus-visible,
a:focus-visible,
summary:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 3px;
}

[hidden] {
    display: none !important;
}

.site-header {
    position: sticky;
    z-index: 20;
    top: 0;
    display: flex;
    min-height: 68px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px max(18px, calc((100vw - 1180px) / 2));
    border-bottom: 1px solid rgb(48 51 47 / 8%);
    background: rgb(245 240 229 / 94%);
    backdrop-filter: blur(14px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--green);
    text-decoration: none;
}

.brand-mark {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 1px solid var(--gold);
    border-radius: 50%;
    background: var(--paper);
    color: var(--red);
    font-size: 22px;
}

.brand-name,
.brand-place {
    display: block;
}

.brand-name {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 16px;
    font-weight: 700;
}

.brand-place {
    margin-top: 2px;
    color: var(--muted);
    font-size: 10px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.connection-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--green);
    font-size: 12px;
    white-space: nowrap;
}

.connection-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #5e8a68;
    box-shadow: 0 0 0 4px rgb(94 138 104 / 13%);
}

.connection-status.is-offline {
    color: var(--red);
}

.connection-status.is-offline .connection-dot {
    background: var(--red);
    box-shadow: 0 0 0 4px rgb(165 72 60 / 12%);
}

.gps-header-button {
    display: grid;
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    place-items: center;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--paper);
    color: var(--green);
    cursor: pointer;
    transition: background-color 140ms ease, color 140ms ease;
}

.gps-header-button:hover,
.gps-header-button.is-active {
    border-color: var(--green);
    background: var(--green);
    color: white;
}

.gps-header-button svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    clip-path: inset(50%);
}

main {
    width: min(100% - 32px, 1180px);
    margin: 0 auto;
    padding: 18px 0 48px;
}

.storage-notice {
    border-color: rgb(165 72 60 / 30%);
    color: var(--red);
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--red);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

h1,
h2,
p {
    margin-top: 0;
}

h1,
h2 {
    color: var(--green);
    font-family: Georgia, "Times New Roman", serif;
}

.welcome {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr);
    min-height: 310px;
    align-items: center;
    gap: clamp(24px, 5vw, 72px);
    overflow: hidden;
    margin: 10px 0 35px;
    padding: clamp(22px, 5vw, 52px);
    border: 1px solid rgb(35 70 56 / 8%);
    border-radius: 26px;
    background: radial-gradient(ellipse at 20% 100%, rgb(196 154 82 / 14%), transparent 42%),
    var(--paper);
    box-shadow: var(--shadow);
}

.welcome-art {
    position: relative;
    min-height: 235px;
    overflow: hidden;
    border: 1px solid rgb(231 212 169 / 42%);
    border-radius: 22px;
    background: #19392f;
    color: #f1dfb8;
}

.welcome-art img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 30% 45%;
}

.welcome-art::after {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 55%, rgb(18 42 34 / 72%) 100%);
    content: "";
}

.art-village {
    position: absolute;
    z-index: 3;
    bottom: 12%;
    left: 50%;
    color: #f3e5c4;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.34em;
    transform: translateX(-50%);
}

.welcome-copy {
    min-width: 0;
    max-width: 580px;
    padding: 8px 0;
}

.welcome h1,
.completed-view h1 {
    margin: 0 0 15px;
    font-size: clamp(36px, 5.2vw, 61px);
    font-weight: 500;
    letter-spacing: -0.045em;
    line-height: 1.02;
}

.welcome h1 em,
.completed-view h1 em {
    color: var(--red);
    font-weight: 400;
}

.intro {
    max-width: 490px;
    margin-bottom: 16px;
    color: #565b54;
    font-size: 15px;
    line-height: 1.65;
}

.demo-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: #765d31;
    font-size: 11px;
    font-weight: 650;
}

.demo-label span {
    color: var(--gold);
    font-size: 17px;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 14px 0;
}

.section-heading h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 500;
    letter-spacing: -0.025em;
}

.section-heading .eyebrow {
    margin-bottom: 5px;
}

.section-spark,
.progress-spark {
    color: var(--gold);
    font-size: 30px;
}

.route-choices {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
    gap: 13px;
}

.route-card {
    display: flex;
    width: 100%;
    min-height: 106px;
    align-items: center;
    gap: 14px;
    padding: 17px;
    border: 1px solid var(--line);
    border-radius: 17px;
    background: var(--paper);
    box-shadow: 0 5px 16px rgb(35 70 56 / 4%);
    color: var(--ink);
    text-align: left;
    cursor: pointer;
    transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.route-card:hover {
    border-color: var(--gold);
    box-shadow: 0 9px 24px rgb(35 70 56 / 8%);
    transform: translateY(-2px);
}

.route-card:active {
    transform: scale(0.99);
}

.route-number {
    display: grid;
    width: 48px;
    height: 48px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid #d5bd8d;
    border-radius: 50%;
    background: #f3ead7;
    color: var(--green);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 17px;
}

.route-copy {
    display: grid;
    min-width: 0;
    flex: 1 1 auto;
    gap: 5px;
}

.route-copy strong {
    color: var(--green);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 18px;
}

.route-copy span {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.4;
}

.route-thumb {
    position: relative;
    width: 72px;
    height: 72px;
    flex: 0 0 auto;
}

.route-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    object-fit: cover;
    object-position: 50% 45%;
}

.route-card .route-thumb .route-number {
    position: absolute;
    right: -6px;
    bottom: -6px;
    width: 30px;
    height: 30px;
    border-color: var(--paper);
    border-width: 2px;
    font-size: 12px;
}

.route-card.is-complete {
    border-color: #c5d3c8;
}

.route-card.is-complete .route-number {
    border-color: var(--green);
    background: var(--green);
    color: var(--paper);
}

.route-copy .route-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--green);
    font-weight: 650;
}

.route-copy .route-status span {
    color: inherit;
}

.route-status svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    padding: 2px;
    border-radius: 50%;
    background: var(--green-light);
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 3;
}

.route-distance {
    flex: 0 0 auto;
    color: var(--green);
    font-size: 12px;
    font-weight: 750;
    white-space: nowrap;
}

.route-distance span {
    display: block;
    margin-top: 5px;
    color: var(--gold);
    font-size: 20px;
    text-align: right;
}

.resume-card {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: -12px 0 30px;
    padding: 17px 19px;
    border: 1px solid rgb(35 70 56 / 20%);
    border-radius: 16px;
    background: var(--green);
    color: white;
    box-shadow: var(--shadow);
}

.resume-card .eyebrow {
    margin-bottom: 5px;
    color: #ead9b7;
}

.resume-card strong,
.resume-card span {
    display: block;
}

.resume-card strong {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 19px;
}

.resume-card span:not(.eyebrow) {
    margin-top: 4px;
    color: rgb(255 255 255 / 75%);
    font-size: 12px;
}

.primary-button,
.secondary-button {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    font-size: 13px;
    font-weight: 750;
    cursor: pointer;
    transition: background-color 140ms ease, transform 140ms ease;
}

.primary-button {
    padding: 0 18px;
    border: 1px solid var(--green);
    background: var(--green);
    color: white;
}

.primary-button:hover {
    background: var(--green-deep);
}

.resume-card .primary-button {
    min-width: 135px;
    border-color: #e7d4a9;
    background: #e7d4a9;
    color: var(--green);
}

.secondary-button {
    padding: 0 16px;
    border: 1px solid var(--line);
    background: var(--paper);
    color: var(--green);
}





.word-bank:empty::before {
    content: "Sleep hier om woorden terug te leggen.";
}

.word-token,
.word-tile {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 18px;
    font-weight: 700;
}

.progress-card {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 18px;
    margin: 20px 0 0;
    padding: 16px 19px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgb(255 252 244 / 75%);
}

.action-link-card {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 12px 0 0;
    padding: 14px 19px;
    border: 1px dashed #cfc6b3;
    border-radius: 16px;
    color: var(--ink);
    text-decoration: none;
    transition: border-color 150ms ease, background 150ms ease;
}

.action-link-card:hover {
    border-color: var(--gold);
    background: rgb(255 252 244 / 75%);
}

.action-link-icon {
    display: grid;
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--paper);
    color: var(--green);
}

.action-link-icon svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.action-link-copy {
    display: grid;
    min-width: 0;
    flex: 1 1 auto;
    gap: 3px;
}

.action-link-copy strong {
    color: var(--green);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 16px;
    font-weight: 500;
}

.action-link-copy span {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.action-link-arrow {
    color: var(--gold);
    font-size: 18px;
}

button.action-link-card.install-card {
    width: 100%;
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

button.action-link-card.install-card[hidden] {
    display: none;
}

.install-steps {
    display: grid;
    gap: 10px;
    margin: 4px 0 0;
    padding-left: 22px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
    text-align: left;
}

.install-steps strong {
    color: var(--ink);
}

.install-share-icon {
    width: 16px;
    height: 16px;
    vertical-align: -3px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.progress-copy {
    display: flex;
    min-width: min(165px, 100%);
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.progress-copy .eyebrow {
    margin: 0 0 5px;
}

.progress-copy strong {
    color: var(--green);
    font-size: 13px;
}

.progress-spark {
    font-size: 20px;
}

.progress-track {
    height: 7px;
    flex: 1 1 auto;
    overflow: hidden;
    border-radius: 99px;
    background: #e4ded2;
}

.progress-track span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--gold);
    transition: width 180ms ease;
}

.text-button {
    min-height: 38px;
    padding: 0 2px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 11px;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.walk-view {
    padding-bottom: 12px;
}

.walk-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 13px;
}

.back-button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    gap: 8px;
    padding: 0 10px 0 0;
    border: 0;
    background: transparent;
    color: var(--green);
    font-size: 13px;
    font-weight: 750;
    cursor: pointer;
}

.back-button span:first-child {
    font-size: 20px;
}

.walk-topline-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.walk-tag {
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 99px;
    background: rgb(255 252 244 / 70%);
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
}

.list-toggle {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    gap: 6px;
    padding: 0 13px;
    border: 1px solid var(--green);
    border-radius: 10px;
    background: var(--green);
    color: white;
    font-size: 12px;
    font-weight: 750;
    cursor: pointer;
}

.list-toggle span {
    font-size: 17px;
}

.walk-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 15px;
}

.walk-heading h1 {
    margin: 0;
    font-size: clamp(25px, 3vw, 34px);
    font-weight: 500;
    letter-spacing: -0.025em;
}

.walk-heading .eyebrow {
    margin-bottom: 5px;
}

.walk-progress {
    max-width: 390px;
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.5;
    text-align: right;
}

.walk-layout {
    position: relative;
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 14px;
}

.walk-sidebar {
    display: block;
    min-width: 0;
    order: 1;
}

.walk-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 3px 2px 6px;
}

.walk-sheet {
    position: fixed;
    z-index: 25;
    right: 0;
    bottom: var(--visual-viewport-bottom, 0px);
    left: 0;
    display: flex;
    height: var(--walk-sheet-collapsed-height);
    max-height: calc(100dvh - 90px);
    flex-direction: column;
    overflow: hidden;
    padding: 5px 12px max(12px, env(safe-area-inset-bottom));
    border: 1px solid var(--line);
    border-right: 0;
    border-left: 0;
    border-bottom: 0;
    border-radius: 20px 20px 0 0;
    background: var(--paper);
    box-shadow: 0 -12px 40px rgb(22 46 36 / 16%);
    transition: height 220ms ease;
}

.walk-sheet.is-expanded {
    height: min(76dvh, 260px);
}

.walk-sheet.is-dragging {
    transition: none;
    user-select: none;
}

.sheet-handle {
    display: grid;
    width: 100%;
    min-height: 25px;
    flex: 0 0 25px;
    place-items: center;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: grab;
    touch-action: none;
}

.sheet-handle:active {
    cursor: grabbing;
}

.sheet-handle-bar {
    width: 43px;
    height: 4px;
    border-radius: 99px;
    background: #b8b2a7;
}

.walk-sheet-content {
    display: flex;
    min-height: 0;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 9px;
    overflow: hidden;
}

.walk-sheet.is-expanded .walk-sheet-content {
    overflow-y: auto;
    overscroll-behavior: contain;
}

.summary-icon {
    display: grid;
    width: 35px;
    height: 35px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    background: #f3ead7;
    color: var(--red);
    font-size: 18px;
}

.walk-summary .eyebrow {
    margin-bottom: 2px;
    font-size: 9px;
}

.walk-summary strong {
    color: var(--green);
    font-size: 12px;
}

.map-card {
    order: 0;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--paper);
    box-shadow: var(--shadow);
}

.map-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 15px 9px;
}

.map-heading .eyebrow {
    margin-bottom: 0;
    font-size: 9px;
    white-space: nowrap;
}

.map-heading strong {
    min-width: 0;
    overflow: hidden;
    color: var(--green);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 15px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.map-north {
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
}

.route-map {
    height: clamp(160px, 48dvh, 500px);
    min-height: min(310px, 38dvh);
    overscroll-behavior: contain;
}

.route-map .maplibregl-canvas-container {
    overscroll-behavior: contain;
}

.route-map .maplibregl-map {
    width: 100%;
    height: 100%;
    background: #f7f3e9;
    color: var(--ink);
    font-family: Inter, "Avenir Next", Avenir, "Segoe UI", sans-serif;
}

.route-map .maplibregl-ctrl-attrib {
    font-size: 9px;
}

.route-map .maplibregl-ctrl-group {
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgb(25 49 39 / 18%);
}

.route-map .maplibregl-ctrl-group button {
    color: var(--green);
}

.map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    padding: 10px 14px 12px;
    border-top: 1px solid rgb(48 51 47 / 7%);
    color: var(--muted);
    font-size: 10px;
}

.map-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border: 2px solid var(--route-color, var(--gold));
    border-radius: 50%;
    background: var(--paper);
}

.legend-dot.seen {
    border-color: var(--route-color, var(--green));
    background: var(--route-fill-color, var(--green-light));
}

.legend-dot.selected {
    border-color: #9a7131;
    background: var(--route-color, var(--green));
    outline: 2px solid var(--route-color, var(--green));
}

.next-stop-card {
    position: relative;
    margin: 0;
    padding: 13px;
    border: 1px solid rgb(35 70 56 / 20%);
    border-radius: 16px;
    background: var(--green);
    box-shadow: var(--shadow);
    color: white;
}

.next-stop-card.needs-attention {
    animation: next-stop-pulse 2.1s ease-in-out infinite;
}

.next-stop-card.is-arriving {
    animation: next-stop-arrival 900ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.next-stop-card .eyebrow {
    margin-bottom: 10px;
    color: #ead9b7;
}

#nextStop {
    display: flex;
    min-height: 43px;
    align-items: center;
    gap: 12px;
}

.stop-index {
    display: grid;
    width: 43px;
    height: 43px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid #d5bd8d;
    border-radius: 50%;
    color: #f2dfb6;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 15px;
}

.next-stop-copy strong,
.next-stop-copy span {
    display: block;
}

.next-stop-copy strong {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.35;
}

.next-stop-copy span {
    margin-top: 4px;
    color: rgb(255 255 255 / 73%);
    font-size: 10px;
}

.all-done {
    margin: 0;
    color: white;
    font-size: 13px;
    line-height: 1.5;
}

.stop-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.stop-actions .primary-button {
    min-width: 115px;
    border-color: #e7d4a9;
    background: #e7d4a9;
    color: var(--green);
}

.stop-actions .secondary-button {
    border-color: rgb(255 255 255 / 33%);
    background: transparent;
    color: white;
}

.route-map .maplibregl-popup-content {
    min-width: 170px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgb(255 252 244 / 98%);
}

.route-map .maplibregl-popup-close-button {
    display: none;
}

.route-map .church-map-popup .maplibregl-popup-close-button {
    display: block;
}

.route-map .maplibregl-popup-anchor-top .maplibregl-popup-tip,
.route-map .maplibregl-popup-anchor-top-left .maplibregl-popup-tip,
.route-map .maplibregl-popup-anchor-top-right .maplibregl-popup-tip {
    border-bottom-color: rgb(255 252 244 / 98%);
}

.route-map .maplibregl-popup-anchor-bottom .maplibregl-popup-tip,
.route-map .maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip,
.route-map .maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip {
    border-top-color: rgb(255 252 244 / 98%);
}

.route-map .maplibregl-popup-anchor-left .maplibregl-popup-tip {
    border-right-color: rgb(255 252 244 / 98%);
}

.route-map .maplibregl-popup-anchor-right .maplibregl-popup-tip {
    border-left-color: rgb(255 252 244 / 98%);
}

.stop-popup strong,
.stop-popup span,
.stop-popup small {
    display: block;
}

.stop-popup strong {
    color: var(--green);
    font-size: 13px;
}

.stop-popup span {
    margin-top: 4px;
    color: var(--ink);
    font-size: 12px;
    line-height: 1.35;
}

.stop-popup small {
    margin-top: 5px;
    color: var(--muted);
    font-size: 10px;
}

.church-popup strong,
.church-popup span,
.church-popup a {
    display: block;
}

.church-popup strong {
    color: var(--green);
    font-size: 13px;
}

.church-popup span,
.church-popup a {
    margin-top: 5px;
    font-size: 12px;
    line-height: 1.35;
}

.church-popup span {
    color: var(--ink);
}

.church-popup a {
    color: var(--green);
    font-weight: 650;
}

.stop-list-section {
    display: none;
    min-width: 0;
    order: 4;
    margin: 0;
    padding: 17px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--paper);
}

.stop-list-section.is-open {
    position: fixed;
    z-index: 31;
    right: 0;
    bottom: 0;
    left: 0;
    display: block;
    max-height: min(82dvh, 760px);
    overflow: auto;
    padding: 18px 18px max(20px, env(safe-area-inset-bottom));
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -12px 42px rgb(22 46 36 / 22%);
    animation: sheet-enter 180ms ease-out;
}

.stop-list-header {
    position: sticky;
    z-index: 2;
    top: 0;
    background: var(--paper);
}

.stop-list-backdrop:not([hidden]) {
    position: fixed;
    z-index: 30;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgb(16 32 25 / 48%);
}

.section-heading.compact {
    align-items: center;
    margin: 0 0 12px;
}

.section-heading.compact h2 {
    font-size: 21px;
}

.list-count {
    margin-left: auto;
    color: var(--muted);
    font-size: 10px;
}

.list-close {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    place-items: center;
    margin-left: 4px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: transparent;
    color: var(--green);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.stop-filters {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    margin: 0 -2px 12px;
    padding: 2px;
}

.filter-chip {
    min-height: 34px;
    flex: 0 0 auto;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 99px;
    background: transparent;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
}

.filter-chip.is-active {
    border-color: var(--green);
    background: var(--green);
    color: white;
}

.stop-list {
    display: grid;
    grid-auto-rows: minmax(58px, auto);
    align-content: start;
    gap: 7px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.stop-row {
    display: block;
    height: auto;
    min-height: 58px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fffdf8;
    box-shadow: 0 2px 5px rgb(35 70 56 / 7%);
}

.stop-row-header {
    display: flex;
    min-height: 56px;
    align-items: center;
}

.stop-row-header .stop-select {
    width: 100%;
}

.stop-letter-open {
    display: grid;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    place-items: center;
    margin-right: 7px;
    border: 1px solid transparent;
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.stop-letter-open:hover,
.stop-letter-open:focus-visible {
    border-color: var(--line);
    background: var(--green-light);
    color: var(--green);
}

.stop-row.is-current {
    border-color: var(--gold);
    box-shadow: 0 2px 5px rgb(35 70 56 / 7%), 0 0 0 2px rgb(196 154 82 / 12%);
}

.stop-list-letter {
    display: inline-flex;
    min-width: 48px;
    height: 28px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    border: 1px solid rgb(196 154 82 / 55%);
    border-radius: 14px;
    background: #f3ead7;
    color: var(--green);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.stop-list-letter[hidden] {
    display: none;
}

.stop-select {
    display: flex;
    min-width: 0;
    min-height: 56px;
    flex: 1 1 auto;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border: 0;
    border-radius: inherit;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.stop-list-number {
    display: grid;
    width: 31px;
    height: 31px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--green);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 11px;
}

.stop-list-copy {
    display: grid;
    min-width: 0;
    flex: 1 1 auto;
    gap: 3px;
}

.stop-list-copy strong {
    overflow: hidden;
    color: var(--ink);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stop-list-copy small {
    color: var(--muted);
    font-size: 9px;
}

.stop-row.seen .stop-list-number {
    border-color: var(--route-color, var(--green));
    background: var(--route-color, var(--green));
    color: white;
}

.stop-row.skipped .stop-list-copy small {
    color: var(--red);
}

.undo-inline {
    display: grid;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    place-items: center;
    margin-right: 7px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 50%;
    background: transparent;
    color: var(--green);
    cursor: pointer;
}

.undo-inline:hover,
.undo-inline:focus-visible {
    border-color: var(--line);
    background: var(--green-light);
}

.undo-inline svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.empty-filter {
    margin: 14px 0 4px;
    color: var(--muted);
    font-size: 12px;
}

.completed-view {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    align-items: center;
    gap: clamp(18px, 4vw, 36px);
    max-width: 940px;
    min-height: min(70vh, 650px);
    margin: 25px auto;
    padding: clamp(22px, 5vw, 56px);
    border: 1px solid rgb(35 70 56 / 8%);
    border-radius: 26px;
    background: var(--paper);
    box-shadow: var(--shadow);
}

.letter-puzzle {
    display: grid;
    grid-column: 1 / -1;
    gap: 10px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fffdf8;
}

.letter-puzzle .eyebrow,
.letter-puzzle h2,
.letter-puzzle-instructions,
.letter-puzzle-status {
    margin: 0;
}

.letter-puzzle h2 {
    font-size: 24px;
}

.letter-puzzle-instructions,
.letter-puzzle-status {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.positioned-word {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.positioned-letter {
    display: grid;
    width: 46px;
    min-height: 58px;
    place-items: center;
    padding: 5px 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: white;
    color: var(--green);
}

.positioned-letter span {
    font-size: 22px;
    font-weight: 800;
}

.positioned-letter small {
    color: var(--muted);
    font-size: 11px;
    line-height: 1;
}

.positioned-letter.is-empty {
    border-style: dashed;
    color: #a49b8b;
}

.completion-art {
    position: relative;
    display: grid;
    min-height: 290px;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgb(231 212 169 / 35%);
    border-radius: 22px;
    background: radial-gradient(circle at 50% 45%, rgb(196 154 82 / 16%) 0 21%, transparent 21.5%),
    linear-gradient(145deg, #274a3d, #17362c);
}

.completion-photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.completion-art.has-photo > span {
    display: none;
}

.completion-art.has-photo::after {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 60%, rgb(18 42 34 / 45%) 100%);
    content: "";
}

.completion-halo {
    position: absolute;
    top: 14%;
    left: 50%;
    width: 170px;
    height: 170px;
    border: 1px solid rgb(231 212 169 / 48%);
    border-radius: 50%;
    transform: translateX(-50%);
}

.completion-tree {
    position: absolute;
    z-index: 1;
    bottom: 16%;
    width: 128px;
    height: 180px;
    clip-path: polygon(50% 0, 100% 52%, 70% 52%, 95% 81%, 60% 81%, 60% 100%, 40% 100%, 40% 81%, 5% 81%, 30% 52%, 0 52%);
    background: #d1d6b7;
    color: #d1d6b7;
    filter: drop-shadow(0 10px 0 rgb(8 28 20 / 30%));
}

.tree-a {
    left: 7%;
    width: 100px;
    height: 145px;
}

.tree-b {
    right: 4%;
    bottom: 12%;
}

.completion-light {
    position: absolute;
    z-index: 2;
    top: 39%;
    left: 50%;
    display: grid;
    width: 72px;
    height: 72px;
    place-items: center;
    border: 1px solid #e8cc8d;
    border-radius: 50%;
    background: #e8cc8d;
    color: var(--green);
    font-size: 39px;
    box-shadow: 0 0 38px rgb(232 204 141 / 42%);
    transform: translate(-50%, -50%);
}

.completion-star {
    position: absolute;
    z-index: 3;
    color: #f4e4c0;
    text-shadow: 0 0 18px rgb(231 212 169 / 65%);
}

.star-a {
    top: 18%;
    left: 20%;
    font-size: 28px;
}

.star-b {
    top: 24%;
    right: 17%;
    color: #d3a75d;
    font-size: 19px;
}

.completion-copy {
    min-width: 0;
    max-width: 520px;
}

.completion-copy h1 {
    font-size: clamp(32px, 5vw, 56px);
    overflow-wrap: anywhere;
}

.completion-stats {
    display: flex;
    gap: 12px;
    margin: 23px 0;
}

.completion-stats div {
    display: grid;
    min-width: 0;
    flex: 1 1 0;
    gap: 3px;
    padding: 13px 15px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #fffdf8;
}

.completion-stats strong {
    color: var(--green);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 25px;
}

.completion-stats span {
    color: var(--muted);
    font-size: 10px;
}

.completion-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.completion-copy .text-button {
    margin-top: 8px;
}

.completion-note {
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
    gap: 10px;
    margin-top: 0;
    padding: 12px 14px;
    border-radius: 12px;
    background: #f5f0e5;
    color: #765d31;
}

.completion-note span {
    color: var(--gold);
    font-size: 19px;
}

.completion-note p {
    margin: 0;
    font-size: 11px;
}

.site-footer {
    display: flex;
    width: min(100% - 32px, 1180px);
    justify-content: space-between;
    gap: 10px;
    margin: 0 auto;
    padding: 0 0 23px;
    color: var(--muted);
    font-size: 10px;
}

.site-footer a {
    color: inherit;
    text-underline-offset: 2px;
}

.toast {
    position: fixed;
    z-index: 50;
    right: 16px;
    bottom: max(16px, env(safe-area-inset-bottom));
    left: 16px;
    width: fit-content;
    max-width: min(500px, calc(100vw - 32px));
    margin: 0 auto;
    padding: 13px 17px;
    border: 1px solid rgb(255 255 255 / 20%);
    border-radius: 99px;
    background: var(--green-deep);
    box-shadow: var(--shadow);
    color: white;
    font-size: 12px;
    text-align: center;
}

.toast.is-centered {
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
}

.confirm-dialog {
    width: min(400px, calc(100vw - 24px));
    max-width: none;
    max-height: calc(100dvh - 24px);
    overflow: auto;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--paper);
    box-shadow: var(--shadow);
    color: var(--ink);
}

.confirm-dialog[open] {
    animation: sheet-enter 180ms ease-out;
}

.confirm-dialog::backdrop {
    background: rgb(23 54 44 / 45%);
}

.confirm-dialog-body {
    padding: clamp(18px, 5vw, 26px) clamp(16px, 5vw, 24px) 22px;
    text-align: center;
}

.confirm-dialog-icon {
    display: inline-grid;
    width: 42px;
    height: 42px;
    place-items: center;
    margin-bottom: 12px;
    border-radius: 50%;
    background: var(--green-light);
    color: var(--gold);
    font-size: 20px;
}

.confirm-dialog h2 {
    margin: 0 0 8px;
    font-size: 22px;
    line-height: 1.2;
}

.confirm-dialog p:not(.eyebrow) {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.confirm-dialog-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 120px), 1fr));
    gap: 10px;
    margin-top: 22px;
}

.confirm-dialog-actions button {
    padding: 6px 12px;
    line-height: 1.2;
}

.letter-entry-body {
    margin: 0;
}

.letter-entry-status {
    margin-top: 16px;
    text-align: left;
}

.letter-entry-body p.letter-entry-status-label {
    margin: 0 0 8px;
    color: var(--green);
    font-size: 12px;
    font-weight: 700;
}

.letter-entry-body .letter-entry-stop-actions {
    margin-top: 0;
}

.letter-entry-stop-actions .primary-button {
    flex: 1 1 auto;
}

.letter-entry-stop-actions .secondary-button {
    border-color: var(--line);
    background: var(--paper);
    color: var(--green);
}

.letter-entry-fields {
    display: grid;
    gap: 6px;
    margin-top: 18px;
    text-align: left;
}

.letter-entry-fields label {
    color: var(--green);
    font-size: 12px;
    font-weight: 700;
}

.letter-entry-fields input {
    width: 100%;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: white;
    color: var(--ink);
    font: inherit;
    font-size: 16px;
}

.letter-entry-fields input:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

.letter-entry-body .letter-entry-hint {
    margin: 12px 0 0 !important;
    text-align: left;
}

.church-dialog-icon {
    color: var(--green);
}

.church-website-link {
    display: inline-block;
    margin-top: 12px;
    color: var(--green);
    font-size: 13px;
    font-weight: 650;
}

.church-dialog-actions {
    grid-template-columns: 1fr;
}

#confirmAccept {
    border-color: var(--red);
    background: var(--red);
}

#confirmAccept:hover {
    background: #8c3b31;
}

@keyframes sheet-rise {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes next-stop-pulse {
    0%,
    100% {
        box-shadow: var(--shadow);
        border-color: rgb(35 70 56 / 20%);
    }
    50% {
        box-shadow: 0 0 0 3px rgb(231 212 169 / 28%), var(--shadow);
        border-color: #e7d4a9;
    }
}

@keyframes next-stop-arrival {
    0% {
        opacity: 0.55;
        transform: translateY(12px) scale(0.97);
        box-shadow: var(--shadow);
    }
    45% {
        opacity: 1;
        transform: translateY(-4px) scale(1.015);
        box-shadow: 0 0 0 5px rgb(231 212 169 / 42%), var(--shadow);
        border-color: #e7d4a9;
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        box-shadow: var(--shadow);
        border-color: #e7d4a9;
    }
}

@keyframes sheet-enter {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (min-width: 900px) {
    main {
        padding-top: 25px;
    }

    main:has(.walk-view:not([hidden])) {
        padding-bottom: 12px;
    }

    .walk-view {
        display: flex;
        height: calc(100dvh - 130px);
        flex-direction: column;
        min-height: 0;
        padding-bottom: 0;
    }

    .walk-topline {
        flex: 0 0 auto;
    }

    .list-toggle {
        display: none;
    }

    .walk-layout {
        display: grid;
        grid-template-columns: minmax(min(300px, 36vw), 365px) minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr);
        align-items: stretch;
        flex: 1 1 auto;
        gap: 16px;
        height: auto;
        min-height: 0;
    }

    .walk-sidebar {
        display: flex;
        grid-column: 1;
        grid-row: 1;
        flex-direction: column;
        gap: 12px;
        min-height: 0;
    }

    .walk-sheet {
        position: static;
        order: 2;
        margin-top: auto;
        flex: 0 0 auto;
        height: auto;
        max-width: none;
        max-height: none;
        overflow: visible;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    .walk-sheet.is-expanded {
        height: auto;
    }

    .sheet-handle {
        display: none;
    }

    .walk-sheet-content,
    .walk-sheet.is-expanded .walk-sheet-content {
        overflow: visible;
    }

    .walk-summary,
    .next-stop-card,
    .stop-list-section {
        grid-row: auto;
    }

    .map-card {
        display: flex;
        flex-direction: column;
        grid-column: 2;
        grid-row: 1;
        position: sticky;
        top: 86px;
        min-height: 0;
    }

    .route-map {
        height: auto;
        flex: 1 1 0;
        min-height: 0;
    }

    .stop-list-section {
        display: flex;
        flex-direction: column;
        order: 1;
        flex: 1 1 0;
        height: auto;
        min-height: 0;
        max-height: none;
        overflow: hidden;
        padding: 15px;
    }

    .stop-list-header {
        position: static;
        flex: 0 0 auto;
    }

    .stop-list {
        min-height: 0;
        flex: 1 1 auto;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .stop-list-section.is-open {
        display: flex;
        flex-direction: column;
        position: static;
        z-index: auto;
        flex: 1 1 0;
        height: auto;
        min-height: 0;
        max-height: none;
        padding: 15px;
        border-radius: 16px;
        box-shadow: none;
        animation: none;
    }

    .list-close,
    .stop-list-backdrop {
        display: none !important;
    }

}

@media (min-width: 701px) {
    .walk-sheet {
        display: none;
    }

    .sheet-handle {
        display: none;
    }

    .next-stop-card {
        display: none;
    }
}

@media (max-width: 700px), (max-width: 1024px) and (max-height: 500px) and (orientation: landscape) {
    .site-header {
        min-height: 60px;
        padding-right: 15px;
        padding-left: 15px;
    }

    .header-actions {
        gap: 8px;
    }

    .gps-header-button {
        width: 36px;
        height: 36px;
    }

    .brand-mark {
        width: 36px;
        height: 36px;
    }

    .brand-name {
        font-size: 14px;
    }

    .brand-place {
        font-size: 9px;
    }

    .connection-status {
        max-width: 26vw;
        gap: 6px;
        font-size: 10px;
    }

    #connectionText {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    main {
        width: min(100% - 30px, 560px);
        padding-top: 12px;
    }

    .storage-notice {
        margin-bottom: 11px;
        font-size: 10px;
    }

    .welcome {
        grid-template-columns: 1fr;
        gap: 17px;
        margin: 4px 0 25px;
        padding: 15px;
        border-radius: 21px;
    }

    .welcome-art {
        min-height: 190px;
        border-radius: 16px;
    }

    .art-village {
        bottom: 8%;
        font-size: 10px;
    }

    .welcome-copy {
        padding: 0 2px 4px;
    }

    .welcome h1 {
        font-size: clamp(34px, 10vw, 46px);
    }

    .intro {
        font-size: 13px;
        line-height: 1.55;
    }

    .section-heading {
        margin: 10px 0;
    }

    .section-heading h2 {
        font-size: 21px;
    }

    .route-choices {
        grid-template-columns: 1fr;
        gap: 9px;
    }

    .route-card {
        min-height: 83px;
        padding: 12px 13px;
        border-radius: 14px;
    }

    .route-number {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }

    .route-thumb {
        width: 58px;
        height: 58px;
    }

    .route-card .route-thumb .route-number {
        width: 26px;
        height: 26px;
        font-size: 11px;
    }

    .route-copy strong {
        font-size: 15px;
    }

    .route-copy span {
        font-size: 10px;
    }

    .route-distance {
        font-size: 11px;
    }

    .resume-card {
        align-items: stretch;
        flex-direction: column;
        margin: 0 0 21px;
        padding: 15px;
    }

    .resume-card .primary-button {
        width: 100%;
    }

    .progress-card {
        display: grid;
        grid-template-columns: 1fr;
        gap: 9px;
        margin-top: 15px;
        padding: 13px;
    }

    .progress-copy {
        min-width: 0;
    }

    .progress-track {
        grid-row: 2;
    }

    .text-button {
        justify-self: start;
    }

    .walk-view {
        padding-bottom: 14px;
    }

    .walk-topline {
        margin-bottom: 9px;
    }

    .walk-topline-meta {
        gap: 6px;
    }

    .walk-tag {
        padding: 6px 8px;
        font-size: 9px;
    }

    .list-toggle {
        min-height: 38px;
        padding: 0 10px;
        font-size: 11px;
    }

    .walk-heading {
        align-items: start;
        flex-direction: column;
        gap: 5px;
        margin-bottom: 11px;
    }

    .walk-heading h1 {
        font-size: 24px;
    }

    .walk-progress {
        text-align: left;
    }

    .walk-layout {
        gap: 10px;
    }

    .map-card {
        position: fixed;
        z-index: 1;
        top: calc(60px + 12px + 42px + 9px);
        bottom: 0;
        inset-inline: 0;
        width: auto;
        height: auto;
        display: flex;
        flex-direction: column;
        border-right: 0;
        border-left: 0;
        border-radius: 0;
    }

    .map-heading,
    .map-legend {
        flex: 0 0 auto;
    }

    .route-map {
        height: auto;
        min-height: 0;
        flex: 1 1 0;
    }

    .map-legend {
        position: fixed;
        z-index: 23;
        right: 10px;
        bottom: calc(var(--walk-sheet-collapsed-height) + 10px);
        left: 10px;
        gap: 7px 12px;
        padding: 8px 11px;
        border: 1px solid rgb(48 51 47 / 10%);
        border-radius: 12px;
        background: rgb(255 252 244 / 90%);
        font-size: 9px;
        box-shadow: 0 2px 10px rgb(25 49 39 / 14%);
        backdrop-filter: blur(8px);
    }

    .walk-summary {
        padding: 3px 2px 6px;
    }

    .next-stop-card {
        padding: 14px;
        border-radius: 15px;
    }

    .completed-view {
        grid-template-columns: 1fr;
        gap: 18px;
        min-height: 0;
        margin: 5px 0 15px;
        padding: 15px;
        border-radius: 21px;
    }

    .completion-art {
        min-height: 190px;
        border-radius: 16px;
    }

    .completion-halo {
        width: 130px;
        height: 130px;
    }

    .completion-tree {
        bottom: 9%;
        width: 90px;
        height: 126px;
    }

    .tree-a {
        width: 73px;
        height: 105px;
    }

    .completion-light {
        top: 39%;
        width: 56px;
        height: 56px;
        font-size: 31px;
    }

    .completion-copy h1 {
        font-size: clamp(35px, 9.5vw, 46px);
    }

    .completion-stats {
        margin: 17px 0;
    }

    .completion-stats div {
        min-width: 0;
        flex: 1 1 0;
        padding: 11px;
    }

    .completion-note {
        grid-column: auto;
        margin-top: 0;
    }

    .site-footer {
        width: min(100% - 24px, 560px);
        flex-direction: column;
        gap: 5px;
        padding-bottom: max(17px, env(safe-area-inset-bottom));
        font-size: 9px;
    }
}

@media (min-width: 701px) and (max-width: 899px) and (min-height: 501px) {
    .stop-list-section.is-open {
        display: flex;
        flex-direction: column;
        height: min(82dvh, 760px);
        overflow: hidden;
        padding-top: 0;
        padding-bottom: 0;
    }

    .stop-list-section.is-open .stop-list-header {
        flex: 0 0 auto;
        margin: 0 -18px;
        padding: 18px 18px 0;
    }

    .stop-list-section.is-open .stop-list {
        min-height: 0;
        flex: 1 1 auto;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding-bottom: max(20px, env(safe-area-inset-bottom));
        scrollbar-width: thin;
        scrollbar-color: rgb(23 54 44 / 28%) transparent;
    }

    .map-card {
        position: fixed;
        z-index: 1;
        top: calc(68px + 18px + 42px + 13px);
        bottom: 0;
        inset-inline: 0;
        width: auto;
        height: auto;
        display: flex;
        flex-direction: column;
        border-right: 0;
        border-left: 0;
        border-radius: 0;
    }

    .map-heading,
    .map-legend {
        flex: 0 0 auto;
    }

    .route-map {
        height: auto;
        min-height: 0;
        flex: 1 1 0;
    }

    .map-legend {
        position: fixed;
        z-index: 23;
        right: 10px;
        bottom: calc(var(--walk-sheet-collapsed-height) + 10px);
        left: 10px;
        border: 1px solid rgb(48 51 47 / 10%);
        border-radius: 12px;
        background: rgb(255 252 244 / 90%);
        box-shadow: 0 2px 10px rgb(25 49 39 / 14%);
        backdrop-filter: blur(8px);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (max-width: 700px), (max-width: 1024px) and (max-height: 500px) and (orientation: landscape) {
    .walk-layout {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .walk-sidebar {
        display: block;
        grid-column: auto;
        grid-row: auto;
    }

    .walk-topline {
        margin-bottom: 9px;
    }

    .list-toggle {
        display: inline-flex;
    }

    .walk-sheet {
        position: fixed;
        z-index: 25;
        right: 0;
        bottom: 0;
        left: 0;
        height: var(--walk-sheet-collapsed-height);
        max-height: calc(100dvh - 90px);
        max-width: none;
        overflow: hidden;
        padding: 5px 12px max(12px, env(safe-area-inset-bottom));
        border: 1px solid var(--line);
        border-right: 0;
        border-left: 0;
        border-bottom: 0;
        border-radius: 20px 20px 0 0;
        background: var(--paper);
        box-shadow: 0 -12px 40px rgb(22 46 36 / 16%);
    }

    .walk-sheet.is-expanded {
        height: min(76dvh, 260px);
    }

    .sheet-handle {
        display: grid;
    }

    .walk-sheet-content {
        overflow: hidden;
    }

    .walk-sheet.is-expanded .walk-sheet-content {
        overflow-y: auto;
    }

    .stop-list-section {
        display: none;
        height: auto;
        max-height: none;
        overflow: visible;
    }

    .stop-list-section.is-open {
        position: fixed;
        z-index: 31;
        right: 0;
        bottom: 0;
        left: 0;
        display: block;
        height: min(82dvh, 760px);
        max-height: min(82dvh, 760px);
        overflow: auto;
        padding: 18px 18px max(20px, env(safe-area-inset-bottom));
        border-radius: 22px 22px 0 0;
        box-shadow: 0 -12px 42px rgb(22 46 36 / 22%);
        animation: sheet-enter 180ms ease-out;
    }

    .list-close {
        display: grid !important;
    }

    .stop-list-backdrop:not([hidden]) {
        display: block !important;
    }

    .walk-view .walk-topline {
        width: calc(100vw - 30px);
        margin-left: calc(50% - 50vw + 15px);
    }

    .stop-list-section.is-open {
        display: flex;
        flex-direction: column;
        height: min(82dvh, 760px);
        overflow: hidden;
        padding-top: 0;
        padding-bottom: 0;
    }

    .stop-list-section.is-open .stop-list-header {
        flex: 0 0 auto;
        margin: 0 -18px;
        padding: 18px 18px 0;
    }

    .stop-list-section.is-open .stop-list {
        min-height: 0;
        flex: 1 1 auto;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding-bottom: max(20px, env(safe-area-inset-bottom));
        scrollbar-width: thin;
        scrollbar-color: rgb(23 54 44 / 28%) transparent;
    }

    .brand-name,
    .storage-notice,
    .eyebrow,
    .intro,
    .demo-label,
    .route-number,
    .route-copy strong,
    .route-copy span,
    .route-distance,
    .resume-card span:not(.eyebrow),
    .primary-button,
    .secondary-button,
    .progress-copy strong,
    .text-button,
    .back-button,
    .walk-tag,
    .list-toggle,
    .walk-progress,
    .walk-summary strong,
    .map-heading strong,
    .map-legend,
    .stop-index,
    .next-stop-copy span,
    .all-done,
    .stop-popup strong,
    .stop-popup span,
    .stop-popup small,
    .list-count,
    .filter-chip,
    .stop-list-number,
    .stop-list-copy strong,
    .stop-list-copy small,
    .empty-filter,
    .completion-stats span,
    .completion-note,
    .site-footer,
    .toast {
        font-size: 1rem;
    }

    .walk-summary .eyebrow {
        font-size: 1rem;
    }

    .walk-tag {
        font-size: 0.8125rem;
    }

    .walk-sheet {
        transition: height 340ms cubic-bezier(0.32, 0.72, 0, 1);
        animation: sheet-rise 460ms cubic-bezier(0.22, 1, 0.36, 1) both;
    }

    .walk-sheet.is-expanded {
        height: min(76dvh, var(--walk-sheet-expanded-height, 330px));
        max-height: 76dvh;
    }

    .walk-sheet.is-animating .walk-sheet-content,
    .walk-sheet.is-dragging .walk-sheet-content {
        overflow: hidden;
    }

    .walk-sheet .next-stop-card {
        transition:
            opacity 260ms ease 40ms,
            transform 340ms cubic-bezier(0.32, 0.72, 0, 1);
    }

    .walk-sheet:not(.is-expanded) .next-stop-card {
        opacity: 0.4;
        transform: translateY(8px);
    }

    .next-stop-card {
        padding: 12px 13px;
    }

    .next-stop-card .eyebrow {
        margin-bottom: 8px;
    }

    .stop-actions {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
        margin-top: 10px;
    }

    .stop-actions .primary-button,
    .stop-actions .secondary-button {
        min-width: 0;
        min-height: 42px;
    }

}

@media (min-width: 701px) and (max-width: 899px) and (min-height: 501px) {
    .walk-view .walk-topline {
        width: calc(100vw - 36px);
        margin-left: calc(50% - 50vw + 18px);
    }
}
