:root {
  color-scheme: dark;
  --shell: #0b0f16;
  --panel: #111722;
  --panel-2: #17202c;
  --surface: #ffffff;
  --surface-soft: #f4f7fb;
  --ink: #111827;
  --text: #f8fafc;
  --muted: #a6b0bf;
  --muted-light: #5b6678;
  --line: #263142;
  --line-light: #d7dee8;
  --blue: #2563eb;
  --blue-hover: #1d4ed8;
  --blue-pressed: #1e40af;
  --blue-soft: #eff6ff;
  --focus: #60a5fa;
  --green: #2fd477;
  --green-strong: #15803d;
  --green-soft: #ecfdf3;
  --red: #dc2626;
  --red-hover: #b91c1c;
  --red-soft: #fff1f2;
  --yellow: #f6c445;
  --warning-strong: #a16207;
  --warning-soft: #fffbeb;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --control-sm: 36px;
  --control-md: 44px;
  --control-lg: 48px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, .08);
  --shadow-control: 0 1px 2px rgba(15, 23, 42, .12);
  --shadow-soft: 0 10px 30px rgba(15, 23, 42, .07);
  --button-secondary-bg: var(--panel-2);
  --button-secondary-bg-hover: #1d2836;
  --button-secondary-border: #3a4657;
  --button-secondary-text: var(--text);
  --button-disabled-bg: #151c26;
  --button-disabled-border: #2d3746;
  --button-disabled-text: #8792a2;
  --press-scale: .98;
  --dur-instant: 100ms;
  --dur-fast: 120ms;
  --dur-standard: 180ms;
  --dur-emphasis: 240ms;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  font-family: Inter, "Segoe UI", "Microsoft YaHei UI", sans-serif;
  font-synthesis: none;
  letter-spacing: 0;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
html { background: var(--shell); }
body {
  margin: 0;
  background: var(--shell);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--blue);
  font-weight: 750;
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

button, input, textarea { font: inherit; letter-spacing: 0; }
button {
  color: inherit;
  user-select: none;
  transition:
    color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease),
    background-color var(--dur-standard) var(--ease),
    box-shadow var(--dur-standard) var(--ease),
    opacity var(--dur-fast) var(--ease),
    transform var(--dur-instant) var(--ease-out);
}
button, a, input, textarea {
  outline-offset: 3px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(37, 99, 235, .16);
}
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--focus);
}
button:disabled {
  cursor: not-allowed;
  color: var(--button-disabled-text);
  border-color: var(--button-disabled-border);
  background-color: var(--button-disabled-bg);
  box-shadow: none;
  opacity: .72;
}
button:disabled:active { transform: none; }
button:not(:disabled):active { transform: scale(var(--press-scale)); }
button.is-busy {
  min-inline-size: var(--button-busy-width, auto);
  cursor: progress;
  opacity: 1;
}
button.is-busy::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  flex: 0 0 auto;
  animation: spin 720ms linear infinite;
}
button.is-busy svg { display: none; }
.primary-button.is-busy:disabled {
  color: #fff;
  border-color: var(--blue-hover);
  background-color: var(--blue-hover);
}
.secondary-button.is-busy:disabled,
.key-actions button.is-busy:disabled {
  color: var(--button-secondary-text);
  border-color: var(--button-secondary-border);
  background-color: var(--button-secondary-bg);
}
.action-item.is-busy:disabled {
  color: var(--blue);
  border-color: var(--line-light);
  background-color: var(--blue-soft);
}
.danger-button.is-busy:disabled,
.danger-outline-button.is-busy:disabled {
  color: #fff;
  border-color: var(--red-hover);
  background-color: var(--red-hover);
}
button.is-success { color: #dcfce7 !important; border-color: #22c55e !important; background-color: #166534 !important; }
button.is-error, .upload-button.is-error { color: #fee2e2 !important; border-color: #ef4444 !important; background-color: #991b1b !important; }
@keyframes spin { to { transform: rotate(360deg); } }

.content-view,
.folder-browser-dialog,
.note-dialog {
  --button-secondary-bg: var(--surface);
  --button-secondary-bg-hover: var(--blue-soft);
  --button-secondary-border: #b8c0cc;
  --button-secondary-text: var(--ink);
  --button-disabled-bg: #f1f5f9;
  --button-disabled-border: #d8e1ee;
  --button-disabled-text: #5b6678;
}
.content-view button.is-success,
.folder-browser-dialog button.is-success,
.note-dialog button.is-success {
  color: var(--green-strong) !important;
  border-color: #16a34a !important;
  background-color: #f0fdf4 !important;
}
.content-view button.is-error,
.content-view .upload-button.is-error,
.folder-browser-dialog button.is-error,
.note-dialog button.is-error {
  color: var(--red-hover) !important;
  border-color: var(--red) !important;
  background-color: #fef2f2 !important;
}

svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.icon-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell { min-height: 100vh; background: var(--shell); }
.app-shell[hidden] { display: none; }
body.is-embedded-control .switch-device-button { display: none; }
body.is-embedded-control .current-device-control { padding-left: 6px; }
body.is-embedded-control .device-choice-multi { display: none; }
.section-nav {
  min-height: 50px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  padding: 0 max(24px, calc((100vw - 1200px) / 2));
  background: var(--surface);
  border-bottom: 1px solid var(--line-light);
  position: sticky;
  top: 0;
  z-index: 30;
}

.tabs { display: flex; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative;
  min-width: 82px;
  flex: 1 1 98px;
  height: 50px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px 6px 0 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--muted-light);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: color 160ms var(--ease), background-color 160ms var(--ease);
}
.tab span { line-height: 1; }
.tab::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 0;
  height: 2px;
  border-radius: 999px;
  background: transparent;
}
.tab:hover { color: var(--ink); background: var(--surface-soft); }
.tab.is-active { color: var(--blue); background: #eff6ff; }
.tab.is-active::after { background: var(--blue); }

.nav-status {
  align-self: center;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-left: 14px;
  white-space: nowrap;
}
.connection-state {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 6px 9px;
  border-radius: 999px;
  background: #ecfdf3;
  color: #15803d;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: none; }
.connection-state.is-offline { background: #fef2f2; color: #b91c1c; }
.connection-state.is-loading { background: #fffbeb; color: #a16207; }
.connection-state.is-degraded { background: #fff7ed; color: #c2410c; }
.lan-accelerate-link {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  background: #ecfdf3;
  color: #047857;
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  transition: color 160ms var(--ease), border-color 160ms var(--ease), background-color 160ms var(--ease), transform 120ms var(--ease);
}
.lan-accelerate-link:hover { border-color: #34d399; background: #d1fae5; color: #065f46; }
.lan-accelerate-link:active { transform: scale(var(--press-scale)); }
.current-device-control {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-left: 8px;
  border-left: 1px solid var(--line-light);
  color: var(--muted-light);
  font-size: 11px;
}
.current-device-label { font-weight: 700; }
.current-device-control strong {
  max-width: 130px;
  overflow: hidden;
  color: var(--ink);
  font: 700 11px/1.2 Consolas, "SFMono-Regular", monospace;
  text-overflow: ellipsis;
}
.switch-device-button {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
  cursor: pointer;
  transition: color 160ms var(--ease), border-color 160ms var(--ease), background-color 160ms var(--ease), transform 120ms var(--ease);
}
.switch-device-button:hover { border-color: var(--blue); background: #dbeafe; color: #1e40af; }
.switch-device-button:active { transform: scale(var(--press-scale)); }
.icon-button {
  align-self: center;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  margin-left: 8px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 160ms var(--ease), color 160ms var(--ease), transform 120ms var(--ease);
}
.icon-button:hover { color: var(--blue); border-color: var(--blue); }
.icon-button:active { transform: scale(.97); }

.view { display: none; }
.view.is-active { display: block; animation: view-in 120ms var(--ease) both; }
@keyframes view-in { from { transform: translateY(3px); } }
.remote-layout {
  min-height: calc(100vh - 50px);
  display: block;
  background: var(--shell);
}
.remote-main { min-width: 0; display: flex; flex-direction: column; }
.screen-panel { flex: 1 1 auto; min-height: 0; padding: 4px; background: var(--shell); }
.screen-stage {
  position: relative;
  width: min(100%, calc((100dvh - 204px) * 16 / 9));
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #020304;
  overflow: hidden;
}
.screen-toolbar {
  position: absolute;
  z-index: 15;
  top: 8px;
  left: 50%;
  max-width: calc(100% - 16px);
  min-height: 44px;
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .42);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, -8px);
  transition: opacity 140ms var(--ease), transform 140ms var(--ease), visibility 140ms linear;
}
.screen-stage[data-toolbar-side="bottom"] .screen-toolbar {
  top: auto;
  bottom: 8px;
  transform: translate(-50%, 8px);
}
.screen-stage.controls-open .screen-toolbar {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, 0);
}
.screen-control-float {
  position: absolute;
  z-index: 20;
  top: 10px;
  left: calc(100% - 66px);
  width: 56px;
  height: 56px;
  touch-action: none;
  user-select: none;
}
.screen-control-orb {
  width: 56px;
  height: 56px;
  padding: 0;
  border: 1px solid rgba(147, 197, 253, .82);
  border-radius: 50%;
  background: #1d4ed8;
  color: #eff6ff;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .24);
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 2px;
  cursor: grab;
  transition: transform 120ms var(--ease), box-shadow 120ms var(--ease), border-color 120ms var(--ease);
}
.screen-control-orb svg { width: 19px; height: 19px; }
.screen-control-orb span { font-size: 10px; font-weight: 800; line-height: 1; }
.screen-control-orb:hover { transform: translateY(-1px); border-color: #dbeafe; }
.screen-control-orb:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.screen-control-float.is-dragging .screen-control-orb { cursor: grabbing; transform: scale(1.05); }
.screen-stage.controls-open .screen-control-orb {
  border-color: #86efac;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .5), 0 0 0 3px rgba(34, 197, 94, .24);
}
.tool-button {
  min-height: 44px;
  padding: 0 9px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: #c9d0da;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: color 160ms var(--ease), background-color 160ms var(--ease);
}
.tool-button:hover { color: var(--blue); background: #10151c; }
.tool-button.is-active { color: #86efac; background: #0b1912; box-shadow: inset 0 3px 0 var(--green); }
.tool-button:active svg { transform: scale(.98); }
.tool-button svg { transition: transform 120ms var(--ease); }
.privacy-clear-button { color: #fecaca; }
.privacy-clear-button:hover,
.privacy-clear-button:focus-visible { color: #fff1f2; background: #351216; }
.screen-frame {
  position: relative;
  width: 100%;
  flex: 0 0 auto;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
  contain: layout paint;
}
.nuc-performance-mode .view.is-active { animation: none; }
.nuc-performance-mode .screen-stage { contain: layout paint style; }
.screen-frame.has-remote-pointer { cursor: none; }
.screen-frame:focus-visible, .screen-frame:focus-within { outline: 3px solid var(--focus); outline-offset: -4px; }
.screen-stage:fullscreen {
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: #000;
}
.screen-stage:fullscreen .screen-frame { flex: 1 1 auto; height: auto; min-height: 0; max-height: none; aspect-ratio: auto; }
.screen-frame img, .screen-frame video, .screen-frame canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}
.screen-frame img, .screen-frame canvas { z-index: 0; }
.screen-frame video { z-index: 1; opacity: 1; transition: none; }
.screen-frame.is-video-handoff-pending video { z-index: 0; }
.screen-frame.is-video-handoff-pending img,
.screen-frame.is-video-handoff-pending canvas { z-index: 2; }
.nuc-performance-mode .screen-frame video { transition: none; }
.screen-frame video[hidden], .screen-frame img[hidden], .screen-frame canvas[hidden] { display: none; }
.screen-frame.is-fill img, .screen-frame.is-fill video, .screen-frame.is-fill canvas { object-fit: cover; }
.screen-pointer-actions {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  padding: 4px 6px;
  border-left: 1px solid var(--line);
  background: var(--panel);
}
.screen-shortcut-actions {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 6px;
  border-left: 1px solid var(--line);
  background: var(--panel);
}
.screen-shortcut-actions button {
  min-height: 32px;
  padding: 0 9px;
  border: 1px solid #3b4654;
  border-radius: 5px;
  background: rgba(5, 8, 12, .9);
  color: #f5f7fa;
  font: 750 10px/1 Consolas, monospace;
  cursor: pointer;
}
.screen-shortcut-actions button:hover,
.screen-shortcut-actions button:focus-visible {
  border-color: var(--blue);
  background: #0c2742;
}
.screen-switch-actions {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  border-left: 1px solid var(--line);
  background: #07140e;
}
.screen-switch-actions[hidden] { display: none; }
.screen-switch-actions button {
  width: 32px;
  min-width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid #2f855a;
  border-radius: 50%;
  background: #0a2117;
  color: #dcfce7;
  font: 800 12px/1 Consolas, monospace;
  cursor: pointer;
}
.screen-switch-actions button:hover,
.screen-switch-actions button:focus-visible {
  border-color: #86efac;
  background: #14532d;
}
.screen-action-button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid #3b4654;
  border-radius: 5px;
  background: rgba(5, 8, 12, .9);
  color: #f5f7fa;
  font: 750 11px/1 system-ui, sans-serif;
  cursor: pointer;
}
.screen-action-button:hover, .screen-action-button[aria-pressed="true"] { border-color: var(--blue); background: #0c2742; }
.screen-action-button svg { width: 15px; height: 15px; }
.screen-action-button .click-count {
  min-width: 24px;
  padding: 4px 5px;
  border-radius: 3px;
  background: var(--blue);
  color: #fff;
  font: 800 11px/1 Consolas, monospace;
  text-align: center;
}
.remote-pointer {
  position: absolute;
  z-index: 3;
  left: 0;
  top: 0;
  width: 25px;
  height: 31px;
  opacity: 0;
  transform: translate3d(calc(var(--pointer-x, 0px) - 3px), calc(var(--pointer-y, 0px) - 2px), 0);
  pointer-events: none;
  filter: drop-shadow(0 1px 2px #000);
  transition: opacity 80ms linear;
  will-change: transform, opacity;
}
.nuc-performance-mode .remote-pointer { filter: none; transition: none; }
.remote-pointer::before {
  content: "";
  position: absolute;
  inset: 0 7px 7px 0;
  background: #fff;
  clip-path: polygon(0 0, 0 100%, 6px 76%, 10px 100%, 14px 98%, 10px 73%, 18px 73%);
}
.remote-pointer span {
  position: absolute;
  left: 14px;
  top: 14px;
  min-width: 23px;
  padding: 3px 4px;
  border: 1px solid #fff;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font: 800 9px/1 Consolas, monospace;
  text-align: center;
}
.screen-frame.has-remote-pointer .remote-pointer { opacity: 1; }
.remote-pointer.is-clicking { animation: remote-pointer-click 180ms ease-out; }
@keyframes remote-pointer-click {
  50% {
    transform: translate3d(calc(var(--pointer-x, 0px) - 3px), calc(var(--pointer-y, 0px) - 2px), 0) scale(.72);
  }
}
.remote-keyboard-capture {
  position: absolute;
  left: 1px;
  top: 1px;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
  resize: none;
}
.screen-empty {
  position: absolute;
  z-index: 5;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #e7edf6;
  background: #020304;
  text-align: center;
}
.screen-empty svg { width: 42px; height: 42px; color: var(--blue); }
.screen-empty strong { font-size: 17px; }
.screen-empty span { color: var(--muted); font-size: 13px; }
.screen-empty.is-hidden { display: none; }
.screen-retry {
  min-height: 38px;
  margin-top: 8px;
  padding: 0 14px;
  border: 1px solid var(--blue);
  border-radius: 4px;
  background: transparent;
  color: var(--blue);
  font-weight: 700;
  cursor: pointer;
}
.screen-retry:hover { background: #101b2b; }
.live-label {
  position: absolute;
  z-index: 2;
  left: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  color: #fff;
  background: rgba(5, 6, 7, .86);
  border: 1px solid #303640;
  border-radius: 3px;
  font: 700 11px/1.2 Consolas, monospace;
  pointer-events: none;
}
.live-label span { width: 7px; height: 7px; background: var(--green); border-radius: 50%; box-shadow: 0 0 10px var(--green); }
.live-label strong { font: inherit; }
.keyboard-label {
  position: absolute;
  z-index: 2;
  right: 12px;
  bottom: 12px;
  padding: 6px 9px;
  color: #b9c3d0;
  background: rgba(5, 6, 7, .86);
  border: 1px solid #303640;
  border-radius: 3px;
  font: 700 11px/1.2 Consolas, monospace;
  pointer-events: none;
}
.screen-frame:focus-within .keyboard-label { color: #fff; border-color: var(--blue); background: rgba(7, 27, 48, .92); }

.input-confirmation {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 48px;
  max-width: calc(100% - 24px);
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border: 1px solid #334155;
  border-radius: var(--radius-pill);
  background: rgba(7, 12, 19, .92);
  color: #dbeafe;
  box-shadow: 0 7px 18px rgba(0, 0, 0, .28);
  font: 750 10px/1.2 Consolas, monospace;
  pointer-events: none;
  transform: translateX(-50%);
}
.input-confirmation[hidden] { display: none; }
.input-confirmation i {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: #60a5fa;
}
.input-confirmation strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.input-confirmation[data-state="sending"] i { animation: input-confirmation-pulse 900ms ease-in-out infinite; }
.input-confirmation[data-state="confirmed"] { border-color: rgba(74, 222, 128, .48); color: #dcfce7; }
.input-confirmation[data-state="confirmed"] i { background: #22c55e; }
.input-confirmation[data-state="ignored"],
.input-confirmation[data-state="limited"] { border-color: rgba(251, 191, 36, .58); color: #fef3c7; }
.input-confirmation[data-state="ignored"] i,
.input-confirmation[data-state="limited"] i { background: #f59e0b; }
.input-confirmation[data-state="unknown"] { border-color: rgba(248, 113, 113, .58); color: #fee2e2; }
.input-confirmation[data-state="unknown"] i { background: #ef4444; }
@keyframes input-confirmation-pulse { 50% { opacity: .35; } }

.session-health-pill {
  position: absolute;
  z-index: 12;
  top: 9px;
  left: 9px;
  max-width: min(260px, calc(100% - 88px));
  min-height: 44px;
  display: grid;
  grid-template-columns: 8px auto;
  grid-template-areas: "dot grade" "dot summary";
  align-items: center;
  column-gap: 8px;
  padding: 5px 10px;
  border: 1px solid rgba(134, 239, 172, .42);
  border-radius: 999px;
  background: rgba(7, 12, 19, .9);
  color: #dcfce7;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .32);
  text-align: left;
  cursor: pointer;
  transition: opacity 120ms var(--ease), border-color 120ms var(--ease), background-color 120ms var(--ease);
}
.session-health-pill i {
  grid-area: dot;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px currentColor;
}
.session-health-pill strong { grid-area: grade; font: 800 11px/1.1 Consolas, monospace; }
.session-health-pill small {
  grid-area: summary;
  min-width: 0;
  overflow: hidden;
  color: #a7b2c2;
  font: 700 9px/1.15 Consolas, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.session-health-pill.is-fair { border-color: rgba(251, 191, 36, .62); color: #fde68a; }
.session-health-pill.is-fair i,
.session-health-pill.is-recovering i { background: #f59e0b; }
.session-health-pill.is-poor,
.session-health-pill.is-offline { border-color: rgba(248, 113, 113, .68); color: #fecaca; }
.session-health-pill.is-poor i,
.session-health-pill.is-offline i { background: #ef4444; }
.session-health-pill.is-checking i { background: #60a5fa; }
.screen-stage.controls-open:not(.health-open) .session-health-pill { opacity: 0; pointer-events: none; }
.session-health-pill:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.session-health-panel {
  position: absolute;
  z-index: 26;
  top: 9px;
  left: 9px;
  width: min(430px, calc(100% - 18px));
  max-height: calc(100% - 18px);
  overflow: auto;
  padding: 14px;
  border: 1px solid #334155;
  border-radius: var(--radius-md);
  background: rgba(8, 13, 21, .98);
  color: #e5edf7;
  box-shadow: 0 18px 46px rgba(0, 0, 0, .58);
}
.session-health-panel[hidden] { display: none; }
.session-health-panel header,
.session-health-panel footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.session-health-panel header > span { display: grid; gap: 2px; }
.session-health-panel header small { color: #60a5fa; font: 800 9px/1 Consolas, monospace; letter-spacing: .08em; }
.session-health-panel header strong { font-size: 15px; }
.session-health-panel header button,
.session-health-panel footer button {
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid #3b4a5e;
  border-radius: var(--radius-sm);
  background: #101923;
  color: #dbeafe;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.session-health-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin: 12px 0 10px;
}
.session-health-metrics > span {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 8px 9px;
  border: 1px solid #202d3c;
  border-radius: var(--radius-sm);
  background: #0b111a;
}
.session-health-metrics small { color: #8b9aad; font: 700 9px/1.1 Consolas, monospace; }
.session-health-metrics strong { overflow: hidden; color: #edf5ff; font: 800 11px/1.25 Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.session-health-panel > p {
  margin: 0 0 10px;
  padding: 9px 10px;
  border-left: 3px solid #60a5fa;
  background: #0c1622;
  color: #bdc9d8;
  font-size: 11px;
  line-height: 1.45;
}
.session-health-panel footer { align-items: flex-start; }
.session-health-panel footer small { max-width: 210px; color: #7f8da0; font-size: 9px; line-height: 1.4; text-align: right; }
.session-health-panel button:hover { border-color: #60a5fa; background: #12243a; }
.session-health-panel button:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.control-bar {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 4px 10px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}
.key-actions, .inline-actions { display: flex; gap: 8px; }
.text-command {
  height: 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  border: 1px solid #3a424f;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #080a0d;
}
.text-command:focus-within { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.text-command input { min-width: 0; border: 0; padding: 0 16px; color: var(--text); background: transparent; outline: 0; }
.text-command input::placeholder { color: #687384; }
.text-command button { border: 0; border-left: 1px solid #3a424f; background: transparent; color: var(--blue); display: grid; place-items: center; cursor: pointer; }
.text-command button:hover { background: #101b2b; }
.key-actions button, .secondary-button, .primary-button {
  min-height: 48px;
  border: 1px solid #3a424f;
  border-radius: var(--radius-sm);
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
}
.key-actions button { min-width: 70px; min-height: 44px; padding: 6px 12px; flex-direction: column; gap: 0; background: #080a0d; }
.key-actions button:hover, .secondary-button:hover { color: var(--blue); border-color: var(--blue); background-color: var(--button-secondary-bg-hover); }
.key-actions button:active, .secondary-button:active, .primary-button:active { transform: scale(var(--press-scale)); }
.key-actions strong { font-size: 14px; }
.key-actions span { font-size: 10px; color: var(--muted); }
.switch-mode-panel {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 64px;
  padding: 8px 10px;
  border-top: 1px solid var(--line);
  background: #070a0d;
}
.switch-mode-toggle {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 7px 12px;
  border: 1px solid #3a424f;
  border-radius: var(--radius-sm);
  background: #0c1015;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.switch-mode-toggle > span { display: grid; gap: 2px; }
.switch-mode-toggle strong { font-size: 13px; }
.switch-mode-toggle small { color: var(--muted); font-size: 10px; }
.switch-mode-toggle b {
  flex: 0 0 auto;
  min-width: 44px;
  padding: 5px 8px;
  border-radius: 999px;
  background: #1d2530;
  color: #aeb8c6;
  font: 800 11px/1 Consolas, monospace;
  text-align: center;
}
.switch-mode-toggle[aria-pressed="true"] { border-color: #22c55e; background: #081b12; }
.switch-mode-toggle[aria-pressed="true"] b { background: #166534; color: #dcfce7; }
.switch-mode-toggle:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.switch-mode-keys {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
}
.switch-mode-keys[hidden] { display: none; }
.switch-key-group { display: grid; grid-template-columns: repeat(4, minmax(42px, 1fr)); gap: 7px; }
.switch-face-keys { grid-template-columns: repeat(5, minmax(42px, 1fr)); }
.switch-key-group button {
  min-width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid #365544;
  border-radius: 50%;
  background: #0b1711;
  color: #e7f8ed;
  font: 800 14px/1 Consolas, monospace;
  cursor: pointer;
  transition: transform 100ms var(--ease), border-color 120ms var(--ease), background-color 120ms var(--ease);
}
.switch-key-group button:hover,
.switch-key-group button:focus-visible { border-color: #4ade80; background: #123b24; }
.switch-key-group button:active { transform: scale(.97); }
.telemetry-bar {
  display: none;
  align-items: center;
  gap: 24px;
  padding: 0 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font: 600 11px/1.2 Consolas, monospace;
}
.telemetry-bar span { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.telemetry-bar i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.telemetry-bar strong { color: #dbe3ee; font-weight: 700; }

.command-rail { padding: 24px 20px; background: var(--panel); }
.rail-section + .rail-section { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 22px; }
.rail-section h2 { margin: 0 0 14px; font-size: 16px; line-height: 1.3; }
.rail-section h2::before { content: "//"; margin-right: 8px; color: var(--blue); font-family: Consolas, monospace; }
.status-row {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  color: var(--muted);
}
.status-row svg { width: 19px; height: 19px; color: var(--green); }
.status-row strong { color: var(--green); font: 700 12px/1 Consolas, monospace; }
.action-row {
  width: 100%;
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0 10px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: color 160ms var(--ease), background-color 160ms var(--ease);
}
.action-row:hover { color: var(--blue); background: #10141a; }
.action-row.danger { color: var(--red); }
.action-row svg { width: 21px; height: 21px; }
.action-row > svg, .action-row > span { transition: transform var(--dur-fast) var(--ease); }
.action-row:hover > svg, .action-row:hover > span { transform: translateX(4px); }

.content-view { width: min(1040px, calc(100% - 48px)); min-height: calc(100vh - 50px); margin: 0 auto; padding: 48px 0 80px; color: var(--ink); contain: layout style; }
.content-view.is-active { display: block; }
main:has(.content-view.is-active) { background: var(--surface-soft); }
.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line-light);
  margin-bottom: 20px;
}
.page-heading h1 { margin: 2px 0 0; font-size: 31px; line-height: 1.15; }
.page-heading small { color: var(--blue); font: 700 10px/1.2 Consolas, monospace; }
.page-heading > span { color: var(--muted-light); font-size: 13px; }
.section-intro { max-width: 820px; margin: -4px 0 20px; color: var(--muted-light); line-height: 1.7; }
.action-list { display: grid; grid-template-columns: 1fr 1fr; }
.action-item {
  min-height: 92px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: var(--space-4) 18px;
  border: 0;
  border-bottom: 1px solid var(--line-light);
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.action-item:nth-child(odd) { border-right: 1px solid var(--line-light); }
.action-item:hover { color: var(--blue); background: var(--blue-soft); }
.action-item:active { transform: scale(.99); }
.action-item svg { width: 27px; height: 27px; }
.action-item span { display: flex; flex-direction: column; gap: 3px; }
.action-item strong { font-size: 16px; }
.action-item small { color: var(--muted-light); font-size: 12px; }
.action-item.is-dangerous { box-shadow: inset 3px 0 0 transparent; }
.action-item.is-dangerous svg { color: var(--red-hover); }
.action-item.is-dangerous:hover,
.action-item.is-dangerous:focus-visible {
  color: var(--red-hover);
  background: var(--red-soft);
  box-shadow: inset 3px 0 0 var(--red);
}
.field-label { display: block; margin: 24px 0 8px; font-weight: 750; }
textarea {
  width: 100%;
  min-height: 280px;
  resize: vertical;
  border: 1px solid #b8c0cc;
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  padding: 15px;
}
.inline-actions { justify-content: flex-end; margin-top: 14px; }
.content-view .secondary-button { color: var(--button-secondary-text); border-color: var(--button-secondary-border); background: var(--button-secondary-bg); }
.primary-button { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: var(--shadow-control); }
.primary-button:hover { background: var(--blue-hover); border-color: var(--blue-hover); }
.primary-button:active { background: var(--blue-pressed); border-color: var(--blue-pressed); }
.folder-sync-card {
  margin: 0 0 24px;
  padding: 20px;
  border: 1px solid #b9cdf2;
  border-radius: var(--radius-md);
  background: #f3f7fd;
  box-shadow: var(--shadow-soft);
}
.folder-sync-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.folder-sync-heading small, .folder-browser-heading small { color: var(--blue); font: 700 10px/1.2 Consolas, monospace; letter-spacing: .08em; }
.folder-sync-heading h2, .folder-browser-heading h2 { margin: 4px 0 0; font-size: 22px; }
.folder-sync-mode { padding: 6px 9px; border: 1px solid #93c5fd; border-radius: 999px; color: #1d4ed8; background: #eff6ff; font-size: 11px; font-weight: 750; white-space: nowrap; }
.folder-sync-route { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 14px; margin-top: 18px; }
.folder-sync-endpoint { min-width: 0; display: grid; gap: 7px; padding: 15px; border: 1px solid #d8e4f7; border-radius: var(--radius-sm); background: rgba(255, 255, 255, .88); }
.folder-sync-endpoint > span, .folder-sync-endpoint > label { color: var(--muted-light); font-size: 11px; font-weight: 750; }
.folder-sync-endpoint > strong { color: var(--blue); font-size: 16px; }
.folder-sync-endpoint > select {
  width: 100%;
  min-height: 44px;
  border: 1px solid #aebdd3;
  border-radius: var(--radius-sm);
  padding: 0 36px 0 11px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}
.folder-sync-endpoint > select:disabled { color: var(--muted-light); background: #f1f5f9; }
.folder-sync-destination { display: grid; gap: 4px; padding: 11px 12px; border: 1px solid #bfdbfe; border-radius: 11px; background: #eff6ff; }
.folder-sync-destination span { color: var(--muted-light); font-size: 10px; font-weight: 750; }
.folder-sync-destination strong { overflow-wrap: anywhere; color: #1d4ed8; font: 700 12px/1.45 Consolas, monospace; }
.folder-sync-arrow { color: var(--blue); font-size: 24px; font-weight: 800; }
.folder-sync-path-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.folder-sync-path-row input { min-width: 0; height: 44px; border: 1px solid #aebdd3; border-radius: var(--radius-sm); padding: 0 11px; background: #fff; color: var(--ink); font: 13px/1.2 Consolas, monospace; }
.folder-sync-path-row input:read-only { color: var(--muted-light); background: #f1f5f9; }
.folder-sync-path-row button { min-height: 44px; padding: 0 13px; }
.folder-sync-location-options { display: grid; gap: 6px; margin-top: 2px; }
.folder-sync-location-options > span { color: var(--muted-light); font-size: 11px; font-weight: 750; }
.folder-sync-location-options > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.folder-sync-location-options button {
  min-width: 0;
  min-height: 44px;
  border: 1px solid #bfd0e9;
  border-radius: 10px;
  background: #f8fbff;
  color: #334155;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}
.folder-sync-location-options button:hover,
.folder-sync-location-options button:focus-visible { border-color: var(--blue); color: var(--blue); background: #eff6ff; }
.folder-sync-location-options button[aria-pressed="true"] { border-color: var(--blue); color: #fff; background: var(--blue); }
.folder-sync-location-options button:disabled { border-color: #d8e1ee; color: #94a3b8; background: #f1f5f9; cursor: not-allowed; }
.folder-sync-help { margin: 13px 0 0; color: var(--muted-light); font-size: 12px; line-height: 1.6; }
.folder-sync-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 14px; }
.folder-sync-actions > button { min-height: 46px; }
.folder-sync-status { display: grid; gap: 4px; margin-top: 14px; padding: 13px 14px; border-left: 3px solid var(--blue); background: rgba(255, 255, 255, .86); color: var(--muted-light); }
.folder-sync-status strong { color: var(--ink); }
.folder-sync-status.is-error { border-left-color: var(--red); background: #fef2f2; }
.folder-sync-status.is-success { border-left-color: #16a34a; background: #f0fdf4; }
.folder-sync-status progress { width: 100%; height: 8px; accent-color: var(--blue); }
.folder-sync-status-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 3px; }
.folder-sync-status-meta span { padding: 4px 7px; border: 1px solid #cbd9ed; border-radius: 999px; background: rgba(248, 251, 255, .92); color: #475569; font: 700 10px/1.2 Consolas, monospace; }
.folder-sync-progress-label { justify-self: end; color: var(--blue); font: 750 11px/1.2 Consolas, monospace; }
.folder-sync-diff { display: grid; gap: 12px; margin-top: 14px; padding: 15px; border: 1px solid #cbd9ed; border-radius: var(--radius-sm); background: rgba(248, 251, 255, .94); }
.folder-sync-diff[hidden] { display: none; }
.folder-sync-diff-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.folder-sync-diff-heading > div { display: grid; gap: 3px; }
.folder-sync-diff-heading small { color: var(--blue); font: 700 9px/1.2 Consolas, monospace; letter-spacing: .08em; }
.folder-sync-diff-heading strong { color: var(--ink); font-size: 17px; }
.folder-sync-diff-heading > span { color: var(--muted-light); font-size: 10px; text-align: right; }
.folder-sync-diff-summary { display: flex; flex-wrap: wrap; gap: 6px; }
.folder-sync-diff-summary span { padding: 5px 8px; border: 1px solid #bfdbfe; border-radius: 999px; background: #eff6ff; color: #1d4ed8; font-size: 10px; font-weight: 750; }
.folder-sync-diff-list { display: grid; gap: 7px; max-height: 420px; overflow: auto; }
.folder-sync-diff-row { display: grid; gap: 4px; padding: 10px 11px; border: 1px solid #d8e4f7; border-left: 3px solid #f59e0b; border-radius: 9px; background: #fff; }
.folder-sync-diff-row.is-source-only { border-left-color: #2563eb; }
.folder-sync-diff-row.is-target-only { border-left-color: #0891b2; }
.folder-sync-diff-row > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.folder-sync-diff-row strong { min-width: 0; overflow-wrap: anywhere; color: var(--ink); font-size: 12px; }
.folder-sync-diff-row span { flex: 0 0 auto; color: var(--blue); font-size: 9px; font-weight: 800; }
.folder-sync-diff-row p, .folder-sync-diff-empty, .folder-sync-diff-truncated { margin: 0; color: var(--muted-light); font-size: 10px; line-height: 1.5; }
.folder-sync-diff-empty { padding: 12px; border: 1px dashed #86efac; border-radius: 9px; color: #15803d; background: #f0fdf4; }
.folder-sync-diff-truncated { padding: 8px 10px; border-radius: 8px; color: #92400e; background: #fffbeb; }
.upload-button {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  margin: 18px 0 14px;
  padding: 0 16px;
  border: 1px solid var(--blue);
  border-radius: var(--radius-sm);
  color: var(--blue);
  background: var(--surface);
  font-weight: 750;
  cursor: pointer;
  user-select: none;
  transition:
    color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease),
    background-color var(--dur-standard) var(--ease),
    box-shadow var(--dur-standard) var(--ease),
    transform var(--dur-instant) var(--ease-out);
}
.upload-button:hover { color: #fff; background: var(--blue); }
.upload-button:active { transform: scale(var(--press-scale)); }
.upload-button:focus-within { outline: 2px solid var(--focus); outline-offset: 3px; }
.upload-button[aria-busy="true"] { pointer-events: none; }
.upload-button.is-busy > svg, .upload-button.is-busy > span { visibility: hidden; }
.upload-button.is-busy::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  position: absolute;
  left: calc(50% - 42px);
  top: calc(50% - 9px);
  animation: spin 720ms linear infinite;
}
.upload-button.is-busy::after { content: "上传中…"; position: absolute; left: calc(50% - 18px); top: 50%; transform: translateY(-50%); }
.upload-button input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.file-list { border-top: 1px solid var(--line-light); }
.file-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 18px; min-height: 70px; border-bottom: 1px solid var(--line-light); }
.file-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.file-meta { color: var(--muted-light); font-size: 12px; white-space: nowrap; }
.file-download { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent; color: var(--blue); cursor: pointer; }
.file-download:hover { border-color: var(--blue); background: #fff; }
.empty-row { padding: 36px 0; color: var(--muted-light); text-align: center; }
.file-state {
  min-height: 150px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 28px 16px;
  color: var(--muted-light);
  text-align: center;
  overflow-wrap: anywhere;
}
.file-state svg { width: 28px; height: 28px; color: var(--blue); }
.file-state.is-loading svg { animation: spin 720ms linear infinite; }
.file-state.is-error svg { color: var(--red); }
.file-state button { min-height: 44px; padding: 0 14px; border: 1px solid var(--blue); border-radius: var(--radius-sm); background: #fff; color: var(--blue); font-weight: 700; cursor: pointer; }
.settings-list { margin: 0; }
.settings-list > div { display: grid; grid-template-columns: 150px 1fr; gap: 20px; padding: 19px 0; border-bottom: 1px solid var(--line-light); }
.settings-list dt { color: var(--muted-light); }
.settings-list dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.logout-button { margin-top: 28px; color: var(--red) !important; }
.remote-command-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 1px;
  padding: 1px;
  border-top: 1px solid var(--line);
  background: var(--line);
  scrollbar-color: #556274 transparent;
  scrollbar-width: thin;
}
.remote-command-grid::-webkit-scrollbar { height: 4px; }
.remote-command-grid::-webkit-scrollbar-track { background: transparent; }
.remote-command-grid::-webkit-scrollbar-thumb { border-radius: var(--radius-pill); background: #556274; }
.remote-command-grid button {
  min-height: var(--control-md);
  border: 0;
  background: var(--panel);
  color: #cbd3df;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.remote-command-grid button:hover { color: var(--blue); background: #10151c; }
.action-groups { display: grid; gap: var(--space-6); padding-top: var(--space-2); }
.action-group {
  overflow: hidden;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}
.action-group h2 {
  margin: 0;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-light);
  background: var(--surface-soft);
  font-size: 16px;
  line-height: 1.35;
}
.action-group .action-list { border-bottom: 0; }
.assistant-card {
  max-width: 880px;
  margin: 0 auto;
  padding: 24px;
  border: 1px solid #bfd0ee;
  border-radius: var(--radius-md);
  background: #f8fbff;
  box-shadow: var(--shadow-soft);
}
.assistant-privacy { margin: 16px 0; color: var(--muted-light); font-size: 13px; line-height: 1.65; }
.assistant-chat {
  display: grid;
  gap: 12px;
  min-height: 230px;
  max-height: min(52vh, 520px);
  overflow-y: auto;
  padding: 18px;
  border: 1px solid #d7e1ef;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, .82);
  scroll-behavior: smooth;
}
.assistant-message { max-width: min(78%, 660px); }
.assistant-message span { display: block; margin: 0 0 4px; color: var(--muted-light); font-size: 10px; font-weight: 800; letter-spacing: .04em; }
.assistant-message p { margin: 0; padding: 12px 14px; border: 1px solid #d8e3f2; border-radius: 4px 15px 15px 15px; background: #f4f8fe; color: var(--ink); line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.assistant-message.is-user { justify-self: end; }
.assistant-message.is-user span { text-align: right; }
.assistant-message.is-user p { border-color: #8db4ef; border-radius: 15px 4px 15px 15px; background: #e8f1ff; }
.assistant-message.is-error p { border-color: #fecaca; background: #fff1f2; color: #9f1239; }
.assistant-message.is-pending p { color: var(--muted-light); }
#assistantInput { min-height: 96px; max-height: 220px; }
.assistant-actions { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.assistant-actions > span { flex: 1 1 auto; color: var(--muted-light); font-size: 11px; line-height: 1.45; }
.assistant-actions button { flex: 0 0 auto; }
.assistant-actions button.is-listening { border-color: var(--red); color: var(--red); background: #fff1f2; }
.secure-result, .control-card {
  margin-top: 28px;
  padding: 22px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.section-heading small { color: var(--blue); font: 700 10px/1.2 Consolas, monospace; }
.section-heading h2 { margin: 3px 0 0; font-size: 20px; }
.section-heading > span, .section-heading > strong { color: var(--muted-light); font-size: 12px; }
.toolbar-row, .file-actions { display: flex; align-items: center; gap: 10px; margin: 18px 0 14px; }
.search-field { flex: 1 1 auto; }
.search-field input, .form-grid input {
  width: 100%;
  min-height: 48px;
  border: 1px solid #b8c0cc;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  padding: 0 13px;
}
.notes-toolbar { display: flex; align-items: center; gap: 10px; margin: 18px 0 12px; }
.notes-toolbar .search-field { min-width: 240px; }
.note-tag-filters { display: flex; gap: 7px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: thin; }
.note-tag-filter {
  min-height: 44px;
  flex: 0 0 auto;
  padding: 0 12px;
  border: 1px solid #cbd3df;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted-light);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}
.note-tag-filter:hover, .note-tag-filter.is-active { border-color: var(--blue); color: var(--blue); background: #eff6ff; }
.notes-summary { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-top: 1px solid var(--line-light); color: var(--muted-light); }
.notes-summary span { color: var(--ink); font-weight: 750; }
.notes-summary small { text-align: right; }
.note-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 4px; }
.note-card {
  min-width: 0;
  min-height: 210px;
  display: flex;
  flex-direction: column;
  padding: 18px;
  border: 1px solid var(--line-light);
  border-top: 3px solid #94a3b8;
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  content-visibility: auto;
  contain-intrinsic-size: auto 230px;
}
.note-card.is-pinned { border-top-color: var(--blue); }
.note-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.note-card-tag { max-width: 70%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--blue); font-size: 11px; font-weight: 800; }
.note-card-time { flex: 0 0 auto; color: var(--muted-light); font-size: 11px; }
.note-card h2 { margin: 12px 0 7px; font-size: 18px; line-height: 1.3; overflow-wrap: anywhere; }
.note-card-content { flex: 1 1 auto; margin: 0; color: #4b5563; font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.note-card-details { display: flex; align-items: center; gap: 10px; min-height: 22px; margin-top: 12px; color: var(--muted-light); font-size: 11px; }
.note-card-details svg { width: 14px; height: 14px; color: var(--blue); }
.note-card-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 14px; margin-top: 10px; border-top: 1px solid var(--line-light); }
.note-card-actions button { min-height: 44px; padding: 0 13px; }
.note-card-actions .delete-note { color: #b91c1c; }
.note-state { grid-column: 1 / -1; min-height: 250px; display: grid; place-items: center; align-content: center; gap: 10px; padding: 30px; border: 1px dashed #b8c0cc; border-radius: var(--radius-md); color: var(--muted-light); text-align: center; }
.note-state svg { width: 34px; height: 34px; color: var(--blue); }
.note-state.is-loading svg { animation: spin 720ms linear infinite; }
.note-state.is-error svg { color: var(--red); }
.notes-entry-card { border-left: 4px solid var(--blue); }
.notes-entry-card .inline-actions { justify-content: flex-start; }
.managed-list { margin-top: 14px; border-top: 1px solid var(--line-light); }
.managed-row {
  min-height: 70px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-light);
}
.managed-copy { min-width: 0; display: grid; gap: 3px; }
.managed-copy strong { overflow-wrap: anywhere; }
.managed-copy small { color: var(--muted-light); overflow-wrap: anywhere; }
.managed-row button { min-width: 92px; }
.managed-row, .file-row, .action-item { content-visibility: auto; contain-intrinsic-size: auto 72px; }
.list-state { padding: 34px 12px; color: var(--muted-light); text-align: center; }
.app-download-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line-light);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.app-download-summary > div { min-width: 0; display: grid; gap: 3px; padding: 17px 18px; border-right: 1px solid var(--line-light); }
.app-download-summary > div:last-child { border-right: 0; }
.app-download-summary strong { color: var(--blue); font: 800 25px/1.1 Consolas, monospace; }
.app-download-summary span { color: var(--muted-light); font-size: 12px; }
.project-update-section {
  margin-bottom: 20px;
  padding: 20px;
  border: 1px solid #d9c95f;
  border-radius: var(--radius-md);
  background: #fffef3;
  box-shadow: var(--shadow-soft);
}
.project-update-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 14px;
  border: 1px solid #ece3a8;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: rgba(255, 255, 255, .82);
}
.project-update-summary > div { display: grid; gap: 3px; padding: 14px 16px; border-right: 1px solid #ece3a8; }
.project-update-summary > div:last-child { border-right: 0; }
.project-update-summary strong { color: #8a5b00; font: 800 23px/1.1 Consolas, monospace; }
.project-update-summary span { color: var(--muted-light); font-size: 12px; }
.project-update-toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.project-update-list { margin-top: 14px; }
.project-update-note { margin: 14px 0 0; color: var(--muted-light); font-size: 12px; line-height: 1.65; }
.project-update-row.is-unavailable { opacity: .82; }
.project-update-row .managed-copy small { line-height: 1.55; }
.app-download-toolbar { display: grid; grid-template-columns: minmax(220px, 1fr) auto auto auto; align-items: end; gap: 10px; margin: 18px 0 28px; }
.app-download-toolbar .search-field input { height: 48px; }
.catalog-filter-label { display: grid; gap: 5px; color: var(--muted-light); font-size: 11px; font-weight: 750; }
.catalog-filter-label select { min-width: 140px; height: 48px; border: 1px solid #b8c0cc; border-radius: var(--radius-sm); padding: 0 34px 0 12px; background: var(--surface); color: var(--ink); }
.app-install-script, .app-download-row > a { text-decoration: none; }
.app-artifact-section, .app-catalog-section { padding: 20px; border: 1px solid var(--line-light); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-soft); }
.app-artifact-section + .app-artifact-section, .app-catalog-section { margin-top: 18px; }
.app-download-row > a, .app-download-row > button { min-width: 142px; }
.catalog-heading-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; }
.primary-button[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.catalog-title-line { min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.catalog-badge { flex: 0 0 auto; padding: 4px 7px; border: 1px solid #cbd5e1; border-radius: 999px; color: #64748b; background: #f8fafc; font-size: 10px; font-weight: 800; line-height: 1; }
.catalog-badge.is-ready { border-color: #86efac; color: #166534; background: #f0fdf4; }
.catalog-badge.is-update { border-color: #facc15; color: #854d0e; background: #fefce8; }
.catalog-badge.is-system { border-color: #cbd5e1; color: #475569; background: #f1f5f9; }
.catalog-badge.is-local { border-color: #93c5fd; color: #1d4ed8; background: #eff6ff; }
.app-download-row button:disabled { cursor: not-allowed; opacity: .62; }
.file-actions .upload-button { margin: 0; }
.danger-outline-button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid var(--red);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: #b91c1c;
  font-weight: 750;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
}
.danger-outline-button:hover { border-color: var(--red-hover); background: var(--red-soft); }
.danger-outline-button:active { transform: scale(var(--press-scale)); }
.system-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.system-grid .control-card { margin-top: 0; }
.control-card.full-width { width: 100%; }
.review-entry-card {
  position: relative;
  overflow: hidden;
  border-left: 4px solid var(--blue);
}
.review-entry-card::after {
  content: "";
  position: absolute;
  top: -60px;
  right: -38px;
  width: 190px;
  height: 190px;
  border: 34px solid rgba(37, 99, 235, .06);
  border-radius: 50%;
  pointer-events: none;
}
.review-entry-card > * { position: relative; z-index: 1; }
.review-summary-grid {
  display: grid;
  grid-template-columns: 1.35fr repeat(3, 1fr);
  margin: 18px 0;
  border: 1px solid var(--line-light);
  background: var(--surface-soft);
}
.review-summary-grid > div {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 15px 17px;
  border-right: 1px solid var(--line-light);
}
.review-summary-grid > div:last-child { border-right: 0; }
.review-summary-grid span { color: var(--muted-light); font-size: 11px; font-weight: 700; }
.review-summary-grid strong { color: var(--ink); font-size: 20px; line-height: 1.15; overflow-wrap: anywhere; }
#reviewState.is-ready { color: #15803d; }
#reviewState.is-warning { color: #a16207; }
#reviewState.is-error { color: #b91c1c; }
.review-view { min-height: calc(100vh - 50px); background: #071016; }
.review-view.is-active { display: flex; flex-direction: column; }
.review-view-toolbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 8px max(20px, calc((100vw - 1420px) / 2));
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.review-view-toolbar > div:first-child { min-width: 0; display: grid; gap: 2px; }
.review-view-toolbar strong { color: var(--text); font-size: 15px; }
.review-view-toolbar span { color: var(--muted); font-size: 11px; }
.review-view-toolbar .inline-actions { margin: 0; flex: 0 0 auto; }
.review-view-toolbar .secondary-button { min-height: 44px; border-color: #3a4657; background: var(--panel-2); color: var(--text); }
.review-frame {
  width: 100%;
  height: calc(100vh - 114px);
  min-height: 720px;
  display: block;
  border: 0;
  background: #071016;
}
.deal-view, .deal-frame { background: #f4f7fb; }
.settings-list.compact { margin-top: 12px; }
.settings-list.compact > div { grid-template-columns: 112px minmax(0, 1fr); padding: 12px 0; }
.inline-actions.wrap { flex-wrap: wrap; justify-content: flex-start; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.form-grid label { display: grid; gap: 6px; color: var(--muted-light); font-size: 12px; font-weight: 700; }
.field-help { margin: 14px 0 0; color: var(--muted-light); font-size: 12px; }
.sensitive-card { border-color: #efc3c1; }
.credential-list { display: grid; gap: 10px; margin-top: 18px; }
.credential-row { display: grid; grid-template-columns: 130px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line-light); background: var(--surface-soft); }
.credential-row strong { font-size: 12px; }
.credential-row code { min-width: 0; overflow-wrap: anywhere; white-space: pre-wrap; color: var(--ink); }
.session-actions { display: flex; justify-content: flex-end; }
.guardian-overview { overflow: hidden; }
.guardian-overview[data-level="normal"] { border-top: 3px solid var(--green); }
.guardian-overview[data-level="warning"] { border-top: 3px solid #d97706; }
.guardian-overview[data-level="critical"] { border-top: 3px solid var(--red); }
.guardian-overview[data-level="offline"] { border-top: 3px solid var(--line); }
.guardian-summary { margin: 2px 0 18px; color: var(--muted-light); line-height: 1.6; }
.guardian-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line-light); background: #080b10; }
.guardian-metrics > div { min-width: 0; padding: 17px 18px; border-right: 1px solid #202630; border-bottom: 1px solid #202630; }
.guardian-metrics > div:nth-child(3n) { border-right: 0; }
.guardian-metrics > div:nth-last-child(-n+3) { border-bottom: 0; }
.guardian-metrics span, .guardian-metrics small { display: block; color: #8b98aa; font-size: 11px; }
.guardian-metrics strong { display: block; margin: 7px 0 5px; color: #edf5ff; font: 700 23px/1.1 Consolas, monospace; }
.guardian-plan { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 20px; margin-top: 16px; padding: 15px 16px; border-left: 3px solid var(--blue); background: #f6f9fd; }
.guardian-plan small { color: var(--blue); font: 700 10px/1 Consolas, monospace; letter-spacing: .1em; }
.guardian-plan strong { display: block; margin-top: 7px; font-size: 16px; }
.guardian-plan p { margin: 5px 0 0; color: var(--muted-light); font-size: 12px; line-height: 1.55; }
.guardian-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 15px; }
.guardian-action { min-height: 78px; padding: 14px 15px; border: 1px solid var(--line-light); border-radius: 4px; color: var(--ink); background: #fff; text-align: left; transition: border-color var(--dur-fast), transform var(--dur-fast), background var(--dur-fast); }
.guardian-action:hover, .guardian-action:focus-visible { border-color: var(--blue); background: #f8fbff; transform: translateY(-1px); }
.guardian-action:disabled { opacity: .48; cursor: not-allowed; transform: none; }
.guardian-action strong, .guardian-action span { display: block; }
.guardian-action strong { font-size: 15px; }
.guardian-action span { margin-top: 5px; color: var(--muted-light); font-size: 12px; line-height: 1.45; }
.guardian-action.primary { border-color: #8bb6ef; background: #eef6ff; }
.guardian-action.extreme { border-color: #f3a4a4; background: #fff6f6; }
.guardian-action.extreme strong { color: #b91c1c; }
.guardian-action.restore { border-style: dashed; }
.guardian-alert-list { margin-top: 5px; }
.guardian-alert-item { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 13px 2px; border-bottom: 1px solid var(--line-light); }
.guardian-alert-item:last-child { border-bottom: 0; }
.guardian-alert-item i { width: 8px; height: 8px; border-radius: 50%; background: #d97706; }
.guardian-alert-item.critical i { background: var(--red); }
.guardian-alert-item strong, .guardian-alert-item span { display: block; }
.guardian-alert-item strong { font-size: 13px; }
.guardian-alert-item span { margin-top: 3px; color: var(--muted-light); font-size: 11px; }
.guardian-alert-item time { color: var(--muted-light); font: 11px/1 Consolas, monospace; }
.guardian-alert-empty { padding: 16px 0 5px; color: var(--green); font-size: 13px; }
.top-notice-region {
  position: fixed;
  top: 64px;
  right: 20px;
  z-index: 120;
  width: min(410px, calc(100% - 40px));
  display: grid;
  gap: 8px;
  pointer-events: none;
}
.network-banner {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid #5f302f;
  border-left: 3px solid var(--red);
  border-radius: 4px;
  background: #151011;
  color: var(--text);
  pointer-events: none;
}
.network-banner > span { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 0 8px; }
.network-banner i { grid-row: 1 / 3; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.network-banner strong { font-size: 13px; }
.network-banner small { color: #b9a7a7; white-space: normal; }
.network-banner button { flex: 0 0 auto; min-height: 44px; padding: 0 12px; border: 1px solid #6f4140; border-radius: var(--radius-sm); background: transparent; color: #ffd3d1; font-weight: 700; cursor: pointer; pointer-events: auto; }

.multi-control-view {
  min-height: 100dvh;
  padding: 0 20px 18px;
  background: #080d14;
  color: var(--text);
}
.multi-control-view[hidden] { display: none; }
.multi-control-header {
  min-height: 64px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid #273241;
}
.multi-control-brand { display: inline-flex; align-items: center; gap: 10px; padding-right: 20px; border-right: 1px solid #273241; }
.multi-control-brand strong { font-size: 18px; }
.multi-control-logo { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 7px; background: var(--blue); color: #fff; }
.multi-control-logo svg { width: 19px; height: 19px; }
.multi-control-heading { min-width: 0; display: flex; align-items: baseline; gap: 14px; }
.multi-control-heading h1 { margin: 0; font-size: 21px; letter-spacing: -.02em; }
.multi-control-heading p { margin: 0; color: #8794a7; font-size: 12px; }
.multi-control-actions { display: flex; gap: 9px; }
.multi-control-actions button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid #465366;
  border-radius: var(--radius-sm);
  background: #0d131d;
  color: var(--text);
  font: 750 12px/1 system-ui, sans-serif;
  cursor: pointer;
}
.multi-control-actions button:hover, .multi-control-actions button:focus-visible { border-color: var(--focus); background: #121b28; }
.multi-control-actions button:disabled { opacity: .42; cursor: default; }
.multi-control-actions button:disabled:hover { border-color: #465366; background: #0d131d; }
.multi-control-actions button:last-child svg { transform: rotate(180deg); }
.multi-control-actions svg { width: 17px; height: 17px; }
.multi-control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding-top: 18px;
}
.multi-control-grid[data-focus-device="zijian-new"] { grid-template-columns: minmax(0, 1fr) minmax(320px, .34fr); }
.multi-control-grid[data-focus-device="nucbox-m3plus"] { grid-template-columns: minmax(320px, .34fr) minmax(0, 1fr); }
.multi-control-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #344052;
  border-radius: 8px;
  background: #0b111a;
  transition: border-color 180ms ease, opacity 180ms ease;
}
.multi-control-panel.is-focused { border-color: var(--focus); }
.multi-control-panel.is-compact { opacity: .78; }
.multi-control-panel > header {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  border-bottom: 1px solid #2b3544;
}
.multi-control-panel.is-focused > header { background: #101c2b; border-bottom-color: #2f6fb4; }
.multi-control-panel > header > div { min-width: 0; display: flex; align-items: center; gap: 9px; }
.multi-control-panel > header i { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: var(--green); }
.multi-control-panel > header strong { overflow: hidden; font: 750 13px/1.2 Consolas, "SFMono-Regular", monospace; text-overflow: ellipsis; white-space: nowrap; }
.multi-control-panel > header span { padding: 4px 7px; border-radius: 4px; background: #142b4a; color: #7db8ff; font-size: 10px; font-weight: 750; }
.multi-control-panel > header .multi-control-panel-actions { flex: 0 0 auto; gap: 7px; }
.multi-control-focus {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid #3d4c61;
  border-radius: 4px;
  background: #0d131d;
  color: #aeb9c8;
  font: 750 10px/1 system-ui, sans-serif;
  cursor: pointer;
}
.multi-control-focus:hover, .multi-control-focus:focus-visible { border-color: var(--focus); color: #d9eaff; }
.multi-control-focus[aria-pressed="true"] { border-color: #2f79c8; background: #123057; color: #9dccff; cursor: default; }
.multi-control-panel > header a { color: var(--focus); font-size: 11px; font-weight: 750; text-decoration: none; white-space: nowrap; }
.multi-control-panel > header a:hover { text-decoration: underline; }
.multi-control-frame { height: calc(100dvh - 154px); min-height: 620px; background: #04070b; }
.multi-control-frame iframe { width: 100%; height: 100%; display: block; border: 0; background: #080d14; }
.multi-control-hint { margin: 12px 0 0; padding: 10px 12px; border: 1px solid #273241; color: #7f8b9c; font-size: 11px; }

.auth-screen { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; overflow-y: auto; padding: 20px; background: var(--shell); }
.auth-screen.is-hidden { display: none; }
.auth-panel { width: min(470px, 100%); padding: 38px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: 0 24px 70px rgba(0, 0, 0, .28); }
.auth-step[hidden] { display: none; }
.auth-mark { width: 52px; height: 52px; display: grid; place-items: center; color: var(--focus); border: 1px solid var(--blue); border-radius: var(--radius-md); }
.auth-mark svg { width: 28px; height: 28px; }
.auth-kicker { display: block; margin-top: 24px; color: var(--blue); font: 700 10px/1.2 Consolas, monospace; }
.auth-panel h1 { margin: 4px 0 12px; font-size: 30px; }
.auth-intro { margin: 0 0 24px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.device-list { display: grid; gap: 10px; }
.device-choice {
  width: 100%;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 74px;
  padding: 12px 14px;
  border: 1px solid #343b46;
  border-radius: var(--radius-md);
  background: #11151c;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}
.device-choice:hover, .device-choice:focus-visible { border-color: var(--blue); background: #141b25; }
.device-choice.is-current { border-color: var(--blue); }
.device-choice-multi { margin-top: 4px; border-color: #315f9d; background: #0e1928; }
.device-choice-multi .device-choice-icon { border-color: #315f9d; background: #102443; }
.device-choice-icon { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid #3b4655; border-radius: var(--radius-sm); color: var(--focus); }
.device-choice-icon svg { width: 22px; height: 22px; }
.device-choice-copy { min-width: 0; display: grid; gap: 4px; }
.device-choice-copy strong { overflow: hidden; text-overflow: ellipsis; font-size: 15px; }
.device-choice-copy small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; }
.device-choice-action { color: var(--focus); font-size: 12px; font-weight: 750; white-space: nowrap; }
.auth-selected-device {
  margin: 18px 0 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px 12px;
  padding: 11px 12px;
  border: 1px solid #343b46;
  border-radius: var(--radius-sm);
  background: #11151c;
}
.auth-selected-device span { grid-column: 1; color: var(--muted); font-size: 11px; }
.auth-selected-device strong { grid-column: 1; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.auth-selected-device button { grid-column: 2; grid-row: 1 / 3; border: 0; padding: 8px; background: transparent; color: var(--focus); font-size: 12px; font-weight: 750; cursor: pointer; }
.auth-panel label { display: block; margin-bottom: 8px; font-weight: 700; }
.auth-input-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.auth-input-row input { min-width: 0; height: 50px; border: 1px solid #404753; border-right: 0; border-radius: 4px 0 0 4px; padding: 0 12px; color: var(--text); background: #07090c; }
.auth-input-row button { height: 50px; border: 1px solid var(--blue); border-radius: 0 4px 4px 0; padding: 0 22px; background: var(--blue); color: #fff; font-weight: 750; cursor: pointer; }
.auth-error { min-height: 22px; margin: 10px 0 0; color: var(--red); font-size: 13px; }
.toast-region { display: grid; gap: 8px; pointer-events: none; }
.toast { max-width: 100%; padding: 12px 14px; border: 1px solid #3a424f; border-left: 3px solid var(--green); border-radius: var(--radius-sm); background: var(--panel-2); color: var(--text); font-size: 13px; animation: toast-in var(--dur-standard) var(--ease); }
.toast.is-error { border-left-color: var(--red); color: #ffd9d7; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.confirm-dialog {
  width: min(470px, calc(100% - 32px));
  padding: 0;
  border: 1px solid #343b46;
  border-radius: var(--radius-md);
  background: var(--panel);
  color: var(--text);
}
.confirm-dialog::backdrop { background: rgba(0, 0, 0, .76); }
.confirm-dialog[open] { animation: dialog-in 180ms var(--ease); }
.confirm-dialog form { padding: 28px; }
.confirm-dialog small { color: var(--red); font: 700 10px/1.2 Consolas, monospace; }
.confirm-dialog h2 { margin: 6px 0 8px; font-size: 24px; }
.confirm-dialog p { min-height: 42px; margin: 0; color: #aab4c2; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }
.danger-button {
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid var(--red);
  border-radius: var(--radius-sm);
  background: var(--red);
  color: #fff;
  font-weight: 750;
  cursor: pointer;
  box-shadow: var(--shadow-control);
}
.danger-button:hover { border-color: var(--red-hover); background: var(--red-hover); }
.danger-button:active { transform: scale(var(--press-scale)); }
.folder-browser-dialog {
  width: min(680px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid #343b46;
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
}
.folder-browser-dialog::backdrop { background: rgba(0, 0, 0, .76); }
.folder-browser-dialog[open] { animation: dialog-in 180ms var(--ease); }
.folder-browser-dialog form { display: grid; gap: 13px; padding: 24px; }
.folder-browser-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.folder-browser-dialog label { color: var(--muted-light); font-size: 12px; font-weight: 750; }
.folder-browser-list { min-height: 180px; max-height: 42vh; overflow: auto; border: 1px solid var(--line-light); border-radius: var(--radius-sm); background: #f8fafc; }
.folder-browser-item { width: 100%; min-height: 48px; display: flex; align-items: center; gap: 10px; border: 0; border-bottom: 1px solid var(--line-light); padding: 8px 12px; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.folder-browser-item:last-child { border-bottom: 0; }
.folder-browser-item:hover, .folder-browser-item:focus-visible { color: var(--blue); background: #fff; }
.folder-browser-item svg { width: 19px; height: 19px; flex: 0 0 auto; }
.folder-browser-item span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-browser-empty { padding: 26px 14px; color: var(--muted-light); text-align: center; }
.note-dialog {
  width: min(640px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid #343b46;
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
}
.note-dialog::backdrop { background: rgba(0, 0, 0, .76); }
.note-dialog[open] { animation: dialog-in 180ms var(--ease); }
.note-dialog form { display: grid; gap: 14px; padding: 26px; }
.note-dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.note-dialog-heading small { color: var(--blue); font: 700 10px/1.2 Consolas, monospace; }
.note-dialog-heading h2 { margin: 4px 0 0; font-size: 25px; }
.note-dialog-close { width: 44px; height: 44px; border: 1px solid var(--line-light); border-radius: var(--radius-sm); background: var(--surface); color: var(--muted-light); font-size: 24px; cursor: pointer; }
.note-dialog-close:hover { color: var(--blue); border-color: var(--blue); }
.note-dialog label:not(.note-pin-toggle) { display: grid; gap: 6px; color: var(--muted-light); font-size: 12px; font-weight: 750; }
.note-dialog input[type="text"] { min-height: 46px; border: 1px solid #b8c0cc; border-radius: var(--radius-sm); padding: 0 12px; color: var(--ink); background: var(--surface); }
.note-dialog textarea { min-height: 190px; max-height: 42vh; }
.note-pin-toggle { display: inline-flex; align-items: center; gap: 9px; width: fit-content; color: var(--ink); font-size: 13px; font-weight: 700; cursor: pointer; }
.note-pin-toggle input { width: 18px; height: 18px; accent-color: var(--blue); }
.note-dialog-help { margin: -2px 0 0; color: var(--muted-light); font-size: 12px; }
.note-dialog .dialog-actions { margin-top: 4px; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }

@media (max-width: 1280px) {
  .section-nav { padding: 0 16px; }
  .tool-button { min-height: 44px; padding: 0 9px; }
  .tool-button span { display: none; }
  #qualityToggle { min-width: 56px; }
  #qualityToggle span { display: inline; }
  .telemetry-bar { gap: 14px; }
}

@media (min-width: 1021px) and (max-width: 1280px) {
  .tab {
    min-width: 64px;
    flex-basis: 72px;
    flex-direction: column;
    gap: 2px;
    padding: 4px;
    font-size: 10px;
  }
  .tab svg { width: 17px; height: 17px; }
}

@media (min-width: 761px) and (max-width: 1020px) {
  .tab {
    min-width: 48px;
    flex-basis: 48px;
    padding: 5px 8px;
    gap: 0;
    font-size: 0;
  }
  .tab span { display: none; }
  .tab svg { width: 19px; height: 19px; }
}

@media (max-width: 760px) {
  .multi-control-view { padding: 0 10px 14px; }
  .multi-control-header {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: 58px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    background: #080d14;
  }
  .multi-control-brand { display: none; }
  .multi-control-heading { display: grid; gap: 2px; }
  .multi-control-heading h1 { font-size: 18px; }
  .multi-control-heading p { font-size: 10px; }
  .multi-control-actions { gap: 6px; }
  .multi-control-actions button { min-width: 42px; min-height: 42px; padding: 0 10px; }
  .multi-control-actions button:not(:last-child) span { display: none; }
  .multi-control-actions button:last-child span { font-size: 11px; }
  .multi-control-grid,
  .multi-control-grid[data-focus-device="zijian-new"],
  .multi-control-grid[data-focus-device="nucbox-m3plus"] { grid-template-columns: 1fr; gap: 14px; padding-top: 12px; }
  .multi-control-panel { scroll-margin-top: 68px; }
  .multi-control-panel.is-focused { order: 0; }
  .multi-control-panel.is-compact { order: 1; opacity: .72; }
  .multi-control-panel > header { min-height: 48px; padding: 0 11px; }
  .multi-control-frame { height: 72dvh; min-height: 560px; }
  .multi-control-panel.is-compact .multi-control-frame { height: 42dvh; min-height: 340px; }
  .multi-control-hint { margin-top: 10px; }
  .section-nav {
    min-height: 46px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding-left: max(14px, env(safe-area-inset-left));
    padding-right: max(14px, env(safe-area-inset-right));
  }
  .nav-status { gap: 5px; margin-left: 8px; }
  .connection-state { min-width: auto; padding: 5px 7px; font-size: 11px; }
  .connection-state span:last-child { display: none; }
  .current-device-control { gap: 4px; padding-left: 5px; }
  .current-device-label { display: none; }
  .current-device-control strong { max-width: 88px; font-size: 10px; }
  .switch-device-button { min-height: var(--control-md); padding: 0 8px; font-size: 10px; }
  .lan-accelerate-link { min-height: var(--control-md); padding: 0 8px; font-size: 10px; }
  .tabs { overflow-x: auto; scroll-padding-inline: 4px; scroll-snap-type: x proximity; }
  .tab { height: 46px; min-width: 48px; flex: 0 0 48px; padding: 5px 8px; flex-direction: row; scroll-snap-align: center; font-size: 0; gap: 0; }
  .tab span { display: none; }
  .tab.is-active { min-width: 82px; flex-basis: auto; gap: 5px; padding-inline: 10px; font-size: 10px; }
  .tab.is-active span { display: inline; }
  .tab svg { width: 18px; height: 18px; }
  .tab-settings { min-width: 0; }
  .assistant-card { padding: 16px; }
  .assistant-chat { min-height: 260px; max-height: 48vh; padding: 12px; }
  .assistant-message { max-width: 90%; }
  .assistant-actions { align-items: stretch; flex-wrap: wrap; }
  .assistant-actions > span { flex-basis: 100%; order: 3; }
  .top-notice-region { top: 58px; right: 12px; width: calc(100% - 24px); }
  .remote-layout { min-height: 0; display: block; }
  .remote-main { border: 0; }
  .screen-panel { padding: 6px; }
  .screen-stage { min-height: 0; display: flex; flex-direction: column; }
  .screen-toolbar { min-height: 48px; flex-flow: row nowrap; overflow-x: auto; border: 0; border-bottom: 1px solid var(--line); }
  .tool-button { min-width: 44px; min-height: 48px; flex: 0 0 44px; gap: 4px; border: 0; border-right: 1px solid var(--line); padding: 0 4px; }
  .privacy-clear-button { min-width: 78px; flex-basis: 78px; }
  .tool-button.is-active { box-shadow: inset 0 3px 0 var(--green); }
  .tool-button span { display: none; }
  .privacy-clear-button span { display: inline; }
  .screen-frame { max-height: none; }
  .screen-pointer-actions { order: 0; width: auto; min-height: 48px; flex: 0 0 auto; justify-content: flex-start; gap: 5px; margin-left: 0; padding: 4px 6px; border-right: 1px solid var(--line); border-left: 0; }
  .screen-shortcut-actions { min-height: 48px; flex: 0 0 auto; border-left: 0; border-right: 1px solid var(--line); }
  .screen-switch-actions { min-height: 48px; flex: 0 0 auto; border-left: 0; border-right: 1px solid var(--line); }
  .screen-shortcut-actions button { min-height: 44px; }
  .screen-switch-actions button { width: 44px; min-width: 44px; height: 44px; }
  .screen-action-button { min-height: 44px; padding: 0 8px; }
  .live-label { left: 7px; bottom: 7px; padding: 4px 7px; font-size: 9px; }
  .keyboard-label { right: 7px; bottom: 7px; max-width: 52%; padding: 4px 7px; font-size: 9px; text-align: right; }
  .input-confirmation { bottom: 38px; max-width: calc(100% - 14px); min-height: 28px; padding: 4px 8px; font-size: 9px; }
  .session-health-pill { top: 7px; left: 7px; max-width: calc(100% - 76px); min-height: 44px; padding: 4px 8px; }
  .session-health-pill small { max-width: 150px; }
  .session-health-panel { top: 6px; left: 6px; width: calc(100% - 12px); max-height: calc(100% - 12px); padding: 11px; }
  .session-health-metrics { gap: 5px; margin: 9px 0 8px; }
  .session-health-metrics > span { padding: 6px 7px; }
  .session-health-panel footer { align-items: stretch; flex-direction: column; }
  .session-health-panel footer small { max-width: none; text-align: left; }
  .control-bar { display: flex; flex-direction: column; align-items: stretch; min-height: 0; padding: 12px; gap: 10px; }
  .text-command { width: 100%; }
  .key-actions { display: grid; grid-template-columns: repeat(3, 1fr); }
  .key-actions button { min-width: 0; }
  .switch-mode-panel { grid-template-columns: 1fr; padding: 10px 12px; }
  .switch-mode-keys { align-items: stretch; flex-direction: column; gap: 8px; }
  .switch-key-group { width: 100%; }
  .telemetry-bar { min-height: 42px; padding: 8px 12px; flex-wrap: wrap; overflow: visible; }
  .telemetry-bar span { white-space: normal; }
  .telemetry-bar span:first-child { display: none; }
  .command-rail { border-top: 1px solid var(--line); padding: 22px 16px 36px; }
  .status-section { display: none; }
  .rail-section + .rail-section { border: 0; margin: 0; padding: 0; }
  .content-view { width: calc(100% - 30px); min-height: calc(100vh - 120px); padding: 28px 0 54px; }
  .page-heading h1 { font-size: 26px; }
  .action-list { grid-template-columns: 1fr; }
  .guardian-metrics, .guardian-actions { grid-template-columns: 1fr; }
  .guardian-metrics > div { border-right: 0; }
  .guardian-metrics > div:nth-last-child(-n+3) { border-bottom: 1px solid #202630; }
  .guardian-metrics > div:last-child { border-bottom: 0; }
  .guardian-plan { grid-template-columns: 1fr; }
  .guardian-plan button { width: 100%; }
  .action-item:nth-child(odd) { border-right: 0; }
  .remote-command-grid { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(70px, 1fr); overflow-x: auto; }
  .toolbar-row, .file-actions, .notes-toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-row > *, .file-actions > *, .notes-toolbar > * { width: 100%; }
  .folder-sync-card { padding: 16px; }
  .folder-sync-heading { align-items: stretch; flex-direction: column; gap: 9px; }
  .folder-sync-mode { align-self: flex-start; }
  .folder-sync-route { grid-template-columns: 1fr; }
  .folder-sync-arrow { transform: rotate(90deg); text-align: center; line-height: 1; }
  .folder-sync-actions { display: grid; grid-template-columns: 1fr; }
  .folder-sync-actions > button { width: 100%; }
  .folder-sync-diff-heading { flex-direction: column; }
  .folder-sync-diff-heading > span { text-align: left; }
  .folder-sync-diff-row > div { align-items: flex-start; flex-direction: column; gap: 3px; }
  .folder-browser-dialog form { padding: 20px 16px; }
  .folder-browser-dialog .dialog-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .folder-browser-dialog .dialog-actions > * { width: 100%; }
  .app-download-summary { grid-template-columns: 1fr 1fr; }
  .app-download-summary > div:nth-child(2) { border-right: 0; }
  .app-download-summary > div:nth-child(-n + 2) { border-bottom: 1px solid var(--line-light); }
  .app-download-toolbar { grid-template-columns: 1fr; align-items: stretch; }
  .app-download-toolbar > * { width: 100%; }
  .project-update-section { padding: 16px; }
  .project-update-summary { grid-template-columns: 1fr; }
  .project-update-summary > div { border-right: 0; border-bottom: 1px solid #ece3a8; }
  .project-update-summary > div:last-child { border-bottom: 0; }
  .project-update-toolbar { display: grid; grid-template-columns: 1fr; }
  .project-update-toolbar > * { width: 100%; }
  .catalog-filter-label select { width: 100%; }
  .app-artifact-section, .app-catalog-section { padding: 16px; }
  .file-actions .upload-button { justify-content: center; }
  .system-grid, .form-grid { grid-template-columns: 1fr; }
  .note-grid { grid-template-columns: 1fr; }
  .notes-summary { align-items: flex-start; flex-direction: column; gap: 3px; }
  .notes-summary small { text-align: left; }
  .review-summary-grid { grid-template-columns: 1fr 1fr; }
  .review-summary-grid > div { border-bottom: 1px solid var(--line-light); }
  .review-summary-grid > div:nth-child(2n) { border-right: 0; }
  .review-summary-grid > div:nth-last-child(-n + 2) { border-bottom: 0; }
  .review-view { min-height: calc(100dvh - 46px); }
  .review-view-toolbar { align-items: stretch; flex-direction: column; padding: 10px 12px; }
  .review-view-toolbar .inline-actions { width: 100%; }
  .review-view-toolbar .inline-actions > * { flex: 1 1 0; }
  .review-frame { height: calc(100dvh - 148px); min-height: 640px; }
  .control-card { padding: 18px 15px; }
  .credential-row { grid-template-columns: 1fr auto; }
  .credential-row code { grid-column: 1 / -1; grid-row: 2; }
  .managed-row { align-items: stretch; grid-template-columns: 1fr; }
  .managed-row button, .managed-row > a { width: 100%; }
  .file-row { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
  .file-meta { grid-column: 1; grid-row: 2; padding-bottom: 10px; overflow: hidden; text-overflow: ellipsis; }
  .file-download { grid-column: 2; grid-row: 1 / 3; }
  .settings-list > div { grid-template-columns: 100px minmax(0, 1fr); }
  .auth-panel { padding: 28px 22px; }
  .device-choice { min-height: 72px; }
  .note-dialog form { padding: 20px 16px; }
  .note-dialog .dialog-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .note-dialog .dialog-actions > * { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .multi-control-grid,
  .multi-control-panel { transition: none; }
}

@media (max-width: 960px) and (max-height: 500px) and (orientation: landscape) {
  .screen-stage { width: 100%; }
}

@media (max-width: 390px) {
  .tab { min-width: 44px; flex-basis: 44px; }
  .tab span { font-size: 9px; }
  .tool-button { font-size: 10px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .auth-input-row { grid-template-columns: 1fr; }
  .auth-input-row input { border-right: 1px solid #404753; border-radius: 4px 4px 0 0; }
  .auth-input-row button { border-radius: 0 0 4px 4px; }
  .network-banner { align-items: stretch; flex-direction: column; }
  .network-banner button { width: 100%; }
  .file-name { white-space: normal; overflow-wrap: anywhere; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}

@media (forced-colors: active) {
  button, input, textarea, .tab, .control-card, .managed-row, .file-row, .note-card, .note-state { border-color: CanvasText; }
  .tab.is-active, button:focus-visible, input:focus-visible, textarea:focus-visible, .screen-frame:focus-visible { outline: 2px solid Highlight; }
  .status-dot, .live-label span, .telemetry-bar i, .network-banner i, .session-health-pill i, .input-confirmation i { background: Highlight; forced-color-adjust: none; }
  .remote-pointer::before { background: CanvasText; forced-color-adjust: none; }
}
