/* =========================================================
   云枢设备云 · Pages
   ========================================================= */

/* ================= Dashboard ================= */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.stat-card {
  position: relative;
  padding: 17px 18px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .025);
  overflow: hidden;
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.stat-card::after {
  content: "";
  position: absolute;
  top: -42px;
  right: -42px;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(47, 107, 255, .045), transparent 68%);
  pointer-events: none;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(16, 24, 40, .075); border-color: #dde5f0; }
.stat-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stat-label { font-size: 12px; font-weight: 550; color: #667085; }
.stat-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
}
.stat-icon .ico { width: 17px; height: 17px; }
.tint-blue { background: #edf3ff; color: #2f6bff; }
.tint-mint { background: #eafaf2; color: #0e9f5d; }
.tint-indigo { background: #f0efff; color: #6d4df6; }
.tint-amber { background: #fff6e6; color: #e58a05; }
.tint-purple { background: #f3efff; color: #7a5af8; }
.tint-red { background: #fef1f0; color: #e53e32; }
.stat-main { display: flex; align-items: baseline; gap: 9px; margin-top: 6px; }
.stat-main strong {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -.04em;
  line-height: 1.15;
  color: #0e1728;
  font-variant-numeric: tabular-nums;
}
.stat-main strong small { font-size: 17px; font-weight: 650; color: #344054; letter-spacing: -.02em; }
.delta {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
}
.delta .ico { width: 10px; height: 10px; stroke-width: 2.4; }
.delta.is-up { color: #067647; background: #ecfaf3; }
.delta.is-flat { color: #667085; background: #f3f5f8; font-weight: 500; }
.stat-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px dashed #edf0f5;
  font-size: 10.5px;
  color: #98a2b3;
}
.stat-foot span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-foot b { font-weight: 650; }
.spark { width: 76px; height: 22px; flex: none; opacity: .85; overflow: visible; }

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}
.chart-card { grid-column: span 8; min-width: 0; }
.donut-card { grid-column: span 4; min-width: 0; }
.live-card { grid-column: span 8; min-width: 0; overflow: hidden; }
.side-stack { grid-column: span 4; display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.chart-wrap { position: relative; height: 244px; margin: 6px 10px 0 6px; }
.chart-wrap svg { width: 100%; height: 100%; overflow: visible; }
.chart-wrap .axis-text { font-size: 9.5px; fill: #98a2b3; font-family: var(--font); }
.chart-wrap .grid-line { stroke: #eef2f7; stroke-width: 1; }
.chart-wrap .hover-line { stroke: #b8c4d6; stroke-width: 1; stroke-dasharray: 3 4; opacity: 0; }
.chart-wrap .hover-dot { opacity: 0; }
.chart-wrap.is-hovering .hover-line, .chart-wrap.is-hovering .hover-dot { opacity: 1; }
.chart-tip {
  position: absolute;
  z-index: 5;
  min-width: 132px;
  padding: 9px 11px;
  border-radius: 9px;
  background: rgba(13, 24, 41, .95);
  color: #fff;
  box-shadow: 0 8px 20px rgba(16, 24, 40, .2);
  pointer-events: none;
  transform: translate(-50%, -100%);
  backdrop-filter: blur(6px);
}
.chart-tip .tip-time { font-size: 9px; color: #8fa3bd; margin-bottom: 5px; }
.chart-tip .tip-row { display: flex; align-items: center; gap: 6px; font-size: 10px; color: #c8d4e4; line-height: 1.7; }
.chart-tip .tip-row b { margin-left: auto; color: #fff; font-size: 11px; padding-left: 12px; }
.chart-tip i { width: 5px; height: 5px; border-radius: 50%; flex: none; }
.chart-legend { display: flex; align-items: center; gap: 13px; padding-top: 3px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--muted); }
.legend-dot { width: 6px; height: 6px; border-radius: 50%; }
.dot-blue { background: #2f6bff; }
.dot-mint { background: #12b76a; }
.chart-footnote {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 22px;
  padding: 12px 0 17px;
  border-top: 1px solid #f1f4f8;
  font-size: 10.5px;
  color: var(--muted-2);
}
.chart-footnote b { color: #067647; }

.donut-wrap { position: relative; width: 168px; height: 168px; margin: 12px auto 0; }
.donut-wrap svg { width: 100%; height: 100%; transform: rotate(0deg); }
.donut-wrap circle { transition: stroke-dasharray .5s ease; }
.donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.donut-center span { font-size: 9.5px; color: #98a2b3; letter-spacing: .04em; }
.donut-center strong { font-size: 25px; letter-spacing: -.04em; line-height: 1.25; color: #101828; }
.donut-center small { font-size: 9.5px; color: #b0b9c6; }
.donut-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; padding: 5px 22px 0; }
.donut-legend-item { display: flex; align-items: center; gap: 7px; min-width: 0; }
.donut-legend-item i { width: 7px; height: 7px; border-radius: 2px; flex: none; }
.donut-legend-item span { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.donut-legend-item b { margin-left: auto; font-size: 10px; color: #344054; font-weight: 600; }
.donut-foot {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 14px 18px 16px;
  padding: 9px 11px;
  border-radius: 9px;
  background: #fffaef;
  font-size: 10px;
  color: #8a5b08;
}
.donut-foot .link-btn { margin-left: auto; font-size: 10px; }

.live-card .card-head { padding-bottom: 11px; }
.live-card .table-scroll { margin-top: 4px; }
.live-device { display: flex; align-items: center; gap: 9px; min-width: 0; }
.live-device-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #f2f6fc;
  color: #5b7ca8;
  flex: none;
}
.live-device-icon .ico { width: 15px; height: 15px; }
.live-device strong { display: block; font-size: 11.5px; font-weight: 600; color: #344054; line-height: 1.2; }
.live-device span { display: block; margin-top: 2px; font-size: 9.5px; color: #98a2b3; font-family: var(--mono); }
.live-table-group { font-size: 10.5px; color: #667085; white-space: nowrap; }
.live-time { font-size: 10px; color: #98a2b3; }
.live-time b { font-weight: 550; color: #667085; }

.signal-cell { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.signal-bars-mini { display: flex; align-items: flex-end; gap: 1.5px; height: 12px; }
.signal-bars-mini i { width: 2.5px; border-radius: 1px; background: #d8e0eb; }
.signal-bars-mini i:nth-child(1) { height: 4px; }
.signal-bars-mini i:nth-child(2) { height: 6.5px; }
.signal-bars-mini i:nth-child(3) { height: 9px; }
.signal-bars-mini i:nth-child(4) { height: 11.5px; }
.signal-bars-mini i.on { background: #12b76a; }
.signal-bars-mini i.on.mid { background: #f79009; }
.signal-bars-mini i.on.weak { background: #f04438; }
.signal-cell span { font-size: 10px; color: #98a2b3; font-variant-numeric: tabular-nums; }

.todo-card .card-head { padding-bottom: 10px; }
.alert-list { padding: 0 12px 12px; }
.alert-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 10px;
  border-radius: 10px;
  transition: background .15s;
  cursor: pointer;
}
.alert-item + .alert-item { border-top: 1px solid #f2f4f8; border-radius: 0 0 10px 10px; }
.alert-item:hover { background: #f8fafc; }
.alert-icon {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  flex: none;
}
.alert-icon .ico { width: 15px; height: 15px; }
.alert-icon.is-red { background: #fef1f0; color: #e53e32; }
.alert-icon.is-amber { background: #fff7e8; color: #d97a06; }
.alert-icon.is-blue { background: #eef4ff; color: #2f6bff; }
.alert-copy { min-width: 0; flex: 1; }
.alert-copy strong { display: block; font-size: 11.5px; font-weight: 600; color: #344054; }
.alert-copy p { margin-top: 2px; font-size: 10px; line-height: 1.45; color: #98a2b3; }
.alert-copy em { display: block; margin-top: 4px; font-style: normal; font-size: 9.5px; color: #b0b9c6; }
.alert-item .link-btn { flex: none; align-self: center; font-size: 10.5px; }

.signal-card .card-head { padding-bottom: 13px; }
.signal-bars { display: flex; flex-direction: column; gap: 11px; padding: 0 22px; }
.signal-row { display: grid; grid-template-columns: 67px 1fr 38px; align-items: center; gap: 9px; }
.signal-row > span { display: flex; align-items: center; gap: 6px; font-size: 10px; color: var(--muted); white-space: nowrap; }
.signal-row b { font-size: 10px; color: #475467; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.sig-dot { width: 5px; height: 5px; border-radius: 50%; }
.sig-strong { background: #12b76a; }
.sig-mid { background: #f79009; }
.sig-weak { background: #f04438; }
.meter { height: 5px; border-radius: 99px; background: #f0f3f7; overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 99px; background: #12b76a; }
.meter i.mid { background: #f79009; }
.meter i.weak { background: #f04438; }
.signal-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 16px 16px 16px;
  padding: 9px 10px;
  border-radius: 9px;
  background: #f8fafc;
  color: #8a94a6;
  font-size: 9.5px;
  line-height: 1.5;
}
.signal-note .ico { width: 13px; height: 13px; color: #f79009; margin-top: 1px; }

/* ================= Device list ================= */
.stat-strip {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}
.strip-item {
  flex: 1;
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 14px 18px;
  min-width: 0;
}
.strip-item + .strip-item { border-left: 1px solid #f0f3f7; }
.strip-item span { font-size: 10.5px; color: #7d899b; white-space: nowrap; }
.strip-item strong { font-size: 20px; letter-spacing: -.03em; color: #172033; line-height: 1; }
.strip-item small { margin-left: auto; font-size: 9.5px; color: #98a2b3; white-space: nowrap; }

.table-card { overflow: hidden; }
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 18px;
  border-bottom: 1px solid #eef2f7;
  flex-wrap: wrap;
}
.filter-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-row .search-field { width: 280px; }
.toolbar-actions { display: flex; align-items: center; gap: 6px; }
.toolbar-hint { font-size: 10.5px; color: #a3adbd; }
.device-table { min-width: 1060px; }
.device-cell { display: flex; align-items: center; gap: 10px; min-width: 168px; }
.device-avatar {
  width: 33px;
  height: 33px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #f2f6fc;
  border: 1px solid #e9eff7;
  color: #5b7ca8;
  flex: none;
}
.device-avatar .ico { width: 16px; height: 16px; }
.device-cell strong { display: block; font-size: 11.5px; font-weight: 600; color: #344054; line-height: 1.3; }
.device-cell span { display: block; margin-top: 2px; font-size: 9.5px; color: #98a2b3; font-family: var(--mono); }
.group-tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  background: #f5f7fa;
  color: #5d6b80;
  font-size: 10px;
  white-space: nowrap;
}
.key-tag {
  display: inline-flex;
  align-items: center;
  height: 21px;
  padding: 0 7px;
  border-radius: 5px;
  background: #eef4ff;
  color: #2456c4;
  font-size: 8.5px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: -.02em;
}
.version-stack { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.version-stack .config-version { font-size: 9px; }
.fw-version { display: inline-flex; align-items: center; gap: 4px; font-family: var(--mono); font-size: 10.5px; color: #344054; white-space: nowrap; }
.fw-version::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #b9c4d4; }
.fw-version.is-latest::before { background: #12b76a; }
.config-version { font-family: var(--mono); font-size: 10.5px; color: #667085; white-space: nowrap; }
.config-version.is-stale { color: #b54708; background: #fff7e8; padding: 2px 6px; border-radius: 5px; }
.last-seen { display: flex; flex-direction: column; line-height: 1.25; white-space: nowrap; }
.last-seen b { font-size: 10.5px; font-weight: 550; color: #475467; }
.last-seen small { font-size: 9px; color: #a3adbd; margin-top: 1px; }
.actions-cell { text-align: right; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.table-action {
  height: 27px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--brand);
  font-size: 10.5px;
  font-weight: 600;
}
.table-action:hover { background: var(--brand-soft); }
.row-actions .icon-btn { width: 27px; height: 27px; }
.row-actions .icon-btn .ico { width: 15px; height: 15px; }

/* ================= Device types / KEY ================= */
.code-generate { display: flex; align-items: center; gap: 8px; }
.code-generate input { flex: 1; min-width: 0; letter-spacing: .08em; font-weight: 600; background: #f8fafc; }
.code-generate .btn { flex: none; height: 39px; font-size: 11px; }
.key-table { min-width: 940px; }
.key-name-cell { display: flex; align-items: center; gap: 10px; min-width: 190px; }
.key-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 9px;
  background: #eef4ff;
  border: 1px solid #e1eaff;
  color: #2f6bff;
}
.key-avatar .ico { width: 17px; height: 17px; }
.key-name-cell strong { display: block; font-family: var(--mono); font-size: 10.5px; font-weight: 650; color: #344054; line-height: 1.3; }
.key-name-cell span { display: block; margin-top: 2px; font-size: 9px; color: #98a2b3; }
.key-device-count strong { font-size: 15px; font-weight: 650; color: #344054; }
.key-device-count span { margin-left: 3px; font-size: 9px; color: #98a2b3; }
.key-fw-cell { display: flex; flex-direction: column; gap: 2px; }
.key-fw-cell b { font-family: var(--mono); font-size: 10px; font-weight: 600; color: #344054; }
.key-fw-cell span { font-size: 9px; color: #98a2b3; }
.key-table .table-action { font-size: 10px; }
.key-guide {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 14px;
  padding: 13px 16px;
  border: 1px dashed #dce4ef;
  border-radius: 12px;
  background: rgba(255, 255, 255, .55);
}
.key-guide-step { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.key-guide-step > span {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 6px;
  background: #eef4ff;
  color: #2f6bff;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
}
.key-guide-step b { display: block; font-size: 10px; font-weight: 600; color: #475467; white-space: nowrap; }
.key-guide-step p { font-size: 8.5px; color: #a3adbd; white-space: nowrap; }
.key-guide > .ico { width: 13px; height: 13px; color: #c7d2e0; flex: none; }

/* ================= Sessions ================= */
.stat-grid-4 { margin-bottom: 16px; }
.mini-stat {
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .025);
}
.mini-stat > span { display: block; font-size: 10.5px; color: #7d899b; }
.mini-stat strong { display: block; margin-top: 5px; font-size: 24px; line-height: 1.2; letter-spacing: -.035em; color: #172033; }
.mini-stat strong em { font-style: normal; font-size: 12px; font-weight: 600; color: #667085; letter-spacing: 0; }
.mini-stat small { display: block; margin-top: 4px; font-size: 9.5px; color: #98a2b3; }
.session-device { display: flex; flex-direction: column; line-height: 1.3; }
.session-device b { font-size: 11px; font-weight: 600; color: #344054; }
.session-device span { margin-top: 2px; font-size: 9.5px; color: #98a2b3; font-family: var(--mono); }
.session-id { font-family: var(--mono); font-size: 9.5px; color: #7d899b; }
.session-pair { display: flex; flex-direction: column; gap: 2px; font-size: 10px; line-height: 1.3; color: #475467; }
.session-pair span:last-child { color: #98a2b3; }
.result-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 21px;
  padding: 0 7px;
  border-radius: 6px;
  font-size: 9.5px;
  font-weight: 600;
  white-space: nowrap;
}
.result-pill::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.result-ok { background: #ecfaf3; color: #067647; }
.result-warn { background: #fff7e8; color: #b54708; }
.result-error { background: #fef1f0; color: #b42318; }

/* ================= Config groups ================= */
.config-layout {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.group-panel { padding: 16px 14px 14px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 0 4px 13px; }
.panel-head h2 { font-size: 14px; font-weight: 650; }
.panel-head > div > span { display: block; margin-top: 2px; font-size: 10px; color: #98a2b3; }
.panel-head .icon-btn { width: 29px; height: 29px; margin-top: -3px; }
.group-panel .search-field-sm { margin-bottom: 10px; }
.group-list { display: flex; flex-direction: column; gap: 5px; }
.group-item {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 9px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  text-align: left;
  transition: background .14s, border-color .14s;
}
.group-item:hover { background: #f8fafc; }
.group-item.is-active { background: #f3f7ff; border-color: #dce8ff; }
.group-item .group-avatar { width: 31px; height: 31px; font-size: 11px; }
.group-copy { flex: 1; min-width: 0; }
.group-copy strong { display: block; font-size: 11.5px; font-weight: 600; color: #344054; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.group-copy p { margin-top: 2px; font-size: 9.5px; color: #98a2b3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.group-copy .group-tags { display: flex; align-items: center; gap: 5px; margin-top: 5px; }
.mini-tag {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 5px;
  border-radius: 4px;
  background: #edf2f9;
  color: #667085;
  font-size: 8.5px;
  font-weight: 550;
  white-space: nowrap;
}
.mini-tag.is-draft { color: #b54708; background: #fff7e8; }
.group-side { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; }
.group-side b { font-family: var(--mono); font-size: 9px; color: #7d899b; font-weight: 550; }
.group-side span { font-size: 8.5px; color: #b0b9c6; white-space: nowrap; }
.group-tip {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  padding: 10px;
  border-radius: 9px;
  background: #f8fafc;
  border: 1px dashed #e3e9f1;
}
.group-tip .ico { width: 13px; height: 13px; color: #d9a11a; margin-top: 2px; flex: none; }
.group-tip p { font-size: 9px; line-height: 1.55; color: #98a2b3; }
.group-tip b { color: #667085; font-weight: 600; }

.config-editor { min-width: 0; overflow: hidden; }
.editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 19px 22px 15px;
}
.editor-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.group-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 12px;
  background: linear-gradient(145deg, #1d3557, #2f6bff);
  color: #fff;
  font-size: 14px;
  font-weight: 650;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18);
}
.title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.title-row h2 { font-size: 17px; font-weight: 650; letter-spacing: -.02em; }
.editor-identity p { margin-top: 4px; font-size: 10px; color: #98a2b3; }
.editor-actions { display: flex; gap: 7px; flex: none; }
.tabs { display: flex; align-items: center; gap: 3px; border-bottom: 1px solid #eef2f7; padding: 0 22px; }
.tab {
  position: relative;
  height: 39px;
  padding: 0 11px;
  border: 0;
  background: none;
  color: #7d899b;
  font-size: 11.5px;
  font-weight: 550;
}
.tab:hover { color: #344054; }
.tab.is-active { color: #1d4ed8; font-weight: 600; }
.tab.is-active::after {
  content: "";
  position: absolute;
  left: 11px;
  right: 11px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--brand);
}
.tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  margin-left: 5px;
  padding: 0 4px;
  border-radius: 5px;
  background: #f1f4f9;
  color: #98a2b3;
  font-size: 8.5px;
}
.config-panel { display: none; }
.config-panel.is-active { display: block; }
.config-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 305px;
  gap: 22px;
  padding: 20px 22px 24px;
}
.param-area { min-width: 0; }
.protocol-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}
.protocol-option {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  text-align: left;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.protocol-option:hover { border-color: #c9d8ef; background: #fbfdff; }
.protocol-option.is-active { border-color: #9bb9f8; background: #f5f9ff; box-shadow: 0 0 0 3px rgba(47, 107, 255, .06); }
.protocol-code {
  width: 38px;
  height: 30px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 6px;
  background: #f1f4f9;
  color: #667085;
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 700;
}
.protocol-option.is-active .protocol-code { background: #2f6bff; color: #fff; }
.protocol-option b { display: block; font-size: 10.5px; font-weight: 600; color: #344054; }
.protocol-option small { display: block; margin-top: 2px; font-size: 8.5px; color: #98a2b3; }
.protocol-panel { display: none; }
.protocol-panel.is-active { display: block; animation: pageIn .2s ease both; }
.protocol-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin: 3px 0 12px; }
.protocol-panel-head h3 { font-size: 11.5px; font-weight: 650; color: #475467; }
.protocol-panel-head p { margin-top: 3px; font-size: 9px; line-height: 1.5; color: #98a2b3; }
.protocol-panel-head code { padding: 0 3px; border-radius: 3px; background: #f1f4f9; font-family: var(--mono); font-size: 8.5px; color: #475467; }
.protocol-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 14px;
  padding: 9px 10px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px dashed #e4e9f1;
  font-size: 8.5px;
  line-height: 1.55;
  color: #8a94a6;
}
.protocol-note .ico { width: 12px; height: 12px; color: #7d899b; margin-top: 1px; flex: none; }
.protocol-note code { font-family: var(--mono); font-size: 8px; color: #667085; }
.param-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.param-section-head h3 { font-size: 12.5px; font-weight: 650; color: #344054; }
.param-section-head p { margin-top: 3px; font-size: 9.5px; color: #98a2b3; }
.param-section-head-spaced { margin-top: 23px; }
.draft-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  background: #f4f7fb;
  color: #667085;
  font-size: 9px;
  font-weight: 600;
  flex: none;
}
.draft-pill span { width: 5px; height: 5px; border-radius: 50%; background: #f79009; }
.param-area .form-grid { gap: 13px 12px; }
.param-area .field > span { font-size: 10.5px; }
.input-unit { position: relative; display: flex; align-items: center; }
.input-unit input { padding-right: 38px; }
.input-unit em {
  position: absolute;
  right: 10px;
  font-style: normal;
  font-size: 9.5px;
  color: #98a2b3;
  pointer-events: none;
}
.advanced-box {
  margin-top: 18px;
  border: 1px solid #e7ebf1;
  border-radius: 10px;
  overflow: hidden;
}
.advanced-box summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
  background: #fafbfd;
  font-size: 10.5px;
  font-weight: 550;
  color: #475467;
}
.advanced-box summary::-webkit-details-marker { display: none; }
.advanced-box summary > span { display: inline-flex; align-items: center; gap: 6px; }
.advanced-box summary .ico { width: 14px; height: 14px; color: #7d899b; }
.advanced-box summary .advanced-chevron { transition: transform .2s; }
.advanced-box[open] summary .advanced-chevron { transform: rotate(180deg); }
.advanced-box p { padding: 9px 12px 4px; font-size: 9px; color: #98a2b3; }
.advanced-box textarea {
  display: block;
  width: calc(100% - 24px);
  margin: 4px 12px 12px;
  padding: 10px;
  border: 1px solid #dfe6f0;
  border-radius: 8px;
  background: #fff;
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.6;
  resize: vertical;
  outline: 0;
}
.advanced-box textarea:focus { border-color: rgba(47, 107, 255, .5); box-shadow: 0 0 0 3px rgba(47, 107, 255, .07); }

.config-preview {
  align-self: start;
  border-radius: 13px;
  border: 1px solid #1a2b42;
  background: #0d1829;
  overflow: hidden;
  position: sticky;
  top: 84px;
}
.preview-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-bottom: 1px solid #1a2b42; background: #111f33; }
.preview-title { display: flex; align-items: center; gap: 7px; font-size: 9.5px; font-weight: 550; color: #90a4be; letter-spacing: .03em; }
.code-dots { display: flex; gap: 3px; }
.code-dots i { width: 5px; height: 5px; border-radius: 50%; background: #3a4f6d; }
.code-dots i:first-child { background: #f97066; }
.code-dots i:nth-child(2) { background: #fdb022; }
.code-dots i:nth-child(3) { background: #32d583; }
.config-preview .code-block { max-height: 390px; padding: 13px 14px; font-size: 10px; line-height: 1.68; border-radius: 0; background: transparent; white-space: pre-wrap; word-break: break-all; }
.preview-meta { display: flex; flex-direction: column; gap: 0; margin: 0 12px; padding: 3px 0; border-top: 1px solid #1b2c44; }
.preview-meta > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; font-size: 9px; }
.preview-meta span { color: #6f839d; }
.preview-meta b { color: #c8d6e8; font-weight: 550; font-size: 9px; }
.impact-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 9px 12px 13px;
  padding: 9px 10px;
  border-radius: 8px;
  background: rgba(18, 183, 106, .07);
  border: 1px solid rgba(18, 183, 106, .12);
}
.impact-note .ico { width: 13px; height: 13px; color: #4fd1a1; margin-top: 1px; flex: none; }
.impact-note p { font-size: 8.5px; line-height: 1.55; color: #87a89d; }

.history-table-wrap { padding: 8px 10px 12px; }
.history-table-wrap .data-table td { font-size: 10.5px; }
.history-table-wrap .data-table th { font-size: 9.5px; }
.history-table-wrap .data-table th:first-child, .history-table-wrap .data-table td:first-child { padding-left: 12px; }
.history-table-wrap .data-table th:last-child, .history-table-wrap .data-table td:last-child { padding-right: 12px; }
.version-pill { display: inline-flex; align-items: center; height: 21px; padding: 0 6px; border-radius: 5px; background: #f3f6fb; color: #344054; font-family: var(--mono); font-size: 9.5px; font-weight: 600; }
.change-desc { font-size: 10px; color: #667085; }
.sync-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 9.5px; color: #067647; }
.sync-tag::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: #12b76a; }
.sync-tag.is-pending { color: #b54708; }
.sync-tag.is-pending::before { background: #f79009; }

/* ================= Firmware ================= */
.repo-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 13px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(115deg, #fff, #f8fbff);
}
.repo-summary-main { display: flex; align-items: center; gap: 16px; }
.repo-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: #eef4ff; color: #2f6bff; }
.repo-icon .ico { width: 18px; height: 18px; }
.repo-summary-main > div:not(.repo-divider) { display: flex; align-items: baseline; gap: 5px; }
.repo-summary-main strong { font-size: 18px; letter-spacing: -.02em; color: #172033; }
.repo-summary-main span { font-size: 10px; color: #98a2b3; }
.repo-divider { width: 1px; height: 24px; background: #e7ecf3; }
.repo-summary-note { display: flex; align-items: center; gap: 7px; font-size: 10px; color: #7d899b; }
.firmware-list { display: flex; flex-direction: column; gap: 10px; }
.firmware-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 110px 180px;
  align-items: center;
  gap: 16px;
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .025);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.firmware-card:hover { border-color: #dce5f2; box-shadow: 0 10px 26px rgba(16, 24, 40, .06); transform: translateY(-1px); }
.fw-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 12px; background: linear-gradient(145deg, #eef4ff, #e5edff); color: #2f6bff; border: 1px solid #e1eaff; }
.fw-icon.is-beta { background: linear-gradient(145deg, #f6f1ff, #ede7ff); color: #7a5af8; border-color: #e9e2ff; }
.fw-icon.is-archived { background: #f4f6f9; color: #98a2b3; border-color: #edf0f5; }
.fw-icon .ico { width: 23px; height: 23px; }
.fw-main { min-width: 0; }
.fw-title { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.fw-title h3 { font-size: 15px; font-weight: 650; letter-spacing: -.015em; }
.fw-title .badge { height: 20px; font-size: 9px; }
.fw-latest { display: inline-flex; align-items: center; height: 18px; padding: 0 5px; border-radius: 4px; background: #101828; color: #fff; font-size: 7.5px; font-weight: 700; letter-spacing: .08em; }
.fw-main > p { margin-top: 4px; max-width: 520px; font-size: 10.5px; color: #7d899b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fw-meta { display: flex; align-items: center; gap: 10px; margin-top: 6px; font-size: 9px; color: #a3adbd; flex-wrap: wrap; }
.fw-meta span { display: inline-flex; align-items: center; gap: 3px; }
.fw-meta .mono { font-size: 8.5px; }
.fw-coverage { text-align: left; }
.fw-coverage strong { display: block; font-size: 16px; color: #344054; font-weight: 650; letter-spacing: -.02em; }
.fw-coverage span { font-size: 9px; color: #98a2b3; }
.fw-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.fw-actions .btn { height: 31px; border-radius: 8px; font-size: 10.5px; padding: 0 10px; }
.fw-actions .icon-btn { width: 31px; height: 31px; }
.fw-actions .icon-btn .ico { width: 15px; height: 15px; }

/* ================= Tasks ================= */
.task-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.task-kpi {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.kpi-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; flex: none; }
.kpi-icon .ico { width: 17px; height: 17px; }
.task-kpi > div { display: flex; flex-direction: column; line-height: 1.2; }
.task-kpi strong { font-size: 18px; font-weight: 700; letter-spacing: -.03em; color: #172033; }
.task-kpi span:not(.kpi-icon) { font-size: 9.5px; color: #98a2b3; }
.task-kpi small { margin-left: auto; font-size: 9px; color: #a3adbd; text-align: right; white-space: nowrap; }
.task-list { display: flex; flex-direction: column; gap: 11px; }
.task-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 156px;
  gap: 22px;
  padding: 17px 20px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .025);
  transition: border-color .15s, box-shadow .15s;
}
.task-card:hover { border-color: #dce5f2; box-shadow: 0 10px 28px rgba(16, 24, 40, .055); }
.task-main { min-width: 0; }
.task-title-row { display: flex; align-items: flex-start; gap: 10px; }
.task-type-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 9px;
  background: #f0f4ff;
  color: #2f6bff;
}
.task-type-icon .ico { width: 17px; height: 17px; }
.task-title-copy { min-width: 0; flex: 1; }
.task-title-copy h3 { font-size: 13.5px; font-weight: 650; color: #253044; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-title-copy p { margin-top: 3px; font-size: 9.5px; color: #98a2b3; }
.task-title-row > .badge { margin-top: 2px; flex: none; }
.task-progress { margin-top: 14px; }
.progress-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.progress-head span { font-size: 9px; color: #98a2b3; }
.progress-head b { font-size: 10px; color: #344054; font-weight: 650; font-variant-numeric: tabular-nums; }
.progressbar { height: 6px; border-radius: 99px; background: #f0f3f7; overflow: hidden; }
.progressbar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #2f6bff, #6a9bff); transition: width .6s cubic-bezier(.2, .8, .2, 1); position: relative; }
.progressbar i::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent);
  animation: progressShine 2.2s infinite;
}
.progressbar.is-mint i { background: linear-gradient(90deg, #0e9f5d, #32d583); }
.progressbar.is-amber i { background: linear-gradient(90deg, #e58a05, #fdb022); }
.progressbar.is-gray i { background: #98a2b3; }
.progressbar.is-gray i::after { display: none; }
@keyframes progressShine { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.task-stats { display: flex; align-items: center; gap: 17px; margin-top: 10px; flex-wrap: wrap; }
.task-stat { display: inline-flex; align-items: baseline; gap: 4px; font-size: 9.5px; color: #98a2b3; }
.task-stat b { font-size: 11px; font-weight: 650; color: #475467; font-variant-numeric: tabular-nums; }
.task-stat.is-red b { color: #d92d20; }
.task-stat.is-mint b { color: #067647; }
.task-side { display: flex; flex-direction: column; justify-content: center; align-items: stretch; gap: 9px; border-left: 1px solid #f1f4f8; padding-left: 18px; }
.task-time { display: flex; flex-direction: column; gap: 3px; }
.task-time span { font-size: 9px; color: #a3adbd; }
.task-time b { font-size: 10px; color: #475467; font-weight: 550; }
.task-side .btn { height: 31px; font-size: 10.5px; border-radius: 8px; }

/* Task detail modal */
.task-detail-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.task-detail-summary > div { padding: 11px 12px; border-radius: 10px; background: #f8fafc; }
.task-detail-summary span { display: block; font-size: 9px; color: #98a2b3; }
.task-detail-summary b { display: block; margin-top: 3px; font-size: 15px; letter-spacing: -.02em; color: #344054; }
.device-progress-list { border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.device-progress-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 100px 74px;
  align-items: center;
  gap: 12px;
  padding: 10px 13px;
  border-bottom: 1px solid #f2f4f8;
  font-size: 10.5px;
}
.device-progress-row:last-child { border-bottom: 0; }
.device-progress-row .dp-name { display: flex; flex-direction: column; gap: 1px; }
.device-progress-row .dp-name b { font-size: 10.5px; font-weight: 600; color: #344054; }
.device-progress-row .dp-name span { font-size: 8.5px; color: #a3adbd; }
.dp-state { font-size: 9.5px; color: #667085; }
.dp-state.ok { color: #067647; }
.dp-state.fail { color: #b42318; }
.dp-progress { height: 4px; border-radius: 99px; background: #f0f3f7; overflow: hidden; }
.dp-progress i { display: block; height: 100%; background: #2f6bff; border-radius: 99px; }

/* ================= API docs ================= */
.api-hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 14px;
  padding: 22px 24px;
  border-radius: 16px;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(500px 260px at 90% 0%, rgba(47, 107, 255, .38), transparent 65%),
    radial-gradient(380px 260px at 40% 130%, rgba(18, 183, 106, .14), transparent 65%),
    linear-gradient(120deg, #0b1729, #10233d);
  border: 1px solid #1c3352;
  box-shadow: 0 14px 30px rgba(11, 23, 41, .12);
}
.api-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(148, 175, 220, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(148, 175, 220, .045) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(90deg, #000, transparent 70%);
  pointer-events: none;
}
.api-hero-copy { position: relative; z-index: 1; }
.api-env { display: inline-flex; align-items: center; gap: 6px; font-size: 9px; letter-spacing: .1em; color: #8fb0d8; text-transform: uppercase; }
.api-hero-copy > p { margin: 8px 0 5px; font-size: 9.5px; color: #6f89a8; letter-spacing: .08em; text-transform: uppercase; }
.base-url { display: flex; align-items: center; gap: 7px; }
.base-url code { font-family: var(--mono); font-size: 15px; color: #e5eefb; letter-spacing: -.01em; }
.api-hero .copy-btn { border-color: rgba(255, 255, 255, .12); }
.api-hero-meta { display: flex; align-items: center; gap: 26px; position: relative; z-index: 1; }
.api-hero-meta div { display: flex; flex-direction: column; gap: 4px; }
.api-hero-meta span { font-size: 8.5px; color: #6985a6; text-transform: uppercase; letter-spacing: .09em; }
.api-hero-meta b { font-size: 10px; color: #c5d7ed; font-weight: 550; }

.api-flow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
  padding: 14px 18px;
}
.flow-step { display: flex; align-items: center; gap: 9px; min-width: 0; }
.flow-step > span {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 7px;
  background: #eef4ff;
  color: #2f6bff;
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 700;
}
.flow-step b { display: block; font-size: 10.5px; color: #344054; font-weight: 600; white-space: nowrap; }
.flow-step p { font-size: 8.5px; color: #a3adbd; white-space: nowrap; }
.flow-arrow { color: #c7d2e0; }
.flow-arrow .ico { width: 13px; height: 13px; }

.api-layout { display: grid; grid-template-columns: 196px minmax(0, 1fr); gap: 14px; align-items: start; }
.api-nav {
  position: sticky;
  top: calc(var(--topbar-h) + 16px);
  padding: 12px 9px;
}
.api-nav p { margin: 10px 10px 4px; font-size: 8.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #a3adbd; }
.api-nav p:first-child { margin-top: 3px; }
.api-nav a {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 10.5px;
  color: #667085;
}
.api-nav a .ico { width: 11px; height: 11px; margin-left: auto; color: #b0b9c6; }
.api-nav a:hover { background: #f6f8fb; color: #344054; }
.api-nav a.is-active { background: #eef4ff; color: #1d4ed8; font-weight: 600; }
.api-main { display: flex; flex-direction: column; gap: 13px; min-width: 0; }
.api-section { padding: 20px 22px; scroll-margin-top: calc(var(--topbar-h) + 18px); }
.api-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 9px; }
.api-section-head > div { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.api-section-head h2 { font-size: 15px; font-weight: 650; letter-spacing: -.015em; }
.method-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 21px;
  padding: 0 7px;
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: .04em;
}
.method-chip.post { background: #e8f7ef; color: #067647; }
.method-chip.get { background: #eaf2ff; color: #1d4ed8; }
.method-chip.auth { background: #fff4e5; color: #b54708; }
.method-chip.admin { background: #f1edff; color: #5925dc; }
.method-chip.error { background: #fef0ef; color: #b42318; }
.method-chip.sm { height: 18px; font-size: 7.5px; padding: 0 5px; }
.path { padding: 2px 6px; border-radius: 5px; background: #f4f7fb; color: #475467; font-family: var(--mono); font-size: 10px; }
.api-desc { font-size: 11px; line-height: 1.7; color: #667085; }
.api-desc code, .callout code, .api-hint code {
  padding: 1px 4px;
  border-radius: 4px;
  background: #f2f5fa;
  color: #344054;
  font-family: var(--mono);
  font-size: 9.5px;
}
.api-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 15px; }
.api-cols-40-60 { grid-template-columns: .8fr 1.2fr; }
.api-subhead { font-size: 10.5px; font-weight: 650; color: #344054; margin: 3px 0 7px; }
.param-table { width: 100%; border-collapse: collapse; font-size: 10px; }
.param-table th {
  padding: 7px 8px;
  text-align: left;
  font-size: 8.5px;
  font-weight: 650;
  color: #98a2b3;
  background: #f8fafc;
  border-bottom: 1px solid #edf1f6;
  white-space: nowrap;
}
.param-table td { padding: 7px 8px; border-bottom: 1px solid #f2f4f8; color: #667085; vertical-align: top; line-height: 1.5; }
.param-table tr:last-child td { border-bottom: 0; }
.param-table code { font-family: var(--mono); font-size: 9px; color: #344054; background: #f5f8fc; padding: 1px 4px; border-radius: 4px; white-space: nowrap; }
.param-table td:nth-child(2) { color: #98a2b3; white-space: nowrap; }
.callout {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 9px;
  background: #fffbf2;
  border: 1px solid #f8ebd2;
}
.callout .ico { width: 14px; height: 14px; color: #d9a11a; margin-top: 1px; flex: none; }
.callout p { font-size: 9.5px; line-height: 1.65; color: #8a6a2a; }
.api-section .code-sample { margin-top: 14px; }
.api-section .code-block { max-height: 360px; }
.state-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.state-flow span { padding: 4px 6px; border-radius: 5px; background: #f2f5fa; color: #475467; font-family: var(--mono); font-size: 8.5px; }
.state-flow span.ok { background: #e8f7ef; color: #067647; }
.state-flow i { font-style: normal; font-size: 9px; color: #b0b9c6; }
.api-hint { margin-top: 8px; font-size: 9px; line-height: 1.6; color: #98a2b3; }
.endpoint-table td:first-child { width: 50px; }
.error-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.error-grid > div { padding: 10px 11px; border-radius: 9px; border: 1px solid #eef2f7; background: #fbfcfe; }
.error-grid code { display: inline-block; font-family: var(--mono); font-size: 9.5px; color: #b42318; font-weight: 650; }
.error-grid span { display: inline-block; margin-left: 6px; font-size: 9px; color: #344054; font-weight: 600; }
.error-grid p { margin-top: 3px; font-size: 8.5px; color: #98a2b3; line-height: 1.5; }

/* ================= Playground ================= */
.playground-layout { display: grid; grid-template-columns: 390px minmax(0, 1fr); gap: 14px; align-items: start; }
.playground-form { padding: 0 20px 18px; }
.playground-form .card-head { padding: 18px 0 15px; }
.playground-form .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.playground-form .field input, .playground-form .field select { height: 36px; font-size: 11px; }
.playground-form .field > span { font-size: 10px; }
.playground-form .btn-block { margin-top: 16px; height: 40px; }
.playground-note { display: flex; align-items: center; gap: 6px; justify-content: center; margin-top: 9px; font-size: 8.5px; color: #a3adbd; }
.playground-note .ico { width: 11px; height: 11px; }
.playground-response {
  border-color: #1a2b42;
  background: #0d1829;
  overflow: hidden;
  min-width: 0;
}
.response-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid #1b2c44;
  background: #111f33;
  flex-wrap: wrap;
}
.response-status { display: flex; align-items: center; gap: 9px; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; height: 23px; padding: 0 8px; border-radius: 6px; background: rgba(18, 183, 106, .13); color: #6ee7b7; font-family: var(--mono); font-size: 9px; font-weight: 650; }
.status-pill .live-dot { background: #34d399; box-shadow: 0 0 0 3px rgba(52, 211, 153, .12); }
.latency { font-family: var(--mono); font-size: 8.5px; color: #637b99; }
.response-tabs { display: flex; gap: 2px; }
.response-tabs button { height: 26px; padding: 0 9px; border: 0; border-radius: 6px; background: transparent; color: #7188a4; font-size: 9.5px; }
.response-tabs button:hover { color: #c5d5e9; background: rgba(255, 255, 255, .04); }
.response-tabs button.is-active { color: #dce9f9; background: rgba(255, 255, 255, .075); }
.response-panel { display: none; }
.response-panel.is-active { display: block; }
.response-code { min-height: 500px; max-height: 620px; padding: 17px 19px; background: transparent; font-size: 10.5px; line-height: 1.8; }
.response-head + .response-panel .response-code { border-radius: 0; }
.response-panel .code-head { background: transparent; border-bottom: 1px solid #1b2c44; }
.response-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 16px;
  border-top: 1px solid #1b2c44;
  background: #0b1523;
  color: #637b99;
  font-size: 8.5px;
}
.response-foot span { display: inline-flex; align-items: center; gap: 4px; }
.response-foot .ico { width: 11px; height: 11px; }
.response-foot code { font-family: var(--mono); color: #8ea6c2; }

/* ================= Drawer content ================= */
.profile-hero { display: flex; align-items: flex-start; gap: 13px; padding-bottom: 17px; }
.profile-avatar {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 14px;
  background: linear-gradient(145deg, #eef4ff, #e3edff);
  color: #2f6bff;
  border: 1px solid #dfe9fb;
}
.profile-avatar .ico { width: 27px; height: 27px; }
.profile-copy { flex: 1; min-width: 0; }
.profile-copy h3 { display: flex; align-items: center; gap: 7px; font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.profile-copy p { margin-top: 3px; font-size: 10.5px; color: #98a2b3; font-family: var(--mono); }
.profile-tags { display: flex; align-items: center; gap: 6px; margin-top: 7px; flex-wrap: wrap; }
.profile-actions { display: flex; gap: 6px; margin-top: 2px; flex-wrap: wrap; }
.profile-actions .btn { height: 31px; font-size: 10.5px; }
.detail-tabs { display: flex; gap: 3px; border-bottom: 1px solid var(--line); margin-bottom: 17px; }
.detail-tab { height: 35px; padding: 0 10px; border: 0; background: none; color: #7d899b; font-size: 11px; font-weight: 550; position: relative; }
.detail-tab.is-active { color: #1d4ed8; font-weight: 600; }
.detail-tab.is-active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--brand); }
.detail-panel { display: none; }
.detail-panel.is-active { display: block; }
.detail-section { margin-bottom: 19px; }
.detail-section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.detail-section-head h4 { font-size: 10.5px; font-weight: 650; color: #475467; letter-spacing: .03em; text-transform: uppercase; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid #edf1f6; border-radius: 11px; overflow: hidden; }
.info-item { padding: 10px 12px; border-bottom: 1px solid #f1f4f8; min-width: 0; }
.info-item:nth-child(odd) { border-right: 1px solid #f1f4f8; }
.info-item:nth-last-child(-n+2) { border-bottom: 0; }
.info-item span { display: block; font-size: 9px; color: #98a2b3; margin-bottom: 3px; }
.info-item b { display: block; font-size: 10.5px; color: #344054; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.info-item b.mono { font-family: var(--mono); font-size: 9.5px; }
.stat-inline { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat-inline > div { padding: 10px 11px; border-radius: 9px; background: #f8fafc; }
.stat-inline span { display: block; font-size: 8.5px; color: #98a2b3; }
.stat-inline b { display: block; margin-top: 3px; font-size: 14px; letter-spacing: -.02em; color: #344054; }
.stat-inline b small { font-size: 9px; color: #98a2b3; font-weight: 400; letter-spacing: 0; }
.mini-table-wrap { border: 1px solid #edf1f6; border-radius: 10px; overflow: hidden; }
.mini-table { width: 100%; border-collapse: collapse; font-size: 9.5px; }
.mini-table th { padding: 7px 10px; background: #f8fafc; text-align: left; font-size: 8.5px; color: #98a2b3; font-weight: 550; border-bottom: 1px solid #edf1f6; white-space: nowrap; }
.mini-table td { padding: 8px 10px; border-bottom: 1px solid #f3f5f9; color: #667085; white-space: nowrap; }
.mini-table tr:last-child td { border-bottom: 0; }
.mini-table .mono { font-size: 8.5px; }
.code-light { margin: 0; padding: 12px 13px; border-radius: 10px; background: #f7f9fc; border: 1px solid #edf1f6; font-family: var(--mono); font-size: 9.5px; line-height: 1.7; color: #475467; overflow: auto; }
.config-list { display: flex; flex-direction: column; border: 1px solid #edf1f6; border-radius: 10px; overflow: hidden; }
.config-row { display: flex; align-items: center; gap: 8px; padding: 8px 11px; border-bottom: 1px solid #f2f5f9; font-size: 10px; }
.config-row:last-child { border-bottom: 0; }
.config-row span { color: #7d899b; }
.config-row b { margin-left: auto; font-family: var(--mono); font-size: 9.5px; color: #344054; font-weight: 550; }
.timeline { position: relative; padding-left: 16px; }
.timeline::before { content: ""; position: absolute; left: 4px; top: 5px; bottom: 7px; width: 1px; background: #e8edf4; }
.timeline-item { position: relative; padding-bottom: 15px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before { content: ""; position: absolute; left: -15px; top: 4px; width: 7px; height: 7px; border-radius: 50%; background: #fff; border: 2px solid #b9c8dd; }
.timeline-item.is-ok::before { border-color: #12b76a; background: #ecfaf3; }
.timeline-item.is-warn::before { border-color: #f79009; background: #fff7e8; }
.timeline-item.is-error::before { border-color: #f04438; background: #fef1f0; }
.timeline-item strong { display: block; font-size: 10.5px; font-weight: 600; color: #344054; }
.timeline-item p { margin-top: 2px; font-size: 9.5px; color: #98a2b3; line-height: 1.5; }
.timeline-item time { font-size: 8.5px; color: #b0b9c6; }
.drawer-empty { padding: 30px 10px; text-align: center; color: #98a2b3; font-size: 10.5px; }

/* ================= Action list ================= */
.action-list { display: flex; flex-direction: column; gap: 6px; }
.action-row {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px 11px;
  border: 1px solid #edf1f6;
  border-radius: 10px;
  background: #fff;
  text-align: left;
  transition: background .14s, border-color .14s;
}
.action-row:hover { background: #f8fbff; border-color: #dce8ff; }
.action-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 8px;
  background: #f2f6fc;
  color: #2f6bff;
}
.action-icon .ico { width: 16px; height: 16px; }
.action-row > span:nth-child(2) { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.action-row b { font-size: 11px; font-weight: 600; color: #344054; }
.action-row small { font-size: 9px; color: #98a2b3; }
.action-row > .ico { width: 14px; height: 14px; color: #c0cad8; }

/* ================= Modal content ================= */
.modal-note { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border-radius: 9px; background: #f7f9fc; border: 1px solid #edf1f6; font-size: 10px; line-height: 1.6; color: #667085; }
.modal-note .ico { width: 14px; height: 14px; color: #7d899b; margin-top: 1px; flex: none; }
.modal-note.is-warn { background: #fffbf2; border-color: #f8ebd2; color: #8a6a2a; }
.modal-note.is-warn .ico { color: #d9a11a; }
.confirm-block { text-align: center; padding: 5px 0 3px; }
.confirm-icon { width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto 11px; border-radius: 14px; background: #fff7e8; color: #d97a06; }
.confirm-icon .ico { width: 23px; height: 23px; }
.confirm-block h3 { font-size: 14px; font-weight: 650; }
.confirm-block p { margin-top: 6px; font-size: 10.5px; line-height: 1.65; color: #7d899b; }
.confirm-meta { display: flex; justify-content: center; gap: 18px; margin-top: 14px; padding: 10px; border-radius: 9px; background: #f8fafc; }
.confirm-meta div { text-align: center; }
.confirm-meta span { display: block; font-size: 8.5px; color: #98a2b3; }
.confirm-meta b { display: block; margin-top: 2px; font-size: 12px; color: #344054; }
.upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 23px 16px;
  border: 1.5px dashed #d6dfeb;
  border-radius: 11px;
  background: #fbfcfe;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.upload-zone:hover { border-color: #9bb9f8; background: #f8fbff; }
.upload-zone .upload-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: #eef4ff; color: #2f6bff; }
.upload-zone .upload-icon .ico { width: 19px; height: 19px; }
.upload-zone b { font-size: 11px; color: #344054; }
.upload-zone span { font-size: 9px; color: #98a2b3; }
.upload-zone em { font-style: normal; font-size: 9px; color: #2f6bff; font-weight: 550; }
.form-hint { margin-top: 4px; font-size: 9px; color: #a3adbd; }
.radio-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.radio-card { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 10px 11px; border: 1px solid #e2e8f1; border-radius: 9px; cursor: pointer; }
.radio-card input { position: absolute; opacity: 0; }
.radio-card b { font-size: 10.5px; color: #344054; font-weight: 600; }
.radio-card span { font-size: 8.5px; color: #98a2b3; }
.radio-card:has(input:checked) { border-color: #8fb3ff; background: #f5f9ff; box-shadow: 0 0 0 3px rgba(47, 107, 255, .06); }
.check-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; font-size: 10.5px; color: #475467; }
.check-row input { width: 14px; height: 14px; accent-color: var(--brand); }

/* ================= Responsive ================= */
@media (max-width: 1240px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .chart-card { grid-column: span 12; }
  .donut-card { grid-column: span 5; }
  .live-card { grid-column: span 7; }
  .side-stack { grid-column: span 5; }
  .config-layout { grid-template-columns: 260px minmax(0, 1fr); }
  .config-body { grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; }
  .api-hero-meta { gap: 16px; }
}

@media (max-width: 1080px) {
  :root { --sidebar-w: 84px; }
  .sidebar { width: 84px; }
  .brand { padding-left: 8px; padding-right: 8px; justify-content: center; }
  .brand-text, .nav-caption, .nav-item span, .nav-count, .nav-dot, .system-health, .user-mini-text, .user-mini .icon-btn { display: none; }
  .nav-item { justify-content: center; padding: 0; }
  .user-mini { justify-content: center; padding-left: 0; padding-right: 0; }
  .sidebar-collapse { display: none; }
  .main-shell { margin-left: 84px; }
  body.sidebar-collapsed .main-shell { margin-left: 84px; }
  .content { padding: 26px 24px 54px; }
  .topbar { padding: 0 24px; }
  .global-search { width: 220px; }
  .playground-layout { grid-template-columns: 340px minmax(0, 1fr); }
  .config-layout { grid-template-columns: 1fr; }
  .group-panel { display: grid; grid-template-columns: 1fr; }
  .group-list { display: grid; grid-template-columns: repeat(2, 1fr); }
  .group-tip { display: none; }
  .config-preview { position: static; }
}

@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }
  .sidebar { width: 258px; transform: translateX(-100%); padding-left: 14px; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .sidebar-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 45;
    background: rgba(8, 17, 31, .5);
    backdrop-filter: blur(2px);
  }
  .brand { justify-content: flex-start; padding-left: 9px; }
  .brand-text, .user-mini-text { display: flex; }
  .nav-caption { display: block; }
  .nav-item span, .nav-count { display: inline-flex; }
  .nav-dot { display: block; }
  .system-health { display: block; }
  .user-mini .icon-btn { display: grid; }
  .nav-item { justify-content: flex-start; padding: 0 12px; }
  .user-mini { justify-content: flex-start; padding-left: 8px; padding-right: 8px; }
  .sidebar-collapse { display: none; }
  .main-shell { margin-left: 0; }
  body.sidebar-collapsed .main-shell { margin-left: 0; }
  body.sidebar-collapsed .sidebar { width: 258px; }
  body.sidebar-collapsed .brand-text, body.sidebar-collapsed .user-mini-text { display: flex; }
  body.sidebar-collapsed .nav-caption { display: block; }
  body.sidebar-collapsed .nav-item span, body.sidebar-collapsed .nav-count { display: inline-flex; }
  body.sidebar-collapsed .nav-dot { display: block; }
  body.sidebar-collapsed .system-health { display: block; }
  body.sidebar-collapsed .user-mini .icon-btn { display: grid; }
  body.sidebar-collapsed .nav-item { justify-content: flex-start; padding: 0 12px; }
  .mobile-only { display: grid; }
  .topbar { padding: 0 18px; height: 62px; }
  .global-search { width: 190px; }
  .global-search kbd { display: none; }
  .content { padding: 22px 18px 48px; }
  .page-head { align-items: flex-start; flex-direction: column; gap: 16px; }
  .page-actions { width: 100%; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .chart-card, .donut-card, .live-card, .side-stack { grid-column: span 1; }
  .side-stack { display: grid; grid-template-columns: 1fr 1fr; }
  .stat-strip { flex-wrap: wrap; }
  .strip-item { flex: 1 1 45%; border-bottom: 1px solid #f0f3f7; }
  .strip-item:nth-child(odd) { border-left: 0; }
  .strip-item:nth-last-child(-n+2) { border-bottom: 0; }
  .task-kpis { grid-template-columns: 1fr 1fr; }
  .firmware-card { grid-template-columns: 44px minmax(0, 1fr) 150px; }
  .fw-coverage { display: none; }
  .api-hero { flex-direction: column; align-items: flex-start; }
  .api-hero-meta { flex-wrap: wrap; }
  .api-flow { overflow-x: auto; justify-content: flex-start; }
  .flow-step { flex: none; }
  .key-guide { gap: 5px; }
  .key-guide-step p { display: none; }
  .api-layout { grid-template-columns: 1fr; }
  .api-nav { position: static; display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 8px; }
  .api-nav p { display: none; }
  .api-nav a { padding: 6px 9px; }
  .playground-layout { grid-template-columns: 1fr; }
  .response-code { min-height: 340px; }
  .config-body { grid-template-columns: 1fr; }
  .config-preview { order: -1; }
  .config-preview .code-block { max-height: 260px; }
}

@media (max-width: 640px) {
  .topbar { padding: 0 14px; gap: 8px; }
  .crumbs { display: none; }
  .crumbs span, .crumb-sep { display: none; }
  .global-search { width: auto; flex: 1; min-width: 0; }
  .topbar-actions { gap: 3px; flex: 1; }
  .topbar-actions .hide-sm { display: none; }
  .content { padding: 18px 14px 40px; }
  .page-head h1 { font-size: 23px; }
  .page-subtitle { font-size: 12px; }
  .page-actions .btn { flex: 1; }
  .page-actions .btn-icon { flex: 0 0 44px; width: 44px; padding: 0; }
  .stat-grid, .stat-grid-4 { grid-template-columns: 1fr; }
  .stat-main strong { font-size: 27px; }
  .side-stack { grid-template-columns: 1fr; }
  .chart-legend { display: none; }
  .chart-wrap { height: 215px; margin-left: 0; margin-right: 0; }
  .chart-footnote { flex-direction: column; align-items: flex-start; }
  .segmented { display: none; }
  .filter-row { width: 100%; }
  .filter-row .search-field { width: 100%; min-width: 0; }
  .select-field { flex: 1; min-width: 100px; }
  .toolbar-actions { width: 100%; justify-content: flex-end; }
  .stat-strip { flex-direction: column; }
  .strip-item { border-left: 0 !important; border-bottom: 1px solid #f0f3f7; }
  .strip-item:last-child { border-bottom: 0; }
  .group-list { grid-template-columns: 1fr; }
  .key-guide { display: none; }
  .code-generate { flex-direction: column; align-items: stretch; }
  .code-generate .btn { width: 100%; }
  .editor-head { flex-direction: column; align-items: flex-start; }
  .editor-actions { width: 100%; }
  .editor-actions .btn { flex: 1; }
  .config-tabs { padding: 0 14px; overflow-x: auto; }
  .config-body { padding: 16px 14px 18px; }
  .protocol-switch { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .field-span-2 { grid-column: span 1; }
  .repo-summary { flex-direction: column; align-items: flex-start; }
  .repo-summary-main { gap: 10px; flex-wrap: wrap; }
  .firmware-card { grid-template-columns: 40px minmax(0, 1fr); gap: 12px; padding: 13px 14px; }
  .fw-icon { width: 40px; height: 40px; }
  .fw-actions { grid-column: span 2; justify-content: flex-start; padding-top: 4px; }
  .fw-actions .btn { flex: 1; }
  .fw-main > p { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .task-kpis { grid-template-columns: 1fr 1fr; gap: 9px; }
  .task-card { grid-template-columns: 1fr; gap: 13px; padding: 14px; }
  .task-side { border-left: 0; border-top: 1px solid #f1f4f8; padding-left: 0; padding-top: 11px; flex-direction: row; align-items: center; }
  .task-side .btn { margin-left: auto; }
  .task-detail-summary { grid-template-columns: 1fr 1fr; }
  .api-hero { padding: 18px; }
  .base-url code { font-size: 11px; word-break: break-all; }
  .api-hero-meta { gap: 16px; }
  .api-cols, .api-cols-40-60 { grid-template-columns: 1fr; }
  .api-section { padding: 16px 14px; }
  .error-grid { grid-template-columns: 1fr 1fr; }
  .playground-form { padding: 0 14px 16px; }
  .response-head { align-items: flex-start; flex-direction: column; }
  .response-code { min-height: 300px; font-size: 9.5px; }
  .response-foot { flex-direction: column; align-items: flex-start; gap: 4px; }
  .drawer { width: 100vw; }
  .drawer-head, .drawer-content { padding-left: 18px; padding-right: 18px; }
  .modal-head, .modal-body, .modal-foot { padding-left: 18px; padding-right: 18px; }
  .info-grid { grid-template-columns: 1fr; }
  .info-item:nth-child(odd) { border-right: 0; }
  .info-item:nth-last-child(2) { border-bottom: 1px solid #f1f4f8; }
  .stat-inline { grid-template-columns: 1fr 1fr; }
  .task-detail-summary { grid-template-columns: 1fr 1fr; }
  .toast-stack { top: 70px; right: 12px; }
  .modal { max-height: calc(100vh - 24px); }
  .radio-cards { grid-template-columns: 1fr; }
}

/* ---------------- OTA control ---------------- */
.ota-switch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 7px 3px 4px;
  border: 1px solid #e4e9f1;
  border-radius: 999px;
  background: #fff;
  color: #98a2b3;
  font-size: 8.5px;
  font-weight: 600;
  white-space: nowrap;
}
.ota-switch:hover { border-color: #c9d8ef; background: #fbfdff; }
.ota-switch.is-on { color: #2f6bff; border-color: #cfe0ff; background: #f5f9ff; }
.ota-switch.is-disabled { opacity: .5; pointer-events: none; }
.ota-track {
  width: 24px;
  height: 14px;
  border-radius: 999px;
  background: #d8dee8;
  position: relative;
  flex: none;
  transition: background .15s;
}
.ota-track i {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  transition: transform .15s;
  box-shadow: 0 1px 2px rgba(16,24,40,.18);
}
.ota-switch.is-on .ota-track { background: #2f6bff; }
.ota-switch.is-on .ota-track i { transform: translateX(10px); }
.ota-text { line-height: 1; }

.ota-control-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 14px;
  border: 1px solid #e8edf5;
  border-radius: 10px;
  background: #fbfcfe;
}
.ota-control-head h3 { font-size: 13px; font-weight: 650; color: #344054; }
.ota-control-head p { margin-top: 3px; font-size: 9px; color: #98a2b3; }
.switch-control { position: relative; display: inline-flex; align-items: center; cursor: pointer; flex: none; }
.switch-control input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track {
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #d8dee8;
  position: relative;
  transition: background .18s;
}
.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(16,24,40,.2);
  transition: transform .18s;
}
.switch-control input:checked + .switch-track { background: #2f6bff; }
.switch-control input:checked + .switch-track::after { transform: translateX(18px); }
.ota-device-picker {
  margin-top: 14px;
  border: 1px solid #e8edf5;
  border-radius: 10px;
  overflow: hidden;
}
.ota-device-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  background: #f8fafc;
  border-bottom: 1px solid #eef1f6;
}
.ota-device-head b { font-size: 10px; color: #475467; }
.ota-device-head span { font-size: 8.5px; color: #98a2b3; }
.ota-device-list { max-height: 220px; overflow: auto; }
.ota-device-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 11px;
  border-bottom: 1px solid #f1f4f8;
  cursor: pointer;
}
.ota-device-row:last-child { border-bottom: 0; }
.ota-device-row:hover { background: #fbfdff; }
.ota-device-row input { accent-color: #2f6bff; flex: none; }
.ota-device-main { min-width: 0; flex: 1; }
.ota-device-main b { display: block; font-family: var(--mono); font-size: 9.5px; color: #344054; }
.ota-device-main span { display: block; margin-top: 2px; font-size: 8px; color: #98a2b3; }
.ota-device-state { font-size: 8px; color: #667085; flex: none; }
.ota-control-note {
  margin-top: 13px;
  padding: 9px 10px;
  border-radius: 8px;
  background: #fff8eb;
  border: 1px solid #fdecc8;
  font-size: 8.5px;
  line-height: 1.55;
  color: #8a6116;
}
