:root {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #18243b;
  background: #e8eff8;
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
  --blue: #205cb5;
  --line: #dbe5f1;
  --quiet: #586980;
  --paper: #f6f9fd;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid #3575cf; outline-offset: 3px; }
h1, h2, p { margin: 0; }
button, h1, h2, p, li, a { overflow-wrap: anywhere; }
a { color: var(--blue); text-underline-offset: .2em; }
#app {
  margin-inline: auto;
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: clip;
  background: var(--paper);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.home-header {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 235px;
  padding: calc(17px + env(safe-area-inset-top)) 22px 37px;
  background: linear-gradient(153deg, #f7fbff 5%, #e8f3ff 58%, #d4e9fd);
}
.home-header::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: url("./skyline.png") right bottom / auto 79% no-repeat;
  mask-image: linear-gradient(104deg, transparent 43%, #000 76%);
}
.town-button {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  min-height: 44px;
  background: #fff;
  border: 1px solid #d7e4f4;
  border-radius: 24px;
  padding: 0 14px;
  font-weight: 700;
  font-size: 15px;
  color: #204577;
}
.home-header h1 { margin-top: 20px; font-size: clamp(34px, 9vw, 42px); line-height: 1.15; letter-spacing: .04em; }
.home-header p { margin-top: 7px; font-size: 19px; color: #48678d; letter-spacing: .12em; font-weight: 650; }
.service-grid {
  position: relative;
  margin-top: -17px;
  padding: 16px 15px calc(25px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  border-radius: 22px 22px 0 0;
  background: var(--paper);
}
.tile {
  min-width: 0;
  min-height: 67px;
  display: flex;
  align-items: center;
  text-align: left;
  gap: 9px;
  padding: 10px;
  border: 1px solid #e5edf6;
  border-radius: 13px;
  box-shadow: 0 3px 10px #243e6510;
  background: white;
  font-size: 15px;
  line-height: 1.35;
  font-weight: 700;
}
.tile:active, .option:active, .choice:active, .result:active { background: #edf5ff; }
.icon {
  display: block;
  flex: 0 0 33px;
  width: 33px;
  height: 33px;
  border-radius: 6px;
  background-image: url("./service-icons.png");
  background-size: 66px 165px;
}
.nav {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  min-height: calc(55px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 11px 0;
  border-bottom: 1px solid var(--line);
  background: #f9fcff;
  text-align: center;
  font-weight: 700;
}
.back, .close { border: 0; background: transparent; min-width: 44px; min-height: 44px; border-radius: 10px; }
.arrow {
  width: 8px; height: 8px; display: inline-block;
  border-right: 1.7px solid currentColor; border-top: 1.7px solid currentColor;
  transform: rotate(45deg);
}
.arrow.down { transform: rotate(135deg); margin-bottom: 3px; }
.arrow.left { transform: rotate(-135deg); }
.page { padding: 27px 18px calc(26px + env(safe-area-inset-bottom)); }
.page h1 { font-size: 29px; line-height: 1.23; letter-spacing: .01em; }
.choice-page {
  min-height: calc(100dvh - 56px - env(safe-area-inset-top));
  display: flex;
  flex-direction: column;
}
.choice-controls {
  display: grid;
  gap: 12px;
  margin: 25px 0 22px;
}
.choice {
  text-align: left;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 12px;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  min-height: 76px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: white;
}
.choice small { display: block; font-size: 13px; color: var(--quiet); margin-bottom: 5px; }
.choice strong { font-size: 17px; line-height: 1.45; }
.search-box {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}
.search-icon {
  position: relative;
  flex: 0 0 13px;
  height: 13px;
  border: 1.7px solid var(--quiet);
  border-radius: 50%;
  margin-right: 3px;
}
.search-icon::after {
  content: "";
  position: absolute;
  top: 9px;
  left: 9px;
  width: 6px;
  height: 1.7px;
  background: var(--quiet);
  transform: rotate(45deg);
  transform-origin: left center;
}
.search-input {
  min-width: 0;
  width: 100%;
  min-height: 46px;
  padding: 0 3px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 16px;
}
.search-input::placeholder { color: var(--quiet); opacity: 1; }
.search-results:empty { display: none; }
.result-group, .picker-group {
  min-width: 0;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}
.result-group + .result-group { margin-top: 11px; }
.group-label {
  margin: 0;
  padding: 10px 0 8px;
  color: #365a85;
  font-size: 14px;
  line-height: 1.4;
}
.result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 12px;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 55px;
  padding: 8px 2px;
  border: 0;
  border-top: 1px solid #e5edf5;
  background: transparent;
  text-align: left;
}
.result strong, .result small { display: block; line-height: 1.45; }
.result small { margin-top: 2px; color: var(--quiet); font-size: 13px; }
.result .arrow { color: var(--quiet); }
.no-results { padding: 12px 0; color: var(--quiet); font-size: 15px; }
.primary {
  display: block; width: 100%; min-height: 50px; padding: 10px 15px;
  margin-top: auto; background: var(--blue); border: 0;
  border-radius: 12px; color: white; font-weight: 700;
}
.primary:disabled { background: #d9e3f0; color: #566982; cursor: default; }
.details { margin-top: 18px; padding: 0 17px; border: 1px solid var(--line); border-radius: 15px; background: white; }
.detail-section { padding: 17px 0; }
.detail-section + .detail-section { border-top: 1px solid #e5edf5; }
.detail-section h2 { color: #224c83; font-size: 16px; line-height: 1.45; margin-bottom: 7px; }
.detail-section p { color: #28384e; font-size: 16px; line-height: 1.72; white-space: pre-wrap; }
.detail-section p + p { margin-top: 6px; }
.detail-section .scenario { display: block; font-size: 13px; color: var(--quiet); margin-top: 9px; }
.detail-section .empty { color: var(--quiet); font-size: 14px; }
dialog {
  position: fixed;
  inset: auto 0 0;
  width: min(100%, 480px);
  max-width: none;
  max-height: 75dvh;
  margin: 0 auto;
  padding: 0 0 env(safe-area-inset-bottom);
  border: 0;
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -6px 42px #142d5140;
  color: inherit;
}
dialog::backdrop { background: #162b4e61; }
.picker-head {
  position: sticky; top: 0; z-index: 1;
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 13px 8px 19px;
  background: white; border-bottom: 1px solid var(--line);
}
.picker-head h2 { font-size: 18px; }
.close { font-size: 25px; color: var(--quiet); }
.picker-options { display: grid; gap: 8px; padding: 10px 15px 16px; }
.option {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 49px; padding: 10px 13px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--paper); text-align: left; line-height: 1.45;
}
.option[aria-pressed="true"] { background: #e9f2ff; border-color: #abcaf0; color: #204f91; font-weight: 700; }
.picker-group .option {
  width: 100%;
  border: 0;
  border-top: 1px solid #e5edf5;
  border-radius: 0;
  padding-inline: 2px;
  background: white;
}
.picker-group .option[aria-pressed="true"] { background: #e9f2ff; }
.check { flex: 0 0 auto; }
.unavailable { padding: 13px; line-height: 1.65; color: var(--quiet); font-size: 15px; }
@media (prefers-reduced-motion: no-preference) {
  #app[data-motion="forward"] { --page-shift: 8px; }
  #app[data-motion="back"] { --page-shift: -8px; }
  #app:is([data-motion="forward"], [data-motion="back"]) > * {
    animation: page-in 180ms ease-out both;
  }
  dialog[open] { animation: picker-in 170ms ease-out both; }
  dialog[open]::backdrop { animation: backdrop-in 170ms ease-out both; }
}
@keyframes page-in {
  from { opacity: .68; transform: translateY(var(--page-shift)); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes picker-in {
  from { opacity: .72; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 359px) {
  .service-grid { gap: 8px; padding-inline: 10px; }
  .tile { gap: 7px; padding: 8px; }
}
