:root {
  color-scheme: light;
  --bg: #eef1f4;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --line: #cfd6dd;
  --line-strong: #97a3ad;
  --text: #1f252b;
  --muted: #66727d;
  --green: #16784f;
  --green-soft: #d8f1e5;
  --amber: #a76c00;
  --amber-soft: #fff0ce;
  --red: #b21f2d;
  --red-soft: #ffe0e3;
  --ink: #15191d;
  --focus: #2164a5;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-user-select: none;
  user-select: none;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
:fullscreen body,
:-webkit-full-screen body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

:fullscreen .app-shell,
:-webkit-full-screen .app-shell {
  width: 100vw;
  min-height: 100vh;
}

:fullscreen .mobile-shell,
:-webkit-full-screen .mobile-shell {
  max-height: 100vh;
}


button,
input {
  font: inherit;
}

button {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  border-radius: 6px;
  min-height: 38px;
  padding: 0 12px;
  cursor: pointer;
}

button:hover {
  border-color: var(--ink);
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 28%, transparent);
  outline-offset: 2px;
}

button.primary {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

#connectButton.hidden {
  display: none !important;
}

.qr-activation {
  display: grid;
  gap: 12px;
}

.qr-activation-compact {
  gap: 8px;
}

.qr-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.qr-actions-compact {
  grid-template-columns: 1fr auto auto auto auto auto;
  align-items: stretch;
}

.qr-file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}

.qr-file-button:focus,
.qr-file-button:focus-within,
.qr-file-button:hover {
  border-color: var(--ink);
  outline: 3px solid color-mix(in srgb, var(--focus) 28%, transparent);
  outline-offset: 2px;
}

.qr-scanner-panel {
  display: grid;
  gap: 8px;
}

.qr-scanner-compact {
  gap: 6px;
}

.qr-video-wrap {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #0b0f13;
  aspect-ratio: 1 / 1;
}

.qr-video-wrap-compact {
  aspect-ratio: 4 / 3;
  max-height: min(42vh, 300px);
}

.qr-video-wrap video,
.html5-qr-reader video,
.html5-qr-reader canvas {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  display: block;
}

.html5-qr-reader {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #0b0f13;
}

.html5-qr-reader > div {
  width: 100% !important;
  height: 100% !important;
}

.html5-qr-reader img,
.html5-qr-reader select,
.html5-qr-reader button,
.html5-qr-reader span {
  max-width: 100%;
}

.qr-target-frame {
  position: absolute;
  inset: 18%;
  border: 3px solid rgba(255, 255, 255, 0.9);
  border-radius: 18px;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.28);
  pointer-events: none;
}

.qr-target-frame-compact {
  inset: 17% 20%;
  border-width: 2px;
  border-radius: 14px;
}

.qr-method-pill {
  position: absolute;
  left: 8px;
  bottom: 8px;
  max-width: calc(100% - 16px);
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.64);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  pointer-events: none;
}

.qr-status-compact {
  margin: 0;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 13px;
  line-height: 1.35;
}

.qr-guide-line {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}


.qr-ios-help {
  padding: 9px 10px;
  border: 1px solid color-mix(in srgb, var(--focus) 42%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--focus) 12%, var(--surface-2));
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
}

.qr-ios-help strong {
  font-weight: 800;
}

.activation-field-compact {
  gap: 4px;
}

.qr-target-frame::before,
.qr-target-frame::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  height: 2px;
  background: rgba(255, 255, 255, 0.72);
}

.qr-target-frame::before {
  top: 50%;
}

.qr-target-frame::after {
  transform: rotate(90deg);
  top: 50%;
}

@media (max-width: 560px) {
  .qr-actions-compact {
    grid-template-columns: 1fr 1fr;
  }

  .qr-actions-compact > * {
    min-width: 0;
  }

  .qr-video-wrap-compact {
    max-height: 240px;
  }
}

.shell {
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  display: grid;
  gap: 12px;
  box-shadow: 0 18px 40px rgba(31, 37, 43, 0.08);
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.05;
}

h2 {
  font-size: 15px;
}

.field {
  display: grid;
  gap: 6px;
}

.field span,
.meta-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

input {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  min-height: 40px;
  padding: 0 11px;
  color: var(--text);
  background: var(--surface);
}

.quick-tokens {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.status-line {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
}

.app-view {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto auto 1fr;
}

.topbar {
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(140px, 220px) 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 12px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand-block {
  display: grid;
  gap: 2px;
}

.top-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
}

.top-meta > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.top-meta strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.connection-badge {
  min-width: 86px;
  text-align: center;
  border-radius: 999px;
  padding: 7px 10px;
  background: var(--red-soft);
  color: var(--red);
  border: 1px solid color-mix(in srgb, var(--red) 35%, transparent);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0;
}

.connection-badge.online {
  background: var(--green-soft);
  color: var(--green);
  border-color: color-mix(in srgb, var(--green) 35%, transparent);
}

.connection-badge.degraded {
  background: var(--amber-soft, #fff0ce);
  color: var(--amber, #a76c00);
  border-color: color-mix(in srgb, var(--amber, #a76c00) 35%, transparent);
}

.frequency-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.frequency {
  flex: 0 0 auto;
  min-width: 210px;
  display: grid;
  gap: 2px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.frequency strong {
  font-size: 13px;
}

.frequency span {
  color: var(--muted);
  font-size: 12px;
}

.workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(320px, 1fr) minmax(230px, 300px);
  grid-template-rows: 1fr 220px;
  grid-template-areas:
    "groups ptt users"
    "events events events";
  gap: 12px;
  padding: 12px;
}

.panel {
  min-height: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  overflow: hidden;
}

.panel-head {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.panel-head span {
  color: var(--muted);
  font-weight: 800;
}

.talkgroups-panel {
  grid-area: groups;
  grid-template-rows: auto 1fr;
}

.ptt-panel {
  grid-area: ptt;
  grid-template-rows: auto 1fr auto auto auto auto;
}

.users-panel {
  grid-area: users;
  grid-template-rows: auto 1fr;
}

.event-panel {
  grid-area: events;
  grid-template-rows: auto 1fr;
}

.groups-list,
.users-list,
.event-log {
  overflow: auto;
}

.group-button,
.user-row {
  width: 100%;
  min-height: 62px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  text-align: left;
}

.group-button:hover,
.user-row:hover {
  background: var(--surface-2);
}

.group-button.active {
  border-left: 5px solid var(--green);
  background: var(--green-soft);
  padding-left: 7px;
}

.group-line,
.user-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.group-meta,
.user-meta {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.security-pill {
  min-width: 32px;
  text-align: center;
  border-radius: 999px;
  background: var(--amber-soft);
  color: var(--amber);
  padding: 3px 7px;
  font-size: 12px;
  font-weight: 800;
}

.active-call {
  display: grid;
  gap: 4px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.active-call strong {
  font-size: clamp(26px, 5vw, 46px);
  line-height: 1;
}

.active-call span:last-child {
  min-height: 20px;
  color: var(--muted);
}

.ptt-stage {
  display: grid;
  grid-template-columns: minmax(180px, 320px) minmax(84px, 120px);
  justify-content: center;
  align-content: center;
  gap: 16px;
  padding: 18px;
}

.ptt-button {
  aspect-ratio: 1;
  width: min(320px, 58vw);
  border-radius: 50%;
  background: var(--green);
  border-color: color-mix(in srgb, var(--green) 75%, #000);
  color: #fff;
  font-size: 44px;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: inset 0 -12px 0 rgba(0, 0, 0, 0.12), 0 18px 32px rgba(22, 120, 79, 0.22);
  touch-action: none;
}

.ptt-button.pending {
  background: var(--amber);
}

.ptt-button.transmitting {
  background: var(--red);
  border-color: color-mix(in srgb, var(--red) 75%, #000);
  box-shadow: inset 0 -12px 0 rgba(0, 0, 0, 0.12), 0 18px 32px rgba(178, 31, 45, 0.24);
}

.ptt-button:disabled {
  background: #8c969f;
  border-color: #737d86;
  cursor: not-allowed;
  box-shadow: inset 0 -12px 0 rgba(0, 0, 0, 0.1);
}

.emergency-button {
  align-self: center;
  height: min(150px, 35vw);
  background: var(--red-soft);
  border-color: color-mix(in srgb, var(--red) 45%, transparent);
  color: var(--red);
  font-weight: 900;
}

.meter-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-weight: 800;
}

.meter {
  height: 10px;
  background: #d9dee4;
  border-radius: 999px;
  overflow: hidden;
  transition: opacity 120ms ease;
}

.meter.inactive {
  opacity: 0.38;
}

.meter-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--amber), var(--red));
}

.rx-fill {
  background: linear-gradient(90deg, var(--focus), var(--green), var(--amber));
}

.meter-status {
  min-width: 82px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-align: right;
}

.meter-status.muted {
  color: var(--red);
}

.meter-mode {
  min-height: 32px;
  min-width: 82px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  padding: 0 10px;
}

.meter-mode[aria-checked="true"] {
  background: var(--green-soft);
  border-color: color-mix(in srgb, var(--green) 45%, transparent);
  color: var(--green);
}

.direct-call {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
  padding: 12px 18px;
}

.sds-call {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
  padding: 0 18px 18px;
}

.user-row {
  cursor: pointer;
}

.user-row.local {
  background: var(--surface-2);
}

.event-log {
  list-style: none;
  margin: 0;
  padding: 0;
}

.event-log li {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.event-log time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.event-entry-body {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.event-entry-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.event-entry-location {
  color: var(--muted);
  font-size: 12px;
}

.event-entry-image {
  width: min(100%, 260px);
  max-height: 220px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.18);
}

.desktop-client {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto auto 1fr;
}

.mobile-client {
  display: none;
}

.mobile-shell {
  min-height: 100vh;
  min-height: 100dvh;
  background: #111;
  display: flex;
  justify-content: center;
  align-items: stretch;
  touch-action: manipulation;
}

.mobile-screen {
  width: min(100vw, 420px);
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  --mobile-display-min: clamp(320px, 42dvh, 440px);
  --mobile-controls-min: clamp(176px, 27dvh, 240px);
  --mobile-nav-min: calc(clamp(54px, 7.2dvh, 66px) + env(safe-area-inset-bottom, 0px));
  background-color: #1a1c20;
  color: #fff;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  touch-action: manipulation;
}

.mobile-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url('data:image/svg+xml;utf8,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noise"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="1.2" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noise)" opacity="0.12"/%3E%3C/svg%3E');
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 0;
}

.mobile-client .status-bar,
.mobile-client .header,
.mobile-client .view-container,
.mobile-client .hardware-controls,
.mobile-client .bottom-nav,
.mobile-summary {
  position: relative;
  z-index: 1;
}

.mobile-screen.emergency-active {
  animation: mobileEmergencyFrame 0.9s linear infinite;
}

@keyframes mobileEmergencyFrame {
  0%,
  100% {
    box-shadow: inset 0 0 0 2px rgba(211, 56, 51, 0.28), inset 0 0 24px rgba(211, 56, 51, 0.06);
  }

  50% {
    box-shadow: inset 0 0 0 4px rgba(211, 56, 51, 0.92), inset 0 0 38px rgba(211, 56, 51, 0.18);
  }
}

.mobile-client .status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: max(12px, env(safe-area-inset-top, 0px)) 18px 8px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

.status-icons {
  display: flex;
  align-items: center;
  gap: 10px;
}

.battery-status {
  display: flex;
  align-items: center;
  color: #e9ecde;
  margin-right: 2px;
}

.battery-shell {
  width: 22px;
  height: 11px;
  border: 1.5px solid currentColor;
  border-radius: 3px;
  position: relative;
  padding: 1px;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.28);
}

.battery-shell::after {
  content: "";
  position: absolute;
  right: -4px;
  top: 2.5px;
  width: 2.5px;
  height: 5px;
  border-radius: 0 2px 2px 0;
  background: currentColor;
}

.battery-level {
  height: 100%;
  width: 50%;
  border-radius: 1.5px;
  background: currentColor;
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.14);
  transition: width 0.2s ease, background-color 0.2s ease, opacity 0.2s ease;
}

.battery-status.medium {
  color: #d49e24;
}

.battery-status.low {
  color: #d33833;
}

.battery-status.charging {
  color: #30a54a;
}

.signal-status {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 13px;
  color: #e9ecde;
}

.signal-bar {
  width: 3.5px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.16;
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.08);
  transition: opacity 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.signal-bar:nth-child(1) {
  height: 4px;
}

.signal-bar:nth-child(2) {
  height: 7px;
}

.signal-bar:nth-child(3) {
  height: 10px;
}

.signal-status.level-1 .signal-bar:nth-child(1),
.signal-status.level-2 .signal-bar:nth-child(-n+2),
.signal-status.level-3 .signal-bar {
  opacity: 1;
}

.signal-status.good {
  color: #e9ecde;
}

.signal-status.medium {
  color: #d49e24;
}

.signal-status.low {
  color: #d33833;
}

.signal-status.offline {
  color: rgba(255, 255, 255, 0.55);
}

.camera-hole {
  position: absolute;
  top: max(15px, env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #000;
  box-shadow: inset 0 0 4px rgba(255, 255, 255, 0.2);
}

.mobile-client .header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 18px 6px;
}

/* Extra luft mellan status-/logotyp-raden och informationsraden under. */
.mobile-client .header + .mobile-summary {
  padding-top: 10px;
}

.header-pill {
  min-width: 68px;
  text-align: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid transparent;
}

.pill-connection {
  background: rgba(211, 56, 51, 0.15);
  color: #d33833;
  border-color: rgba(211, 56, 51, 0.3);
}

.pill-connection.online {
  background: rgba(48, 165, 74, 0.15);
  color: #30a54a;
  border-color: rgba(48, 165, 74, 0.3);
}

.pill-connection.degraded {
  background: rgba(212, 158, 36, 0.16);
  color: #d49e24;
  border-color: rgba(212, 158, 36, 0.34);
}

.pill-status {
  background: rgba(255, 255, 255, 0.1);
  color: #9e9f95;
  border-color: rgba(255, 255, 255, 0.2);
  transition: all 0.2s;
}

.pill-status.rx {
  background: rgba(212, 158, 36, 0.15);
  color: #d49e24;
  border-color: rgba(212, 158, 36, 0.3);
}

.pill-status.tx {
  background: rgba(211, 56, 51, 0.15);
  color: #d33833;
  border-color: rgba(211, 56, 51, 0.3);
}

.logo {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: min(300px, calc(100% - 176px));
  min-width: 92px;
  height: 28px;
  color: #fff;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 24px;
  line-height: 28px;
  letter-spacing: -0.5px;
  text-align: center;
  text-transform: lowercase;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.client-logo-image {
  display: block;
  max-height: 28px;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.client-logo-fallback {
  display: block;
  line-height: 28px;
}

.logo.has-custom-logo .client-logo-fallback {
  display: none;
}

.mobile-summary {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  padding: 0 18px 8px;
  color: #9e9f95;
  font-size: 9px;
  font-weight: 700;
}

.mobile-summary span {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-emergency-banner {
  position: absolute;
  top: 116px;
  left: 20px;
  right: 20px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(211, 56, 51, 0.28);
  background: linear-gradient(145deg, rgba(94, 18, 24, 0.82) 0%, rgba(53, 11, 15, 0.88) 100%);
  color: #fff4f4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.24), inset 0 1px 1px rgba(255, 255, 255, 0.06);
  z-index: 4;
  pointer-events: none;
}

.mobile-emergency-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.mobile-emergency-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 211, 211, 0.8);
}

.mobile-emergency-copy strong {
  font-size: 22px;
  line-height: 1;
}

.mobile-emergency-copy span:last-child {
  font-size: 11px;
  color: rgba(255, 232, 232, 0.86);
}

.mobile-emergency-hold {
  flex: 0 0 auto;
}

.hold-ring {
  --hold-progress: 1;
  --hold-color: #d33833;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  position: relative;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--hold-color) calc(var(--hold-progress) * 1turn), rgba(255, 255, 255, 0.08) 0turn);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.32);
}

.hold-ring::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: #1a1c20;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.7);
}

.hold-ring span {
  position: relative;
  z-index: 1;
  font-size: 21px;
  font-weight: 900;
  color: #fff;
}

.hold-ring-green {
  --hold-color: #30a54a;
}

.hold-ring-red {
  --hold-color: #d33833;
}

.mobile-client .view-container {
  flex: 1 1 var(--mobile-display-min);
  min-height: 0;
  min-block-size: var(--mobile-display-min);
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 6px;
  scrollbar-gutter: stable;
  font-family: "Segoe UI", "Aptos", "Helvetica Neue", Arial, sans-serif;
  color: #e4e8db;
}

.mobile-client .view-container::-webkit-scrollbar {
  width: 3px;
}

.mobile-client .view-container::-webkit-scrollbar-track {
  background: transparent;
}

.mobile-client .view-container::-webkit-scrollbar-thumb {
  background: rgba(187, 198, 137, 0.2);
  border-radius: 999px;
}

.mobile-client .view {
  display: none;
  flex-direction: column;
  min-height: 100%;
  padding: 0 18px;
  animation: fadeIn 0.2s ease-in-out;
}

.mobile-client .view.active {
  display: flex;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.talkgroup-card {
  background:
    radial-gradient(circle at 1px 1px, rgba(192, 206, 142, 0.08) 1px, transparent 0) 0 0 / 6px 6px,
    linear-gradient(145deg, rgba(71, 78, 51, 0.94) 0%, rgba(48, 55, 35, 0.96) 100%);
  border-radius: 20px;
  color: #e0e8b8;
  display: flex;
  flex-direction: column;
  margin-bottom: 6px;
  border: 1px solid rgba(191, 202, 139, 0.18);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(232, 241, 192, 0.06);
  backdrop-filter: blur(5px);
}

.talkgroup-card,
.talkgroup-card *,
.meter-cluster,
.meter-cluster *,
.mobile-emergency-banner,
.mobile-emergency-banner * {
  font-family: "Lucida Console", "Courier New", monospace;
  letter-spacing: 0.03em;
}

.card-content {
  padding: 16px 16px 14px;
}

.tg-label {
  margin-bottom: 3px;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: rgba(196, 205, 155, 0.68);
  text-transform: uppercase;
}

.tg-name {
  margin-bottom: 3px;
  font-size: clamp(24px, 7.5vw, 32px);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-shadow: 0 0 6px rgba(212, 223, 155, 0.12);
  line-height: 1.05;
}

.tg-desc {
  font-size: 12px;
  line-height: 1.2;
  color: rgba(214, 221, 170, 0.92);
}

.dynamic-action-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid rgba(191, 202, 139, 0.16);
  background: rgba(18, 24, 12, 0.28);
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
}

.action-btn {
  border: 0;
  border-radius: 0;
  min-height: 70px;
  background: transparent;
  color: #dbe2b5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 4px;
  font-size: 10.5px;
  font-weight: 800;
  opacity: 0.86;
}

.action-icon {
  width: 36px;
  height: 36px;
}

.action-btn:hover {
  opacity: 1;
  background: rgba(207, 219, 151, 0.06);
}

.action-btn.danger {
  color: #ff8e8a;
}

.meter-container {
  padding: 0 2px;
  margin-top: 0;
  margin-bottom: 14px;
}

.meter-cluster {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: stretch;
}

.meter-stack {
  display: grid;
  min-width: 0;
}

.compact-meter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  padding: 0;
  border-top: 0;
  color: #aeb68a;
  font-size: 10px;
  font-weight: 800;
}

.compact-meter-row:last-child {
  margin-bottom: 0;
}

.meter-track {
  flex: 1;
  height: 6px;
  background: rgba(216, 226, 172, 0.1);
  border-radius: 999px;
  overflow: hidden;
}

.meter-fill.tx {
  background: linear-gradient(90deg, #30a54a, #d49e24, #d33833);
}

.meter-fill.rx {
  background: linear-gradient(90deg, #2a84d2, #30a54a);
}

.mobile-panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.075) 0%, rgba(255, 255, 255, 0.03) 100%);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.secondary-panel {
  margin-top: 8px;
}

.compact-panel {
  border-radius: 13px;
}

.fill-panel {
  flex: 1 1 auto;
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 0;
}

.mobile-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
}

.mobile-panel-head h2,
.mobile-panel-head span {
  color: #f1f3ea;
  font-size: 11px;
  line-height: 1.1;
}

.mobile-panel-head span {
  color: #b9c1b3;
  font-weight: 800;
}

.mobile-panel-head button {
  min-height: 30px;
  border-radius: 999px;
  border-color: rgba(188, 198, 146, 0.14);
  background: rgba(218, 228, 172, 0.04);
  color: #dbe2b5;
}

.mobile-list {
  display: grid;
}

.mobile-list-item {
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  background: transparent;
  color: #edf1e6;
  padding: 8px 10px;
  text-align: left;
}

.mobile-list-item:last-child {
  border-bottom: 0;
}

.mobile-list-item.active {
  background: rgba(84, 129, 187, 0.14);
}

.mobile-list-item.local {
  background: rgba(255, 255, 255, 0.035);
}

.mobile-list-primary {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.mobile-list-primary strong {
  display: block;
  margin-bottom: 1px;
  font-size: 11px;
  line-height: 1.1;
}

.list-item-meta {
  color: #a9b0a4;
  font-size: 9px;
  line-height: 1.1;
}

.mobile-list-status {
  color: #dfe7da;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.compact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.compact-cell {
  min-width: 0;
  padding: 8px 9px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.compact-cell:nth-child(odd) {
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.compact-label {
  display: block;
  margin-bottom: 2px;
  color: #9aa59a;
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.compact-cell strong {
  display: block;
  color: #f1f4ee;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slim-head {
  min-height: 32px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.compact-list .mobile-list-item {
  min-height: 0;
  padding-top: 6px;
  padding-bottom: 6px;
}

.compact-list .mobile-list-primary strong {
  font-size: 10px;
}

.mobile-event-log li {
  grid-template-columns: 62px 1fr;
  padding: 5px 8px;
  border-bottom-color: rgba(188, 198, 146, 0.08);
  color: #dbe2b5;
  font-size: 9px;
  line-height: 1.2;
}

.mobile-compose-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 10px;
}

.mobile-field {
  color: #e3e8de;
}

.mobile-field input {
  border-color: rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.045);
  color: #f1f4ee;
  font-family: inherit;
  padding-top: 7px;
  padding-bottom: 7px;
}

.mobile-help-text {
  margin: -2px 0 0;
  color: rgba(219, 226, 181, 0.76);
  font-size: 10px;
  line-height: 1.35;
}

.mobile-call-panel,
.mobile-sds-panel {
  align-content: start;
}

.mobile-field input::placeholder {
  color: #91998d;
}

.mobile-inline-button {
  align-self: end;
  min-height: 34px;
  border-radius: 10px;
  border-color: rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.055);
  color: #edf1e6;
  font-size: 10px;
}

.image-panel {
  overflow: hidden;
}

.image-open-button {
  width: 100%;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.image-stage {
  position: relative;
  min-height: 116px;
  max-height: 136px;
  background: radial-gradient(circle at 50% 20%, rgba(56, 66, 84, 0.2), rgba(13, 16, 21, 0.92));
}

.image-stage::after {
  content: "Tryck för fullskarm";
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(7, 10, 14, 0.78);
  border: 1px solid rgba(225, 232, 201, 0.18);
  color: #dce4b8;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.image-preview {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 116px;
  max-height: 136px;
  object-fit: cover;
  background: #090b0e;
}

.image-viewer {
  position: absolute;
  inset: 0;
  z-index: 90;
  padding: max(14px, env(safe-area-inset-top, 0px)) 12px max(16px, env(safe-area-inset-bottom, 0px));
  background: rgba(3, 5, 7, 0.985);
  backdrop-filter: blur(10px);
  touch-action: none;
}

.image-viewer-close {
  position: absolute;
  top: max(14px, env(safe-area-inset-top, 0px));
  right: 12px;
  z-index: 2;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(221, 229, 196, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: #eef3d8;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.image-viewer-body {
  position: relative;
  height: 100%;
  min-height: 0;
  display: block;
}

.image-viewer-meta {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 12px;
  z-index: 1;
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(8, 11, 15, 0.72) 0%, rgba(8, 11, 15, 0.92) 100%);
  border: 1px solid rgba(220, 228, 193, 0.16);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.34);
  color: #b7c08f;
}

.image-viewer-meta strong {
  color: #f1f4e2;
  font-size: 13px;
  letter-spacing: 0.02em;
}

.image-viewer-meta span {
  color: #b3bd89;
  font-size: 10px;
  font-weight: 700;
}

.image-viewer-preview {
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: 0;
  object-fit: contain;
  background: #050709;
  box-shadow: inset 0 0 0 1px rgba(222, 230, 195, 0.08);
}

.camera-panel {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

#view-camera {
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.camera-head button {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #edf1e6;
  font-size: 10px;
}

.camera-stage {
  position: relative;
  min-height: 0;
  height: 100%;
  background: radial-gradient(circle at 50% 20%, rgba(56, 66, 84, 0.35), rgba(13, 16, 21, 0.98));
  overflow: hidden;
}

.camera-preview,
.camera-empty {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.camera-preview {
  display: block;
  object-fit: cover;
  background: #090b0e;
}

.camera-empty {
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 24px 24px 116px;
  text-align: center;
  color: #eef2fb;
}

.camera-empty span {
  max-width: 28ch;
  color: #c5cfdf;
  font-size: 11px;
  line-height: 1.35;
}

.camera-overlay {
  position: absolute;
  inset: auto 0 0;
  z-index: 2;
  display: grid;
  gap: 12px;
  justify-items: center;
  padding: 16px 16px 18px;
  background: linear-gradient(180deg, transparent 0%, rgba(8, 10, 14, 0.3) 18%, rgba(8, 10, 14, 0.88) 100%);
}

.camera-meta {
  display: grid;
  gap: 4px;
  justify-items: center;
  color: #f6f8fc;
  text-align: center;
}

.camera-meta span:last-child {
  color: #d5dce8;
  font-size: 10px;
}

.camera-capture-button {
  width: 68px;
  height: 68px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.12);
  display: grid;
  place-items: center;
  flex: 0 0 68px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
}

.camera-capture-button:disabled {
  opacity: 0.45;
}

.camera-capture-button.hold-active {
  transform: scale(0.96);
  background: rgba(211, 56, 51, 0.2);
}

.camera-capture-core {
  width: 52px;
  height: 52px;
  display: block;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(227, 231, 237, 0.88) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.full-width {
  grid-column: 1 / -1;
}

.mobile-event-log {
  overflow: auto;
}

.mobile-event-log li {
  grid-template-columns: 68px 1fr;
  border-bottom-color: rgba(188, 198, 146, 0.08);
  color: #dbe2b5;
}

.mobile-event-log time {
  color: #9ea676;
}

.meter-mini-toggle {
  min-width: 44px;
  min-height: 30px;
  padding: 0 10px;
  align-self: center;
  border-radius: 10px;
  border-color: rgba(188, 198, 146, 0.18);
  background: rgba(216, 226, 172, 0.05);
  color: #dbe2b5;
  font-family: "Lucida Console", "Courier New", monospace;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.quickstatus-panel,
.quickstatus-panel * {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

.quickstatus-panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, rgba(241, 245, 250, 0.045) 100%);
  border-color: rgba(255, 255, 255, 0.14);
}

.quickstatus-panel .mobile-panel-head {
  background: rgba(255, 255, 255, 0.05);
}

.quickstatus-panel .mobile-panel-head h2 {
  color: #f7f8fc;
}

.quickstatus-panel .mobile-panel-head span {
  color: #c9d0dd;
}

.quickstatus-panel .compact-grid {
  grid-template-columns: 1fr 1fr;
}

.quickstatus-panel .compact-cell {
  padding: 9px 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035) 0%, rgba(255, 255, 255, 0.015) 100%);
}

.quickstatus-panel .compact-label {
  margin-bottom: 3px;
  color: #97a1b5;
  font-size: 8px;
  letter-spacing: 0.08em;
}

.quickstatus-panel .compact-cell strong {
  color: #fbfcff;
  font-size: 11px;
}

.meter-mini-toggle[aria-checked="true"] {
  background: rgba(205, 218, 148, 0.12);
  border-color: rgba(205, 218, 148, 0.28);
  color: #eef5c9;
}

.settings-panel {
  min-height: 0;
}

.lcd-head h2,
.lcd-head span {
  font-family: "Lucida Console", "Courier New", monospace;
  letter-spacing: 0.03em;
}

.settings-list {
  display: grid;
}

.settings-row {
  width: 100%;
  min-height: 58px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  background: transparent;
  color: #edf1e6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 11px;
  text-align: left;
}

.settings-row:last-child {
  border-bottom: 0;
}

.settings-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.settings-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.settings-copy strong {
  font-size: 11px;
  color: #f1f4ee;
}

.settings-copy span {
  font-size: 9px;
  color: #a9b0a4;
  line-height: 1.15;
}

.lcd-toggle {
  width: 46px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid rgba(220, 68, 68, 0.38);
  background: rgba(92, 18, 18, 0.34);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.32);
  position: relative;
  flex: 0 0 auto;
}

.lcd-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #e34b4b;
  box-shadow: 0 0 8px rgba(227, 75, 75, 0.34);
  transition: transform 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.settings-row[aria-checked="true"] .lcd-toggle {
  background: rgba(39, 174, 96, 0.18);
  border-color: rgba(39, 174, 96, 0.46);
}

.settings-row[aria-checked="true"] .lcd-toggle-thumb {
  transform: translateX(22px);
  background: #2ecc71;
  box-shadow: 0 0 10px rgba(46, 204, 113, 0.38);
}

.settings-row.logout-row {
  border-top: 1px solid rgba(171, 197, 139, 0.14);
}

.settings-row.logout-row:hover {
  background: rgba(171, 197, 139, 0.08);
}

.settings-row.logout-row .settings-copy strong {
  color: #f2f7e8;
}

.settings-row.logout-row .settings-copy span {
  color: #bdc7b2;
}

.settings-row.danger-row {
  border-top: 1px solid rgba(255, 120, 96, 0.16);
  color: #fff1ec;
}

.settings-row.danger-row:hover {
  background: rgba(255, 120, 96, 0.08);
}

.settings-row.danger-row .settings-copy strong {
  color: #fff1ec;
}

.settings-row.danger-row .settings-copy span {
  color: #d9b7ad;
}

.settings-action {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 120, 96, 0.3);
  border-radius: 999px;
  padding: 5px 10px;
  color: #ffd6cc;
  background: rgba(255, 120, 96, 0.08);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.hardware-controls {
  flex-shrink: 0;
  padding: 16px 20px 10px;
  min-height: var(--mobile-controls-min);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}

.row-primary {
  display: flex;
  flex: 1 1 auto;
  justify-content: space-between;
  align-items: stretch;
  min-height: 0;
  height: auto;
  gap: 12px;
}

.hw-btn {
  background: linear-gradient(180deg, rgba(24, 25, 28, 0.8) 0%, rgba(13, 15, 17, 0.8) 100%);
  border: 1px solid #232528;
  border-radius: 16px;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  padding: 0 10px;
  backdrop-filter: blur(4px);
}

.hw-btn:active {
  transform: scale(0.97);
}

.btn-call,
.btn-end {
  flex: 0 0 70px;
  border-radius: 20px;
}

.btn-call {
  color: #30a54a;
}

.btn-call.alarm-ack {
  background: linear-gradient(180deg, rgba(28, 62, 40, 0.94) 0%, rgba(15, 31, 20, 0.92) 100%);
  border-color: rgba(48, 165, 74, 0.46);
  color: #9ff0b2;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(48, 165, 74, 0.15);
}

.btn-end {
  color: #d33833;
}

.btn-end.hold-active,
.btn-call.hold-active {
  transform: scale(0.97);
}

.mobile-client .btn-ptt {
  flex: 1 1 auto;
  border-radius: 24px;
  position: relative;
  border: 1px solid #1a1c20;
  background: rgba(30, 32, 36, 0.6);
  overflow: hidden;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.6), inset 0 2px 2px rgba(255, 255, 255, 0.05);
  transition: all 0.2s ease;
}

.mobile-client .btn-ptt::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 20px;
  background-image: url('data:image/svg+xml;utf8,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noisePTT"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="1.5" numOctaves="4" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noisePTT)" opacity="0.18"/%3E%3C/svg%3E');
  box-shadow: inset 0 5px 15px rgba(0, 0, 0, 0.9);
  pointer-events: none;
  transition: background-color 0.18s ease, box-shadow 0.18s ease;
}

.mobile-client .btn-ptt.state-ready {
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.6), inset 0 2px 2px rgba(255, 255, 255, 0.05), 0 0 0 2px rgba(48, 165, 74, 0.4);
}

.mobile-client .btn-ptt.state-ready::before {
  background-color: rgba(48, 165, 74, 0.05);
  box-shadow: inset 0 5px 15px rgba(0, 0, 0, 0.9);
}

.mobile-client .btn-ptt.state-rx {
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.6), inset 0 2px 2px rgba(255, 255, 255, 0.05), 0 0 0 2px rgba(212, 158, 36, 0.6);
}

.mobile-client .btn-ptt.state-rx::before {
  background-color: rgba(212, 158, 36, 0.1);
  box-shadow: inset 0 5px 15px rgba(0, 0, 0, 0.9);
}

.mobile-client .btn-ptt.state-tx {
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.6), inset 0 2px 2px rgba(255, 255, 255, 0.05), 0 0 0 2px rgba(211, 56, 51, 0.8);
  transform: scale(0.98);
}

.mobile-client .btn-ptt.state-tx::before {
  background-color: rgba(211, 56, 51, 0.15);
  box-shadow: inset 0 8px 20px rgba(0, 0, 0, 0.9);
}

.mobile-client .btn-ptt:disabled {
  opacity: 0.55;
}

.ptt-text {
  position: relative;
  z-index: 1;
  font-size: 42px;
  font-weight: 900;
  letter-spacing: 2.8px;
  color: #9ea59f;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.035),
    0 -1px 1px rgba(0, 0, 0, 0.92);
  -webkit-user-select: none;
  user-select: none;
  pointer-events: none;
}

.mobile-client .btn-ptt.state-ready .ptt-text {
  color: #2a332c;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.03), 0 -1px 1px rgba(0, 0, 0, 0.9);
}

.mobile-client .btn-ptt.state-rx .ptt-text {
  color: #3b311b;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.025), 0 -1px 1px rgba(0, 0, 0, 0.9);
}

.mobile-client .btn-ptt.state-tx .ptt-text {
  color: #4a1c1a;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.02), 0 -1px 1px rgba(0, 0, 0, 0.92);
}

.app-icon {
  width: 1em;
  height: 1em;
  display: inline-block;
  fill: currentColor;
  flex-shrink: 0;
}

.bottom-nav {
  display: flex;
  justify-content: space-around;
  min-height: var(--mobile-nav-min);
  margin-top: 18px;
  padding: 5px 8px calc(8px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.bottom-nav .nav-item {
  border: 0;
  background: transparent;
  min-height: 38px;
  padding: 0 8px;
  border-radius: 0;
  color: #9e9f95;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 8.5px;
  line-height: 1;
  letter-spacing: 0.02em;
  position: relative;
}

.bottom-nav .nav-icon {
  width: 19px;
  height: 19px;
}

.hw-icon {
  width: 24px;
  height: 24px;
}

.bottom-nav .nav-item.active {
  color: #2a84d2;
}

.bottom-nav .nav-item.active::after {
  content: "";
  position: absolute;
  bottom: -7px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 2px;
  background: #2a84d2;
  border-radius: 2px;
  box-shadow: 0 -2px 10px rgba(42, 132, 210, 0.9);
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .top-meta {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .workspace {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto 220px;
    grid-template-areas:
      "ptt"
      "groups"
      "users"
      "events";
  }

  .ptt-stage {
    grid-template-columns: minmax(160px, 260px) minmax(78px, 110px);
  }
}

@media (max-width: 700px) {
  body {
    background: #111;
  }

  .app-view {
    display: block;
    min-height: 100vh;
    min-height: 100dvh;
    background: #111;
  }

  .mobile-client {
    display: block;
  }

  .desktop-client {
    display: none;
  }
}

@media (max-width: 560px) {
  .mobile-shell {
    justify-content: stretch;
  }

  .mobile-screen {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
  }

  .mobile-client .view {
    padding: 0 14px;
  }

  .compact-cell {
    padding-left: 10px;
    padding-right: 10px;
  }

  .mobile-summary,
  .mobile-client .header,
  .mobile-client .status-bar,
  .hardware-controls {
    padding-left: 14px;
    padding-right: 14px;
  }

  .row-primary {
    min-height: clamp(168px, 26dvh, 208px);
  }

  .mobile-compose-panel {
    grid-template-columns: 1fr;
  }

  .topbar {
    padding: 10px;
  }

  .top-meta {
    grid-template-columns: 1fr;
  }

  .workspace {
    padding: 8px;
    gap: 8px;
  }

  .ptt-stage {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .emergency-button {
    width: min(220px, 100%);
    height: 52px;
  }

  .direct-call {
    grid-template-columns: 1fr;
  }

  .sds-call {
    grid-template-columns: 1fr;
  }

  .meter-row {
    grid-template-columns: auto 1fr auto;
  }

  .meter-mode {
    grid-column: 2 / -1;
    justify-self: end;
  }
}

#wakeLockButton .settings-copy span {
  color: #c6ceb8;
}


.login-brand-preview {
  min-height: 110px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  margin: 18px 0 14px;
  overflow: hidden;
}

.login-brand-preview.has-custom-logo {
  background: rgba(255, 255, 255, 0.055);
}

.login-brand-image {
  display: block;
  max-width: min(320px, 100%);
  max-height: 170px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.login-brand-fallback {
  color: #fff;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: clamp(30px, 12vw, 54px);
  line-height: 1;
  letter-spacing: -1px;
  text-transform: lowercase;
}

.login-brand-preview.has-custom-logo .login-brand-fallback {
  display: none;
}

/* Beta: tydligare talgruppsväljare och mobil back-knapp. */
.group-selection-panel {
  min-height: 0;
}

.mobile-groups-list {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.mobile-group-item {
  padding: 14px 12px;
}

.mobile-group-item .mobile-list-primary {
  align-items: center;
}

.mobile-group-item .mobile-list-primary strong {
  margin-bottom: 4px;
  font-size: clamp(24px, 7.5vw, 30px);
  line-height: 1;
  letter-spacing: 0.02em;
  color: #f7faef;
}

.mobile-group-item .list-item-meta {
  font-size: 11px;
  line-height: 1.25;
  color: rgba(220, 228, 198, 0.78);
}

.mobile-group-item .mobile-list-status {
  align-self: center;
  padding: 6px 8px;
  border: 1px solid rgba(222, 232, 173, 0.16);
  border-radius: 999px;
  background: rgba(222, 232, 173, 0.06);
  font-size: 10px;
}

/* Beta: fast, toppjusterad talgruppsmodal med intern scroll och talgruppslogotyper. */
.mobile-client .view-container {
  overflow: hidden;
}

.mobile-client .view {
  min-height: 0;
  height: 100%;
}

#view-groups {
  justify-content: flex-start;
  align-items: stretch;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

#view-groups .group-selection-panel {
  align-self: stretch;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
}

#view-groups .mobile-panel-head {
  flex: 0 0 auto;
}

#view-groups .mobile-groups-list {
  display: block;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 18px;
}

.talkgroup-card-main {
  display: flex;
  align-items: stretch;
  min-width: 0;
}

.tg-logo-wrap {
  flex: 0 0 clamp(58px, 18vw, 86px);
  align-self: stretch;
  display: grid;
  place-items: center;
  margin: 12px 0 12px 12px;
  border-radius: 16px;
  background: rgba(5, 8, 11, 0.28);
  border: 1px solid rgba(224, 232, 190, 0.14);
  overflow: hidden;
}

.tg-logo-wrap.hidden {
  display: none;
}

.tg-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
}

.tg-logo.hidden {
  display: none;
}

.tg-logo-placeholder {
  width: 58%;
  height: 58%;
  color: #ffffff;
  fill: currentColor;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.35));
}

.tg-logo-placeholder.hidden {
  display: none;
}

.talkgroup-card-main .card-content {
  min-width: 0;
  flex: 1 1 auto;
}

.mobile-group-item .mobile-list-primary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.mobile-group-logo {
  width: clamp(48px, 15vw, 62px);
  height: clamp(48px, 15vw, 62px);
  object-fit: contain;
  border-radius: 12px;
  background: rgba(6, 9, 12, 0.32);
  border: 1px solid rgba(224, 232, 190, 0.15);
  padding: 4px;
}

.mobile-group-logo.talkgroup-logo-placeholder {
  display: grid;
  place-items: center;
}

.talkgroup-logo-placeholder-icon {
  width: 58%;
  height: 58%;
  color: #ffffff;
  fill: currentColor;
  opacity: 0.96;
}

.mobile-group-copy {
  min-width: 0;
}

.mobile-group-copy strong,
.mobile-group-copy .list-item-meta {
  overflow-wrap: anywhere;
}

/* Karta i mobilklienten. */
.mobile-map-panel {
  gap: 10px;
}

.mobile-map-canvas {
  min-height: 0;
}

.mobile-map-canvas .samband-map-shell {
  grid-template-columns: 1fr;
  gap: 8px;
}

.mobile-map-canvas .samband-map-stage,
.mobile-map-canvas .samband-map-svg {
  min-height: clamp(180px, 34dvh, 300px);
}

.mobile-map-canvas .samband-map-list {
  max-height: clamp(110px, 18dvh, 180px);
  border-radius: 14px;
}

.mobile-map-canvas .samband-map-list-item {
  padding: 7px;
}

.bottom-nav .nav-item span {
  white-space: nowrap;
}

/* Operativa mätvärden för PTT, media och failover. */
.desktop-metrics-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 18px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.32));
}

.desktop-metrics-strip div,
.metric-cell {
  min-width: 0;
  border: 1px solid rgba(151, 163, 173, 0.24);
  border-radius: 12px;
  background: rgba(21, 25, 29, 0.05);
  padding: 8px 10px;
}

.desktop-metrics-strip span,
.metric-label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.desktop-metrics-strip strong,
.metric-cell strong {
  display: block;
  color: var(--ink);
  font-family: "Lucida Console", "Courier New", monospace;
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.metrics-panel {
  margin: 10px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(9, 14, 11, 0.28);
}

.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 10px;
}

.metric-cell {
  background: rgba(0, 0, 0, 0.20);
  border-color: rgba(224, 232, 190, 0.12);
}

.metric-cell-wide {
  grid-column: 1 / -1;
}

.metric-cell .metric-label {
  color: #9aa59a;
  font-size: 8px;
}

.metric-cell strong {
  color: #f1f3ea;
  font-size: 10px;
}

/* SAMBAND DESKTOP/LANDSCAPE PTT DIRECT FIX BEGIN
   Gäller endast bred telefon-/tabletvy där klienten använder desktop-layout.
   Den smala/stående mobilterminalen under 700px påverkas inte. */
@media (min-width: 701px) and (orientation: landscape) and (max-height: 820px) {
  .desktop-client .ptt-panel {
    grid-template-rows: auto minmax(150px, 1fr) auto auto auto auto;
  }

  .desktop-client .ptt-stage {
    grid-template-columns: minmax(96px, 138px);
    justify-content: center;
    align-content: center;
    justify-items: center;
    gap: 0;
    padding: 10px 14px;
  }

  .desktop-client .ptt-button {
    width: clamp(96px, 18vh, 138px);
    max-width: 138px;
    font-size: clamp(20px, 4.4vh, 30px);
    box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.12), 0 8px 18px rgba(22, 120, 79, 0.18);
  }

  .desktop-client .ptt-button.transmitting {
    box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.12), 0 8px 18px rgba(178, 31, 45, 0.20);
  }

  .desktop-client .emergency-button {
    display: none !important;
  }
}
/* SAMBAND DESKTOP/LANDSCAPE PTT DIRECT FIX END */


/* SAMBAND RUNTIME TOASTS BEGIN
   Små drift-/behörighetsmeddelanden från servern. */
.toast-region {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10000;
  display: grid;
  gap: 10px;
  width: min(410px, calc(100vw - 32px));
  pointer-events: none;
}

.app-toast {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 12px;
  padding: 14px 14px 14px 16px;
  border: 1px solid color-mix(in srgb, var(--focus) 34%, var(--line));
  border-left: 6px solid var(--focus);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  color: var(--text);
  box-shadow: 0 18px 44px rgba(21, 25, 29, 0.24);
  pointer-events: auto;
  animation: toast-in 160ms ease-out;
}

.app-toast.success {
  border-color: color-mix(in srgb, var(--green) 34%, var(--line));
  border-left-color: var(--green);
  background: color-mix(in srgb, var(--green-soft) 28%, #ffffff);
}

.app-toast.warning {
  border-color: color-mix(in srgb, var(--amber) 38%, var(--line));
  border-left-color: var(--amber);
  background: color-mix(in srgb, var(--amber-soft) 42%, #ffffff);
}

.app-toast.error {
  border-color: color-mix(in srgb, var(--red) 38%, var(--line));
  border-left-color: var(--red);
  background: color-mix(in srgb, var(--red-soft) 36%, #ffffff);
}

.app-toast.closing {
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  transition: opacity 180ms ease, transform 180ms ease;
}

.app-toast-body {
  font-size: 13.5px;
  font-weight: 650;
  line-height: 1.38;
}

.app-toast-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  width: 30px;
  padding: 0;
  border-radius: 999px;
  border-color: color-mix(in srgb, var(--line-strong) 52%, transparent);
  background: rgba(255, 255, 255, 0.76);
  color: var(--muted);
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
}

.app-toast-close:hover {
  border-color: var(--ink);
  background: #ffffff;
  color: var(--ink);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 700px) {
  .toast-region {
    top: max(10px, env(safe-area-inset-top));
    right: 10px;
    left: 10px;
    width: auto;
  }
}
/* SAMBAND RUNTIME TOASTS END */

/* Runtime-logotyper hämtas on-demand så att signaltrafiken inte behöver bära bilddata. */
.group-button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.desktop-group-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 10px;
  background: rgba(6, 9, 12, 0.30);
  border: 1px solid rgba(224, 232, 190, 0.14);
  padding: 4px;
  flex: 0 0 auto;
}

.desktop-group-logo.talkgroup-logo-placeholder {
  display: grid;
  place-items: center;
}

.group-button-copy {
  min-width: 0;
}

.mobile-idle-brand-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: end center;
  padding: max(54px, env(safe-area-inset-top, 0px) + 42px) 22px max(88px, env(safe-area-inset-bottom, 0px) + 82px);
  background:
    radial-gradient(circle at 50% 78%, rgba(116, 130, 82, 0.20), transparent 42%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.50), rgba(0, 0, 0, 0.92));
  backdrop-filter: blur(2px);
  transition: opacity 180ms ease;
}

.mobile-idle-brand-overlay.hidden {
  display: none;
}

.mobile-idle-brand-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  text-align: center;
  gap: 10px;
  pointer-events: none;
}

.mobile-idle-brand-image {
  display: block;
  width: min(80vw, 320px);
  max-width: 80%;
  max-height: min(46dvh, 420px);
  object-fit: contain;
  filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.50));
}

.mobile-idle-brand-fallback {
  width: min(80vw, 320px);
  min-height: 130px;
  display: grid;
  place-items: center;
  border-radius: 30px;
  border: 1px solid rgba(224, 232, 190, 0.18);
  background: rgba(255, 255, 255, 0.045);
  color: rgba(255, 255, 255, 0.78);
  font-family: "Arial Black", Impact, sans-serif;
  font-size: clamp(32px, 13vw, 62px);
  line-height: 1;
  letter-spacing: -1px;
  text-transform: uppercase;
}

.mobile-idle-brand-card.has-custom-logo .mobile-idle-brand-fallback {
  display: none;
}

.mobile-idle-brand-organization {
  max-width: 92%;
  color: rgba(255, 255, 255, 0.76);
  font-size: clamp(15px, 4.1vw, 22px);
  font-weight: 900;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.mobile-idle-brand-detail {
  color: rgba(224, 232, 190, 0.62);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.1px;
  text-transform: uppercase;
}

.mobile-screen.p60-visual .mobile-idle-brand-overlay {
  padding: 46px 18px 76px;
}

.mobile-screen.p60-visual .mobile-idle-brand-image {
  max-height: min(42dvh, 300px);
}

/* Desktop-/surfplattelayouten saknar bottennavigationen som fältterminalens smala vy har.
   Sidomenyn ger därför tillgång till operativa klientinställningar och utloggning utan att
   ändra PTT-/mediaflöden eller förstora huvudpanelen. */
.desktop-brand-block {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.desktop-menu-button {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  padding: 0;
  flex: 0 0 auto;
}

.desktop-menu-button span {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  display: block;
}

.desktop-menu-button:hover,
.desktop-menu-button:focus-visible {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 18%, transparent);
}

.desktop-brand-logo {
  min-width: 0;
  max-width: 210px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.desktop-brand-logo-image {
  max-width: 100%;
  max-height: 40px;
  object-fit: contain;
  object-position: left center;
  display: block;
}

.desktop-brand-logo.has-custom-logo .desktop-brand-fallback {
  display: none;
}

.desktop-brand-fallback {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface-2);
  font-weight: 800;
  letter-spacing: 0.02em;
}

.desktop-side-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(4, 6, 10, 0.36);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.desktop-side-menu-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.desktop-side-menu {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 90;
  width: min(330px, calc(100vw - 32px));
  padding: calc(14px + env(safe-area-inset-top, 0px)) 14px calc(14px + env(safe-area-inset-bottom, 0px));
  background: var(--surface);
  border-right: 1px solid var(--line);
  box-shadow: 16px 0 42px rgba(0, 0, 0, 0.24);
  transform: translateX(-110%);
  transition: transform 0.2s ease;
  display: grid;
  align-content: start;
  gap: 14px;
  overflow-y: auto;
}

.desktop-side-menu.open {
  transform: translateX(0);
}

.desktop-side-menu-head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
}

.desktop-side-menu-logo {
  min-height: 44px;
  display: flex;
  align-items: center;
  min-width: 0;
}

.desktop-side-menu-logo-image {
  max-width: 220px;
  max-height: 44px;
  object-fit: contain;
  object-position: left center;
  display: block;
}

.desktop-side-menu-logo.has-custom-logo .desktop-side-menu-logo-fallback {
  display: none;
}

.desktop-side-menu-logo-fallback {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  color: var(--muted);
  background: var(--surface-2);
  font-weight: 800;
}

.desktop-side-menu-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  display: inline-grid;
  place-items: center;
}

.desktop-side-menu-section {
  display: grid;
  gap: 8px;
}

.desktop-side-menu-label {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.desktop-side-menu-row {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  text-align: left;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  padding: 10px;
}

.desktop-side-menu-row:hover,
.desktop-side-menu-row:focus-visible {
  border-color: var(--focus);
}

.desktop-side-menu-row span:first-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.desktop-side-menu-row strong {
  font-size: 13px;
}

.desktop-side-menu-row small {
  color: var(--muted);
  line-height: 1.25;
}

.desktop-side-menu-row.danger strong,
.desktop-side-menu-row.danger .desktop-side-menu-action {
  color: var(--red);
}

.desktop-side-menu-action {
  color: var(--focus);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

body.desktop-menu-open {
  overflow: hidden;
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: minmax(170px, auto) 1fr auto;
  }

  .desktop-brand-logo {
    max-width: 180px;
  }
}

@media (max-width: 760px) {
  .desktop-brand-logo {
    max-width: 150px;
  }
}

.desktop-side-menu-close.desktop-menu-button {
  width: 36px;
  height: 36px;
}

.desktop-side-menu-close.desktop-menu-button {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
}

/* Mobil karta fas 3: använd vertikal yta till själva kartan, inte till listor under den. */
#view-map {
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.mobile-map-panel {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0;
}

.mobile-map-panel .map-head {
  padding: 7px 10px;
}

.mobile-map-heading {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.mobile-map-heading h2 {
  margin: 0;
  overflow: hidden;
  color: #f3f5ea;
  font-size: 12px;
  line-height: 1.08;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-map-heading span {
  overflow: hidden;
  color: #b5beb0;
  font-size: 9px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-map-status-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.mobile-map-canvas {
  height: 100%;
  min-height: clamp(230px, 46dvh, 420px);
}

.mobile-map-canvas .samband-map-shell,
.mobile-map-canvas .samband-map-shell-leaflet,
.mobile-map-canvas .samband-map-stage,
.mobile-map-canvas .samband-map-stage-leaflet,
.mobile-map-canvas .samband-map-leaflet {
  height: 100%;
  min-height: 0;
}

.mobile-map-canvas .samband-map-list {
  display: none;
}

/* Meddelanden i smala klienten: samma SDS-flöde men presenterat som pratbubblor. */
.mobile-messages-panel {
  height: 100%;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.messages-head span {
  max-width: 54%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-message-thread {
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  background: linear-gradient(180deg, rgba(8, 10, 12, 0.16), rgba(8, 10, 12, 0.02));
}

.mobile-message-empty {
  margin: auto;
  max-width: 30ch;
  display: grid;
  gap: 6px;
  text-align: center;
  color: #bec8b0;
  font-size: 11px;
  line-height: 1.35;
}

.mobile-message-empty strong {
  color: #f0f4df;
}

.mobile-message-bubble {
  max-width: min(92%, 560px);
  display: grid;
  gap: 7px;
  padding: 11px 13px;
  border-radius: 17px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.22);
  font-size: 12px;
  line-height: 1.28;
}

.mobile-message-bubble.incoming {
  align-self: flex-start;
  border-bottom-left-radius: 6px;
  background: rgba(54, 62, 70, 0.92);
  color: #edf1e8;
}

.mobile-message-bubble.outgoing {
  align-self: flex-end;
  border-bottom-right-radius: 6px;
  background: linear-gradient(145deg, rgba(41, 114, 183, 0.92), rgba(23, 83, 145, 0.94));
  color: #ffffff;
}

.mobile-message-meta {
  color: rgba(237, 243, 223, 0.72);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.mobile-message-text {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  font-size: 24px;
  line-height: 1.32;
}

.mobile-message-text.muted {
  color: rgba(237, 243, 223, 0.78);
  font-size: 16px;
  font-style: italic;
  line-height: 1.32;
}

.mobile-message-image-button {
  width: 100%;
  max-width: 210px;
  border: 0;
  border-radius: 12px;
  overflow: hidden;
  padding: 0;
  background: #080a0c;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.mobile-message-image {
  display: block;
  width: 100%;
  max-height: 170px;
  object-fit: cover;
}

.mobile-message-location {
  color: rgba(237, 243, 223, 0.72);
  font-size: 9px;
  font-weight: 700;
}

.mobile-message-compose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  padding: 8px 10px 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 13, 17, 0.42);
}

.mobile-message-compose .field {
  gap: 4px;
}

.mobile-message-compose input {
  min-height: 34px;
}

.mobile-message-compose .mobile-inline-button {
  min-width: 72px;
  min-height: 34px;
}

/* ISSI ska vara snabbt läsbart i fält: de fyra sista siffrorna motsvarar ofta callsign. */
.issi-display {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.issi-prefix {
  color: #b5bdb5;
  font-weight: 800;
}

.issi-callsign {
  color: #f8fbff;
  font-size: 1.24em;
  font-weight: 950;
  letter-spacing: 0.035em;
  text-shadow: 0 0 7px rgba(255, 255, 255, 0.22);
}

.issi-level {
  margin-left: 3px;
  color: #aab3ac;
  font-size: 0.86em;
  font-weight: 800;
}

#mobileUserIssi .issi-display {
  font-size: 11px;
}

#userIssi .issi-display {
  font-size: 15px;
}

.bottom-nav .nav-item {
  flex: 1 1 0;
  min-width: 0;
  padding-left: 3px;
  padding-right: 3px;
}


.settings-panel.fill-panel {
  grid-template-rows: auto minmax(0, 1fr);
}

.settings-shell {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 10px;
  scrollbar-gutter: stable;
}

.settings-shell::-webkit-scrollbar {
  width: 3px;
}

.settings-shell::-webkit-scrollbar-track {
  background: transparent;
}

.settings-shell::-webkit-scrollbar-thumb {
  background: rgba(187, 198, 137, 0.24);
  border-radius: 999px;
}

.settings-hub {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  padding: 10px;
}

.settings-tile {
  min-height: 96px;
  border: 1px solid rgba(188, 198, 146, 0.14);
  border-radius: 15px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0.025) 100%);
  color: #edf1e6;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  padding: 10px 8px;
  text-align: center;
}

.settings-tile:hover,
.settings-tile:focus-visible {
  background: rgba(205, 218, 148, 0.09);
  border-color: rgba(205, 218, 148, 0.28);
}

.settings-tile-icon {
  width: 30px;
  height: 30px;
  color: #dbe2b5;
}

.settings-tile span {
  display: grid;
  gap: 3px;
}

.settings-tile strong {
  font-size: 12px;
  line-height: 1.1;
  color: #f1f4ee;
}

.settings-tile small {
  color: #a9b0a4;
  font-size: 9px;
  line-height: 1.2;
}

.settings-tile.danger-tile {
  border-color: rgba(255, 120, 96, 0.18);
}

.settings-tile.danger-tile .settings-tile-icon,
.settings-tile.danger-tile small {
  color: #ffd6cc;
}

.settings-page {
  display: grid;
  gap: 8px;
  padding: 8px 0 10px;
}

.settings-back {
  justify-self: start;
  margin: 0 10px 2px;
  min-height: 30px;
  border-radius: 999px;
  border-color: rgba(188, 198, 146, 0.16);
  background: rgba(255, 255, 255, 0.045);
  color: #dbe2b5;
  font-size: 10px;
  font-weight: 800;
}

.settings-range-row,
.settings-select-row {
  width: 100%;
  min-height: 58px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #edf1e6;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
}

.settings-range-row input[type="range"] {
  width: 128px;
  accent-color: #dbe2b5;
}

.settings-select-row select {
  min-width: 128px;
  min-height: 34px;
  border: 1px solid rgba(188, 198, 146, 0.24);
  border-radius: 10px;
  background: rgba(18, 24, 12, 0.62);
  color: #edf1e6;
  padding: 0 9px;
}

.settings-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 10px 11px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-form-grid label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.settings-form-grid label span {
  color: #a9b0a4;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.settings-form-grid input {
  min-height: 34px;
  border-color: rgba(188, 198, 146, 0.24);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
  color: #f1f4ee;
  padding: 0 9px;
  font-size: 11px;
}

.settings-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 10px 11px 4px;
}

.settings-small-action {
  min-height: 32px;
  border-radius: 999px;
  border-color: rgba(188, 198, 146, 0.16);
  background: rgba(255, 255, 255, 0.045);
  color: #edf1e6;
  font-size: 10px;
  font-weight: 800;
}

.settings-help {
  margin: 0;
  padding: 6px 11px 10px;
  color: rgba(219, 226, 181, 0.78);
  font-size: 10px;
  line-height: 1.35;
}

.embedded-metrics {
  margin: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 13px;
  overflow: hidden;
}

@media (max-width: 360px) {
  .settings-hub {
    grid-template-columns: 1fr;
  }

  .settings-range-row,
  .settings-select-row {
    grid-template-columns: 1fr;
  }

  .settings-range-row input[type="range"],
  .settings-select-row select {
    width: 100%;
  }
}


/* PATCH 69A: Diagnostik och plattformssäker webbklient.
   Webbappen körs på både Chromium/Android och WebKit/iOS. Diagnostikraderna
   gör capability-/permission-läget synligt utan att användaren behöver öppna devtools. */
.diagnostic-actions {
  margin: 10px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.18);
}

.mobile-message-bubble.legacy-metadata {
  opacity: 0.82;
  border-style: dashed;
}

.mobile-message-text.muted {
  color: rgba(241, 243, 234, 0.68);
  font-style: italic;
}


.field-code-panel.fill-panel {
  grid-template-rows: auto minmax(0, 1fr);
}

.field-code-head > div {
  min-width: 0;
}

.field-code-role {
  max-width: 42%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-code-body {
  min-height: 0;
  overflow-y: auto;
  padding: 10px;
  display: grid;
  align-content: start;
  gap: 9px;
}

.field-code-guard {
  border: 1px solid rgba(219, 226, 181, 0.16);
  border-radius: 12px;
  background: rgba(219, 226, 181, 0.055);
  color: rgba(241, 244, 238, 0.88);
  padding: 9px;
  font-size: 10px;
  line-height: 1.35;
}

.field-code-guard.denied {
  border-color: rgba(211, 56, 51, 0.42);
  background: rgba(211, 56, 51, 0.10);
  color: #ffd0cd;
}

.mobile-select {
  width: 100%;
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
  color: #f1f4ee;
  padding: 7px 9px;
  font: inherit;
}

.mobile-select option {
  background: #101412;
  color: #f1f4ee;
}

.field-code-create {
  align-self: stretch;
  min-height: 38px;
}

.field-code-create:disabled {
  opacity: 0.46;
  cursor: not-allowed;
}

.field-code-status {
  min-height: 28px;
}

.field-code-result {
  border: 1px solid rgba(42, 132, 210, 0.24);
  border-radius: 14px;
  background: rgba(42, 132, 210, 0.08);
  padding: 10px;
  display: grid;
  grid-template-columns: minmax(96px, 132px) 1fr;
  gap: 10px;
  align-items: center;
}

.field-code-qr {
  background: #fff;
  border-radius: 10px;
  padding: 6px;
  line-height: 0;
}

.field-code-qr svg {
  width: 100%;
  height: auto;
  display: block;
}

.field-code-result-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.field-code-result-copy strong {
  color: #f1f4ee;
  font-size: 11px;
}

.field-code-result-copy span {
  color: #b9c1b3;
  font-size: 9.5px;
  line-height: 1.25;
}

.field-code-result-copy code {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  color: #dbe2b5;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 5px 6px;
  font-size: 9px;
  line-height: 1.25;
}

.bottom-nav .nav-item.denied {
  color: #d33833;
}

.bottom-nav .nav-item.denied.active::after {
  background: #d33833;
  box-shadow: 0 -2px 10px rgba(211, 56, 51, 0.9);
}

@media (max-width: 420px) {
  .field-code-result {
    grid-template-columns: 1fr;
  }

  .field-code-qr {
    max-width: 156px;
    margin: 0 auto;
  }
}


.field-code-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.field-code-action-button {
  min-height: 30px;
  padding: 0 9px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.075);
  color: #f1f4ee;
  font-size: 10px;
  font-weight: 800;
}

.field-code-action-button svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  flex: 0 0 auto;
}

.field-code-action-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.field-code-qr-status {
  margin-top: 6px;
  color: #53616d;
  background: #f1f4f7;
  border: 1px solid #d3dbe2;
  border-radius: 8px;
  padding: 5px 6px;
  font-size: 10px;
  line-height: 1.3;
}

.field-code-qr-fallback {
  color: #25313b;
  line-height: 1.35;
  font-size: 11px;
  padding: 8px;
}

@media (max-width: 420px) {
  .field-code-actions {
    justify-content: center;
  }

  .field-code-action-button span {
    display: none;
  }

  .field-code-action-button {
    min-width: 42px;
    padding: 0 10px;
  }
}



.sound-input-row {
  grid-template-columns: minmax(0, 1fr) minmax(140px, 48%);
  align-items: center;
}

.sound-input-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-width: min(100%, 240px);
}

.sound-input-controls select {
  width: 100%;
  min-width: 0;
}

.sound-input-refresh {
  min-height: 34px;
  padding: 0 10px;
  white-space: nowrap;
}

@media (max-width: 440px) {
  .sound-input-row {
    grid-template-columns: 1fr;
  }

  .sound-input-controls {
    width: 100%;
    grid-template-columns: 1fr;
  }
}



.sound-mic-gain-row input[type="range"] {
  accent-color: #30a54a;
}

.settings-meter-row {
  width: 100%;
  min-height: 58px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #edf1e6;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 38%);
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
}

.settings-vu-meter {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(216, 226, 172, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  transition: opacity 120ms ease;
}

.settings-vu-meter.inactive {
  opacity: 0.46;
}

.settings-vu-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #30a54a, #d49e24 72%, #d33833);
  transition: width 70ms linear;
}

@media (max-width: 440px) {
  .settings-meter-row {
    grid-template-columns: 1fr;
  }

  .settings-vu-meter {
    width: 100%;
  }
}



@media (min-width: 701px) {
  .app-view {
    min-height: 100vh;
    grid-template-columns: 0 minmax(0, 1fr);
    grid-template-rows: 1fr;
    background: var(--bg);
    transition: grid-template-columns 0.18s ease;
  }

  .app-view.desktop-terminal-open {
    grid-template-columns: minmax(340px, 390px) minmax(0, 1fr);
  }

  .app-view.desktop-terminal-closed {
    grid-template-columns: 0 minmax(0, 1fr);
  }

  .app-view > .mobile-client {
    display: block;
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    width: 100%;
    overflow: hidden;
    border-right: 1px solid rgba(0, 0, 0, 0.24);
    box-shadow: 8px 0 24px rgba(20, 30, 40, 0.12);
  }

  .app-view.desktop-terminal-closed > .mobile-client {
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
  }

  .app-view > .desktop-client {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    min-height: 100vh;
    display: grid;
    grid-template-rows: auto auto 1fr;
    overflow: hidden;
  }

  .app-view > .mobile-client .mobile-shell {
    min-height: 100vh;
    height: 100vh;
    justify-content: center;
    background: #0e1116;
  }

  .app-view > .mobile-client .mobile-screen {
    width: min(100%, 390px);
    box-shadow: none;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    grid-template-columns: minmax(170px, 240px) minmax(0, 1fr) auto auto;
  }

  .desktop-terminal-toggle {
    min-height: 34px;
    border-radius: 999px;
    white-space: nowrap;
    font-weight: 800;
    border-color: color-mix(in srgb, var(--focus) 38%, var(--line-strong));
    color: var(--focus);
    background: color-mix(in srgb, var(--focus) 8%, var(--surface));
  }

  .desktop-tab-bar {
    position: sticky;
    top: 72px;
    z-index: 24;
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    background: color-mix(in srgb, var(--surface) 88%, var(--surface-2));
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
  }

  .desktop-tab-button {
    min-height: 36px;
    border-radius: 999px;
    padding: 0 14px;
    font-weight: 800;
    background: var(--surface);
  }

  .desktop-tab-button.active {
    color: #fff;
    background: var(--ink);
    border-color: var(--ink);
  }

  .desktop-main-region {
    min-height: 0;
    min-width: 0;
    display: grid;
    overflow: hidden;
  }

  .desktop-tab-panel {
    min-height: 0;
    min-width: 0;
    display: none;
    overflow: auto;
  }

  .desktop-tab-panel.active {
    display: grid;
  }

  #desktopPanelOverview.active {
    grid-template-rows: auto 1fr;
  }

  .desktop-map-tab-panel.active {
    grid-template-rows: auto 1fr auto;
    padding: 12px;
    gap: 10px;
  }

  .desktop-messages-tab-panel.active {
    grid-template-rows: auto 1fr auto;
    padding: 12px;
    gap: 10px;
  }

  .desktop-settings-tab-panel.active {
    grid-template-rows: auto 1fr;
    padding: 12px;
    gap: 12px;
  }

  .desktop-tactical-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
  }

  .desktop-tactical-panel-head h2 {
    margin: 0;
    font-size: 20px;
  }

  .desktop-tactical-panel-head span {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 13px;
  }

  .desktop-panel-kicker {
    margin: 0 0 4px;
    color: var(--focus);
    font-weight: 900;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .desktop-panel-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
  }

  .desktop-map-canvas {
    min-height: 0;
    height: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    background: #101820;
  }

  .desktop-map-canvas .samband-map-shell {
    min-height: 100%;
    height: 100%;
  }

  .desktop-map-canvas .samband-map-stage {
    min-height: 100%;
  }

  .desktop-panel-status {
    margin: 0;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 13px;
  }

  .desktop-message-thread {
    min-height: 0;
    overflow: auto;
    display: grid;
    align-content: start;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
  }

  .desktop-message-empty {
    display: grid;
    gap: 6px;
    place-items: center;
    min-height: 180px;
    color: var(--muted);
    text-align: center;
  }

  .desktop-message-bubble {
    max-width: min(760px, 82%);
    display: grid;
    gap: 6px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-2);
    box-shadow: 0 6px 16px rgba(31, 37, 43, 0.05);
  }

  .desktop-message-bubble.outgoing {
    justify-self: end;
    border-color: color-mix(in srgb, var(--green) 28%, var(--line));
    background: color-mix(in srgb, var(--green-soft) 65%, var(--surface));
  }

  .desktop-message-bubble.incoming {
    justify-self: start;
  }

  .desktop-message-meta,
  .desktop-message-location {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }

  .desktop-message-text {
    overflow-wrap: anywhere;
    white-space: pre-wrap;
  }

  .desktop-message-image-button {
    width: min(360px, 100%);
    height: auto;
    padding: 0;
    overflow: hidden;
    border-radius: 10px;
    background: #000;
  }

  .desktop-message-image {
    display: block;
    width: 100%;
    max-height: 300px;
    object-fit: cover;
  }

  .desktop-message-compose {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
  }

  .desktop-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
    align-content: start;
  }

  .desktop-settings-card {
    min-height: 104px;
    display: grid;
    align-content: start;
    gap: 8px;
    padding: 14px;
    text-align: left;
    border-radius: 12px;
    background: var(--surface);
  }

  .desktop-settings-card strong {
    font-size: 16px;
  }

  .desktop-settings-card span {
    color: var(--muted);
    line-height: 1.35;
  }
}

@media (min-width: 701px) and (max-width: 1120px) {
  .app-view.desktop-terminal-open {
    grid-template-columns: minmax(320px, 360px) minmax(0, 1fr);
  }

  .topbar {
    grid-template-columns: minmax(150px, 220px) 1fr auto;
  }

  .desktop-terminal-toggle {
    grid-column: 2 / 3;
    justify-self: end;
  }

  .connection-badge {
    grid-column: 3 / 4;
  }
}


@media (min-width: 701px) {
  #desktopPanelOverview.active {
    grid-template-rows: auto 1fr;
    gap: 10px;
    padding: 0 10px 10px;
  }

  .desktop-overview-grid {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(250px, 0.72fr) minmax(340px, 1.1fr) minmax(280px, 0.82fr);
    grid-template-rows: auto minmax(0, 1fr) minmax(180px, 0.45fr);
    grid-template-areas:
      "status metrics messages"
      "groups users messages"
      "events events messages";
    gap: 10px;
  }

  .desktop-overview-card,
  .desktop-overview-panel {
    min-width: 0;
    min-height: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    overflow: hidden;
  }

  .desktop-overview-card {
    display: grid;
    gap: 6px;
    padding: 12px 14px;
    align-content: start;
  }

  .desktop-overview-card-status {
    grid-area: status;
  }

  .desktop-overview-card-status > strong {
    font-size: clamp(28px, 4vw, 46px);
    line-height: 1;
  }

  .desktop-overview-card-status > span {
    color: var(--muted);
    font-weight: 700;
  }

  .desktop-overview-status-row {
    display: grid;
    gap: 5px;
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    overflow-wrap: anywhere;
  }

  .desktop-overview-card-metrics {
    grid-area: metrics;
  }

  .desktop-metrics-strip-overview {
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .desktop-overview-talkgroups {
    grid-area: groups;
  }

  .desktop-overview-users {
    grid-area: users;
  }

  .desktop-overview-messages {
    grid-area: messages;
    display: grid;
    grid-template-rows: auto 1fr;
  }

  .desktop-overview-events {
    grid-area: events;
    display: grid;
    grid-template-rows: auto 1fr;
  }

  .desktop-legacy-controls {
    display: none !important;
  }

  .desktop-situation-tab-panel.active,
  .desktop-map-tab-panel.active {
    grid-template-rows: auto minmax(0, 1fr) auto;
    padding: 12px;
    gap: 10px;
  }

  .desktop-situation-layout,
  .desktop-map-layout {
    min-width: 0;
    min-height: 0;
    display: grid;
    gap: 10px;
  }

  .desktop-situation-layout {
    grid-template-columns: minmax(520px, 1fr) minmax(300px, 360px);
  }

  .desktop-map-layout {
    grid-template-columns: minmax(600px, 1fr) minmax(280px, 340px);
  }

  .desktop-situation-map-canvas,
  .desktop-map-canvas {
    min-height: 0;
    height: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    background: #101820;
  }

  .desktop-situation-side,
  .desktop-map-side {
    min-height: 0;
    display: grid;
    gap: 10px;
    align-content: start;
    overflow: auto;
  }

  .desktop-situation-side {
    grid-template-rows: minmax(160px, auto) minmax(180px, 1fr) auto;
  }

  .desktop-map-side {
    grid-template-rows: minmax(180px, auto) minmax(220px, 1fr);
  }

  .desktop-situation-card {
    min-width: 0;
    min-height: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    padding: 10px;
    display: grid;
    gap: 8px;
    align-content: start;
  }

  .desktop-situation-card h3 {
    margin: 0;
    font-size: 15px;
  }

  .desktop-compact-feed {
    min-height: 0;
    display: grid;
    gap: 8px;
    align-content: start;
    overflow: auto;
  }

  .desktop-compact-empty {
    color: var(--muted);
    font-size: 13px;
    padding: 8px 2px;
  }

  .desktop-compact-message,
  .desktop-compact-resource,
  .desktop-compact-status-row {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-2);
    padding: 8px 9px;
    display: grid;
    gap: 3px;
    text-align: left;
  }

  .desktop-compact-message strong,
  .desktop-compact-resource strong,
  .desktop-compact-status-row strong {
    font-size: 12px;
    color: var(--ink);
  }

  .desktop-compact-message span,
  .desktop-compact-resource span,
  .desktop-compact-status-row span {
    color: var(--muted);
    font-size: 12px;
    overflow-wrap: anywhere;
  }

  .desktop-compact-message.outgoing {
    border-color: color-mix(in srgb, var(--green) 28%, var(--line));
    background: color-mix(in srgb, var(--green-soft) 72%, var(--surface));
  }

  .desktop-compact-message.clickable {
    cursor: pointer;
  }

  .desktop-compact-message img {
    width: 100%;
    max-height: 120px;
    object-fit: cover;
    border-radius: 8px;
    background: #000;
  }

  .desktop-compact-resource {
    cursor: pointer;
  }

  .desktop-compact-resource.local {
    border-color: color-mix(in srgb, var(--focus) 35%, var(--line));
    background: color-mix(in srgb, var(--focus) 8%, var(--surface));
  }

  .desktop-compact-resource:hover,
  .desktop-compact-resource:focus-visible {
    border-color: var(--focus);
  }
}

@media (min-width: 701px) and (max-width: 1180px) {
  .desktop-overview-grid {
    grid-template-columns: minmax(240px, 0.9fr) minmax(300px, 1.1fr);
    grid-template-rows: auto auto minmax(0, 1fr) minmax(180px, 0.45fr);
    grid-template-areas:
      "status metrics"
      "messages messages"
      "groups users"
      "events events";
  }

  .desktop-situation-layout,
  .desktop-map-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .desktop-situation-side,
  .desktop-map-side {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    grid-template-rows: none;
  }
}


@media (min-width: 701px) {
  .desktop-side-menu-toggle {
    width: 56px;
    height: 30px;
    position: relative;
    flex: 0 0 auto;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.22);
    background: color-mix(in srgb, var(--red) 72%, #222);
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.28);
  }

  .desktop-side-menu-toggle::after {
    content: "";
    position: absolute;
    top: 4px;
    left: 4px;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.32);
    transition: transform 0.16s ease;
  }

  .desktop-side-menu-toggle.on {
    background: color-mix(in srgb, var(--green) 82%, #123);
  }

  .desktop-side-menu-toggle.on::after {
    transform: translateX(26px);
  }

  .desktop-side-menu-toggle.off {
    background: color-mix(in srgb, var(--red) 78%, #222);
  }

  .desktop-metrics-strip-overview {
    grid-template-columns: minmax(170px, 0.42fr) minmax(280px, 1fr);
    align-items: stretch;
  }

  .desktop-metrics-strip-overview > div:first-child {
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 6px;
  }

  .desktop-metrics-strip-overview > div:nth-child(2) {
    min-width: 0;
  }

  .desktop-metrics-strip-overview > div:nth-child(3) {
    grid-column: 1;
    grid-row: 1;
    margin-top: 48px;
  }

  .desktop-situation-layout,
  .desktop-map-layout {
    height: 100%;
  }

  .desktop-situation-map-canvas .samband-map-shell,
  .desktop-map-canvas .samband-map-shell {
    min-height: 100%;
    height: 100%;
  }

  .desktop-situation-map-canvas .samband-map-stage,
  .desktop-map-canvas .samband-map-stage {
    min-height: 100%;
    height: 100%;
  }

  .desktop-situation-map-canvas .samband-map-leaflet,
  .desktop-map-canvas .samband-map-leaflet {
    min-height: 100%;
    height: 100%;
  }

  .desktop-compact-resource-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
  }

  .desktop-resource-seen {
    flex: 0 0 auto;
    font-size: 11px !important;
    font-weight: 800;
    color: color-mix(in srgb, var(--focus) 78%, var(--muted)) !important;
    white-space: nowrap;
  }

  .desktop-compact-resource.selected {
    border-color: #ffb020;
    box-shadow: inset 4px 0 0 #ffb020;
    background: color-mix(in srgb, #ffb020 12%, var(--surface));
  }

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

  .desktop-message-image-actions button {
    min-height: 30px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    padding: 0 11px;
  }

  .desktop-message-download-button {
    width: 34px;
    padding: 0 !important;
  }

  .desktop-message-compose {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .desktop-message-compose .hidden {
    display: none !important;
  }
}
@media (min-width: 701px) {
  .desktop-metrics-strip-overview {
    grid-template-columns: minmax(170px, 0.42fr) minmax(280px, 1fr);
    grid-template-rows: repeat(2, minmax(0, 1fr));
  }
  .desktop-metrics-strip-overview > div:first-child {
    grid-column: 1;
    grid-row: 1;
    display: grid;
    gap: 3px;
  }
  .desktop-metrics-strip-overview > div:nth-child(2) {
    grid-column: 2;
    grid-row: 1 / 3;
    min-width: 0;
    display: grid;
    align-content: start;
  }
  .desktop-metrics-strip-overview > div:nth-child(3) {
    grid-column: 1;
    grid-row: 2;
    margin-top: 0;
    display: grid;
    gap: 3px;
  }
}


/* Public activation screen layout */
.login-view {
  align-items: start;
  justify-items: center;
  padding: 10px;
}

.login-panel {
  width: min(440px, 100%);
  padding: 12px;
  gap: 8px;
}

.login-panel > div:first-child {
  display: grid;
  gap: 2px;
}

.login-panel .eyebrow {
  font-size: 11px;
}

.login-panel h1 {
  font-size: 24px;
}

.activation-required {
  display: grid;
  gap: 3px;
}

.activation-required p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
}

.qr-activation-compact {
  gap: 6px;
}

.qr-actions-compact {
  grid-template-columns: 1.25fr 0.8fr 0.9fr 0.75fr auto;
  gap: 6px;
}

.qr-actions-compact > *,
.qr-file-button {
  min-height: 36px;
  padding-inline: 9px;
  font-size: 13px;
}

.qr-scanner-panel:not(.hidden) {
  margin-top: 0;
}

.qr-video-wrap-compact {
  max-height: min(54vh, 440px);
}

.qr-scanner-panel.hidden ~ .qr-guide-line {
  display: none;
}

.login-view.qr-scanner-active {
  padding-top: 6px;
}

.login-view.qr-scanner-active .login-panel {
  width: min(560px, 100%);
  gap: 7px;
}

.login-view.qr-scanner-active .login-brand-preview,
.login-view.qr-scanner-active .activation-required,
.login-view.qr-scanner-active .eyebrow {
  display: none;
}

.login-view.qr-scanner-active .login-panel h1 {
  font-size: 20px;
}

.login-view.qr-scanner-active .qr-video-wrap-compact {
  aspect-ratio: auto;
  height: min(64vh, 520px);
  min-height: min(44vh, 340px);
  max-height: none;
}

.login-view.qr-scanner-active .qr-status-compact {
  min-height: auto;
  padding: 6px 8px;
}

.login-view.qr-scanner-active .activation-field-compact {
  margin-top: 0;
}

@media (max-width: 560px) {
  .login-view {
    padding: 8px;
  }

  .login-panel {
    border-radius: 0;
    min-height: auto;
  }

  .qr-actions-compact {
    grid-template-columns: 1fr 1fr;
  }

  .login-view.qr-scanner-active .qr-video-wrap-compact {
    height: min(62vh, calc(100vh - 180px));
    min-height: 300px;
  }
}


/* Public activation screen refinement */
.login-panel .login-heading,
.login-panel > div:first-child {
  text-align: center;
  justify-items: center;
}

.login-panel .eyebrow {
  margin-inline: auto;
}

#activationDebugLog {
  display: none !important;
}

.login-view {
  min-height: 100svh;
  overflow-y: auto;
}

.login-panel {
  align-self: start;
}

.login-view.qr-scanner-active {
  align-items: start;
  padding-top: max(4px, env(safe-area-inset-top));
}

.login-view.qr-scanner-active .login-panel {
  width: min(640px, 100%);
  padding-top: 8px;
}

.login-view.qr-scanner-active .login-panel h1 {
  margin: 0;
}

.login-view.qr-scanner-active .qr-scanner-panel {
  order: -1;
  width: 100%;
}

.login-view.qr-scanner-active .qr-video-wrap-compact {
  height: min(72svh, 560px);
  min-height: min(54svh, 390px);
}

@media (max-height: 720px) {
  .login-panel {
    gap: 6px;
    padding-block: 8px;
  }
  .login-brand-preview {
    min-height: 58px;
  }
  .activation-required h2 {
    margin-block: 0;
  }
  .activation-required p {
    font-size: 12px;
  }
}


/* Public activation screen: rugged first impression */
.login-view {
  position: relative;
  isolation: isolate;
  align-items: center;
  justify-items: center;
  min-height: 100svh;
  padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom));
  overflow-y: auto;
  background:
    radial-gradient(circle at 22% 18%, rgba(255,255,255,0.16) 0 1px, transparent 2px 100%),
    radial-gradient(circle at 72% 34%, rgba(255,255,255,0.10) 0 1px, transparent 2px 100%),
    radial-gradient(circle at 38% 78%, rgba(0,0,0,0.42) 0 1px, transparent 2px 100%),
    linear-gradient(135deg, rgba(255,255,255,0.05), transparent 22%, rgba(0,0,0,0.28) 62%, rgba(255,255,255,0.04)),
    repeating-radial-gradient(circle at 0 0, rgba(255,255,255,0.045) 0 1px, transparent 1px 7px),
    repeating-linear-gradient(45deg, rgba(255,255,255,0.028) 0 1px, transparent 1px 8px),
    #11171c;
  background-size: 31px 31px, 43px 43px, 29px 29px, auto, 18px 18px, 11px 11px, auto;
  color: #eef3f6;
}

.login-view::before,
.login-view::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

.login-view::before {
  background:
    radial-gradient(circle at 50% 12%, rgba(64, 94, 109, 0.42), transparent 38%),
    radial-gradient(circle at 82% 82%, rgba(0, 0, 0, 0.34), transparent 35%),
    linear-gradient(180deg, rgba(6, 10, 13, 0.08), rgba(6, 10, 13, 0.62));
}

.login-view::after {
  opacity: 0.34;
  background-image:
    linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255,255,255,0.028) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(circle at center, black 0 62%, transparent 100%);
}

.login-panel {
  width: min(420px, calc(100vw - 20px));
  max-height: calc(100svh - 20px);
  overflow-y: auto;
  gap: 8px;
  padding: 14px;
  color: #eef3f6;
  background:
    linear-gradient(180deg, rgba(24, 31, 37, 0.96), rgba(10, 14, 18, 0.94)),
    repeating-radial-gradient(circle at 0 0, rgba(255,255,255,0.06) 0 1px, transparent 1px 9px);
  border: 1px solid rgba(188, 203, 213, 0.26);
  border-radius: 18px;
  box-shadow:
    0 24px 80px rgba(0,0,0,0.48),
    inset 0 1px 0 rgba(255,255,255,0.10),
    inset 0 -1px 0 rgba(0,0,0,0.55);
  backdrop-filter: blur(10px);
}

.login-panel .login-heading,
.login-panel > div:first-child {
  text-align: center;
  justify-items: center;
}

.login-panel .eyebrow {
  margin: 0 auto;
  color: rgba(226, 234, 239, 0.78);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 800;
}

.login-panel h1 {
  margin: 2px 0 0;
  color: #f7fafc;
  letter-spacing: 0.03em;
  text-shadow: 0 1px 0 rgba(0,0,0,0.7);
}

.login-brand-preview {
  min-height: 52px;
  padding: 8px 10px;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.075), rgba(0,0,0,0.14)),
    repeating-linear-gradient(135deg, rgba(255,255,255,0.035) 0 1px, transparent 1px 8px);
  border: 1px solid rgba(255,255,255,0.14);
}

.login-brand-fallback {
  color: rgba(245, 248, 250, 0.96);
  text-shadow: 0 1px 0 rgba(0,0,0,0.72);
}

.activation-required {
  gap: 2px;
  text-align: center;
}

.activation-required h2 {
  margin: 0;
  color: #f2f7fa;
  font-size: 17px;
  letter-spacing: 0.01em;
}

.activation-required p {
  color: rgba(225, 234, 239, 0.76);
  font-size: 12px;
  line-height: 1.25;
}

.qr-activation-compact {
  gap: 6px;
}

.qr-actions-compact {
  grid-template-columns: 1fr 0.62fr 0.74fr;
  gap: 6px;
}

.qr-actions-compact #qrIosHelpButton,
.qr-actions-compact #stopQrScannerButton,
.qr-actions-compact #qrSwitchMethodButton:not(.hidden) {
  grid-column: auto;
}

.qr-actions-compact > *,
.qr-file-button {
  min-height: 36px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
}

.login-panel button,
.login-panel .qr-file-button,
.login-panel input {
  border-color: rgba(197, 211, 220, 0.30);
  background: rgba(242, 246, 249, 0.92);
  color: #111820;
}

.login-panel button.primary {
  border-color: rgba(255,255,255,0.18);
  background: linear-gradient(180deg, #263641, #101820);
  color: #f8fbfc;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.10), 0 10px 20px rgba(0,0,0,0.22);
}

.qr-status-compact,
.login-status-compact {
  min-height: auto;
  margin: 0;
  padding: 6px 8px;
  border-radius: 10px;
  border-color: rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.20);
  color: rgba(229, 237, 241, 0.80);
  font-size: 12px;
}

.qr-guide-line,
.qr-ios-help {
  color: rgba(229, 237, 241, 0.76);
}

.activation-field-compact span {
  color: rgba(229, 237, 241, 0.80);
  font-size: 12px;
}

.activation-field-compact input {
  min-height: 36px;
}

.login-view.qr-scanner-active {
  align-items: start;
  padding-top: max(4px, env(safe-area-inset-top));
}

.login-view.qr-scanner-active .login-panel {
  width: min(660px, calc(100vw - 12px));
  max-height: calc(100svh - 8px);
  padding: 8px;
  gap: 6px;
}

.login-view.qr-scanner-active .qr-scanner-panel {
  order: -1;
  width: 100%;
}

.login-view.qr-scanner-active .qr-video-wrap-compact {
  height: min(74svh, 570px);
  min-height: min(52svh, 370px);
  border-radius: 16px;
  border-color: rgba(255,255,255,0.24);
  box-shadow: 0 18px 50px rgba(0,0,0,0.55), inset 0 0 0 1px rgba(255,255,255,0.08);
}

.login-view.qr-scanner-active .login-heading,
.login-view.qr-scanner-active .login-brand-preview,
.login-view.qr-scanner-active .activation-required {
  display: none;
}

.login-view.qr-scanner-active .qr-actions-compact {
  grid-template-columns: 1fr 1fr 1fr;
}

@media (max-width: 560px) {
  .login-view {
    padding: max(6px, env(safe-area-inset-top)) 6px max(6px, env(safe-area-inset-bottom));
  }
  .login-panel {
    width: calc(100vw - 12px);
    max-height: calc(100svh - 12px);
    border-radius: 16px;
    padding: 10px;
  }
  .login-brand-preview {
    min-height: 46px;
  }
  .activation-required h2 {
    font-size: 16px;
  }
  .activation-required p,
  .qr-status-compact,
  .login-status-compact {
    font-size: 11px;
  }
  .qr-actions-compact {
    grid-template-columns: 1fr 1fr;
  }
  .login-view.qr-scanner-active .login-panel {
    width: calc(100vw - 8px);
    max-height: calc(100svh - 8px);
  }
  .login-view.qr-scanner-active .qr-video-wrap-compact {
    height: min(74svh, calc(100svh - 122px));
    min-height: 340px;
  }
}

@media (max-height: 680px) {
  .login-panel {
    gap: 5px;
    padding-block: 8px;
  }
  .login-brand-preview {
    min-height: 42px;
  }
  .activation-required h2 {
    font-size: 15px;
  }
  .activation-required p {
    display: none;
  }
  .qr-status-compact,
  .login-status-compact {
    padding-block: 5px;
  }
}


/* Public activation screen polish */
.login-heading {
  width: 100%;
  text-align: center;
  justify-items: center;
}

.login-brand-preview {
  width: 75%;
  max-width: 320px;
  min-height: 48px;
  margin: 12px auto 10px;
}

.login-brand-image {
  max-width: 100%;
  max-height: 122px;
}

.login-brand-fallback,
.client-logo-fallback {
  text-transform: none;
}

.login-panel button,
.login-panel .qr-file-button {
  border-color: rgba(210, 222, 228, 0.24);
  color: #edf4f7;
  background:
    linear-gradient(180deg, rgba(73, 87, 96, 0.98), rgba(25, 34, 40, 0.98)),
    repeating-radial-gradient(circle at 0 0, rgba(255,255,255,0.09) 0 1px, transparent 1px 8px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),
    inset 0 -2px 0 rgba(0,0,0,0.45),
    0 9px 18px rgba(0,0,0,0.28);
  text-shadow: 0 1px 0 rgba(0,0,0,0.75);
}

.login-panel button:hover,
.login-panel .qr-file-button:hover {
  border-color: rgba(238, 247, 250, 0.40);
  background:
    linear-gradient(180deg, rgba(86, 102, 111, 0.98), rgba(30, 41, 48, 0.98)),
    repeating-radial-gradient(circle at 0 0, rgba(255,255,255,0.10) 0 1px, transparent 1px 8px);
}

.login-panel button.primary,
.login-panel #activateCodeButton {
  border-color: rgba(220, 235, 238, 0.28);
  background:
    linear-gradient(180deg, rgba(70, 98, 87, 0.98), rgba(17, 35, 30, 0.98)),
    repeating-radial-gradient(circle at 0 0, rgba(255,255,255,0.10) 0 1px, transparent 1px 7px);
  color: #f5fbf8;
}

.login-panel input {
  border-color: rgba(210, 222, 228, 0.28);
  background: rgba(8, 13, 17, 0.48);
  color: #f2f7fa;
  box-shadow: inset 0 1px 8px rgba(0,0,0,0.35);
}

.login-panel input::placeholder {
  color: rgba(226, 234, 239, 0.52);
}

.login-view.qr-scanner-active {
  align-items: start;
  justify-items: center;
  overflow: hidden;
}

.login-view.qr-scanner-active .login-panel {
  width: min(640px, calc(100vw - 10px));
  max-height: calc(100svh - 8px);
  overflow: hidden;
  padding: 8px;
  gap: 6px;
}

.login-view.qr-scanner-active .login-heading,
.login-view.qr-scanner-active .login-brand-preview,
.login-view.qr-scanner-active .activation-required,
.login-view.qr-scanner-active .activation-field-compact,
.login-view.qr-scanner-active #activateCodeButton,
.login-view.qr-scanner-active .login-status-compact {
  display: none !important;
}

.login-view.qr-scanner-active .qr-scanner-panel {
  order: -2;
  width: 100%;
  display: grid;
  justify-items: center;
}

.login-view.qr-scanner-active .qr-video-wrap-compact {
  aspect-ratio: 1 / 1;
  width: min(100%, 560px, calc(100svh - 128px));
  height: auto;
  min-height: 0;
  max-height: none;
  margin: 0 auto;
  border-radius: 18px;
}

.login-view.qr-scanner-active .qr-actions-compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
}

.login-view.qr-scanner-active .qr-status-compact,
.login-view.qr-scanner-active .qr-guide-line {
  text-align: center;
}

@media (max-width: 560px) {
  .login-brand-preview {
    width: 75%;
    min-height: 42px;
    margin-block: 8px;
  }
  .login-view.qr-scanner-active .login-panel {
    width: calc(100vw - 8px);
    max-height: calc(100svh - 8px);
  }
  .login-view.qr-scanner-active .qr-video-wrap-compact {
    width: min(100%, calc(100svh - 132px));
  }
}
