:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --text: #18202b;
  --muted: #667085;
  --line: #d9e1ea;
  --line-strong: #b8c4d1;
  --brand: #155eef;
  --brand-dark: #0b49c7;
  --green: #0f7b53;
  --amber: #9a5b00;
  --red: #b42318;
  --shadow: 0 10px 30px rgba(15, 23, 42, .08);
}

* {
  box-sizing: border-box;
}

[v-cloak] {
  display: none;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text);
  border-radius: 6px;
  min-height: 36px;
  padding: 0 12px;
  cursor: pointer;
  white-space: nowrap;
}

button:hover {
  border-color: #98a7b8;
  background: #f8fafc;
}

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

button.primary:hover {
  background: var(--brand-dark);
}

button.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
}

button.ghost:hover {
  color: var(--text);
  background: var(--panel-soft);
}

button.danger {
  border-color: #f1a6a0;
  color: var(--red);
  background: #fff;
}

button.danger:hover {
  border-color: var(--red);
  background: #fff5f4;
}

button:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 5;
}

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

.device-mark {
  width: 38px;
  height: 38px;
  border: 2px solid #202939;
  border-radius: 8px;
  position: relative;
  background: #eef4ff;
  flex: 0 0 auto;
}

.device-mark::before,
.device-mark::after {
  content: "";
  position: absolute;
  left: 10px;
  width: 14px;
  height: 8px;
  border: 2px solid #202939;
  border-radius: 4px;
  background: #fff;
}

.device-mark::before {
  top: -10px;
}

.device-mark::after {
  bottom: -10px;
}

.brand h1 {
  margin: 0;
  font-size: 19px;
  line-height: 1.1;
  font-weight: 700;
}

.brand small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
  font-size: 12px;
}

.status-strip {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pill {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  flex: 0 0 auto;
}

.login-shell {
  min-height: calc(100vh - 64px);
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(100%, 390px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.login-header {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.login-header h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.login-header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-form label {
  display: grid;
  gap: 6px;
}

.login-form label span {
  color: #344054;
  font-size: 12px;
  font-weight: 600;
}

.login-form button {
  margin-top: 2px;
}

.app-shell {
  max-width: 1800px;
  margin: 0 auto;
  padding: 16px;
}

.tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
  overflow-x: auto;
}

.tab-button {
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  min-height: 42px;
  padding: 0 14px;
}

.tab-button:hover,
.tab-button.active {
  color: var(--brand);
  background: transparent;
  border-bottom-color: var(--brand);
}

.layout {
  display: grid;
  grid-template-columns: minmax(300px, 390px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.platform-layout {
  display: grid;
  grid-template-columns: minmax(330px, 430px) minmax(0, 1fr);
  gap: 16px;
}

.right-stack {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.watch-panel {
  position: sticky;
  top: 82px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.panel-header {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.panel-header h2 {
  margin: 0;
  font-size: 15px;
  line-height: 1.2;
}

.panel-body {
  padding: 14px;
}

.watch-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-bottom: 12px;
}

.field,
.form-grid label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field span,
.form-grid label span {
  color: #344054;
  font-size: 12px;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 6px;
  min-height: 38px;
  padding: 8px 10px;
  color: var(--text);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(21, 94, 239, .12);
}

textarea {
  resize: vertical;
  min-height: 96px;
  line-height: 1.5;
  word-break: break-word;
}

.watch-list {
  display: grid;
  gap: 8px;
  max-height: 760px;
  overflow: auto;
  padding-right: 2px;
}

.watch-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  display: grid;
  gap: 8px;
  background: #fff;
  text-align: left;
}

.watch-row.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(21, 94, 239, .11);
}

.platform-list {
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 245px);
  overflow: auto;
  padding-right: 2px;
}

.platform-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  display: grid;
  gap: 8px;
  background: #fff;
  text-align: left;
  white-space: normal;
}

.platform-row.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(21, 94, 239, .11);
}

.platform-row header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.platform-row strong {
  min-width: 0;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.watch-row header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.watch-row strong {
  font-size: 14px;
  overflow-wrap: anywhere;
}

.watch-meta {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.watch-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.watch-endurance {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.battery-range {
  display: flex;
  align-items: center;
  gap: 8px;
}

.battery-chart {
  display: flex;
  gap: 8px;
}

.battery-chart-y {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
  padding-bottom: 18px;
  text-align: right;
}

.battery-chart-plot {
  flex: 1;
  min-width: 0;
  position: relative;
}

.battery-chart-plot svg {
  width: 100%;
  height: 180px;
  display: block;
}

.battery-chart-plot .grid {
  stroke: rgba(148, 163, 184, 0.35);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.battery-chart-plot .curve {
  fill: none;
  stroke: #155eef;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.battery-chart-plot .dot {
  fill: #155eef;
}

.battery-chart-plot .dot.active {
  fill: #0b3fb8;
  stroke: #fff;
  stroke-width: 1.5;
}

.chart-tip {
  position: absolute;
  transform: translate(10px, -50%);
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.88);
  color: #fff;
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
  pointer-events: none;
  z-index: 5;
}

.chart-tip.flip {
  transform: translate(calc(-100% - 10px), -50%);
}

.battery-chart-x {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
  margin-top: 4px;
}

.cycle-section {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.cycle-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.cycle-header strong {
  font-size: 13px;
}

.cycle-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.cycle-table th,
.cycle-table td {
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.cycle-table th {
  color: var(--muted);
  font-weight: 500;
  background: #f8fafc;
}

.watch-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.6;
  font-weight: 500;
  background: #f1f5f9;
  color: #475569;
  white-space: nowrap;
}

.watch-badge.battery {
  background: #ecfdf5;
  color: #047857;
}

.watch-badge.mode {
  background: #eff6ff;
  color: #1d4ed8;
}

.watch-badge.freq {
  background: #fefce8;
  color: #a16207;
}

.watch-badge.power {
  background: #fdf2f8;
  color: #be185d;
}

.watch-badge.chart {
  background: #eef2ff;
  color: #4338ca;
  cursor: pointer;
}

.watch-badge.chart:hover {
  background: #e0e7ff;
}

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.45);
}

.modal {
  width: min(720px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.modal-header h3 {
  margin: 0 0 2px;
  font-size: 15px;
}

.modal-close {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  padding: 4px;
  cursor: pointer;
}

.modal-close:hover {
  color: #0f172a;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px 16px;
}

.command-grid {
  display: grid;
  grid-template-columns: minmax(300px, 460px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.command-description {
  margin-top: 10px;
}

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

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

.checkbox-field {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: var(--panel-soft);
}

.checkbox-field input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  accent-color: var(--brand);
}

.summary {
  display: grid;
  gap: 10px;
}

.callout {
  border: 1px solid #f2c94c;
  background: #fffbeb;
  color: var(--amber);
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.5;
}

.muted {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.action-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.preview-label {
  margin-bottom: 6px;
}

.preview-box,
.history-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b1220;
  color: #d9e6ff;
  padding: 12px;
  min-height: 120px;
  max-height: 300px;
  overflow: auto;
  line-height: 1.5;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.history-box {
  background: #fff;
  color: var(--text);
  max-height: 230px;
}

.history-item {
  display: grid;
  gap: 4px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

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

.record-list {
  display: grid;
  gap: 8px;
  max-height: 520px;
  overflow: auto;
  padding-right: 2px;
}

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

.history-toolbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.record-row {
  width: 100%;
  height: auto;
  min-height: 0;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
  white-space: normal;
}

.record-row.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(21, 94, 239, .11);
}

.record-row header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.record-heading {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.record-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.record-inline-label {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef4ff;
  color: #155eef;
  border: 1px solid #c7d7fe;
  font-size: 12px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.record-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.record-body {
  color: #344054;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
  max-height: 42px;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.record-json {
  margin: 0;
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b1220;
  color: #d9e6ff;
  padding: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.history-pagination {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.binding-detail {
  display: grid;
  gap: 14px;
}

.binding-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.binding-table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: auto;
}

.binding-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 13px;
}

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

.binding-table th {
  background: var(--panel-soft);
  color: #344054;
  font-size: 12px;
  font-weight: 700;
}

.binding-table tr:last-child td {
  border-bottom: 0;
}

.binding-table td:last-child {
  width: 96px;
}

.table-empty {
  height: 120px;
  color: var(--muted);
  text-align: center;
}

.status-text {
  font-weight: 700;
}

.ok {
  color: var(--green);
}

.bad {
  color: var(--red);
}

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

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  max-width: min(460px, calc(100vw - 32px));
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow);
  display: none;
  z-index: 10;
  line-height: 1.45;
}

.toast.show {
  display: block;
}

.toast.error {
  border-color: #f1a6a0;
  color: var(--red);
}

.toast.success {
  border-color: #9ed8bd;
  color: var(--green);
}

.server-layout {
  display: grid;
  grid-template-columns: minmax(0, 720px);
  gap: 16px;
}

.trajectory-layout {
  display: grid;
  grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.trajectory-sidebar {
  position: sticky;
  top: 82px;
}

.trajectory-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-bottom: 12px;
}

.trajectory-device-list,
.trajectory-selected {
  display: grid;
  gap: 8px;
}

.trajectory-device-list {
  max-height: 430px;
  overflow: auto;
  padding-right: 2px;
}

.trajectory-selected {
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 12px;
}

.trajectory-device-row,
.trajectory-layer-row {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 9px 10px;
  min-width: 0;
}

.trajectory-device-row.selected {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(21, 94, 239, .09);
}

.trajectory-device-row input,
.trajectory-layer-row input {
  width: 16px;
  height: 16px;
  min-height: 16px;
  padding: 0;
  accent-color: var(--brand);
}

.trajectory-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--line-strong);
  flex: 0 0 auto;
}

.trajectory-device-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.trajectory-device-main strong,
.trajectory-layer-row span {
  overflow-wrap: anywhere;
}

.trajectory-layer-row {
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  font-size: 13px;
}

.trajectory-main {
  overflow: hidden;
}

.trajectory-toolbar {
  display: grid;
  grid-template-columns: minmax(190px, 240px) minmax(190px, 240px) auto auto auto auto auto;
  align-items: end;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.trajectory-live-switch {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  background: var(--panel-soft);
  white-space: nowrap;
}

.trajectory-live-switch input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  accent-color: var(--brand);
}

.trajectory-map-wrap {
  position: relative;
  min-height: 560px;
  background: #eef2f7;
}

.trajectory-map {
  width: 100%;
  height: min(68vh, 680px);
  min-height: 560px;
}

.trajectory-map-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(248, 250, 252, .86);
  color: var(--muted);
  text-align: center;
  z-index: 2;
}

.trajectory-map-state.error {
  color: var(--red);
}

.trajectory-map-alert {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 12px;
  border: 1px solid #f2c94c;
  background: #fffbeb;
  color: var(--amber);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13px;
  line-height: 1.45;
  z-index: 3;
}

.trajectory-timeline {
  display: grid;
  gap: 8px;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--line);
}

.trajectory-timeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.trajectory-timeline-header strong {
  color: var(--text);
  font-size: 13px;
}

.trajectory-timeline input[type="range"] {
  padding: 0;
  min-height: 26px;
  accent-color: var(--brand);
}

.empty.small {
  min-height: 56px;
  padding: 10px;
}

.trajectory-info {
  display: grid;
  gap: 5px;
  color: #18202b;
  font-size: 12px;
  line-height: 1.45;
}

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

.config-action-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(120px, 200px);
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.config-action-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.config-action-inputs input[type="number"] {
  width: 110px;
}

.config-action-inputs input:disabled,
.config-action-inputs select:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.config-unit-label {
  color: var(--muted);
  font-size: 13px;
}

.config-action-hint {
  font-size: 12px;
  text-align: right;
}

.server-config-actions {
  margin-top: 4px;
}

.config-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  margin-bottom: 12px;
}

.switch {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  width: 44px;
  height: 24px;
  cursor: pointer;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.switch-slider {
  position: absolute;
  inset: 0;
  background: var(--line-strong);
  border-radius: 999px;
  transition: background .2s ease;
}

.switch-slider::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s ease;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .3);
}

.switch input:checked + .switch-slider {
  background: var(--brand);
}

.switch input:checked + .switch-slider::before {
  transform: translateX(20px);
}

.switch input:disabled + .switch-slider {
  opacity: .55;
  cursor: not-allowed;
}

@media (max-width: 980px) {
  .layout,
  .command-grid,
  .platform-layout,
  .server-layout,
  .record-grid,
  .trajectory-layout,
  .trajectory-toolbar {
    grid-template-columns: 1fr;
  }

  .watch-list,
  .platform-list {
    max-height: 360px;
  }

  .watch-panel {
    position: static;
  }

  .trajectory-sidebar {
    position: static;
  }

  .trajectory-map,
  .trajectory-map-wrap {
    min-height: 420px;
  }
}

@media (max-width: 640px) {
  .topbar {
    height: auto;
    padding: 12px;
    align-items: flex-start;
    flex-direction: column;
  }

  .status-strip {
    justify-content: flex-start;
  }

  .app-shell {
    padding: 10px;
  }

  .form-grid,
  .watch-tools,
  .binding-form,
  .history-toolbar,
  .trajectory-search {
    grid-template-columns: 1fr;
  }

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

  button {
    width: 100%;
  }

  .status-strip {
    width: 100%;
  }

  .action-row {
    display: grid;
  }

  .history-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .history-pagination-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .trajectory-device-row,
  .trajectory-layer-row {
    grid-template-columns: auto auto minmax(0, 1fr);
  }

  .trajectory-device-row .status-text,
  .trajectory-layer-row .muted {
    grid-column: 3;
  }

  .trajectory-timeline-header {
    align-items: flex-start;
    flex-direction: column;
  }
}
