:root {
  color-scheme: dark;
  --graphite: #030711;
  --panel: rgba(5, 13, 24, 0.9);
  --panel-strong: rgba(8, 21, 38, 0.96);
  --metal: #d7e8f5;
  --metal-dim: #72869a;
  --signal: #28bfff;
  --signal-soft: rgba(40, 191, 255, 0.15);
  --red: #ff3b54;
  --red-soft: rgba(255, 59, 84, 0.16);
  --cyan: #8be7ff;
  --ink: #eef9ff;
  --muted: #92a9ba;
  --line: rgba(255, 255, 255, 0.12);
  --radius: 28px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.46);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "Cascadia Code", "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 38%, rgba(40, 191, 255, 0.16), transparent 28%),
    radial-gradient(circle at 12% 14%, rgba(139, 231, 255, 0.1), transparent 27%),
    radial-gradient(circle at 82% 6%, rgba(255, 59, 84, 0.1), transparent 24%),
    linear-gradient(135deg, #02040a 0%, #07111e 54%, #010207 100%);
  color: var(--ink);
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.ambient-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.44;
  background-image:
    linear-gradient(rgba(40, 191, 255, 0.11) 1px, transparent 1px),
    linear-gradient(90deg, rgba(40, 191, 255, 0.11) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(circle at center, black, transparent 78%);
  animation: gridDrift 18s linear infinite;
}

.code-rain {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.2;
  background-image:
    repeating-linear-gradient(90deg, transparent 0 34px, rgba(40, 191, 255, 0.1) 35px, transparent 36px),
    repeating-linear-gradient(180deg, rgba(40, 191, 255, 0.18) 0 1px, transparent 1px 22px);
  mask-image: linear-gradient(to bottom, transparent, black 18%, black 82%, transparent);
  animation: codeFall 7s linear infinite;
}

.scanline {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.035), transparent);
  background-size: 100% 7px;
  mix-blend-mode: screen;
  opacity: 0.32;
  animation: scanSweep 4.8s linear infinite;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1220px, calc(100% - 28px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 22px 0 36px;
}

.device-frame {
  position: relative;
  min-height: calc(100vh - 58px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 50% 45%, rgba(40, 191, 255, 0.12), transparent 34%),
    linear-gradient(135deg, rgba(215, 232, 245, 0.1), rgba(40, 191, 255, 0.025)),
    rgba(3, 7, 17, 0.9);
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(40, 191, 255, 0.14);
  overflow: hidden;
  isolation: isolate;
}

.device-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, transparent, rgba(40, 191, 255, 0.11), transparent),
    repeating-linear-gradient(0deg, transparent 0 29px, rgba(40, 191, 255, 0.07) 30px);
  transform: translateX(-100%);
  animation: panelSweep 6s ease-in-out infinite;
}

.device-frame::after {
  content: "";
  position: absolute;
  inset: 8% 10%;
  z-index: -1;
  pointer-events: none;
  opacity: 0.26;
  background:
    repeating-radial-gradient(circle at 50% 42%, transparent 0 42px, rgba(40, 191, 255, 0.22) 43px 45px, transparent 46px 76px),
    conic-gradient(from 40deg at 50% 42%, transparent 0 12deg, rgba(139, 231, 255, 0.18) 13deg 18deg, transparent 19deg 84deg, rgba(255, 59, 84, 0.1) 85deg 92deg, transparent 93deg 360deg);
  animation: hudRotate 22s linear infinite;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px clamp(16px, 3vw, 30px);
  border-bottom: 1px solid var(--line);
  background: rgba(12, 14, 18, 0.9);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: #111;
  font-weight: 900;
  background:
    radial-gradient(circle at 35% 25%, #eaffef, transparent 28%),
    linear-gradient(135deg, #8be7ff, #11314a 64%, #ff3b54);
  box-shadow: 0 0 28px rgba(40, 191, 255, 0.42);
}

.brand h1 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 2.2rem);
  line-height: 1;
  letter-spacing: 0;
  font-family: var(--mono);
  text-shadow: 2px 0 rgba(255, 59, 84, 0.55), -2px 0 rgba(40, 191, 255, 0.55), 0 0 18px rgba(139, 231, 255, 0.22);
  animation: glitchBoot 1.25s steps(2, end) 1, glitchText 3.4s steps(2, end) 1.25s infinite;
}

.glitch-brand {
  position: relative;
  display: inline-block;
}

.glitch-brand::before,
.glitch-brand::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
}

.glitch-brand::before {
  color: var(--red);
  transform: translateX(2px);
  clip-path: inset(0 0 55% 0);
  animation: glitchLayer 2.9s steps(2, end) infinite;
}

.glitch-brand::after {
  color: var(--cyan);
  transform: translateX(-2px);
  clip-path: inset(46% 0 0 0);
  animation: glitchLayer 3.7s steps(2, end) infinite reverse;
}

.brand span,
.muted {
  color: var(--muted);
}

.brand span,
.badge,
label,
th,
.stat span {
  font-family: var(--mono);
}

.nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav button,
.icon-btn,
.primary,
.danger,
.ghost {
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 10px 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
  font-family: var(--mono);
}

.nav button.active,
.primary {
  border-color: rgba(40, 191, 255, 0.68);
  background: linear-gradient(135deg, rgba(40, 191, 255, 0.2), rgba(255, 59, 84, 0.08));
  box-shadow: 0 0 22px rgba(40, 191, 255, 0.16);
}

.danger {
  border-color: rgba(255, 49, 84, 0.64);
  background: var(--red-soft);
}

.ghost {
  color: var(--muted);
}

button:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.34);
}

.content {
  padding: clamp(16px, 3vw, 30px);
}

.auth-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 22px;
  align-items: stretch;
}

.hero-panel,
.panel,
.tile,
.post,
.gear-card,
.log-row,
.fallback-map {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(40, 191, 255, 0.12), rgba(255, 255, 255, 0.035) 42%, rgba(255, 59, 84, 0.065)),
    var(--panel);
  box-shadow: inset 0 0 0 1px rgba(40, 191, 255, 0.08);
  overflow: hidden;
}

.hero-panel {
  min-height: 540px;
  padding: clamp(22px, 5vw, 48px);
}

.hero-panel h2 {
  max-width: 680px;
  margin: 0;
  font-size: clamp(2.25rem, 8vw, 5.6rem);
  line-height: 0.92;
  letter-spacing: 0;
  font-family: var(--mono);
  text-shadow: 0 0 22px rgba(40, 191, 255, 0.22);
}

.hero-panel h2::after {
  content: "_";
  display: inline-block;
  color: var(--signal);
  animation: cursorBlink 900ms steps(1, end) infinite;
}

.hero-panel p {
  max-width: 620px;
  color: var(--muted);
  font-size: 1.06rem;
  line-height: 1.65;
}

.node-field {
  position: absolute;
  inset: auto 0 0;
  height: 46%;
  background:
    linear-gradient(120deg, transparent 12%, rgba(40, 191, 255, 0.34) 13%, transparent 14%),
    linear-gradient(30deg, transparent 34%, rgba(140, 199, 163, 0.18) 35%, transparent 36%),
    radial-gradient(circle at 24% 50%, var(--signal) 0 6px, transparent 7px),
    radial-gradient(circle at 54% 24%, var(--red) 0 5px, transparent 6px),
    radial-gradient(circle at 76% 66%, var(--cyan) 0 4px, transparent 5px);
  opacity: 0.9;
  animation: pulseHud 2.8s ease-in-out infinite;
}

.panel {
  padding: 18px;
}

.panel::after,
.tile::after,
.post::after,
.gear-card::after,
.log-row::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, rgba(40, 191, 255, 0.1), transparent) 0 0 / 220% 100%;
  mix-blend-mode: screen;
  opacity: 0;
  animation: shimmerGlitch 5.5s ease-in-out infinite;
}

.panel h2,
.panel h3 {
  margin: 0 0 14px;
}

.form-stack {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 14px;
  padding: 12px 13px;
  color: var(--ink);
  background: rgba(0, 0, 0, 0.24);
  outline: none;
  font-family: var(--mono);
}

textarea {
  min-height: 110px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(40, 191, 255, 0.72);
  box-shadow: 0 0 0 3px rgba(40, 191, 255, 0.13);
}

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

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

.tile {
  min-height: 154px;
  padding: 18px;
  text-align: left;
}

.tile-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  margin-bottom: 16px;
  background: var(--signal-soft);
  color: var(--signal);
  font-weight: 900;
}

.tile h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.tile p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stat {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.045);
}

.stat b {
  display: block;
  font-size: 1.6rem;
  color: var(--signal);
  font-family: var(--mono);
  overflow-wrap: anywhere;
}

.widget-grid {
  display: grid;
  grid-template-columns: 0.85fr 1fr 1.35fr 1.2fr;
  gap: 16px;
  margin-bottom: 18px;
}

.widget-panel {
  min-height: 210px;
}

.mono-readout {
  font-family: var(--mono);
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1;
  color: var(--signal);
  text-shadow: 0 0 22px rgba(40, 191, 255, 0.22);
}

.media-frame {
  width: 100%;
  height: 190px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #010713;
}

.notification-list {
  display: grid;
  gap: 10px;
  max-height: 260px;
  overflow: auto;
}

.map-shell {
  display: grid;
  gap: 14px;
}

#mapCanvas,
.fallback-map {
  width: 100%;
  height: min(66vh, 620px);
  min-height: 430px;
  border-radius: 24px;
}

.fallback-map {
  display: grid;
  place-items: center;
  background:
    linear-gradient(90deg, transparent 24%, rgba(40, 191, 255, 0.18) 25%, transparent 26%),
    linear-gradient(0deg, transparent 24%, rgba(255, 59, 84, 0.15) 25%, transparent 26%),
    radial-gradient(circle at 36% 38%, rgba(40, 191, 255, 0.72) 0 8px, transparent 9px),
    radial-gradient(circle at 62% 58%, rgba(140, 199, 163, 0.58) 0 6px, transparent 7px),
    rgba(3, 5, 4, 0.96);
  background-size: 120px 120px, 120px 120px, auto, auto, auto;
}

.fallback-map div {
  max-width: 420px;
  padding: 24px;
  text-align: center;
}

.feed-layout,
.admin-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 16px;
}

.side-stack {
  display: grid;
  gap: 16px;
  align-content: start;
}

.post,
.gear-card,
.log-row {
  padding: 16px;
}

.mission-attachment {
  display: grid;
  gap: 8px;
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.045);
}

.mission-attachment img,
.mission-attachment video {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  border-radius: 12px;
  background: #010713;
}

.mission-attachment a {
  color: var(--signal);
  font-family: var(--mono);
  overflow-wrap: anywhere;
}

.mission-attachment.file {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.post + .post,
.log-row + .log-row {
  margin-top: 12px;
}

.meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  color: var(--muted);
  font-size: 0.86rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 10px;
  border: 1px solid rgba(40, 191, 255, 0.38);
  color: var(--signal);
  background: var(--signal-soft);
  font-size: 0.78rem;
  font-weight: 800;
}

.badge.red {
  border-color: rgba(255, 49, 84, 0.42);
  color: #ff8aa0;
  background: var(--red-soft);
}

.message-list {
  display: grid;
  gap: 10px;
  max-height: 50vh;
  overflow: auto;
  padding-right: 4px;
}

.member-list {
  display: grid;
  gap: 10px;
}

.member-row {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.045);
}

.bubble {
  max-width: 82%;
  border-radius: 18px;
  padding: 12px 14px;
  line-height: 1.5;
  background: rgba(255, 255, 255, 0.08);
}

.bubble.user {
  justify-self: end;
  background: linear-gradient(135deg, rgba(40, 191, 255, 0.24), rgba(255, 59, 84, 0.14));
}

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

.analysis {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.analysis p {
  margin: 0;
  line-height: 1.45;
}

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

.video-card {
  position: relative;
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: #010713;
}

.video-card video {
  width: 100%;
  height: 100%;
  min-height: 220px;
  object-fit: cover;
  display: block;
}

.video-card .badge {
  position: absolute;
  left: 10px;
  bottom: 10px;
}

.gear-card img,
.avatar {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
}

.avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 0.82rem;
}

.inline-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.segmented-control {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(40, 191, 255, 0.24);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
}

.segmented-control button {
  min-height: 38px;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 8px 12px;
  color: var(--muted);
  background: transparent;
  font-family: var(--mono);
}

.segmented-control button.active {
  color: var(--ink);
  border-color: rgba(40, 191, 255, 0.58);
  background: var(--signal-soft);
  box-shadow: 0 0 18px rgba(40, 191, 255, 0.12);
}

.panel-lite,
.group-summary {
  border: 1px solid rgba(40, 191, 255, 0.2);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.hud-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(40, 191, 255, 0.18);
}

.pinpoint-readout,
.intel-location,
.intel-card {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  border: 1px solid rgba(40, 191, 255, 0.24);
  border-radius: 16px;
  padding: 12px;
  background:
    linear-gradient(135deg, rgba(40, 191, 255, 0.1), rgba(255, 255, 255, 0.035)),
    rgba(0, 0, 0, 0.16);
}

.pinpoint-readout strong,
.intel-location strong,
.intel-card strong {
  font-family: var(--mono);
  overflow-wrap: anywhere;
}

.pinpoint-readout small {
  color: var(--muted);
}

.intel-results,
.intel-group {
  display: grid;
  gap: 10px;
}

.intel-group h3 {
  margin: 10px 0 0;
  font-size: 0.95rem;
  color: var(--cyan);
  font-family: var(--mono);
}

.intel-card {
  margin-top: 0;
}

.intel-card img {
  width: 100%;
  max-height: 160px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #010713;
}

.intel-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.intel-card a {
  color: var(--cyan);
  font-family: var(--mono);
  overflow-wrap: anywhere;
}

.crime-feed-results,
.crime-feed-section {
  display: grid;
  gap: 10px;
}

.crime-feed-section h3 {
  margin: 12px 0 0;
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 0.95rem;
}

.crime-video {
  width: 100%;
  min-height: 210px;
  max-height: 320px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #010713;
}

iframe.crime-video {
  height: 260px;
}

.crime-audio {
  width: 100%;
  margin: 8px 0;
}

.surveillance-grid {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.surveillance-card {
  position: relative;
  border: 1px solid rgba(40, 191, 255, 0.24);
  border-radius: 16px;
  padding: 12px;
  background:
    linear-gradient(145deg, rgba(40, 191, 255, 0.09), rgba(255, 255, 255, 0.035)),
    rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.surveillance-preview {
  width: 100%;
  min-height: 210px;
  max-height: 320px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 14px;
  margin: 12px 0;
  background: #010713;
}

iframe.surveillance-preview {
  height: 260px;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 999px;
  padding: 10px 14px;
  text-decoration: none;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  max-width: min(380px, calc(100% - 36px));
  border: 1px solid rgba(40, 191, 255, 0.5);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(18, 20, 24, 0.96);
  color: var(--ink);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.warning {
  border-color: rgba(255, 49, 84, 0.42);
  background: rgba(255, 49, 84, 0.08);
}

.empty {
  color: var(--muted);
  padding: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 16px;
}

@keyframes gridDrift {
  to {
    transform: translate3d(54px, 54px, 0);
  }
}

@keyframes codeFall {
  to {
    transform: translateY(88px);
  }
}

@keyframes scanSweep {
  0% {
    transform: translateY(-18px);
  }
  100% {
    transform: translateY(18px);
  }
}

@keyframes panelSweep {
  0%,
  62%,
  100% {
    transform: translateX(-100%);
  }
  72% {
    transform: translateX(100%);
  }
}

@keyframes shimmerGlitch {
  0%,
  58%,
  100% {
    opacity: 0;
    background-position: 0 0;
  }
  61% {
    opacity: 1;
    background-position: 100% 0;
  }
  63% {
    opacity: 0.18;
  }
}

@keyframes glitchText {
  0%,
  92%,
  100% {
    transform: translate(0);
    filter: none;
  }
  94% {
    transform: translate(1px, -1px);
    filter: hue-rotate(18deg);
  }
  96% {
    transform: translate(-2px, 1px);
  }
}

@keyframes cursorBlink {
  0%,
  48% {
    opacity: 1;
  }
  49%,
  100% {
    opacity: 0;
  }
}

@keyframes pulseHud {
  0%,
  100% {
    opacity: 0.7;
    filter: saturate(1);
  }
  50% {
    opacity: 1;
    filter: saturate(1.5);
  }
}

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

@keyframes glitchBoot {
  0% {
    opacity: 0;
    transform: translateX(-10px) skewX(-8deg);
    filter: blur(5px);
  }
  18% {
    opacity: 1;
    transform: translateX(8px);
    filter: contrast(1.8);
  }
  32% {
    transform: translateX(-4px);
  }
  44% {
    transform: translateX(2px) skewX(5deg);
  }
  64%,
  100% {
    transform: translateX(0);
    filter: none;
  }
}

@keyframes glitchLayer {
  0%,
  86%,
  100% {
    opacity: 0;
  }
  88%,
  91% {
    opacity: 0.75;
  }
  93% {
    opacity: 0.28;
  }
}

@media (max-width: 900px) {
  .auth-grid,
  .feed-layout,
  .admin-layout,
  .split {
    grid-template-columns: 1fr;
  }

  .grid,
  .gear-grid,
  .video-grid,
  .status-strip,
  .widget-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: calc(100% - 16px);
    padding-top: 8px;
  }

  .device-frame {
    border-radius: 22px;
  }

  .grid,
  .gear-grid,
  .video-grid,
  .status-strip,
  .widget-grid {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    min-height: 420px;
  }

  .nav button {
    flex: 1 1 44%;
  }

  #mapCanvas,
  .fallback-map {
    min-height: 360px;
  }
}
