:root {
  --pine: #173d31;
  --pine-2: #245345;
  --moss: #839a72;
  --cream: #f3efe5;
  --paper: #fffdf7;
  --ink: #17332b;
  --muted: #68766f;
  --line: #d9ded3;
  --amber: #d48b27;
  --red: #a44332;
  --shadow: 0 18px 50px rgba(28, 48, 39, .11);
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--cream);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { width: 100%; max-width: 100%; overflow-x: hidden; overflow-x: clip; }
body { margin: 0; min-width: 0; background: radial-gradient(circle at 100% -10%, #dfe7d6 0, transparent 30rem), var(--cream); }
main, section, nav, .view, .section-heading > div { min-width: 0; }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.shell { width: 100%; max-width: 760px; margin: 0 auto; padding: calc(18px + env(safe-area-inset-top)) 18px calc(34px + env(safe-area-inset-bottom)); overflow-x: hidden; overflow-x: clip; }
.access { min-height: 100vh; display: grid; place-content: center; text-align: center; padding: 30px; }
.access__mark { display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto; border-radius: 50%; background: var(--pine); color: white; font: italic 34px/1 Georgia, serif; }
.access h1 { margin: 18px 0 4px; font: 42px/1 Georgia, serif; }
.access p { color: var(--muted); }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; margin: 4px 2px 18px; }
.eyebrow { margin: 0 0 5px; font-size: 11px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); }
h1, h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; letter-spacing: -.035em; }
.topbar h1 { margin: 0; font-size: 39px; line-height: .95; }
.topbar h1 span { display: inline-flex; color: var(--amber); vertical-align: -.12em; }
.topbar h1 span svg { width: .75em; height: .75em; stroke-width: 2.4; }
.sync { display: flex; align-items: center; gap: 7px; padding-bottom: 3px; font-size: 12px; color: var(--muted); }
.sync i { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 4px rgba(212,139,39,.13); }
.sync.is-live i { background: #4d8e66; box-shadow: 0 0 0 4px rgba(77,142,102,.13); }
.sync.is-error i { background: var(--red); box-shadow: 0 0 0 4px rgba(164,67,50,.13); }
.warning { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 14px; padding: 13px 14px; border: 1px solid #e9c88f; border-radius: 14px; background: #fff8e9; }
.warning__icon { flex: 0 0 auto; display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; background: var(--amber); color: white; font-weight: 800; }
.warning__icon svg { width: 14px; height: 14px; }
.warning strong { font-size: 13px; }
.warning p { margin: 2px 0 0; color: #765b34; font-size: 12px; line-height: 1.4; }
.map-card { position: relative; overflow: hidden; height: min(42vh, 330px); min-height: 255px; border-radius: 22px; background: #dbe5d2; box-shadow: var(--shadow); }
#map { width: 100%; height: 100%; }
.map-fullscreen { position: absolute; z-index: 600; top: 10px; left: 10px; display: inline-flex; align-items: center; gap: 7px; min-width: 44px; min-height: 44px; padding: 0 13px; border: 0; border-radius: 12px; background: rgba(255,253,247,.96); color: var(--pine); box-shadow: 0 5px 18px rgba(23,61,49,.18); font-size: 11px; font-weight: 750; cursor: pointer; touch-action: manipulation; }
.map-fullscreen svg { width: 16px; height: 16px; }
.map-card.is-fullscreen { position: fixed; z-index: 2000; inset: 0; width: 100%; max-width: none; height: 100vh; height: 100dvh; min-height: 0; border-radius: 0; box-shadow: none; }
.map-card.is-fullscreen .map-fullscreen { top: max(12px, env(safe-area-inset-top)); left: max(12px, env(safe-area-inset-left)); }
.map-card.is-fullscreen .map-note { bottom: max(12px, env(safe-area-inset-bottom)); left: max(12px, env(safe-area-inset-left)); }
body.is-map-fullscreen { position: fixed; inset: 0; overflow: hidden; overscroll-behavior: none; }
.map-error { display: grid; place-content: center; gap: 4px; width: 100%; height: 100%; padding: 28px; text-align: center; color: var(--pine); }
.map-error strong, .map-error span { display: block; }
.map-error span { max-width: 34ch; color: var(--muted); font-size: 11px; line-height: 1.4; }
.google-popup { display: grid; gap: 4px; max-width: 220px; color: var(--ink); font-family: "Avenir Next", Avenir, sans-serif; }
.google-popup span { color: var(--muted); font-size: 11px; }
.google-popup svg { width: 14px; height: 14px; vertical-align: -2px; }
.google-popup a { color: var(--pine-2); font-size: 11px; font-weight: 700; text-decoration: none; }
.map-note { position: absolute; z-index: 500; left: 10px; bottom: 10px; max-width: calc(100% - 20px); padding: 6px 9px; border-radius: 9px; background: rgba(255,253,247,.88); backdrop-filter: blur(8px); font-size: 10px; color: var(--muted); overflow-wrap: anywhere; }
.google-marker { position: absolute; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 2px solid var(--paper); border-radius: 50%; transform: translate(-50%, -100%); color: var(--paper); box-shadow: 0 4px 13px rgba(23,51,43,.34); cursor: pointer; }
.google-marker svg { width: 17px; height: 17px; stroke-width: 2.4; pointer-events: none; }
.google-marker b { position: absolute; right: -6px; bottom: -6px; display: grid; place-items: center; width: 17px; height: 17px; border: 1.5px solid currentColor; border-radius: 50%; background: var(--paper); color: var(--ink); font-size: 8px; line-height: 1; box-shadow: 0 1px 5px rgba(23,51,43,.2); pointer-events: none; }
.kind-start { background: #426b58 !important; }
.kind-scenic { background: #2b7590 !important; }
.kind-nature { background: #668b55 !important; }
.kind-sight { background: #825f77 !important; }
.kind-food { background: #a65f37 !important; }
.kind-shop { background: #9b7a2d !important; }
.kind-loppis { background: #806040 !important; }
.kind-activity { background: #426c86 !important; }
.kind-fuel { background: #505d66 !important; }
.kind-terminal { background: var(--amber) !important; }
.kind-other { background: var(--pine) !important; }
.summary { display: grid; grid-template-columns: 1.05fr 1fr 1fr; margin: 13px 0 5px; padding: 15px 7px; border-radius: 17px; background: var(--paper); border: 1px solid rgba(23,61,49,.08); }
.summary div { padding: 0 10px; border-right: 1px solid var(--line); }
.summary div { min-width: 0; }
.summary div:last-child { border-right: 0; }
.summary span, .summary small { display: block; color: var(--muted); }
.summary span { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
.summary strong { display: block; margin: 3px 0 1px; font: 23px/1 Georgia, serif; }
.summary small { overflow: hidden; font-size: 9px; line-height: 1.2; white-space: nowrap; text-overflow: ellipsis; }
.summary.is-infeasible { border-color: #e2b9aa; background: #fff9f5; }
.summary.is-infeasible #slack { color: var(--red); font-size: 20px; }
.tabs { display: flex; gap: 5px; margin: 19px 0 20px; padding: 4px; border-radius: 14px; background: #e2e3d9; }
.tab { flex: 1; padding: 10px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 650; cursor: pointer; }
.tab.is-active { background: var(--paper); color: var(--pine); box-shadow: 0 2px 9px rgba(23,61,49,.08); }
.tab span { opacity: .65; }
.recovery { display: grid; gap: 13px; margin: -3px 0 16px; padding: 16px; border: 1px solid #e4b4a5; border-radius: 17px; background: #fff6f1; }
.recovery h2 { margin: 0; font-size: 25px; }
.recovery p:not(.eyebrow) { margin: 5px 0 0; color: #784b3d; font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.recovery__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.action-button { min-height: 42px; padding: 9px 13px; border: 0; border-radius: 10px; background: var(--pine); color: var(--paper); font-size: 11px; font-weight: 750; cursor: pointer; }
.recovery__actions .action-button { max-width: 100%; overflow-wrap: anywhere; }
.action-button.is-quiet { border: 1px solid rgba(23,61,49,.2); background: transparent; color: var(--pine); }
.action-button:disabled { cursor: wait; opacity: .55; }
.scenic-status { display: flex; gap: 11px; align-items: center; margin: 0 2px 18px; padding: 11px 0; border-block: 1px solid var(--line); }
.scenic-status__mark { display: grid; flex: 0 0 auto; place-items: center; width: 31px; height: 31px; border-radius: 50%; background: #dce9e8; color: #2b7590; font: 700 20px/1 Georgia, serif; }
.scenic-status__mark svg { width: 16px; height: 16px; stroke-width: 2.3; }
.scenic-status strong { display: block; font-size: 12px; }
.scenic-status p { margin: 2px 0 0; color: var(--muted); font-size: 10px; line-height: 1.4; }
.scenic-status.is-changed .scenic-status__mark { background: #f2dfd6; color: var(--red); }
.scenic-status.is-changed strong { color: var(--red); }
.section-heading { display: flex; justify-content: space-between; align-items: end; margin: 0 2px 13px; }
.section-heading h2 { margin: 0; font-size: 28px; }
.section-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.text-button { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; color: var(--pine-2); font-size: 12px; font-weight: 700; cursor: pointer; }
.text-button svg, .stop__nav svg { width: 12px; height: 12px; }
.text-button.is-secondary { color: var(--muted); font-size: 10px; }
.order-help { margin: -7px 2px 15px; color: var(--muted); font-size: 10px; }
.timeline { margin: 0; padding: 0; list-style: none; }
.stop { position: relative; display: grid; grid-template-columns: 48px 24px 1fr; min-height: 92px; }
.stop__time { padding-top: 3px; font: 15px/1 Georgia, serif; color: var(--pine); }
.stop__rail { position: relative; display: flex; justify-content: center; }
.stop__rail::before { content: ""; position: absolute; top: 14px; bottom: -14px; width: 1px; background: var(--line); }
.stop:last-child .stop__rail::before { display: none; }
.stop__dot { position: relative; z-index: 1; display: grid; place-items: center; width: 22px; height: 22px; border: 2px solid var(--paper); border-radius: 50%; background: var(--pine); color: white; font-size: 11px; box-shadow: 0 0 0 1px rgba(23,61,49,.35); }
.stop__dot svg { width: 12px; height: 12px; stroke-width: 2.5; }
.stop__dot b { position: absolute; right: -5px; bottom: -5px; display: grid; place-items: center; width: 13px; height: 13px; border-radius: 50%; background: var(--paper); color: var(--ink); font: 800 7px/1 "Avenir Next", sans-serif; box-shadow: 0 0 0 1px var(--line); }
.stop__content { position: relative; margin: 0 0 13px 8px; padding: 0 30px 16px 0; border-bottom: 1px solid var(--line); }
.stop:last-child .stop__content { border-bottom: 0; }
.stop__content h3 { margin: 0 0 3px; font-size: 15px; line-height: 1.25; }
.stop__meta { display: flex; flex-wrap: wrap; gap: 4px 10px; color: var(--muted); font-size: 11px; }
.stop__note { margin: 6px 0 0; max-width: 48ch; color: #765b34; font-size: 10px; line-height: 1.4; }
.stop__nav { display: inline-flex; align-items: center; gap: 4px; margin-top: 7px; color: var(--pine-2); font-size: 11px; font-weight: 700; text-decoration: none; }
.drag-handle { position: absolute; top: -5px; right: 0; width: 28px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 17px; cursor: grab; touch-action: none; }
.drag-handle svg { width: 17px; height: 17px; pointer-events: none; }
.drag-handle:active { cursor: grabbing; background: #e2e6dc; color: var(--pine); }
.stop.is-dragging { z-index: 20; opacity: .72; transform: scale(.99); }
.stop.is-dragging .stop__content { border-radius: 10px; background: var(--paper); box-shadow: 0 10px 30px rgba(23,61,49,.14); }
.stop.is-unscheduled .stop__time, .stop.is-unscheduled .stop__content { opacity: .62; }
.stop.is-unscheduled .stop__rail::before { border-left: 1px dashed var(--line); background: transparent; }
.is-reordering { user-select: none; }
.choice-guide { display: grid; grid-template-columns: 1fr; gap: 12px; align-items: center; margin-bottom: 12px; padding: 14px; border-radius: 15px; background: #dfe8d8; }
.choice-guide .action-button { justify-self: start; }
.choice-guide strong, .choice-guide span { display: block; }
.choice-guide strong { font-size: 13px; }
.choice-guide span { margin-top: 3px; max-width: 42ch; color: var(--muted); font-size: 10px; line-height: 1.4; }
.search-wrap input, .add-card input { width: 100%; border: 1px solid var(--line); outline: none; background: var(--paper); color: var(--ink); }
.search-wrap input { padding: 13px 15px; border-radius: 13px; }
.search-wrap input:focus, .add-card input:focus { border-color: var(--moss); box-shadow: 0 0 0 3px rgba(131,154,114,.13); }
.filters { display: flex; flex-wrap: wrap; gap: 7px; margin: 11px 0 16px; padding-bottom: 2px; }
.chip { flex: 0 0 auto; padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); font-size: 11px; cursor: pointer; }
.chip.is-active { border-color: var(--pine); background: var(--pine); color: white; }
.add-card { padding: 14px; margin-bottom: 12px; border-radius: 15px; background: #dfe8d8; }
.add-card strong, .add-card span { display: block; }
.add-card strong { font-size: 13px; }
.add-card span { margin: 2px 0 10px; font-size: 10px; color: var(--muted); }
.add-card form { display: grid; grid-template-columns: 1fr auto; gap: 7px; }
.add-card input { min-width: 0; padding: 9px 10px; border-radius: 9px; font-size: 11px; }
.add-card button { border: 0; border-radius: 9px; padding: 0 13px; background: var(--pine); color: white; font-size: 11px; font-weight: 700; cursor: pointer; }
.place-list { display: grid; gap: 8px; }
.place { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 13px 14px; border: 1px solid rgba(23,61,49,.09); border-radius: 14px; background: var(--paper); }
.place.is-closed { opacity: .58; }
.place__content { min-width: 0; }
.place__title { display: flex; flex-wrap: wrap; gap: 5px 8px; align-items: center; }
.place h3 { min-width: 0; margin: 0; font-size: 13px; line-height: 1.25; overflow-wrap: anywhere; }
.place__meta { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; margin-top: 5px; font-size: 10px; color: var(--muted); }
.badge { padding: 2px 7px; border-radius: 99px; background: #e6eadf; color: white; font-weight: 650; }
.badge, .rating { display: inline-flex; align-items: center; gap: 4px; }
.badge svg { width: 11px; height: 11px; }
.rating svg { width: 10px; height: 10px; fill: currentColor; }
.badge.is-closed { background: #f0ded8; color: var(--red); }
.decision-badge { padding: 2px 6px; border-radius: 5px; background: #dce8d4; color: var(--pine); font-size: 8px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.decision-badge.is-extra { background: #f3e2c6; color: #78541e; }
.place__note { display: -webkit-box; margin: 7px 0 0; overflow: hidden; color: #765b34; font-size: 10px; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.switch { position: relative; width: 39px; height: 23px; }
.switch input { position: absolute; opacity: 0; }
.switch span { display: block; width: 100%; height: 100%; border-radius: 20px; background: #c7cec5; transition: .18s ease; cursor: pointer; }
.switch span::after { content: ""; position: absolute; width: 17px; height: 17px; top: 3px; left: 3px; border-radius: 50%; background: white; box-shadow: 0 2px 5px rgba(0,0,0,.2); transition: .18s ease; }
.switch input:checked + span { background: var(--pine); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:disabled + span { cursor: not-allowed; opacity: .55; }
footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 7px 14px; margin-top: 25px; padding: 15px 2px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.toast { position: fixed; z-index: 1000; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); width: min(calc(100% - 36px), 520px); padding: 12px 14px; border-radius: 12px; transform: translate(-50%, 130%); background: var(--ink); color: white; box-shadow: var(--shadow); font-size: 12px; transition: transform .2s ease; }
.toast:not(.is-visible) { visibility: hidden; }
.toast.is-visible { transform: translate(-50%, 0); }
.toast.is-error { background: var(--red); }

@media (min-width: 680px) {
  .shell { padding-left: 28px; padding-right: 28px; }
  .place-list { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 500px) {
  .choice-guide { grid-template-columns: 1fr auto; }
  .choice-guide .action-button { justify-self: auto; }
}

@media (pointer: coarse) {
  .text-button { min-height: 36px; padding-inline: 4px; }
  .chip { min-height: 40px; padding-inline: 14px; }
  .drag-handle { width: 44px; height: 44px; top: -10px; right: -8px; }
  .switch { width: 44px; height: 27px; }
  .switch span::after { width: 21px; height: 21px; }
  .switch input:checked + span::after { transform: translateX(17px); }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
