@layer tokens, reset, base, layout, components, utilities, motion;

@layer tokens {
  :root {
    --blue: #4285f4;
    --blue-ink: #1558c9;
    --red: #ea4335;
    --green: #34a853;
    --yellow: #fbbc04;
    --paper: #ffffff;
    --line: #dadce0;
    --ink: #202124;
    --muted: #5f6368;
    --park: #c8e6c9;
    --water: #aadaff;
    --road: #fdf6e3;
    --building: #f0f0f0;
    --display: "DM Serif Display", Georgia, "Times New Roman", serif;
    --reading: "Roboto Slab", Georgia, "Times New Roman", serif;
    --shadow: 0 10px 30px rgb(32 33 36 / 18%);
    --soft-shadow: 0 4px 16px rgb(32 33 36 / 15%);
    --side: 16rem;
  }
}

@layer reset {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  html {
    scroll-behavior: smooth;
  }

  body,
  h1,
  h2,
  h3,
  p,
  figure,
  ol,
  ul {
    margin: 0;
  }

  img {
    display: block;
    max-width: 100%;
  }

  a {
    color: inherit;
  }

  button,
  input,
  summary {
    font: inherit;
  }
}

@layer base {
  html {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--reading);
    font-size: 16px;
  }

  body {
    min-width: 20rem;
    overflow-x: hidden;
    background:
      linear-gradient(90deg, rgb(200 230 201 / 22%), transparent 22rem),
      var(--paper);
    font-size: 1rem;
    line-height: 1.55;
  }

  h1,
  h2,
  h3,
  strong,
  .site-mark,
  nav,
  summary {
    font-family: var(--display);
    font-style: normal;
  }

  h1 {
    max-width: 18ch;
    font-size: clamp(2.25rem, 4.2vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.03rem;
    line-height: 1.03;
  }

  h2 {
    max-width: 25ch;
    font-size: clamp(1.75rem, 3vw, 2.35rem);
    font-weight: 500;
    letter-spacing: -0.02rem;
    line-height: 1.12;
  }

  h3 {
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 1.2;
  }

  p,
  li,
  a {
    font-size: 1rem;
  }

  p {
    max-width: 70ch;
  }

  :focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 3px;
  }

  ::selection {
    background: var(--water);
    color: var(--ink);
  }
}

@layer layout {
  .side-index {
    position: fixed;
    z-index: 20;
    inset: 0 auto 0 0;
    width: var(--side);
    padding: 1rem;
    overflow-y: auto;
    border-right: 1px solid var(--line);
    background: rgb(255 255 255 / 95%);
    box-shadow: 8px 0 24px rgb(32 33 36 / 8%);
  }

  .side-index nav {
    display: grid;
    gap: 0.25rem;
    margin-top: 1.75rem;
  }

  .side-index nav p {
    margin-bottom: 0.35rem;
    color: var(--muted);
    font-family: var(--reading);
    font-size: 0.875rem;
  }

  .map-stage {
    position: relative;
    min-height: 78svh;
    margin-left: var(--side);
    overflow: hidden;
    background:
      linear-gradient(19deg, transparent 46%, rgb(253 246 227 / 90%) 46% 51%, transparent 51%),
      radial-gradient(circle at 76% 22%, var(--water) 0 12%, transparent 12.5%),
      radial-gradient(circle at 18% 74%, var(--park) 0 18%, transparent 18.5%),
      var(--building);
  }

  .map-photo {
    position: absolute;
    inset: 0;
    background:
      linear-gradient(135deg, transparent 0 44%, rgb(255 255 255 / 75%) 44% 50%, transparent 50%),
      linear-gradient(18deg, var(--park), var(--road) 48%, var(--water));
  }

  .map-photo::after {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgb(32 33 36 / 7%), rgb(32 33 36 / 3%) 55%, rgb(32 33 36 / 30%));
    content: "";
  }

  .map-photo img {
    width: 100%;
    height: 100%;
    color: transparent;
    font-size: 0;
    object-fit: cover;
  }

  .searchbar,
  .map-chips,
  .map-controls,
  .direction-card,
  .route-path {
    position: absolute;
    z-index: 2;
  }

  .searchbar {
    top: 1rem;
    right: 1rem;
    left: 1rem;
    display: flex;
    min-height: 3rem;
    align-items: center;
    gap: 0.75rem;
    max-width: 47rem;
    padding: 0.25rem 0.75rem;
    border: 1px solid rgb(218 220 224 / 80%);
    border-radius: 999px;
    background: var(--paper);
    box-shadow: var(--soft-shadow);
    font-family: var(--display);
    font-weight: 500;
    text-decoration: none;
  }

  .map-chips {
    top: 4.75rem;
    right: 1rem;
    left: 1rem;
    display: flex;
    gap: 0.5rem;
    max-width: calc(100% - 2rem);
    overflow-x: auto;
    padding: 0 0 0.5rem;
    scrollbar-width: thin;
  }

  .map-chips a {
    display: inline-flex;
    min-height: 2.75rem;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.45rem;
    padding: 0 0.9rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--paper);
    box-shadow: 0 3px 12px rgb(32 33 36 / 12%);
    font-family: var(--display);
    text-decoration: none;
  }

  .map-controls {
    top: 8.75rem;
    right: 1rem;
    display: grid;
    justify-items: center;
    gap: 1rem;
  }

  .direction-card {
    right: 6.5rem;
    bottom: 7rem;
    left: clamp(1rem, 5vw, 4.5rem);
    max-width: 44rem;
    padding: clamp(1.25rem, 3vw, 2rem);
    border: 1px solid rgb(218 220 224 / 80%);
    border-radius: 1rem;
    background: rgb(255 255 255 / 95%);
    box-shadow: var(--shadow);
  }

  .direction-card p:last-child {
    max-width: 57ch;
    margin-top: 0.9rem;
    color: var(--muted);
    font-size: 1.0625rem;
  }

  .route-path {
    top: 8.7rem;
    left: 44%;
    width: 30%;
    height: 34%;
    border-top: 0.35rem solid var(--blue);
    border-right: 0.35rem solid var(--blue);
    border-radius: 0 4rem 0 0;
    filter: drop-shadow(0 2px 2px rgb(32 33 36 / 20%));
    opacity: 0.85;
    transform: rotate(9deg);
    transform-origin: left center;
  }

  .route-path::before,
  .route-path::after {
    position: absolute;
    border-radius: 50%;
    content: "";
  }

  .route-path::before {
    top: -0.65rem;
    left: -0.65rem;
    width: 1rem;
    height: 1rem;
    border: 0.25rem solid var(--paper);
    background: var(--blue);
    box-shadow: 0 0 0 0.4rem rgb(66 133 244 / 22%);
  }

  .route-path::after {
    right: -0.75rem;
    bottom: -0.7rem;
    width: 1.35rem;
    height: 1.35rem;
    border: 0.3rem solid var(--paper);
    background: var(--red);
    box-shadow: var(--soft-shadow);
  }

  .route-path.alternate {
    top: 10rem;
    left: 50%;
    height: 25%;
    transform: rotate(-5deg);
  }

  .route-path.final {
    top: 11rem;
    left: 41%;
    height: 28%;
    transform: rotate(17deg);
  }

  .sheet {
    position: relative;
    z-index: 4;
    width: min(calc(100% - var(--side) - 4rem), 70rem);
    margin: -5.5rem 2rem 0 calc(var(--side) + 2rem);
    padding: 1rem clamp(1.25rem, 4vw, 4rem) 4rem;
    border: 1px solid var(--line);
    border-radius: 1rem 1rem 0 0;
    background: var(--paper);
    box-shadow: var(--shadow);
  }

  .sheet > section {
    padding: clamp(3.5rem, 8vw, 6rem) 0;
    border-bottom: 1px solid var(--line);
  }

  .sheet > section:last-child {
    border-bottom: 0;
  }

  .with-margin {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(12rem, 15rem);
    gap: clamp(2rem, 6vw, 5rem);
    align-items: start;
  }

  .route-cards,
  .answer-grid,
  .warning-grid,
  .report-list {
    display: grid;
    gap: 1rem;
    margin-top: 2rem;
  }

  .route-cards article {
    display: grid;
    grid-template-columns: 4.5rem 1fr;
    gap: 1rem;
  }

  .answer-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .warning-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-list article {
    display: grid;
    grid-template-columns: 4.5rem 1fr;
    gap: 1rem;
  }

  .action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
  }

  .next-route {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2.5rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: #eaf4ff;
  }

  footer {
    margin-left: var(--side);
    padding: 2rem clamp(1.25rem, 5vw, 4rem) 6rem;
    border-top: 1px solid var(--line);
    background: var(--ink);
    color: var(--paper);
  }

  footer nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
  }
}

@layer components {
  .skip {
    position: fixed;
    z-index: 50;
    top: 0.5rem;
    left: 0.5rem;
    min-height: 2.75rem;
    padding: 0.6rem 1rem;
    border-radius: 999px;
    background: var(--ink);
    color: var(--paper);
    text-decoration: none;
    transform: translateY(-150%);
  }

  .skip:focus {
    transform: translateY(0);
  }

  .site-mark {
    display: flex;
    min-height: 3rem;
    align-items: center;
    gap: 0.7rem;
    font-size: 1.1rem;
    font-weight: 500;
    text-decoration: none;
  }

  .site-mark span,
  .place-pin {
    position: relative;
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    flex: 0 0 auto;
    border: 0.25rem solid var(--paper);
    border-radius: 50% 50% 50% 0;
    background: var(--red);
    box-shadow: 0 0 0 1px var(--line);
    transform: rotate(-45deg);
  }

  .site-mark span::after,
  .place-pin::after {
    position: absolute;
    top: 0.22rem;
    left: 0.22rem;
    width: 0.3rem;
    height: 0.3rem;
    border-radius: 50%;
    background: var(--paper);
    content: "";
  }

  .side-index nav a {
    display: flex;
    min-height: 2.75rem;
    align-items: center;
    padding: 0.45rem 0.75rem;
    border-radius: 0.75rem;
    color: var(--muted);
    text-decoration: none;
  }

  .side-index nav a:hover,
  .side-index nav a[aria-current] {
    background: rgb(66 133 244 / 12%);
    color: var(--ink);
  }

  .side-index nav a[aria-current] {
    box-shadow: inset 0.25rem 0 var(--blue);
  }

  .section-list a[aria-current="location"] {
    color: var(--blue-ink);
    font-weight: 700;
  }

  .search-key {
    margin-left: auto;
    padding: 0.25rem 0.55rem;
    border: 1px solid var(--line);
    border-radius: 0.5rem;
    color: var(--muted);
    font-family: var(--reading);
    font-size: 0.8125rem;
    font-variant-numeric: tabular-nums;
  }

  .dot {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
  }

  .dot.blue {
    background: var(--blue);
  }

  .dot.green {
    background: var(--green);
  }

  .dot.yellow {
    background: var(--yellow);
  }

  .map-controls a {
    display: grid;
    width: 2.75rem;
    min-width: 2.75rem;
    height: 2.75rem;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--paper);
    box-shadow: var(--soft-shadow);
    font-family: var(--display);
    font-size: 1.25rem;
    text-decoration: none;
  }

  .map-controls .primary-control {
    width: 3.5rem;
    min-width: 3.5rem;
    height: 3.5rem;
    border-color: var(--blue-ink);
    background: var(--blue-ink);
    color: var(--paper);
  }

  .eyebrow,
  .chapter-label {
    margin-bottom: 0.65rem;
    color: var(--blue-ink);
    font-family: var(--display);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .eyebrow {
    font-size: 1rem;
  }

  .grab {
    width: 3rem;
    height: 0.3rem;
    margin: 0 auto;
    border-radius: 999px;
    background: var(--line);
  }

  .sheet section > p,
  .sheet section > div > p,
  .sheet article p,
  .urgent-panel p {
    margin-top: 1rem;
  }

  .sheet .chapter-label,
  .sheet article h3 + p {
    margin-top: 0;
  }

  .lead {
    font-size: 1.25rem;
    line-height: 1.45;
  }

  .margin-note {
    padding: 1rem;
    border-top: 0.3rem solid var(--blue);
    border-radius: 0 0 0.75rem 0.75rem;
    background: rgb(170 218 255 / 28%);
  }

  .margin-note strong {
    font-size: 1rem;
    font-weight: 500;
  }

  .margin-note p {
    margin-top: 0.45rem;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.45;
  }

  .route-cards article,
  .answer-grid article,
  .warning-grid article,
  .report-list article {
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: var(--paper);
    box-shadow: 0 3px 12px rgb(32 33 36 / 8%);
  }

  .route-number,
  .report-marker {
    display: grid;
    width: 4.5rem;
    height: 4.5rem;
    place-items: center;
    border-radius: 0.75rem;
    color: var(--ink);
    font-family: var(--display);
    font-size: 1.5rem;
    font-weight: 700;
  }

  .route-number.approved,
  .blue-bg {
    background: var(--water);
  }

  .route-number.compound,
  .green-bg {
    background: var(--park);
  }

  .route-number.warning,
  .yellow-bg {
    background: var(--yellow);
  }

  .status {
    display: inline-flex;
    width: fit-content;
    min-height: 2rem;
    align-items: center;
    margin: 0 0 0.45rem;
    padding: 0.25rem 0.65rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--ink);
    font-family: var(--display);
    font-size: 0.875rem;
  }

  .status.good {
    border-color: var(--green);
    background: rgb(200 230 201 / 40%);
  }

  .status.caution,
  .status.stop {
    border-color: var(--yellow);
    background: rgb(251 188 4 / 18%);
  }

  .answer-grid article {
    min-height: 13rem;
  }

  .answer-grid h3 {
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--line);
  }

  .warning-grid article > span {
    display: grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    margin-bottom: 0.75rem;
    border-radius: 0.5rem;
    background: var(--yellow);
    color: var(--ink);
    font-family: var(--display);
    font-weight: 700;
  }

  .check-route ol {
    display: grid;
    gap: 0.65rem;
    max-width: 50rem;
    margin-top: 2rem;
    padding: 0;
    list-style: none;
    counter-reset: questions;
  }

  .check-route li {
    display: grid;
    grid-template-columns: 8rem 1fr;
    min-height: 3.5rem;
    align-items: center;
    gap: 1rem;
    padding: 0.65rem 1rem;
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    counter-increment: questions;
  }

  .check-route li::before {
    content: counter(questions, decimal-leading-zero);
    color: var(--blue-ink);
    font-family: var(--display);
    font-variant-numeric: tabular-nums;
    font-weight: 700;
  }

  .check-route li span {
    grid-column: 1;
    margin-left: 2.25rem;
    font-family: var(--display);
    font-weight: 500;
  }

  .check-route li::before,
  .check-route li span {
    grid-row: 1;
  }

  .check-route li > :not(span) {
    grid-column: 2;
  }

  .next-route > div > span,
  .next-route strong {
    display: block;
  }

  .next-route > div > span {
    color: var(--muted);
    font-size: 0.875rem;
  }

  .next-route strong {
    margin-top: 0.2rem;
    font-weight: 500;
  }

  .next-route a,
  .action-row a,
  .card-action,
  .report-list a,
  .endnotes a,
  footer a {
    display: inline-flex;
    min-height: 2.75rem;
    align-items: center;
  }

  .next-route a,
  .action-row a,
  .card-action,
  .report-list a {
    padding: 0.55rem 0.9rem;
    border: 1px solid var(--blue-ink);
    border-radius: 999px;
    color: var(--blue-ink);
    font-family: var(--display);
    font-weight: 500;
    text-decoration: none;
  }

  .next-route a {
    background: var(--blue-ink);
    color: var(--paper);
  }

  .card-action {
    margin-top: 1rem;
  }

  .report-list a {
    margin-top: 0.75rem;
  }

  .urgent-panel {
    margin: 2rem 0;
    padding-right: clamp(1rem, 4vw, 3rem) !important;
    padding-left: clamp(1rem, 4vw, 3rem) !important;
    border: 1px solid var(--yellow) !important;
    border-radius: 1rem;
    background: #fef6dd;
  }

  .endnotes ol {
    max-width: 54rem;
    margin-top: 2rem;
    padding-left: 1.5rem;
  }

  .endnotes li {
    padding: 0.35rem 0 1rem 0.5rem;
  }

  .endnotes a {
    color: var(--blue-ink);
    font-family: var(--display);
    font-weight: 500;
    text-underline-offset: 0.2rem;
  }

  .endnotes span {
    display: block;
    max-width: 65ch;
    color: var(--muted);
  }

  .jump-menu {
    position: fixed;
    z-index: 30;
    right: 1rem;
    bottom: 1rem;
  }

  .jump-menu summary {
    display: grid;
    width: 3.5rem;
    height: 3.5rem;
    place-items: center;
    border-radius: 50%;
    background: var(--blue-ink);
    box-shadow: var(--shadow);
    color: var(--paper);
    cursor: pointer;
    list-style: none;
  }

  .jump-menu summary::-webkit-details-marker {
    display: none;
  }

  .jump-menu summary span:last-child {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .jump-menu nav {
    position: absolute;
    right: 0;
    bottom: 4.25rem;
    display: grid;
    width: min(19rem, calc(100vw - 2rem));
    padding: 0.5rem;
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: var(--paper);
    box-shadow: var(--shadow);
  }

  .jump-menu nav a {
    display: flex;
    min-height: 2.75rem;
    align-items: center;
    padding: 0.45rem 0.75rem;
    border-radius: 0.6rem;
    color: var(--ink);
    text-decoration: none;
  }

  .jump-menu nav a:hover,
  .jump-menu nav a[aria-current="location"] {
    background: rgb(66 133 244 / 12%);
  }

  footer a {
    padding: 0.35rem 0.75rem;
    border: 1px solid rgb(255 255 255 / 45%);
    border-radius: 999px;
    text-decoration: none;
  }

  footer p {
    color: var(--line);
    font-size: 1rem;
  }

  .error-page {
    min-height: 100svh;
    background:
      radial-gradient(circle at 20% 20%, var(--park) 0 14%, transparent 14.5%),
      radial-gradient(circle at 80% 30%, var(--water) 0 11%, transparent 11.5%),
      linear-gradient(28deg, transparent 46%, var(--road) 46% 53%, transparent 53%),
      var(--building);
  }

  .error-page .error-card {
    width: min(42rem, calc(100% - 2rem));
    margin: clamp(3rem, 12vh, 8rem) auto;
    padding: clamp(1.5rem, 5vw, 3.5rem);
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: rgb(255 255 255 / 96%);
    box-shadow: var(--shadow);
  }

  .error-card h1,
  .error-card p {
    margin-top: 1rem;
  }

  .error-card nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 2rem;
  }

  .error-card a {
    display: inline-flex;
    min-height: 2.75rem;
    align-items: center;
    padding: 0.55rem 0.9rem;
    border: 1px solid var(--blue-ink);
    border-radius: 999px;
    color: var(--blue-ink);
    text-decoration: none;
  }

  .error-page footer {
    margin-left: 0;
  }
}

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

@layer motion {
  .route-path {
    animation: draw-route 600ms ease-out both;
  }

  .route-path::before {
    animation: location-pulse 1.8s ease-out infinite;
  }

  .sheet {
    animation: settle-sheet 350ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }

  a,
  summary {
    transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
  }

  @keyframes draw-route {
    from {
      clip-path: inset(0 100% 100% 0);
    }
    to {
      clip-path: inset(-1rem -1rem -1rem -1rem);
    }
  }

  @keyframes location-pulse {
    0%, 100% {
      box-shadow: 0 0 0 0 rgb(66 133 244 / 35%);
    }
    50% {
      box-shadow: 0 0 0 0.8rem rgb(66 133 244 / 0%);
    }
  }

  @keyframes settle-sheet {
    from {
      transform: translateY(1.5rem);
    }
    to {
      transform: translateY(0);
    }
  }

  @media (prefers-reduced-motion: reduce) {
    html {
      scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
    }
  }
}

@media (max-width: 62rem) {
  .side-index {
    position: relative;
    inset: auto;
    display: flex;
    width: 100%;
    min-height: 4rem;
    align-items: center;
    gap: 1rem;
    overflow-x: auto;
    padding: 0.5rem 1rem;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    box-shadow: none;
  }

  .side-index nav:first-of-type {
    display: flex;
    flex: 0 0 auto;
    gap: 0.25rem;
    margin: 0;
  }

  .side-index nav p,
  .side-index .section-list {
    display: none;
  }

  .side-index nav a {
    white-space: nowrap;
  }

  .site-mark {
    flex: 0 0 auto;
  }

  .map-stage,
  footer {
    margin-left: 0;
  }

  .sheet {
    width: calc(100% - 2rem);
    margin-right: 1rem;
    margin-left: 1rem;
  }

  .answer-grid {
    grid-template-columns: 1fr;
  }

  .answer-grid article {
    min-height: 0;
  }
}

@media (max-width: 43rem) {
  .map-stage {
    min-height: 80svh;
  }

  .searchbar {
    right: 0.75rem;
    left: 0.75rem;
  }

  .side-index {
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    overflow-x: visible;
  }

  .side-index nav:first-of-type {
    flex: 1 1 100%;
    flex-wrap: wrap;
  }

  .side-index nav a {
    padding: 0.45rem 0.6rem;
  }

  .map-chips {
    right: 4.5rem;
    left: 0.75rem;
    max-width: none;
    flex-wrap: wrap;
    overflow-x: visible;
  }

  .map-chips a {
    padding: 0 0.75rem;
  }

  .search-key {
    display: none;
  }

  .map-controls {
    top: 8.4rem;
    right: 0.75rem;
  }

  .route-path {
    top: 10rem;
    left: 25%;
    width: 42%;
    height: 24%;
  }

  .direction-card {
    right: 4.5rem;
    bottom: 5.75rem;
    left: 0.75rem;
    max-width: none;
    padding: 1.15rem;
  }

  .direction-card h1 {
    font-size: clamp(2.15rem, 11vw, 2.75rem);
  }

  .direction-card p:last-child {
    font-size: 1rem;
  }

  .sheet {
    width: calc(100% - 1rem);
    margin: -4.5rem 0.5rem 0;
    padding: 1rem 1rem 3rem;
  }

  .with-margin,
  .warning-grid {
    grid-template-columns: 1fr;
  }

  .margin-note {
    margin-top: 0.5rem;
  }

  .route-cards article,
  .report-list article {
    grid-template-columns: 3.5rem 1fr;
  }

  .route-number,
  .report-marker {
    width: 3.5rem;
    height: 3.5rem;
  }

  .check-route li {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .check-route li::before,
  .check-route li span,
  .check-route li > :not(span) {
    grid-column: 1;
  }

  .check-route li::before,
  .check-route li span {
    grid-row: auto;
  }

  .check-route li span {
    margin-left: 0;
  }

  .next-route {
    align-items: stretch;
    flex-direction: column;
  }

  .next-route a {
    justify-content: center;
  }

  .action-row {
    align-items: stretch;
    flex-direction: column;
  }

  .action-row a,
  .card-action,
  .report-list a {
    justify-content: center;
    text-align: center;
  }

  footer {
    padding-bottom: 6rem;
  }
}

@media (prefers-color-scheme: dark) {
  html,
  body {
    background: var(--ink);
  }

  body {
    color: var(--ink);
  }

  .side-index,
  .sheet,
  .jump-menu nav,
  .searchbar,
  .map-chips a,
  .map-controls a:not(.primary-control),
  .direction-card,
  .route-cards article,
  .answer-grid article,
  .warning-grid article,
  .report-list article {
    background-color: var(--paper);
  }
}
