* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%;
  font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", Roboto, sans-serif;
  background: #0b0e13; color: #e7eaf0;
  -webkit-font-smoothing: antialiased;
}

button { cursor: pointer; border: 0; padding: 10px 16px; border-radius: 8px; font-size: 14px; font-family: inherit; transition: background .15s, transform .05s, opacity .15s; }
button:active { transform: translateY(1px); }
button:disabled { opacity: .35; cursor: not-allowed; transform: none; }
button.primary { background: #4f8cff; color: #fff; }
button.primary:hover:not(:disabled) { background: #3f7df0; }
button.danger { background: #e5484d; color: #fff; }
button.danger:hover:not(:disabled) { background: #d33d42; }
button.ghost { background: transparent; color: #9aa4b2; border: 1px solid #2a3140; }
button.ghost:hover:not(:disabled) { background: #1a1f29; color: #cfd6e1; }
button.mini { padding: 4px 8px; font-size: 12px; background: #2a3140; color: #e6e6e6; }

/* ===== 顶栏(仅首页显示) ===== */
.topbar { display: flex; align-items: center; padding: 10px 16px; background: #14181f; border-bottom: 1px solid #1f242d; }
.brand { font-weight: 600; }
.status { margin-left: auto; font-size: 12px; color: #9aa4b2; }
.topbar-logout {
  margin-left: 10px;
  padding: 5px 10px;
  background: transparent;
  color: #9aa4b2;
  border: 1px solid #2a3140;
  border-radius: 8px;
  font-size: 12px;
}
.topbar-logout:hover { color: #fff; background: #1a1f29; }
.topbar-logout.hidden { display: none; }
body.in-room .topbar { display: none; }

/* ===== 通用页 / 卡片 ===== */
.page { padding: 16px; max-width: 1200px; margin: 0 auto; }
.page.hidden { display: none; }
#room.page.hidden { display: none; }
.card { background: #14181f; border: 1px solid #1f242d; border-radius: 12px; padding: 16px; margin-bottom: 12px; }
.card h2 { margin: 0 0 12px; font-size: 16px; }
.card input { display: block; width: 100%; padding: 10px 12px; background: #0e1116; border: 1px solid #2a3140; color: #e6e6e6; border-radius: 8px; margin-bottom: 8px; font-size: 14px; }
.card input:focus { outline: none; border-color: #4f8cff; box-shadow: 0 0 0 3px rgba(79,140,255,.18); }

/* ===== 首页 ===== */
.home-page {
  min-height: calc(100vh - 44px);
  max-width: 860px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-top: clamp(28px, 7vh, 72px);
}
.connect-card {
  width: min(100%, 620px);
  margin-left: auto;
  margin-right: auto;
}
.connect-card h1 {
  margin: 0 0 16px;
  font-size: 24px;
  font-weight: 650;
  text-align: center;
}
.connect-card .room-input {
  height: 58px;
  text-align: center;
  font-size: 28px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: 4px;
}
.connect-button {
  width: 100%;
  height: 48px;
  font-size: 16px;
  font-weight: 600;
}
.recent-card {
  background: transparent;
  border: 0;
  padding: 0;
  margin-top: 10px;
}
.recent-card h2 {
  margin: 0 0 10px;
  font-size: 15px;
  color: #cfd6e1;
}
.history {
  list-style: none;
  padding: 0;
  margin: 0 0 10px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}
.history-card {
  min-height: 148px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 12px;
  background: #14181f;
  border: 1px solid #242b38;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.16);
}
.history-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.history-room {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: .5px;
  color: #e7eaf0;
}
.history-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #8e99aa;
  font-size: 11px;
  white-space: nowrap;
}
.history-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8e99aa;
  box-shadow: 0 0 0 3px rgba(142,153,170,.14);
}
.history-status[data-state="checking"] .history-status-dot {
  background: #f5a623;
  box-shadow: 0 0 0 3px rgba(245,166,35,.16);
}
.history-status[data-state="online"] {
  color: #8ff0bd;
}
.history-status[data-state="online"] .history-status-dot {
  background: #2bd17e;
  box-shadow: 0 0 0 3px rgba(43,209,126,.18), 0 0 10px rgba(43,209,126,.45);
}
.history-status[data-state="offline"] {
  color: #ff9fa3;
}
.history-status[data-state="offline"] .history-status-dot {
  background: #e5484d;
  box-shadow: 0 0 0 3px rgba(229,72,77,.16);
}
.history-status[data-state="unknown"] .history-status-dot {
  background: #6b7280;
}
.history-meta {
  color: #8e99aa;
  font-size: 12px;
  line-height: 1.3;
}
.history-note {
  width: 100%;
  min-height: 34px;
  margin: 0;
  padding: 7px 9px;
  background: #0e1116;
  border: 1px solid #2a3140;
  color: #e7eaf0;
  border-radius: 8px;
  font-size: 13px;
}
.history-note:focus {
  outline: none;
  border-color: #4f8cff;
  box-shadow: 0 0 0 3px rgba(79,140,255,.16);
}
.history-actions {
  margin-top: auto;
  display: flex;
  justify-content: flex-end;
}
.history-actions button {
  padding: 6px 12px;
  font-size: 12px;
  background: #4f8cff;
  color: #fff;
  border-radius: 8px;
}
.history-actions button:hover {
  background: #3f7df0;
}
.meta { font-size: 12px; color: #9aa4b2; }
.meta div { margin-bottom: 4px; }
.meta summary { cursor: pointer; margin-bottom: 8px; color: #cfd6e1; }

/* ===== 控制端登录 ===== */
.login-page {
  min-height: calc(100vh - 44px);
  max-width: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  width: min(100%, 420px);
  margin: 0 auto;
}
.login-card h1 {
  margin: 0 0 16px;
  text-align: center;
  font-size: 24px;
  font-weight: 650;
}
.login-card input {
  height: 48px;
  font-size: 16px;
}
.login-error {
  margin-top: 10px;
  color: #ff9fa3;
  font-size: 13px;
  text-align: center;
}

/* ===== 房间页:沉浸式布局 ===== */
#room.page {
  padding: 0;
  max-width: none;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: #0b0e13;
}

/* —— 顶部紧凑工具条 —— */
.room-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  gap: 12px;
  background: linear-gradient(to bottom, rgba(20,24,31,.95), rgba(20,24,31,.7));
  border-bottom: 1px solid #1f242d;
  flex-shrink: 0;
  z-index: 4;
}
.room-bar-group { display: flex; align-items: center; gap: 8px; }

.leave-btn {
  background: transparent;
  color: #e5484d;
  border: 1px solid #3a2026;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
}
.leave-btn:hover { background: rgba(229,72,77,.12); border-color: #e5484d; }

.room-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #0e1116;
  border: 1px solid #2a3140;
  border-radius: 999px;
  padding: 4px 4px 4px 12px;
  font-size: 13px;
}
.conn-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #6b7280; flex-shrink: 0;
  box-shadow: 0 0 0 3px transparent;
  transition: background .2s, box-shadow .2s;
}
.conn-dot[data-state="connecting"] { background: #f5a623; box-shadow: 0 0 0 3px rgba(245,166,35,.18); animation: pulse 1.4s ease-in-out infinite; }
.conn-dot[data-state="connected"]  { background: #2bd17e; box-shadow: 0 0 0 3px rgba(43,209,126,.18); }
.conn-dot[data-state="error"]      { background: #e5484d; box-shadow: 0 0 0 3px rgba(229,72,77,.18); }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .45 } }

.room-id {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-weight: 600;
  letter-spacing: 1px;
  color: #e7eaf0;
}
.copy-btn {
  background: #2a3140;
  color: #cfd6e1;
  padding: 3px 9px;
  font-size: 11px;
  border-radius: 999px;
}
.copy-btn:hover { background: #3a4254; color: #fff; }

.conn-text {
  font-size: 12px;
  color: #9aa4b2;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* —— chip(控制开关) —— */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #1a1f29;
  color: #9aa4b2;
  border: 1px solid #2a3140;
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 999px;
}
.chip:hover:not(:disabled) { background: #232936; color: #cfd6e1; }
.chip .chip-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #6b7280;
}
.chip.on {
  background: rgba(43,209,126,.12);
  color: #2bd17e;
  border-color: rgba(43,209,126,.4);
}
.chip.on .chip-dot { background: #2bd17e; box-shadow: 0 0 6px rgba(43,209,126,.7); }

.icon-btn {
  background: transparent;
  color: #9aa4b2;
  border: 1px solid #2a3140;
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 8px;
}
.icon-btn:hover { background: #1a1f29; color: #cfd6e1; }
.icon-btn.active { background: #4f8cff; color: #fff; border-color: #4f8cff; }

/* —— 主舞台 —— */
.room-body {
  flex: 1;
  min-height: 0;
  position: relative;
  background: #05070a;
  overflow: hidden;
}
.workbench {
  position: absolute;
  inset: 0;
}
.stage {
  position: absolute;
  inset: 0;
  background: #05070a;
  overflow: hidden;
}
.skeleton-panel {
  position: absolute;
  left: 12px;
  top: 14px;
  width: 280px;
  min-width: 210px;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #080b10;
  border: 1px solid #242b38;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,.38);
  z-index: 6;
}
.skeleton-panel.hidden {
  display: none;
}
.skeleton-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 40px;
  padding: 0 12px;
  background: #111722;
  border-bottom: 1px solid #242b38;
  color: #e7eaf0;
  font-size: 13px;
  font-weight: 650;
}
#skeletonMeta {
  color: #8e99aa;
  font-size: 11px;
  font-weight: 500;
}
#skeletonCanvas {
  flex: 1;
  width: 100%;
  height: 100%;
  display: block;
  background: #05070a;
}
.skeleton-ctrl-overlay {
  position: absolute;
  left: 0;
  right: 0;
  top: 40px;
  bottom: 0;
  cursor: crosshair;
  touch-action: none;
  background: transparent;
  pointer-events: auto;
  z-index: 3;
}
.skeleton-ctrl-overlay[hidden] {
  display: none;
}
.skeleton-tooltip {
  position: absolute;
  max-width: min(320px, calc(100% - 16px));
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(7,10,16,.94);
  border: 1px solid rgba(119,183,255,.45);
  color: #f5f7fb;
  font-size: 12px;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
  pointer-events: none;
  z-index: 4;
  box-shadow: 0 8px 18px rgba(0,0,0,.38);
}
.skeleton-tooltip[hidden] {
  display: none;
}
.side-tools {
  position: absolute;
  left: auto;
  right: 12px;
  top: 14px;
  width: 184px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0;
  background: transparent;
  border-left: 0;
  z-index: 7;
  max-height: calc(100% - 28px);
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.side-tools::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}
.quality-control {
  width: 100%;
  min-height: 46px;
  padding: 6px 7px;
  border-radius: 8px;
  background: #151a24;
  color: #e7eaf0;
  border: 1px solid #2a3140;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}
.quality-control span {
  color: #9aa4b2;
  font-size: 11px;
  line-height: 1;
  text-align: center;
}
.quality-control select {
  width: 100%;
  min-width: 0;
  border-radius: 6px;
  border: 1px solid #30384a;
  background: #0f1420;
  color: #f3f6fb;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  padding: 3px 5px;
  outline: none;
}
.quality-control select:focus {
  border-color: #4f8cff;
  box-shadow: 0 0 0 2px rgba(79,140,255,.22);
}
.quality-control select:disabled {
  opacity: .55;
}
.source-control {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  background: #101722;
  color: #e7eaf0;
  border: 1px solid #293244;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.source-title {
  color: #9aa4b2;
  font-size: 12px;
  font-weight: 650;
  line-height: 1;
}
.source-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.source-option,
.source-exit,
.source-settings {
  width: 100%;
  min-width: 0;
  border-radius: 7px;
  border: 1px solid #30384a;
  background: #151a24;
  color: #e7eaf0;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.15;
  padding: 8px 7px;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .12s ease;
}
.source-option:hover:not(:disabled),
.source-exit:hover:not(:disabled),
.source-settings:hover:not(:disabled) {
  background: #202636;
}
.source-option.active {
  background: #1f6feb;
  color: #ffffff;
  border-color: #5a9bff;
  box-shadow: 0 0 0 2px rgba(79,140,255,.20);
}
.source-option#btnIgnoreMode.active {
  background: linear-gradient(180deg, #20bd76 0%, #0a774e 100%);
  border-color: #7df0b3;
  box-shadow:
    inset 0 3px 8px rgba(0,0,0,.24),
    0 0 0 2px rgba(43,209,126,.22);
}
.source-status {
  min-height: 16px;
  color: #a8b2c1;
  font-size: 12px;
  line-height: 1.3;
}
.source-exit {
  background: #182131;
  border-color: #3a465b;
}
.source-exit:not(:disabled) {
  color: #fff2f2;
  border-color: #8b3b45;
  background: #3a1820;
}
.source-exit:hover:not(:disabled) {
  background: #55212c;
}
.source-settings {
  padding: 6px 7px;
  color: #9fc1ff;
  background: transparent;
  border-color: transparent;
  font-size: 12px;
  font-weight: 650;
}
.source-settings:hover:not(:disabled) {
  background: rgba(79,140,255,.12);
  border-color: rgba(79,140,255,.26);
}
.source-option:disabled,
.source-exit:disabled,
.source-settings:disabled {
  opacity: .55;
  cursor: not-allowed;
}
.side-tool {
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #6b3ff1;
  color: #fff;
  font-size: 14px;
  font-weight: 650;
  box-shadow: 0 8px 18px rgba(107,63,241,.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  line-height: 1.05;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .12s ease;
}
.side-tool:hover:not(:disabled) { background: #7a50ff; }
.side-tool.active {
  background: #22a06b;
  box-shadow: 0 8px 18px rgba(34,160,107,.24);
}
.side-tool::after {
  content: "未开启";
  font-size: 10px;
  font-weight: 500;
  color: #8e99aa;
}
.side-tool.instant::after {
  content: "";
  display: none;
}
.side-tool.active::after {
  content: "已开启";
  color: #d9ffeb;
}
.side-tool.secondary {
  background: #151a24;
  color: #e7eaf0;
  border: 1px solid #2a3140;
  box-shadow: none;
}
.side-tool.secondary:hover:not(:disabled) {
  background: #202636;
}
.side-tool.secondary.active {
  background: linear-gradient(180deg, #20bd76 0%, #0a774e 100%);
  color: #ffffff;
  border-color: #7df0b3;
  box-shadow:
    inset 0 3px 8px rgba(0,0,0,.26),
    0 0 0 2px rgba(43,209,126,.24),
    0 10px 24px rgba(31,191,117,.20);
  transform: translateY(1px);
}
.side-tool.secondary.confirming {
  background: #7c4d12;
  color: #fff4df;
  border-color: #e0a642;
}
.side-tool:active:not(:disabled) {
  transform: translateY(2px) scale(.98);
}
.side-tool:disabled {
  opacity: .55;
  box-shadow: none;
}
.stage-inner {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  background: #000;
  border-radius: 6px;
  overflow: hidden;
  width: 100%;
  height: 100%;
  box-shadow: 0 6px 30px rgba(0,0,0,.5);
}
.stage-inner #remoteScreen { position: absolute; inset: 0; }
.stage-inner #remoteScreen video,
.stage-inner #remoteScreen img,
.stage-inner #remoteScreen canvas {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  display: block; background: #000;
  object-fit: contain;
}
.stage-inner #remoteScreen .adb-video-canvas {
  z-index: 2;
}
.stage-inner #remoteScreen .screen-parked {
  opacity: 0;
  pointer-events: none;
}
.adb-video-status {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  max-width: min(320px, calc(100% - 28px));
  padding: 7px 10px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 8px;
  background: rgba(8,12,18,.76);
  color: #f2f5f8;
  font-size: 12px;
  line-height: 1.3;
  text-align: center;
  pointer-events: none;
  backdrop-filter: blur(8px);
  box-shadow: 0 6px 20px rgba(0,0,0,.24);
}
.adb-video-status[hidden] { display: none; }
.stage-empty {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  color: #6b7686;
  font-size: 14px;
  pointer-events: none;
  text-align: center;
}

/* ===== 远程控制覆盖层 ===== */
.ctrl-overlay {
  position: absolute; inset: 0;
  cursor: crosshair;
  touch-action: none;
  background: transparent;
  pointer-events: auto;
  z-index: 5;
}
.ctrl-overlay[hidden] { display: none; }
.ctrl-hint {
  position: absolute; left: 12px; top: 12px;
  background: rgba(229,72,77,.92);
  color: #fff;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 6px;
  pointer-events: none;
  max-width: 70%;
  box-shadow: 0 2px 12px rgba(0,0,0,.4);
}
.ctrl-hint[hidden] { display: none; }

/* ===== 浮动 Android 导航键 dock ===== */
.nav-dock {
  position: absolute;
  left: 50%;
  bottom: 14px;
  width: min(560px, calc(100vw - 24px));
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 6px;
  margin: 0;
  background: rgba(18,22,30,.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  box-shadow: 0 6px 24px rgba(0,0,0,.45);
  z-index: 8;
  opacity: 1;
  pointer-events: auto;
  transition: opacity .25s ease, transform .25s ease;
  transform: translateX(-50%);
}
.nav-key {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 56px;
  padding: 8px 10px;
  background: transparent;
  color: #e7eaf0;
  border-radius: 10px;
  font-size: 11px;
  line-height: 1;
}
.nav-key:hover:not(:disabled) { background: rgba(255,255,255,.08); }
.nav-key:disabled { color: #5a6473; }
.nav-glyph { font-size: 18px; line-height: 1; font-weight: 500; }
.nav-text { font-size: 10px; color: #9aa4b2; }
.nav-key:disabled .nav-text { color: #4a5363; }

/* ===== 浮动日志面板 ===== */
.log {
  position: fixed;
  right: 16px; bottom: 16px;
  width: 420px;
  max-width: calc(100vw - 32px);
  max-height: 240px;
  background: rgba(10,12,16,.94);
  backdrop-filter: blur(8px);
  border: 1px solid #1f242d;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 11px;
  font-family: ui-monospace, Consolas, monospace;
  overflow: auto;
  color: #9aa4b2;
  z-index: 20;
  box-shadow: 0 8px 28px rgba(0,0,0,.5);
  margin: 0;
  white-space: pre-wrap;
}
.log.hidden { display: none; }

.adb-setup {
  position: fixed;
  inset: 0;
  display: block;
  z-index: 30;
  pointer-events: none;
}
.adb-setup.hidden { display: none; }
.adb-setup-panel {
  position: fixed;
  top: 18px;
  right: 18px;
  width: min(430px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow: auto;
  background: #111722;
  border: 1px solid #2a3140;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,.48);
  padding: 18px;
  pointer-events: auto;
}
.adb-setup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  cursor: move;
  user-select: none;
  touch-action: none;
}
.adb-setup-head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 650;
}
.adb-setup-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: #0b111b;
  border: 1px solid #283142;
  border-radius: 8px;
  margin-bottom: 12px;
}
.adb-setup-state {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.adb-setup-state strong {
  display: block;
  margin-bottom: 4px;
  color: #e7eaf0;
  font-size: 15px;
}
.adb-setup-state span:last-child {
  display: block;
  color: #aab4c2;
  font-size: 13px;
  line-height: 1.45;
}
.adb-setup-dot {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 999px;
  background: #8792a2;
  box-shadow: 0 0 0 4px rgba(135,146,162,.12);
}
.adb-setup-dot.busy {
  background: #4f8cff;
  box-shadow: 0 0 0 4px rgba(79,140,255,.16);
}
.adb-setup-dot.ok {
  background: #2bd17e;
  box-shadow: 0 0 0 4px rgba(43,209,126,.16);
}
.adb-setup-dot.error {
  background: #ff686f;
  box-shadow: 0 0 0 4px rgba(255,104,111,.16);
}
.adb-setup-dot.warn {
  background: #f2b84b;
  box-shadow: 0 0 0 4px rgba(242,184,75,.16);
}
.adb-detected {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(43,209,126,.08);
  border: 1px solid rgba(43,209,126,.26);
  border-radius: 8px;
  color: #9ee8bf;
  font-size: 12px;
}
.adb-detected.hidden { display: none; }
.adb-detected strong {
  color: #e7eaf0;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 13px;
}
.adb-setup-steps {
  display: grid;
  gap: 5px;
  margin-bottom: 12px;
  color: #aab4c2;
  font-size: 12px;
}
.adb-setup-note {
  margin: 0 0 12px;
  color: #aab4c2;
  font-size: 12px;
  line-height: 1.5;
}
.adb-setup-guide {
  margin: 0 0 12px 18px;
  padding: 0;
  color: #cfd6e1;
  font-size: 13px;
  line-height: 1.65;
}
.adb-route-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 0 12px;
}
.adb-route-card {
  padding: 12px;
  border: 1px solid #283142;
  border-radius: 8px;
  background: #0b111b;
}
.adb-route-card.recommended {
  border-color: rgba(79,140,255,.38);
  background: rgba(79,140,255,.08);
}
.adb-route-title {
  display: grid;
  gap: 4px;
  margin-bottom: 8px;
}
.adb-route-title span {
  color: #e7eaf0;
  font-size: 14px;
  font-weight: 800;
}
.adb-route-title strong {
  color: #9fc1ff;
  font-size: 12px;
  font-weight: 750;
}
.adb-route-card:not(.recommended) .adb-route-title strong {
  color: #9ee8bf;
}
.adb-route-card p {
  margin: 0;
  color: #aab4c2;
  font-size: 12px;
  line-height: 1.45;
}
.adb-pair-code {
  margin: 0 0 12px;
}
.adb-pair-code[hidden],
.adb-manual[hidden],
.adb-setup-actions button[hidden] {
  display: none;
}
.adb-pair-code label {
  display: grid;
  gap: 6px;
  color: #e7eaf0;
  font-size: 13px;
  font-weight: 700;
}
.adb-pair-code input {
  width: 100%;
  min-height: 46px;
  padding: 9px 12px;
  background: #070a10;
  border: 1px solid #2a3140;
  border-radius: 8px;
  color: #e7eaf0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0;
  text-align: center;
}
.adb-pair-code input:focus {
  outline: none;
  border-color: #4f8cff;
  box-shadow: 0 0 0 3px rgba(79,140,255,.16);
}
.adb-direct {
  margin: 0 0 12px;
}
.adb-manual {
  margin: 0 0 12px;
  border: 1px solid #283142;
  border-radius: 8px;
  background: rgba(7,10,16,.55);
}
.adb-manual summary {
  cursor: pointer;
  padding: 11px 12px;
  color: #cfd6e1;
  font-size: 13px;
  user-select: none;
}
.adb-manual summary:hover {
  color: #e7eaf0;
}
.adb-manual .adb-setup-grid {
  padding: 0 12px 12px;
}
.adb-setup-grid {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 10px;
}
.adb-address-grid {
  grid-template-columns: 1fr;
}
.adb-setup-grid label {
  display: grid;
  gap: 5px;
  color: #cfd6e1;
  font-size: 12px;
}
.adb-setup-grid label:nth-child(3) {
  grid-column: auto;
}
.adb-setup-grid input {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  background: #070a10;
  border: 1px solid #2a3140;
  border-radius: 8px;
  color: #e7eaf0;
  font-size: 13px;
}
.adb-setup-grid input:focus {
  outline: none;
  border-color: #4f8cff;
  box-shadow: 0 0 0 3px rgba(79,140,255,.16);
}
.adb-setup-status {
  min-height: 20px;
  margin: 12px 0;
  color: #9aa4b2;
  font-size: 12px;
}
.adb-setup-status.error { color: #ff8589; }
.adb-setup-status.ok { color: #2bd17e; }
.adb-setup-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.adb-setup-actions #btnAdbOpenSettings {
  min-width: 0;
  min-height: 46px;
  padding: 0 14px;
  border-color: rgba(91,145,255,.82);
  background: linear-gradient(180deg, #4f8cff 0%, #1d67e8 100%);
  color: #ffffff;
  font-size: 14px;
  font-weight: 850;
  box-shadow:
    0 12px 26px rgba(34,104,232,.30),
    inset 0 1px 0 rgba(255,255,255,.18);
}
.adb-setup-actions #btnAdbOpenSettings:hover:not(:disabled) {
  background: linear-gradient(180deg, #6aa0ff 0%, #2876f2 100%);
  border-color: rgba(148,185,255,.95);
}
.adb-setup-actions .primary {
  min-width: 0;
  min-height: 46px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 850;
}

@media (max-width: 600px) {
  .conn-text { display: none; }
  .room-bar { padding: 6px 8px; }
  .skeleton-panel { min-width: 170px; }
  .side-tools { width: min(168px, calc(100vw - 24px)); }
  .source-control { padding: 8px; gap: 7px; }
  .source-option { font-size: 12px; padding: 7px 5px; }
  .side-tool { min-height: 40px; padding: 6px 8px; font-size: 13px; }
  .adb-setup-panel { padding: 14px; }
  .adb-route-grid { grid-template-columns: 1fr; }
  .adb-setup-grid { grid-template-columns: 1fr; }
  .adb-setup-grid label:nth-child(3) { grid-column: auto; }
  .adb-setup-actions { grid-template-columns: 1fr; }
  .nav-dock { margin-top: 8px; margin-bottom: 10px; max-width: calc(100vw - 16px); overflow-x: auto; }
  .nav-key { min-width: 48px; padding: 6px 8px; }
  .log { width: calc(100vw - 24px); right: 12px; bottom: 12px; }
}
