:root {
  color-scheme: light;
  --ink: #263f56;
  --ink-deep: #132b40;
  --muted: #64717b;
  --blue: #3c718c;
  --blue-pale: #dce9ed;
  --cream: #f4f0e4;
  --paper: #fffdf7;
  --orange: #e46e3d;
  --yellow: #f1c54b;
  --green: #4e8971;
  --red: #c94f43;
  --line: #bac5c7;
  --shadow: 0 18px 45px rgb(19 43 64 / 13%);
  color: var(--ink);
  background: var(--cream);
  font-family: "Yu Gothic UI", "Hiragino Kaku Gothic ProN", "BIZ UDPGothic", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background-color: var(--cream);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30'%3E%3Cpath d='M0 29.5h30M29.5 0v30' fill='none' stroke='%23263f56' stroke-opacity='.035'/%3E%3C/svg%3E");
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

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

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

button {
  color: inherit;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.6rem;
  left: 0.6rem;
  padding: 0.7rem 1rem;
  color: white;
  background: var(--ink-deep);
  transform: translateY(-150%);
}

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

.site-header,
.site-footer,
.home,
.content-page,
.not-found {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  border-bottom: 1px solid rgb(38 63 86 / 20%);
}

.wordmark {
  display: inline-flex;
  gap: 0.75rem;
  align-items: center;
  color: var(--ink-deep);
  font-weight: 900;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.route-mark {
  position: relative;
  display: block;
  width: 32px;
  height: 32px;
  background: var(--ink-deep);
  border-radius: 50%;
}

.route-mark i:first-child {
  position: absolute;
  top: 7px;
  left: 8px;
  width: 15px;
  height: 11px;
  border-right: 4px solid var(--paper);
  border-bottom: 4px solid var(--paper);
}

.route-mark i:last-child {
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 9px;
  height: 9px;
  background: var(--orange);
  border: 2px solid var(--paper);
  border-radius: 50% 50% 50% 2px;
  transform: rotate(-45deg);
}

.site-header nav {
  display: flex;
  gap: 0.35rem;
}

.site-header nav a {
  padding: 0.55rem 0.75rem;
  color: var(--muted);
  border-radius: 5px;
  font-size: 0.83rem;
  font-weight: 700;
  text-decoration: none;
}

.site-header nav a:hover {
  color: var(--ink-deep);
  background: rgb(255 253 247 / 75%);
}

.route-intro {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(430px, 1.1fr);
  gap: clamp(2rem, 6vw, 5.5rem);
  align-items: center;
  min-height: 530px;
  padding: 4.3rem 2rem 4rem;
}

.eyebrow,
.section-heading p,
.desk-heading p,
.result-heading p,
.saved-list header p,
.content-heading p {
  margin: 0 0 0.55rem;
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.product-heading h1 {
  max-width: 14em;
  margin: 0;
  color: var(--ink-deep);
  font-size: clamp(1.85rem, 3.2vw, 2.5rem);
  line-height: 1.38;
  letter-spacing: 0.025em;
}

.product-heading > p:not(.eyebrow) {
  max-width: 31rem;
  margin: 1.2rem 0 0;
  color: var(--muted);
  line-height: 1.9;
}

.data-pair {
  display: flex;
  gap: 0.65rem;
  margin-top: 1.8rem;
}

.data-pair span {
  display: grid;
  min-width: 150px;
  padding: 0.7rem 0.85rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 5px solid var(--orange);
  box-shadow: 4px 4px 0 var(--blue-pale);
}

.data-pair span:last-child {
  border-left-color: var(--green);
}

.data-pair strong {
  color: var(--ink-deep);
  font-family: ui-monospace, "Cascadia Mono", monospace;
  font-size: 1.15rem;
}

.data-pair small {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.65rem;
}

.route-scene {
  position: relative;
  min-height: 405px;
}

.street-board {
  position: absolute;
  inset: 0 100px 42px 0;
  overflow: hidden;
  background-color: #dce9ed;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72'%3E%3Cpath d='M0 36h72M36 0v72' stroke='%23fffdf7' stroke-width='2'/%3E%3C/svg%3E");
  border: 9px solid var(--ink-deep);
  border-radius: 12px;
  box-shadow: 17px 18px 0 rgb(228 110 61 / 22%);
  transform: rotate(-1deg);
}

.street {
  position: absolute;
  z-index: 1;
  display: block;
  background: var(--paper);
  border: 2px solid rgb(60 113 140 / 30%);
  border-radius: 20px;
}

.street.one {
  top: 13%;
  left: -8%;
  width: 118%;
  height: 32px;
  transform: rotate(17deg);
}

.street.two {
  top: -9%;
  left: 38%;
  width: 35px;
  height: 120%;
  transform: rotate(23deg);
}

.street.three {
  bottom: 12%;
  left: -8%;
  width: 100%;
  height: 28px;
  transform: rotate(-13deg);
}

.route-pin {
  position: absolute;
  z-index: 2;
  width: 25px;
  height: 25px;
  background: var(--orange);
  border: 4px solid var(--ink-deep);
  border-radius: 50% 50% 50% 7px;
  box-shadow: 3px 4px 0 rgb(19 43 64 / 16%);
  transform: rotate(-45deg);
}

.route-pin::after {
  position: absolute;
  inset: 6px;
  content: "";
  background: var(--paper);
  border-radius: 50%;
}

.route-pin.first {
  top: 18%;
  right: 17%;
}

.route-pin.second {
  top: 46%;
  left: 39%;
  background: var(--green);
}

.route-pin.third {
  bottom: 16%;
  left: 16%;
}

.you-are-here {
  position: absolute;
  z-index: 3;
  right: 27%;
  bottom: 18%;
  padding: 0.35rem 0.55rem;
  color: var(--paper);
  background: var(--blue);
  border-radius: 3px;
  font-size: 0.62rem;
}

.you-are-here::after {
  position: absolute;
  top: 100%;
  left: 15px;
  width: 0;
  height: 0;
  content: "";
  border: 7px solid transparent;
  border-top-color: var(--blue);
}

.signpost {
  position: absolute;
  z-index: 4;
  right: 0;
  bottom: 0;
  display: grid;
  gap: 8px;
  width: 250px;
  padding: 12px;
  background: var(--ink-deep);
  border: 5px solid var(--ink-deep);
  box-shadow: var(--shadow);
  transform: rotate(2deg);
}

.sign {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 0 0.65rem;
  align-items: center;
  min-height: 68px;
  padding: 0.65rem;
  color: var(--ink-deep);
  background: var(--paper);
  border-left: 7px solid var(--orange);
}

.sign.shelter {
  margin-left: -8px;
  border-left-color: var(--green);
}

.sign i,
.mode-icon {
  display: grid;
  place-items: center;
  color: white;
  background: var(--orange);
  font-style: normal;
  font-weight: 900;
}

.sign i {
  grid-row: 1 / 3;
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.sign.shelter i {
  background: var(--green);
}

.sign b {
  font-size: 0.78rem;
}

.sign small {
  color: var(--muted);
  font-size: 0.58rem;
}

.signpost > strong {
  color: var(--yellow);
  font-family: ui-monospace, "Cascadia Mono", monospace;
  font-size: 0.9rem;
  letter-spacing: 0.17em;
  text-align: right;
}

.safety-ribbon {
  display: flex;
  align-items: stretch;
  margin-bottom: 3rem;
  color: var(--paper);
  background: var(--ink-deep);
  border: 1px solid var(--ink-deep);
  box-shadow: 8px 8px 0 var(--blue-pale);
}

.safety-ribbon > * {
  display: flex;
  align-items: center;
  min-height: 50px;
  padding: 0.55rem 1rem;
  border-right: 1px solid rgb(255 253 247 / 20%);
  font-size: 0.72rem;
}

.safety-ribbon strong {
  color: var(--yellow);
}

.safety-ribbon a {
  margin-left: auto;
  color: var(--yellow);
  font-weight: 800;
}

.mode-deck,
.prefecture-deck,
.directory-workspace {
  scroll-margin-top: 1.5rem;
}

.mode-deck {
  margin-bottom: 3rem;
}

.section-heading,
.desk-heading,
.result-heading,
.saved-list > header {
  display: flex;
  gap: 1rem;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 1.2rem;
}

.section-heading h2,
.desk-heading h2,
.result-heading h2,
.saved-list h2 {
  margin: 0;
  color: var(--ink-deep);
  font-size: 1.35rem;
}

.section-heading > span,
.section-heading output,
.result-heading output,
.saved-list output {
  color: var(--blue);
  font-family: ui-monospace, "Cascadia Mono", monospace;
  font-size: 0.75rem;
  font-weight: 800;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.mode-grid button {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
  min-height: 118px;
  padding: 1.2rem;
  background: var(--paper);
  border: 2px solid var(--line);
  box-shadow: 5px 6px 0 rgb(38 63 86 / 9%);
  cursor: pointer;
  text-align: left;
}

.mode-grid button:first-child {
  border-left: 9px solid var(--orange);
}

.mode-grid button:last-child {
  border-left: 9px solid var(--green);
}

.mode-grid button:hover {
  border-color: var(--blue);
}

.mode-grid button[aria-pressed="true"] {
  background: #e9f0ef;
  border-color: var(--ink-deep);
  box-shadow: 7px 8px 0 var(--blue-pale);
}

.mode-icon {
  flex: 0 0 auto;
  width: 45px;
  height: 45px;
  border: 4px solid var(--ink-deep);
  border-radius: 50%;
  font-size: 1.15rem;
}

.mode-icon.house {
  background: var(--green);
}

.mode-grid button > span:nth-child(2) {
  display: grid;
  gap: 0.25rem;
}

.mode-grid small,
.mode-grid em {
  color: var(--muted);
  font-size: 0.68rem;
  font-style: normal;
}

.mode-grid strong {
  color: var(--ink-deep);
  font-size: 1.03rem;
}

.mode-grid button > b {
  color: var(--blue);
  font-family: ui-monospace, "Cascadia Mono", monospace;
  font-size: 0.8rem;
}

.region-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.region-card {
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 3px;
  box-shadow: 4px 5px 0 rgb(38 63 86 / 8%);
}

.region-card h3 {
  margin: 0;
  padding: 0.65rem 0.9rem;
  color: var(--paper);
  background: var(--blue);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
}

.region-card:nth-child(2n) h3 {
  background: var(--ink);
}

.region-card > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 0.35rem;
}

.region-card button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  padding: 0.65rem 0.6rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 3px;
  cursor: pointer;
  text-align: left;
}

.region-card button:hover {
  background: var(--blue-pale);
}

.region-card button[aria-pressed="true"] {
  color: white;
  background: var(--orange);
}

.region-card button span {
  overflow: hidden;
  font-size: 0.83rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.region-card button small {
  color: var(--muted);
  font-family: ui-monospace, "Cascadia Mono", monospace;
  font-size: 0.6rem;
}

.region-card button[aria-pressed="true"] small {
  color: white;
}

.directory-workspace {
  margin-top: 4.5rem;
  padding-top: 1.6rem;
  border-top: 8px solid var(--ink-deep);
}

.search-desk {
  padding: clamp(1.2rem, 3vw, 2.1rem);
  background: #e7edef;
  border: 1px solid var(--line);
}

.desk-heading button,
.reset-filters,
.active-mode button {
  padding: 0.55rem 0.75rem;
  color: var(--blue);
  background: transparent;
  border: 1px solid var(--blue);
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 800;
}

.selected-prefecture {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.8rem;
  align-items: center;
  padding: 0.7rem 0;
  border-block: 1px solid var(--line);
}

.selected-prefecture span {
  display: grid;
  place-items: center;
  width: 37px;
  height: 37px;
  color: white;
  background: var(--blue);
  border-radius: 50%;
  font-family: ui-monospace, "Cascadia Mono", monospace;
  font-size: 0.72rem;
  font-weight: 900;
}

.selected-prefecture strong {
  color: var(--ink-deep);
  font-size: 1.13rem;
}

.selected-prefecture output {
  color: var(--muted);
  font-family: ui-monospace, "Cascadia Mono", monospace;
  font-size: 0.78rem;
  font-weight: 800;
}

.active-mode {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: center;
  margin: 1rem 0;
  padding: 0.7rem;
  background: var(--paper);
  border-left: 6px solid var(--orange);
}

.active-mode:has(.mode-icon.house) {
  border-left-color: var(--green);
}

.active-mode .mode-icon {
  width: 37px;
  height: 37px;
  border-width: 3px;
  font-size: 0.9rem;
}

.active-mode p {
  display: grid;
  gap: 0.1rem;
  margin: 0;
}

.active-mode small {
  color: var(--muted);
  font-size: 0.6rem;
}

.active-mode strong {
  color: var(--ink-deep);
  font-size: 0.86rem;
}

.place-search {
  display: grid;
  grid-template-columns: minmax(175px, 0.35fr) 1fr;
  gap: 1.2rem;
  align-items: center;
  margin: 1.4rem 0;
  color: var(--ink-deep);
  font-size: 0.8rem;
  font-weight: 800;
}

.search-box {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.65rem;
  align-items: center;
  min-height: 50px;
  padding-inline: 0.9rem;
  background: var(--paper);
  border: 2px solid var(--ink-deep);
  box-shadow: 4px 4px 0 rgb(38 63 86 / 12%);
}

.search-box i {
  color: var(--orange);
  font-size: 1.5rem;
  font-style: normal;
}

.search-box input {
  width: 100%;
  min-width: 0;
  padding: 0.8rem 0;
  background: transparent;
  border: 0;
  outline: 0;
}

.hazard-filter {
  position: relative;
  margin: 0;
  padding: 1.1rem 0 0;
  border: 0;
  border-top: 1px dashed var(--line);
}

.hazard-filter legend {
  padding: 0 0.6rem 0 0;
  color: var(--ink-deep);
  font-size: 0.79rem;
  font-weight: 800;
}

#hazard-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.48rem;
  padding-right: 7rem;
}

#hazard-buttons p {
  margin: 0;
  color: var(--muted);
}

#hazard-buttons button {
  padding: 0.46rem 0.68rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 2rem;
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 800;
}

#hazard-buttons button:hover {
  border-color: var(--orange);
}

#hazard-buttons button[aria-pressed="true"] {
  color: white;
  background: var(--orange);
  border-color: var(--orange);
}

#hazard-buttons button[aria-pressed="true"]::before {
  content: "✓ ";
}

.reset-filters {
  position: absolute;
  top: 0.75rem;
  right: 0;
}

.search-actions {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  margin-top: 1.15rem;
}

.search-actions button {
  min-height: 42px;
  padding: 0.55rem 0.85rem;
  color: var(--paper);
  background: var(--blue);
  border: 1px solid var(--ink-deep);
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 900;
}

.search-actions button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.search-actions small,
#search-status {
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.55;
}

#search-status {
  min-height: 1.4em;
  margin: 0.9rem 0 0;
}

.result-and-saved {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 1.2rem;
  align-items: start;
  margin-top: 1.2rem;
}

.place-results,
.saved-list {
  min-width: 0;
  padding: clamp(1.1rem, 2.4vw, 1.8rem);
  background: rgb(255 253 247 / 72%);
  border: 1px solid var(--line);
}

.place-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.place-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 320px;
  padding: 1.05rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 7px solid var(--orange);
  box-shadow: 4px 5px 0 rgb(38 63 86 / 9%);
}

.place-card.shelter {
  border-top-color: var(--green);
}

.place-card > header {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.66rem;
}

.place-card > header span {
  overflow: hidden;
  color: var(--blue);
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.place-card h3 {
  margin: 0.75rem 0 0.35rem;
  color: var(--ink-deep);
  font-size: 1.02rem;
  line-height: 1.55;
}

.place-address {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  align-items: center;
  margin: 0 0 0.8rem;
  color: var(--muted);
  font-size: 0.71rem;
  line-height: 1.6;
}

.place-address strong {
  padding: 0.2rem 0.38rem;
  color: var(--blue);
  background: var(--blue-pale);
  border-radius: 3px;
  font-family: ui-monospace, "Cascadia Mono", monospace;
  font-size: 0.62rem;
}

.field-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.field-tags span,
.field-tags small {
  padding: 0.25rem 0.42rem;
  color: #934025;
  background: #f6dfd4;
  border-radius: 3px;
  font-size: 0.6rem;
  font-weight: 700;
  line-height: 1.3;
}

.place-card.shelter .field-tags span,
.place-card.shelter .field-tags small {
  color: #2d684f;
  background: #dcebe3;
}

.place-note {
  display: -webkit-box;
  overflow: hidden;
  margin: 0.8rem 0;
  color: #566872;
  font-size: 0.7rem;
  line-height: 1.7;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.place-card dl {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.3rem 0.6rem;
  margin: auto 0 0.9rem;
  padding-top: 0.7rem;
  border-top: 1px dashed var(--line);
  font-size: 0.63rem;
}

.place-card dt {
  color: var(--muted);
}

.place-card dd {
  overflow: hidden;
  margin: 0;
  font-family: ui-monospace, "Cascadia Mono", monospace;
  font-weight: 700;
  text-overflow: ellipsis;
}

.card-actions {
  display: flex;
  gap: 0.5rem;
}

.card-actions > * {
  flex: 1;
  display: grid;
  place-items: center;
  min-height: 40px;
  padding: 0.45rem;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.67rem;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
}

.save-place {
  color: var(--ink-deep);
  background: var(--yellow);
  border: 1px solid var(--ink-deep);
}

.save-place:disabled {
  color: var(--muted);
  background: #e9e6dc;
  border-color: var(--line);
  cursor: default;
}

.card-actions a {
  color: var(--paper);
  background: var(--ink-deep);
  border: 1px solid var(--ink-deep);
}

.loading-note,
.empty-results {
  grid-column: 1 / -1;
  padding: 3rem 1rem;
  color: var(--muted);
  text-align: center;
}

.empty-results span {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin: 0 auto 1rem;
  color: white;
  background: var(--blue);
  border-radius: 50%;
}

.empty-results h3,
.empty-results p {
  margin: 0.45rem 0;
}

.load-more,
.page-cta {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 48px;
  margin-top: 1rem;
  color: white;
  background: var(--blue);
  border: 0;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 900;
  text-decoration: none;
}

.saved-list {
  position: sticky;
  top: 1rem;
  background: #f3e8c8;
  border-top: 7px solid var(--yellow);
}

#saved-items {
  display: grid;
  gap: 0.55rem;
}

#saved-items > p {
  margin: 1.5rem 0;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.7;
}

#saved-items article {
  display: grid;
  grid-template-columns: 27px 1fr;
  gap: 0.24rem 0.6rem;
  padding: 0.7rem;
  background: var(--paper);
  border: 1px solid #cebd88;
}

#saved-items article > span {
  grid-row: 1 / 4;
  color: var(--orange);
  font-family: ui-monospace, "Cascadia Mono", monospace;
  font-size: 0.68rem;
  font-weight: 900;
}

#saved-items article strong {
  color: var(--ink-deep);
  font-size: 0.75rem;
  line-height: 1.45;
}

#saved-items article small,
#saved-items article p {
  margin: 0;
  color: var(--muted);
  font-size: 0.6rem;
  line-height: 1.5;
}

#saved-items article p {
  grid-column: 2;
}

#saved-items article div {
  grid-column: 1 / -1;
  display: flex;
  gap: 0.5rem;
  justify-content: end;
  margin-top: 0.35rem;
}

#saved-items article a,
.remove-saved {
  color: var(--blue);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 0.64rem;
  font-weight: 800;
}

.saved-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  margin-top: 0.9rem;
}

.saved-actions button {
  min-height: 40px;
  padding: 0.45rem 0.6rem;
  color: white;
  background: var(--ink-deep);
  border: 1px solid var(--ink-deep);
  cursor: pointer;
  font-size: 0.66rem;
  font-weight: 900;
}

.saved-actions .clear-button {
  color: var(--muted);
  background: transparent;
  border-color: var(--line);
}

.saved-actions button:disabled {
  opacity: 0.45;
  cursor: default;
}

.content-page,
.not-found {
  min-height: calc(100vh - 170px);
  padding: 4rem 0;
}

.content-heading {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  max-width: 780px;
  margin-bottom: 2.4rem;
}

.page-index {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 67px;
  height: 67px;
  color: var(--paper);
  background: var(--blue);
  border: 5px solid var(--ink-deep);
  border-radius: 50%;
  font-weight: 900;
}

.content-heading h1 {
  margin: 0;
  color: var(--ink-deep);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
}

.definition-grid,
.instruction-grid,
.source-grid,
.privacy-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.definition-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 1rem;
}

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

.definition-grid section,
.instruction-grid section,
.source-grid section,
.privacy-grid section,
.care-note {
  padding: 1.5rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 6px solid var(--blue);
  box-shadow: 4px 5px 0 rgb(38 63 86 / 8%);
}

.definition-grid section:first-child {
  border-top-color: var(--orange);
}

.definition-grid section:last-child,
.instruction-grid section:nth-child(3),
.privacy-grid section:nth-child(2) {
  border-top-color: var(--green);
}

.instruction-grid section:nth-child(2),
.source-grid section:nth-child(2) {
  border-top-color: var(--orange);
}

.definition-grid .mode-icon {
  width: 41px;
  height: 41px;
  border-width: 3px;
}

.instruction-grid b {
  color: var(--orange);
  font-family: ui-monospace, "Cascadia Mono", monospace;
}

.definition-grid h2,
.instruction-grid h2,
.source-grid h2,
.privacy-grid h2 {
  margin: 0.75rem 0;
  color: var(--ink-deep);
  font-size: 1rem;
}

.definition-grid p,
.instruction-grid p,
.source-grid p,
.privacy-grid p,
.care-note p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.9;
}

.source-grid a {
  color: var(--blue);
  font-weight: 800;
}

.care-note {
  margin-top: 1rem;
  border-top-color: var(--red);
}

.care-note strong {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--red);
}

.page-cta {
  width: fit-content;
  min-width: 180px;
  padding-inline: 1.2rem;
}

.not-found {
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
}

.not-found span {
  color: var(--orange);
  font-family: ui-monospace, "Cascadia Mono", monospace;
  font-size: 2.2rem;
  font-weight: 900;
}

.not-found h1 {
  margin: 0.7rem 0;
  color: var(--ink-deep);
  font-size: 1.6rem;
}

.not-found p {
  color: var(--muted);
}

.not-found a {
  padding: 0.65rem 1rem;
  color: white;
  background: var(--blue);
  text-decoration: none;
}

.site-footer {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-top: 5rem;
  padding: 1.5rem 0 2rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 0.68rem;
}

.site-footer > span:last-child {
  display: flex;
  gap: 1rem;
}

@media (max-width: 940px) {
  .route-intro {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .route-scene {
    width: min(630px, 100%);
    min-height: 390px;
    margin-inline: auto;
  }

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

  .result-and-saved {
    grid-template-columns: 1fr;
  }

  .saved-list {
    position: static;
  }
}

@media (max-width: 680px) {
  .site-header,
  .site-footer,
  .home,
  .content-page,
  .not-found {
    width: min(100% - 24px, 1180px);
  }

  .site-header {
    min-height: 66px;
  }

  .site-header nav {
    gap: 0;
  }

  .site-header nav a {
    padding-inline: 0.42rem;
    font-size: 0.7rem;
  }

  .route-intro {
    gap: 2.5rem;
    padding: 3.1rem 0.25rem 3rem;
  }

  .product-heading h1 {
    font-size: 1.78rem;
  }

  .data-pair {
    flex-direction: column;
  }

  .route-scene {
    min-height: 310px;
  }

  .street-board {
    inset: 0 55px 40px 0;
    border-width: 6px;
  }

  .signpost {
    width: 200px;
  }

  .sign {
    grid-template-columns: 31px 1fr;
    min-height: 57px;
    padding: 0.5rem;
  }

  .sign i {
    width: 30px;
    height: 30px;
  }

  .safety-ribbon {
    flex-wrap: wrap;
  }

  .safety-ribbon > * {
    flex: 1 0 50%;
    justify-content: center;
    min-height: 43px;
    padding: 0.4rem;
    text-align: center;
  }

  .safety-ribbon a {
    margin-left: 0;
  }

  .mode-grid,
  .region-grid,
  .place-grid,
  .definition-grid,
  .instruction-grid,
  .source-grid,
  .privacy-grid {
    grid-template-columns: 1fr;
  }

  .mode-grid button {
    grid-template-columns: auto 1fr;
  }

  .mode-grid button > b {
    grid-column: 2;
  }

  .section-heading,
  .desk-heading,
  .result-heading,
  .saved-list > header {
    align-items: center;
  }

  .section-heading h2,
  .desk-heading h2,
  .result-heading h2,
  .saved-list h2 {
    font-size: 1.1rem;
  }

  .active-mode {
    grid-template-columns: auto 1fr;
  }

  .active-mode button {
    grid-column: 2;
    width: fit-content;
  }

  .place-search {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  #hazard-buttons {
    padding: 0 0 3.2rem;
  }

  .reset-filters {
    top: auto;
    right: auto;
    bottom: 0;
    left: 0;
  }

  .search-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .place-results,
  .saved-list {
    padding: 1rem;
  }

  .place-card {
    min-height: 0;
  }

  .content-page {
    padding-top: 3rem;
  }

  .content-heading {
    align-items: flex-start;
  }

  .page-index {
    width: 54px;
    height: 54px;
  }

  .content-heading h1 {
    font-size: 1.45rem;
  }

  .site-footer {
    flex-direction: column;
    line-height: 1.7;
  }
}

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