:root {
  color-scheme: light;
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  --primary: #006fee;
  --primary-dark: #005bc4;
  --primary-soft: #e6f4ff;
  --text: #1e2329;
  --muted: #71717a;
  --line: #e5e7eb;
  --surface: #ffffff;
  --canvas: #f5f5f5;
  --danger: #dc2626;
  --success: #059669;
  --warning: #d97706;
  --sidebar: 224px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background: var(--canvas);
  color: var(--text);
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.boot-loading,
.page-loading {
  display: grid;
  min-height: 180px;
  place-items: center;
  color: var(--muted);
  font-size: 14px;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: fixed;
  z-index: 30;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  height: 64px;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.6);
  padding: 8px 16px;
  backdrop-filter: blur(16px);
}

.brand {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text);
}

.brand-title {
  margin-left: 16px;
  background: linear-gradient(90deg, #006fee, #7828c8, #006fee);
  background-size: 200% auto;
  color: transparent;
  background-clip: text;
  font-size: 24px;
  font-weight: 500;
  line-height: 32px;
  white-space: nowrap;
}

.brand-mark {
  display: none;
}

.header-tools {
  display: grid;
  grid-template-columns: repeat(2, 32px);
  gap: 16px;
}

.header-tool {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
}

.header-tool:hover {
  opacity: 0.85;
}

.header-tool:active {
  transform: scale(0.97);
}

.header-tool svg {
  width: 18px;
  height: 18px;
}

.topbar-actions {
  position: relative;
  display: flex;
  align-items: center;
}

.username {
  max-width: 180px;
  overflow: hidden;
  color: var(--text);
  font-size: 20px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-trigger {
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0;
  cursor: pointer;
}

.avatar {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 2px solid #dbeafe;
  border-radius: 999px;
  background: linear-gradient(135deg, #dbeafe, #f3e8ff);
  color: var(--primary);
  font-size: 15px;
  font-weight: 700;
}

.user-dropdown {
  position: absolute;
  z-index: 80;
  top: 48px;
  right: 0;
  width: 150px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 6px;
  box-shadow: 0 10px 28px rgba(17, 24, 39, 0.14);
}

.user-dropdown .btn {
  width: 100%;
  justify-content: flex-start;
  border: 0;
}

.sidebar {
  position: fixed;
  z-index: 20;
  top: 64px;
  bottom: 0;
  left: 0;
  width: var(--sidebar);
  overflow-y: auto;
  background: var(--surface);
  padding: 8px 0 24px;
}

.nav-link {
  display: grid;
  width: calc(100% - 16px);
  height: 40px;
  align-items: center;
  grid-template-columns: 20px minmax(0, 1fr) 20px;
  gap: 8px;
  margin: 0 8px;
  border-radius: 8px;
  color: var(--text);
  padding: 0 8px;
  text-decoration: none;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease;
}

.nav-link:hover {
  background: #f3f4f6;
}

.nav-link:active {
  transform: translateY(1px);
}

.nav-link.is-active {
  background: var(--primary-soft);
  color: #0958d9;
}

.nav-icon {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
}

.nav-icon svg {
  width: 18px;
  height: 18px;
}

.nav-label {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.main {
  min-height: 100vh;
  margin-left: var(--sidebar);
  padding: 72px 8px 8px;
}

.page {
  width: 100%;
  height: calc(100vh - 80px);
  min-height: calc(100vh - 80px);
  overflow: auto;
  border-radius: 12px 12px 0 0;
  background: var(--surface);
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 16px 16px 0;
}

.page-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.25;
}

.page-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 0 16px;
}

.toolbar-spacer {
  flex: 1 1 20px;
}

.filter-panel {
  padding-top: 8px;
}

.status-toolbar {
  min-height: 36px;
  margin-bottom: 4px;
}

.filter-toolbar {
  margin-top: 12px;
  margin-bottom: 8px;
}

.filter-select {
  max-width: 190px;
}

.search-input {
  width: 192px;
  min-width: 160px;
}

.summary-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 0 16px 8px;
}

.summary-item {
  display: inline-flex;
  min-width: max-content;
  min-height: 32px;
  align-items: center;
  gap: 8px;
  border-radius: 8px;
  background: #f5f5f5;
  color: var(--muted);
  padding: 5px 10px;
  font-size: 12px;
}

.summary-item strong {
  color: var(--text);
  font-size: 14px;
}

.user-page {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.flag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  padding: 4px 16px 8px;
  color: #71717a;
  font-size: 12px;
}

.flag-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.date-input {
  width: 190px;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d4d4d8;
}

.status-dot.is-on {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.device-id-link {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.device-id-link:hover {
  text-decoration: underline;
}

.device-uid {
  display: block;
  overflow: hidden;
  max-width: 142px;
  margin-top: 3px;
  color: #9ca3af;
  font-size: 11px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-item.is-success {
  background: #ecfdf5;
  color: #047857;
}

.summary-item.is-warning {
  background: #fffbeb;
  color: #b45309;
}

.summary-item.is-danger {
  background: #fef2f2;
  color: #b91c1c;
}

.summary-item.is-info {
  background: #e0f2fe;
  color: #0369a1;
}

.link-action {
  border: 0;
  background: transparent;
  color: var(--primary);
  padding: 0 6px;
  cursor: pointer;
  font-size: 12px;
}

.link-action.is-success {
  color: #059669;
}

.link-action.is-danger {
  color: #dc2626;
}

.order-stat.is-warning {
  background: #fff7ed;
}

.order-stat.is-success {
  background: #ecfdf5;
}

.order-stat.is-danger {
  background: #fef2f2;
}

#user-results {
  min-height: 0;
  flex: 1;
}

#user-results .table-card {
  display: flex;
  height: 100%;
  flex-direction: column;
}

#user-results .table-scroll {
  min-height: 0;
  flex: 1;
}

#user-results table {
  width: 2010px;
  min-width: 2010px;
}

#user-results th,
#user-results td {
  height: 58px;
}

#user-results th {
  height: 44px;
}

#user-results th:nth-child(1),
#user-results td:nth-child(1) {
  width: 180px;
  min-width: 180px;
}

#user-results th:nth-child(2),
#user-results td:nth-child(2),
#user-results th:nth-child(3),
#user-results td:nth-child(3) {
  width: 150px;
  min-width: 150px;
}

#user-results th:nth-child(4),
#user-results td:nth-child(4) {
  width: 120px;
  min-width: 120px;
}

#user-results th:nth-child(5),
#user-results td:nth-child(5) {
  width: 130px;
  min-width: 130px;
}

#user-results td:nth-child(-n + 5) .cell-wrap {
  overflow: visible;
}

.orders-page {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.order-heading {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 16px;
  padding: 8px 16px 4px;
}

.order-heading h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 500;
}

.order-filter-row {
  display: flex;
  min-height: 52px;
  align-items: center;
  gap: 8px;
  padding: 4px 16px 8px;
}

.fixed-select {
  width: 150px;
  min-width: 150px;
  background: #f4f4f5;
  border-color: transparent;
}

.order-search-input {
  width: min(420px, 42vw);
}

.order-search-toolbar {
  min-height: 52px;
  margin: 0;
  padding-top: 4px;
  padding-bottom: 8px;
}

.order-summary {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 20px;
  overflow-x: auto;
  padding: 4px 16px 8px;
}

.order-stat {
  display: flex;
  min-width: max-content;
  align-items: baseline;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.order-stat strong {
  color: var(--text);
  font-size: 18px;
}

.order-summary > .btn {
  margin-left: auto;
  color: var(--primary);
}

#order-results {
  min-height: 0;
  flex: 1;
}

#order-results .table-card {
  display: flex;
  height: 100%;
  flex-direction: column;
}

#order-results .table-scroll {
  min-height: 0;
  flex: 1;
}

#order-results table {
  min-width: 1280px;
}

.app-icon-thumb,
.app-icon-placeholder {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  object-fit: cover;
  background: #f4f4f5;
}

.app-icon-thumb-lg {
  width: 58px;
  height: 58px;
  border-radius: 13px;
}

.icon-upload-result,
.detail-list dd:has(.app-icon-thumb) {
  display: flex;
  align-items: center;
  gap: 10px;
}

.detail-icon-path {
  word-break: break-all;
}

.app-icon-placeholder {
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 9px;
  font-weight: 700;
}

.btn {
  display: inline-flex;
  min-width: 80px;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  color: #374151;
  padding: 0 16px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.2;
  text-decoration: none;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
}

.btn-icon {
  min-width: 40px;
  width: 40px;
  padding: 0;
  background: #f5f5f5;
}

.btn:hover {
  border-color: #818cf8;
  color: var(--primary);
}

.btn:focus-visible,
.input:focus-visible,
.select:focus-visible,
.textarea:focus-visible {
  outline: 3px solid rgba(99, 102, 241, 0.18);
  outline-offset: 1px;
}

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

.btn-primary:hover {
  border-color: var(--primary-dark);
  background: var(--primary-dark);
  color: #fff;
}

.btn-danger {
  border-color: #fecaca;
  color: var(--danger);
}

.btn-danger:hover {
  border-color: #f87171;
  background: #fef2f2;
  color: #b91c1c;
}

.btn-ghost {
  border-color: transparent;
  background: transparent;
}

.btn-small {
  min-width: 32px;
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.btn[disabled] {
  cursor: not-allowed;
  opacity: 0.55;
}

.tabs {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.tab {
  min-width: auto;
  min-height: 28px;
  padding: 0 12px;
  border-color: transparent;
  background: transparent;
}

.tab.is-active {
  border-color: #b8d9ff;
  background: var(--primary-soft);
  color: #0958d9;
}

.input,
.select,
.textarea {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 7px 10px;
  outline: none;
}

.input,
.select {
  min-height: 40px;
  font-size: 14px;
}

.input {
  min-width: 220px;
}

.compact-select {
  width: 80px;
  min-width: 80px;
}

.textarea {
  width: 100%;
  min-height: 160px;
  resize: vertical;
  font-size: 14px;
  line-height: 1.55;
}

.card {
  border: 1px solid #e4e4e7;
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.03);
}

.table-card {
  border: 0;
  border-top: 1px solid #f0f0f0;
  border-radius: 0;
  overflow: hidden;
  box-shadow: none;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  height: 40px;
  padding: 8px 12px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  background: #f5f5f5;
  color: #71717a;
  font-size: 14px;
  font-weight: 600;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: #fafbff;
}

.cell-wrap {
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty {
  padding: 42px 16px;
  color: #9ca3af;
  text-align: center;
}

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  min-height: 56px;
  padding: 8px 16px;
  color: var(--muted);
  font-size: 12px;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.badge {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  border-radius: 999px;
  background: #f3f4f6;
  color: #4b5563;
  padding: 2px 8px;
  font-size: 12px;
}

.badge-success {
  background: #ecfdf5;
  color: var(--success);
}

.badge-warning {
  background: #fffbeb;
  color: var(--warning);
}

.badge-danger {
  background: #fef2f2;
  color: var(--danger);
}

.device-live-status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.live-state {
  position: relative;
  display: inline-grid;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  place-items: center;
  border-radius: 50%;
  background: #f4f4f5;
}

.live-state i {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #a1a1aa;
}

.live-state.is-on {
  background: #dcfce7;
}

.live-state.is-on::before {
  position: absolute;
  width: 12px;
  height: 12px;
  border: 1px solid rgba(34, 197, 94, 0.5);
  border-radius: 50%;
  animation: live-state-pulse 2s ease-out infinite;
  content: "";
}

.live-state.is-on i {
  background: #22c55e;
  box-shadow: 0 0 0 2px #fff;
}

@keyframes live-state-pulse {
  from {
    opacity: 0.85;
    transform: scale(0.75);
  }
  to {
    opacity: 0;
    transform: scale(1.65);
  }
}

.device-state-icon {
  display: inline-grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  border-radius: 8px;
  background: #f4f4f5;
  color: #a1a1aa;
}

.device-state-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.device-state-icon.is-accessibility.is-on {
  background: #e0f2fe;
  color: #0284c7;
}

.device-state-icon.is-lock.is-on {
  background: #fce7f3;
  color: #db2777;
}

.device-state-icon.is-battery-whitelist.is-on {
  background: #fff7ed;
  color: #ea580c;
}

.device-state-icon.is-adb.is-on {
  background: #e0f2fe;
  color: #0284c7;
}

.country-flag {
  display: inline-grid;
  width: 40px;
  height: 30px;
  overflow: hidden;
  flex: 0 0 40px;
  place-items: center;
  border: 1px solid #e4e4e7;
  border-radius: 4px;
  background: #fafafa;
  font-family: "Segoe UI Emoji", sans-serif;
  font-size: 25px;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.country-flag svg {
  width: 100%;
  height: 100%;
}

.country-flag.country-cn {
  border-color: #dc2626;
}

.country-flag.is-unknown svg {
  width: 24px;
  height: 18px;
  fill: none;
  stroke: #a1a1aa;
  stroke-width: 1.3;
}

.device-brand {
  display: inline-flex;
  max-width: 142px;
  flex-direction: column;
  gap: 3px;
}

.device-brand strong,
.device-brand small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-brand strong {
  color: #27272a;
  font-size: 13px;
  font-weight: 650;
}

.device-brand small {
  color: #9ca3af;
  font-size: 11px;
}

.battery-cell {
  display: inline-flex;
  min-width: 98px;
  align-items: center;
  gap: 8px;
  color: #52525b;
  font-size: 12px;
}

.battery-cell strong {
  min-width: 32px;
  color: #3f3f46;
  font-size: 12px;
  font-weight: 650;
}

.battery-cell small {
  margin-left: -6px;
  color: #f59e0b;
  font-size: 10px;
}

.battery-gauge {
  position: relative;
  display: inline-flex;
  width: 48px;
  height: 20px;
  align-items: stretch;
  gap: 2px;
  border: 1.5px solid currentColor;
  border-radius: 4px;
  padding: 3px;
  color: #22c55e;
}

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

.battery-gauge i {
  min-width: 0;
  flex: 1;
  border-radius: 1px;
  background: #e4e4e7;
}

.battery-gauge i.is-filled {
  background: currentColor;
}

.battery-cell.is-medium .battery-gauge {
  color: #f59e0b;
}

.battery-cell.is-low .battery-gauge {
  color: #ef4444;
}

.network-quality {
  display: inline-flex;
  min-width: 104px;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
}

.network-quality i {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: currentColor;
}

.network-quality strong {
  font-weight: 650;
}

.network-quality em {
  opacity: 0.8;
  font-size: 11px;
  font-style: normal;
}

.network-quality.is-excellent {
  background: #dcfce7;
  color: #15803d;
}

.network-quality.is-good {
  background: #e0f2fe;
  color: #0369a1;
}

.network-quality.is-fair {
  background: #fef3c7;
  color: #b45309;
}

.network-quality.is-poor {
  background: #fee2e2;
  color: #dc2626;
}

.network-quality.is-interrupted {
  background: #f4f4f5;
  color: #71717a;
}

.network-quality.is-interrupted i {
  background: #ef4444;
}

.screen-state,
.network-type-tag {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 6px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 550;
}

.screen-state.is-off {
  background: #f4f4f5;
  color: #71717a;
}

.screen-state.is-black {
  background: #27272a;
  color: #fff;
}

.network-type-tag {
  background: #f3e8ff;
  color: #7e22ce;
}

.cell-muted {
  color: #a1a1aa;
}

@media (prefers-reduced-motion: reduce) {
  .live-state.is-on::before {
    animation: none;
  }
}

.dashboard-hero {
  position: relative;
  display: flex;
  overflow: hidden;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid #dbeafe;
  border-radius: 18px;
  background:
    radial-gradient(circle at 88% 18%, rgba(124, 58, 237, 0.12), transparent 32%),
    linear-gradient(135deg, #eef4ff, #fff 58%);
  margin: 16px;
  padding: 28px 32px;
}

.dashboard-kicker {
  display: block;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.dashboard-hero h1 {
  margin: 8px 0 0;
  font-size: 28px;
}

.dashboard-hero p {
  max-width: 620px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.dashboard-cta {
  flex: 0 0 auto;
  margin-top: 8px;
}

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

.home-stat-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stat-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  min-height: 118px;
  padding: 18px 20px;
}

.stat-card-online {
  background: #ecfdf5;
  border-color: #bbf7d0;
}

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

.stat-icon {
  font-size: 22px;
}

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

.stat-value {
  margin-top: 7px;
  font-size: 28px;
  font-weight: 700;
}

.form-card {
  padding: 20px;
}

.page > .form-card {
  margin: 0 16px 16px;
}

.page > .toolbar:first-child {
  padding-top: 8px;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.field label {
  color: #4b5563;
  font-size: 13px;
  font-weight: 500;
}

.field label em {
  color: #ef4444;
  font-style: normal;
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.admin-modal {
  width: min(760px, 100%);
}

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

.permission-option {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  padding: 8px 10px;
  cursor: pointer;
}

.permission-option:has(input:checked) {
  border-color: #91caff;
  background: var(--primary-soft);
  color: #0958d9;
}

.permission-option input {
  width: 15px;
  height: 15px;
  accent-color: var(--primary);
}

.permission-option .nav-icon {
  width: 18px;
  height: 18px;
}

#admin-power-field.is-disabled {
  opacity: 0.72;
}

.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  overflow-y: auto;
  place-items: center;
  background: rgba(17, 24, 39, 0.48);
  padding: 20px;
}

.modal {
  width: min(600px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.24);
}

.modal-header,
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
}

.modal-header {
  border-bottom: 1px solid var(--line);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.terminal-modal-head button,
.modal-header button,
.terminal-modal-head a,
.modal-header a,
.terminal-modal-head input,
.modal-header input {
  cursor: pointer;
  touch-action: auto;
}

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

.modal-body {
  padding: 18px;
}

.modal-footer {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
}

.pack-modal {
  display: flex;
  width: min(820px, 100%);
  flex-direction: column;
  overflow: hidden;
}

.pack-modal .modal-header {
  flex: 0 0 auto;
  background: #fff;
}

.pack-modal .modal-body {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0;
  background: #f8fafc;
}

.pack-modal .modal-footer {
  flex: 0 0 auto;
  background: #fff;
}

.pack-form {
  display: flex;
  flex-direction: column;
}

.pack-section {
  border-bottom: 1px solid #e8ebf0;
  background: #fff;
  padding: 18px 22px 20px;
}

.pack-section:last-child {
  border-bottom: 0;
}

.pack-section-title {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 16px;
}

.pack-section-title > span {
  display: inline-flex;
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
}

.pack-section-title div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.pack-section-title strong {
  color: #27272a;
  font-size: 15px;
}

.pack-section-title small,
.pack-icon-picker small,
.pack-connection-note small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
}

.pack-form .input,
.pack-form .select {
  width: 100%;
  min-width: 0;
}

.pack-brand-row {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.pack-icon-picker {
  display: flex;
  min-height: 88px;
  align-items: center;
  gap: 13px;
  border: 1px dashed #b8c1d1;
  border-radius: 10px;
  background: #fafcff;
  padding: 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.pack-icon-picker:hover {
  border-color: var(--primary);
  background: #f5f8ff;
}

.pack-icon-picker > span:last-of-type {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.pack-icon-picker strong {
  color: #3f3f46;
  font-size: 13px;
}

.pack-icon-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.pack-icon-preview {
  display: inline-flex;
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 13px;
  background: linear-gradient(145deg, #2563eb, #7c3aed);
  color: #fff;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.2);
  font-size: 13px;
  font-weight: 700;
}

.pack-icon-preview:has(img) {
  background: #e4e4e7;
  color: transparent;
}

.pack-icon-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pack-version-grid {
  gap: 12px;
}

.pack-extra-grid {
  margin-top: 14px;
}

.pack-connect-section {
  background: #fbfdff;
}

.pack-connection-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  grid-column: 1 / -1;
  border: 1px solid #bfdbfe;
  border-radius: 9px;
  background: #eff6ff;
  margin: 12px 0 14px;
  padding: 10px 12px;
}

.pack-connection-note div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pack-connection-note strong {
  color: #1e40af;
  font-size: 13px;
}

.connection-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: #22c55e;
  margin-top: 5px;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.connection-dot-warning {
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.16);
}

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

.input-action .input {
  flex: 1;
}

.detail-list {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 9px 14px;
  margin: 0;
  font-size: 13px;
}

.detail-list dt {
  color: var(--muted);
}

.detail-list dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

#toast-root {
  position: fixed;
  z-index: 200;
  right: 18px;
  top: 18px;
  bottom: auto;
  display: flex;
  width: min(360px, calc(100vw - 36px));
  flex-direction: column;
  gap: 8px;
}

.toast {
  border-radius: 10px;
  background: #111827;
  color: #fff;
  padding: 11px 14px;
  box-shadow: 0 12px 30px rgba(17, 24, 39, 0.24);
  font-size: 13px;
}

.toast-error {
  background: #b91c1c;
}

.login-page {
  position: relative;
  overflow: hidden;
  display: grid;
  min-height: 100vh;
  place-items: center;
  background: #f4f6fb;
  padding: 24px;
}

.login-blob {
  position: absolute;
  z-index: 0;
  width: 420px;
  height: 320px;
  filter: blur(8px);
  opacity: 0.9;
  pointer-events: none;
}

.login-blob-tr {
  top: -80px;
  right: -60px;
  border-radius: 50% 40% 60% 50%;
  background: linear-gradient(135deg, #8b8cf8, #6d74f6);
}

.login-blob-bl {
  bottom: -90px;
  left: -80px;
  border-radius: 50% 60% 40% 50%;
  background: linear-gradient(135deg, #9aa0ff, #7b82f8);
}

.login-card {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  border: 0;
  border-radius: 8px;
  background: #fff;
  padding: 36px 32px 28px;
  box-shadow: 0 12px 40px rgba(80, 86, 180, 0.12);
}

.login-card h1 {
  margin: 0 0 6px;
  color: #5b5ef6;
  font-size: 28px;
  font-weight: 700;
  text-align: center;
}

.login-card > p {
  margin: 0 0 22px;
  color: #8b8b97;
  font-size: 13px;
  text-align: center;
}

.login-mark {
  display: none;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-form .input {
  width: 100%;
  background: #f4f4f5;
  border-color: transparent;
}

.login-submit {
  width: 100%;
  min-height: 42px;
  border-radius: 8px;
}

.login-error {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-size: 13px;
}

.terminal-boot,
.terminal-error-page {
  min-height: 100vh;
  background: #f4f4f5;
  padding: 20px;
}

.terminal-page {
  display: flex;
  width: 100%;
  height: 100vh;
  min-height: 680px;
  flex-direction: column;
  overflow: hidden;
  background: #f4f4f5;
  color: #27272a;
}

.terminal-header {
  z-index: 5;
  display: flex;
  min-height: 64px;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid #e4e4e7;
  background: rgba(255, 255, 255, 0.95);
  padding: 8px 14px;
}

.terminal-body {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
  padding: 10px;
}

.terminal-tabs-top {
  z-index: 4;
  flex: 0 0 auto;
  border-bottom: 1px solid #e4e4e7;
  background: #fff;
}

.layout-switch {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid #d4d4d8;
  border-radius: 999px;
  background: #f4f4f5;
  padding: 2px;
}

.layout-switch-btn {
  min-height: 28px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #52525b;
  padding: 0 12px;
  cursor: pointer;
  font-size: 12px;
}

.layout-switch-btn.is-active {
  background: #fff;
  color: var(--primary);
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.screen-board {
  --phone-scale: 0.42;
  display: grid;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  gap: 10px;
}

.screen-board.is-grid {
  grid-template-columns: minmax(0, 1fr) 308px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
}

.screen-board.is-grid [data-screen="node"] { grid-column: 1; grid-row: 1; }
.screen-board.is-grid [data-screen="cast"] { grid-column: 1; grid-row: 2; }
.screen-board.is-grid .terminal-center { grid-column: 2; grid-row: 1 / span 2; }
.screen-board.is-grid [data-screen="adb-node"],
.screen-board.is-grid [data-screen="shizuku"] { grid-column: 3; grid-row: 1; }
.screen-board.is-grid [data-screen="adb-cast"] { grid-column: 3; grid-row: 2; }

.screen-board.is-row {
  --phone-scale: 0.32;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 308px minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
}

.screen-board.is-row [data-screen="node"] { grid-column: 1; }
.screen-board.is-row [data-screen="cast"] { grid-column: 2; }
.screen-board.is-row .terminal-center { grid-column: 3; }
.screen-board.is-row [data-screen="adb-node"],
.screen-board.is-row [data-screen="shizuku"] { grid-column: 4; }
.screen-board.is-row [data-screen="adb-cast"] { grid-column: 5; }

/* Right-side ADB panels: visual folding only, never a connection toggle. */
.screen-board.is-row.is-adb-collapsed {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 308px;
}

.screen-board.is-grid.is-adb-collapsed {
  grid-template-columns: minmax(0, 1fr) 308px;
}

.screen-board.is-adb-collapsed > [data-screen="adb-node"],
.screen-board.is-adb-collapsed > [data-screen="shizuku"],
.screen-board.is-adb-collapsed > [data-screen="adb-cast"] {
  display: none;
}

.screen-board > section,
.screen-board > .terminal-center {
  min-width: 0;
  min-height: 0;
}

.terminal-center {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
}

.terminal-center .terminal-tree-panel,
.terminal-center .terminal-control-panel {
  min-height: 0;
}

.terminal-center .terminal-control-panel {
  flex: 1 1 auto;
  overflow: auto;
}

.terminal-modal {
  position: fixed;
  z-index: 120;
  inset: 0;
  display: grid;
  place-items: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  animation: terminal-modal-fade-in 0.22s ease;
}

@keyframes terminal-modal-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes terminal-sheet-rise {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.terminal-modal[hidden] {
  display: none;
}

.terminal-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(6px);
  cursor: pointer;
}

.terminal-modal-card {
  position: relative;
  display: flex;
  width: min(920px, calc(100vw - 32px));
  max-height: min(82vh, 880px);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 22px;
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.06),
    0 28px 80px -24px rgba(15, 23, 42, 0.45);
  animation: terminal-sheet-rise 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.terminal-modal-head {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  background: rgba(255, 255, 255, 0.92);
  padding: 14px 18px;
  backdrop-filter: blur(8px);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.terminal-modal-card.is-moved,
.modal.is-moved {
  animation: none;
}

.terminal-modal-card.is-dragging,
.modal.is-dragging {
  transition: none;
}

.terminal-modal-card.is-dragging .terminal-modal-head,
.modal.is-dragging .modal-header {
  cursor: grabbing;
}

.terminal-modal-head-text {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.terminal-modal-head strong {
  color: #0f172a;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.terminal-modal-subtitle {
  color: #64748b;
  font-size: 12px;
  line-height: 1.4;
}

.terminal-modal-subtitle:empty {
  display: none;
}

.terminal-modal-head-actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
}

.terminal-modal-card.terminal-sheet::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  border-radius: 22px 22px 0 0;
  background: linear-gradient(90deg, #0f172a 0%, #006fee 50%, #38bdf8 100%);
  content: '';
  pointer-events: none;
}

.terminal-modal-close {
  display: grid;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.05);
  color: #475569;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.terminal-modal-close span {
  margin-top: -2px;
}

.terminal-modal-close:hover {
  background: rgba(15, 23, 42, 0.06);
  color: #0f172a;
}

.terminal-modal .terminal-data-panel {
  min-height: 0;
  flex: 1;
  overflow: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.terminal-sheet-body {
  padding: 16px 18px 20px;
}

.terminal-modal .terminal-sheet-body {
  min-height: 200px;
}

.terminal-page .terminal-modal .page-loading {
  min-height: 220px;
  color: #64748b;
  font-size: 13px;
}

.terminal-page .terminal-modal .page-loading::after {
  display: block;
  width: 28px;
  height: 28px;
  border: 2px solid #e2e8f0;
  border-top-color: #0f172a;
  border-radius: 50%;
  margin: 12px auto 0;
  animation: terminal-spin 0.7s linear infinite;
  content: '';
}

@keyframes terminal-spin {
  to {
    transform: rotate(360deg);
  }
}

.terminal-left {
  display: flex;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #e4e4e7;
  border-radius: 10px;
  background: #fff;
}

.terminal-left .terminal-tabs {
  border-bottom: 1px solid #e4e4e7;
}

.terminal-left .terminal-data-panel {
  min-height: 0;
  flex: 1;
  overflow: auto;
  border: 0;
}

.terminal-sliders {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  color: #94a3b8;
  font-size: 11px;
}

.terminal-sliders label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid #e6edf5;
  border-radius: 999px;
  background: #fff;
  padding: 2px 8px 2px 8px;
  white-space: nowrap;
}

.terminal-sliders input[type='range'] {
  width: 64px;
  accent-color: #2563eb;
}

.terminal-sliders .compact-input {
  width: 46px;
  min-width: 0;
  min-height: 22px;
  border: 0;
  background: transparent;
  padding: 0 2px;
  font-size: 12px;
}

.metric-chip {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  background: #f4f4f5;
  padding: 0 8px;
  font-size: 11px;
}

.metric-chip.is-ping {
  background: #dcfce7;
  color: #166534;
}

.metric-chip.is-battery {
  background: #ffedd5;
  color: #9a3412;
}

.metric-chip.is-wifi {
  background: #dbeafe;
  color: #1d4ed8;
}

.terminal-sim-label {
  display: flex;
  flex-direction: column;
  color: #71717a;
  font-size: 11px;
}

.terminal-brand-wrap {
  position: relative;
}

.online-dot {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 10px;
  height: 10px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #a1a1aa;
}

.online-dot.is-on {
  background: #22c55e;
}

.unlock-btn {
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  background: #d1fae5;
  color: #047857;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.cast-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.control-subtabs {
  display: flex;
  gap: 8px;
}

.control-subtabs button {
  border: 0;
  background: transparent;
  color: #a1a1aa;
  cursor: pointer;
}

.control-subtabs button.is-active {
  color: var(--primary);
  font-weight: 700;
}

.control-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #3f3f46;
  font-size: 13px;
}

.control-toggle small {
  display: block;
  color: #a1a1aa;
  font-size: 10px;
}

.btn-danger-soft {
  color: #e11d48 !important;
  border-color: #fecdd3 !important;
  background: #fff1f2 !important;
}

.control-line {
  display: flex;
}

.control-line .btn {
  width: 100%;
  justify-content: flex-start;
}

.log-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.terminal-camera-bar {
  border-top: 1px solid #f1f1f3;
  margin-top: 12px;
  padding-top: 10px;
}

.terminal-camera-bar small {
  display: block;
  margin: 4px 0 8px;
  color: #a1a1aa;
}

.terminal-camera-preview {
  position: relative;
  margin-top: 12px;
  width: 100%;
  min-height: 200px;
  overflow: hidden;
  border-radius: 16px;
  background: linear-gradient(165deg, #0f172a 0%, #1e293b 55%, #0b1220 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.terminal-camera-preview.has-frame {
  min-height: 0;
  width: 100%;
  max-width: 100%;
  max-height: min(56vh, 720px);
  aspect-ratio: var(--camera-aspect, 16 / 9);
}

.terminal-camera-stage {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  transition: transform 0.25s ease;
  transform-origin: center center;
}

.terminal-camera-frame {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.terminal-camera-preview.is-on .terminal-camera-idle {
  opacity: 0;
  pointer-events: none;
}

.terminal-camera-idle {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  color: rgba(248, 250, 252, 0.72);
  font-size: 13px;
  transition: opacity 0.2s ease;
}

.terminal-camera-eye {
  width: 52px;
  height: 52px;
  fill: none;
  stroke: rgba(248, 250, 252, 0.35);
  stroke-width: 1.6;
}

.terminal-camera-eye circle {
  fill: rgba(248, 250, 252, 0.12);
  stroke: rgba(248, 250, 252, 0.45);
}

.terminal-camera-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
}

.terminal-camera-rotate {
  min-height: 32px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 999px;
  background: #fff;
  color: #475569;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  padding: 0 12px;
}

.terminal-camera-rotate.is-active {
  border-color: #0f172a;
  background: #0f172a;
  color: #fff;
}

.terminal-camera-preview.is-on .terminal-camera-empty {
  display: none;
}

.terminal-identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.terminal-identity > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
}

.terminal-identity > .terminal-nav {
  min-width: auto;
  flex-direction: row;
  gap: 8px;
}

.terminal-identity strong {
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terminal-identity small {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
}

.terminal-nav {
  display: inline-flex;
  flex: 0 0 auto;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.terminal-back {
  display: inline-flex;
  height: 42px;
  align-items: center;
  gap: 2px;
  border: 1px solid #d5deea;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 18px -14px rgba(15, 23, 42, 0.9);
  padding: 0 16px 0 8px;
  color: #0f172a;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

.terminal-back span {
  font-size: 30px;
  font-weight: 500;
  line-height: 0.8;
}

.terminal-back:hover {
  border-color: #b9c8dc;
  background: #f8fbff;
}

.terminal-refresh {
  height: 42px;
  border: 1px solid #c5d5ee;
  border-radius: 14px;
  background: #eef4ff;
  padding: 0 16px;
  color: #1d4ed8;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.terminal-refresh:hover {
  background: #e2ecff;
}

.terminal-brand-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(145deg, #1428a0, #0a1458);
  color: white;
  font-size: 16px;
  font-weight: 800;
  box-shadow: 0 5px 14px -6px rgba(10, 20, 88, 0.65);
}

/* Device metadata is shared by the list and the terminal header. */
.terminal-note {
  display: flex;
  min-width: 0;
  flex: 0 1 auto;
  align-items: stretch;
  gap: 8px;
}
.terminal-metadata-item {
  display: flex;
  min-width: 140px;
  max-width: 260px;
  align-items: center;
  gap: 8px;
  border: 1px solid #e3eaf3;
  border-radius: 12px;
  background: #f8fafc;
  padding: 8px 12px;
  text-align: left;
  cursor: pointer;
}
.terminal-metadata-item:hover { border-color: #a5b8f9; background: #f3f6ff; }
.terminal-metadata-item:focus-visible { outline: 2px solid #4f6af0; outline-offset: 2px; }
.terminal-metadata-label { color: #718096; font-size: 13px; flex: 0 0 auto; }
.terminal-metadata-item b {
  overflow: hidden;
  color: #172033;
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.terminal-metadata-tag-values { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.terminal-metadata-tags { max-width: 380px; }

.terminal-metrics {
  display: flex;
  flex: 0 0 auto;
  align-items: stretch;
  gap: 8px;
}

.terminal-metrics > .metric-chip {
  display: flex;
  min-width: 86px;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  border-radius: 12px;
  padding: 6px 12px 7px;
  font-size: 11px;
  line-height: 1.2;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.terminal-metrics > .metric-chip em {
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0.04em;
  opacity: 0.72;
}

.terminal-metrics > .metric-chip strong {
  overflow: hidden;
  max-width: 120px;
  font-size: 14px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terminal-metrics > .assist-chip {
  min-width: 0;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  background: linear-gradient(180deg, #fff, #f8fafc);
  padding: 4px 4px 4px 10px;
  color: #64748b;
}

.terminal-metrics > .assist-chip.is-on {
  background: linear-gradient(180deg, #f0fdf4, #ecfdf5);
  box-shadow: inset 0 0 0 1px #bbf7d0, inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.assist-chip .socket-status {
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

.assist-chip .adb-status.is-busy {
  color: #b45309;
}

.assist-chip .adb-status.is-busy::before {
  background: #f59e0b;
}

.assist-btn {
  height: 28px;
  border: 0;
  border-radius: 9px;
  background: #006fee;
  color: #fff;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.assist-btn:hover {
  background: #005bc4;
}

.assist-chip .assist-btn.btn-danger,
.assist-chip .assist-btn.btn-danger:hover {
  background: #fff1f2;
  color: #e11d48;
  box-shadow: inset 0 0 0 1px #fecdd3;
}

.terminal-metrics > .metric-chip.is-ping {
  background: linear-gradient(180deg, #f0fdf4, #dcfce7);
  color: #166534;
}

.terminal-metrics > .metric-chip.is-pipeline {
  min-width: 104px;
  background: linear-gradient(180deg, #f8fafc, #eef2f7);
  color: #475569;
}

.terminal-metrics > .metric-chip.is-pipeline.is-good {
  background: linear-gradient(180deg, #eff6ff, #dbeafe);
  color: #1d4ed8;
}

.terminal-metrics > .metric-chip.is-pipeline.is-slow {
  background: linear-gradient(180deg, #fff7ed, #ffedd5);
  color: #c2410c;
}

.terminal-metrics > .metric-chip.is-battery {
  background: linear-gradient(180deg, #fff7ed, #ffedd5);
  color: #9a3412;
}

.terminal-metrics > .metric-chip.is-link.is-wifi {
  min-width: 88px;
  background: linear-gradient(180deg, #eff6ff, #dbeafe);
  color: #1d4ed8;
}

.terminal-metrics > .metric-chip.is-link.is-cell {
  min-width: 88px;
  background: linear-gradient(180deg, #f5f3ff, #ede9fe);
  color: #6d28d9;
}

.terminal-metrics > .metric-chip.is-link.is-lan,
.terminal-metrics > .metric-chip.is-link.is-unknown {
  min-width: 88px;
  background: linear-gradient(180deg, #f8fafc, #f1f5f9);
  color: #475569;
}

.tone-menu {
  position: relative;
  flex: 0 0 auto;
}

.tone-menu-btn {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid #e6edf5;
  border-radius: 12px;
  background: #fff;
  color: #64748b;
  cursor: pointer;
}

.tone-menu-btn svg {
  width: 18px;
  height: 18px;
}

.tone-menu.is-mist .tone-menu-btn { color: #3b82f6; }
.tone-menu.is-cream .tone-menu-btn { color: #c4843a; }
.tone-menu.is-apricot .tone-menu-btn { color: #e08a3c; }
.tone-menu.is-peach .tone-menu-btn { color: #e07a6a; }
.tone-menu.is-sand .tone-menu-btn { color: #b08948; }
.tone-menu.is-rose .tone-menu-btn { color: #c56b8a; }
.tone-menu.is-matcha .tone-menu-btn { color: #6f9a52; }

.tone-popover {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  min-width: 132px;
  gap: 2px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  background: #fff;
  padding: 6px;
  box-shadow: 0 18px 40px -22px rgba(15, 23, 42, 0.55);
}

.tone-popover[hidden] {
  display: none;
}

.tone-chip {
  display: flex;
  width: 100%;
  height: 32px;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  padding: 0 8px;
  color: #475569;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.tone-chip:hover {
  background: #f8fafc;
}

.tone-chip i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.12);
}

.tone-chip.tone-mist i { background: #8eb4e8; }
.tone-chip.tone-cream i { background: #e7c99a; }
.tone-chip.tone-apricot i { background: #f0b27a; }
.tone-chip.tone-peach i { background: #f3a598; }
.tone-chip.tone-sand i { background: #d8c29a; }
.tone-chip.tone-rose i { background: #e3a8bc; }
.tone-chip.tone-matcha i { background: #b7cf9e; }

.tone-check {
  width: 7px;
  height: 11px;
  margin-left: auto;
  margin-right: 4px;
  border-right: 2px solid transparent;
  border-bottom: 2px solid transparent;
  transform: rotate(45deg) translate(-1px, -1px);
}

.tone-chip.is-active {
  font-weight: 700;
  box-shadow: inset 0 0 0 1.5px currentColor;
}

.tone-chip.is-active .tone-check {
  border-color: currentColor;
}

.tone-chip.tone-mist.is-active { background: #e7f0fc; color: #1d4ed8; }
.tone-chip.tone-cream.is-active { background: #f8edd8; color: #9a5b24; }
.tone-chip.tone-apricot.is-active { background: #fde8d2; color: #c26512; }
.tone-chip.tone-peach.is-active { background: #fde4df; color: #c45448; }
.tone-chip.tone-sand.is-active { background: #f3ead6; color: #8d6a2f; }
.tone-chip.tone-rose.is-active { background: #fbe4ec; color: #b14b72; }
.tone-chip.tone-matcha.is-active { background: #e7f0dc; color: #4f7a38; }

.shell-switch {
  display: inline-flex;
  height: 36px;
  flex: 0 0 auto;
  align-items: center;
  gap: 2px;
  border: 1px solid #e6edf5;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  padding: 3px;
}

.shell-switch-btn {
  display: inline-flex;
  height: 100%;
  align-items: center;
  gap: 4px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  padding: 0 8px;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.shell-switch-btn svg {
  width: 15px;
  height: 15px;
}

.shell-switch-btn.is-active {
  background: #0f172a;
  color: #fff;
  box-shadow: 0 6px 14px -10px rgba(15, 23, 42, 0.8);
}

.terminal-page.shell-ios .phone-frame {
  border: 12px solid #1c1c1e;
  border-radius: 56px;
  background: #000;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.28),
    inset 0 0 0 3px #3f3f46,
    0 22px 40px -24px rgba(15, 23, 42, 0.55);
}

.terminal-page.shell-ios .phone-camera {
  z-index: 6;
  top: 14px;
  width: 118px;
  height: 34px;
  border-radius: 20px;
  background: #050505;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.terminal-page.shell-ios .phone-camera::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 16px;
  width: 9px;
  height: 9px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #35506e, #101820 70%);
  box-shadow: 0 0 0 1px rgba(90, 150, 210, 0.35);
}

.terminal-page.shell-ios .phone-nav {
  position: relative;
  background: #f5f5f7;
}

.terminal-page.shell-ios .phone-nav button,
.terminal-page.shell-ios .phone-nav span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.terminal-page.shell-ios .phone-nav button[data-terminal-command="control_home"] {
  left: 50%;
  top: 50%;
  width: 132px;
  height: 28px;
  transform: translate(-50%, -50%);
  color: transparent;
  font-size: 0;
  opacity: 1;
  pointer-events: auto;
}

.terminal-page.shell-ios .phone-nav::after {
  content: "";
  width: 126px;
  height: 5px;
  border-radius: 99px;
  background: #1c1c1e;
}

.terminal-page.shell-android .phone-frame {
  border: 9px solid #12141a;
  border-radius: 36px;
}

.terminal-page.shell-android .phone-camera {
  z-index: 6;
  top: 8px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #09090b;
  box-shadow: 0 0 0 3px #27272a;
}

.terminal-metrics > .metric-chip.is-ping strong,
.terminal-metrics > .metric-chip.is-battery strong,
.terminal-metrics > .metric-chip.is-link strong {
  color: inherit;
}

.terminal-metrics #terminal-network-metric.is-excellent strong {
  color: #15803d;
}

.terminal-metrics #terminal-network-metric.is-good strong {
  color: #0369a1;
}

.terminal-metrics #terminal-network-metric.is-fair strong {
  color: #b45309;
}

.terminal-metrics #terminal-network-metric.is-poor strong,
.terminal-metrics #terminal-network-metric.is-interrupted strong {
  color: #dc2626;
}

.terminal-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.socket-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #a16207;
  font-size: 11px;
}

.socket-status::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f59e0b;
  content: "";
}

.socket-status.is-connected {
  color: #047857;
}

.socket-status.is-connected::before {
  background: #10b981;
  box-shadow: 0 0 0 3px #d1fae5;
}

.terminal-tabs {
  display: flex;
  min-height: 42px;
  flex: 0 0 auto;
  align-items: flex-end;
  gap: 2px;
  overflow-x: auto;
  border-bottom: 1px solid #e4e4e7;
  background: white;
  padding: 0 12px;
}

.terminal-tab {
  position: relative;
  min-width: 64px;
  height: 41px;
  border: 0;
  background: transparent;
  color: #71717a;
  padding: 0 12px;
  cursor: pointer;
  font-size: 12px;
}

.terminal-tab:hover,
.terminal-tab.is-active {
  color: var(--primary);
}

.terminal-tab.is-active {
  font-weight: 600;
}

.terminal-tab.is-active::after {
  position: absolute;
  right: 12px;
  bottom: 0;
  left: 12px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--primary);
  content: "";
}

.terminal-workspace {
  display: none;
}

.terminal-data-panel,
.terminal-tree-panel,
.terminal-control-panel,
.terminal-phone-stage,
.terminal-secondary-stage {
  min-height: 0;
  overflow: auto;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  background: white;
}

.terminal-data-panel,
.terminal-tree-panel,
.terminal-control-panel {
  padding: 8px;
}

.terminal-panel-title {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid #f1f1f3;
  margin: -2px -2px 8px;
  padding: 0 4px 7px;
  font-size: 13px;
}

.terminal-panel-title.is-centered {
  justify-content: center;
  text-align: center;
}

.terminal-tree,
.terminal-control-panel,
.terminal-list,
.terminal-permissions {
  display: flex;
  flex-direction: column;
}

.terminal-tree {
  gap: 4px;
  color: #71717a;
  font-size: 12px;
}

.terminal-overlay-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
  gap: 6px;
}

.guard-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.terminal-overlay-actions .terminal-overlay-btn {
  min-width: 0;
}

.terminal-overlay-switch {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 14px;
  background: linear-gradient(180deg, #f8fbff 0%, #d9e4f2 100%);
  padding: 8px 2px 7px;
  cursor: pointer;
  user-select: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 1px 2px rgba(15, 23, 42, 0.05),
    inset 0 0 0 1px rgba(15, 23, 42, 0.06);
}

.terminal-overlay-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 9px;
  background: #fff;
  color: #64748b;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.05);
}

.terminal-overlay-icon svg,
.fn-ico svg,
.lock-record svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.terminal-overlay-switch-label {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
}

.terminal-overlay-switch input {
  position: relative;
  width: 40px;
  height: 22px;
  appearance: none;
  border-radius: 999px;
  background: #cbd5e1;
  cursor: pointer;
  transition: background 0.2s ease;
}

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

.terminal-overlay-switch input:checked {
  background: #10b981;
}

.terminal-overlay-switch.is-mode-black input:checked {
  background: #0f172a;
}

.terminal-overlay-switch.is-mode-black:has(input:checked) .terminal-overlay-switch-label {
  color: #0f172a;
}

.terminal-overlay-switch.is-mode-block input:checked {
  background: #f59e0b;
}

.terminal-overlay-switch.is-mode-block:has(input:checked) .terminal-overlay-switch-label {
  color: #b45309;
}

.terminal-overlay-switch.is-mode-touch input:checked {
  background: #14b8a6;
}

.terminal-overlay-switch.is-mode-touch:has(input:checked) .terminal-overlay-switch-label {
  color: #0f766e;
}

.terminal-overlay-switch.is-mode-black-block input:checked {
  background: #0f172a;
  box-shadow: inset 0 0 0 1px #f59e0b;
}

.terminal-overlay-switch.is-mode-black-block:has(input:checked) .terminal-overlay-switch-label {
  color: #b45309;
}

.terminal-overlay-switch.is-mode-off input:checked {
  background: #10b981;
}

.terminal-overlay-switch.is-mode-off:has(input:checked) .terminal-overlay-switch-label {
  color: #047857;
}

.terminal-overlay-switch input:checked::after {
  transform: translateX(18px);
}

.terminal-tree span {
  min-height: 32px;
  border-radius: 7px;
  padding: 8px;
}

.terminal-tree span:nth-child(n + 2) {
  margin-left: 12px;
}

.terminal-tree span.is-active {
  background: #ecfdf5;
  color: #047857;
}

.terminal-phone-column {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 8px;
}

.terminal-phone-stage,
.terminal-secondary-stage {
  display: flex;
  overflow: auto;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background: radial-gradient(circle at 50% 28%, rgba(0, 111, 238, 0.08), transparent 42%), #f7f7f8;
  padding: 12px;
}

.phone-stage-head {
  display: flex;
  width: 100%;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
  color: #27272a;
  font-size: 13px;
}

.phone-stage-head small,
.adb-connect span {
  color: #71717a;
  font-size: 11px;
}

.adb-connect {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid #e4e4e7;
  margin-top: 8px;
  padding-top: 10px;
}

.adb-connect label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #71717a;
  font-size: 11px;
}

.adb-connect .input {
  width: 100%;
  min-width: 0;
}

.adb-connect .input::placeholder {
  color: #a1a1aa;
}

.adb-hint {
  margin: 0;
  color: #71717a;
  font-size: 11px;
  line-height: 1.45;
}

.adb-pair-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  background: #fafafa;
  padding: 8px;
}

.adb-pair-box > strong {
  font-size: 12px;
}

.adb-connect .row-actions {
  flex-wrap: wrap;
}

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

.adb-actions .btn {
  width: 100%;
  min-width: 0;
  padding: 0 4px;
  font-size: 12px;
}

.terminal-control-panel .adb-act,
.terminal-control-panel .adb-act:hover {
  border-color: transparent;
  color: #fff;
}

.terminal-control-panel .adb-act-pair,
.terminal-control-panel .adb-act-pair:hover {
  background: #3d4d63;
  border-color: #3d4d63;
}

.terminal-control-panel .adb-act-auto,
.terminal-control-panel .adb-act-auto:hover {
  background: #0f9f6e;
  border-color: #0f9f6e;
}

.terminal-control-panel .adb-act-stop,
.terminal-control-panel .adb-act-stop:hover {
  background: #e11d48;
  border-color: #e11d48;
}

#adb-status {
  line-height: 1.4;
  white-space: normal;
}

.phone-nav span {
  width: 33%;
  text-align: center;
}

.phone-scale-box {
  position: relative;
  align-self: center;
  flex: 0 0 auto;
  width: calc(412px * var(--phone-scale, 0.42));
  height: calc(915px * var(--phone-scale, 0.42));
}

.phone-frame {
  position: absolute;
  top: 0;
  left: 0;
  box-sizing: border-box;
  display: flex;
  width: 412px;
  height: 915px;
  flex-direction: column;
  overflow: hidden;
  transform: scale(var(--phone-scale, 0.42));
  transform-origin: top left;
  border: 7px solid #09090b;
  border-radius: 34px;
  background: #fff;
  box-shadow: 0 18px 44px -18px rgba(9, 9, 11, 0.4);
}

.phone-camera {
  position: absolute;
  z-index: 3;
  top: 7px;
  left: 50%;
  width: 9px;
  height: 9px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: #09090b;
  box-shadow: 0 0 0 2px #27272a;
}

.phone-screen {
  position: relative;
  min-height: 0;
  flex: 1;
  overflow: hidden;
  background: #fff;
  cursor: default;
}

.phone-screen > img.terminal-live-screen {
  display: none !important;
}

.phone-screen > canvas.live-frame {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  pointer-events: none;
}

.phone-screen > img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.phone-node-tree {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  background: #f2f3f5;
  color: #202124;
  font-family: Roboto, "Noto Sans SC", "Noto Sans", ui-sans-serif, system-ui, sans-serif;
}

.phone-node-tree.secure-node-fallback {
  z-index: 4;
  background: #f2f3f5;
  pointer-events: none;
}

/* The original accessibility view intentionally keeps all existing rules. */
.node-source-note {
  margin: -4px 12px 8px;
  color: #56606c;
  font-size: 11px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.node-source-note[hidden] { display: none; }
#terminal-phone-screen[data-node-view-channel="adb"] > #adb-node-tree {
  background: #fff;
  color: #292929;
}
#terminal-phone-screen[data-node-view-channel="adb"] #adb-node-tree .node-widget {
  box-shadow: none;
}
#terminal-phone-screen[data-node-view-channel="adb"] #adb-node-tree .node-frame,
#terminal-phone-screen[data-node-view-channel="adb"] #adb-node-tree .node-app-tile,
#terminal-phone-screen[data-node-view-channel="adb"] #adb-node-tree .node-image,
#terminal-phone-screen[data-node-view-channel="adb"] #adb-node-tree .node-button,
#terminal-phone-screen[data-node-view-channel="adb"] #adb-node-tree .node-input {
  background: transparent;
  border: 1px solid #aaa;
  border-radius: 2px;
}
#terminal-phone-screen[data-node-view-channel="adb"] #adb-node-tree .node-frame {
  border-style: dashed;
  border-color: #cecece;
}
#terminal-phone-screen[data-node-view-channel="adb"] #adb-node-tree .node-app-icon {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  color: #555;
}

.node-status-bar {
  position: absolute;
  z-index: 3;
  top: 0;
  right: 0;
  left: 0;
  height: 4.1%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f2f3f5;
  padding: 0 14px;
  color: #202124;
  font-size: 12px;
  line-height: 1;
  pointer-events: none;
}

.node-status-bar strong {
  font-size: inherit;
  font-weight: 650;
  letter-spacing: -0.2px;
}

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

.node-status-icons svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.node-status-icons svg:first-child {
  stroke: none;
}

.node-status-icons svg:nth-child(2) {
  fill: none;
}

.node-status-battery {
  position: relative;
  width: 19px;
  height: 9px;
  box-sizing: border-box;
  border: 1.5px solid currentColor;
  border-radius: 2px;
}

.node-status-battery::after {
  content: "";
  position: absolute;
  top: 2px;
  right: -3px;
  width: 2px;
  height: 4px;
  border-radius: 0 1px 1px 0;
  background: currentColor;
}

.node-status-battery i {
  position: absolute;
  inset: 1px;
  width: 58%;
  border-radius: 1px;
  background: currentColor;
}

.node-window-layer {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
}

.node-window-layer-dialog,
.node-window-layer-sheet,
.node-window-layer-popup,
.node-window-layer-ime {
  z-index: 4;
}

.node-window-dim {
  position: absolute;
  z-index: 3;
  inset: 0;
  background: rgba(24, 25, 27, 0.34);
  pointer-events: none;
}

.node-window-shell {
  position: absolute;
  z-index: 0;
  box-sizing: border-box;
  background: #fff;
  pointer-events: none;
}

.node-window-dialog {
  border: 1px solid #e1e3e6;
  border-radius: 18px;
  box-shadow: 0 12px 34px rgba(20, 22, 25, 0.22);
}

.node-window-sheet {
  border: 1px solid #e1e3e6;
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -10px 30px rgba(20, 22, 25, 0.18);
}

.node-window-popup {
  border: 1px solid #e3e4e7;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(20, 22, 25, 0.2);
}

.node-window-ime {
  border-top: 1px solid #d7dade;
  background: #e9ebee;
  box-shadow: 0 -5px 18px rgba(20, 22, 25, 0.12);
}

.phone-placeholder,
.secondary-placeholder {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  background: linear-gradient(180deg, #050505 0%, #0b0b0b 70%, #050505 100%);
  color: #f4f4f5;
}

.phone-screen.has-tree:has(.phone-node-tree:not([hidden])) .phone-placeholder,
.phone-screen.has-screen .secondary-placeholder,
.phone-screen.has-secure-tree .secondary-placeholder {
  display: none;
}

.phone-screen.has-screen > img {
  display: block;
  pointer-events: none;
  user-select: none;
  object-fit: contain;
}

.node-widget {
  position: absolute;
  z-index: 1;
  box-sizing: border-box;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 var(--node-text-padding, 4px);
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #202124;
  font-size: 12px;
  line-height: 1.15;
  white-space: nowrap;
  pointer-events: none;
}

.node-label {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: clip;
}

.node-frame {
  z-index: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.node-frame-row {
  border-bottom: 1px solid #eceef0;
  background: #fff;
}

.node-frame-network {
  border-bottom-color: #edf0f2;
  background: #fff;
}

.node-frame-setting {
  background: #fff;
}

.node-frame-preference {
  border-bottom: 1px solid #eceef0;
  background: rgba(255, 255, 255, 0.98);
}

.node-frame-preference.node-frame-card {
  border-color: #e6e8eb;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(30, 33, 36, 0.035);
}

.node-frame-search {
  border: 1px solid #e0e3e6;
  border-radius: 999px;
  background: #f8f9fa;
  box-shadow: inset 0 1px 1px rgba(30, 33, 36, 0.03);
}

.node-frame-card {
  border: 1px solid #eceef0;
  border-radius: 13px;
}

.node-frame-widget-card {
  border: 1px solid #e2e4e7;
  border-radius: 16px;
  background: linear-gradient(145deg, #fff, #f0f1f3);
  box-shadow: 0 3px 10px rgba(30, 33, 36, 0.08);
}

.node-widget.is-clipped {
  justify-content: center;
  overflow: hidden;
  padding: 0 var(--node-text-padding, 2px);
}

.node-widget.is-clipped .node-label {
  overflow: hidden;
  width: 100%;
  text-align: center;
  text-overflow: ellipsis;
}

.node-widget.is-multiline {
  align-items: flex-start;
  white-space: normal;
  overflow-wrap: anywhere;
}

.node-widget.is-multiline .node-label {
  max-height: 100%;
  white-space: normal;
}

.node-button {
  justify-content: center;
  border-radius: 18px;
  border: 1px solid #cfd2d6;
  background: #f7f7f8;
  color: #202124;
  font-weight: 500;
}

.node-input {
  padding: 0 var(--node-text-padding, 10px);
  border: 1px solid #c7c9cd;
  border-radius: 10px;
  background: #fff;
  color: #303134;
}

.node-input.is-focused {
  border-color: #555a60;
  box-shadow: 0 0 0 1px #555a60;
}

.node-input.node-role-search {
  border-color: #e0e3e6;
  border-radius: 999px;
  background: #f7f8f9;
  padding: 0 14px;
  color: #676b70;
  box-shadow: none;
}

.node-input.node-role-password .node-label {
  letter-spacing: 1.6px;
}

.node-image {
  background: transparent;
}

.node-visual-placeholder {
  overflow: hidden;
  padding: 0;
  border: 1px solid #dfe2e5;
  border-radius: 15px;
  background: linear-gradient(145deg, #f8f9fa 0%, #e4e7ea 100%);
  box-shadow: 0 3px 10px rgba(30, 33, 36, 0.08);
}

.node-image-placeholder {
  position: absolute;
  inset: 0;
  display: block;
  background:
    radial-gradient(circle at 72% 28%, rgba(105, 110, 116, 0.18) 0 9%, transparent 10%),
    linear-gradient(140deg, transparent 47%, rgba(112, 117, 123, 0.16) 48% 64%, transparent 65%);
}

.node-image-placeholder i,
.node-image-placeholder b {
  position: absolute;
  right: 12%;
  left: 12%;
  height: 6px;
  border-radius: 99px;
  background: rgba(92, 97, 103, 0.18);
}

.node-image-placeholder i {
  bottom: 22%;
}

.node-image-placeholder b {
  right: 38%;
  bottom: 13%;
}

.node-widget-host-placeholder {
  z-index: 0;
  align-items: flex-start;
  overflow: hidden;
  padding: 12px 14px;
  border: 1px solid #e0e3e6;
  border-radius: 16px;
  background:
    radial-gradient(circle at 79% 24%, rgba(88, 93, 99, 0.12) 0 8%, transparent 8.5%),
    linear-gradient(145deg, #fafafa, #e9ebee);
  box-shadow: 0 3px 10px rgba(30, 33, 36, 0.08);
  color: #8b8f94;
  font-size: 12px !important;
}

.node-widget-host-placeholder::after {
  content: "";
  position: absolute;
  right: 12%;
  bottom: 15%;
  left: 12%;
  height: 24%;
  border-radius: 9px;
  background:
    linear-gradient(90deg, rgba(92, 97, 103, 0.13) 0 36%, transparent 36% 42%, rgba(92, 97, 103, 0.09) 42%);
}

.node-widget-host-placeholder .node-label {
  position: relative;
  z-index: 1;
}

.node-progress {
  padding: 0 8px;
}

.node-bar {
  display: block;
  width: 100%;
  height: 4px;
  border-radius: 99px;
  background: #dfe1e4;
}

.node-check,
.node-switch {
  flex: 0 0 auto;
  box-sizing: border-box;
}

.node-check {
  width: 14px;
  height: 14px;
  border: 2px solid #79747e;
  border-radius: 2px;
  background: transparent;
}

.node-check.is-on {
  border-color: #3f444a;
  background: #3f444a;
  box-shadow: inset 0 0 0 2px #fff;
}

.node-radio {
  gap: 8px;
}

.node-radio .node-check {
  border-radius: 50%;
}

.node-widget.node-switch,
.node-widget.node-checkbox,
.node-widget.node-radio {
  justify-content: center;
  border: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.node-switch-ui {
  width: 36px;
  height: 22px;
  flex: 0 0 36px;
  border-radius: 99px;
  background: #e4e4e7;
  position: relative;
}

.node-switch-ui::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.28);
}

.node-switch-ui.is-on {
  background: #3f444a;
}

.node-switch-ui.is-on::after {
  left: 16px;
}

.node-has-icon {
  justify-content: center;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.node-semantic-icon {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  color: #303236;
}

.node-semantic-icon svg {
  width: 62%;
  height: 62%;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.node-icon-wifi .node-semantic-icon svg,
.node-icon-info .node-semantic-icon svg {
  width: 78%;
  height: 78%;
}

.node-icon-chevron .node-semantic-icon svg {
  width: 58%;
  height: 58%;
  color: #a8acb1;
}

.node-icon-back .node-semantic-icon svg,
.node-icon-scan .node-semantic-icon svg,
.node-icon-more .node-semantic-icon svg {
  width: 46%;
  height: 46%;
}

.node-icon-cellular .node-semantic-icon svg {
  fill: currentColor;
  stroke-width: 1.2;
}

.node-icon-airplane .node-semantic-icon svg,
.node-icon-data .node-semantic-icon svg {
  fill: currentColor;
  stroke-width: 1.1;
}

.node-icon-theme .node-semantic-icon svg {
  width: 66%;
  height: 66%;
}

.node-icon-edit .node-semantic-icon svg,
.node-icon-refresh .node-semantic-icon svg,
.node-icon-search .node-semantic-icon svg,
.node-icon-eye .node-semantic-icon svg,
.node-icon-close .node-semantic-icon svg,
.node-icon-add .node-semantic-icon svg {
  width: 55%;
  height: 55%;
}

.node-app-tile {
  flex-direction: column;
  justify-content: flex-end;
  gap: 5px;
  padding: 7px 6px 9px;
  color: #35383c;
  font-size: 12px !important;
  font-weight: 550;
  text-align: center;
}

.node-app-tile .node-app-icon {
  display: flex;
  width: 52%;
  max-width: 48px;
  aspect-ratio: 1;
  align-items: center;
  justify-content: center;
  border: 1px solid #bec2c7;
  border-radius: 28%;
  background: linear-gradient(145deg, #f8f9fa, #d7dade);
  box-shadow: 0 2px 6px rgba(32, 34, 37, 0.2);
}

.node-app-tile .node-semantic-icon svg {
  width: 70%;
  height: 70%;
}

.node-app-tile .node-label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.node-role-toolbar {
  align-items: center;
  color: #202124;
  font-weight: 650;
  letter-spacing: -0.35px;
}

.node-role-section {
  align-items: flex-end;
  color: #6f7378;
  font-size: 12px !important;
  font-weight: 500;
}

.node-role-secondary {
  color: #7a7e83;
  font-size: 12px !important;
}

.node-role-assignment {
  justify-content: flex-end;
  color: #777b80;
  font-size: 12px !important;
  text-align: right;
}

.node-role-dialog-title {
  color: #202124;
  font-size: 18px !important;
  font-weight: 650;
  white-space: normal;
}

.node-role-message {
  align-items: flex-start;
  color: #565a5f;
  line-height: 1.45;
  white-space: normal;
}

.node-role-dialog-action {
  justify-content: center;
  border: 0;
  background: transparent;
  color: #303439;
  font-size: 13px !important;
  font-weight: 650;
}

.node-widget.is-disabled {
  opacity: 0.42;
}

.node-widget.is-selected:not(.node-switch):not(.node-checkbox):not(.node-radio) {
  color: #111315;
}

.node-role-badge {
  justify-content: center;
  border-radius: 4px;
  background: #eceef0;
  color: #7a7e83;
  font-size: 10px !important;
  font-weight: 500;
  padding: 0 4px;
}

.node-role-action {
  justify-content: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #45494e;
  font-size: 12px !important;
  font-weight: 600;
}

.phone-placeholder strong {
  font-size: 50px;
  font-weight: 200;
  letter-spacing: 2px;
}

.phone-placeholder span {
  color: #a1a1aa;
  font-size: 11px;
}

.phone-nav {
  display: flex;
  height: 34px;
  flex: 0 0 34px;
  align-items: center;
  justify-content: space-around;
  background: #fff;
  color: #71717a;
}

.phone-nav button {
  width: 33%;
  height: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.phone-frame-secondary {
  width: 412px;
}

.phone-frame-secondary .phone-screen,
#adb-cast-screen,
#shizuku-screen {
  cursor: crosshair;
  touch-action: none;
}

.secondary-placeholder {
  background: #fff;
  color: #71717a;
}

.terminal-control-panel {
  gap: 8px;
  background: #fafafa;
}

.terminal-control-card {
  display: flex;
  flex-direction: column;
  gap: 9px;
  border: 1px solid #e4e4e7;
  border-radius: 9px;
  background: #fff;
  padding: 12px;
}

.terminal-control-card > strong {
  font-size: 13px;
}

.terminal-control-card > p {
  margin: 0;
  color: #71717a;
  font-size: 11px;
  line-height: 1.5;
}

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

.terminal-control-grid .btn {
  min-width: 0;
}

.terminal-detail-grid {
  display: grid;
  grid-template-columns: minmax(86px, auto) minmax(0, 1fr);
  gap: 0;
  margin: 0;
  font-size: 11px;
}

.terminal-detail-grid dt,
.terminal-detail-grid dd {
  min-height: 30px;
  margin: 0;
  border-bottom: 1px solid #f1f1f3;
  padding: 7px 5px;
}

.terminal-detail-grid dt {
  color: #71717a;
}

.terminal-detail-grid dd {
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
}

.terminal-list,
.terminal-permissions {
  gap: 6px;
}

.terminal-list-item {
  display: flex;
  min-height: 54px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid #f1f1f3;
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}

.terminal-list-item > div {
  min-width: 0;
}

.terminal-list-item strong {
  font-size: 11px;
}

.terminal-list-item p {
  display: -webkit-box;
  overflow: hidden;
  margin: 4px 0 0;
  color: #71717a;
  font-size: 10px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.terminal-list-item > small {
  flex: 0 0 auto;
  color: #a1a1aa;
  font-size: 9px;
}

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

.terminal-app {
  position: relative;
  display: flex;
  min-width: 0;
  align-items: center;
  flex-direction: column;
  gap: 4px;
  border: 1px solid #f1f1f3;
  border-radius: 9px;
  padding: 16px 8px 8px;
  text-align: center;
}

.terminal-app-pick {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 1;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  margin: 0;
  cursor: pointer;
}

.terminal-app-pick input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #2563eb;
  cursor: pointer;
}

.terminal-app img,
.terminal-app > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 9px;
  background: var(--primary-soft);
  object-fit: cover;
}

.terminal-app strong,
.terminal-app small {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terminal-app strong {
  font-size: 15px;
  font-weight: 650;
}

.terminal-app small {
  color: #a1a1aa;
  font-size: 8px;
}

.terminal-app-actions {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}

.terminal-app-actions .btn {
  flex: 1 1 0;
  min-width: 0;
  min-height: 28px;
  padding: 0 2px;
  font-size: 12px;
}

.terminal-app-hide,
.terminal-app-restore {
  border-color: #d4d4d8;
  background: #fff;
  color: #3f3f46;
}

.terminal-app.is-hidden {
  background: #c5ccd6;
  border-color: #9aa3b2;
  filter: grayscale(1);
  opacity: 0.82;
}

.terminal-app.is-hidden img,
.terminal-app.is-hidden > span {
  background: #b7c0cc;
  filter: grayscale(1);
}

.terminal-app.is-hidden strong,
.terminal-app.is-hidden small,
.terminal-app-hidden-mark {
  color: #4b5563;
}

.terminal-app-hidden-mark {
  font-size: 11px;
  font-style: normal;
  font-weight: 650;
  line-height: 1.2;
}

.terminal-app.is-picked {
  border-color: #93c5fd;
  box-shadow: inset 0 0 0 1px #93c5fd;
}

.terminal-app-board {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  gap: 12px;
}

.terminal-app-bulk {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 24px -18px rgba(15, 23, 42, 0.45), inset 0 0 0 1px rgba(15, 23, 42, 0.06);
}

.terminal-app-bulk .btn {
  min-height: 36px;
  padding: 0 14px;
  font-size: 14px;
}

.terminal-app-bulk b {
  margin-left: 6px;
}

.terminal-app-force {
  border-color: #64748b;
  background: #f1f5f9;
  color: #1e293b;
}

.terminal-app.is-force-hidden,
.terminal-modal .terminal-app.is-force-hidden {
  background: #a8b0bc;
  border-color: #7b8798;
}

.terminal-app-hidden-total {
  margin-left: auto;
  color: #4b5563;
  font-size: 14px;
  font-weight: 650;
}

.terminal-app-open {
  margin-top: 0;
  min-width: 0;
}

.terminal-empty {
  display: flex;
  min-height: 180px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 7px;
  color: #a1a1aa;
  text-align: center;
}

.terminal-empty strong {
  color: #52525b;
  font-size: 13px;
}

.terminal-empty span {
  max-width: 210px;
  font-size: 11px;
  line-height: 1.5;
}

.permission-mode {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.permission-mode-adb {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid #e7eaf0;
}

.permission-mode-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 0 2px;
}

.permission-mode-head strong {
  color: #0f172a;
  font-size: 13px;
  font-weight: 700;
}

.permission-mode-head span {
  color: #64748b;
  font-size: 12px;
}

.terminal-permission-row {
  display: flex;
  min-height: 40px;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid #e7eaf0;
  border-radius: 10px;
  background: #fff;
  padding: 6px 8px;
  text-align: left;
}

.terminal-permission-row.is-on {
  border-color: #e7eaf0;
  background: #fff;
}

.terminal-permission-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(206px, 1fr));
  gap: 8px;
}

.permission-pick {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 8px;
  min-width: 0;
  cursor: pointer;
}

.permission-pick input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: #16a34a;
  cursor: pointer;
}

.permission-icon {
  display: grid;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  place-items: center;
  border-radius: 7px;
}

.permission-icon svg {
  width: 15px;
  height: 15px;
}

.permission-icon-blue { background: #dbeafe; color: #1d4ed8; }
.permission-icon-green { background: #dcfce7; color: #15803d; }
.permission-icon-teal { background: #ccfbf1; color: #0f766e; }
.permission-icon-orange { background: #ffedd5; color: #c2410c; }
.permission-icon-pink { background: #fce7f3; color: #be185d; }
.permission-icon-indigo { background: #e0e7ff; color: #4338ca; }
.permission-icon-purple { background: #ede9fe; color: #6d28d9; }
.permission-icon-slate { background: #e2e8f0; color: #334155; }
.permission-icon-red { background: #fee2e2; color: #b91c1c; }
.permission-icon-cyan { background: #cffafe; color: #0e7490; }
.permission-icon-amber { background: #fef3c7; color: #b45309; }
.permission-icon-lime { background: #ecfccb; color: #4d7c0f; }
.permission-icon-navy { background: #dbe4ff; color: #1e3a8a; }
.permission-icon-sky { background: #e0f2fe; color: #0369a1; }

.terminal-permission-open {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  cursor: pointer;
}

.terminal-permission-open:hover {
  background: #dbeafe;
}

.terminal-permission-open:disabled {
  cursor: default;
  opacity: 0.55;
}

.terminal-permission-all,
.terminal-permission-adb-all {
  width: 100%;
  min-height: 36px;
  margin-top: 2px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
}

.terminal-permission-adb-all {
  border: 0;
  background: #0284c7;
  color: #fff;
  cursor: pointer;
}

.terminal-permission-adb-all:hover {
  background: #0369a1;
}

.terminal-permission-adb-all:disabled {
  cursor: default;
  opacity: 0.55;
}

.permission-check {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 6px;
  background: #eff6ff;
  color: var(--primary);
}

.permission-check.is-on {
  background: #d1fae5;
  color: #059669;
}

.terminal-notice {
  border: 1px solid #fde68a;
  border-radius: 8px;
  background: #fffbeb;
  color: #92400e;
  margin-bottom: 8px;
  padding: 9px;
  font-size: 10px;
  line-height: 1.5;
}

.terminal-consent {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.terminal-consent p {
  margin: 0;
  color: #71717a;
  font-size: 13px;
  line-height: 1.6;
}

@media (max-width: 960px) {
  :root {
    --sidebar: 190px;
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  :root {
    --sidebar: 0px;
  }

  .topbar {
    padding: 0 12px;
  }

  .sidebar {
    position: fixed;
    z-index: 40;
    top: 64px;
    width: min(280px, 82vw);
    transform: translateX(-102%);
    transition: transform 0.2s ease;
  }

  body.nav-open .sidebar {
    transform: translateX(0);
  }

  .main {
    margin-left: 0;
    padding: 72px 8px 8px;
  }

  .mobile-menu {
    display: inline-flex !important;
  }

  .username {
    display: none;
  }

  .brand-title {
    margin-left: 0;
    font-size: 18px;
  }

  .header-tools {
    display: none;
  }

  .page-header,
  .table-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .form-grid,
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .pack-brand-row {
    grid-template-columns: 1fr;
  }

  .pack-section {
    padding-inline: 16px;
  }

  .input-action {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-hero {
    padding: 24px 20px;
  }
}

.mobile-menu {
  display: none;
}

.terminal-page {
  --tone-glow: rgba(0, 111, 238, 0.08);
  --tone-page: #e8eef6;
  --tone-header: rgba(255, 255, 255, 0.92);
  --tone-track: rgba(255, 255, 255, 0.72);
  --tone-card: rgba(255, 255, 255, 0.94);
  --tone-stage-glow: rgba(255, 255, 255, 0.9);
  --tone-stage-top: #f8fafc;
  --tone-stage-bottom: #eef3f9;
  background:
    radial-gradient(1200px 480px at 50% -180px, var(--tone-glow), transparent 60%),
    var(--tone-page);
  color: #0f172a;
}

.terminal-page.tone-mist {
  --tone-glow: rgba(0, 111, 238, 0.08);
  --tone-page: #e8eef6;
  --tone-header: rgba(255, 255, 255, 0.92);
  --tone-track: rgba(255, 255, 255, 0.78);
  --tone-card: rgba(255, 255, 255, 0.94);
  --tone-stage-glow: rgba(255, 255, 255, 0.92);
  --tone-stage-top: #f7fafc;
  --tone-stage-bottom: #e4edf7;
}

.terminal-page.tone-cream {
  --tone-glow: rgba(214, 168, 108, 0.32);
  --tone-page: #f6efe4;
  --tone-header: rgba(255, 250, 243, 0.94);
  --tone-track: rgba(255, 248, 240, 0.88);
  --tone-card: rgba(255, 250, 244, 0.96);
  --tone-stage-glow: rgba(255, 246, 232, 0.95);
  --tone-stage-top: #fbf6ee;
  --tone-stage-bottom: #f0e2cc;
}

.terminal-page.tone-apricot {
  --tone-glow: rgba(232, 154, 78, 0.28);
  --tone-page: #f8ecdf;
  --tone-header: rgba(255, 248, 241, 0.94);
  --tone-track: rgba(255, 244, 232, 0.88);
  --tone-card: rgba(255, 247, 240, 0.96);
  --tone-stage-glow: rgba(255, 236, 214, 0.95);
  --tone-stage-top: #fff4e8;
  --tone-stage-bottom: #f6dcc0;
}

.terminal-page.tone-peach {
  --tone-glow: rgba(232, 132, 118, 0.26);
  --tone-page: #fbeeea;
  --tone-header: rgba(255, 247, 245, 0.94);
  --tone-track: rgba(255, 240, 236, 0.88);
  --tone-card: rgba(255, 247, 245, 0.96);
  --tone-stage-glow: rgba(255, 228, 222, 0.95);
  --tone-stage-top: #fff3ef;
  --tone-stage-bottom: #f8d9d2;
}

.terminal-page.tone-sand {
  --tone-glow: rgba(186, 150, 92, 0.26);
  --tone-page: #f3eee3;
  --tone-header: rgba(251, 248, 242, 0.94);
  --tone-track: rgba(247, 241, 228, 0.9);
  --tone-card: rgba(251, 248, 242, 0.96);
  --tone-stage-glow: rgba(244, 234, 214, 0.95);
  --tone-stage-top: #f7f2e6;
  --tone-stage-bottom: #eadec4;
}

.terminal-page.tone-rose {
  --tone-glow: rgba(196, 120, 148, 0.22);
  --tone-page: #f8eef2;
  --tone-header: rgba(255, 248, 250, 0.94);
  --tone-track: rgba(255, 240, 245, 0.88);
  --tone-card: rgba(255, 248, 250, 0.96);
  --tone-stage-glow: rgba(255, 228, 236, 0.95);
  --tone-stage-top: #fdf3f6;
  --tone-stage-bottom: #f3d5e0;
}

.terminal-page.tone-matcha {
  --tone-glow: rgba(122, 154, 92, 0.24);
  --tone-page: #eef3e6;
  --tone-header: rgba(248, 251, 244, 0.94);
  --tone-track: rgba(240, 246, 232, 0.9);
  --tone-card: rgba(248, 251, 244, 0.96);
  --tone-stage-glow: rgba(232, 242, 220, 0.95);
  --tone-stage-top: #f4f8ee;
  --tone-stage-bottom: #dce8cc;
}

.terminal-header {
  border-bottom: 0;
  background: var(--tone-header);
  box-shadow: 0 1px 0 #e6ebf2;
  backdrop-filter: blur(10px);
}

.terminal-tabs.terminal-tabs-top {
  min-height: 0;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  overflow: visible;
  border-bottom: 0;
  background: transparent;
  padding: 12px 16px 0;
  box-shadow: none;
}

.terminal-tab-track {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  border-radius: 14px;
  background: var(--tone-track);
  padding: 4px;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06), 0 10px 24px -18px rgba(15, 23, 42, 0.45);
}

.terminal-tabs-top .terminal-tab {
  display: inline-flex;
  height: 40px;
  min-width: 0;
  align-items: center;
  gap: 6px;
  border-radius: 11px;
  color: #334155;
  padding: 0 12px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.terminal-tab-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.terminal-tabs-top .terminal-tab:hover {
  background: rgba(15, 23, 42, 0.04);
  color: #0f172a;
}

.terminal-tabs-top .terminal-tab.is-active {
  background: #0f172a;
  color: #fff;
  font-weight: 600;
}

.terminal-tabs-top .terminal-tab.is-active::after {
  display: none;
}

.quality-switch {
  position: relative;
  display: inline-flex;
  height: 40px;
  flex: 0 0 auto;
  align-items: center;
  gap: 2px;
  margin-left: 8px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.78);
  padding: 3px;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.quality-toggle {
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.quality-toggle::after {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 6px;
  border-top: 4px solid currentColor;
  border-right: 3px solid transparent;
  border-left: 3px solid transparent;
  vertical-align: 2px;
}

.quality-switch.is-open .quality-toggle {
  background: rgba(15, 23, 42, 0.06);
  color: #0f172a;
}

.quality-menu {
  position: fixed;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 92px;
  border-radius: 12px;
  background: #fff;
  padding: 6px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16), inset 0 0 0 1px rgba(15, 23, 42, 0.06);
}

.quality-menu[hidden] {
  display: none;
}

.quality-switch button {
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.quality-switch button:hover {
  background: rgba(15, 23, 42, 0.05);
  color: #0f172a;
}

.quality-switch button.is-active {
  background: #fff;
  color: #0f172a;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.14);
}

.quality-switch small {
  min-width: 58px;
  border-radius: 7px;
  background: #eef2f7;
  color: #475569;
  padding: 4px 6px;
  font-size: 10px;
  font-weight: 650;
  text-align: center;
  white-space: nowrap;
}

.quality-switch small.is-smooth {
  background: #ecfdf5;
  color: #047857;
}

.quality-switch small.is-clear {
  background: #eff6ff;
  color: #1d4ed8;
}

.terminal-body {
  padding: 14px;
}

.screen-board {
  gap: 12px;
}

.terminal-phone-stage,
.terminal-secondary-stage,
.terminal-tree-panel,
.terminal-control-panel {
  border: 0;
  border-radius: 18px;
  background: var(--tone-card);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 16px 40px -28px rgba(15, 23, 42, 0.45);
}

.terminal-phone-stage,
.terminal-secondary-stage {
  align-items: stretch;
  justify-content: flex-start;
  height: 100%;
  gap: 10px;
  background:
    radial-gradient(circle at 50% 18%, var(--tone-stage-glow), transparent 46%),
    linear-gradient(180deg, var(--tone-stage-top) 0%, var(--tone-stage-bottom) 100%);
  padding: 10px 10px 14px;
}

.phone-stage-head {
  position: sticky;
  top: 0;
  z-index: 1;
  box-sizing: border-box;
  display: flex;
  flex: 0 0 52px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  height: 52px;
  margin: 0;
  padding: 0 8px 0 12px;
  overflow: hidden;
  border: 1px solid #e6edf5;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  color: #0f172a;
  font-size: 15px;
  font-weight: 750;
}

.phone-stage-head strong {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 15px;
  font-weight: 750;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.phone-stage-head small {
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 650;
  line-height: 18px;
  white-space: nowrap;
}

.stage-tools {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  overflow-x: auto;
  flex-wrap: nowrap;
  scrollbar-width: none;
}

.stage-tools::-webkit-scrollbar {
  display: none;
}

[data-screen="node"] .phone-stage-head {
  flex-wrap: nowrap;
  gap: 8px;
}

.node-channels {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 4px;
}

.node-channels button {
  border: 0;
  border-radius: 999px;
  padding: 4px 10px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
  white-space: nowrap;
  cursor: pointer;
}

.node-channels button.is-ready {
  background: #16a34a;
}

.node-channels button.is-down {
  background: #dc2626;
}

.node-channels button.is-selected {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #0f172a;
}

.stage-tools .shizuku-load {
  min-height: 28px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.stage-tools > em {
  min-width: 42px;
  color: #475569;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.stage-tools > em.is-slow {
  color: #c2410c;
}

.stage-refresh {
  border: 1px solid #d4d4d8;
  border-radius: 999px;
  background: #fff;
  color: #3f3f46;
  padding: 2px 10px;
  font-size: 12px;
  line-height: 18px;
  cursor: pointer;
}

.stage-switch {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 44px;
  height: 26px;
}

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

.stage-switch span {
  display: block;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: #cbd5e1;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
  transition: background 0.15s ease;
}

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

.stage-switch input:checked + span {
  background: #2563eb;
}

.stage-switch input:checked + span::after {
  transform: translateX(18px);
}

.stage-switch input:focus-visible + span {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.screen-debug {
  width: min(920px, calc(100vw - 48px));
  max-height: min(70vh, 640px);
  display: flex;
  flex-direction: column;
}

.screen-debug-log {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 240px;
  overflow: auto;
}

.terminal-debug-sliders {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  margin-left: 6px;
}

.terminal-debug-sliders label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  border: 1px solid #e6edf5;
  border-radius: 12px;
  background: #fff;
  padding: 0 10px;
  color: #334155;
  font-size: 13px;
  font-weight: 650;
}

.terminal-debug-sliders input[type='range'] {
  width: 92px;
  accent-color: #2563eb;
}

.screen-debug-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  border-bottom: 1px solid #eef2f7;
  background: #f8fafc;
  padding: 12px 18px;
}

.screen-debug-summary span {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
  border: 1px solid #e5eaf0;
  border-radius: 10px;
  background: #fff;
  padding: 8px 10px;
}

.screen-debug-summary em {
  color: #94a3b8;
  font-size: 10px;
  font-style: normal;
}

.screen-debug-summary b {
  overflow: hidden;
  color: #0f172a;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.factory-open {
  margin-left: 8px;
  border: 1px solid #fecaca;
  border-radius: 999px;
  background: #fff7f7;
  color: #b91c1c;
  padding: 4px 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.debug-open {
  margin-left: 8px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 999px;
  background: #fff;
  padding: 4px 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.control-route {
  display: inline-flex;
  margin-left: 8px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.control-route button {
  border: 0;
  background: transparent;
  padding: 4px 10px;
  color: #0f172a;
  font-size: 12px;
  line-height: 18px;
  white-space: nowrap;
  cursor: pointer;
}

.control-route button.is-selected {
  background: #0f172a;
  color: #fff;
}

.control-route button.is-live:not(.is-selected) {
  box-shadow: inset 0 -2px 0 #16a34a;
}

.a11y-power {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 999px;
  background: #fff;
  padding: 4px 10px;
  color: #0f172a;
  font-size: 12px;
  line-height: 18px;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.a11y-power input {
  margin: 0;
}

.a11y-power.is-on {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
}

[data-a11y-only].is-ineffective {
  opacity: 0.45;
}

.screen-debug li {
  display: grid;
  grid-template-columns: 78px 92px 88px 72px 1fr;
  gap: 8px;
  align-items: center;
  padding: 6px 12px;
  border-bottom: 1px solid #fafafa;
  font-size: 12px;
  color: #3f3f46;
}

.screen-debug li.is-slow {
  background: #fff7ed;
  color: #9a3412;
}

.screen-debug li.is-empty {
  display: block;
  color: #a1a1aa;
}

.screen-debug time,
.screen-debug em {
  font-style: normal;
  font-variant-numeric: tabular-nums;
}

.unlock-pin-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 420px;
  padding: 8px 4px 16px;
}

.unlock-pin-form p {
  margin: 0;
  color: #52525b;
  font-size: 13px;
  line-height: 1.5;
}

.unlock-pin-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}

.unlock-pin-form input,
.unlock-pin-form .unlock-pin-input {
  border: 1px solid #d4d4d8;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.02em;
}

.unlock-pin-lead {
  margin: 0;
  color: #52525b;
  font-size: 13px;
  line-height: 1.55;
}

.unlock-pin-log-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: linear-gradient(180deg, #fafafa 0%, #f4f4f5 100%);
  border: 1px solid #e4e4e7;
}

.unlock-pin-log-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.unlock-pin-log-label {
  font-size: 12px;
  color: #71717a;
}

.unlock-pin-log-time {
  font-size: 11px;
  color: #a1a1aa;
}

.unlock-pin-log-value {
  font-size: 15px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  word-break: break-all;
  color: #18181b;
}

.unlock-pin-log-empty {
  margin: 0;
  font-size: 12px;
  color: #71717a;
  line-height: 1.5;
}

.unlock-pin-form .row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.phone-frame {
  border: 9px solid #12141a;
  border-radius: 38px;
  background: #0c0e13;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.16),
    0 22px 40px -24px rgba(15, 23, 42, 0.55);
}

.phone-screen {
  background: #f8fafc;
}

.phone-nav {
  background: #f8fafc;
  color: #94a3b8;
}

.phone-placeholder strong {
  color: #334155;
  font-size: 42px;
  font-weight: 300;
}

.terminal-center {
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.terminal-tree-panel,
.terminal-control-panel {
  padding: 14px;
}

.terminal-control-panel {
  gap: 10px;
  background: var(--tone-card);
}

.terminal-panel-title {
  margin: 0 0 10px;
  border-bottom: 0;
  padding: 0;
  color: #0f172a;
  font-size: 14px;
}

.terminal-tree-panel .terminal-panel-title.is-centered {
  margin-bottom: 12px;
}

.terminal-tree span {
  border-radius: 10px;
}

.terminal-tree span:nth-child(n + 2) {
  margin-left: 0;
}

.terminal-tree span.is-active {
  background: #ecfdf5;
  font-weight: 600;
}

.unlock-btn {
  box-shadow: inset 0 0 0 1px rgba(4, 120, 87, 0.08);
}

.adb-pair-box {
  border: 0;
  border-radius: 14px;
  background: #f4f7fb;
  padding: 12px;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.05);
}

.adb-hint {
  color: #94a3b8;
  line-height: 1.5;
}

.control-line .btn,
.cast-row .btn,
.adb-connect .btn {
  border-radius: 10px;
}

.tab-track-split {
  width: 1px;
  height: 22px;
  flex: 0 0 1px;
  margin: 0 6px 0 8px;
  background: rgba(15, 23, 42, 0.12);
}

.terminal-tab-track .layout-switch {
  border: 0;
  background: transparent;
  padding: 0;
}

.terminal-tab-track .layout-switch-btn {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  color: #334155;
  font-size: 15px;
  font-weight: 600;
}

.terminal-tab-track .layout-switch-btn.is-active {
  background: #0f172a;
  color: #fff;
  box-shadow: none;
}

.terminal-fish-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.terminal-fish-toolbar .terminal-fish-close {
  min-height: 42px;
  padding: 0 18px;
  border-color: #b91c1c;
  background: #dc2626;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 8px 16px -10px rgba(220, 38, 38, 0.95);
}

.terminal-fish-toolbar .terminal-fish-close:hover,
.terminal-fish-toolbar .terminal-fish-close:focus-visible {
  border-color: #991b1b;
  background: #b91c1c;
  color: #fff;
}

.terminal-fish-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.terminal-fish-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 10px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.terminal-fish-tile:hover {
  border-color: #006fee;
  box-shadow: 0 4px 14px rgba(0, 111, 238, 0.12);
}

.terminal-fish-tile strong {
  font-size: 15px;
  color: #0f172a;
}

.terminal-fish-url {
  font-size: 12px;
  color: #64748b;
  word-break: break-all;
  line-height: 1.35;
}

.keyboard-slot {
  position: relative;
}

.keyboard-popover {
  position: fixed;
  z-index: 80;
  display: flex;
  width: 460px;
  max-width: calc(100vw - 24px);
  flex-direction: column;
  gap: 6px;
  border-radius: 16px;
  background: #f4f7fb;
  padding: 12px;
  box-shadow: 0 18px 40px -24px rgba(15, 23, 42, 0.55), inset 0 0 0 1px rgba(15, 23, 42, 0.06);
}

.keyboard-popover[hidden] {
  display: none;
}

.keyboard-drag {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  margin: -4px 0 2px;
  border-radius: 8px;
  background: #e7eef6;
  color: #64748b;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.04em;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.keyboard-drag:active {
  cursor: grabbing;
}

.keyboard-compose {
  display: flex;
  gap: 6px;
}

.keyboard-compose .input {
  min-width: 0;
  flex: 1;
  min-height: 36px;
}

.key-row {
  display: grid;
  gap: 4px;
}

.key-row.cols-10 { grid-template-columns: repeat(10, minmax(0, 1fr)); }
.key-row.cols-9 { grid-template-columns: repeat(9, minmax(0, 1fr)); }
.key-row-bottom { grid-template-columns: 52px repeat(7, minmax(0, 1fr)) 52px; }
.key-row-actions { grid-template-columns: 44px 44px minmax(0, 1fr) 64px; }

.key-btn {
  min-width: 0;
  min-height: 36px;
  border: 0;
  border-radius: 10px;
  background: #fff;
  color: #1e293b;
  padding: 0 4px;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.08);
}

.key-btn:hover {
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.key-fn,
.key-send {
  background: #d9e4f2;
  font-size: 13px;
}

.keyboard-popover.is-shift [data-letter] {
  text-transform: uppercase;
}

.key-send {
  min-width: 64px;
  background: #3d4d63;
  color: #fff;
}

.terminal-control-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  overflow: hidden;
  background: color-mix(in srgb, var(--tone-card) 62%, #e7edf4);
}

.terminal-center .terminal-control-panel {
  overflow: hidden;
}

.ops-scroll {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
}

.ops-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-radius: 18px;
  background: #fff;
  padding: 14px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 14px 28px -22px rgba(15, 23, 42, 0.55);
}

.ops-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #0f172a;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.ops-label::before {
  width: 3px;
  height: 12px;
  border-radius: 99px;
  background: #0f172a;
  content: "";
}

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

.fn-tile {
  display: flex;
  min-height: 52px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, #f8fbff 0%, #d9e4f2 100%);
  color: #1e293b;
  padding: 6px 2px;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 #fff,
    0 1px 2px rgba(30, 58, 95, 0.08),
    inset 0 0 0 1px rgba(51, 78, 120, 0.1);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.fn-tile:hover {
  background: #fff;
  box-shadow:
    inset 0 1px 0 #fff,
    0 8px 16px -12px rgba(15, 23, 42, 0.45),
    inset 0 0 0 1px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.fn-tile.is-sent {
  background: #dbeafe;
  color: #1d4ed8;
  box-shadow: inset 0 0 0 1.5px #93c5fd;
}

.fn-tile.is-sent .fn-ico {
  color: #1d4ed8;
}

.fn-tile.is-soft.is-sent {
  background: #ffe4e6;
  color: #be123c;
  box-shadow: inset 0 0 0 1.5px #fda4af;
}

.fn-tile.is-soft.is-sent .fn-ico {
  color: #e11d48;
}

.fn-ico {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  color: #3d5270;
}

.fn-tile.is-soft {
  background: linear-gradient(180deg, #fff5f6 0%, #ffc9d2 100%);
  color: #be123c;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 1px 2px rgba(190, 18, 60, 0.08),
    inset 0 0 0 1px rgba(225, 29, 72, 0.16);
}

.fn-tile.is-soft .fn-ico {
  color: #e11d48;
}

.vol-slot {
  position: relative;
  min-width: 0;
}

.vol-slot > .fn-tile {
  width: 100%;
  height: 100%;
}

.vol-slot.is-open > .fn-tile {
  background: #dbeafe;
  color: #1d4ed8;
  box-shadow: inset 0 0 0 1.5px #93c5fd;
}

.vol-slot.is-open > .fn-tile .fn-ico {
  color: #1d4ed8;
}

.vol-popover {
  position: absolute;
  z-index: 20;
  bottom: calc(100% + 8px);
  left: 50%;
  display: flex;
  width: 64px;
  transform: translateX(-50%);
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border-radius: 16px;
  background: #fff;
  padding: 10px 8px 12px;
  box-shadow: 0 16px 36px -18px rgba(15, 23, 42, 0.5), inset 0 0 0 1px rgba(15, 23, 42, 0.06);
}

.vol-popover[hidden] {
  display: none;
}

.vol-cap {
  color: #94a3b8;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

.vol-track {
  position: relative;
  width: 36px;
  height: 148px;
  border-radius: 999px;
  background: #e8eef5;
  cursor: grab;
  touch-action: none;
}

.vol-track:active {
  cursor: grabbing;
}

.vol-fill {
  position: absolute;
  right: 12px;
  bottom: 0;
  left: 12px;
  height: 50%;
  border-radius: 999px;
  background: #006fee;
  pointer-events: none;
}

.vol-thumb {
  position: absolute;
  bottom: calc(0.5 * (100% - 22px));
  left: 50%;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.28), inset 0 0 0 2px #006fee;
  pointer-events: none;
  transform: translateX(-50%);
}

.vol-track.is-min .vol-fill {
  height: 0;
}

.vol-track.is-min .vol-thumb {
  bottom: 0;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.28), inset 0 0 0 2px #94a3b8;
}

#terminal-volume-min,
#terminal-volume-max {
  min-height: 16px;
}

.move-well {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-radius: 16px;
  background: #f4f7fb;
  padding: 8px;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.04);
}

.dir-pad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 0;
}

.dir-key {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #f8fbff 0%, #d9e4f2 100%);
  color: #1e293b;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 #fff,
    0 1px 2px rgba(30, 58, 95, 0.08),
    inset 0 0 0 1px rgba(51, 78, 120, 0.1);
}

.dir-key svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dir-up { grid-column: 2; grid-row: 1; }
.dir-left { grid-column: 1; grid-row: 2; }
.dir-down { grid-column: 2; grid-row: 2; }
.dir-right { grid-column: 3; grid-row: 2; }

.dir-key:hover {
  background: #f1f5f9;
}

.dir-key.is-sent {
  background: #dbeafe;
  color: #1d4ed8;
  box-shadow: inset 0 0 0 1.5px #93c5fd;
}

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

.nav-row .fn-tile {
  min-height: 52px;
}

.lock-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.lock-row:has(> :nth-child(3)) {
  grid-template-columns: 1.15fr 1fr 1fr;
}

.lock-row:has(> :nth-child(4)) {
  grid-template-columns: 1fr 1fr;
}

.ops-block .lock-row + .lock-row {
  margin-top: 8px;
}

.lock-row .fn-open {
  min-height: 52px;
  width: 100%;
  margin: 0;
  font-size: 13px;
}

.lock-record {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff5f6 0%, #ffc9d2 100%);
  color: #e11d48;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 1px 2px rgba(190, 18, 60, 0.06),
    inset 0 0 0 1px rgba(244, 63, 94, 0.14);
}

.lock-row .lock-chip {
  min-width: 0;
  min-height: 52px;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  border-radius: 14px;
  padding: 6px;
}

.lock-row .terminal-overlay-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
}

.lock-row .terminal-overlay-switch-label {
  min-width: 0;
  flex: 1 1 auto;
  overflow: visible;
  font-size: 12px;
  line-height: 1.15;
  color: #1e293b;
  white-space: normal;
  word-break: break-all;
}

.lock-row .terminal-overlay-switch input {
  width: 36px;
  height: 20px;
  flex: 0 0 36px;
  margin-left: auto;
}

.lock-row .terminal-overlay-switch input::after {
  width: 16px;
  height: 16px;
}

.lock-row .terminal-overlay-switch input:checked::after {
  transform: translateX(16px);
}

.lock-record .fn-ico {
  color: #e11d48;
}

.fn-open {
  background: linear-gradient(180deg, #f8fbff 0%, #dbeafe 100%);
  color: #1d4ed8;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 1px 2px rgba(29, 78, 216, 0.06),
    inset 0 0 0 1px rgba(37, 99, 235, 0.16);
}

.fn-open .fn-ico {
  color: #1d4ed8;
}

.fn-sheet {
  width: min(420px, calc(100vw - 32px));
}

.fn-menu {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
}

.fn-menu-item {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  background: #fff;
  padding: 12px 14px;
  color: #0f172a;
  text-align: left;
  cursor: pointer;
}

.fn-menu-item strong {
  font-size: 15px;
}

.fn-menu-item span {
  color: #64748b;
  font-size: 12px;
}

.fn-menu .lock-record {
  justify-content: flex-start;
}

.perm-sheet {
  width: min(680px, calc(100vw - 32px));
}

.perm-menu {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.perm-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  color: inherit;
  font-size: inherit;
}

.perm-copy strong {
  color: #0f172a;
}

.perm-state {
  flex: none;
  border-radius: 999px;
  padding: 2px 8px;
  background: #f1f5f9;
  color: #64748b;
  font-style: normal;
  font-size: 12px;
  font-weight: 650;
}

.perm-state.is-on {
  background: #dcfce7;
  color: #166534;
}

.perm-state.is-off {
  background: #fee2e2;
  color: #b91c1c;
}

.perm-actions {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.perm-note {
  min-height: 20px;
  margin: 0 16px 14px;
  color: #64748b;
  font-size: 12px;
}

@media (max-width: 720px) {
  .perm-menu {
    grid-template-columns: 1fr;
  }
}

.terminal-overlay-switch.is-mode-black:has(input:checked) .terminal-overlay-icon,
.terminal-overlay-switch.is-mode-black-block:has(input:checked) .terminal-overlay-icon {
  background: #0f172a;
  color: #fff;
}

.terminal-overlay-switch.is-mode-touch:has(input:checked) .terminal-overlay-icon {
  background: #ccfbf1;
  color: #0f766e;
}

.terminal-overlay-switch.is-mode-off:has(input:checked) .terminal-overlay-icon {
  background: #d1fae5;
  color: #047857;
}

.control-subtabs {
  align-self: flex-start;
  gap: 2px;
  border-radius: 10px;
  background: #f1f5f9;
  padding: 3px;
}

.control-subtabs button {
  height: 28px;
  border-radius: 8px;
  padding: 0 12px;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
}

.control-subtabs button.is-active {
  background: #fff;
  color: #0f172a;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.unlock-btn {
  min-height: 40px;
  font-size: 14px;
}

.control-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.control-grid .btn {
  min-width: 0;
  width: 100%;
  min-height: 36px;
  padding: 0 8px;
  font-size: 13px;
}

.control-link {
  min-height: 28px;
  border: 0;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  font-size: 12px;
}

.control-link:hover {
  color: #0f172a;
}

.control-toggles {
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  background: #f8fafc;
  padding: 0 10px;
}

.control-toggles .control-toggle {
  min-height: 44px;
  border-bottom: 1px solid #e8eef5;
}

.control-toggles .control-toggle:last-child {
  border-bottom: 0;
}

.control-toggles .control-toggle > span {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 1px;
}

.control-toggle input {
  position: relative;
  width: 36px;
  height: 20px;
  flex: 0 0 36px;
  appearance: none;
  border-radius: 999px;
  background: #cbd5e1;
  cursor: pointer;
}

.control-toggle input::after {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  content: "";
  transition: transform 0.15s ease;
}

.control-toggle input:checked {
  background: #0f172a;
}

.control-toggle input:checked::after {
  transform: translateX(16px);
}

.control-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.control-foot .btn {
  min-width: 0;
  flex: 1;
}

.terminal-control-panel .btn:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #0f172a;
}

.terminal-control-panel .btn-primary,
.terminal-control-panel .btn-primary:hover {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.terminal-control-panel .btn-danger-soft,
.terminal-control-panel .btn-danger-soft:hover {
  border-color: #fecdd3;
  background: #fff1f2;
  color: #e11d48;
}

.adb-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 0;
}

.adb-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
}

.adb-step-head {
  padding-bottom: 8px;
  border-bottom: 1px solid #e6edf5;
}

.adb-dev-btn {
  flex: 0 0 auto;
  min-height: 32px;
  border-radius: 999px;
  padding: 4px 14px;
}

.shizuku-screen {
  background: #050505;
}

.shizuku-screen.has-screen .shizuku-body {
  display: none;
}

.shizuku-body {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 28px 22px;
  text-align: center;
  color: #f4f4f5;
}

.shizuku-body strong {
  font-size: 28px;
  font-weight: 700;
}

.shizuku-body span {
  max-width: 250px;
  color: #a1a1aa;
  font-size: 15px;
  line-height: 1.5;
}

.shizuku-body .adb-dev-btn {
  margin-top: 6px;
  background: #fff;
  color: #111;
}

#shizuku-link.is-on {
  color: #16a34a;
}

#shizuku-link.is-busy {
  color: #d97706;
}

.adb-head .ops-label {
  margin: 0;
  flex: 1;
  color: #0f172a;
  font-size: 16px;
  letter-spacing: 0.04em;
}

.adb-link {
  border-radius: 999px;
  background: #f1f5f9;
  padding: 6px 12px;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}

.adb-link.is-on {
  background: #dcfce7;
  color: #166534;
}

.adb-link.is-busy {
  background: #fef3c7;
  color: #92400e;
}

.adb-head.has-panel-fold {
  gap: 6px;
}

.adb-head.has-panel-fold .ops-label {
  min-width: 0;
  gap: 6px;
  font-size: 14px;
  letter-spacing: 0;
  white-space: nowrap;
}

.adb-head.has-panel-fold .adb-link {
  flex: 0 0 auto;
  padding: 5px 8px;
  font-size: 12px;
  white-space: nowrap;
}

.adb-head.has-panel-fold .adb-switch {
  display: inline-flex;
  flex: 0 0 auto;
}

.adb-panels-toggle {
  display: inline-flex;
  min-height: 28px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 1px solid #d9e2ef;
  border-radius: 9px;
  background: #f3f7fd;
  color: #475569;
  padding: 3px 6px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
  white-space: nowrap;
  cursor: pointer;
}

.adb-panels-toggle:hover {
  border-color: #a9c0e3;
  background: #eaf2ff;
  color: #1d4ed8;
}

.adb-panels-toggle:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.adb-panels-toggle svg {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
}

.adb-panels-toggle[aria-expanded="false"] svg {
  transform: rotate(180deg);
}

.adb-switch input {
  position: relative;
  width: 48px;
  height: 28px;
  appearance: none;
  border-radius: 999px;
  background: #cbd5e1;
  cursor: pointer;
}

.adb-switch input::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  content: "";
  transition: transform 0.15s ease;
}

.adb-switch input:checked {
  background: #0f172a;
}

.adb-switch input:checked::after {
  transform: translateX(20px);
}

.adb-log {
  max-height: 84px;
  min-height: 48px;
  overflow: auto;
  margin: 0;
  border-radius: 12px;
  background: #f4f7fb;
  padding: 8px 10px;
  color: #334155;
  list-style: none;
  font-size: 11px;
  line-height: 1.5;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
}

.adb-log li {
  display: flex;
  gap: 6px;
}

.adb-log time {
  flex: 0 0 auto;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}

.adb-log .is-empty {
  color: #64748b;
}

.adb-enable-btn {
  display: none;
}

.adb-connect {
  gap: 6px;
  margin-top: 0;
  border-top: 0;
  padding-top: 0;
}

.adb-connect > strong {
  font-size: 13px;
}

.adb-pair-box {
  gap: 6px;
  padding: 10px;
}

.phone-screen.has-tree {
  background: #f2f3f5;
}

.phone-screen.has-tree .phone-node-tree {
  z-index: 2;
  background: #f2f3f5;
}

.phone-screen > canvas.node-image-fallback {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  background: #111;
  pointer-events: none;
}

.phone-screen > canvas.node-detail-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
  width: 100%;
  height: 100%;
  pointer-events: none;
  filter: grayscale(1);
}

.phone-screen.has-node-image {
  background: #111;
}

/* Node reconstruction stays monochrome; filtering is entirely browser-side. */
#terminal-phone-screen.has-tree,
#adb-node-screen.has-tree {
  filter: grayscale(1);
}

.phone-screen.has-node-image .phone-node-tree {
  background: transparent;
}

.phone-screen.has-node-image .node-status-bar {
  display: none;
}

.phone-screen.has-node-backdrop .phone-node-tree {
  background: transparent;
}

.phone-screen.has-node-backdrop .node-status-bar,
.phone-screen.has-node-backdrop .node-label,
.phone-screen.has-node-backdrop .node-widget {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9), 0 0 8px rgba(0, 0, 0, 0.65);
}

.phone-screen.has-node-backdrop .node-status-bar {
  background: rgba(0, 0, 0, 0.28);
}

.phone-screen.has-node-backdrop .node-semantic-icon {
  color: inherit;
}

.phone-screen.has-node-backdrop .node-frame {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.phone-screen.has-node-backdrop .node-button {
  background: rgba(23, 25, 27, 0.88);
  border-color: rgba(255, 255, 255, 0.28);
}

.node-text {
  overflow: hidden;
  background: transparent;
  color: #202124;
}

.node-label {
  color: inherit;
}

/* —— Terminal sheet content (弹窗内列表 / 权限 / 空状态) —— */
.terminal-modal .log-filters {
  gap: 8px;
  margin-bottom: 14px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.04);
}

.terminal-modal .log-filters .btn.tab {
  min-height: 34px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
}

.terminal-modal .log-filters .btn.tab.is-active {
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  color: #0f172a;
}

.terminal-modal .log-filters .search-input {
  min-height: 34px;
  border-radius: 10px;
  font-size: 13px;
}

.terminal-modal .terminal-list {
  gap: 10px;
}

.terminal-modal .terminal-list-item {
  min-height: 0;
  align-items: center;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  padding: 12px 14px;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.terminal-modal .terminal-list-item:hover {
  border-color: rgba(0, 111, 238, 0.18);
  box-shadow: 0 4px 14px -8px rgba(0, 111, 238, 0.35);
}

.terminal-modal .terminal-list-item strong {
  color: #0f172a;
  font-size: 14px;
  font-weight: 600;
}

.terminal-modal .terminal-list-item p {
  color: #64748b;
  font-size: 12px;
  -webkit-line-clamp: 2;
}

.terminal-modal .terminal-list-item > small {
  font-size: 11px;
}

.terminal-modal .terminal-app-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.terminal-modal .terminal-app {
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  padding: 18px 8px 12px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.terminal-modal .terminal-app.is-hidden {
  background: #c5ccd6;
  border-color: #9aa3b2;
  box-shadow: none;
  filter: grayscale(1);
  opacity: 0.82;
}

.terminal-modal .terminal-app.is-hidden:hover {
  transform: none;
  background: #d5dbe3;
  filter: grayscale(1);
  box-shadow: none;
}

.terminal-modal .terminal-app.is-hidden.is-picked {
  border-color: #93c5fd;
  box-shadow: inset 0 0 0 1px #93c5fd;
}

.terminal-modal .terminal-app:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -12px rgba(15, 23, 42, 0.25);
}

.terminal-modal .terminal-app img,
.terminal-modal .terminal-app > span {
  width: 44px;
  height: 44px;
  border-radius: 12px;
}

.terminal-modal .terminal-app strong {
  font-size: 16px;
}

.terminal-modal .terminal-app small {
  font-size: 12px;
}

.terminal-modal .terminal-empty {
  min-height: 240px;
  border: 1px dashed rgba(15, 23, 42, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  gap: 10px;
}

.terminal-modal .terminal-empty::before {
  display: block;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, #e2e8f0, #f8fafc);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
  content: '';
}

.terminal-modal .terminal-empty strong {
  color: #334155;
  font-size: 15px;
}

.terminal-modal .terminal-empty span {
  max-width: 280px;
  color: #64748b;
  font-size: 13px;
}

.terminal-modal .terminal-permissions {
  gap: 8px;
}

.terminal-modal .terminal-permission-row {
  min-height: 40px;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  border-radius: 10px;
  padding: 6px 8px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.terminal-modal .permission-icon {
  width: 26px;
  height: 26px;
  border-radius: 7px;
}

.terminal-modal .terminal-permission-row.is-off:hover {
  border-color: rgba(0, 111, 238, 0.28);
  box-shadow: 0 6px 16px -12px rgba(0, 111, 238, 0.4);
}

.terminal-modal .terminal-permission-row strong {
  color: #0f172a;
  font-size: 13px;
  line-height: 1.3;
}

.terminal-modal .permission-check {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 700;
}

.terminal-modal .terminal-detail-grid {
  gap: 0;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}

.terminal-modal .terminal-detail-grid dt,
.terminal-modal .terminal-detail-grid dd {
  margin: 0;
  padding: 11px 14px;
  font-size: 13px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.05);
}

.terminal-modal .terminal-detail-grid dt {
  background: #f8fafc;
  color: #64748b;
  font-weight: 500;
}

.terminal-modal .terminal-detail-grid dd {
  color: #0f172a;
  font-weight: 500;
}

.terminal-modal .terminal-notice {
  border-radius: 12px;
  margin-bottom: 12px;
  padding: 12px 14px;
  font-size: 12px;
}

.terminal-modal .unlock-pin-form {
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 14px;
  background: #fff;
  padding: 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.terminal-modal .terminal-camera-bar {
  margin-top: 16px;
  padding-top: 16px;
}

.terminal-modal-card.screen-debug {
  width: min(920px, calc(100vw - 32px));
  max-height: min(78vh, 720px);
}

.terminal-modal .screen-debug-log {
  list-style: none;
  max-height: none;
  flex: 1;
  overflow: auto;
  margin: 0;
  padding: 0;
}

.terminal-modal .screen-debug li {
  grid-template-columns: 72px 88px 80px 64px 1fr;
  padding: 10px 18px;
  font-size: 12px;
}

.terminal-modal .screen-debug li.is-slow {
  background: #fff7ed;
}

.modal.terminal-dialog-modal {
  width: min(480px, 100%);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 20px;
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.06),
    0 28px 80px -24px rgba(15, 23, 42, 0.45);
}

.modal.terminal-dialog-modal .modal-header {
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  background: rgba(255, 255, 255, 0.95);
  padding: 16px 20px;
}

.modal.terminal-dialog-modal .modal-header h3 {
  color: #0f172a;
  font-size: 17px;
  font-weight: 700;
}

.modal.terminal-dialog-modal .modal-body {
  padding: 20px;
  background: #f8fafc;
}

.modal.terminal-dialog-modal .modal-footer {
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  background: #fff;
  padding: 14px 20px;
}

.modal.terminal-dialog-modal .terminal-consent strong {
  display: block;
  margin-bottom: 8px;
  color: #0f172a;
  font-size: 15px;
}

.modal-backdrop:has(.terminal-dialog-modal) {
  backdrop-filter: blur(8px);
  background: rgba(15, 23, 42, 0.48);
}

/* Premium sheet v2 — toolbar, lists, permissions, system */
.terminal-log-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.terminal-segment {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.05);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.04);
}

.terminal-segment-btn {
  min-height: 34px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  padding: 0 14px;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.terminal-segment-btn:hover {
  color: #0f172a;
}

.terminal-segment-btn.is-active {
  background: #fff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
  color: #0f172a;
}

.terminal-log-search {
  display: flex;
  flex: 1 1 220px;
  align-items: center;
  gap: 8px;
  min-width: min(100%, 280px);
}

.terminal-log-search .search-input {
  flex: 1;
  min-height: 38px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 11px;
  background: #fff;
  font-size: 13px;
}

.terminal-log-search .btn-primary {
  min-height: 38px;
  border-radius: 11px;
  padding: 0 16px;
  font-weight: 600;
}

.terminal-list-main {
  min-width: 0;
  flex: 1;
}

.terminal-list-meta {
  margin-bottom: 4px;
}

.terminal-log-kind {
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  background: rgba(0, 111, 238, 0.1);
  color: #005bc4;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
}

.keylogger-shell {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 320px;
}

.keylogger-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.keylogger-date-select {
  min-width: 140px;
  min-height: 36px;
}

.keylogger-search {
  display: flex;
  flex: 1 1 220px;
  align-items: center;
  gap: 6px;
  min-width: min(100%, 280px);
}

.keylogger-search .search-input {
  flex: 1;
  min-height: 36px;
}

.keylogger-error {
  margin: 0;
  color: #dc2626;
  font-size: 13px;
}

.keylogger-mode {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.keylogger-mode-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
}

.keylogger-mode-chip.is-all {
  background: rgba(245, 158, 11, 0.15);
  color: #b45309;
}

.keylogger-mode-chip.is-input {
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
}

.keylogger-body {
  display: flex;
  gap: 12px;
  min-height: 280px;
}

.keylogger-apps {
  flex: 0 0 168px;
  max-height: 420px;
  overflow-y: auto;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 10px;
  background: #fff;
}

.keylogger-app-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  background: transparent;
  cursor: pointer;
  padding: 10px 12px;
  text-align: left;
}

.keylogger-app-row:hover {
  background: rgba(15, 23, 42, 0.04);
}

.keylogger-app-row.is-active {
  background: rgba(0, 111, 238, 0.12);
  color: #005bc4;
  font-weight: 600;
}

.keylogger-app-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.keylogger-app-count {
  flex-shrink: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
}

.keylogger-detail {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 10px;
  background: rgba(248, 250, 252, 0.6);
  overflow: hidden;
}

.keylogger-detail-head {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  font-size: 13px;
}

.keylogger-table-wrap {
  max-height: 400px;
  overflow: auto;
}

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

.keylogger-table th,
.keylogger-table td {
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.keylogger-table th {
  position: sticky;
  top: 0;
  background: #f1f5f9;
  font-weight: 600;
  z-index: 1;
}

.keylogger-col-time {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.keylogger-col-app {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.keylogger-col-content {
  word-break: break-all;
}

.keylogger-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  font-size: 12px;
  color: #64748b;
}

.keylogger-empty {
  margin: auto;
  padding: 24px;
}

.terminal-list-time {
  flex-shrink: 0;
  color: #94a3b8;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.terminal-empty-state {
  gap: 12px;
}

.terminal-empty-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(0, 111, 238, 0.12), rgba(15, 23, 42, 0.04)),
    #fff;
  box-shadow:
    inset 0 0 0 1px rgba(15, 23, 42, 0.06),
    0 8px 24px -16px rgba(15, 23, 42, 0.35);
}

.terminal-modal .terminal-empty::before {
  display: none;
}

.terminal-permission-label {
  min-width: 0;
  flex: 1;
  text-align: left;
}

.terminal-permission-label strong {
  display: block;
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terminal-permission-badge {
  align-self: center;
  flex-shrink: 0;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  min-width: 58px;
  padding: 6px 8px;
  text-align: center;
}

.terminal-permission-badge.is-on {
  background: #dcfce7;
  color: #15803d;
}

.terminal-permission-badge.terminal-permission-open {
  border: 0;
  background: #006fee;
  color: #fff;
  cursor: pointer;
}

.terminal-permission-badge.terminal-permission-open:hover {
  background: #005bc4;
}

.terminal-permission-badge.is-on::before {
  content: "✓ ";
}

.terminal-modal .terminal-permission-row {
  display: flex;
  flex-direction: row;
  align-items: center;
}

.terminal-system-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.terminal-system-section {
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.terminal-section-title {
  margin: 0;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.05);
  background: linear-gradient(180deg, #f8fafc, #fff);
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.terminal-system-section .terminal-detail-grid {
  border: 0;
  border-radius: 0;
}

.terminal-camera-panel {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.terminal-camera-modal-shell .terminal-camera-panel {
  margin-top: 0;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.terminal-camera-modal-shell .terminal-camera-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}

.terminal-camera-modal-shell .terminal-camera-actions {
  flex: 0 0 auto;
  justify-content: flex-end;
  margin-top: 0;
}

.terminal-camera-modal-shell .terminal-camera-preview:not(.has-frame) {
  min-height: 240px;
}

.terminal-modal .terminal-camera-modal-shell:not([hidden]) ~ #terminal-tab-content {
  display: none;
}

.terminal-camera-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.terminal-camera-actions .btn.is-on {
  border-color: #0f172a;
  background: #0f172a;
  color: #fff;
}

.terminal-camera-actions .btn {
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
}

.terminal-modal .terminal-data-panel.terminal-sheet-body,
.terminal-modal .terminal-sheet-body {
  background: linear-gradient(180deg, #f1f5f9 0%, #f8fafc 48%, #fff 100%);
}

.terminal-path-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
  font-size: 13px;
}

.terminal-path-crumb {
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #475569;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 8px;
}

.terminal-path-crumb:hover {
  background: rgba(15, 23, 42, 0.05);
  color: #0f172a;
}

.terminal-path-crumb.is-current {
  background: #0f172a;
  color: #fff;
}

.terminal-path-sep {
  color: #cbd5e1;
}

.terminal-folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.terminal-folder-grid-compact {
  margin-bottom: 12px;
}

.terminal-folder-card {
  display: flex;
  min-height: 108px;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 16px;
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  box-shadow: 0 2px 10px -6px rgba(15, 23, 42, 0.25);
  cursor: pointer;
  padding: 14px 10px;
  text-align: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.terminal-folder-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -12px rgba(0, 111, 238, 0.35);
}

.terminal-folder-icon {
  width: 42px;
  height: 34px;
  border-radius: 10px 10px 6px 6px;
  background: linear-gradient(180deg, #fde68a 0%, #f59e0b 100%);
  box-shadow: inset 0 -4px 0 rgba(180, 83, 9, 0.25);
  position: relative;
}

.terminal-folder-icon::before {
  position: absolute;
  top: -6px;
  left: 0;
  width: 18px;
  height: 8px;
  border-radius: 6px 6px 0 0;
  background: #fcd34d;
  content: '';
}

.terminal-folder-card strong {
  font-size: 13px;
  line-height: 1.3;
}

.terminal-folder-card small {
  color: #94a3b8;
  font-size: 11px;
}

.terminal-file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 14px;
  background: #fff;
  padding: 12px 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.terminal-file-row-icon {
  width: 36px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 8px;
  background: linear-gradient(180deg, #e2e8f0, #cbd5e1);
  position: relative;
}

.terminal-file-row-icon::after {
  position: absolute;
  top: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border-radius: 0 8px 0 8px;
  background: #f8fafc;
  content: '';
}

.terminal-file-row > div {
  min-width: 0;
  flex: 1;
}

.terminal-file-row strong {
  display: block;
  font-size: 14px;
}

.terminal-file-row small {
  color: #64748b;
  font-size: 12px;
}

.terminal-file-row time {
  flex-shrink: 0;
  color: #94a3b8;
  font-size: 12px;
}

.terminal-album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 10px;
}

.terminal-album-tile {
  display: flex;
  overflow: hidden;
  flex-direction: column;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 2px 10px -8px rgba(15, 23, 42, 0.35);
  cursor: pointer;
  padding: 0;
  text-align: left;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.terminal-album-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -14px rgba(0, 111, 238, 0.45);
}

.terminal-album-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  background:
    linear-gradient(135deg, rgba(0, 111, 238, 0.15), rgba(14, 165, 233, 0.08)),
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.9), transparent 55%),
    #e2e8f0;
}

.terminal-album-name {
  display: block;
  overflow: hidden;
  padding: 8px 10px;
  color: #334155;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terminal-empty-icon-folder {
  background:
    linear-gradient(145deg, rgba(245, 158, 11, 0.2), rgba(15, 23, 42, 0.04)),
    #fff;
}

.terminal-empty-icon-photo {
  background:
    linear-gradient(145deg, rgba(0, 111, 238, 0.15), rgba(15, 23, 42, 0.04)),
    #fff;
}

.terminal-lightbox {
  position: fixed;
  z-index: 140;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
}

.terminal-lightbox[hidden] {
  display: none;
}

.terminal-lightbox-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(8px);
  cursor: pointer;
}

.terminal-lightbox-card {
  position: relative;
  display: flex;
  width: min(920px, 100%);
  max-height: min(86vh, 900px);
  flex-direction: column;
  overflow: hidden;
  border-radius: 20px;
  background: #0f172a;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.55);
  margin: 0;
}

.terminal-lightbox-card .terminal-modal-close {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.terminal-lightbox-card img {
  display: block;
  width: 100%;
  max-height: calc(86vh - 56px);
  object-fit: contain;
  background: #020617;
}

.terminal-lightbox-card img:not([src]) {
  display: none;
}

.terminal-lightbox-card figcaption {
  padding: 12px 16px;
  color: #e2e8f0;
  font-size: 13px;
  text-align: center;
}

.terminal-lightbox.is-loading .terminal-lightbox-card img {
  display: none;
}

.terminal-lightbox.is-loading .terminal-lightbox-card figcaption::after {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  margin-left: 8px;
  vertical-align: middle;
  animation: terminal-spin 0.7s linear infinite;
  content: '';
}

.terminal-camera-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.terminal-file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

/* SystemUI quick settings retain the reported tile and slider bounds. */
.node-widget.node-quicktile {
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: #eceeef;
  box-shadow: none;
}

.node-widget.node-quicktile.is-on {
  background: #cbd0d5;
}

.node-widget.node-progress-vertical {
  justify-content: center;
  padding: 0;
}

.node-progress-vertical .node-bar {
  width: 100%;
  height: 100%;
  border-radius: 18px;
  background: #dfe1e4;
}

/* Compact device identity, local address details and editable metadata. */
#user-results table { min-width: 1980px; width: 100%; }
#user-results th[data-col="online"], #user-results td[data-col="online"] { width: 120px; min-width: 120px; }
#user-results th[data-col="ip"], #user-results td[data-col="ip"] { width: 220px; min-width: 220px; }
#user-results th[data-col="remark"], #user-results td[data-col="remark"] { width: 200px; min-width: 200px; }
#user-results th[data-col="tags"], #user-results td[data-col="tags"] { width: 180px; min-width: 180px; }
#user-results td[data-col="ip"] .cell-wrap,
#user-results td[data-col="remark"] .cell-wrap,
#user-results td[data-col="tags"] .cell-wrap { overflow: visible; white-space: normal; max-width: 240px; }
.device-country { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; color: #46546a; font-size: 12px; }
.device-country-flag { display: inline-flex; width: 24px; height: 18px; flex: 0 0 24px; align-items: center; justify-content: center; border: 1px solid #e2e7ee; border-radius: 3px; overflow: hidden; background: #f5f7fa; }
.device-country-flag img { display: block; width: 100%; height: 100%; object-fit: cover; }
.device-country.is-unknown { color: #8791a1; }
.device-country-flag svg { width: 15px; height: 15px; }
.device-ip { max-width: 220px; }
.device-ip-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.device-ip-address { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; color: #243047; font-size: 12px; overflow-wrap: anywhere; word-break: break-word; }
.device-ip-kind { display: inline-flex; padding: 1px 5px; border-radius: 4px; background: #edf1f6; color: #6b778c; font-size: 10px; white-space: nowrap; }
.device-ip-more { color: #526dd5; font-size: 11px; white-space: nowrap; }
.device-ip-details summary { cursor: pointer; border-radius: 4px; }
.device-ip-details summary:focus-visible { outline: 2px solid #6982e8; }
.device-ip-details[open] summary { margin-bottom: 8px; }
.device-ip-list { display: grid; gap: 6px; margin: 0; padding: 8px; background: #f6f8fc; border: 1px solid #e5eaf2; border-radius: 8px; list-style: none; }
.device-ip-item { display: flex; flex-wrap: wrap; gap: 3px 6px; min-width: 0; }
.device-remark-cell { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 36px; border: 1px solid transparent; border-radius: 7px; padding: 6px 8px; cursor: text; }
.device-remark-cell:hover { background: #f1f5ff; border-color: #dbe4fb; }
.device-remark-cell:focus-visible { outline: 2px solid #6982e8; }
.device-remark-cell.is-editing { padding: 0; border: 0; }
.device-remark-text { overflow-wrap: anywhere; line-height: 1.6; color: #334155; white-space: pre-wrap; }
.device-remark-text.is-empty, .metadata-tag-empty { color: #8b95a5; font-size: 12px; }
.metadata-edit-hint { color: #a7b0bf; font-size: 14px; flex-shrink: 0; }
.remark-inline-editor { display: grid; width: 100%; gap: 5px; }
.remark-inline-editor .input { min-width: 0; width: 100%; }
.remark-inline-actions { display: flex; justify-content: flex-end; gap: 5px; }
.device-tags-edit { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; min-height: 36px; width: 100%; padding: 5px; border: 1px dashed transparent; border-radius: 7px; background: transparent; text-align: left; cursor: pointer; }
.device-tags-edit:hover, .device-tags-edit:focus-visible { border-color: #b5c4ed; background: #f7f9ff; }
.metadata-tag-chip { display: inline-block; max-width: 170px; overflow: hidden; padding: 3px 8px; border-radius: 6px; font-size: 12px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; background: #eaf0ff; color: #3e5ca5; }
.metadata-tag-chip.is-tone-1 { background: #e9f5ef; color: #317155; }
.metadata-tag-chip.is-tone-2 { background: #fff1dd; color: #996725; }
.metadata-tag-chip.is-tone-3 { background: #f0eafd; color: #7853a2; }
.metadata-tag-chip.is-tone-4 { background: #fbeaf0; color: #a15570; }
.device-metadata-modal { width: min(580px, calc(100vw - 32px)); }
.metadata-editor { display: grid; gap: 14px; }
.metadata-editor [hidden] { display: none !important; }
.metadata-help { margin: 0; color: #7b8798; line-height: 1.6; font-size: 12px; }
.metadata-error { margin: 0; color: #b42335; white-space: normal; font-size: 12px; line-height: 1.6; }
.metadata-tag-list { display: grid; gap: 8px; max-height: 360px; overflow: auto; padding: 2px; }
.metadata-tag-option { display: flex; align-items: center; gap: 9px; padding: 9px 11px; border: 1px solid #e1e7ef; border-radius: 8px; cursor: pointer; overflow-wrap: anywhere; }
.metadata-tag-option:has(input:checked) { border-color: #9fb3f3; background: #f3f6ff; }
.metadata-tag-option input { accent-color: #4468dc; }
.metadata-tag-create { display: flex; gap: 8px; align-items: center; }
.metadata-tag-create .input { flex: 1; min-width: 0; }
.metadata-tag-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; border-bottom: 1px solid #edf0f5; padding: 8px 0; }
.metadata-tag-row .input { flex: 1; min-width: 120px; }
.metadata-tag-count { color: #8390a0; font-size: 11px; }
.metadata-tag-actions { display: flex; align-items: center; gap: 6px; }
.metadata-delete-confirm { flex-basis: 100%; padding: 10px; border: 1px solid #f1cece; border-radius: 8px; background: #fff8f7; color: #8e4141; line-height: 1.6; font-size: 12px; }
.metadata-delete-confirm .btn { margin: 6px 6px 0 0; }
.metadata-empty { padding: 22px 12px; text-align: center; color: #8b95a5; background: #f8fafc; border-radius: 8px; }
@media (max-width: 760px) {
  .terminal-note { flex-wrap: wrap; }
  .terminal-metadata-item { min-width: 120px; max-width: 220px; }
  .metadata-tag-create { flex-wrap: wrap; }
}
