:root {
  color-scheme: dark;
  --ink: #f1f7f4;
  --muted: #8fa39a;
  --panel: rgba(16, 34, 28, 0.88);
  --line: rgba(187, 255, 217, 0.13);
  --accent: #67f5a5;
  --accent-dark: #0b291d;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #07130f;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(35, 119, 79, 0.2), transparent 34rem),
    radial-gradient(circle at 90% 82%, rgba(49, 141, 103, 0.13), transparent 30rem),
    #07130f;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI",
    sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

button {
  font: inherit;
}

button:focus-visible {
  outline: 3px solid rgba(103, 245, 165, 0.55);
  outline-offset: 3px;
}

main {
  width: min(100% - 32px, 760px);
  min-height: 100vh;
  margin: 0 auto;
  padding:
    max(32px, env(safe-area-inset-top))
    0
    max(26px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}

.app-shell,
.install-card {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.app-shell {
  padding: 30px;
  border-radius: 30px;
}

.app-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 15px;
}

.mark {
  width: 54px;
  height: 54px;
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 17px;
  color: var(--accent);
  background: var(--accent-dark);
  box-shadow: inset 0 0 0 1px rgba(103, 245, 165, 0.17);
}

.mark-ring {
  width: 27px;
  height: 27px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.mark-ring::before,
.mark-ring::after {
  content: "";
  position: absolute;
  background: currentColor;
}

.mark-ring::before {
  width: 2px;
  height: 38px;
  top: 8px;
  left: 26px;
}

.mark-ring::after {
  width: 38px;
  height: 2px;
  left: 8px;
  top: 26px;
}

.mark-dot {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 12px currentColor;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.65rem, 5vw, 2.25rem);
  letter-spacing: -0.045em;
  line-height: 1;
}

.connection {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 650;
}

.connection span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(103, 245, 165, 0.7);
}

.connection.offline span {
  background: #ffbf66;
  box-shadow: 0 0 10px rgba(255, 191, 102, 0.55);
}

.status-line {
  min-height: 21px;
  margin: 26px 2px 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 0.82rem;
}

.pulse {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border: 1px solid var(--muted);
  border-radius: 50%;
}

.pulse.active {
  border-color: var(--accent);
  background: var(--accent);
  animation: pulse 1.1s ease-in-out infinite;
}

.coordinate-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.coordinate-card {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(5, 17, 13, 0.72);
}

.coordinate-label {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.71rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.axis {
  color: rgba(143, 163, 154, 0.55);
}

.coordinate-value {
  margin: 16px 0 17px;
  overflow: hidden;
  color: var(--ink);
  font-family: "SF Mono", "Roboto Mono", ui-monospace, monospace;
  font-size: clamp(1.65rem, 5.4vw, 2.6rem);
  font-variant-numeric: tabular-nums;
  font-weight: 560;
  letter-spacing: -0.07em;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.coordinate-value span {
  margin-left: 3px;
  color: var(--accent);
  font-family: inherit;
  font-size: 0.54em;
  vertical-align: top;
}

.copy-button {
  min-height: 34px;
  padding: 0;
  border: 0;
  color: var(--accent);
  background: transparent;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}

.copy-button:disabled {
  color: rgba(143, 163, 154, 0.35);
  cursor: default;
}

.details {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.details div {
  padding: 13px 17px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.details div + div {
  border-left: 1px solid var(--line);
}

.details span {
  color: var(--muted);
  font-size: 0.76rem;
}

.details strong {
  font-size: 0.78rem;
}

.actions {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.primary-button,
.secondary-button {
  min-height: 54px;
  border-radius: 16px;
  font-weight: 750;
  cursor: pointer;
  transition:
    transform 160ms ease,
    opacity 160ms ease;
}

.primary-button:active,
.secondary-button:active {
  transform: scale(0.985);
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: default;
  opacity: 0.42;
}

.primary-button {
  border: 0;
  color: #07130f;
  background: var(--accent);
}

.target-icon {
  width: 14px;
  height: 14px;
  margin-right: 9px;
  display: inline-block;
  border: 2px solid currentColor;
  border-radius: 50%;
  vertical-align: -2px;
  box-shadow: inset 0 0 0 3px var(--accent);
  background: currentColor;
}

.secondary-button {
  padding: 0 22px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.035);
}

.privacy-note {
  margin: 17px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.45;
  text-align: center;
}

.privacy-note span {
  margin-right: 7px;
  color: var(--accent);
  font-size: 0.55rem;
  vertical-align: 2px;
}

.install-card {
  padding: 22px 24px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 18px;
  border-radius: 22px;
}

.install-number {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(103, 245, 165, 0.25);
  border-radius: 12px;
  color: var(--accent);
  background: rgba(103, 245, 165, 0.06);
  font-size: 1.4rem;
  font-weight: 350;
}

.install-card h2 {
  margin-bottom: 7px;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.install-card p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.55;
}

.install-card strong {
  color: var(--ink);
  font-weight: 650;
}

footer {
  color: rgba(143, 163, 154, 0.58);
  font-size: 0.72rem;
  text-align: center;
}

footer p {
  margin: 0;
}

@keyframes pulse {
  50% {
    opacity: 0.28;
    transform: scale(1.45);
  }
}

@media (max-width: 570px) {
  main {
    width: min(100% - 20px, 760px);
    padding-top: max(14px, env(safe-area-inset-top));
    justify-content: flex-start;
  }

  .app-shell {
    padding: 20px;
    border-radius: 24px;
  }

  .app-header {
    grid-template-columns: auto 1fr;
  }

  .connection {
    display: none;
  }

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

  .coordinate-card {
    padding: 18px;
  }

  .coordinate-value {
    font-size: clamp(2rem, 10vw, 3rem);
  }
}

@media (max-width: 360px) {
  .mark {
    width: 48px;
    height: 48px;
  }

  .mark-ring::before {
    left: 23px;
  }

  .mark-ring::after {
    top: 23px;
    left: 5px;
  }

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

  .secondary-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
