/* rakn-backend — hand-written, no framework, no build step. Dark theme only. */

:root {
  --bg: #0a0c10;
  --bg-glow: #10151d;
  --surface: #14181f;
  --surface-2: #1a1f28;
  --border: #262d38;
  --border-strong: #333c4a;

  --text: #e8ecf3;
  --text-muted: #8d98a9;
  --text-faint: #5f6979;

  --accent: #4f8cff;
  --accent-hover: #6da0ff;
  --accent-soft: rgba(79, 140, 255, 0.12);
  --danger: #ff6b6b;
  --danger-soft: rgba(255, 107, 107, 0.1);
  --ok: #35d0a5;
  --ok-soft: rgba(53, 208, 165, 0.12);

  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);

  --font: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(60rem 40rem at 50% -18rem, var(--bg-glow), transparent 70%);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* ---------- brand ---------- */

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  font-size: 1.05rem;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(140deg, var(--accent), #7b5cff);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  flex: none;
}

.brand-sub {
  color: var(--text-faint);
  font-weight: 450;
}

/* ---------- auth pages ---------- */

.auth-wrap {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 2.5rem 1.25rem;
}

.auth-card {
  width: 100%;
  max-width: 27rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 2rem;
}

.auth-card .brand {
  margin-bottom: 1.75rem;
}

.auth-card h1 {
  margin: 0 0 0.4rem;
  font-size: 1.4rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.auth-card .lede {
  margin: 0 0 1.6rem;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.auth-foot {
  margin: 1.5rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
}

/* ---------- forms ---------- */

.field {
  margin-bottom: 1.1rem;
}

.field label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
  font-weight: 550;
  color: var(--text);
}

.field .hint {
  display: block;
  margin-top: 0.4rem;
  color: var(--text-faint);
  font-size: 0.8rem;
}

input[type='text'],
input[type='email'],
input[type='password'],
input[type='url'] {
  width: 100%;
  padding: 0.65rem 0.8rem;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input::placeholder {
  color: var(--text-faint);
}

input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

button {
  font-family: inherit;
  font-size: 0.92rem;
  cursor: pointer;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-primary {
  width: 100%;
  padding: 0.7rem 1rem;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-ghost {
  padding: 0.45rem 0.85rem;
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text-muted);
}

.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text);
}

/* ---------- alerts ---------- */

.alert {
  display: none;
  margin-bottom: 1.1rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius);
  font-size: 0.88rem;
  border: 1px solid transparent;
}

.alert.show {
  display: block;
}

.alert-error {
  background: var(--danger-soft);
  border-color: rgba(255, 107, 107, 0.35);
  color: #ffb3b3;
}

/* ---------- dashboard ---------- */

.topbar {
  border-bottom: 1px solid var(--border);
  background: rgba(10, 12, 16, 0.85);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-inner,
.page {
  max-width: 60rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 60px;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
}

.topbar-email {
  color: var(--text-muted);
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page {
  padding-top: 2.5rem;
  padding-bottom: 4rem;
}

.page-head {
  margin-bottom: 2rem;
}

.page-head h1 {
  margin: 0 0 0.35rem;
  font-size: 1.6rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.page-head p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.93rem;
}

.section {
  margin-bottom: 1.75rem;
}

.section-title {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-faint);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* config rows */

.row {
  display: grid;
  grid-template-columns: 11rem 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--border);
}

.row:last-child {
  border-bottom: none;
}

.row-label {
  color: var(--text-muted);
  font-size: 0.87rem;
  font-weight: 500;
}

.row-value {
  font-family: var(--mono);
  font-size: 0.86rem;
  color: var(--text);
  word-break: break-all;
  min-width: 0;
}

.row-value.is-empty {
  color: var(--text-faint);
  font-style: italic;
  font-family: var(--font);
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.icon-btn {
  padding: 0.35rem 0.6rem;
  background: var(--surface-2);
  border-color: var(--border-strong);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 550;
  white-space: nowrap;
}

.icon-btn:hover:not(:disabled) {
  background: var(--border);
  color: var(--text);
}

.icon-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.icon-btn.copied {
  background: var(--ok-soft);
  border-color: rgba(53, 208, 165, 0.4);
  color: var(--ok);
}

.note {
  margin: 0.85rem 0 0;
  color: var(--text-faint);
  font-size: 0.82rem;
}

.loading {
  padding: 3rem 0;
  text-align: center;
  color: var(--text-faint);
}

/* ---------- pilot bridge page ---------- */

.pilot-body {
  min-height: 100%;
}

.pilot-layout {
  max-width: 68rem;
  margin: 0 auto;
  padding: 1.75rem 1.5rem 3rem;
  display: grid;
  grid-template-columns: minmax(0, 22rem) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.pilot-panel,
.pilot-log {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
}

.pilot-h1 {
  margin: 0 0 0.3rem;
  font-size: 1.3rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.pilot-sub {
  margin: 0 0 1.4rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.pilot-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.2rem;
}

/* module checklist */
.module-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.module {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}

.module:last-child {
  border-bottom: none;
}

.module-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
  background: var(--text-faint);
}

.module-pending .module-dot {
  background: #f5a524;
  box-shadow: 0 0 0 3px rgba(245, 165, 36, 0.18);
  animation: pulse 1.2s ease-in-out infinite;
}

.module-ok .module-dot {
  background: var(--ok);
  box-shadow: 0 0 0 3px var(--ok-soft);
}

.module-fail .module-dot {
  background: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-soft);
}

@keyframes pulse {
  50% { opacity: 0.35; }
}

.module-name {
  font-size: 0.9rem;
  font-weight: 550;
}

.module-sub {
  font-size: 0.78rem;
  color: var(--text-faint);
  word-break: break-word;
}

.module-fail .module-sub {
  color: #ffb3b3;
}

/* log output */
.log-output {
  margin: 0;
  padding: 0.85rem;
  background: #07090c;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: #cfd6e2;
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.55;
  height: 26rem;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.log-output.tall {
  height: 30rem;
  border: none;
  border-radius: 0;
}

code {
  font-family: var(--mono);
  font-size: 0.85em;
  padding: 0.05rem 0.3rem;
  background: var(--surface-2);
  border-radius: 4px;
}

/* ---------- stat tiles ---------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 0.75rem;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
}

.stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
}

.stat-value {
  margin-top: 0.2rem;
  font-family: var(--mono);
  font-size: 1.4rem;
  font-weight: 600;
}

.stat-sub {
  margin-top: 0.1rem;
  font-size: 0.75rem;
  color: var(--text-faint);
}

.stat-ok .stat-value { color: var(--ok); }
.stat-warn .stat-value { color: #f5b769; }
.stat-idle .stat-value { color: var(--text-muted); }
.stat-bad .stat-value { color: var(--danger); }
.stat-bad, .stat-warn { border-color: var(--border-strong); }

@media (max-width: 52rem) {
  .pilot-layout {
    grid-template-columns: 1fr;
  }
  .log-output {
    height: 18rem;
  }
}

/* ---------- icon preview ---------- */

.icon-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
}

.icon-controls label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.icon-controls input[type='range'] {
  width: 14rem;
  accent-color: var(--accent);
}

.icon-controls select {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 0.35rem 0.6rem;
  font-family: inherit;
  font-size: 0.85rem;
}

.icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: 1rem;
}

.icon-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem;
}

.icon-name {
  font-size: 1rem;
  font-weight: 650;
}

.icon-sub {
  font-size: 0.8rem;
  color: var(--text-faint);
  margin-bottom: 0.9rem;
}

.icon-row {
  padding: 0.7rem 0;
  border-top: 1px solid var(--border);
}

.icon-variant {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: 0.5rem;
}

.icon-stage {
  display: flex;
  align-items: flex-end;
  gap: 1.4rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius);
  background: #11161d;
  transition: background 0.2s ease;
}

.icon-shot {
  text-align: center;
}

.icon-img {
  display: block;
  image-rendering: auto;
  transition: transform 0.12s linear;
}

.icon-size {
  margin-top: 0.35rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-faint);
}

.icon-url {
  margin-top: 0.5rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  word-break: break-all;
}

/* backdrops, so contrast can be judged the way the RC will show it */
.icon-grid.bg-light .icon-stage { background: #eef2f6; }
.icon-grid.bg-sat .icon-stage {
  background:
    radial-gradient(circle at 30% 30%, #4a5a3e, transparent 60%),
    radial-gradient(circle at 70% 65%, #6b6350, transparent 55%),
    #3d4636;
}
.icon-grid.bg-checker .icon-stage {
  background-color: #808080;
  background-image:
    linear-gradient(45deg, #666 25%, transparent 25%, transparent 75%, #666 75%),
    linear-gradient(45deg, #666 25%, transparent 25%, transparent 75%, #666 75%);
  background-size: 16px 16px;
  background-position: 0 0, 8px 8px;
}

/* ---------- tables (admin) ---------- */

.page-wide {
  max-width: 78rem;
}

.table-wrap {
  overflow-x: auto;
}

.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.tbl th {
  text-align: left;
  padding: 0.6rem 0.9rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-faint);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.tbl td {
  padding: 0.55rem 0.9rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.tbl tr:last-child td {
  border-bottom: none;
}

.tbl tbody tr:hover {
  background: var(--surface-2);
}

.tbl .num {
  text-align: right;
  font-family: var(--mono);
}

.tbl .mono {
  font-family: var(--mono);
  color: var(--accent);
}

.tbl .muted {
  color: var(--text-faint);
}

.tbl .good {
  color: var(--ok);
}

.tbl .arrow {
  color: var(--text-faint);
  text-align: center;
}

/* ---------- raw message viewer ---------- */

.msg {
  border-bottom: 1px solid var(--border);
}

.msg:last-child {
  border-bottom: none;
}

.msg-head {
  border-bottom: none;
}

.payload {
  margin: 0;
  padding: 0.7rem 1.1rem 1rem;
  background: #07090c;
  color: #cfd6e2;
  font-family: var(--mono);
  font-size: 0.74rem;
  line-height: 1.5;
  max-height: 22rem;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------- small screens: the RC's own display ---------- *
 * The RC Plus screen is short, and Pilot's on-screen keyboard eats most of
 * the remaining height when a field takes focus. These rules target height
 * rather than width, because the viewport gets short before it gets narrow.
 */

@media (max-height: 640px) {
  body {
    font-size: 14px;
  }

  .topbar-inner {
    height: 44px;
  }

  .brand-sub,
  .topbar-email {
    display: none;
  }

  .pilot-layout {
    padding: 0.75rem;
    gap: 0.75rem;
  }

  .pilot-panel,
  .pilot-log {
    padding: 0.85rem;
  }

  .pilot-h1 {
    font-size: 1.05rem;
    margin-bottom: 0.15rem;
  }

  /* The explanatory copy is the first thing to go — the form must stay reachable. */
  .pilot-sub,
  .auth-card .lede {
    display: none;
  }

  .field {
    margin-bottom: 0.6rem;
  }

  .field label {
    margin-bottom: 0.2rem;
    font-size: 0.78rem;
  }

  input[type='text'],
  input[type='email'],
  input[type='password'],
  input[type='url'] {
    padding: 0.45rem 0.6rem;
    font-size: 0.9rem;
  }

  .btn-primary {
    padding: 0.5rem 1rem;
  }

  .auth-wrap {
    padding: 0.75rem;
    align-items: start;
  }

  .auth-card {
    padding: 1rem;
  }

  .auth-card .brand {
    margin-bottom: 0.75rem;
  }

  .auth-foot {
    margin-top: 0.85rem;
    padding-top: 0.7rem;
  }

  .log-output {
    height: 9rem;
  }

  .module {
    padding: 0.4rem 0;
  }

  .page {
    padding-top: 1rem;
  }

  .page-head {
    margin-bottom: 1rem;
  }
}

/* Very short — the keyboard is almost certainly open. Strip to essentials. */
@media (max-height: 460px) {
  .pilot-log,
  .note,
  .page-head p,
  .auth-foot {
    display: none;
  }

  .pilot-layout {
    grid-template-columns: 1fr;
  }

  .topbar {
    position: static;
  }
}

/* Landscape on a short display: put the auth form side by side with the
   branding so the fields sit in the upper half, above the keyboard. */
@media (max-height: 560px) and (min-width: 40rem) {
  .pilot-layout {
    grid-template-columns: minmax(0, 20rem) minmax(0, 1fr);
    align-items: start;
  }
}

/* ---------- landing page extras ---------- */

.code-big {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--accent);
}

.row-wide {
  grid-template-columns: 8rem 1fr auto;
  align-items: start;
}

.row-meta {
  margin-top: 0.15rem;
  font-family: var(--font);
  font-size: 0.78rem;
  color: var(--text-faint);
}

.row-meta.ua {
  font-size: 0.72rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 34rem;
}

.mono-strong {
  font-family: var(--mono);
  font-size: 0.86rem;
  color: var(--text);
}

.row-label.is-current {
  color: var(--ok);
  font-weight: 600;
}

.row-form {
  align-items: start;
  background: var(--bg);
}

.row-form .row-value input {
  margin-bottom: 0;
}

.count {
  color: var(--text-faint);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.note.warn {
  color: #f5b769;
}

.origin-tag {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.68rem;
  font-weight: 500;
  vertical-align: middle;
}

/* ---------- live map ---------- */

.map-body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.map-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 19rem 1fr;
  min-height: 0;
}

.map-side {
  border-right: 1px solid var(--border);
  background: var(--surface);
  padding: 1.1rem;
  overflow-y: auto;
  min-height: 0;
}

.side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.9rem;
}

.map-canvas {
  position: relative;
  min-height: 0;
}

#map {
  position: absolute;
  inset: 0;
  background: #0f1319;
}

/* Leaflet's chrome is light by default — bring it into the dark theme. */
.leaflet-container {
  background: #0f1319;
  font-family: var(--font);
}

.leaflet-control-zoom a,
.leaflet-bar a {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text);
}

.leaflet-control-zoom a:hover,
.leaflet-bar a:hover {
  background: var(--border);
  color: var(--text);
}

.leaflet-control-attribution {
  background: rgba(10, 12, 16, 0.75) !important;
  color: var(--text-faint) !important;
}

.leaflet-control-attribution a {
  color: var(--text-muted) !important;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
}

.leaflet-popup-content {
  margin: 0.7rem 0.85rem;
  font-size: 0.85rem;
}

.popup table {
  margin-top: 0.45rem;
  border-collapse: collapse;
}

.popup th {
  text-align: left;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.1rem 0.9rem 0.1rem 0;
  white-space: nowrap;
}

.popup td {
  font-family: var(--mono);
  font-size: 0.8rem;
}

/* device markers: the same PNGs Pilot draws on the RC */
.dev-marker-wrap {
  background: none;
  border: none;
}

.dev-icon {
  display: block;
  transform-origin: 50% 50%;
  transition: transform 0.3s ease, width 0.15s ease, height 0.15s ease;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.65));
}

/* device list */
.device-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.device {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.65rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s ease;
}

.device:hover {
  background: var(--surface-2);
}

.device.is-following {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(79, 140, 255, 0.35);
}

.device-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--text-faint);
  flex: none;
}

/* sidebar rows carry the device's own marker, so the list and the map agree */
.device-icon {
  width: 22px;
  height: 22px;
  flex: none;
}

.device-icon.is-offline {
  opacity: 0.35;
  filter: grayscale(1);
}

.device-dot.is-online {
  background: var(--dev-color, var(--ok));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--dev-color, var(--ok)) 25%, transparent);
}

.device-text {
  min-width: 0;
}

.device-name {
  font-size: 0.88rem;
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-sub {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--text-faint);
}

.side-empty {
  color: var(--text-faint);
  font-size: 0.83rem;
  line-height: 1.5;
  margin: 0.5rem 0.65rem;
}

/* claim form */
.claim-form {
  margin-bottom: 1rem;
  padding: 0.85rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.claim-form input {
  margin-bottom: 0.5rem;
  padding: 0.45rem 0.6rem;
  font-size: 0.85rem;
}

.claim-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.btn-sm {
  width: auto;
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
}

.claim-form .alert {
  margin: 0.6rem 0 0;
  font-size: 0.8rem;
}

/* connection pill */
.conn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.conn-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-faint);
}

.conn-live .conn-dot {
  background: var(--ok);
  box-shadow: 0 0 0 3px var(--ok-soft);
}

.conn-down .conn-dot {
  background: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-soft);
}

.btn-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.btn-link:hover {
  text-decoration: none;
}

@media (max-width: 52rem) {
  .map-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 13rem 1fr;
  }

  .map-side {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
}

@media (max-width: 40rem) {
  .row {
    grid-template-columns: 1fr auto;
    row-gap: 0.35rem;
  }

  .row-label {
    grid-column: 1 / -1;
  }

  .auth-card {
    padding: 1.5rem;
  }
}
