/* ==========================================================================
   WLOC 坐标实验室
   A dark control deck + a paper-like map. No framework, no build step.
   ========================================================================== */

:root {
  --ink: #0b100e;
  --ink-soft: #0e1411;
  --panel: #101713;
  --panel-raised: #151e19;
  --panel-higher: #1a251f;
  --line: #2a362f;
  --line-soft: #1d2822;
  --paper: #f2f4ec;
  --paper-dim: #d9dfd5;
  --muted: #9ba89e;
  --muted-deep: #718076;
  --acid: #c7f46b;
  --acid-bright: #ddff8b;
  --acid-ink: #11180d;
  --warm: #ffba7a;
  --danger: #ff8378;
  --danger-soft: rgba(255, 131, 120, 0.12);
  --map-paper: #e4e8df;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  --font-mono: "SFMono-Regular", "SF Mono", "Roboto Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
  --shadow-panel: 30px 0 80px rgba(0, 0, 0, 0.28);
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--ink);
}

body {
  color: var(--paper);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
  border: 0;
  cursor: pointer;
}

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

a {
  color: var(--acid);
}

code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  padding: 0.12em 0.34em;
  border-radius: 4px;
  color: var(--paper);
  background: rgba(255, 255, 255, 0.07);
  overflow-wrap: anywhere;
}

svg {
  width: 20px;
  height: 20px;
  display: block;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   App layout
   -------------------------------------------------------------------------- */

.app-shell {
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-columns: minmax(390px, 438px) minmax(0, 1fr);
  background:
    radial-gradient(ellipse at 30% -20%, rgba(199, 244, 107, 0.08), transparent 44%),
    var(--ink);
  overflow: hidden;
}

.control-panel {
  position: relative;
  z-index: 20;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 20%),
    var(--panel);
  border-right: 1px solid var(--line);
  box-shadow: var(--shadow-panel);
}

.control-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.22;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, black, transparent 34%);
  -webkit-mask-image: linear-gradient(to bottom, black, transparent 34%);
}

.brand-bar {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  height: 74px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line-soft);
}

.brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--paper);
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--acid-ink);
  background: var(--acid);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15), 0 6px 18px rgba(199, 244, 107, 0.13);
}

.brand-mark svg {
  width: 23px;
  height: 23px;
}

.brand-type {
  display: grid;
  line-height: 1.1;
}

.brand-type strong {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.2em;
  font-weight: 700;
}

.brand-type small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.16em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 11px;
  color: var(--muted);
  background: transparent;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.icon-button svg {
  width: 19px;
  height: 19px;
}

.icon-button:hover {
  color: var(--paper);
  background: var(--panel-raised);
  border-color: var(--line-soft);
}

.panel-scroll {
  position: relative;
  z-index: 1;
  min-height: 0;
  flex: 1 1 auto;
  padding: 28px 28px 22px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #334139 transparent;
}

.panel-scroll::-webkit-scrollbar {
  width: 8px;
}

.panel-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.panel-scroll::-webkit-scrollbar-thumb {
  background: #2b3931;
  border: 2px solid var(--panel);
  border-radius: 999px;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  padding-top: 2px;
}

.eyebrow-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.eyebrow,
.modal-kicker,
.result-kicker,
.note-label {
  color: var(--acid);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.version-pill,
.mini-badge,
.experimental-badge {
  display: inline-flex;
  align-items: center;
  height: 21px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted-deep);
  background: rgba(255, 255, 255, 0.025);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.hero h1 {
  margin: 0;
  max-width: 360px;
  color: var(--paper);
  font-size: clamp(32px, 3.5vw, 42px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.06em;
}

.hero h1 span {
  color: var(--acid);
  font-weight: 600;
}

.hero-copy {
  max-width: 340px;
  margin: 17px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.8;
}

.connection-pill {
  width: fit-content;
  max-width: 100%;
  margin-top: 18px;
  padding: 6px 11px 6px 9px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.015em;
}

.status-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: var(--muted-deep);
}

.connection-pill[data-state="connected"] {
  color: var(--paper);
  border-color: rgba(199, 244, 107, 0.22);
  background: rgba(199, 244, 107, 0.06);
}

.connection-pill[data-state="connected"] .status-dot {
  background: var(--acid);
  box-shadow: 0 0 0 3px rgba(199, 244, 107, 0.1);
}

.connection-pill[data-state="connecting"] .status-dot {
  background: var(--warm);
  animation: pulse-dot 1.2s ease infinite;
}

.connection-pill[data-state="error"] {
  color: #ffc1ba;
  border-color: rgba(255, 131, 120, 0.22);
  background: rgba(255, 131, 120, 0.07);
}

.connection-pill[data-state="error"] .status-dot {
  background: var(--danger);
}

/* --------------------------------------------------------------------------
   Coordinate card + search
   -------------------------------------------------------------------------- */

.coordinate-card {
  position: relative;
  margin-top: 24px;
  padding: 17px 17px 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.035), transparent 52%),
    #141c17;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.coordinate-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 17px;
  width: 46px;
  height: 1px;
  background: var(--acid);
  opacity: 0.8;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted-deep);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.coordinate-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  margin-top: 11px;
}

.coordinate-readout {
  min-width: 0;
  display: block;
  margin: 0;
  padding: 7px 10px 7px 0;
  border: 0;
  border-radius: 8px;
  color: var(--paper);
  background: transparent;
  text-align: left;
  cursor: copy;
  transition: color 140ms ease, background 140ms ease;
}

.coordinate-readout + .coordinate-readout {
  padding-left: 17px;
  border-left: 1px solid var(--line);
  border-radius: 0 8px 8px 0;
}

.coordinate-readout:hover {
  color: var(--acid-bright);
}

.coordinate-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted-deep);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.14em;
}

.coordinate-readout strong {
  display: block;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: clamp(20px, 2.45vw, 25px);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.06em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.coordinate-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
  padding-top: 11px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted-deep);
  font-size: 10.5px;
}

.coordinate-foot-copy {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.coordinate-foot-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-shrink: 0;
}

.coordinate-foot-actions .inline-link {
  margin-left: 0;
}

.pulse-dot {
  width: 5px;
  height: 5px;
  flex: 0 0 5px;
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 0 3px rgba(199, 244, 107, 0.08);
  animation: pulse-dot 2.4s ease infinite;
}

.inline-link {
  margin-left: auto;
  padding: 0;
  color: var(--muted);
  background: none;
  font-size: 10.5px;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  white-space: nowrap;
  transition: color 160ms ease, text-decoration-color 160ms ease;
}

.inline-link:hover {
  color: var(--acid);
  text-decoration-color: currentColor;
}

.search-form {
  position: relative;
  margin-top: 14px;
  height: 50px;
}

.search-icon {
  position: absolute;
  top: 50%;
  left: 16px;
  z-index: 1;
  width: 17px;
  height: 17px;
  color: var(--muted-deep);
  transform: translateY(-50%);
  pointer-events: none;
}

.search-form input {
  width: 100%;
  height: 100%;
  padding: 0 57px 0 43px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--paper);
  background: #151d18;
  font-size: 12.5px;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.search-form input::placeholder {
  color: #6f7f74;
}

.search-form input::-webkit-search-cancel-button {
  filter: invert(1) grayscale(1);
  opacity: 0.5;
}

.search-form input:focus {
  outline: none;
  border-color: rgba(199, 244, 107, 0.48);
  background: #18211b;
  box-shadow: 0 0 0 3px rgba(199, 244, 107, 0.06);
}

.search-submit {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 10px;
  color: var(--acid-ink);
  background: var(--paper);
  transition: background 160ms ease, transform 160ms ease;
}

.search-submit svg {
  width: 16px;
  height: 16px;
}

.search-submit:hover {
  background: var(--acid);
  transform: translateX(1px);
}

.search-submit:disabled {
  opacity: 0.45;
  cursor: wait;
  transform: none;
}

.search-status {
  margin: 9px 2px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.search-status.is-error {
  color: #ffb4ac;
}

.search-results {
  margin-top: 9px;
  max-height: 248px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #121a16;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.24);
}

.search-result {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 13px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  color: var(--paper);
  background: transparent;
  text-align: left;
  transition: background 140ms ease;
}

.search-result:last-child {
  border-bottom: 0;
}

.search-result:hover {
  background: var(--panel-raised);
}

.search-result-mark {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  display: grid;
  place-items: center;
  margin-top: 1px;
  border-radius: 8px;
  color: var(--acid);
  background: rgba(199, 244, 107, 0.08);
}

.search-result-mark svg {
  width: 14px;
  height: 14px;
}

.search-result-copy {
  min-width: 0;
  flex: 1;
}

.search-result-copy strong {
  display: block;
  overflow: hidden;
  color: var(--paper);
  font-size: 12px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-copy small {
  display: -webkit-box;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted-deep);
  font-size: 10px;
  line-height: 1.5;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.search-result-provider {
  flex: 0 0 auto;
  padding-top: 2px;
  color: var(--muted-deep);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   Lock button
   -------------------------------------------------------------------------- */

.lock-button {
  width: 100%;
  min-height: 72px;
  margin-top: 18px;
  padding: 13px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 17px;
  color: var(--acid-ink);
  background: var(--acid);
  box-shadow: 0 10px 25px rgba(199, 244, 107, 0.08);
  text-align: left;
  transition: background 160ms ease, transform 200ms var(--ease-out), box-shadow 200ms ease;
}

.lock-button:hover {
  background: var(--acid-bright);
  box-shadow: 0 15px 36px rgba(199, 244, 107, 0.16);
  transform: translateY(-2px);
}

.lock-button:active {
  transform: translateY(0);
}

.lock-button:disabled {
  cursor: wait;
  opacity: 0.68;
  transform: none;
}

.lock-button-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: rgba(12, 18, 10, 0.09);
}

.lock-button-icon svg {
  width: 20px;
  height: 20px;
}

.lock-button-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.lock-button-copy strong {
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.lock-button-copy small {
  color: rgba(17, 24, 13, 0.58);
  font-size: 10px;
  line-height: 1.4;
}

.lock-button-arrow {
  width: 18px;
  height: 18px;
  margin-left: auto;
  opacity: 0.62;
}

.lock-button.is-loading .lock-button-arrow {
  animation: spin 0.9s linear infinite;
}

.search-submit[aria-busy="true"] svg {
  animation: spin 0.9s linear infinite;
}

.lock-hint {
  margin: 9px 3px 0;
  color: var(--muted-deep);
  font-size: 10px;
  line-height: 1.55;
}

.lock-hint.is-error {
  color: #ffb4ac;
}

/* --------------------------------------------------------------------------
   Results
   -------------------------------------------------------------------------- */

.result-panel {
  position: relative;
  margin-top: 22px;
  padding: 18px;
  border: 1px solid rgba(199, 244, 107, 0.22);
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(199, 244, 107, 0.035), transparent 44%),
    #111912;
  box-shadow: inset 0 1px 0 rgba(199, 244, 107, 0.06);
  animation: reveal-up 420ms var(--ease-out) both;
}

.result-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.result-heading h2 {
  margin: 7px 0 0;
  color: var(--paper);
  font-size: 22px;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.045em;
}

.success-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border: 1px solid rgba(199, 244, 107, 0.2);
  border-radius: 999px;
  color: var(--acid);
  background: rgba(199, 244, 107, 0.06);
  font-size: 9.5px;
  white-space: nowrap;
}

.success-chip svg {
  width: 12px;
  height: 12px;
}

.result-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 106px;
  gap: 10px;
  margin-top: 15px;
}

.result-meta > div {
  position: relative;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.13);
}

.result-coordinate-cell {
  padding-right: 37px !important;
}

.result-meta span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted-deep);
  font-size: 9.5px;
}

.result-meta strong {
  display: block;
  overflow: hidden;
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-copy-button {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  transition: color 140ms ease, border-color 140ms ease, background 140ms ease;
}

.result-copy-button svg {
  width: 13px;
  height: 13px;
}

.result-copy-button:hover {
  color: var(--acid);
  border-color: rgba(199, 244, 107, 0.25);
  background: rgba(199, 244, 107, 0.06);
}

.module-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 21px;
}

.module-heading h3 {
  margin: 0;
  color: var(--paper);
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.module-heading p {
  margin: 4px 0 0;
  color: var(--muted-deep);
  font-size: 10.5px;
  line-height: 1.5;
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 0;
  color: var(--acid);
  background: none;
  font-size: 10.5px;
  white-space: nowrap;
  transition: color 140ms ease;
}

.text-button svg {
  width: 13px;
  height: 13px;
}

.text-button:hover {
  color: var(--acid-bright);
}

.module-list {
  display: grid;
  gap: 7px;
  margin-top: 11px;
}

.module-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  color: var(--paper);
  background: rgba(255, 255, 255, 0.018);
  text-align: left;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms var(--ease-out);
}

.module-item:hover {
  border-color: #445649;
  background: rgba(255, 255, 255, 0.045);
  transform: translateX(2px);
}

.module-item:active {
  transform: translateX(0);
}

.module-badge {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--acid);
  background: rgba(199, 244, 107, 0.07);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.03em;
}

.module-info {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.module-info strong {
  overflow: hidden;
  color: var(--paper);
  font-size: 11.5px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.module-info small {
  overflow: hidden;
  color: var(--muted-deep);
  font-family: var(--font-mono);
  font-size: 8.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.module-copy {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  color: var(--muted-deep);
  font-size: 9.5px;
  white-space: nowrap;
  transition: color 140ms ease;
}

.module-copy svg {
  width: 13px;
  height: 13px;
}

.module-item:hover .module-copy {
  color: var(--acid);
}

.secret-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 13px;
  padding: 10px;
  border: 1px solid rgba(199, 244, 107, 0.09);
  border-radius: 10px;
  background: rgba(199, 244, 107, 0.025);
  color: var(--muted);
}

.secret-note svg {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  margin-top: 1px;
  color: var(--acid);
}

.secret-note p {
  margin: 0;
  font-size: 9.5px;
  line-height: 1.6;
}

.result-actions {
  display: flex;
  gap: 7px;
  margin-top: 13px;
}

.secondary-button,
.danger-button {
  min-height: 34px;
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  font-size: 10px;
  transition: color 150ms ease, border-color 150ms ease, background 150ms ease;
}

.secondary-button svg,
.danger-button svg {
  width: 13px;
  height: 13px;
}

.secondary-button:hover {
  color: var(--paper);
  border-color: #45574a;
  background: rgba(255, 255, 255, 0.035);
}

.danger-button {
  color: #d59a93;
  border-color: rgba(255, 131, 120, 0.17);
}

.danger-button:hover,
.danger-button.is-armed {
  color: #ffd0ca;
  border-color: rgba(255, 131, 120, 0.5);
  background: var(--danger-soft);
}

/* --------------------------------------------------------------------------
   Guide card + footer
   -------------------------------------------------------------------------- */

.guide-card {
  margin-top: 20px;
  padding: 17px;
  border: 1px dashed #35443a;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.014);
}

.guide-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted-deep);
}

.guide-card-head svg {
  width: 17px;
  height: 17px;
}

.step-index {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.guide-card h3 {
  margin: 10px 0 5px;
  color: var(--paper);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.guide-card p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.65;
}

.panel-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-top: 18px;
  color: #59685f;
  font-size: 9px;
  line-height: 1.5;
}

.api-footnote {
  max-width: 52%;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 8px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Map
   -------------------------------------------------------------------------- */

.map-stage {
  position: relative;
  min-width: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--map-paper);
  isolation: isolate;
}

#map {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--map-paper);
}

#map::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 450;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(11, 16, 14, 0.08), inset 0 0 120px rgba(11, 16, 14, 0.08);
}

.leaflet-container {
  font-family: var(--font-sans);
  background: var(--map-paper);
}

.leaflet-tile-pane {
  filter: grayscale(0.2) saturate(0.72) contrast(1.02);
}

.leaflet-control-zoom {
  margin-right: 20px !important;
  margin-bottom: 22px !important;
  overflow: hidden;
  border: 1px solid rgba(16, 23, 19, 0.16) !important;
  border-radius: 11px !important;
  box-shadow: 0 8px 20px rgba(16, 23, 19, 0.12) !important;
}

.leaflet-control-zoom a {
  width: 34px !important;
  height: 34px !important;
  line-height: 34px !important;
  color: #263129 !important;
  background: rgba(247, 248, 242, 0.94) !important;
  border-bottom-color: rgba(16, 23, 19, 0.1) !important;
  font-family: var(--font-mono) !important;
  font-size: 17px !important;
}

.leaflet-control-zoom a:hover {
  color: var(--ink) !important;
  background: var(--acid) !important;
}

.leaflet-control-attribution {
  padding: 3px 7px !important;
  color: #647168 !important;
  background: rgba(242, 244, 236, 0.82) !important;
  font-size: 9px !important;
  backdrop-filter: blur(8px);
}

.leaflet-control-attribution a {
  color: #405045 !important;
}

.leaflet-control-scale-line {
  border-color: rgba(13, 18, 16, 0.65) !important;
  color: #2e3a31 !important;
  background: rgba(242, 244, 236, 0.72) !important;
  font-family: var(--font-mono) !important;
  font-size: 8px !important;
  border-top: 0 !important;
}

.map-status,
.map-crs,
.map-default-button,
.map-drag-hint {
  position: absolute;
  z-index: 600;
  color: var(--paper);
  background: rgba(13, 19, 15, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.13);
  box-shadow: 0 10px 30px rgba(7, 11, 9, 0.18);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.map-status {
  top: 22px;
  left: 22px;
  max-width: calc(100% - 44px);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.02em;
}

.map-status-dot {
  width: 5px;
  height: 5px;
  flex: 0 0 5px;
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 0 3px rgba(199, 244, 107, 0.1);
}

.map-status > span:nth-child(2) {
  color: var(--muted);
}

.map-status strong {
  color: var(--paper);
  font-weight: 500;
}

.geo-pill {
  position: absolute;
  top: calc(66px + env(safe-area-inset-top));
  left: 22px;
  z-index: 600;
  max-width: calc(100% - 44px);
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: #c9d3ca;
  background: rgba(13, 19, 15, 0.82);
  box-shadow: 0 8px 24px rgba(7, 11, 9, 0.14);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.35;
}

.geo-pill-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 0 3px rgba(199, 244, 107, 0.1);
}

.geo-pill.is-loading .geo-pill-dot {
  background: var(--warm);
  animation: pulse-dot 1.1s ease infinite;
}

.geo-pill.is-error {
  color: #ffc1ba;
  border-color: rgba(255, 131, 120, 0.24);
  background: rgba(40, 20, 18, 0.82);
}

.geo-pill.is-error .geo-pill-dot {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(255, 131, 120, 0.1);
}

.geo-pill-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.geo-pill-action {
  flex: 0 0 auto;
  padding: 1px 0 1px 8px;
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--acid);
  background: transparent;
  font-size: 9px;
  white-space: nowrap;
}

.geo-pill-action:hover {
  color: var(--acid-bright);
}

.geo-pill-action[hidden] {
  display: none !important;
}

.map-crs {
  top: 22px;
  right: 22px;
  padding: 9px 11px;
  border-radius: 999px;
  color: #c0c9c1;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.08em;
}

.map-drag-hint {
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border-radius: 999px;
  color: #c7cfc8;
  font-size: 9.5px;
  white-space: nowrap;
  pointer-events: none;
}

.drag-line {
  width: 16px;
  height: 1px;
  background: var(--acid);
  opacity: 0.75;
}

.map-default-button {
  bottom: 24px;
  left: 22px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border-radius: 999px;
  color: #c7cfc8;
  font-size: 9.5px;
  transition: color 150ms ease, border-color 150ms ease, background 150ms ease;
}

.map-default-button svg {
  width: 13px;
  height: 13px;
  color: var(--acid);
}

.map-default-button:hover {
  color: var(--paper);
  border-color: rgba(199, 244, 107, 0.4);
  background: rgba(23, 34, 26, 0.94);
}

.map-lock-fab {
  display: none;
}

/* Crosshair sits exactly over the map center. */
.crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 550;
  width: 66px;
  height: 66px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(8, 12, 9, 0.24));
}

.crosshair-ring {
  position: absolute;
  inset: 9px;
  border: 1px solid rgba(13, 18, 16, 0.68);
  border-radius: 50%;
  background: rgba(247, 249, 242, 0.28);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35), inset 0 0 12px rgba(255, 255, 255, 0.22);
  transition: border-color 240ms ease, box-shadow 240ms ease;
}

.crosshair-h,
.crosshair-v {
  position: absolute;
  background: linear-gradient(90deg, transparent, rgba(13, 18, 16, 0.8));
}

.crosshair-h {
  top: 50%;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent 0 20%, rgba(13, 18, 16, 0.7) 20% 80%, transparent 80%);
}

.crosshair-v {
  top: 0;
  left: 50%;
  width: 1px;
  height: 100%;
  background: linear-gradient(180deg, transparent 0 20%, rgba(13, 18, 16, 0.7) 20% 80%, transparent 80%);
}

.crosshair-core {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 7px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  background: var(--acid-ink);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 2px rgba(199, 244, 107, 0.22);
}

.map-stage.is-locked .crosshair-ring {
  border-color: rgba(199, 244, 107, 0.9);
  box-shadow: 0 0 0 1px rgba(199, 244, 107, 0.25), 0 0 0 9px rgba(199, 244, 107, 0.06),
    inset 0 0 14px rgba(199, 244, 107, 0.13);
}

.map-stage.is-locked .crosshair-core {
  background: var(--acid);
  border-color: var(--acid-ink);
}

.map-error {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 700;
  width: min(360px, calc(100% - 40px));
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  color: var(--paper);
  background: rgba(13, 19, 15, 0.92);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22);
  transform: translate(-50%, -50%);
  text-align: center;
}

.map-error strong {
  font-size: 14px;
}

.map-error p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

/* --------------------------------------------------------------------------
   Dialogs
   -------------------------------------------------------------------------- */

.modal {
  width: min(520px, calc(100vw - 32px));
  max-width: none;
  max-height: min(90dvh, 900px);
  margin: auto;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: var(--radius-xl);
  color: var(--paper);
  background: transparent;
}

.modal-wide {
  width: min(780px, calc(100vw - 32px));
}

.modal::backdrop {
  background: rgba(4, 8, 6, 0.76);
  backdrop-filter: blur(14px) saturate(0.8);
  -webkit-backdrop-filter: blur(14px) saturate(0.8);
}

.modal[open] {
  animation: modal-in 240ms var(--ease-out) both;
}

.modal-surface {
  position: relative;
  max-height: min(90dvh, 900px);
  padding: 30px;
  overflow-y: auto;
  border: 1px solid #324138;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(ellipse at 100% 0%, rgba(199, 244, 107, 0.08), transparent 34%),
    linear-gradient(180deg, #17211b, #101713);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.modal-wide .modal-surface {
  padding: 32px;
}

.modal-close {
  position: absolute;
  top: 17px;
  right: 17px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  transition: color 150ms ease, background 150ms ease;
}

.modal-close svg {
  width: 15px;
  height: 15px;
}

.modal-close:hover {
  color: var(--paper);
  background: var(--panel-higher);
}

.modal-symbol {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 21px;
  border: 1px solid rgba(199, 244, 107, 0.25);
  border-radius: 14px;
  color: var(--acid);
  background: rgba(199, 244, 107, 0.06);
}

.modal-symbol svg {
  width: 25px;
  height: 25px;
}

.modal-kicker {
  display: block;
  margin-bottom: 8px;
}

.modal h2 {
  margin: 0;
  color: var(--paper);
  font-size: 29px;
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.055em;
}

.modal-description {
  max-width: 570px;
  margin: 11px 0 22px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.75;
}

.field {
  margin-top: 16px;
}

.field label {
  display: block;
  margin-bottom: 7px;
  color: var(--paper-dim);
  font-size: 11.5px;
  font-weight: 500;
}

.field input {
  width: 100%;
  height: 46px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--paper);
  background: #0e1511;
  font-family: var(--font-mono);
  font-size: 12px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.field input::placeholder {
  color: #697a6e;
  font-family: var(--font-sans);
}

.field input:focus {
  outline: none;
  border-color: rgba(199, 244, 107, 0.5);
  box-shadow: 0 0 0 3px rgba(199, 244, 107, 0.07);
}

.field small {
  display: block;
  margin-top: 7px;
  color: var(--muted-deep);
  font-size: 10px;
  line-height: 1.6;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 57px;
}

.password-field button {
  position: absolute;
  top: 50%;
  right: 12px;
  padding: 3px;
  color: var(--muted);
  background: none;
  font-size: 10px;
  transform: translateY(-50%);
}

.password-field button:hover {
  color: var(--acid);
}

.form-error {
  margin: 12px 0 0;
  padding: 9px 10px;
  border: 1px solid rgba(255, 131, 120, 0.22);
  border-radius: 9px;
  color: #ffc1ba;
  background: var(--danger-soft);
  font-size: 10.5px;
  line-height: 1.6;
}

.primary-button {
  width: 100%;
  height: 47px;
  margin-top: 19px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 11px;
  color: var(--acid-ink);
  background: var(--acid);
  font-size: 12.5px;
  font-weight: 650;
  transition: background 150ms ease, transform 180ms var(--ease-out);
}

.primary-button svg {
  width: 16px;
  height: 16px;
}

.primary-button:hover {
  background: var(--acid-bright);
  transform: translateY(-1px);
}

.primary-button:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}

.text-danger {
  display: block;
  margin: 15px auto 0;
  padding: 4px;
  color: #c8918b;
  background: none;
  font-size: 10.5px;
}

.text-danger:hover {
  color: var(--danger);
}

.modal-footnote {
  margin: 19px 0 0;
  padding-top: 15px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted-deep);
  font-size: 9.5px;
  line-height: 1.65;
}

/* --------------------------------------------------------------------------
   Guide dialog
   -------------------------------------------------------------------------- */

#guide-dialog .modal-description {
  margin-bottom: 17px;
}

.tab-list {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.12);
}

.tab-button {
  flex: 1;
  min-height: 36px;
  padding: 6px 10px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  transition: color 150ms ease, background 150ms ease;
}

.tab-button:hover {
  color: var(--paper);
}

.tab-button.is-active {
  color: var(--acid-ink);
  background: var(--acid);
  font-weight: 600;
}

.help-panel {
  padding-top: 19px;
  animation: fade-in 220ms ease both;
}

.setup-steps {
  display: grid;
  gap: 13px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.setup-steps > li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.018);
}

.setup-step-number {
  flex: 0 0 24px;
  color: var(--acid);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.8;
}

.setup-steps strong {
  display: block;
  color: var(--paper);
  font-size: 12px;
  font-weight: 600;
}

.setup-steps p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.7;
}

.callout {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 16px;
  padding: 13px;
  border: 1px solid rgba(199, 244, 107, 0.16);
  border-radius: 11px;
  background: rgba(199, 244, 107, 0.04);
}

.callout svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  margin-top: 1px;
  color: var(--acid);
}

.callout p {
  margin: 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.7;
}

.callout-warm {
  border-color: rgba(255, 186, 122, 0.15);
  background: rgba(255, 186, 122, 0.04);
}

.callout-warm svg {
  color: var(--warm);
}

.client-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 1px;
  overflow-x: auto;
  scrollbar-width: none;
}

.client-tabs::-webkit-scrollbar {
  display: none;
}

.client-tab {
  flex: 0 0 auto;
  min-height: 31px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 10px;
  transition: color 140ms ease, border-color 140ms ease, background 140ms ease;
}

.client-tab:hover {
  color: var(--paper);
  border-color: #46594a;
}

.client-tab.is-active {
  color: var(--paper);
  border-color: rgba(199, 244, 107, 0.35);
  background: rgba(199, 244, 107, 0.08);
}

.client-guide {
  margin-top: 15px;
  animation: fade-in 180ms ease both;
}

.client-guide h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 9px;
  color: var(--paper);
  font-size: 14px;
  font-weight: 600;
}

.experimental-badge {
  height: 18px;
  color: var(--warm);
  border-color: rgba(255, 186, 122, 0.24);
  background: rgba(255, 186, 122, 0.06);
  font-size: 8px;
}

.client-guide ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 19px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.75;
}

.client-guide li::marker {
  color: var(--acid);
  font-family: var(--font-mono);
  font-size: 9px;
}

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

.notes-grid article {
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.018);
}

.note-label {
  font-size: 8px;
}

.notes-grid h3 {
  margin: 7px 0 5px;
  color: var(--paper);
  font-size: 12px;
  font-weight: 600;
}

.notes-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}

/* --------------------------------------------------------------------------
   Toasts + noscript
   -------------------------------------------------------------------------- */

.toast-region {
  position: fixed;
  bottom: calc(20px + env(safe-area-inset-bottom));
  left: 50%;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  width: max-content;
  max-width: calc(100vw - 32px);
  pointer-events: none;
  transform: translateX(-50%);
}

.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 10px;
  color: var(--paper);
  background: rgba(17, 25, 20, 0.96);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
  font-size: 11px;
  line-height: 1.5;
  backdrop-filter: blur(16px);
  animation: toast-in 220ms var(--ease-out) both;
}

.toast::before {
  content: "";
  width: 5px;
  height: 5px;
  flex: 0 0 5px;
  border-radius: 50%;
  background: var(--acid);
}

.toast.is-error::before {
  background: var(--danger);
}

.toast.is-leaving {
  animation: toast-out 180ms ease both;
}

.noscript {
  position: fixed;
  inset: auto 16px 16px;
  z-index: 3000;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--paper);
  background: var(--panel);
  font-size: 12px;
  text-align: center;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: minmax(370px, 410px) minmax(0, 1fr);
  }

  .panel-scroll {
    padding-right: 24px;
    padding-left: 24px;
  }

  .hero h1 {
    font-size: 35px;
  }

  .coordinate-readout strong {
    font-size: 21px;
  }
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: clamp(272px, 44dvh, 420px) minmax(0, 1fr);
  }

  .map-stage {
    grid-row: 1;
    height: auto;
    min-height: 0;
  }

  .control-panel {
    grid-row: 2;
    height: auto;
    min-height: 0;
    border-top: 1px solid var(--line);
    border-right: 0;
    box-shadow: 0 -18px 50px rgba(0, 0, 0, 0.22);
  }

  .control-panel::before {
    mask-image: linear-gradient(to bottom, black, transparent 20%);
    -webkit-mask-image: linear-gradient(to bottom, black, transparent 20%);
  }

  .brand-bar {
    height: 60px;
    padding: 0 18px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    border-radius: 10px;
  }

  .brand-mark svg {
    width: 20px;
    height: 20px;
  }

  .brand-type strong {
    font-size: 13px;
  }

  .brand-type small {
    font-size: 9px;
  }

  .hdr-actions,
  .header-actions {
    gap: 3px;
  }

  .icon-button {
    width: 34px;
    height: 34px;
  }

  .panel-scroll {
    padding: 21px 18px calc(18px + env(safe-area-inset-bottom));
  }

  .hero h1 {
    max-width: 100%;
    font-size: clamp(28px, 7vw, 38px);
  }

  .hero-copy {
    max-width: 100%;
    margin-top: 12px;
    font-size: 11.5px;
    line-height: 1.7;
  }

  .connection-pill {
    margin-top: 13px;
  }

  .coordinate-card {
    margin-top: 18px;
    padding: 14px;
    border-radius: 15px;
  }

  .coordinate-readout strong {
    font-size: clamp(18px, 4.8vw, 23px);
  }

  .coordinate-readout {
    padding-top: 5px;
    padding-bottom: 5px;
  }

  .coordinate-readout + .coordinate-readout {
    padding-left: 14px;
  }

  .coordinate-foot {
    margin-top: 6px;
    padding-top: 9px;
  }

  .search-form {
    margin-top: 10px;
    height: 46px;
  }

  .lock-button {
    min-height: 66px;
    margin-top: 13px;
  }

  .lock-hint {
    margin-top: 7px;
  }

  .result-panel {
    margin-top: 17px;
  }

  .guide-card {
    margin-top: 16px;
  }

  .panel-footer {
    padding-top: 15px;
  }

  .map-status {
    top: calc(12px + env(safe-area-inset-top));
    left: 12px;
    max-width: calc(100% - 100px);
    padding: 7px 10px;
  }

  .map-crs {
    top: calc(12px + env(safe-area-inset-top));
    right: 12px;
    padding: 7px 9px;
  }

  .geo-pill {
    top: calc(49px + env(safe-area-inset-top));
    left: 12px;
    max-width: calc(100% - 24px);
    padding: 6px 9px;
    font-size: 8.5px;
  }

  .geo-pill-action {
    font-size: 8.5px;
  }

  .map-default-button {
    bottom: 12px;
    left: 12px;
    padding: 7px 9px;
  }

  .map-lock-fab {
    position: absolute;
    bottom: calc(48px + env(safe-area-inset-bottom));
    left: 50%;
    z-index: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 38px;
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    color: var(--acid-ink);
    background: var(--acid);
    box-shadow: 0 8px 22px rgba(7, 12, 8, 0.24);
    font-size: 11px;
    font-weight: 650;
    transform: translateX(-50%);
    transition: background 150ms ease, opacity 150ms ease;
  }

  .map-lock-fab svg {
    width: 14px;
    height: 14px;
  }

  .map-lock-fab:hover {
    background: var(--acid-bright);
  }

  .map-lock-fab:disabled {
    opacity: 0.6;
    cursor: wait;
  }

  .map-drag-hint {
    display: none;
  }

  .map-stage.is-locked .map-status-dot {
    animation: pulse-dot 2s ease infinite;
  }

  .leaflet-control-zoom {
    margin-right: 12px !important;
    margin-bottom: 19px !important;
  }

  .leaflet-control-zoom a {
    width: 31px !important;
    height: 31px !important;
    line-height: 31px !important;
    font-size: 16px !important;
  }

  .modal-surface,
  .modal-wide .modal-surface {
    padding: 23px;
    border-radius: 22px;
  }

  .modal-wide {
    width: min(680px, calc(100vw - 24px));
  }

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

  .toast-region {
    bottom: calc(14px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 560px) {
  .app-shell {
    grid-template-rows: clamp(250px, 41dvh, 360px) minmax(0, 1fr);
  }

  .map-status {
    gap: 6px;
    max-width: calc(100% - 92px);
    font-size: 8px;
  }

  .map-status strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .map-crs {
    font-size: 7.5px;
  }

  .map-default-button span {
    display: none;
  }

  .map-default-button {
    width: 33px;
    height: 33px;
    justify-content: center;
    padding: 0;
  }

  .map-default-button svg {
    width: 15px;
    height: 15px;
  }

  .crosshair {
    width: 56px;
    height: 56px;
  }

  .hero-copy {
    display: none;
  }

  .eyebrow-row {
    margin-bottom: 11px;
  }

  .hero h1 {
    font-size: clamp(25px, 7.4vw, 32px);
    line-height: 1.08;
  }

  .connection-pill {
    margin-top: 10px;
    padding-top: 5px;
    padding-bottom: 5px;
  }

  .coordinate-card {
    margin-top: 13px;
  }

  .coordinate-label {
    margin-bottom: 4px;
    font-size: 7.5px;
  }

  .coordinate-readout strong {
    font-size: 19px;
  }

  .coordinate-foot > span:nth-child(2) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .coordinate-foot-actions {
    gap: 8px;
  }

  .coordinate-foot-actions .inline-link {
    font-size: 10px;
  }

  .panel-scroll {
    padding-top: 17px;
  }

  .search-status {
    font-size: 10.5px;
  }

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

  .result-meta {
    grid-template-columns: minmax(0, 1fr) 94px;
  }

  .result-meta > div {
    padding: 9px 10px;
  }

  .result-meta strong {
    font-size: 11px;
  }

  .result-panel {
    padding: 15px;
    border-radius: 17px;
  }

  .result-heading h2 {
    font-size: 20px;
  }

  .result-actions {
    flex-direction: column;
  }

  .secondary-button,
  .danger-button {
    min-height: 36px;
  }

  .panel-footer {
    flex-direction: column;
    gap: 4px;
  }

  .api-footnote {
    max-width: 100%;
    text-align: left;
  }

  .modal {
    width: calc(100vw - 20px);
    max-height: 92dvh;
  }

  .modal-surface,
  .modal-wide .modal-surface {
    max-height: 92dvh;
    padding: 21px;
  }

  .modal h2 {
    font-size: 25px;
  }

  .modal-description {
    font-size: 11.5px;
  }

  .tab-list {
    gap: 2px;
  }

  .tab-button {
    padding: 5px 6px;
    font-size: 10px;
  }

  .setup-steps > li {
    padding: 11px;
  }

  .client-tabs {
    margin-right: -21px;
    padding-right: 21px;
  }

  .modal-close {
    top: 13px;
    right: 13px;
  }

  .modal-symbol {
    width: 42px;
    height: 42px;
    margin-bottom: 17px;
  }

  .toast-region {
    align-items: stretch;
  }

  .toast {
    justify-content: flex-start;
  }
}

@media (max-height: 700px) and (min-width: 901px) {
  .brand-bar {
    height: 64px;
  }

  .panel-scroll {
    padding-top: 21px;
  }

  .hero h1 {
    font-size: 32px;
  }

  .hero-copy {
    margin-top: 10px;
    line-height: 1.65;
  }

  .coordinate-card {
    margin-top: 17px;
  }

  .lock-button {
    margin-top: 13px;
  }
}

/* --------------------------------------------------------------------------
   Motion
   -------------------------------------------------------------------------- */

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.78); }
}

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

@keyframes modal-in {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes reveal-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-out {
  to { opacity: 0; transform: translateY(5px) scale(0.98); }
}

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