:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #172033;
  --muted: #667085;
  --line: #e4e7ec;
  --primary: #1976d2;
  --primary-strong: #0f5cad;
  --good: #0f9f6e;
  --warn: #d98d00;
  --bad: #d92d20;
  --down: #7c3aed;
  --old-up: #8bb6dd;
  --old-down: #b8a0f0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

html {
  overflow-y: scroll;
  scrollbar-gutter: stable;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
  padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.brand {
  font-weight: 750;
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav a,
.nav-form button {
  position: relative;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--muted);
}

.nav-form {
  margin: 0;
}

.nav-form button {
  min-height: 0;
  border: 0;
  background: transparent;
}

.nav a:hover,
.nav-form button:hover {
  background: #eef4fb;
  color: var(--primary);
}

.dot {
  position: absolute;
  top: 2px;
  right: 0;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--bad);
  color: #fff;
  font-size: 12px;
  line-height: 18px;
  text-align: center;
}

.shell {
  width: min(1120px, 100%);
  max-width: 100%;
  margin: 0 auto;
  padding: 22px max(16px, env(safe-area-inset-right)) calc(42px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  overflow-x: hidden;
  overflow-x: clip;
}

.page-head,
.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.page-head h1,
.section-title h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.2;
}

.section-title h2 {
  font-size: 18px;
}

.page-head p,
.section-title span {
  margin: 6px 0 0;
  color: var(--muted);
}

.section-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
}

.section-actions #deviceCount {
  margin: 0;
  white-space: nowrap;
}

.device-search {
  flex: 0 1 180px;
  width: 180px;
  min-width: 96px;
  max-width: 180px;
  height: 28px;
  min-height: 28px;
  padding: 0 9px;
  font-size: 12px;
  line-height: 28px;
}

.filter-tabs {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.filter-tabs button {
  min-height: 24px;
  padding: 0 9px;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}

.filter-tabs button.active {
  background: #eef4fb;
  color: var(--primary);
  font-weight: 650;
}

.back-link {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--primary);
  font-size: 14px;
}

.panel,
.metric-card,
.device-card,
.account-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.panel {
  padding: 18px;
  margin-bottom: 18px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.summary-grid.device-summary {
  display: flex;
  flex-wrap: nowrap;
  gap: 14px;
}

.device-summary .metric-card {
  flex: 1 1 0;
  min-width: 0;
}

.device-summary .metric-card strong,
.device-summary .metric-card small {
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
}

.device-total {
  margin-bottom: 22px;
}

.total-speed-card {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  min-height: 112px;
  padding: 0;
  overflow: hidden;
}

.total-speed-item {
  min-width: 0;
  padding: 18px;
}

.total-speed-item span {
  display: block;
  color: var(--muted);
  font-size: 15px;
  font-weight: 650;
}

.total-speed-item + .total-speed-item {
  border-left: 1px solid var(--line);
}

.total-speed-item strong {
  display: block;
  margin-top: 10px;
  font-size: 30px;
  line-height: 1.08;
}

.total-speed-item small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 14px;
}

.total-speed-item strong,
.total-speed-item small {
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
}

.summary-grid.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.summary-grid.detail-summary {
  grid-template-columns:
    minmax(0, 0.86fr)
    minmax(0, 0.86fr)
    minmax(0, 0.92fr)
    minmax(0, 0.92fr)
    minmax(220px, 1.38fr);
  gap: 10px;
  margin-bottom: 10px;
}

.metric-card {
  padding: 18px;
  min-height: 104px;
}

.metric-card span {
  display: block;
  color: var(--muted);
}

.metric-card strong {
  display: block;
  margin-top: 10px;
  font-size: 28px;
  line-height: 1.1;
}

.metric-card small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

button {
  -webkit-appearance: none;
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  cursor: pointer;
}

button:disabled {
  cursor: progress;
  opacity: 0.64;
}

.primary {
  background: var(--primary);
  color: #fff;
}

.primary:hover {
  background: var(--primary-strong);
}

.ghost {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

.ghost:hover {
  border-color: #b8c7d9;
  color: var(--primary);
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 14px;
  align-items: end;
}

.settings-panel {
  width: 100%;
}

.settings-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}

.settings-section {
  display: grid;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.settings-section h2 {
  margin: 0;
  font-size: 17px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}

.settings-grid-sort {
  grid-template-columns: minmax(220px, 360px) auto minmax(0, 1fr);
}

.settings-grid-alert {
  grid-template-columns: auto repeat(3, max-content);
  align-items: end;
}

.push-config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.push-config-group {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.push-config-group legend {
  display: block;
  margin-bottom: 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
}

.push-config-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.compact-number-field {
  width: 132px;
}

.compact-number-field-wide {
  width: 184px;
}

.compact-number-field input[type="number"] {
  width: 100%;
}

.settings-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.settings-fieldset legend {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 14px;
}

.settings-tabs {
  height: 42px;
  padding: 3px;
}

.settings-tabs button {
  min-height: 34px;
  padding: 0 14px;
}

.settings-actions-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.settings-test {
  white-space: nowrap;
}

label span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 14px;
}

input,
select {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  outline: 0;
  background: #fff;
}

input[type="search"] {
  -webkit-appearance: none;
}

input[type="checkbox"] {
  width: auto;
  height: auto;
  padding: 0;
}

input:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.12);
}

.check-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
  color: var(--text);
}

.check-label span {
  display: inline;
  margin: 0;
  color: inherit;
  font-size: 14px;
}

.settings-toggle span {
  font-weight: 650;
}

.settings-toggle-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 28px;
}

.alert-channel-fieldset {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  min-height: 42px;
}

.alert-channel-fieldset legend {
  flex: 0 0 100%;
}

.settings-help {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.required-mark,
label span b {
  color: var(--bad);
  font-size: 12px;
  font-weight: 650;
}

label span b:not(.required-mark) {
  color: var(--muted);
}

.account-list,
.device-list {
  display: grid;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.account-card,
.device-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.device-card {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: pan-x pan-y pinch-zoom;
}

.account-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 12px;
  padding: 12px 14px;
}

.account-main,
.device-main,
.device-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.account-title,
.device-title {
  min-width: 0;
}

.device-title {
  flex: 1 1 0;
  max-width: 100%;
}

.account-title strong,
.device-title strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-title span,
.device-title span,
.subtle {
  color: var(--muted);
  font-size: 13px;
}

.account-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
  white-space: nowrap;
}

.account-actions .ghost {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.account-devices {
  grid-column: 1 / -1;
  min-width: 0;
  padding-top: 12px;
  border-top: 1px solid #e8edf3;
}

.account-device-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: #334155;
  font-size: 13px;
  font-weight: 650;
}

.account-device-summary strong {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  background: #eef5ff;
  color: var(--primary);
  font-size: 12px;
}

.account-device-list {
  overflow: hidden;
  border: 1px solid #e5eaf0;
  border-radius: 10px;
  background: #fbfcfe;
}

.account-device-row {
  display: grid;
  grid-template-columns: 9px minmax(150px, 1fr) minmax(330px, 0.9fr) 14px;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  padding: 8px 12px;
  color: inherit;
  text-decoration: none;
  transition: background 0.16s ease;
}

.account-device-row + .account-device-row {
  border-top: 1px solid #edf0f4;
}

.account-device-row:hover {
  background: #f2f7fd;
}

.account-device-list:not(.is-expanded) .account-device-extra {
  display: none;
}

.account-device-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.14);
}

.account-device-status.online {
  background: #16a36a;
  box-shadow: 0 0 0 3px rgba(22, 163, 106, 0.13);
}

.account-device-status.warning {
  background: #d97706;
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.13);
}

.account-device-status.expired {
  background: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.account-device-identity {
  min-width: 0;
}

.account-device-identity strong,
.account-device-identity small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-device-identity strong {
  color: #1f2937;
  font-size: 14px;
  font-weight: 650;
}

.account-device-identity small,
.account-device-state {
  color: var(--muted);
  font-size: 12px;
}

.account-device-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-width: 0;
  overflow: hidden;
  border: 1px solid #e4eaf2;
  border-radius: 8px;
  background: #fff;
}

.account-device-metric {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 6px 10px;
}

.account-device-metric + .account-device-metric {
  border-left: 1px solid #edf1f5;
}

.account-device-metric small,
.account-device-metric strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-device-metric small {
  color: #7b8798;
  font-size: 11px;
  line-height: 1.2;
}

.account-device-metric strong {
  color: #344054;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.25;
}

.account-device-metric:first-child strong {
  color: var(--primary-strong);
}

.account-device-metric em {
  color: #98a2b3;
  font-size: 10px;
  font-style: normal;
  font-weight: 500;
}

.account-device-arrow {
  color: #9aa8b8;
  font-size: 20px;
  line-height: 1;
}

.account-device-toggle {
  display: block;
  width: 100%;
  min-height: 34px;
  margin-top: 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.account-device-toggle:hover {
  background: #f2f7fd;
}

.account-device-empty {
  border: 1px dashed #d8e0e9;
  border-radius: 10px;
  padding: 14px 12px;
  background: #fbfcfe;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.subtle {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.35;
}

.device-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 12px;
}

.device-card-meta-main {
  min-width: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  background: #edf7f3;
  color: var(--good);
  font-size: 12px;
  white-space: nowrap;
}

.badge.warn {
  background: #fff5df;
  color: var(--warn);
}

.badge.bad {
  background: #fff0ee;
  color: var(--bad);
}

.badge.expired {
  background: #eef0f3;
  color: #667085;
}

.device-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 1 auto;
  min-width: 0;
  flex-wrap: wrap;
}

.power-action {
  min-height: 28px;
  padding: 0 9px;
  color: var(--primary);
  font-size: 12px;
}

.power-action.shutdown {
  color: var(--bad);
}

.device-stat-link {
  color: inherit;
}

.device-card.expired {
  background: #f3f4f6;
  border-color: #d7dbe2;
  color: #7a8391;
}

.device-card.expired .device-title,
.device-card.expired .device-stat-link,
.device-card.expired .subtle,
.device-card.expired .stat span,
.device-card.expired .stat strong,
.device-card.expired .stat small {
  color: #8a93a1;
}

.device-card.expired .stat,
.device-card.expired .income-stat {
  background: #eceff3;
}

.device-card.expired .nat-summary {
  opacity: 0.72;
}

.device-card.expired .power-action {
  opacity: 0.45;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  min-width: 0;
}

.device-card .stat-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.device-card .stat strong,
.device-card .stat small {
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
}

.stat {
  min-width: 0;
  max-width: 100%;
  padding: 10px;
  border-radius: 6px;
  background: #f8fafc;
}

.income-stat {
  background: #eef6ff;
  border-color: #cfe5ff;
  container-type: inline-size;
}

.stat.income-stat {
  background: #eef6ff;
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.stat strong {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
}

.stat small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.nat-summary {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px;
  color: var(--muted);
}

.nat-chip {
  font-weight: 650;
}

.nat-type-0 { color: #667085; }
.nat-type-1 { color: #0f5cad; }
.nat-type-2 { color: #047857; }
.nat-type-3 { color: #a15c00; }
.nat-type-4 { color: #c2410c; }
.nat-type-5 { color: #5b21b6; }
.nat-type-6 { color: #0e7490; }
.nat-type-7 { color: #be185d; }

.packet-loss-summary {
  display: inline-flex;
  align-items: baseline;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 6px;
}

.packet-loss-text {
  font-weight: 700;
  white-space: nowrap;
}

.packet-loss-warning {
  color: #b77900;
}

.packet-loss-danger {
  color: #d04747;
}

.packet-loss-critical {
  color: #b4233a;
}

.empty {
  padding: 26px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.section-title.inside {
  align-items: center;
  margin-bottom: 12px;
}

.chart-panel,
.detail-grid ~ .panel {
  margin-bottom: 10px;
}

.chart-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.chart-unit {
  position: absolute;
  top: 0;
  left: 48px;
  z-index: 1;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  pointer-events: none;
}

#speedChart {
  display: block;
  width: 100%;
  height: 320px;
  min-height: 260px;
}

#incomeChart {
  display: block;
  width: 100%;
  height: 320px;
  min-height: 260px;
}

.echart {
  width: 100%;
  height: 320px;
}

.detail-metric span {
  color: #7b8798;
  font-size: 12px;
  font-weight: 500;
}

.detail-metric strong,
.detail-metric small {
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.18;
  white-space: nowrap;
}

.ledger-card {
  display: grid;
  align-content: start;
  gap: 8px;
}

.ledger-lines {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.ledger-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin: 0;
}

.ledger-line:first-child {
  transform: translateY(2px);
}

.ledger-line:last-child {
  transform: translateY(-3px);
}

.ledger-label {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.ledger-cost {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  white-space: nowrap;
}

.nic-upload-card {
  position: relative;
  z-index: 1;
  overflow: visible;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.nic-upload-card.is-open {
  z-index: 60;
}

.nic-upload-popover {
  position: absolute;
  z-index: 50;
  top: 40px;
  left: 6px;
  box-sizing: border-box;
  width: 260px;
  min-width: 230px;
  max-width: calc(100vw - 32px);
  padding: 12px;
  border: 1px solid #d8e1ec;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(30, 50, 75, 0.16);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 120ms ease, transform 120ms ease, visibility 120ms ease;
  pointer-events: none;
}

.nic-upload-popover::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 18px;
  width: 10px;
  height: 10px;
  border-top: 1px solid #d8e1ec;
  border-left: 1px solid #d8e1ec;
  background: #fff;
  transform: rotate(45deg);
}

.nic-upload-card.is-open .nic-upload-popover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.nic-upload-card:focus-visible {
  box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.12);
  outline: none;
}

@media (hover: hover) and (pointer: fine) {
  .nic-upload-card:hover {
    z-index: 60;
  }

  .nic-upload-card:hover .nic-upload-popover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }
}

.nic-upload-list {
  display: grid;
  gap: 7px;
}

.nic-upload-item {
  display: grid;
  grid-template-columns: minmax(58px, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding-top: 7px;
  border-top: 1px solid #edf1f5;
}

.nic-upload-item:first-child {
  padding-top: 0;
  border-top: 0;
}

.detail-metric .nic-upload-name {
  color: #344054;
  font-size: 13px;
  font-weight: 600;
}

.detail-metric .nic-upload-values {
  display: grid;
  justify-items: end;
  gap: 2px;
}

.detail-metric .nic-upload-values strong,
.detail-metric .nic-upload-values small {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
}

.detail-metric .nic-upload-values small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.nic-upload-empty {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.ledger-cost input {
  width: 100%;
  min-width: 0;
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--primary);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.18;
}

.ledger-cost input:focus {
  box-shadow: none;
}

.ledger-line strong {
  margin: 0;
  font-size: 18px;
  overflow: hidden;
  text-overflow: clip;
}

.resource-card {
  display: grid;
  align-content: start;
  gap: 7px;
}

.resource-balls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.resource-ball-wrap {
  display: grid;
  justify-items: center;
  min-width: 0;
}

.water-ball {
  --level: 0%;
  --water-ball-size: 54px;
  position: relative;
  display: grid;
  place-items: center;
  width: var(--water-ball-size);
  max-width: 100%;
  height: var(--water-ball-size);
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid #cfe5ff;
  border-radius: 50%;
  background: #f8fafc;
}

.water-fill {
  position: absolute;
  left: -18%;
  right: -18%;
  bottom: 0;
  height: var(--level);
  background: rgba(25, 118, 210, 0.34);
  transition: height 0.28s ease;
}

.water-fill::before {
  content: "";
  position: absolute;
  left: -10%;
  top: -8px;
  width: 120%;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
}

.water-ball strong {
  position: relative;
  z-index: 1;
  margin: -6px 0 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
}

.water-ball small {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  z-index: 1;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  text-align: center;
}

.income-cross {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, max-content);
  gap: 7px 24px;
  justify-content: start;
  margin-top: 10px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.18;
}

.income-cross div {
  position: relative;
  display: flex;
  align-items: baseline;
  min-width: 0;
  white-space: nowrap;
}

.income-cross em {
  margin-right: 3px;
  color: var(--muted);
  font-style: normal;
}

.income-cross b {
  min-width: 0;
  color: var(--text);
  font-size: 18px;
  font-size: clamp(13px, 7.5cqi, 18px);
  font-weight: 650;
}

.income-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 18px;
}

.income-detail-button {
  margin-left: auto;
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid #bfd5ed;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.68);
  color: #356a9f;
  font-size: 11px;
  font-weight: 600;
  line-height: 20px;
  transition: border-color 120ms ease, background-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
  -webkit-tap-highlight-color: transparent;
}

.income-detail-button:hover {
  border-color: #8eb8e3;
  background: #fff;
  color: var(--primary);
}

.income-detail-button:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.12);
}

.income-stat .income-cross {
  margin-top: 8px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
}

.totals-row {
  margin-top: 12px;
}

.line {
  display: inline-block;
  width: 18px;
  height: 3px;
  margin-right: 6px;
  vertical-align: middle;
  border-radius: 2px;
  background: var(--primary);
}

.line.down {
  background: var(--down);
}

.line.old-up {
  background: var(--old-up);
}

.line.old-down {
  background: var(--old-down);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.detail-grid .panel {
  margin-bottom: 0;
}

.income-breakdown {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.income-part {
  min-width: 0;
  padding: 14px;
  border: 1px solid #cfe5ff;
  border-radius: 8px;
  background: #f4f9ff;
}

.income-part > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.income-part span {
  color: var(--muted);
}

.income-part strong {
  color: var(--text);
}

.income-part ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.income-part li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid #dceeff;
}

.kv {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 10px 12px;
  margin: 0;
}

.kv dt {
  color: var(--muted);
}

.kv dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.kv .copy-value-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  overflow-wrap: normal;
}

.masked-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#systemInfo.kv dt,
#systemInfo.kv dd {
  display: flex;
  align-items: center;
  min-height: 24px;
}

.kv .hardware-progress-cell {
  width: 100%;
  overflow-wrap: normal;
}

.disk-hardware {
  display: grid;
  gap: 5px;
  width: 100%;
}

.hardware-progress-tooltip {
  position: relative;
  display: block;
  min-width: 0;
  width: 100%;
}

.hardware-progress-tooltip::after {
  position: absolute;
  right: 0;
  bottom: calc(100% + 7px);
  z-index: 20;
  width: max-content;
  max-width: min(320px, calc(100vw - 32px));
  padding: 6px 9px;
  border-radius: 5px;
  background: #172033;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.2);
  color: #fff;
  content: attr(data-disk-serial);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  opacity: 0;
  overflow-wrap: anywhere;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 120ms ease, transform 120ms ease, visibility 120ms ease;
  visibility: hidden;
  white-space: normal;
}

@media (hover: hover) {
  .hardware-progress-tooltip:hover::after {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
  }
}

.hardware-progress-tooltip:focus-within::after {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

.hardware-progress {
  --usage: 0%;
  position: relative;
  display: grid;
  place-items: center;
  min-height: 24px;
  width: 100%;
  overflow: hidden;
  border: 1px solid #d6e7fb;
  border-radius: 6px;
  background: #f7fbff;
  color: var(--text);
}

.hardware-progress:focus-visible {
  outline: 2px solid rgba(25, 118, 210, 0.42);
  outline-offset: 2px;
}

.hardware-progress-fill {
  position: absolute;
  top: 0;
  right: auto;
  bottom: 0;
  left: 0;
  inset: 0 auto 0 0;
  width: var(--usage);
  max-width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(25, 118, 210, 0.34), rgba(25, 118, 210, 0.2));
}

.hardware-progress-text {
  position: relative;
  z-index: 1;
  max-width: 100%;
  padding: 0 10px;
  overflow: hidden;
  color: #172033;
  font-size: 13px;
  font-weight: 650;
  line-height: 24px;
  text-align: center;
  text-overflow: ellipsis;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.72);
  white-space: nowrap;
}

.disk-iops {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
}

.disk-iops.muted {
  color: #98a2b3;
}

.disk-hardware.is-missing {
  touch-action: pan-y;
  user-select: none;
}

.disk-hardware.is-missing .hardware-progress {
  border-color: #c7ccd4;
  border-style: dashed;
  background: #f2f4f7;
}

.disk-hardware.is-missing .hardware-progress-fill {
  background: #d0d5dd;
  opacity: 0.72;
}

.disk-hardware.is-missing .hardware-progress-text {
  color: #667085;
  text-shadow: none;
}

.disk-hardware button.disk-missing-button {
  border-color: #d0d5dd;
  background: #f2f4f7;
  color: #667085;
}

.disk-hardware button.disk-missing-button:hover {
  border-color: #98a2b3;
  background: #e9edf2;
  color: #475467;
}

.disk-hardware button.disk-missing-button:focus-visible {
  border-color: #667085;
  box-shadow: 0 0 0 3px rgba(102, 112, 133, 0.16);
}

.disk-hardware.is-missing.is-holding .hardware-progress {
  border-color: #667085;
  border-style: solid;
  box-shadow: 0 0 0 3px rgba(102, 112, 133, 0.16);
}

.disk-hardware.is-missing.is-removing {
  opacity: 0.55;
  pointer-events: none;
}

.disk-iops-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 0;
}

.disk-action-buttons {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 0;
  white-space: nowrap;
}

.disk-detail-button,
.disk-cache-button {
  min-height: 22px;
  border: 1px solid #d6e7fb;
  border-radius: 5px;
  background: #f7fbff;
  color: var(--primary);
  font-size: 12px;
  line-height: 20px;
  -webkit-tap-highlight-color: transparent;
}

.disk-detail-button {
  padding: 0 9px;
}

.disk-cache-button {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 24px;
  height: 22px;
  padding: 0;
}

.disk-cache-button svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.disk-detail-button:hover,
.disk-cache-button:hover {
  border-color: #b8cfe9;
  background: #eef4fb;
}

.disk-cache-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.disk-grade {
  display: inline-flex;
  align-items: center;
  height: 18px;
  border-radius: 999px;
  padding: 0 7px;
  font-size: 11px;
  font-weight: 650;
}

.disk-grade-excellent {
  background: #e9f8f2;
  color: #087443;
}

.disk-grade-good {
  background: #eef4fb;
  color: var(--primary);
}

.disk-grade-medium {
  background: #fff7e6;
  color: #b76b00;
}

.disk-grade-poor {
  background: #fff1e8;
  color: #c2410c;
}

.disk-grade-bad {
  background: #fff1f2;
  color: var(--bad);
}

.disk-grade-system {
  background: #f2f4f7;
  color: #475467;
}

.io-dialog {
  width: min(980px, calc(100% - 32px));
  max-width: 980px;
  max-height: calc(100vh - 40px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
}

.io-dialog:not([open]) {
  display: none;
}

html.dialog-fallback-active,
html.dialog-fallback-active body {
  overflow: hidden;
}

.io-dialog.dialog-fallback-open {
  position: fixed;
  z-index: 1000;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 20px 16px;
  border-radius: 0;
  background: rgba(15, 23, 42, 0.48);
  box-shadow: none;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.io-dialog.dialog-fallback-open .io-dialog-panel {
  width: min(980px, 100%);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
}

.cpu-frequency-dialog.dialog-fallback-open .io-dialog-panel {
  width: min(760px, 100%);
}

.income-monthly-dialog.dialog-fallback-open .io-dialog-panel {
  width: min(780px, 100%);
}

.cache-clear-dialog.dialog-fallback-open .io-dialog-panel {
  width: min(620px, 100%);
}

.missing-disk-dialog.dialog-fallback-open .io-dialog-panel {
  width: min(480px, 100%);
}

.cpu-frequency-dialog {
  width: min(760px, calc(100% - 32px));
  max-width: 760px;
}

.income-monthly-dialog {
  width: min(780px, calc(100% - 32px));
  max-width: 780px;
}

.income-monthly-echart {
  width: 100%;
  height: 340px;
  min-height: 280px;
}

.io-dialog::backdrop {
  background: rgba(15, 23, 42, 0.48);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.io-dialog-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  max-height: calc(100vh - 40px);
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: inherit;
  background: var(--panel);
}

.io-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.io-dialog-header h2,
.io-chart-heading h3 {
  margin: 0;
}

.io-dialog-header h2 {
  font-size: 20px;
}

.io-dialog-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.io-dialog-close {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--muted);
  font-size: 0;
  line-height: 0;
}

.io-dialog-close::before,
.io-dialog-close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 11px;
  height: 1.5px;
  border-radius: 999px;
  background: currentColor;
  transform: translate(-50%, -50%) rotate(45deg);
}

.io-dialog-close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.io-dialog-close:hover {
  border-color: #b8c7d9;
  color: var(--primary);
}

.io-dialog-body {
  min-height: 0;
  padding: 16px;
  overflow-y: auto;
}

.io-write-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.io-write-summary[hidden] {
  display: none;
}

.io-write-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 11px 14px;
  border: 1px solid #d6e7fb;
  border-radius: 8px;
  background: #f7fbff;
}

.io-write-stat span {
  color: var(--muted);
  font-size: 13px;
}

.io-write-stat strong {
  color: #172033;
  font-size: 18px;
  white-space: nowrap;
}

.io-charts {
  display: grid;
  gap: 14px;
}

.io-chart-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.io-chart-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 30px;
}

.io-chart-heading h3 {
  font-size: 16px;
}

.io-chart-heading span {
  color: var(--muted);
  font-size: 12px;
}

.io-await-heading > div:first-child > span {
  display: block;
  margin-top: 4px;
}

.io-await-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

.io-await-legend span {
  padding: 3px 7px;
  border-radius: 999px;
  font-weight: 650;
}

.io-await-legend .normal {
  background: #e9f8f2;
  color: #087443;
}

.io-await-legend .warning {
  background: #fff7e6;
  color: #a15c00;
}

.io-await-legend .danger {
  background: #fff1f2;
  color: var(--bad);
}

.io-echart {
  width: 100%;
  height: 280px;
  min-height: 240px;
}

.line-table {
  display: grid;
  gap: 10px;
}

.line-item {
  display: grid;
  grid-template-columns: 90px minmax(150px, 1fr) 90px 70px 72px 104px 104px 112px 92px;
  gap: clamp(6px, 0.75vw, 10px);
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.cache-clear-dialog {
  width: min(620px, calc(100% - 32px));
  max-width: 620px;
}

.missing-disk-dialog {
  width: min(480px, calc(100% - 32px));
  max-width: 480px;
}

.missing-disk-delete-body {
  display: grid;
  gap: 14px;
}

.missing-disk-delete-body p {
  margin: 0;
}

.missing-disk-delete-body > p:first-child {
  color: var(--text);
  font-size: 15px;
  line-height: 1.65;
}

.missing-disk-delete-body > p:first-child strong {
  overflow-wrap: anywhere;
}

.missing-disk-delete-note {
  padding: 10px 12px;
  border-radius: 6px;
  background: #f2f4f7;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.missing-disk-delete-status {
  padding: 10px 12px;
  border-radius: 6px;
  background: #eef6ff;
  color: var(--primary-strong);
  font-size: 13px;
}

.missing-disk-delete-status[hidden] {
  display: none;
}

.missing-disk-delete-status.is-error {
  background: #fff1f2;
  color: #b4233a;
}

.missing-disk-delete-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.missing-disk-delete-actions button {
  min-width: 96px;
}

.missing-disk-delete-submit {
  background: var(--bad);
  color: #fff;
}

.missing-disk-delete-submit:hover {
  background: #b42318;
}

@media (max-width: 460px) {
  .missing-disk-delete-actions button {
    flex: 1 1 0;
    min-width: 0;
  }
}

.line-item.packet-loss-row-warning {
  border-color: #f0d99c;
  background: #fff8e6;
}

.line-item.packet-loss-row-danger {
  border-color: #fecdd3;
  background: #fff1f2;
}

.line-item.packet-loss-row-critical {
  border-color: #f5a3ad;
  background: #ffe1e7;
}

.line-item button,
.line-item span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.line-account-action {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-weight: 700;
}

.line-account-action em {
  display: none;
  margin-left: 5px;
  color: var(--primary);
  font-style: normal;
  font-weight: 650;
}

.line-address .subtle {
  display: block;
  margin-top: 2px;
}

.line-action {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--primary);
}

.line-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.line-metric {
  line-height: 1.25;
}

.press-metric > span {
  display: block;
  white-space: nowrap;
}

.press-metric b {
  color: #047857;
  font-weight: 700;
}

.compact-action {
  min-height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

button.device-icon-button {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  box-sizing: border-box;
  width: 29px;
  min-width: 29px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  border: 1px solid #d6e7fb;
  border-radius: 5px;
  background: #f7fbff;
  color: var(--primary);
  font-size: 0;
  line-height: 1;
  cursor: pointer;
  transition: border-color 120ms ease, background-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
  -webkit-tap-highlight-color: transparent;
}

button.device-icon-button svg {
  display: block;
  width: 15px;
  height: 15px;
  pointer-events: none;
}

button.device-icon-button .icon-stroke {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

button.device-icon-button .icon-fill {
  fill: currentColor;
}

button.device-icon-button:hover {
  border-color: #b8cfe9;
  background: #eef4fb;
}

button.device-icon-button:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.12);
}

button.device-icon-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

button .device-action-label {
  display: none;
  white-space: nowrap;
}

.press-finished-time {
  margin: -9px 0 10px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  text-align: right;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom));
  z-index: 20;
  transform: translateX(-50%);
  max-width: min(520px, calc(100% - 32px));
  padding: 12px 14px;
  border-radius: 8px;
  background: #172033;
  color: #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.24);
}

.login-body {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 18px;
}

.login-shell {
  width: min(420px, 100%);
}

.login-card {
  display: grid;
  gap: 16px;
  margin: 0;
}

.login-head h1 {
  margin: 0;
  font-size: 26px;
}

.login-head p {
  margin: 8px 0 0;
  color: var(--muted);
}

.login-remember {
  justify-self: start;
}

.login-message,
.login-auto {
  padding: 10px 12px;
  border-radius: 6px;
  background: #eef4fb;
  color: var(--primary-strong);
  font-size: 14px;
}

.login-message[hidden],
.login-auto[hidden] {
  display: none;
}

.login-auto {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.login-auto button {
  min-height: 28px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: var(--primary);
}

.login-submit {
  width: 100%;
}

.form-error {
  padding: 10px 12px;
  border-radius: 6px;
  background: #fff0ee;
  color: var(--bad);
}

/* Safari 14.0-14.4 supports Grid gap but not Flexbox gap. common.js adds
   this class only when a real flex layout test fails. */
.no-flex-gap .nav > * + * {
  margin-left: 8px;
}

.no-flex-gap .section-actions > * + * {
  margin-left: 10px;
}

.no-flex-gap .filter-tabs > * + * {
  margin-left: 2px;
}

.no-flex-gap .summary-grid.device-summary > * + * {
  margin-left: 14px;
}

.no-flex-gap .check-label > * + *,
.no-flex-gap .account-actions > * + *,
.no-flex-gap .ledger-line > * + * {
  margin-left: 8px;
}

.no-flex-gap .account-main > * + *,
.no-flex-gap .device-main > * + *,
.no-flex-gap .device-stats > * + *,
.no-flex-gap .income-part > div > * + *,
.no-flex-gap .income-part li > * + *,
.no-flex-gap .io-write-stat > * + *,
.no-flex-gap .io-chart-heading > * + * {
  margin-left: 12px;
}

.no-flex-gap .kv .copy-value-cell > * + * {
  margin-left: 6px;
}

.no-flex-gap .disk-iops > * + * {
  margin-left: 7px;
}

.no-flex-gap .disk-iops-row > * + * {
  margin-left: 10px;
}

.no-flex-gap .disk-action-buttons > * + * {
  margin-left: 10px;
}

.no-flex-gap .io-dialog-header > * + * {
  margin-left: 16px;
}

.no-flex-gap .alert-channel-fieldset legend {
  margin-bottom: 10px;
}

.no-flex-gap .alert-channel-fieldset .check-label + .check-label {
  margin-left: 14px;
}

.no-flex-gap .settings-actions-row,
.no-flex-gap .device-actions,
.no-flex-gap .legend,
.no-flex-gap .io-await-legend {
  margin: -5px;
}

.no-flex-gap .settings-actions-row > *,
.no-flex-gap .device-actions > *,
.no-flex-gap .legend > *,
.no-flex-gap .io-await-legend > * {
  margin: 5px;
}

.no-flex-gap .nat-summary > * + * {
  margin-left: 2px;
}

@media (min-width: 761px) and (max-width: 1060px) {
  .line-item {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    align-items: stretch;
    padding: 10px;
  }

  .line-account {
    grid-column: span 1;
    align-self: center;
    font-size: 14px;
  }

  .line-account-action em {
    display: block;
    margin: 2px 0 0;
    font-size: 13px;
    white-space: nowrap;
  }

  .line-address {
    grid-column: span 2;
    align-self: center;
    font-size: 13px;
    line-height: 1.28;
  }

  .line-address .subtle {
    margin-top: 1px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .line-metric {
    min-height: 44px;
    padding: 7px 6px;
    border-radius: 6px;
    background: #f8fafc;
    font-size: 12px;
    line-height: 1.2;
  }

  .line-label {
    margin-bottom: 3px;
    font-size: 10px;
    line-height: 1;
  }

  .press-metric .line-label {
    display: none;
  }

  .press-metric > span {
    line-height: 1.25;
  }

  .line-redial-button {
    display: none;
  }
}

@media (max-width: 760px) {
  input,
  select {
    font-size: 16px;
  }

  .shell {
    padding: 18px max(12px, env(safe-area-inset-right)) calc(32px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  }

  .page-head {
    align-items: stretch;
    flex-direction: column;
  }

  .section-title {
    gap: 8px;
  }

  .section-actions {
    gap: 6px;
  }

  .no-flex-gap .page-head > * + * {
    margin-top: 16px;
  }

  .no-flex-gap .section-actions > * + * {
    margin-left: 6px;
  }

  .device-search {
    flex-basis: clamp(72px, 22vw, 132px);
    width: clamp(72px, 22vw, 132px);
    min-width: 72px;
    padding: 0 7px;
    font-size: 16px;
  }

  .filter-tabs button {
    min-height: 24px;
    padding: 0 7px;
  }

  .page-head h1 {
    font-size: 23px;
  }

  .summary-grid,
  .summary-grid.compact,
  .detail-grid,
  .form-grid,
  .settings-form,
  .settings-grid,
  .settings-grid-sort,
  .settings-grid-alert,
  .push-config-grid,
  .push-config-fields {
    grid-template-columns: 1fr;
  }

  .compact-number-field,
  .compact-number-field-wide {
    width: 100%;
  }

  .settings-tabs {
    width: max-content;
  }

  .summary-grid.detail-summary {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
  }

  .detail-summary > .metric-card {
    grid-column: span 2;
  }

  .detail-summary > .metric-card:nth-child(4),
  .detail-summary > .income-stat {
    grid-column: span 3;
  }

  .summary-grid.device-summary {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
  }

  .metric-card {
    min-height: 92px;
    padding: 14px;
  }

  .metric-card strong {
    font-size: 22px;
  }

  .detail-summary .metric-card {
    min-width: 0;
    height: 94px;
    min-height: 94px;
    padding: 12px 9px;
  }

  .detail-summary .nic-upload-popover {
    top: 34px;
    left: 0;
  }

  .detail-summary .detail-metric strong,
  .detail-summary .detail-metric small {
    font-size: clamp(13px, 3.6vw, 16px);
  }

  .detail-summary .ledger-card {
    gap: 7px;
  }

  .detail-summary .ledger-lines {
    gap: 6px;
  }

  .detail-summary .ledger-line {
    gap: 5px;
  }

  .detail-summary .ledger-label {
    font-size: 10px;
  }

.detail-summary .ledger-cost input,
.detail-summary .ledger-line strong {
    font-size: 16px;
  }

  .no-flex-gap .summary-grid.device-summary > * + * {
    margin-left: 10px;
  }

  .detail-summary .resource-balls {
    gap: 5px;
  }

  .detail-summary .water-ball {
    --water-ball-size: 48px;
  }

  .detail-summary .water-ball strong {
    font-size: 15.48px;
  }

  .detail-summary .water-ball small {
    bottom: 7px;
    font-size: 9px;
  }

  .device-summary .metric-card {
    flex: 1 1 0;
    min-width: 0;
    min-height: 86px;
    padding: 12px 8px;
  }

  .device-summary .metric-card strong {
    font-size: clamp(14px, 4.9vw, 22px);
    white-space: nowrap;
  }

  .device-summary .metric-card small {
    font-size: clamp(10px, 3.3vw, 13px);
    white-space: nowrap;
  }

  .device-total {
    margin-bottom: 18px;
  }

  .total-speed-card {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-height: 84px;
  }

  .total-speed-item + .total-speed-item {
    border-left: 1px solid var(--line);
    border-top: 0;
  }

  .total-speed-item {
    padding: 10px 6px;
  }

  .total-speed-item span {
    font-size: clamp(12px, 3.2vw, 14px);
    font-weight: 700;
  }

  .total-speed-item strong {
    font-size: clamp(15px, 4vw, 18px);
    line-height: 1.12;
  }

  .total-speed-item small {
    font-size: clamp(10px, 2.8vw, 12px);
  }

  .stat-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .device-card .stat-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .device-card {
    padding: 12px;
  }

  .account-card {
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    align-items: start;
    gap: 6px;
    padding: 12px;
  }

  .account-card .account-main,
  .account-actions {
    display: contents;
  }

  .account-actions .ghost {
    min-height: 30px;
    padding: 0 9px;
  }

  .account-card .account-title {
    display: contents;
    min-width: 0;
  }

  .account-card .account-title strong {
    grid-column: 1;
    grid-row: 1;
    line-height: 30px;
  }

  .account-card .account-title span {
    grid-column: 1 / -1;
    grid-row: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .account-card .account-update {
    grid-column: 2;
    grid-row: 1;
    min-height: 24px;
    height: 24px;
    border: 0;
    border-radius: 999px;
    padding: 0 9px;
    background: #eef4fb;
    color: var(--primary);
  }

  .account-card .badge {
    grid-column: 3;
    grid-row: 1;
    padding: 0 7px;
  }

  .account-card .account-delete {
    grid-column: 4;
    grid-row: 1;
    min-height: 24px;
    width: auto;
    height: 24px;
    border: 0;
    border-radius: 999px;
    padding: 0 9px;
    background: #fff1f2;
    color: var(--bad);
    font-size: 0;
  }

  .account-card .account-delete::after {
    content: "\00d7";
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
  }

  .account-card .account-devices {
    grid-column: 1 / -1;
    grid-row: 3;
  }

  .account-device-row {
    grid-template-columns: 9px minmax(76px, 0.72fr) minmax(0, 1.65fr) 12px;
    gap: 6px;
    padding: 8px 9px;
  }

  .account-device-identity {
    grid-column: 2;
  }

  .account-device-metrics {
    grid-column: 3;
    width: 100%;
  }

  .account-device-arrow {
    grid-column: 4;
    grid-row: 1;
  }

  .account-device-metric {
    padding: 5px 5px;
  }

  .account-device-metric small {
    font-size: clamp(9px, 2.5vw, 11px);
  }

  .account-device-metric strong {
    font-size: clamp(10px, 2.8vw, 13px);
  }

  .device-card .stat {
    padding: 8px 6px;
  }

  .device-card .stat span {
    font-size: 11px;
  }

  .device-card .stat strong,
  .device-card .stat small {
    font-size: clamp(10px, 2.8vw, 12px);
  }

  .device-main,
  .account-main {
    align-items: start;
  }

  .device-main {
    gap: 8px;
  }

  .no-flex-gap .device-main > * + * {
    margin-left: 8px;
  }

  .device-actions {
    gap: 5px;
    max-width: 132px;
  }

  .device-actions .badge {
    padding: 0 6px;
  }

  .power-action {
    min-height: 26px;
    padding: 0 6px;
    font-size: 11px;
  }

  .income-cross {
    grid-template-columns: repeat(2, max-content);
    gap: 6px clamp(8px, 3vw, 14px);
    justify-content: start;
    max-width: 100%;
    font-size: clamp(10.5px, 3vw, 13px);
  }

  .income-cross em {
    margin-right: 1px;
  }

  .income-cross div {
    min-width: 0;
  }

  .income-cross b {
    font-size: clamp(12px, 3.4vw, 16px);
  }

  .no-flex-gap .device-actions {
    margin: -2.5px;
  }

  .no-flex-gap .device-actions > * {
    margin: 2.5px;
  }

  .chart-panel {
    padding-left: 8px;
    padding-right: 8px;
  }

  .line-item {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    align-items: stretch;
    padding: 10px;
  }

  .line-account {
    grid-column: span 1;
    align-self: center;
    font-size: 14px;
  }

  .line-account-action em {
    display: block;
    margin: 2px 0 0;
    font-size: 13px;
    white-space: nowrap;
  }

  .line-address {
    grid-column: span 2;
    align-self: center;
    font-size: 13px;
    line-height: 1.28;
  }

  .line-address .subtle {
    display: block;
    margin-top: 1px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .line-metric {
    min-height: 44px;
    padding: 7px 6px;
    border-radius: 6px;
    background: #f8fafc;
    font-size: 12px;
    line-height: 1.2;
  }

  .line-nat {
    grid-column: span 1;
  }

  .line-speed {
    font-size: 12px;
  }

  .press-metric {
    font-size: 12px;
  }

  .press-metric .line-label {
    display: none;
  }

  .press-metric > span {
    line-height: 1.25;
  }

  .line-label {
    margin-bottom: 3px;
    font-size: 10px;
    line-height: 1;
  }

  .income-breakdown {
    grid-template-columns: 1fr;
  }

  .line-action {
    grid-column: span 1;
    min-height: 32px;
    align-self: stretch;
    padding: 0 6px;
    font-size: 12px;
  }

  .line-redial-button {
    display: none;
  }

  .kv {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .disk-iops-row {
    gap: 7px;
  }

  .io-dialog {
    width: calc(100% - 20px);
    max-height: calc(100vh - 20px);
  }

  .io-dialog-panel {
    max-height: calc(100vh - 20px);
  }

  .io-dialog-header {
    padding: 14px;
  }

  .io-dialog-body {
    padding: 10px;
  }

  .io-chart-card {
    padding: 10px 6px;
  }

  .io-chart-heading {
    align-items: flex-start;
    flex-direction: column;
    padding: 0 6px;
  }

  .io-await-legend {
    justify-content: flex-start;
  }

  .io-echart {
    height: 250px;
    min-height: 220px;
  }
}

.cache-clear-body {
  display: grid;
  gap: 14px;
}

.cache-clear-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid #dce6f2;
  border-radius: 9px;
  background: #fbfdff;
}

.cache-clear-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.cache-clear-card h3,
.cache-clear-card p {
  margin: 0;
}

.cache-clear-card h3 {
  font-size: 16px;
}

.cache-clear-card-head p,
.cache-clear-card-title p,
.cache-clear-confirm p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.cache-clear-now {
  flex: 0 0 auto;
  white-space: nowrap;
}

.cache-clear-confirm {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid #f4c7c3;
  border-radius: 8px;
  background: #fff7f6;
}

.cache-clear-confirm[hidden],
.cache-clear-status[hidden] {
  display: none;
}

.cache-clear-confirm strong {
  color: #9f241c;
  font-size: 14px;
}

.cache-clear-confirm-actions,
.cache-schedule-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.cache-clear-confirm-actions button {
  min-height: 36px;
  padding: 0 12px;
  white-space: nowrap;
}

.cache-clear-danger {
  background: var(--bad);
  color: #fff;
}

.cache-clear-danger:hover {
  background: #b42318;
}

.cache-schedule-form {
  display: grid;
  gap: 13px;
}

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

.cache-weekday-field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.cache-weekday-field legend {
  margin: 0 0 7px;
  padding: 0;
  color: var(--muted);
  font-size: 14px;
}

.cache-weekday-options {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}

.cache-weekday-option {
  position: relative;
  display: block;
  min-width: 0;
  margin: 0;
  cursor: pointer;
}

.cache-weekday-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  overflow: hidden;
  opacity: 0;
  clip-path: inset(50%);
}

.cache-weekday-option span {
  display: grid;
  place-items: center;
  min-height: 38px;
  margin: 0;
  padding: 0 3px;
  border: 1px solid #d6e7fb;
  border-radius: 6px;
  background: #f7fbff;
  color: #36536f;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  user-select: none;
  transition: border-color 120ms ease, background-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.cache-weekday-option:hover span {
  border-color: #9fc2e8;
  background: #eef6ff;
}

.cache-weekday-option input:checked + span {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.cache-weekday-option input:focus-visible + span {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.12);
}

.cache-weekday-hint {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.cache-schedule-summary {
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid #d6e7fb;
  border-radius: 7px;
  background: #f4f9ff;
  color: #36536f;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-line;
}

.cache-schedule-actions {
  justify-content: flex-start;
}

.cache-clear-status {
  margin: 0;
  padding: 10px 12px;
  border-radius: 7px;
  background: #eef4fb;
  color: var(--primary-strong);
  font-size: 13px;
}

.cache-clear-status.is-success {
  background: #eaf8f2;
  color: #087443;
}

.cache-clear-status.is-error {
  background: #fff1f2;
  color: #b4233a;
}

@media (max-width: 760px) {
  .cache-clear-card {
    padding: 13px;
  }

  .cache-clear-card-head,
  .cache-clear-confirm {
    align-items: stretch;
    flex-direction: column;
  }

  .cache-clear-now,
  .cache-clear-confirm-actions,
  .cache-schedule-actions {
    width: 100%;
  }

  .cache-clear-confirm-actions button,
  .cache-schedule-actions button {
    flex: 1 1 0;
  }

  .cache-schedule-fields {
    grid-template-columns: 1fr;
  }

  .cache-weekday-options {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.kv .network-tag-setting-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 22px;
  overflow-wrap: normal;
}

.network-tag-value {
  min-width: 52px;
  color: #475467;
  font-weight: 650;
  line-height: 1.35;
}

.network-tag-value.is-enabled,
.network-tag-current-value.is-enabled {
  color: var(--good);
}

.network-tag-value.is-disabled,
.network-tag-current-value.is-disabled {
  color: #475467;
}

.network-tag-value.is-loading,
.network-tag-current-value.is-loading {
  color: var(--warn);
}

.network-tag-value.is-error,
.network-tag-value.is-unsupported,
.network-tag-current-value.is-error,
.network-tag-current-value.is-unsupported {
  color: var(--bad);
}

button.network-tag-setting-button:disabled:not(.is-busy) {
  cursor: not-allowed;
}

.network-tag-dialog {
  width: min(480px, calc(100% - 32px));
  max-width: 480px;
}

.network-tag-dialog.dialog-fallback-open .io-dialog-panel {
  width: min(480px, 100%);
}

.network-tag-dialog-body {
  display: grid;
  gap: 14px;
}

.network-tag-current {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #dce6f2;
  border-radius: 8px;
  background: #f8fbff;
}

.network-tag-current > span {
  color: var(--muted);
  font-size: 13px;
}

.network-tag-current-value {
  font-size: 15px;
}

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

button.network-tag-option {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 78px;
  padding: 12px;
  border: 1px solid #d6e2ef;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-align: left;
  transition: border-color 120ms ease, background-color 120ms ease, box-shadow 120ms ease;
}

button.network-tag-option:hover:not(:disabled) {
  border-color: #9fc2e8;
  background: #f7fbff;
}

button.network-tag-option:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.12);
}

button.network-tag-option.is-selected:disabled {
  border-color: #9fc2e8;
  background: #eef6ff;
  cursor: default;
  opacity: 1;
}

button.network-tag-option.is-enable.is-selected:disabled {
  border-color: #9bd9c1;
  background: #edf9f4;
}

.network-tag-option-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #edf5fd;
  color: var(--primary);
}

.network-tag-option.is-enable .network-tag-option-icon {
  background: #eaf8f2;
  color: var(--good);
}

.network-tag-option-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.network-tag-option > span:last-child {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.network-tag-option strong {
  font-size: 15px;
}

.network-tag-option small {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.network-tag-status {
  margin: 0;
  padding: 10px 12px;
  border-radius: 7px;
  background: #eef4fb;
  color: var(--primary-strong);
  font-size: 13px;
}

.network-tag-status[hidden] {
  display: none;
}

.network-tag-status.is-error {
  background: #fff1f2;
  color: #b4233a;
}

@media (max-width: 460px) {
  .network-tag-option {
    gap: 8px;
  }

  .network-tag-option-icon {
    width: 30px;
    height: 30px;
  }
}

html.device-actions-accessible body.device-detail-page .shell button:not(.network-tag-option):not(.line-account-action):not(.line-redial-button) {
  min-height: 34px;
  font-size: 15px;
}

html.device-actions-accessible body.device-detail-page .shell button.device-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 72px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  font-size: 15px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
}

html.device-actions-accessible body.device-detail-page .shell button.device-icon-button svg {
  display: none;
}

html.device-actions-accessible body.device-detail-page .shell .device-action-label {
  display: inline;
  margin: 0;
  color: inherit;
  font-size: 15px;
  font-weight: inherit;
}

html.device-actions-accessible body.device-detail-page .shell .io-dialog-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 72px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
}

html.device-actions-accessible body.device-detail-page .shell .io-dialog-close::before,
html.device-actions-accessible body.device-detail-page .shell .io-dialog-close::after {
  display: none;
}

html.device-actions-accessible body.device-detail-page .shell button.network-tag-option {
  min-height: 88px;
}

html.device-actions-accessible body.device-detail-page .shell .network-tag-option strong {
  font-size: 17px;
}

html.device-actions-accessible body.device-detail-page .shell .network-tag-option small {
  font-size: 14px;
}

.home-income-heading,
.device-name-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.home-income-heading {
  justify-content: space-between;
  padding-right: 37px;
}

.home-income-heading > span {
  margin: 0;
}

body.devices-page .total-speed-card > .income-stat {
  position: relative;
}

body.devices-page .home-income-detail-button {
  position: absolute;
  top: 16px;
  right: 18px;
  z-index: 1;
}

.device-name-heading h1 {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.device-name-edit-button {
  margin-top: 2px;
}

.home-income-dialog {
  width: min(840px, calc(100% - 32px));
  max-width: 840px;
}

.home-income-dialog.dialog-fallback-open .io-dialog-panel {
  width: min(840px, 100%);
}

.home-income-dialog-body,
.home-income-content {
  display: grid;
  gap: 14px;
}

.home-income-total-card {
  display: grid;
  gap: 5px;
  padding: 16px 18px;
  border: 1px solid #cfe1f5;
  border-radius: 9px;
  background: linear-gradient(135deg, #f7fbff 0%, #edf6ff 100%);
}

.home-income-total-card span,
.home-income-total-card small {
  color: var(--muted);
}

.home-income-total-card strong {
  color: var(--primary-strong);
  font-size: 30px;
}

.home-income-warning,
.device-name-status {
  margin: 0;
  padding: 10px 12px;
  border-radius: 7px;
  background: #fff8e7;
  color: #8a5b08;
  font-size: 13px;
}

.home-income-warning[hidden],
.device-name-status[hidden] {
  display: none;
}

.home-income-echart {
  width: 100%;
  height: 460px;
  min-height: 420px;
}

.device-name-dialog {
  width: min(480px, calc(100% - 32px));
  max-width: 480px;
}

.device-name-dialog.dialog-fallback-open .io-dialog-panel {
  width: min(480px, 100%);
}

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

.device-name-status.is-error {
  background: #fff1f2;
  color: #b4233a;
}

.device-name-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

html.device-actions-accessible body.devices-page .home-income-detail-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 10px;
  right: 8px;
  width: auto;
  min-width: 72px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  font-size: 15px;
  font-weight: 650;
  white-space: nowrap;
}

html.device-actions-accessible body.devices-page .home-income-heading {
  padding-right: 82px;
}

html.device-actions-accessible body.devices-page .home-income-detail-button svg {
  display: none;
}

html.device-actions-accessible body.devices-page .home-income-detail-button .device-action-label {
  display: inline;
  color: inherit;
}

@media (max-width: 760px) {
html.device-actions-accessible body.device-detail-page .network-detail-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(3, auto);
  gap: 8px 6px;
  align-items: center;
}

html.device-actions-accessible body.device-detail-page .network-detail-title,
html.device-actions-accessible body.device-detail-page .network-detail-actions {
  display: contents;
}

html.device-actions-accessible body.device-detail-page .network-detail-title > h2 {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  white-space: nowrap;
}

html.device-actions-accessible body.device-detail-page #pressTestBtn {
  grid-column: 2;
  grid-row: 1;
}

html.device-actions-accessible body.device-detail-page #refreshNetworkBtn {
  grid-column: 3;
  grid-row: 1;
}

html.device-actions-accessible body.device-detail-page #openNetworkQuality {
  grid-column: 4;
  grid-row: 1;
}

html.device-actions-accessible body.device-detail-page .network-detail-actions #lineCount {
  grid-column: 1;
  grid-row: 2;
  margin: 0;
  white-space: nowrap;
}

html.device-actions-accessible body.device-detail-page .network-detail-panel .press-finished-time {
  grid-column: 2 / 5;
  grid-row: 2;
  margin: 0;
  text-align: right;
}

html.device-actions-accessible body.device-detail-page .network-detail-panel .line-table {
  grid-column: 1 / -1;
  grid-row: 3;
  margin-top: 4px;
}
}

@media (max-width: 760px) {
  html.device-actions-accessible body.device-detail-page .shell button.device-icon-button,
  html.device-actions-accessible body.device-detail-page .shell .io-dialog-close {
    min-width: 60px;
    padding: 0;
  }

  html.device-actions-accessible body.device-detail-page .detail-summary .resource-card,
  html.device-actions-accessible body.device-detail-page .detail-summary .income-stat {
    height: 94px;
    min-height: 94px;
  }

  html.device-actions-accessible body.device-detail-page .detail-summary .income-stat {
    position: relative;
  }

  html.device-actions-accessible body.device-detail-page .detail-summary .income-card-heading {
    padding-right: 64px;
  }

  html.device-actions-accessible body.device-detail-page .detail-summary .income-detail-button {
    position: absolute;
    top: 3px;
    right: 9px;
    z-index: 1;
    margin-left: 0;
  }

  html.device-actions-accessible body.device-detail-page .disk-iops-row {
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    text-align: center;
  }

  html.device-actions-accessible body.device-detail-page .disk-iops,
  html.device-actions-accessible body.device-detail-page .disk-action-buttons {
    justify-content: center;
  }

  html.device-actions-accessible body.device-detail-page .disk-action-buttons {
    flex-wrap: nowrap;
    gap: 6px;
  }

  html.device-actions-accessible body.device-detail-page .network-tag-options {
    grid-template-columns: 1fr;
  }

  .home-income-chart-card {
    padding: 8px;
  }

  .home-income-echart {
    height: 480px;
    min-height: 460px;
  }

  .device-name-actions button {
    flex: 1 1 0;
  }
}

@media (max-width: 360px) {
  html.device-actions-accessible body.device-detail-page .network-detail-panel {
    grid-template-columns: minmax(0, 1fr) repeat(3, 44px);
    gap: 7px 4px;
  }

  html.device-actions-accessible body.device-detail-page .network-detail-title > h2 {
    font-size: 16px;
  }

  html.device-actions-accessible body.device-detail-page .network-detail-actions button.device-icon-button {
    width: 44px;
    min-width: 44px;
  }
}

@media (max-width: 760px) {
  body.devices-page .home-income-detail-button {
    top: 8px;
    right: 6px;
  }

  html.device-actions-accessible body.devices-page .total-speed-card > .income-stat {
    padding-right: clamp(4px, 1.1vw, 6px);
    padding-left: clamp(4px, 1.1vw, 6px);
  }

  html.device-actions-accessible body.devices-page .home-income-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: clamp(2px, 1vw, 4px);
    padding-right: clamp(38px, 12vw, 48px);
  }

  html.device-actions-accessible body.devices-page .home-income-heading > span {
    font-size: clamp(10px, 3.2vw, 14px);
    line-height: normal;
    white-space: nowrap;
  }

  html.device-actions-accessible body.devices-page .home-income-detail-button {
    top: 3px;
    right: clamp(4px, 1.1vw, 6px);
    width: clamp(34px, 11vw, 44px);
    min-width: clamp(34px, 11vw, 44px);
    font-size: clamp(12px, 3.5vw, 14px);
  }
}
