:root {
  color-scheme: light;
  --shell: #f5f5f7;
  --panel: #ffffff;
  --panel-2: #f5f5f7;
  --surface: #ffffff;
  --surface-soft: #f5f5f7;
  --ink: #1d1d1f;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --muted-light: #6e6e73;
  --line: #d2d2d7;
  --line-light: #e5e5ea;
  --blue: #0066cc;
  --blue-hover: #005bb5;
  --blue-pressed: #004e9d;
  --blue-soft: #edf5ff;
  --focus: #0066cc;
  --green: #5bbfa8;
  --green-strong: #167c68;
  --green-soft: #ebfbf7;
  --red: #c43c50;
  --red-hover: #a92f42;
  --red-soft: #fff0f3;
  --yellow: #d6a647;
  --warning-strong: #8a5f12;
  --warning-soft: #fff8e9;
  --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: 10px;
  --radius-md: 16px;
  --radius-lg: 18px;
  --radius-pill: 999px;
  --shadow-xs: 0 1px 3px rgba(0, 0, 0, .035);
  --shadow-control: 0 1px 2px rgba(0, 0, 0, .06);
  --shadow-soft: 0 4px 16px rgba(0, 0, 0, .05);
  --button-secondary-bg: #ffffff;
  --button-secondary-bg-hover: #f5f5f7;
  --button-secondary-border: #d2d2d7;
  --button-secondary-text: var(--ink);
  --button-disabled-bg: #f5f5f7;
  --button-disabled-border: #e5e5ea;
  --button-disabled-text: #86868b;
  --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: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", "PingFang SC", "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(--ink);
  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, select { 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, select {
  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, select: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: var(--green-strong) !important; border-color: #16a34a !important; background-color: #f0fdf4 !important; }
button.is-error { color: var(--red-hover) !important; border-color: var(--red) !important; background-color: #fef2f2 !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,
.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: rgba(255, 255, 255, .78);
  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;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  touch-action: pan-y pinch-zoom;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs.is-dragging { scroll-snap-type: none; cursor: grabbing; user-select: 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: 13px;
  font-weight: 600;
  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: var(--blue-soft); }
.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: var(--green-soft);
  color: var(--green-strong);
  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: var(--red-soft); color: var(--red-hover); }
.connection-state.is-loading { background: var(--warning-soft); color: var(--warning-strong); }
.connection-state.is-degraded { background: #fff7ed; color: #c2410c; }
.lan-accelerate-link {
  min-height: var(--control-md);
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border: 1px solid rgba(91, 191, 168, .32);
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-strong);
  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: var(--green); background: #d8f6ef; color: var(--green-strong); }
.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: var(--control-md);
  padding: 0 9px;
  border: 1px solid rgba(93, 173, 238, .34);
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue-hover);
  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: #d7ecfb; color: var(--blue-pressed); }
.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: transparent;
}
.remote-main { min-width: 0; display: flex; flex-direction: column; }
.screen-panel { flex: 1 1 auto; min-height: 0; padding: 10px 4px 4px; background: transparent; }
.screen-stage {
  position: relative;
  width: min(calc(100% - 24px), calc((100dvh - 70px) * 16 / 9));
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin: 0 auto;
  background: transparent;
}
.screen-control-dock {
  width: 100%;
  min-width: 0;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(94, 151, 192, .2);
  border-top: 0;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  background: rgba(255, 255, 255, .92);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.screen-control-dock-summary {
  min-width: 0;
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
}
.screen-toolbar {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  display: none;
  align-items: stretch;
  flex-flow: row nowrap;
  overflow-x: auto;
  border: 0;
  border-top: 1px solid var(--line-light);
  background: rgba(248, 252, 255, .96);
}
.screen-stage.controls-open .screen-toolbar {
  display: flex;
}
.screen-control-float {
  position: static;
  flex: 0 0 auto;
  width: 56px;
  height: 44px;
  user-select: none;
}
.screen-control-orb {
  width: 56px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(94, 151, 192, .2);
  border-radius: var(--radius-sm);
  background: var(--blue);
  color: #fff;
  box-shadow: var(--shadow-control);
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 2px;
  cursor: pointer;
  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: rgba(93, 173, 238, .4); }
.screen-control-orb:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.screen-stage.controls-open .screen-control-orb {
  border-color: rgba(91, 191, 168, .52);
  box-shadow: var(--shadow-control), 0 0 0 4px rgba(91, 191, 168, .2);
}
.tool-button {
  min-height: 44px;
  padding: 0 9px;
  border: 0;
  border-right: 1px solid var(--line-light);
  background: transparent;
  color: var(--muted-light);
  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: var(--blue-soft); }
.tool-button.is-active { color: var(--green-strong); background: var(--green-soft); box-shadow: inset 0 3px 0 var(--green); }
.tool-button:active svg { transform: scale(.98); }
.tool-button svg { transition: transform 120ms var(--ease); }
.screen-frame {
  position: relative;
  width: 100%;
  flex: 0 0 auto;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  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-stage:fullscreen .screen-frame,
.screen-stage:fullscreen .screen-control-dock { border-inline: 0; border-radius: 0; }
.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-light);
  background: transparent;
}
.screen-shortcut-actions {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 6px;
  border-left: 1px solid var(--line-light);
  background: transparent;
}
.screen-shortcut-actions button {
  min-height: 32px;
  padding: 0 9px;
  border: 1px solid rgba(94, 151, 192, .24);
  border-radius: 5px;
  background: rgba(255, 255, 255, .78);
  color: var(--ink);
  font: 750 10px/1 Consolas, monospace;
  cursor: pointer;
}
.screen-shortcut-actions button:hover,
.screen-shortcut-actions button:focus-visible {
  border-color: var(--blue);
  background: var(--blue-soft);
}
.screen-switch-actions {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  border-left: 1px solid var(--line-light);
  background: transparent;
}
.screen-switch-actions[hidden] { display: none; }
.screen-switch-actions button {
  width: 32px;
  min-width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(91, 191, 168, .36);
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green-strong);
  font: 800 12px/1 Consolas, monospace;
  cursor: pointer;
}
.screen-switch-actions button:hover,
.screen-switch-actions button:focus-visible {
  border-color: var(--green);
  background: #d8f6ef;
}
.screen-action-button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid rgba(94, 151, 192, .24);
  border-radius: 5px;
  background: rgba(255, 255, 255, .78);
  color: var(--ink);
  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: var(--blue-soft); }
.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: var(--ink);
  background: #e7f2f8;
  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-light); 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: 12px;
  background: rgba(255, 255, 255, .82);
  color: var(--blue);
  font-weight: 700;
  cursor: pointer;
}
.screen-retry:hover { background: var(--blue-soft); }
.live-label {
  position: static;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  color: var(--green-strong);
  background: var(--green-soft);
  border: 1px solid rgba(91, 191, 168, .3);
  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 0 4px rgba(91, 191, 168, .18); }
.live-label strong { font: inherit; }
.keyboard-label {
  position: static;
  min-width: 0;
  padding: 6px 9px;
  color: var(--muted-light);
  background: rgba(255, 255, 255, .82);
  border: 1px solid rgba(94, 151, 192, .2);
  border-radius: 3px;
  font: 700 11px/1.2 Consolas, monospace;
  overflow: hidden;
  pointer-events: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.screen-frame:focus-within + .screen-control-dock .keyboard-label { color: var(--blue-hover); border-color: var(--blue); background: #eef8ff; }

.screen-outside-status {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  overflow: hidden;
}

.input-confirmation {
  position: static;
  max-width: min(280px, 45%);
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border: 1px solid rgba(94, 151, 192, .24);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, .92);
  color: var(--blue-hover);
  box-shadow: var(--shadow-xs);
  font: 750 10px/1.2 Consolas, monospace;
  pointer-events: none;
}
.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-float {
  position: static;
  width: max-content;
  max-width: min(320px, 45%);
  flex: 0 1 auto;
  display: flex;
  align-items: flex-start;
  gap: 4px;
}
.session-health-float[hidden] { display: none; }
.session-health-pill {
  min-width: 0;
  max-width: min(260px, calc(100% - 48px));
  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(91, 191, 168, .26);
  border-radius: 999px;
  background: rgba(255, 255, 255, .94);
  color: var(--green-strong);
  box-shadow: var(--shadow-xs);
  text-align: left;
  cursor: pointer;
  transition: opacity 120ms var(--ease), border-color 120ms var(--ease), background-color 120ms var(--ease);
}
.session-health-dismiss {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  padding: 0;
  border: 1px solid rgba(94, 151, 192, .2);
  border-radius: 999px;
  background: rgba(255, 255, 255, .9);
  color: var(--muted-light);
  box-shadow: var(--shadow-xs);
  font: 800 18px/1 Consolas, monospace;
  cursor: pointer;
}
.session-health-dismiss:hover,
.session-health-dismiss:focus-visible { border-color: rgba(223, 91, 106, .4); color: var(--red-hover); background: var(--red-soft); }
.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: var(--muted-light);
  font: 700 9px/1.15 Consolas, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.session-health-pill.is-fair { border-color: rgba(214, 166, 71, .4); color: var(--warning-strong); }
.session-health-pill.is-fair i,
.session-health-pill.is-recovering i { background: var(--yellow); }
.session-health-pill.is-poor,
.session-health-pill.is-offline { border-color: rgba(223, 91, 106, .4); color: var(--red-hover); }
.session-health-pill.is-poor i,
.session-health-pill.is-offline i { background: var(--red); }
.session-health-pill.is-checking i { background: #60a5fa; }
.session-health-pill:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.session-health-panel {
  position: static;
  width: 100%;
  max-height: min(420px, 45dvh);
  overflow: auto;
  padding: 14px;
  border: 0;
  border-top: 1px solid var(--line-light);
  border-radius: 0;
  background: rgba(248, 252, 255, .97);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
}
.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: var(--blue); 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 rgba(94, 151, 192, .24);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .84);
  color: var(--blue-hover);
  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 rgba(94, 151, 192, .18);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .88);
}
.session-health-metrics small { color: var(--muted-light); font: 700 9px/1.1 Consolas, monospace; }
.session-health-metrics strong { overflow: hidden; color: var(--ink); 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 var(--blue);
  background: #eef8ff;
  color: var(--muted-light);
  font-size: 11px;
  line-height: 1.45;
}
.session-health-panel footer { align-items: flex-start; }
.session-health-panel footer small { max-width: 210px; color: var(--muted-light); font-size: 9px; line-height: 1.4; text-align: right; }
.session-health-panel button:hover { border-color: var(--blue); background: var(--blue-soft); }
.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-light);
  background: rgba(255, 255, 255, .88);
  box-shadow: var(--shadow-xs);
}
.key-actions, .inline-actions { display: flex; gap: 8px; }
.text-command {
  height: 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  border: 1px solid rgba(94, 151, 192, .24);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: rgba(255, 255, 255, .84);
}
.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(--ink); background: transparent; outline: 0; }
.text-command input::placeholder { color: var(--muted-light); }
.text-command button { border: 0; border-left: 1px solid rgba(94, 151, 192, .2); background: transparent; color: var(--blue); display: grid; place-items: center; cursor: pointer; }
.text-command button:hover { background: var(--blue-soft); }
.key-actions button, .secondary-button, .primary-button {
  min-height: 48px;
  border: 1px solid var(--button-secondary-border);
  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: rgba(255, 255, 255, .82); }
.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-light);
  background: rgba(255, 255, 255, .82);
}
.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 rgba(94, 151, 192, .24);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .86);
  color: var(--ink);
  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: #eff7fd;
  color: var(--muted-light);
  font: 800 11px/1 Consolas, monospace;
  text-align: center;
}
.switch-mode-toggle[aria-pressed="true"] { border-color: var(--green); background: var(--green-soft); }
.switch-mode-toggle[aria-pressed="true"] b { background: #cdeee5; color: var(--green-strong); }
.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 rgba(91, 191, 168, .34);
  border-radius: 50%;
  background: rgba(255, 255, 255, .86);
  color: var(--green-strong);
  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: var(--green); background: var(--green-soft); }
.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: var(--ink); font-weight: 700; }

.command-rail { padding: 24px 20px; background: rgba(255, 255, 255, .88); }
.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: var(--blue-soft); }
.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: 32px 0 64px; 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: 0; font-size: 28px; font-weight: 650; line-height: 1.3; letter-spacing: -.02em; }
.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-width: 0;
  min-height: 80px;
  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: 24px; height: 24px; flex-shrink: 0; }
.action-item span { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.action-item strong { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.action-item small { color: var(--muted-light); font-size: 13px; overflow-wrap: anywhere; }
.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); }
.cloud-clipboard-card {
  margin: 0 0 22px;
  padding: 20px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}
.cloud-clipboard-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.cloud-clipboard-heading h2 { margin: 0; font-size: 22px; }
.cloud-clipboard-heading p { margin: 8px 0 0; color: var(--muted-light); font-size: 13px; line-height: 1.6; }
.app-shell:has(#view-clipboard.is-active) .section-nav { background: var(--surface); }
#view-clipboard .page-heading { padding-bottom: 14px; margin-bottom: 16px; }
#view-clipboard .page-heading p { margin: 6px 0 0; color: var(--muted-light); line-height: 1.5; }
.cloud-clipboard-heading .field-label { margin: 24px 0 8px; }
.cloud-clipboard-list { display: grid; gap: 12px; margin-top: 16px; }
.cloud-clipboard-empty { margin: 0; padding: 16px; border-radius: var(--radius-sm); background: var(--surface-soft); color: var(--muted-light); }
.cloud-clipboard-item { padding: 14px; border: 1px solid var(--line-light); border-radius: var(--radius-sm); }
.cloud-clipboard-item header { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted-light); font-size: 12px; }
.cloud-clipboard-item pre { max-height: 224px; margin: 12px 0 0; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; line-height: 1.55; }
.current-clipboard-state { margin-top: 14px; color: var(--muted-light); font-size: 12px; }
.current-clipboard-preview { min-width: 0; margin-top: 10px; }
.current-clipboard-result { min-width: 0; padding: 14px; border: 1px solid var(--line-light); border-radius: var(--radius-sm); background: var(--surface-soft); }
.current-clipboard-result header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.current-clipboard-result header span { color: var(--muted-light); font-size: 12px; }
.current-clipboard-result pre { max-height: 224px; margin: 12px 0 0; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; line-height: 1.55; }
.current-clipboard-image { display: block; max-width: 100%; max-height: 300px; margin: 12px auto 0; border-radius: 6px; object-fit: contain; }
.current-clipboard-files { max-height: 224px; margin: 12px 0 0; padding-left: 20px; overflow: auto; overflow-wrap: anywhere; }
.current-clipboard-card #refreshCurrentClipboard { min-height: 44px; }
.sticky-notes-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.sticky-notes-section .notes-toolbar { justify-content: space-between; }
.sticky-notes-section .notes-toolbar > span, .cloud-clipboard-card .notes-toolbar > span { color: var(--muted-light); font-size: 12px; white-space: nowrap; }
.sticky-note-images { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 12px; }
.sticky-note-image { min-width: 0; padding: 7px; border: 1px solid var(--line-light); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); text-align: left; cursor: pointer; }
.sticky-note-image[hidden] { display: none; }
.sticky-note-image:only-child { grid-column: 1 / -1; }
.sticky-note-image:hover { border-color: var(--blue); background: var(--blue-soft); }
.sticky-note-image:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.sticky-note-image-frame { display: grid; place-items: center; width: 100%; aspect-ratio: 4 / 3; max-height: 170px; overflow: hidden; border-radius: 6px; background: #f1f5f9; }
.sticky-note-image-preview { display: block; width: 100%; height: 100%; object-fit: contain; }
.sticky-note-image-preview[hidden], .sticky-note-image-status[hidden] { display: none; }
.sticky-note-image-status { padding: 10px; color: var(--muted-light); font-size: 12px; text-align: center; }
.sticky-note-image-caption { display: block; overflow: hidden; padding: 7px 2px 1px; color: var(--muted-light); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.sticky-note-image-more { grid-column: 1 / -1; min-height: 44px; border: 1px dashed #b8c0cc; border-radius: var(--radius-sm); background: var(--surface-soft); color: var(--blue); font-weight: 700; cursor: pointer; }
.sticky-note-image-more:hover { border-color: var(--blue); background: var(--blue-soft); }
.sticky-note-image-more:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.sticky-image-dialog { width: min(960px, calc(100% - 24px)); max-height: calc(100dvh - 24px); border: 1px solid var(--line-light); border-radius: var(--radius-md); padding: 16px; background: var(--surface); color: var(--ink); }
.sticky-image-dialog::backdrop { background: rgba(12, 22, 35, .8); }
.sticky-image-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.sticky-image-heading strong { min-width: 0; overflow-wrap: anywhere; }
.sticky-image-dialog img { display: block; max-width: 100%; max-height: calc(100dvh - 120px); margin: auto; object-fit: contain; }
.file-clipboard-card {
  margin: 0 0 22px;
  padding: 20px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}
.file-clipboard-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.file-clipboard-heading small { color: var(--blue); font: 700 10px/1.2 Consolas, monospace; letter-spacing: .08em; }
.file-clipboard-heading h2 { margin: 4px 0 0; font-size: 22px; }
.file-clipboard-mode { padding: 6px 9px; border: 1px solid #cbd5e1; border-radius: 999px; color: #475569; background: #f8fafc; font-size: 11px; font-weight: 750; white-space: nowrap; }
.file-clipboard-mode.is-connected { border-color: #86efac; color: #15803d; background: #f0fdf4; }
.file-clipboard-card > p { margin: 14px 0 0; color: var(--muted-light); font-size: 13px; line-height: 1.65; }
.file-clipboard-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 15px; }
.file-clipboard-actions > button { min-height: 46px; }
.file-clipboard-status { display: grid; gap: 4px; margin-top: 14px; padding: 13px 14px; border-left: 3px solid var(--blue); background: rgba(255, 255, 255, .88); color: var(--muted-light); }
.file-clipboard-status strong { color: var(--ink); }
.file-clipboard-status.is-error { border-left-color: var(--red); background: #fef2f2; }
.file-clipboard-status.is-success { border-left-color: #16a34a; background: #f0fdf4; }
.folder-sync-card {
  margin: 0 0 24px;
  padding: 20px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}
#view-file-search.content-view { width: min(1360px, calc(100% - 40px)); contain: style; }
.file-desktop-heading { margin-bottom: 14px; }
.file-desktop-shell { overflow: hidden; border: 1px solid var(--line-light); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-soft); }
.file-desktop-locations { margin: 0; padding: 12px 18px; border-bottom: 1px solid var(--line-light); }
.file-desktop-locations.folder-sync-location-options > div { display: flex; flex-wrap: wrap; gap: 7px; }
.file-desktop-locations button { min-height: 36px; width: auto; padding: 0 13px; }
.file-desktop-locations button[aria-pressed="true"] { border-color: var(--blue); color: var(--blue-hover); background: var(--blue-soft); }
.file-desktop-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 1.2fr); align-items: center; gap: 18px; padding: 14px 18px; border-bottom: 1px solid var(--line-light); }
.file-desktop-navigation { display: flex; align-items: center; min-width: 0; gap: 9px; }
.file-desktop-up { min-width: 38px; min-height: 38px; padding: 0; font-size: 19px; }
.file-desktop-breadcrumbs { display: flex; align-items: center; min-width: 0; overflow-x: auto; scrollbar-width: thin; white-space: nowrap; }
.file-desktop-breadcrumbs button { flex: none; min-height: 36px; border: 0; padding: 0 5px; background: transparent; color: var(--blue-hover); font-size: 13px; font-weight: 700; cursor: pointer; }
.file-desktop-breadcrumbs button:last-child { color: var(--ink); }
.file-desktop-breadcrumbs button:not(:last-child)::after { content: "›"; padding-left: 10px; color: var(--muted-light); }
.file-search-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.file-desktop-path-row, .file-search-query-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
.file-desktop-path-row input, .file-search-query-row input { min-width: 0; min-height: 40px; padding: 0 10px; border: 1px solid #aebdd3; border-radius: var(--radius-sm); background: #fff; color: var(--ink); font-size: 12px; }
.file-desktop-path-row button, .file-search-query-row button { min-height: 40px; padding: 0 12px; }
.file-desktop-statusbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px; min-height: 42px; padding: 8px 18px; border-bottom: 1px solid var(--line-light); background: #f8fafc; }
.file-search-status { color: var(--muted-light); font-size: 12px; line-height: 1.5; }
.file-search-summary { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted-light); font-size: 11px; }
.file-search-summary[hidden] { display: none; }
.file-search-summary strong { color: var(--ink); }
.file-search-kinds { flex-basis: 100%; margin: 0; font-size: 11px; }
.file-desktop-workspace { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 440px; }
.file-desktop-workspace:has(.file-preview-panel:not([hidden])) { grid-template-columns: minmax(0, 1fr) 320px; }
.file-search-results { min-width: 0; padding: 18px; }
.file-desktop-results-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.file-desktop-results-heading h2 { margin: 0; font-size: 15px; }
.file-desktop-results-heading button { min-height: 34px; padding: 0 12px; font-size: 12px; }
.file-search-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); align-content: start; gap: 10px; }
.file-search-item { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; min-width: 0; min-height: 122px; gap: 4px; padding: 12px 6px 9px; border: 1px solid transparent; border-radius: 11px; background: transparent; color: var(--ink); text-align: center; cursor: pointer; }
.file-search-item:hover, .file-search-item:focus-visible { border-color: #c7ddfb; background: #f3f8ff; }
.file-search-item[aria-selected="true"] { border-color: var(--blue); background: var(--blue-soft); }
.file-search-item svg { display: block; width: 48px; height: 48px; margin-bottom: 3px; stroke: none; }
.file-search-item strong { display: -webkit-box; max-width: 100%; overflow: hidden; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: 12px; line-height: 1.3; font-weight: 650; }
.file-search-item small { max-width: 100%; overflow: hidden; color: var(--muted-light); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.file-search-empty { grid-column: 1 / -1; padding: 34px 8px; color: var(--muted-light); text-align: center; font-size: 13px; }
.file-preview-panel { min-width: 0; padding: 17px; border-left: 1px solid var(--line-light); background: #fbfcfe; }
.file-preview-panel[hidden], .file-preview-scrim[hidden] { display: none; }
.file-preview-heading { display: flex; align-items: start; justify-content: space-between; gap: 8px; }
.file-preview-heading span { color: var(--blue); font-size: 10px; font-weight: 800; }
.file-preview-heading h2 { margin: 4px 0 0; overflow-wrap: anywhere; font-size: 16px; line-height: 1.35; }
.file-preview-heading button { flex: none; width: 32px; height: 32px; border: 0; border-radius: 8px; background: #e8eef7; color: var(--ink); font-size: 23px; cursor: pointer; }
.file-preview-content { display: grid; place-items: center; min-height: 190px; margin: 17px 0; overflow: auto; border: 1px solid var(--line-light); border-radius: 10px; background: #fff; color: var(--muted-light); font-size: 12px; text-align: center; }
.file-preview-content img, .file-preview-content video, .file-preview-content iframe { width: 100%; max-height: 340px; object-fit: contain; border: 0; }
.file-preview-content audio { width: calc(100% - 14px); }
.file-preview-content pre { width: 100%; max-height: 340px; margin: 0; overflow: auto; padding: 12px; color: var(--ink); text-align: left; white-space: pre-wrap; overflow-wrap: anywhere; font: 11px/1.5 Consolas, monospace; }
.file-preview-meta { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 9px; margin: 0 0 18px; font-size: 11px; }
.file-preview-meta dt { color: var(--muted-light); }
.file-preview-meta dd { min-width: 0; margin: 0; overflow-wrap: anywhere; color: var(--ink); }
.file-preview-download { display: flex; align-items: center; justify-content: center; min-height: 42px; text-decoration: none; }
.file-preview-scrim { display: none; }
.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 rgba(93, 173, 238, .34); border-radius: 999px; color: var(--blue-hover); background: var(--blue-soft); 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 var(--line-light); border-radius: var(--radius-sm); background: var(--surface-soft); }
.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 rgba(93, 173, 238, .28); border-radius: 11px; background: var(--blue-soft); }
.folder-sync-destination span { color: var(--muted-light); font-size: 10px; font-weight: 750; }
.folder-sync-destination strong { overflow-wrap: anywhere; color: var(--blue-hover); 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; overflow: hidden; border: 1px solid #aebdd3; border-radius: var(--radius-sm); padding: 0 11px; background: #fff; color: var(--ink); font: 13px/1.2 Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.folder-sync-path-row input:focus { text-overflow: clip; }
.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: var(--blue-soft); }
.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 rgba(93, 173, 238, .28); border-radius: 999px; background: var(--blue-soft); color: var(--blue-hover); 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: var(--blue); }
.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; }
.empty-row { padding: 36px 0; color: var(--muted-light); text-align: center; }
.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: rgba(94, 151, 192, .35) 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: rgba(94, 151, 192, .35); }
.remote-command-grid button {
  min-height: var(--control-md);
  border: 0;
  background: var(--panel);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.remote-command-grid button:hover { color: var(--blue); background: var(--blue-soft); }
.action-groups { display: grid; gap: 20px; 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: 12px 18px;
  border-bottom: 1px solid var(--line-light);
  background: var(--surface);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}
.action-group .action-list { border-bottom: 0; }
.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 { 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; }
.software-center-intro { max-width: 760px; margin: -7px 0 24px; color: var(--muted-light); line-height: 1.65; }
.software-mode-tabs {
  display: flex;
  gap: 30px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line-light);
}
.software-mode-tab {
  min-height: 48px;
  padding: 0 10px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted-light);
  font-size: 15px;
  font-weight: 750;
  cursor: pointer;
}
.software-mode-tab:hover { color: var(--blue); }
.software-mode-tab.is-active { color: var(--blue); border-bottom-color: var(--blue); }
.software-panel { min-width: 0; }
.software-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(138px, .42fr) minmax(166px, .52fr) auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.software-filter { min-width: 0; }
.software-filter select {
  width: 100%;
  min-height: 48px;
  border: 1px solid #b8c0cc;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  padding: 0 34px 0 12px;
  cursor: pointer;
}
.software-summary {
  min-height: 52px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  margin-bottom: 12px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}
.software-summary > span { padding: 0 18px; border-right: 1px solid var(--line-light); color: var(--muted-light); }
.software-summary > span:last-child { border-right: 0; }
.software-summary strong { color: var(--blue); font-size: 18px; }
.software-summary .is-ready strong { color: var(--green-strong); }
.software-summary .is-pending strong { color: var(--warning-strong); }
.software-catalog-notice {
  margin: 0 0 12px;
  padding: 10px 13px;
  border-left: 3px solid var(--blue);
  background: var(--blue-soft);
  color: var(--muted-light);
  font-size: 12px;
}
.software-catalog-notice.is-error { border-left-color: var(--red); background: var(--red-soft); color: var(--red-hover); }
.software-table {
  overflow: hidden;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}
.software-table-head,
.software-row {
  display: grid;
  grid-template-columns: minmax(260px, 2fr) 88px 112px 112px 108px minmax(174px, auto);
  align-items: center;
  gap: 12px;
}
.software-table-head {
  min-height: 43px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line-light);
  background: var(--surface-soft);
  color: var(--muted-light);
  font-size: 11px;
  font-weight: 750;
}
.software-item { border-bottom: 1px solid var(--line-light); content-visibility: auto; contain-intrinsic-size: auto 70px; }
.software-item:last-child { border-bottom: 0; }
.software-row { min-height: 68px; padding: 9px 16px; }
.software-cell { min-width: 0; color: var(--muted-light); font-size: 12px; overflow-wrap: anywhere; }
.software-app-cell { display: flex; align-items: center; gap: 11px; color: var(--ink); }
.software-app-cell > span:last-child { min-width: 0; display: grid; gap: 2px; }
.software-app-cell strong { color: var(--ink); font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.software-app-cell small { color: var(--muted-light); font-size: 10px; overflow-wrap: anywhere; }
.software-app-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid #bfdbfe;
  border-radius: 9px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: -.02em;
}
.software-platform { color: var(--ink); font-weight: 700; }
.software-status { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; }
.software-status i { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: #94a3b8; }
.software-status.is-ready { color: var(--green-strong); }
.software-status.is-ready i { background: #22c55e; }
.software-status.is-pending { color: var(--warning-strong); }
.software-status.is-pending i { background: #f59e0b; }
.software-status.is-blocked,
.software-status.is-unavailable { color: var(--red-hover); }
.software-status.is-blocked i,
.software-status.is-unavailable i { background: var(--red); }
.software-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.software-download { min-width: 120px; min-height: 44px; padding-inline: 12px; text-decoration: none; }
.software-detail-toggle {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid #b8c0cc;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted-light);
  cursor: pointer;
}
.software-detail-toggle:hover { color: var(--blue); border-color: var(--blue); background: var(--blue-soft); }
.software-detail-toggle svg { width: 17px; height: 17px; transition: transform var(--dur-fast) var(--ease); }
.software-detail-toggle[aria-expanded="true"] svg { transform: rotate(90deg); }
.software-details { padding: 0 16px 12px; }
.software-details dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 24px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #dbe6f5;
  border-radius: var(--radius-sm);
  background: #f8fbff;
}
.software-details dl > div { min-width: 0; display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 8px; }
.software-details dt { color: var(--muted-light); font-size: 11px; font-weight: 750; }
.software-details dd { min-width: 0; margin: 0; color: var(--ink); font-size: 11px; overflow-wrap: anywhere; }
.software-hash { font-family: Consolas, "SFMono-Regular", monospace; }
.software-list-state { min-height: 180px; display: grid; place-items: center; align-content: center; gap: 14px; padding: 28px; color: var(--muted-light); text-align: center; }
.local-software-toolbar { margin-top: 0; }
.local-software-list { margin-top: 0; }
.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: var(--blue-soft); }
.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; flex-wrap: wrap; 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, .action-item { content-visibility: auto; contain-intrinsic-size: auto 72px; }
.list-state { padding: 36px 20px; color: var(--muted-light); text-align: center; line-height: 1.65; overflow-wrap: anywhere; }
.primary-button[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.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%; }
.framefound-view, .framefound-frame { background: #f4f2ec; }
.framefound-frame { height: calc(100vh - 50px); min-height: 640px; }
.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: rgba(255, 255, 255, .88); }
.guardian-metrics > div { min-width: 0; padding: 17px 18px; border-right: 1px solid var(--line-light); border-bottom: 1px solid var(--line-light); }
.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: var(--muted-light); font-size: 11px; }
.guardian-metrics strong { display: block; margin: 7px 0 5px; color: var(--ink); 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 rgba(223, 91, 106, .28);
  border-left: 3px solid var(--red);
  border-radius: 16px;
  background: var(--red-soft);
  color: var(--ink);
  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: var(--muted-light); white-space: normal; }
.network-banner button { flex: 0 0 auto; min-height: 44px; padding: 0 12px; border: 1px solid rgba(223, 91, 106, .28); border-radius: var(--radius-sm); background: rgba(255, 255, 255, .82); color: var(--red-hover); font-weight: 700; cursor: pointer; pointer-events: auto; }

.multi-control-view {
  min-height: 100dvh;
  padding: 0 20px 18px;
  background: var(--shell);
  color: var(--ink);
}
.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 var(--line-light);
}
.multi-control-brand { display: inline-flex; align-items: center; gap: 10px; padding-right: 20px; border-right: 1px solid var(--line-light); }
.multi-control-brand strong { font-size: 18px; }
.multi-control-logo { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: var(--blue); color: #fff; box-shadow: var(--shadow-control); }
.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: var(--muted-light); 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 rgba(94, 151, 192, .24);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .86);
  color: var(--ink);
  font: 750 12px/1 system-ui, sans-serif;
  cursor: pointer;
}
.multi-control-actions button:hover, .multi-control-actions button:focus-visible { border-color: var(--blue); background: var(--blue-soft); }
.multi-control-actions button:disabled { opacity: .42; cursor: default; }
.multi-control-actions button:disabled:hover { border-color: rgba(94, 151, 192, .24); background: rgba(255, 255, 255, .86); }
.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 rgba(94, 151, 192, .2);
  border-radius: 18px;
  background: rgba(255, 255, 255, .9);
  box-shadow: var(--shadow-soft);
  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 var(--line-light);
}
.multi-control-panel.is-focused > header { background: #eef8ff; border-bottom-color: rgba(93, 173, 238, .38); }
.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: 999px; background: #eaf6ff; color: var(--blue); 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 rgba(94, 151, 192, .24);
  border-radius: 10px;
  background: rgba(255, 255, 255, .84);
  color: var(--muted-light);
  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: var(--blue); background: var(--blue-soft); color: var(--blue-hover); 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: #eef6fb; }
.multi-control-frame iframe { width: 100%; height: 100%; display: block; border: 0; background: #eef6fb; }
.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: rgba(241, 248, 252, .96); }
.auth-screen.is-hidden { display: none; }
.auth-panel { position: relative; width: min(470px, 100%); padding: 38px; background: rgba(255, 255, 255, .92); border: 1px solid rgba(94, 151, 192, .18); border-radius: var(--radius-lg); box-shadow: var(--shadow-soft); }
.auth-close {
  position: absolute;
  top: 16px;
  right: 16px;
  min-width: 52px;
  min-height: 44px;
  border: 1px solid rgba(94, 151, 192, .2);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .9);
  color: var(--muted);
  font-weight: 750;
  cursor: pointer;
}
.auth-close[hidden] { display: none; }
.auth-close:hover, .auth-close:focus-visible { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); }
.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-light); 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 rgba(94, 151, 192, .2);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, .84);
  color: var(--ink);
  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: var(--blue-soft); }
.device-choice.is-current { border-color: var(--blue); }
.device-choice-multi { margin-top: 4px; border-color: rgba(93, 173, 238, .34); background: #eef8ff; }
.device-choice-multi .device-choice-icon { border-color: rgba(93, 173, 238, .3); background: rgba(255, 255, 255, .82); }
.device-choice-icon { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid rgba(94, 151, 192, .18); border-radius: var(--radius-sm); color: var(--blue); }
.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-light); 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 rgba(94, 151, 192, .18);
  border-radius: var(--radius-sm);
  background: rgba(248, 252, 255, .88);
}
.auth-selected-device span { grid-column: 1; color: var(--muted-light); 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 rgba(94, 151, 192, .22); border-right: 0; border-radius: 14px 0 0 14px; padding: 0 12px; color: var(--ink); background: rgba(255, 255, 255, .88); }
.auth-input-row button { height: 50px; border: 1px solid var(--blue); border-radius: 0 14px 14px 0; padding: 0 22px; background: var(--blue); color: #fff; font-weight: 750; cursor: pointer; box-shadow: var(--shadow-control); }
.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 rgba(94, 151, 192, .18); border-left: 3px solid var(--green); border-radius: var(--radius-sm); background: rgba(255, 255, 255, .92); color: var(--ink); font-size: 13px; animation: toast-in var(--dur-standard) var(--ease); box-shadow: var(--shadow-soft); }
.toast.is-error { border-left-color: var(--red); color: var(--red-hover); background: var(--red-soft); }
@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 rgba(94, 151, 192, .18);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
}
.confirm-dialog::backdrop { background: rgba(20, 34, 49, .28); }
.confirm-dialog[open] { animation: dialog-in 180ms var(--ease); }
.confirm-dialog form { padding: 24px; }
.confirm-dialog small { color: var(--red); font: 700 10px/1.2 Consolas, monospace; }
.confirm-dialog h2 { margin: 0 0 12px; font-size: 22px; font-weight: 650; line-height: 1.4; overflow-wrap: anywhere; }
.confirm-dialog p { min-height: 42px; margin: 0; color: var(--muted-light); line-height: 1.65; overflow-wrap: anywhere; }
.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 rgba(94, 151, 192, .18);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}
.folder-browser-dialog::backdrop { background: rgba(20, 34, 49, .28); }
.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 rgba(94, 151, 192, .18);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}
.note-dialog::backdrop { background: rgba(20, 34, 49, .28); }
.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: 12px;
  }
  .tab svg { width: 17px; height: 17px; }
}

@media (min-width: 761px) and (max-width: 1020px) {
  .tab {
    min-width: 68px;
    flex-basis: 68px;
    padding: 5px 4px;
    flex-direction: column;
    gap: 3px;
    font-size: 12px;
  }
  .tab span { display: inline; }
  .tab svg { width: 19px; height: 19px; }
}

@media (max-width: 900px) {
  .software-toolbar { grid-template-columns: 1fr 1fr; }
  .software-search,
  .software-toolbar > .primary-button { grid-column: 1 / -1; }
  .software-table-head { display: none; }
  .software-row { grid-template-columns: 1fr 1fr; gap: 9px 14px; padding: 14px; }
  .software-app-cell { grid-column: 1 / -1; padding-bottom: 9px; border-bottom: 1px solid #edf1f6; }
  .software-cell:not(.software-app-cell):not(.software-actions) { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 8px; }
  .software-cell:not(.software-app-cell):not(.software-actions)::before { content: attr(data-label); color: var(--muted-light); font-size: 10px; font-weight: 750; }
  .software-status { display: grid; }
  .software-status i { display: none; }
  .software-actions { grid-column: 1 / -1; justify-content: stretch; padding-top: 4px; }
  .software-download { flex: 1 1 auto; }
  .software-details { padding: 0 14px 14px; }
}

@media (max-width: 820px) {
  .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, minmax(0, 1fr)); }
  .key-actions button { min-width: 0; }
}

@media (max-width: 760px) {
  #view-file-search.content-view { width: calc(100% - 20px); }
  .file-desktop-heading > span { display: none; }
  .file-desktop-locations { padding: 10px; }
  .file-desktop-locations.folder-sync-location-options > div { flex-wrap: nowrap; overflow-x: auto; }
  .file-desktop-locations button { flex: none; }
  .file-desktop-toolbar { grid-template-columns: 1fr; gap: 9px; padding: 10px; }
  .file-search-form { grid-template-columns: 1fr; }
  .file-desktop-statusbar { padding: 8px 10px; }
  .file-desktop-workspace { min-height: 400px; }
  .file-desktop-workspace:has(.file-preview-panel:not([hidden])) { grid-template-columns: minmax(0, 1fr); }
  .file-search-results { padding: 10px; }
  .file-search-grid { grid-template-columns: repeat(auto-fill, minmax(94px, 1fr)); gap: 5px; }
  .file-search-item { min-height: 112px; }
  .file-preview-scrim:not([hidden]) { position: fixed; inset: 0; z-index: 109; display: block; background: rgba(15, 23, 42, .42); }
  .file-preview-panel:not([hidden]) { position: fixed; inset: auto 0 0; z-index: 110; max-height: 82dvh; overflow-y: auto; border: 1px solid var(--line-light); border-radius: 18px 18px 0 0; box-shadow: 0 -12px 36px rgba(15, 23, 42, .2); }
  .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: rgba(255, 255, 255, .92);
  }
  .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: 96px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 40px 56px;
    padding-left: max(10px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
  }
  .nav-status { grid-row: 1; gap: 8px; margin-left: 0; justify-content: flex-end; }
  .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: 120px; font-size: 12px; }
  .switch-device-button { min-height: 36px; padding: 0 10px; font-size: 12px; }
  .lan-accelerate-link { min-height: var(--control-md); padding: 0 8px; font-size: 10px; }
  .tabs { grid-row: 2; overflow-x: auto; scroll-padding-inline: 4px; scroll-snap-type: x proximity; }
  .tab, .tab.is-active { height: 56px; min-width: 60px; flex: 1 0 60px; padding: 6px 4px; flex-direction: column; scroll-snap-align: center; font-size: 12px; gap: 5px; }
  .tab span, .tab.is-active span { display: inline; }
  .tab svg { width: 20px; height: 20px; }
  .tab-settings { min-width: 0; }
  .top-notice-region { top: 106px; right: 12px; width: calc(100% - 24px); }
  .remote-layout { min-height: 0; display: block; }
  .remote-main { border: 0; }
  .screen-panel { padding: 6px; }
  .screen-stage { width: min(calc(100% - 24px), calc((100dvh - 112px) * 16 / 9)); min-height: 0; display: flex; flex-direction: column; }
  .screen-control-dock-summary { min-height: 52px; gap: 5px; padding: 4px; }
  .screen-toolbar { min-height: 48px; flex-flow: row nowrap; overflow-x: auto; border: 0; border-top: 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; }
  .tool-button.is-active { box-shadow: inset 0 3px 0 var(--green); }
  .tool-button span { display: none; }
  .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-width: 44px; 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 { padding: 4px 7px; font-size: 9px; }
  .keyboard-label { max-width: 52%; padding: 4px 7px; font-size: 9px; text-align: right; }
  .input-confirmation { max-width: 48%; min-height: 28px; padding: 4px 8px; font-size: 9px; }
  .session-health-float { max-width: 45%; }
  .session-health-pill { max-width: calc(100% - 48px); min-height: 44px; padding: 4px 8px; }
  .session-health-pill small { max-width: 150px; }
  .session-health-panel { width: 100%; max-height: min(360px, 45dvh); 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: 22px 0 40px; }
  .content-view input, .content-view textarea, .content-view select, .auth-input-row input, .folder-browser-toolbar input { font-size: 16px; }
  .page-heading h1 { font-size: 26px; }
  .action-list { grid-template-columns: minmax(0, 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, .notes-toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-row > *, .notes-toolbar > * { width: 100%; }
  .software-mode-tabs { gap: 18px; }
  .software-mode-tab { flex: 1 1 0; }
  .software-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .software-search,
  .software-toolbar > .primary-button { grid-column: 1 / -1; }
  .software-summary { min-height: 60px; }
  .software-summary > span { padding: 0 8px; font-size: 10px; text-align: center; }
  .software-summary strong { display: block; font-size: 17px; }
  .software-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; padding: 12px 14px; }
  .software-app-cell { padding-bottom: 7px; }
  .software-cell:not(.software-app-cell):not(.software-actions) {
    min-height: 30px;
    align-content: start;
    grid-template-columns: minmax(0, 1fr);
    gap: 3px;
    line-height: 1.25;
  }
  .software-actions { grid-column: 1 / -1; padding-top: 2px; }
  .software-details dl { grid-template-columns: 1fr; }
  .software-details dl > div { grid-template-columns: 82px minmax(0, 1fr); }
  .file-clipboard-card, .folder-sync-card { padding: 16px; }
  .cloud-clipboard-card { padding: 16px; }
  .cloud-clipboard-heading { align-items: flex-start; flex-direction: column; }
  #view-clipboard .page-heading { align-items: flex-start; flex-direction: column; gap: 6px; padding-bottom: 12px; margin-bottom: 14px; }
  #view-clipboard .notes-toolbar { margin: 12px 0 8px; }
  #view-clipboard .note-tag-filters { padding-bottom: 8px; }
  .sticky-notes-actions { width: 100%; }
  .sticky-notes-actions > button { flex: 1 1 120px; }
  .file-clipboard-heading { align-items: stretch; flex-direction: column; gap: 9px; }
  .file-clipboard-mode { align-self: flex-start; }
  .file-clipboard-actions { display: grid; grid-template-columns: 1fr; }
  .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%; }
  .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; }
  .framefound-frame { height: calc(100dvh - 46px); min-height: 560px; }
  .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%; }
  .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 { max-width: calc(100% - 24px); }
}

@media (max-width: 390px) {
  .tool-button { font-size: 10px; }
  .screen-control-dock-summary { flex-wrap: wrap; }
  .session-health-float { max-width: calc(100% - 61px); }
  .screen-outside-status { flex-basis: 100%; justify-content: flex-start; }
  .keyboard-label { flex: 1 1 auto; max-width: none; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .auth-input-row { grid-template-columns: 1fr; }
  .auth-input-row input { border-right: 1px solid rgba(94, 151, 192, .22); border-radius: 14px 14px 0 0; }
  .auth-input-row button { border-radius: 0 0 14px 14px; }
  .network-banner { align-items: stretch; flex-direction: column; }
  .network-banner button { width: 100%; }
}

@media (max-width: 360px) {
  .tab, .tab.is-active { min-width: 48px; flex-basis: 48px; padding-inline: 2px; font-size: 11px; }
}

@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, .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; }
}

/* Keep long native select labels readable on the smallest supported phones. */
@media (max-width: 359px) {
  .software-toolbar { grid-template-columns: minmax(0, 1fr); }
}

/* Private archive and inbox keep their own origins and use the available viewport. */
.app-shell:has(:is(#view-archives, #view-mail).is-active:not([hidden])) { display: grid; grid-template-rows: auto minmax(0, 1fr); height: 100dvh; min-height: 0; }
.app-shell > main:has(:is(#view-archives, #view-mail).is-active:not([hidden])) { min-height: 0; overflow: hidden; }
#view-archives, #view-mail { width: 100%; height: 100%; min-height: 0; margin: 0; padding: 0; }
.archive-card { display: flex; flex-direction: column; height: 100%; min-height: 0; margin: 0; padding: 0; overflow: hidden; border: 0; border-radius: 0; }
.archive-toolbar { flex: 0 0 auto; padding: 6px 16px; margin: 0; gap: 12px; }
.archive-toolbar h1 { margin: 0; font-size: 17px; line-height: 1.4; }
.archive-toolbar button { flex-shrink: 0; min-height: 44px; }
.archive-origin-hint { margin: 0; padding: 16px; line-height: 1.7; }
.archive-frame { display: block; flex: 1 1 0; width: 100%; height: 0; min-height: 0; border: 0; border-top: 1px solid var(--line); background: #fff; }
.archive-frame[hidden] { display: none; }
