:root {
  --ink: #171717;
  --muted: #62666f;
  --line: #d9dde5;
  --panel: #ffffff;
  --map-bg: #dfe6df;
  --brand: #f15a24;
  --brand-dark: #bf3416;
  --positive: #127a46;
  --negative: #b52828;
  --focus: #005fcc;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  background: #f4f6f8;
}

.app-shell {
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  overflow: hidden;
}

.map-area {
  min-width: 0;
  height: 100vh;
  min-height: 100vh;
  position: relative;
  background: var(--map-bg);
  overflow: hidden;
}

#map {
  width: 100%;
  height: 100vh;
  min-height: 100vh;
}

.locate-button {
  position: absolute;
  z-index: 600;
  right: 18px;
  top: 18px;
  min-width: 126px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.14);
}

.locate-icon {
  position: relative;
  width: 16px;
  height: 16px;
  border: 2px solid var(--focus);
  border-radius: 50%;
}

.locate-icon::before,
.locate-icon::after {
  content: "";
  position: absolute;
  background: var(--focus);
}

.locate-icon::before {
  left: 50%;
  top: -5px;
  width: 2px;
  height: 24px;
  transform: translateX(-50%);
}

.locate-icon::after {
  left: -5px;
  top: 50%;
  width: 24px;
  height: 2px;
  transform: translateY(-50%);
}

.startup-overlay {
  position: absolute;
  inset: 0;
  z-index: 900;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(244, 246, 248, 0.72);
  backdrop-filter: blur(3px);
}

.startup-dialog {
  width: min(360px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.16);
  text-align: center;
}

.loading-ring {
  width: 42px;
  height: 42px;
  margin: 0 auto 14px;
  border: 4px solid #eceff3;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.startup-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 700;
}

.startup-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.startup-action,
.startup-link {
  width: 100%;
  min-height: 44px;
  margin-top: 14px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
}

.startup-action {
  border: 0;
  background: var(--brand);
  color: #fff;
}

.startup-link {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.hidden {
  display: none !important;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.status-panel {
  width: 380px;
  height: 100vh;
  min-height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px;
  border-left: 1px solid var(--line);
  background: var(--panel);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: block;
  object-fit: cover;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.status-box,
.address-box,
.coordinate-box,
.package-panel,
.hint-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.status-box.covered {
  border-color: rgba(18, 122, 70, 0.45);
  background: #f1fbf6;
}

.status-box.not-covered {
  border-color: rgba(181, 40, 40, 0.45);
  background: #fff5f4;
}

.status-label {
  margin: 0 0 6px;
  font-size: 19px;
  font-weight: 700;
}

.status-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.address-box label,
.coordinate-box span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  gap: 8px;
}

input {
  min-width: 0;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 11px;
  font: inherit;
}

button,
a {
  font: inherit;
}

.input-row button {
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
}

.coordinate-box strong {
  display: block;
  font-size: 14px;
  line-height: 1.4;
  word-break: break-word;
}

.package-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.package-heading span {
  color: var(--muted);
  font-size: 13px;
}

.package-heading strong {
  font-size: 13px;
}

.package-options {
  display: grid;
  gap: 8px;
}

.package-card {
  position: relative;
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  grid-template-areas:
    "speed name"
    "speed price";
  column-gap: 10px;
  min-height: 68px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px 10px 10px;
  cursor: pointer;
  background: #fff;
}

.package-card:has(input:checked) {
  border-color: #feb71f;
  background: #fff8df;
  box-shadow: inset 0 0 0 1px #feb71f;
}

.package-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.package-speed {
  grid-area: speed;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #feb71f;
  color: #1d1d1d;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.05;
  text-align: center;
  white-space: normal;
}

.package-name {
  grid-area: name;
  align-self: end;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.package-price {
  grid-area: price;
  align-self: start;
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.25;
}

.package-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.action-grid {
  display: grid;
  gap: 10px;
}

.primary-action,
.secondary-action {
  min-height: 46px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 11px 14px;
  color: #fff;
  text-decoration: none;
  text-align: center;
  font-weight: 700;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}

.primary-action {
  background: var(--brand);
}

.primary-action:hover {
  background: var(--brand-dark);
}

.primary-action:hover,
.primary-action:focus-visible,
.secondary-action:hover,
.secondary-action:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.18);
}

.primary-action:active,
.secondary-action:active {
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.14);
}

.secondary-action {
  background: #2d3748;
}

.alternative-action {
  background: #1d4f91;
}

.alternative-action:hover,
.alternative-action:focus-visible {
  background: #153f77;
}

.survey-action {
  background: #feb71f;
  color: #1d1d1d;
}

.survey-action:hover,
.survey-action:focus-visible {
  background: #f0a900;
}

.disabled {
  pointer-events: none;
  opacity: 0.42;
}

.hint-list {
  margin-top: auto;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.hint-list p {
  margin: 0;
}

.hint-list p + p {
  margin-top: 8px;
}

.site-footer {
  margin-top: -8px;
  color: #818691;
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
}

.site-footer span {
  display: block;
}

.location-pin {
  width: 30px !important;
  height: 42px !important;
  background: transparent;
}

.location-pin-dot {
  position: absolute;
  left: 50%;
  top: 1px;
  width: 28px;
  height: 28px;
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 0;
  background: var(--brand);
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.28);
  transform: translateX(-50%) rotate(-45deg);
}

.location-pin-dot::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
}

.location-pin::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 16px;
  height: 6px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.22);
  transform: translateX(-50%);
}

@media (max-width: 840px) {
  html,
  body {
    overflow: auto;
  }

  .app-shell {
    width: 100%;
    height: auto;
    grid-template-columns: 1fr;
    grid-template-rows: 42vh auto;
    overflow: visible;
  }

  .map-area,
  #map {
    min-height: 42vh;
    height: 42vh;
  }

  .status-panel {
    width: 100%;
    height: auto;
    min-height: auto;
    overflow: visible;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 18px;
  }

  .package-panel {
    padding: 12px;
  }

  .package-heading {
    margin-bottom: 8px;
  }

  .package-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .package-card {
    min-height: 96px;
    grid-template-columns: 1fr;
    grid-template-areas:
      "speed"
      "name"
      "price";
    row-gap: 5px;
    padding: 9px;
  }

  .package-speed {
    min-height: 34px;
    font-size: 18px;
  }

  .package-name {
    align-self: start;
    min-height: 30px;
    font-size: 12px;
    line-height: 1.2;
  }

  .package-price {
    font-size: 16px;
  }

  .package-note {
    font-size: 11px;
  }
}
