:root {
  color-scheme: light dark;
  --bg: #f6f5f1;
  --ink: #1b1f1e;
  --accent: #426737;
  --rule: #8b8d85;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14191a;
    --ink: #e8e6df;
    --accent: #c8dda0;
    --rule: #767b75;
  }
}
* {
  box-sizing: border-box;
}
body {
  margin: 0 auto;
  padding: 0 1.25rem;
  max-width: 76rem;
  background: var(--bg);
  color: var(--ink);
  font:
    1rem/1.55 system-ui,
    sans-serif;
  overflow-wrap: anywhere;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  border-bottom: 1px solid var(--ink);
  margin-bottom: 2rem;
}
h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 650;
  letter-spacing: -0.04em;
  margin: 1.25rem 0;
}
h2 {
  font-size: 1.4rem;
  font-weight: 650;
}
h3 {
  font-size: 1.2rem;
  margin: 0.25rem 0;
}
a {
  color: var(--accent);
  text-underline-offset: 0.2em;
}
button,
input {
  font: inherit;
  color: inherit;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 0;
}
button {
  cursor: pointer;
  min-height: 44px;
  padding: 0.55rem 0.9rem;
}
button:hover {
  border-color: var(--accent);
  text-decoration: underline;
}
button:disabled {
  cursor: default;
  opacity: 0.65;
}
#submit {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
  margin-top: 1rem;
}
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}
input:not([type='checkbox']) {
  padding: 0.65rem;
  width: 100%;
  min-width: 0;
  min-height: 44px;
}
label {
  display: block;
}
.fields {
  display: grid;
  grid-template-columns: 1fr 1fr 1.1fr;
  gap: 1.25rem;
}
.fields > div {
  min-width: 0;
}
.fields label {
  font-weight: 600;
  margin-bottom: 0.35rem;
}
small {
  display: block;
  margin-top: 0.35rem;
}
.choices {
  display: grid;
  gap: 0.5rem;
}
.choices p {
  margin: 0.5rem 0 0;
}
.choices button {
  text-align: left;
}
#status {
  min-height: 1.6rem;
  margin: 1.5rem 0;
}
#summary {
  font-size: 1.15rem;
  max-width: 66ch;
}
#summary p {
  margin: 0.5rem 0;
}
.warning {
  border-left: 4px solid var(--accent);
  padding-left: 0.9rem;
  font-weight: 600;
}
.coverage,
#refresh-note,
footer {
  font-size: 0.9rem;
}
details {
  border-block: 1px solid var(--rule);
  margin: 1.5rem 0;
  padding: 0.8rem 0;
}
summary {
  cursor: pointer;
  min-height: 44px;
  padding: 0.45rem 0;
}
#map {
  height: 360px;
  max-height: 60vh;
  width: 100%;
}
fieldset {
  border: 0;
  padding: 0;
  margin: 1.8rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.5rem;
}
legend {
  font-weight: 650;
  padding: 0;
  margin-bottom: 0.5rem;
}
fieldset label {
  min-height: 44px;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
input[type='checkbox'] {
  accent-color: var(--accent);
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
}
.list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.stops {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}
.stops > li {
  padding: 1.3rem 0 1.7rem;
  border-top: 1px solid var(--rule);
  scroll-margin-top: 1rem;
}
.stop-layout {
  display: grid;
  grid-template-columns: 10rem minmax(0, 1fr);
  gap: 1.5rem;
}
.position {
  font-variant-numeric: tabular-nums;
}
.position strong {
  display: block;
  font-size: 1.35rem;
}
.stop-body {
  min-width: 0;
}
.stop-body p {
  margin: 0.45rem 0;
}
.meta {
  font-size: 0.95rem;
}
.image-box {
  width: 100%;
  max-width: 45rem;
  aspect-ratio: 16/9;
  margin: 1rem 0 0.5rem;
  border: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: center;
}
.image-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.image-age {
  min-height: 1.5rem;
}
.actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.75rem;
}
.sign-lines {
  border-left: 2px solid var(--accent);
  padding: 0.5rem 1rem;
  white-space: pre-line;
  font-family: ui-monospace, monospace;
}
.gap,
.not-covered,
.alert {
  padding-left: 1rem;
  border-left: 3px solid var(--accent);
}
footer {
  border-top: 1px solid var(--ink);
  margin-top: 3rem;
  padding: 1rem 0 2rem;
}
.skip {
  position: absolute;
  top: -10rem;
}
.skip:focus {
  top: 1rem;
  background: var(--bg);
  padding: 1rem;
  z-index: 10;
}
[hidden] {
  display: none !important;
}
@media (max-width: 650px) {
  body {
    padding: 0 1rem;
  }
  header {
    align-items: center;
  }
  header p {
    max-width: 8rem;
    text-align: right;
  }
  .fields {
    grid-template-columns: 1fr;
  }
  .stop-layout {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }
  .position strong {
    display: inline;
    margin-right: 0.8rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}
@media (forced-colors: active) {
  button,
  input,
  .image-box {
    border: 1px solid CanvasText;
  }
}
.maplibregl-control-container .maplibregl-ctrl-group {
  border: 1px solid var(--rule);
  border-radius: 0;
  box-shadow: none;
}

.stops > li.compact {
  padding: 0.5rem 0;
}
.compact p {
  margin: 0.2rem 0;
}
.compact button {
  padding: 0.2rem 0.5rem;
}
#departure-error {
  font-weight: 600;
}

.chain-none {
  display: flex;
  align-items: baseline;
  gap: 1rem;
}
.chain-none p {
  flex: 1;
}

/* The page's own summary sizing must not stretch MapLibre's attribution toggle. */
#map .maplibregl-ctrl-attrib-button {
  height: 24px;
  min-height: 0;
  padding: 0;
}

/* Sharing a drive: one button, a short confirmation, and a plain link field as the fallback. */
#share-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
#share-fallback label {
  display: block;
  font-weight: 600;
}
#share-link {
  box-sizing: border-box;
  max-width: 40rem;
  min-height: 44px;
  padding: 0.5rem 0.6rem;
  width: 100%;
}
