:root {
  --bg: #07110f;
  --bg-soft: #0c1714;
  --panel: rgba(11, 23, 20, 0.86);
  --panel-strong: rgba(14, 30, 26, 0.95);
  --border: rgba(140, 200, 182, 0.16);
  --border-strong: rgba(140, 200, 182, 0.28);
  --text: #e5f1eb;
  --muted: #9eb2ab;
  --accent: #7ee1b1;
  --accent-strong: #45c28a;
  --accent-warm: #f0b66c;
  --danger: #f27d7d;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.42);
  --radius: 24px;
  --radius-sm: 16px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(67, 194, 138, 0.18), transparent 30%),
    radial-gradient(circle at right center, rgba(240, 182, 108, 0.12), transparent 26%),
    linear-gradient(160deg, #050c0b 0%, #08110f 45%, #0c1815 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.75), transparent 88%);
}

h1,
h2,
h3,
.eyebrow,
.stat-card strong,
.chip,
.ghost-button {
  font-family: "Space Grotesk", "IBM Plex Sans", system-ui, sans-serif;
}

h1,
h2,
h3,
p {
  margin: 0;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.backdrop {
  position: fixed;
  inset: auto;
  border-radius: 999px;
  filter: blur(90px);
  opacity: 0.35;
  pointer-events: none;
}

.backdrop--a {
  top: 5%;
  left: -6%;
  width: 280px;
  height: 280px;
  background: rgba(125, 225, 177, 0.35);
}

.backdrop--b {
  right: 2%;
  bottom: 8%;
  width: 360px;
  height: 360px;
  background: rgba(240, 182, 108, 0.22);
}

.shell {
  width: calc(100vw - 16px);
  max-width: none;
  margin: 0 auto;
  padding: 28px 0 40px;
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 2px 26px;
}

.eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.topbar h1 {
  font-size: clamp(2.3rem, 3vw, 4rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.lede {
  max-width: 64ch;
  margin-top: 14px;
  color: var(--muted);
  line-height: 1.6;
}

.topbar__status {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: end;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.status-pill--accent {
  border-color: rgba(125, 225, 177, 0.32);
  background: rgba(125, 225, 177, 0.08);
  color: var(--accent);
}

.dashboard {
  display: grid;
  gap: 22px;
}

.panel {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(16, 30, 26, 0.92), rgba(8, 18, 15, 0.92));
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.hero {
  border-radius: var(--radius);
  padding: 28px;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1.3fr) minmax(360px, 0.9fr);
}

.hero__copy h2 {
  font-size: clamp(1.6rem, 2vw, 2.4rem);
  letter-spacing: -0.04em;
  line-height: 1.1;
  max-width: 18ch;
}

.hero__copy p:last-child {
  margin-top: 14px;
  color: var(--muted);
  line-height: 1.65;
  max-width: 70ch;
}

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

.stat-card {
  padding: 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015)),
    rgba(255, 255, 255, 0.02);
}

.stat-card__label {
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 12px;
}

.stat-card strong {
  font-size: 1.5rem;
  letter-spacing: -0.04em;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 0.92fr) minmax(0, 1.58fr);
  gap: 22px;
  align-items: start;
}

.sidebar,
.map-panel {
  border-radius: var(--radius);
  overflow: hidden;
}

.sidebar {
  padding: 22px;
}

.panel__header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel__header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: end;
}

.panel__header h3 {
  font-size: 1.2rem;
  letter-spacing: -0.03em;
}

.ghost-button {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.ghost-button:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.05);
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.field span,
.feed-meta__label,
.mini-note {
  color: var(--muted);
  font-size: 0.92rem;
}

.field input {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  padding: 14px 16px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.field input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

.field input[type="number"]::-webkit-outer-spin-button,
.field input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.field input:focus {
  border-color: rgba(125, 225, 177, 0.42);
  box-shadow: 0 0 0 4px rgba(125, 225, 177, 0.08);
}

.preferences-panel {
  margin-bottom: 18px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
}

.settings-page {
  display: grid;
  gap: 22px;
  width: 100%;
}

.settings-panel {
  width: 100%;
  max-width: none;
  border-radius: var(--radius);
  padding: 22px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.chip {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border-radius: 999px;
  padding: 9px 13px;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.chip:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
}

.chip.is-active {
  color: #062015;
  background: linear-gradient(180deg, var(--accent), #5fca9a);
  border-color: transparent;
}

.feed-meta {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
}

.feed-meta code {
  display: block;
  margin-top: 6px;
  color: #d7f5e7;
  word-break: break-word;
}

.location-list {
  display: grid;
  gap: 12px;
}

.location-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.location-card:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
}

.location-card__top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.location-card h4 {
  font-size: 1rem;
  letter-spacing: -0.02em;
  margin-bottom: 3px;
}

.location-card__meta {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.location-card__action {
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
}

.location-card__action:hover {
  text-decoration: underline;
}

.location-card__coords {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 0.88rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.tag--live {
  color: var(--accent);
  border-color: rgba(125, 225, 177, 0.22);
  background: rgba(125, 225, 177, 0.08);
}

.tag--alert {
  color: var(--danger);
  border-color: rgba(242, 125, 125, 0.24);
  background: rgba(242, 125, 125, 0.08);
}

.map-panel {
  min-height: 720px;
  display: flex;
  flex-direction: column;
}

.map-panel .panel__header {
  padding: 22px 22px 0;
}

.map-frame {
  position: relative;
  flex: 1;
  min-height: 640px;
  padding: 18px 22px 22px;
}

.map {
  position: relative;
  height: 100%;
  min-height: 580px;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--border);
  background:
    radial-gradient(circle at center, rgba(125, 225, 177, 0.08), transparent 35%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
}

.map-status {
  position: absolute;
  inset: 18px 22px 22px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 20px;
  border-radius: 22px;
  border: 1px dashed rgba(125, 225, 177, 0.28);
  color: var(--muted);
  background: rgba(7, 17, 15, 0.78);
  pointer-events: none;
}

.map-status.is-hidden {
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

.map-info {
  color: #061410;
  font-family: "IBM Plex Sans", system-ui, sans-serif;
}

.map-info strong {
  display: block;
  margin-bottom: 6px;
}

.empty-state {
  display: grid;
  gap: 8px;
  place-items: center;
  min-height: 180px;
  border: 1px dashed var(--border);
  border-radius: 18px;
  color: var(--muted);
  text-align: center;
  padding: 20px;
}

.leaflet-container {
  font: inherit;
}

.is-hidden {
  display: none !important;
}

.device-workbench {
  display: grid;
  grid-template-columns: minmax(300px, 0.42fr) minmax(0, 1.58fr);
  gap: 22px;
  align-items: start;
}

.content-column {
  display: grid;
  gap: 22px;
  min-width: 0;
  width: 100%;
  justify-items: stretch;
}

.route-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(360px, 0.95fr);
  gap: 22px;
  align-items: stretch;
  min-width: 0;
  width: 100%;
}

.route-layout > .panel {
  min-width: 0;
}

.detail-panel {
  border-radius: var(--radius);
  padding: 22px;
  width: 100%;
}

.inventory-panel,
.detail-panel,
.map-panel {
  min-height: 780px;
}

.inventory-panel {
  display: flex;
  flex-direction: column;
}

.device-list,
.waypoints-list {
  display: grid;
  gap: 12px;
}

.waypoints-list {
  max-height: clamp(300px, 34vh, 380px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

.device-card {
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border-radius: 18px;
  padding: 16px;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.device-card:hover,
.device-card.is-selected {
  transform: translateY(-1px);
  border-color: rgba(125, 225, 177, 0.32);
  background: rgba(125, 225, 177, 0.06);
}

.device-card__top {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.device-card__top h4 {
  font-size: 1rem;
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}

.device-card__top p {
  color: var(--muted);
  font-size: 0.9rem;
}

.device-card__meta {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.summary-card {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
}

.summary-card--wide {
  grid-column: 1 / -1;
}

.summary-card span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.summary-card strong {
  display: block;
  font-size: 1rem;
  line-height: 1.4;
  word-break: break-word;
}

.summary-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: start;
  color: var(--muted);
  line-height: 1.55;
}

.summary-notes p {
  margin: 0;
  width: 100%;
}

.device-summary {
  margin-bottom: 14px;
}

.device-form {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}

.device-form select,
.device-form textarea {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  padding: 14px 16px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.device-form select:focus,
.device-form textarea:focus {
  border-color: rgba(125, 225, 177, 0.42);
  box-shadow: 0 0 0 4px rgba(125, 225, 177, 0.08);
}

.device-form input[readonly] {
  opacity: 0.82;
}

.suggestion-box {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.suggestion-option {
  width: 100%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border-radius: 16px;
  padding: 12px 14px;
  cursor: pointer;
  text-align: left;
  display: grid;
  gap: 4px;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.suggestion-option:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
  background: rgba(125, 225, 177, 0.06);
}

.suggestion-option strong {
  font-size: 0.98rem;
}

.suggestion-option span,
.suggestion-option small {
  color: var(--muted);
}

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

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.waypoints-panel {
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.waypoints-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  align-content: start;
}

.waypoints-list::-webkit-scrollbar {
  width: 10px;
}

.waypoints-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 999px;
}

.waypoints-list::-webkit-scrollbar-thumb {
  background: rgba(125, 225, 177, 0.24);
  border: 3px solid rgba(8, 18, 15, 0.9);
  border-radius: 999px;
}

.safe-zone-panel {
  margin-bottom: 18px;
  width: 100%;
}

.safe-zone-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.safe-zone-card {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
  border-radius: 18px;
  padding: 16px;
}

.safe-zone-card.is-selected {
  border-color: rgba(125, 225, 177, 0.34);
  background: rgba(125, 225, 177, 0.06);
}

.safe-zone-card__top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
}

.safe-zone-card__top h4 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.safe-zone-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.safe-zone-card__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.safe-zone-card__actions button {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
}

.safe-zone-card__actions button:hover {
  border-color: var(--border-strong);
}

.waypoint-card {
  display: grid;
  gap: 14px;
  border: 1px solid rgba(140, 200, 182, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015)),
    rgba(255, 255, 255, 0.025);
  border-radius: 18px;
  padding: 16px;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.waypoint-card:hover {
  transform: translateY(-1px);
  border-color: rgba(125, 225, 177, 0.34);
  background:
    linear-gradient(180deg, rgba(125, 225, 177, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.03);
}

.waypoint-card--selected {
  border-color: rgba(125, 225, 177, 0.42);
  background:
    linear-gradient(180deg, rgba(125, 225, 177, 0.1), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.03);
}

.waypoint-card__top {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.waypoint-card__top h4 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.waypoint-card__top h4 span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  margin-right: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(125, 225, 177, 0.12);
  color: var(--accent);
  font-size: 0.88rem;
}

.waypoint-card__top p {
  color: var(--muted);
  font-size: 0.9rem;
}

.waypoint-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

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

.waypoint-stat {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(140, 200, 182, 0.14);
  background: rgba(255, 255, 255, 0.025);
}

.waypoint-stat--wide {
  grid-column: 1 / -1;
}

.waypoint-stat span {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.waypoint-stat strong {
  font-size: 1rem;
  line-height: 1.35;
  word-break: break-word;
}

.waypoint-card__events {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid rgba(140, 200, 182, 0.12);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.12);
}

.waypoint-card__event {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
  line-height: 1.35;
}

.waypoint-card__event-time {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.waypoint-card__event-label {
  flex: 1 1 auto;
  text-align: right;
  color: var(--text);
  font-weight: 500;
  word-break: break-word;
}

.waypoint-card__details {
  border: 1px solid rgba(140, 200, 182, 0.14);
  background: rgba(0, 0, 0, 0.16);
  border-radius: 16px;
  overflow: hidden;
}

.waypoint-card__details summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  color: var(--accent);
  font-size: 0.9rem;
  border-bottom: 1px solid transparent;
}

.waypoint-card__details summary::-webkit-details-marker {
  display: none;
}

.waypoint-card__raw {
  max-height: 220px;
  overflow: auto;
  padding: 12px 14px 14px;
  color: #d7f5e7;
  font-size: 0.82rem;
  line-height: 1.45;
}

.waypoint-card__raw-note {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.waypoint-card__raw-line {
  display: grid;
  gap: 2px;
  padding: 10px 0;
  border-top: 1px solid rgba(140, 200, 182, 0.12);
}

.waypoint-card__raw-line:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.waypoint-card__raw-time {
  color: var(--muted);
  font-size: 0.76rem;
}

.waypoint-card__raw-value {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  word-break: break-word;
}

.waypoint-cluster-marker {
  background: transparent;
  border: 0;
}

.waypoint-cluster-marker span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 2px solid rgba(125, 225, 177, 0.75);
  background: rgba(8, 17, 15, 0.95);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  box-shadow: 0 0 0 4px rgba(125, 225, 177, 0.14);
}

@media (max-width: 1260px) {
  .device-workbench {
    grid-template-columns: 1fr;
  }

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

  .inventory-panel,
  .detail-panel,
  .map-panel,
  .waypoints-panel,
  .safe-zone-panel {
    min-height: auto;
  }
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.auth-shell {
  width: min(100vw - 28px, 560px);
  position: relative;
  z-index: 1;
}

.auth-card {
  border-radius: 28px;
  padding: 30px;
  display: grid;
  gap: 22px;
}

.auth-card__copy h1 {
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.auth-card__copy p:last-child {
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.65;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.auth-error {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(242, 125, 125, 0.28);
  background: rgba(242, 125, 125, 0.1);
  color: #ffcbcb;
}

.primary-button {
  border: 0;
  border-radius: 16px;
  min-height: 48px;
  padding: 0 18px;
  background: linear-gradient(180deg, var(--accent), #5fca9a);
  color: #062015;
  font-family: "Space Grotesk", "IBM Plex Sans", system-ui, sans-serif;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, filter 0.18s ease;
}

.primary-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
}

@media (max-width: 1120px) {
  .topbar,
  .hero,
  .workspace {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: start;
  }

  .topbar__status {
    justify-content: start;
  }

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

@media (max-width: 760px) {
  body::before {
    background-size: 36px 36px;
    opacity: 0.75;
  }

  .shell {
    width: calc(100vw - 10px);
    padding-top: 10px;
    padding-bottom: 18px;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding-bottom: 18px;
  }

  .topbar__status {
    width: 100%;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .topbar__status::-webkit-scrollbar {
    display: none;
  }

  .status-pill {
    white-space: nowrap;
    flex: 0 0 auto;
  }

  .hero,
  .sidebar,
  .map-panel {
    border-radius: 20px;
  }

  .hero,
  .sidebar {
    padding: 16px;
  }

  .inventory-panel,
  .detail-panel,
  .safe-zone-panel,
  .waypoints-panel {
    padding: 16px;
  }

  .map-panel .panel__header,
  .map-frame {
    padding-left: 12px;
    padding-right: 12px;
  }

  .panel__header,
  .panel__header-actions,
  .form-actions,
  .device-card__top,
  .safe-zone-card__top {
    gap: 10px;
  }

  .panel__header,
  .panel__header-actions,
  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .panel__header-actions .ghost-button,
  .form-actions .ghost-button,
  .form-actions .primary-button {
    width: 100%;
  }

  .field input,
  .field select,
  .field textarea {
    font-size: 16px;
  }

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

  .map,
  .map-frame {
    min-height: 56svh;
  }

  .auth-card {
    padding: 20px;
  }

  .grid-2,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .waypoints-list {
    max-height: 52svh;
    padding-right: 4px;
  }

  .device-card,
  .safe-zone-card,
  .waypoint-card {
    padding: 14px;
  }
}

@media (max-width: 480px) {
  .topbar h1 {
    font-size: clamp(2rem, 10vw, 2.5rem);
  }

  .lede {
    font-size: 0.96rem;
    line-height: 1.55;
  }

  .panel {
    border-radius: 18px;
  }

  .map-panel .panel__header,
  .map-frame,
  .inventory-panel,
  .detail-panel,
  .safe-zone-panel,
  .waypoints-panel {
    padding-left: 12px;
    padding-right: 12px;
  }

  .map,
  .map-frame {
    min-height: 50svh;
  }

  .waypoints-list {
    max-height: 46svh;
  }
}
