.loc { position: relative; }
.loc-input { width: 100%; }

.loc-suggest {
  list-style: none; margin: 4px 0 0; padding: 4px;
  position: absolute; left: 0; right: 0; z-index: 30;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.28); max-height: 240px; overflow-y: auto;
}
.loc-opt { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.loc-opt:hover { background: var(--accent); color: #fff; }
.loc-opt-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loc-opt-type { flex: 0 0 auto; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em;
  color: var(--muted); background: var(--panel-2, rgba(148,163,184,.15)); padding: 1px 6px; border-radius: 999px; }
.loc-opt:hover .loc-opt-type { color: #fff; background: rgba(255,255,255,.22); }

.loc-chip {
  display: flex; align-items: center; gap: 8px;
  margin-top: 4px; padding: 8px 11px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-brd, var(--border)); border-radius: var(--radius);
  transition: border-color .15s;
}
.loc-chip:hover { border-color: var(--accent); }
.loc-chip-text { flex: 1; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loc-chip-x { border: none; background: transparent; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; padding: 0 2px; }
.loc-chip-x:hover { color: var(--text); }

.loc-hint { margin: 5px 2px 0; font-size: 11px; color: var(--muted); line-height: 1.4; }

.loc-opt-type { text-transform: uppercase; }

.loc-adv-toggle {
  display: inline-block; margin-top: 8px; padding: 0;
  background: none; border: none; color: var(--accent); font: inherit; font-size: 12px; cursor: pointer;
}
.loc-adv-toggle:hover { text-decoration: underline; }
.loc-adv-toggle:focus { outline: none; }
.loc-adv-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.loc-adv { margin-top: 8px; padding: 12px; border: 1px solid var(--glass-brd, var(--border));
  border-radius: var(--radius); background: var(--glass, rgba(255, 255, 255, 0.045)); }
.loc-coord-row { display: flex; gap: 10px; }
.loc-coord { flex: 1; display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--muted); }

.loc-coord input {
  width: 100%; margin-top: 5px; padding: 8px 10px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--glass-brd, var(--border));
  border-radius: var(--radius); color: var(--text); font: inherit; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.loc-coord input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.22); }

.loc-coord input::-webkit-outer-spin-button, .loc-coord input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.loc-usecoords { display: flex; align-items: center; gap: 9px; margin-top: 10px; font-size: 12px; cursor: pointer; }
.loc-adv-note { margin: 8px 0 0; font-size: 11px; color: var(--muted); line-height: 1.4; }

.loc-usecoords input[type="checkbox"] {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; flex: none; margin: 0; padding: 0;
  border: 1.5px solid var(--glass-brd, var(--border)); border-radius: 5px;
  background: var(--glass, rgba(255, 255, 255, 0.06));
  box-shadow: none; cursor: pointer;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.loc-usecoords input[type="checkbox"]:hover { border-color: var(--accent); }
.loc-usecoords input[type="checkbox"]:checked {
  border-color: transparent;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E") center / 12px 12px no-repeat,
    linear-gradient(135deg, #60a5fa 0%, #3B82F6 55%, #2563eb 100%);
  box-shadow: 0 3px 10px rgba(59, 130, 246, 0.4);
}
.loc-usecoords input[type="checkbox"]:focus-visible { box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.35); }

.loc-global {
  display: flex; align-items: center; gap: 10px;
  margin-top: 10px; padding: 10px 12px;
  border: 1px solid var(--glass-brd, var(--border)); border-radius: var(--radius);
  background: var(--glass, rgba(255, 255, 255, 0.045));
  font-size: 12px; line-height: 1.4; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.loc-global:hover { border-color: var(--accent); }
.loc-global.is-on { border-color: var(--accent); background: rgba(59, 130, 246, 0.10); }
.loc-global-note { margin: 6px 2px 0; font-size: 11px; color: var(--muted); line-height: 1.45; }

.loc-switch-input { position: absolute; opacity: 0; width: 0; height: 0; }
.loc-switch-track { position: relative; flex: none; width: 44px; height: 24px; border-radius: 999px;
  background: rgba(148, 163, 184, 0.35); border: 1px solid var(--glass-brd, var(--border));
  transition: background .2s, border-color .2s; }
.loc-switch-knob { position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 3px rgba(2, 6, 23, 0.5); transition: transform .2s; }
.loc-switch-knob .ic { width: 13px; height: 13px; color: #1f2937; stroke-width: 2.2; }
.loc-switch-input:checked ~ .loc-switch-track { background: var(--accent); border-color: var(--accent); }
.loc-switch-input:checked ~ .loc-switch-track .loc-switch-knob { transform: translateX(20px); }
.loc-switch-input:focus-visible ~ .loc-switch-track { box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.35); }
