:root {
  color-scheme: light;
  --green: #154734;
  --green-strong: #0d3526;
  --orange: #df9422;
  --orange-strong: #a86500;
  --pale: #e6f0eb;
  --grey: #e4e4e3;
  --canvas: #ffffff;
  --ink: #171a18;
  --muted: #5d655f;
  --danger: #912c2c;
  --danger-pale: #f8e7e5;
  --amber-pale: #fff2d2;
  --shadow: 0 2px 10px rgb(21 71 52 / 9%);
  --radius: 14px;
  --content: 880px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body { min-height: 100%; margin: 0; background: #f8faf9; color: var(--ink); }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
a { color: var(--green); text-underline-offset: 0.18em; }
img { max-width: 100%; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }
.skip-link { position: fixed; z-index: 1000; left: 12px; top: -80px; padding: 12px 16px; background: white; color: var(--green); border: 2px solid var(--green); border-radius: 8px; }
.skip-link:focus { top: 12px; }
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.offline-banner { position: relative; z-index: 100; padding: 9px max(16px, env(safe-area-inset-right)) 9px max(16px, env(safe-area-inset-left)); background: var(--amber-pale); color: #553900; border-bottom: 1px solid #d6a94d; font-size: 0.82rem; text-align: center; }
.app-shell { min-height: 100vh; }
.desktop-rail { display: none; }
.page-column { min-width: 0; padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
.app-header { position: sticky; z-index: 50; top: 0; height: calc(62px + env(safe-area-inset-top)); padding: calc(8px + env(safe-area-inset-top)) 16px 8px; display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--green); color: white; box-shadow: 0 2px 10px rgb(0 0 0 / 18%); }
.compact-brand { display: inline-flex; min-height: 46px; align-items: center; gap: 10px; color: white; text-decoration: none; font-weight: 850; font-size: 0.82rem; letter-spacing: 0.07em; }
.compact-brand img { width: 38px; height: 38px; object-fit: contain; border-radius: 50%; background: white; }
.header-context { overflow: hidden; color: #dce9e3; font-size: 0.78rem; white-space: nowrap; text-overflow: ellipsis; }
main { width: min(100%, var(--content)); margin: 0 auto; padding: 22px 16px 38px; }

.bottom-navigation { position: fixed; z-index: 60; inset: auto 0 0; display: grid; grid-template-columns: repeat(5, 1fr); padding: 5px max(5px, env(safe-area-inset-right)) calc(5px + env(safe-area-inset-bottom)) max(5px, env(safe-area-inset-left)); background: white; border-top: 1px solid #cbd3cf; box-shadow: 0 -3px 14px rgb(0 0 0 / 10%); }
.nav-link { min-width: 0; min-height: 54px; padding: 7px 3px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 10px; color: #4f5953; text-decoration: none; font-size: 0.73rem; font-weight: 700; }
.nav-link .nav-icon { font-size: 1.2rem; line-height: 1; }
.nav-link[aria-current="page"] { background: var(--pale); color: var(--green); }

h1, h2, h3 { line-height: 1.18; color: var(--green); }
h1 { margin: 0 0 8px; font-size: clamp(1.8rem, 7vw, 2.45rem); letter-spacing: -0.035em; }
h2 { margin: 32px 0 12px; font-size: 1.28rem; }
h3 { margin: 0 0 6px; font-size: 1rem; }
p { margin: 0 0 14px; }
.eyebrow { margin: 0 0 6px; color: var(--orange-strong); font-size: 0.76rem; font-weight: 850; letter-spacing: 0.09em; text-transform: uppercase; }
.lede { max-width: 65ch; color: #344039; font-size: 1.04rem; }
.muted { color: var(--muted); }
.small { font-size: 0.83rem; }
.route-line { font-weight: 750; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 12px; }

.hero { padding: 22px 20px; margin: -2px 0 16px; background: linear-gradient(150deg, var(--green), var(--green-strong)); color: white; border-radius: var(--radius); box-shadow: var(--shadow); }
.hero h1, .hero h2, .hero h3 { color: white; }
.hero .eyebrow { color: #f3bd68; }
.hero .lede { color: #eff6f2; }
.hero-route { display: flex; align-items: center; gap: 10px; margin: 17px 0 0; font-size: 1.04rem; font-weight: 760; }
.hero-route .arrow { color: var(--orange); font-size: 1.25rem; }

.tag-row { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0 0; }
.tag, .status-chip { display: inline-flex; min-height: 30px; align-items: center; padding: 4px 9px; border: 1px solid #bfd0c7; border-radius: 999px; background: var(--pale); color: var(--green); font-size: 0.75rem; font-weight: 760; }
.hero .tag { border-color: rgb(255 255 255 / 24%); background: rgb(255 255 255 / 12%); color: white; }
.status-chip.optional { background: #f2f2f1; border-color: #d4d4d2; color: #505653; }
.status-chip.private { background: var(--danger-pale); border-color: #e0b5af; color: var(--danger); }

.card { margin: 12px 0; padding: 18px; background: white; border: 1px solid #dce3df; border-radius: var(--radius); box-shadow: var(--shadow); }
.card > :last-child { margin-bottom: 0; }
.card-accent { border-left: 5px solid var(--orange); }
.card-pale { background: var(--pale); border-color: #cfdfd7; }
.card-warning { background: var(--amber-pale); border-color: #e7c16f; }
.card-danger { background: var(--danger-pale); border-color: #ddb4ae; }
.card-grid { display: grid; gap: 12px; }
.fact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; overflow: hidden; margin: 14px 0; background: #d7dfdb; border: 1px solid #d7dfdb; border-radius: 10px; }
.fact { min-width: 0; padding: 12px; background: white; }
.fact dt { color: var(--muted); font-size: 0.72rem; font-weight: 750; text-transform: uppercase; letter-spacing: 0.04em; }
.fact dd { margin: 2px 0 0; font-weight: 700; overflow-wrap: anywhere; }

.actions { display: grid; gap: 10px; margin: 15px 0; }
.button, button.button { min-height: 52px; padding: 12px 16px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 2px solid var(--green); border-radius: 11px; background: var(--green); color: white; text-decoration: none; text-align: center; font-weight: 800; cursor: pointer; }
.button:hover { background: var(--green-strong); }
.button.secondary { background: white; color: var(--green); }
.button.secondary:hover { background: var(--pale); }
.button.orange { border-color: var(--orange-strong); background: var(--orange); color: #201300; }
.button.danger { border-color: var(--danger); background: white; color: var(--danger); }
.button.compact { min-height: 46px; padding: 9px 13px; font-size: 0.86rem; }
.button[aria-disabled="true"] { cursor: not-allowed; border-color: #b9bfbc; background: #e8ebe9; color: #66706a; }

.mode-grid { display: grid; gap: 10px; }
.mode-card { padding: 15px; border: 1px solid #d4ddd8; border-radius: 11px; background: white; }
.mode-card h3 { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mode-card.selected { border: 3px solid var(--orange); padding: 13px; background: #fff9ef; }
.mode-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin: 12px 0; }
.mode-picker button { min-height: 52px; padding: 8px 4px; border: 2px solid #b8c7bf; border-radius: 9px; background: white; color: var(--green); font-size: 0.78rem; font-weight: 800; cursor: pointer; }
.mode-picker button[aria-pressed="true"] { border-color: var(--orange-strong); background: var(--orange); color: #211300; }

.checklist { display: grid; gap: 1px; padding: 0; margin: 0; list-style: none; background: #d9e0dc; border: 1px solid #d9e0dc; border-radius: 11px; overflow: hidden; }
.check-item { position: relative; display: flex; gap: 12px; align-items: flex-start; min-height: 54px; padding: 13px; background: white; cursor: pointer; }
.check-item input { width: 23px; height: 23px; flex: 0 0 auto; margin: 1px 0 0; accent-color: var(--green); }
.check-item span { flex: 1; }
.check-note { margin: 10px 0 0; color: var(--muted); font-size: 0.81rem; }

.list { margin: 0; padding-left: 1.2rem; }
.list li { margin: 7px 0; }
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list > li + li { border-top: 1px solid #dce2df; }
.list-link { min-height: 64px; padding: 12px 2px; display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--ink); text-decoration: none; }
.list-link strong { display: block; color: var(--green); }
.list-link .chevron { color: var(--orange-strong); font-weight: 900; }

.day-list { display: grid; gap: 10px; }
.day-card { display: grid; grid-template-columns: 68px 1fr auto; gap: 13px; align-items: center; min-height: 84px; padding: 13px; background: white; color: var(--ink); text-decoration: none; border: 1px solid #d9e1dd; border-radius: 12px; box-shadow: var(--shadow); }
.day-date { align-self: stretch; display: flex; flex-direction: column; justify-content: center; align-items: center; background: var(--pale); color: var(--green); border-radius: 9px; font-weight: 850; line-height: 1.05; text-align: center; }
.day-date small { margin-top: 4px; font-size: 0.65rem; text-transform: uppercase; }
.day-card h3 { margin: 0 0 3px; }
.day-card p { margin: 0; color: var(--muted); font-size: 0.8rem; }

.resource-list { display: grid; gap: 10px; }
.resource { padding: 16px; background: white; border: 1px solid #d7dfdb; border-radius: 12px; }
.resource h3 { margin-bottom: 5px; }
.resource p { color: #46504a; font-size: 0.88rem; }
.resource .button { width: 100%; }
.external-note { display: block; margin-top: 8px; color: var(--muted); font-size: 0.75rem; }

.warning-stripe { padding: 13px 15px; margin: 14px 0; background: var(--amber-pale); border-left: 5px solid var(--orange-strong); font-weight: 720; }
.paper-map { display: grid; gap: 11px; margin: 14px 0; padding: 15px 16px; background: var(--pale); border: 1px solid #c9dad1; border-left: 4px solid var(--green); border-radius: 10px; }
.paper-map p { margin: 0; }
.paper-map-label { color: var(--green); font-size: 0.7rem; font-weight: 900; letter-spacing: 0.09em; text-transform: uppercase; }
.paper-map-value { margin-top: 2px !important; font-size: 0.9rem; font-weight: 720; line-height: 1.4; }
.paper-map-additional { margin-top: 3px !important; color: #39473f; font-size: 0.82rem; line-height: 1.4; }
.paper-map-note { padding-top: 9px; border-top: 1px solid #bdcec5; color: #5b420e; font-size: 0.8rem; line-height: 1.4; }
.paper-map-boundary { color: var(--muted); font-size: 0.72rem; line-height: 1.35; }
.entrance { min-height: calc(100vh - 130px); display: flex; flex-direction: column; }
.stop { padding: 18px; margin: 0 0 18px; background: var(--danger); color: white; border-radius: var(--radius); text-align: center; font-size: clamp(2.5rem, 18vw, 5rem); font-weight: 950; letter-spacing: 0.04em; }
.entrance-steps { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.entrance-steps li { padding: 14px; background: white; border: 2px solid var(--green); border-radius: 10px; color: var(--green); font-size: 1.03rem; font-weight: 900; text-align: center; }
.local-override { margin: 18px 0; padding: 16px; background: var(--green); color: white; border-radius: 10px; font-weight: 850; text-align: center; }

details { border-top: 1px solid #d4ddd8; }
details:first-of-type { border-top: 0; }
summary { min-height: 54px; padding: 14px 2px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--green); font-weight: 800; cursor: pointer; }
summary::marker { color: var(--orange-strong); }
details .detail-body { padding: 0 2px 15px; }

.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 4px; margin: 14px 0; background: var(--grey); border-radius: 10px; }
.tabs button { min-height: 48px; border: 0; border-radius: 8px; background: transparent; color: #3d4641; font-weight: 800; cursor: pointer; }
.tabs button[aria-selected="true"] { background: white; color: var(--green); box-shadow: 0 1px 4px rgb(0 0 0 / 12%); }
.completion-item { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 14px 0; border-bottom: 1px solid #dde3df; }
.completion-item:last-child { border-bottom: 0; }
.completion-item p { margin: 5px 0 0; }

.form-grid { display: grid; gap: 14px; }
label.form-field { display: grid; gap: 5px; font-weight: 730; color: var(--green); }
label.form-field span { font-size: 0.85rem; }
input[type="text"], input[type="tel"], input[type="url"], textarea, select { width: 100%; min-height: 50px; padding: 11px 12px; border: 2px solid #aebdb5; border-radius: 9px; background: white; color: var(--ink); }
textarea { min-height: 92px; resize: vertical; }
.private-label { padding: 11px 13px; background: var(--danger-pale); border: 1px solid #ddb5b0; border-radius: 9px; color: var(--danger); font-weight: 850; }

.traffic-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.traffic-table th, .traffic-table td { padding: 10px; border: 1px solid #ccd7d1; text-align: left; vertical-align: top; }
.traffic-table th { background: var(--green); color: white; }
.traffic-table .green td:first-child { background: var(--pale); font-weight: 900; }
.traffic-table .amber td:first-child { background: var(--amber-pale); font-weight: 900; }
.traffic-table .red td:first-child { background: var(--danger-pale); font-weight: 900; }
.toast { position: fixed; z-index: 200; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); width: min(calc(100% - 32px), 520px); transform: translateX(-50%); padding: 13px 16px; background: #17231d; color: white; border-radius: 10px; box-shadow: 0 5px 20px rgb(0 0 0 / 30%); text-align: center; }
.noscript { margin: 20px; padding: 20px; background: var(--danger-pale); }

@media (min-width: 620px) {
  main { padding: 30px 26px 50px; }
  .card-grid.two, .actions { grid-template-columns: repeat(2, 1fr); }
  .mode-grid { grid-template-columns: repeat(3, 1fr); }
  .resource-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 980px) and (orientation: landscape) {
  .app-shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); }
  .desktop-rail { position: sticky; top: 0; height: 100vh; padding: max(22px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; background: var(--green); color: white; }
  .brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 22px; color: white; text-decoration: none; font-weight: 900; letter-spacing: 0.08em; line-height: 1.1; }
  .brand img { width: 50px; height: 50px; border-radius: 50%; background: white; }
  .brand small { color: #f0bb6b; font-size: 0.65rem; }
  .desktop-rail nav { display: grid; gap: 4px; }
  .desktop-rail .nav-link { min-height: 50px; padding: 10px 12px; flex-direction: row; justify-content: flex-start; font-size: 0.87rem; color: #e9f1ed; }
  .desktop-rail .nav-link[aria-current="page"] { background: white; color: var(--green); }
  .rail-note { margin: auto 8px 0; color: #bcd1c7; font-size: 0.71rem; }
  .page-column { padding-bottom: 0; }
  .app-header { display: none; }
  .bottom-navigation { display: none; }
  main { padding: 40px 34px 70px; }
  .toast { bottom: 25px; }
}

@media (orientation: landscape) and (max-height: 520px) and (max-width: 979px) {
  .app-header { height: calc(50px + env(safe-area-inset-top)); padding-top: calc(4px + env(safe-area-inset-top)); padding-bottom: 4px; }
  .compact-brand { min-height: 40px; }
  .compact-brand img { width: 32px; height: 32px; }
  main { padding-top: 16px; }
  .bottom-navigation { grid-template-columns: repeat(5, minmax(82px, 1fr)); overflow-x: auto; }
  .nav-link { min-height: 48px; flex-direction: row; }
}

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