:root {
  color-scheme: light dark;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #f4f5f7;
  color: #1a1a1a;
}

@media (prefers-color-scheme: dark) {
  body { background: #14161a; color: #eaeaea; }
  input, select { background: #22252b; color: #eaeaea; border-color: #3a3f47; }
  code { background: #22252b; }
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: #1565c0;
  color: white;
}

header h1 { margin: 0; font-size: 1.2rem; }

#headerActions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

#deviceBar { display: flex; gap: 8px; align-items: center; }

.button-link {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 6px;
  background: white;
  color: #1565c0;
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}

.button-link:hover { background: #e3f2fd; }

main { padding: 20px; max-width: 900px; margin: 0 auto; }

.hidden { display: none !important; }

form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 360px;
}

input, select, button {
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 1rem;
}

button {
  background: #1565c0;
  color: white;
  border: none;
  cursor: pointer;
}

button:hover { background: #0d47a1; }

.error { color: #c62828; }

#statusBar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  gap: 12px;
  flex-wrap: wrap;
}

#locationDetails {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  font-size: 0.9rem;
  opacity: 0.85;
}

#map {
  height: 60vh;
  min-height: 320px;
  border-radius: 8px;
  overflow: hidden;
}

code {
  display: inline-block;
  background: #eceff1;
  padding: 2px 6px;
  border-radius: 4px;
  word-break: break-all;
}

.credential-row {
  margin-bottom: 14px;
  max-width: 480px;
}

.credential-row label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.credential-value {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
}

.credential-text {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, "Cascadia Code", "Consolas", monospace;
  color: #1a1a1a;
  background: #eceff1;
  white-space: normal;
  overflow-wrap: anywhere;
}

@media (prefers-color-scheme: dark) {
  .credential-text { color: #eaeaea; background: #22252b; }
}

.credential-text.masked {
  letter-spacing: 2px;
}

.icon-button {
  flex: none;
  padding: 6px 10px;
  background: transparent;
  color: inherit;
  border: 1px solid #ccc;
  font-size: 1rem;
  line-height: 1;
}

.icon-button:hover {
  background: rgba(0, 0, 0, 0.06);
}

@media (prefers-color-scheme: dark) {
  .icon-button:hover { background: rgba(255, 255, 255, 0.1); }
}

.copied-hint {
  position: absolute;
  right: 0;
  top: -22px;
  font-size: 0.8rem;
  background: #2e7d32;
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
}
