:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #242726;
  background: #e6eaeb;
  --green: #66b936;
  --deep-green: #08a447;
  --blue: #32608a;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  padding: max(76px, env(safe-area-inset-top)) 16px max(76px, env(safe-area-inset-bottom));
}

.detection-card {
  position: relative;
  width: min(420px, 100%);
  padding: 102px 60px 37px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 5px 14px rgb(32 45 41 / 16%);
  text-align: center;
}

.site-mark {
  position: absolute;
  top: 0;
  left: 50%;
  display: block;
  width: 124px;
  height: 124px;
  transform: translate(-50%, -50%);
}

h1 {
  margin: 0 0 34px;
  font-size: 21px;
  font-weight: 600;
  line-height: 1.4;
}

.routes {
  margin: 0;
  padding: 0 4px 0 10px;
  list-style: none;
  text-align: left;
}

.route {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) 34px;
  align-items: center;
  gap: 5px;
  min-height: 56px;
  color: var(--blue);
}

.route-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #5a6b73;
  font-size: 15px;
  white-space: nowrap;
}

.route[data-ready] .route-state {
  position: relative;
  color: inherit;
  font-size: 21px;
  font-weight: 500;
}

.route[data-ready] .route-state::before {
  content: "";
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  border-radius: 4px;
  background: var(--green);
}

.route[data-ready] .route-state::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 50%;
  width: 9px;
  height: 5px;
  border: solid #fff;
  border-width: 0 0 2px 2px;
  transform: translateY(-70%) rotate(-45deg);
}

.route-name {
  font-size: 21px;
  font-weight: 500;
  white-space: nowrap;
}

button, .service {
  color: inherit;
  font: inherit;
  cursor: pointer;
}

button:disabled {
  opacity: .55;
  cursor: default;
}

.copy-route {
  display: grid;
  place-items: center;
  width: 34px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
}

.copy-route:hover:not(:disabled) { background: #edf4fa; }

.copy-icon {
  width: 15px;
  height: 16px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
  background:
    linear-gradient(currentColor, currentColor) center 3px / 8px 1px no-repeat,
    linear-gradient(currentColor, currentColor) center 6px / 8px 1px no-repeat,
    linear-gradient(currentColor, currentColor) center 9px / 8px 1px no-repeat;
}

.actions {
  display: grid;
  gap: 20px;
  margin-top: 34px;
}

.action {
  display: grid;
  place-items: center;
  min-height: 55px;
  padding: 8px 12px;
  border: 0;
  border-radius: 6px;
  background: var(--green);
  color: #fff;
  font-size: 22px;
  font-weight: 400;
  text-decoration: none;
}

.service { background: var(--deep-green); }
.action:hover:not(:disabled) { filter: brightness(.92); }
:where(button, a, input):focus-visible { outline: 2px solid #276d96; outline-offset: 3px; }

.card-footer { margin-top: 22px; }

.site-wordmark {
  display: block;
  width: 150px;
  height: auto;
  margin-inline: auto;
}

dialog {
  width: min(352px, calc(100% - 32px));
  padding: 28px 16px 24px;
  border: 0;
  border-radius: 28px;
  color: #e3e3e3;
  background: rgb(39 39 39 / 80%);
  backdrop-filter: blur(18px);
  box-shadow: 0 15px 32px rgb(0 0 0 / 21%);
}

dialog::backdrop { background: rgb(0 0 0 / 41%); }

dialog p {
  margin: 0 12px 24px;
  font-size: 16px;
  line-height: 1.6;
}

dialog .action {
  width: 100%;
  min-height: 48px;
  border-radius: 999px;
  background: rgb(255 255 255 / 16%);
  font-size: 16px;
}

dialog .action:hover { background: rgb(255 255 255 / 23%); }
dialog .action:focus-visible { outline-color: #e3e3e3; }

.manual-copy {
  width: 100%;
  margin: 0 0 16px;
  padding: 8px 10px;
  border: 1px solid rgb(255 255 255 / 34%);
  border-radius: 8px;
  background: rgb(0 0 0 / 19%);
  color: #fff;
  font: inherit;
}

@media (min-width: 461px) and (max-width: 650px) {
  body { padding-block: max(102px, env(safe-area-inset-top)) max(48px, env(safe-area-inset-bottom)); }
}

@media (max-width: 460px) {
  body { padding-block: max(65px, env(safe-area-inset-top)) max(26px, env(safe-area-inset-bottom)); }
  .detection-card { padding: 84px clamp(16px, 5vw, 36px) 30px; }
  .site-mark { width: 104px; height: 104px; }
  h1 { margin-bottom: 26px; font-size: clamp(17px, 4.8vw, 21px); }
  .routes { padding: 0; }
  .route { grid-template-columns: max-content minmax(0, 1fr) 30px; min-height: 52px; }
  .route-name, .route[data-ready] .route-state { font-size: clamp(15px, 4.5vw, 20px); }
  .copy-route { width: 30px; }
  .actions { margin-top: 27px; gap: 14px; }
  .action { min-height: 50px; font-size: 20px; }
}

.service[aria-disabled="true"] { opacity: .55; cursor: default; }
