:root {
  font-family:
    Inter,
    "Segoe UI",
    "Microsoft YaHei UI",
    system-ui,
    -apple-system,
    sans-serif;
  color: #172033;
  background: #f7f9fc;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --ink: #172033;
  --muted: #727d90;
  --border: #dfe4eb;
  --surface: #ffffff;
  --accent: #3568e8;
  --accent-dark: #2856ca;
  --green: #14966b;
  --amber: #ca7a17;
  --app-background: #f7f9fc;
  --surface-soft: #f7f9fc;
  --surface-hover: #f2f6fc;
  --divider: #e8edf4;
  --control-border: #d5dde8;
  --text-strong: #263146;
  --text-body: #344057;
  --text-subtle: #8a95a7;
  --accent-soft: #edf3ff;
  --danger-soft: #fff2f3;
  --success-soft: #eaf8f2;
  --warning-soft: #fff5e7;
  --shadow-soft: 0 8px 26px rgba(30, 43, 67, 0.055);
  --toast-error-strong: #c83f3b;
  --toast-error-text: #a33a36;
  --toast-error-border: #edc4c0;
  --toast-error-bg: #fff1ef;
  --toast-success-text: #176b4d;
  --toast-success-border: #b8dfcf;
  --toast-success-bg: #edf9f4;
  --toast-info-text: #3159a4;
  --toast-info-border: #c5d3f1;
  --toast-info-bg: #f1f5ff;
}

:root[data-theme="dark"] {
  color: #e8edf5;
  background: #101214;
  --ink: #f1f5fb;
  --muted: #a0a9b6;
  --border: #343a42;
  --surface: #181b1f;
  --accent: #5594ff;
  --accent-dark: #78a9ff;
  --green: #49c894;
  --amber: #e7a64a;
  --app-background: #101214;
  --surface-soft: #202429;
  --surface-hover: #252a30;
  --divider: #2b3037;
  --control-border: #3a414a;
  --text-strong: #edf2fa;
  --text-body: #d4dbe5;
  --text-subtle: #929daa;
  --accent-soft: #1c2c47;
  --danger-soft: #352125;
  --success-soft: #193129;
  --warning-soft: #362b1b;
  --shadow-soft: 0 12px 30px rgba(0, 0, 0, 0.22);
  --toast-error-strong: #ff9298;
  --toast-error-text: #ffc2c5;
  --toast-error-border: #714349;
  --toast-error-bg: #342124;
  --toast-success-text: #8be0ba;
  --toast-success-border: #365d4d;
  --toast-success-bg: #193027;
  --toast-info-text: #a9c7ff;
  --toast-info-border: #3e5680;
  --toast-info-bg: #1d2940;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  width: 100%;
  min-width: 0;
  height: 100%;
  min-height: 0;
  margin: 0;
  overflow: hidden;
}

.pairing-document,
.pairing-document body,
.pairing-document #app {
  min-width: 0;
  min-height: 0;
}

.remote-document,
.remote-document body,
.remote-document #app {
  width: 100dvw;
  height: 100dvh;
  min-width: 0;
  min-height: 0;
  background: #070a0f;
}

.usage-log-document,
.usage-log-document body,
.usage-log-document #app {
  width: 100dvw;
  height: 100dvh;
  min-width: 0;
  min-height: 0;
  background: var(--app-background);
}

.usage-log-document .connection-records-view {
  width: 100%;
  height: 100%;
  padding: 0;
}

.usage-log-document .usage-log-backdrop {
  height: 100%;
}

.legal-terms-document,
.legal-terms-document body,
.legal-terms-document #app {
  width: 100dvw;
  height: 100dvh;
  min-width: 0;
  min-height: 0;
  background: var(--app-background);
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(53, 104, 232, 0.22);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.app-shell {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  height: 100%;
  background: var(--app-background);
  padding-top: env(safe-area-inset-top);
  -webkit-user-select: none;
  user-select: none;
}

.app-shell.mobile-app-shell {
  display: flex;
  flex-direction: column;
  touch-action: pan-x pan-y;
}

/* WKWebView builds that do not expose CSS env(safe-area-inset-*) still need
   a notch-sized top reservation on iOS. Android keeps its existing insets. */
.ios-runtime .app-shell.mobile-app-shell {
  padding-top: max(44px, env(safe-area-inset-top));
}

.mobile-app-shell .main-content {
  height: auto;
  min-height: 0;
  flex: 1 1 auto;
}

.mobile-tab-bar {
  display: none;
}

.sidebar {
  display: flex;
  flex-direction: column;
  padding: 26px 16px 20px;
  color: #5d6674;
  background: #f5f5f5;
  border-right: 1px solid #dedfe2;
}

.brand-block {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 0 8px 28px;
}

.brand-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 8px;
  overflow: hidden;
  background: #3568e8;
  box-shadow: 0 8px 18px rgba(23, 63, 166, 0.32);
}

.brand-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-block strong,
.brand-block small,
.sidebar-status strong,
.sidebar-status small {
  display: block;
}

.brand-block strong {
  overflow: hidden;
  color: #172033;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-block small {
  margin-top: 2px;
  color: #89919d;
  font-size: 12px;
  letter-spacing: 0.12em;
}

.primary-nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.primary-nav button {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  color: #525b68;
  border: 0;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  transition: 150ms ease;
}

.primary-nav button:hover {
  color: #1f2937;
  background: #ebebed;
}

.primary-nav button.active {
  color: #172033;
  background: #e4e5e9;
}

.primary-nav button.active svg {
  color: #3568e8;
}

.sidebar-status {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 17px 8px 2px;
  border-top: 1px solid #dedfe2;
}

.online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #31c48d;
  box-shadow: 0 0 0 4px rgba(49, 196, 141, 0.1);
}

.sidebar-status strong {
  overflow: hidden;
  color: #273247;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-status small {
  margin-top: 2px;
  color: #8a94a3;
  font-size: 12px;
}

.main-content {
  position: relative;
  height: 100%;
  overflow: auto;
}

.view {
  width: min(1080px, calc(100% - 64px));
  min-height: 100%;
  margin: 0 auto;
  padding: 34px 0 26px;
}

.devices-view {
  display: flex;
  width: calc(100% - clamp(32px, 5vw, 64px));
  height: 100%;
  flex-direction: column;
}

.copy-protected,
.copy-protected * {
  -webkit-user-select: none;
  user-select: none;
}

.view-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.section-label {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.13em;
}

.view-header h1 {
  margin: 0;
  color: var(--ink);
  font-size: 27px;
  line-height: 1.25;
}

.view-header p:not(.section-label) {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.primary-button {
  display: inline-flex;
  min-width: 112px;
  height: 38px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  color: #ffffff;
  border: 1px solid var(--accent-dark);
  border-radius: 7px;
  background: var(--accent);
  box-shadow: 0 6px 15px rgba(39, 80, 185, 0.18);
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
  transition: 150ms ease;
}

.primary-button:hover:not(:disabled) {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.primary-button:disabled {
  color: #98a5bc;
  border-color: #d6dce7;
  background: #e6eaf0;
  box-shadow: none;
  cursor: not-allowed;
}

.status-strip,
.transfer-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 7px 24px rgba(32, 44, 68, 0.045);
}

.status-strip.mobile-status-strip {
  grid-template-columns: 1fr;
}

.home-license-compact {
  display: grid;
  width: 132px;
  min-height: 42px;
  grid-template-columns: 28px minmax(0, 1fr) 14px;
  align-items: center;
  gap: 6px;
  padding: 5px 7px;
  color: inherit;
  font: inherit;
  text-align: left;
  border: 1px solid var(--toast-error-border);
  border-radius: 7px;
  background: var(--danger-soft);
  cursor: pointer;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.home-license-compact:hover {
  border-color: var(--toast-error-strong);
  box-shadow: 0 5px 14px rgba(163, 58, 54, 0.12);
}

.home-license-compact:focus-visible {
  outline: 3px solid rgba(200, 63, 59, 0.2);
  outline-offset: 2px;
}

.home-license-compact-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: var(--toast-error-strong);
  border-radius: 6px;
  background: var(--surface);
}

.home-license-compact-copy {
  min-width: 0;
}

.home-license-compact-copy strong,
.home-license-compact-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-license-compact-copy strong {
  color: var(--text-strong);
  font-size: 11px;
  line-height: 1.25;
}

.home-license-compact-copy small {
  margin-top: 2px;
  color: var(--toast-error-strong);
  font-size: 10px;
  line-height: 1.2;
}

.home-license-compact > svg {
  color: var(--toast-error-strong);
}

.home-license-notice {
  display: grid;
  width: 100%;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  padding: 10px 14px;
  color: inherit;
  font: inherit;
  text-align: left;
  border: 1px solid var(--toast-error-border);
  border-radius: 8px;
  background: var(--danger-soft);
  cursor: pointer;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    transform 150ms ease;
}

.home-license-notice:hover {
  border-color: var(--toast-error-strong);
  box-shadow: 0 6px 18px rgba(163, 58, 54, 0.1);
  transform: translateY(-1px);
}

.home-license-notice:focus-visible {
  outline: 3px solid rgba(200, 63, 59, 0.2);
  outline-offset: 2px;
}

.home-license-notice-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: var(--toast-error-strong);
  border-radius: 7px;
  background: var(--surface);
}

.home-license-notice-copy {
  min-width: 0;
}

.home-license-notice-copy strong,
.home-license-notice-copy small {
  display: block;
}

.home-license-notice-copy strong {
  color: var(--text-strong);
  font-size: 13px;
}

.home-license-notice-copy small {
  margin-top: 3px;
  color: var(--text-body);
  font-size: 12px;
}

.home-license-notice-action {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--toast-error-strong);
  font-size: 12px;
  font-weight: 650;
}

.status-strip > div,
.transfer-summary > div {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
  min-height: 72px;
  padding: 14px 18px;
  border-right: 1px solid #e8ebf0;
}

.status-strip > div:last-child,
.transfer-summary > div:last-child {
  border-right: 0;
}

.status-strip small,
.status-strip strong,
.transfer-summary small,
.transfer-summary strong {
  display: block;
}

.status-strip small,
.transfer-summary small {
  color: #8a94a5;
  font-size: 12px;
}

.status-strip strong,
.transfer-summary strong {
  margin-top: 3px;
  color: #273247;
  font-size: 14px;
}

.status-icon {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 7px;
}

.status-icon.blue {
  color: #3568e8;
  background: #edf2ff;
}

.status-icon.green {
  color: #12845f;
  background: #e9f8f2;
}

.status-icon.amber {
  color: #b66e14;
  background: #fff5e7;
}

.status-icon.red {
  color: #b04444;
  background: #fff0ee;
}

.local-device {
  display: block !important;
  padding-left: 20px !important;
}

.local-device strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.local-device-value,
.local-device-edit,
.local-password-value,
.local-password-edit {
  height: 25px;
}

.local-device-value,
.local-device-edit form,
.local-password-value,
.local-password-edit form {
  display: flex;
  align-items: center;
  gap: 7px;
}

.local-device-value .icon-button {
  width: 25px;
  height: 25px;
}

.local-device-edit form {
  height: 100%;
}

.local-device-edit input {
  width: min(260px, 28vw);
  height: 25px;
  padding: 0 8px;
  color: #283449;
  border: 1px solid #cfd8ec;
  border-radius: 6px;
  outline: 0;
  background: #ffffff;
  font-size: 12px;
}

.local-password {
  display: block !important;
  padding-left: 20px !important;
}

.local-password strong {
  color: #263f89;
  font-family: "Cascadia Mono", Consolas, monospace;
  letter-spacing: 0.08em;
}

.local-password span {
  display: block;
  margin-top: 3px;
  color: #9aa3b2;
  font-size: 12px;
}

.local-password-value .icon-button {
  width: 25px;
  height: 25px;
}

.local-password-edit form {
  height: 100%;
}

.local-password-edit input {
  width: min(220px, 22vw);
  height: 25px;
  padding: 0 8px;
  color: #283449;
  border: 1px solid #cfd8ec;
  border-radius: 6px;
  outline: 0;
  background: #ffffff;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
}

.device-id {
  display: block;
  margin-top: 3px;
  color: #9aa3b2;
  font-size: 12px;
  letter-spacing: 0.05em;
}

.discovery-error {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 9px;
  margin-bottom: 16px;
  padding: 0 14px;
  color: #94413f;
  border: 1px solid #efcac6;
  border-radius: 7px;
  background: #fff4f2;
  font-size: 12px;
}

.toggle {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 23px;
  flex: 0 0 auto;
}

.toggle input {
  width: 0;
  height: 0;
  opacity: 0;
}

.toggle > span {
  position: absolute;
  inset: 0;
  border-radius: 99px;
  background: #ced5df;
  cursor: pointer;
  transition: 160ms ease;
}

.toggle > span::before {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(32, 41, 57, 0.24);
  content: "";
  transition: 160ms ease;
}

.toggle input:checked + span {
  background: var(--accent);
}

.toggle input:checked + span::before {
  transform: translateX(19px);
}

.toggle.disabled {
  opacity: 0.55;
}

.toggle.disabled > span {
  cursor: not-allowed;
}

.device-list-panel,
.transfer-panel,
.settings-group {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 26px rgba(30, 43, 67, 0.045);
}

.device-list-panel {
  display: flex;
  min-height: 220px;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
}

.search-box input {
  min-width: 0;
  color: #2e394c;
  border: 1px solid #d5dce8;
  background: #ffffff;
}

.compact-primary {
  min-width: 58px;
  height: 32px;
  color: #ffffff;
  border: 1px solid #2c59cf;
  border-radius: 6px;
  background: var(--accent);
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
}

.compact-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.panel-heading {
  display: flex;
  min-height: 61px;
  align-items: center;
  justify-content: space-between;
  padding: 0 19px;
  border-bottom: 1px solid #e8ebf0;
}

.panel-heading h2,
.panel-heading span {
  display: inline;
}

.panel-heading h2 {
  margin: 0;
  color: #243047;
  font-size: 15px;
}

.panel-heading span {
  margin-left: 9px;
  color: #929bab;
  font-size: 12px;
}

.icon-button {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: #8994a7;
  border: 1px solid #e0e5ec;
  border-radius: 6px;
  background: #f8f9fb;
  cursor: pointer;
}

.icon-button:disabled {
  cursor: not-allowed;
}

.device-panel-heading {
  gap: 18px;
}

.device-tools {
  display: flex;
  align-items: center;
  gap: 7px;
}

.search-box {
  display: flex;
  width: 180px;
  height: 32px;
  align-items: center;
  gap: 7px;
  padding: 0 9px;
  color: #8b95a6;
  border: 1px solid #e0e5ec;
  border-radius: 6px;
  background: #f8f9fb;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 12px;
}

.connect-all-button {
  gap: 5px;
  padding: 0 9px;
  white-space: nowrap;
}

.device-rows {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
}

.device-entry {
  border-bottom: 1px solid #edf0f4;
}

.device-entry:last-child {
  border-bottom: 0;
}

.device-entry.offline {
  color: #9aa3b1;
  filter: grayscale(0.75);
  opacity: 0.62;
}

.device-entry.offline .device-row:hover {
  background: transparent;
}

.device-entry.mobile-online-device {
  color: var(--amber);
  filter: none;
  opacity: 1;
}

.device-entry.mobile-online-device .device-os {
  color: #b66e14;
  background: #fff5e7;
}

.device-entry.mobile-online-device .device-main strong {
  color: #8f5c11;
}

.device-entry.mobile-online-device .incoming-session-status {
  color: #a96810;
}

.device-entry.mobile-online-device .incoming-session-status small {
  color: #b18143;
}

.device-row {
  display: grid;
  grid-template-columns: 42px minmax(150px, 1fr) 94px 42px;
  min-height: 72px;
  align-items: center;
  gap: 11px;
  padding: 10px 18px;
}

.device-row:hover {
  background: #fafbfe;
}

.device-os {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #5270cc;
  border-radius: 7px;
  background: #eef2fd;
}

.device-main {
  min-width: 0;
}

.device-main > div {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
}

.device-main strong {
  overflow: hidden;
  color: #2d394e;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-main small {
  display: block;
}

.device-main small {
  overflow: hidden;
  margin-top: 4px;
  color: #8e98a9;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-badge {
  flex: 0 0 auto;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 650;
}

.source-badge {
  padding: 2px 6px;
  color: #3e7c68;
  background: #eaf7f2;
}

.outline-button {
  display: inline-flex;
  height: 28px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 9px;
  color: #4564c5;
  border: 1px solid #ccd6f0;
  border-radius: 6px;
  background: #f7f9ff;
  cursor: pointer;
  font-size: 12px;
}

.outline-button:disabled {
  color: #98a2b2;
  border-color: #dce1e9;
  background: #f7f8fa;
  cursor: not-allowed;
}

.device-actions {
  display: flex;
  min-width: 58px;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.device-actions .outline-button {
  min-width: 58px;
}

.device-delete-button {
  flex: 0 0 auto;
  color: #bd3f4a;
  border-color: #f0cbd0;
  background: #fff7f8;
}

.device-delete-button:hover:not(:disabled) {
  color: #a72f3b;
  border-color: #e7aeb6;
  background: #fff0f2;
}

.device-delete-button:disabled {
  cursor: wait;
}

.device-delete-confirmation-backdrop {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  padding: 18px;
  place-items: center;
  background: rgba(20, 25, 34, 0.58);
}

.device-delete-confirmation-dialog {
  width: min(100%, 360px);
  padding: 20px;
  color: #283449;
  border: 1px solid #dde2ea;
  border-radius: 7px;
  background: #ffffff;
  box-shadow: 0 18px 48px rgba(20, 29, 45, 0.24);
}

.device-delete-confirmation-icon {
  display: grid;
  width: 38px;
  height: 38px;
  margin-bottom: 13px;
  place-items: center;
  color: #b83945;
  border-radius: 7px;
  background: #fff0f2;
}

.device-delete-confirmation-dialog h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.device-delete-confirmation-dialog p {
  margin: 9px 0 20px;
  color: #697589;
  font-size: 12px;
  line-height: 1.6;
}

.device-delete-confirmation-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.device-delete-confirmation-actions button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #526078;
  border: 1px solid #d7dde7;
  border-radius: 6px;
  background: #ffffff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
}

.device-delete-confirmation-actions button:hover:not(:disabled) {
  border-color: #bcc5d3;
  background: #f7f8fa;
}

.device-delete-confirmation-actions .confirm-delete-button {
  color: #ffffff;
  border-color: #b83945;
  background: #b83945;
}

.device-delete-confirmation-actions
  .confirm-delete-button:hover:not(:disabled) {
  border-color: #a42f3a;
  background: #a42f3a;
}

.device-delete-confirmation-actions button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.incoming-session-status {
  display: grid;
  min-width: 130px;
  gap: 2px;
  color: #37634d;
  font-size: 12px;
  line-height: 1.25;
  text-align: right;
}

.incoming-session-status strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.incoming-session-status small {
  color: #6c8578;
  font-size: 12px;
}

.disconnect-session {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  color: #9c6840;
  border-color: #e5d2c0;
  background: #fffaf5;
}

.disconnect-session:hover {
  color: #84502c;
  border-color: #d9b89d;
  background: #fff4eb;
}

.pairing-window {
  display: grid;
  width: 100%;
  height: 100%;
  padding: calc(24px + env(safe-area-inset-top)) 24px
    calc(24px + env(safe-area-inset-bottom));
  place-items: center;
  background: #f4f6f9;
}

.pairing-window-card {
  width: min(100%, 360px);
  text-align: center;
}

.pairing-window-icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  place-items: center;
  color: #3568e8;
  border: 1px solid #d5def7;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(31, 55, 103, 0.1);
}

.pairing-window-kicker {
  margin: 0 0 4px;
  color: #3568e8;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.pairing-window-card h1 {
  margin: 0;
  overflow: hidden;
  color: #1e293b;
  font-size: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pairing-window-copy {
  margin: 7px 0 16px;
  color: #7b8798;
  font-size: 12px;
}

.pairing-window-card input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  color: #243451;
  border: 1px solid #cbd5e5;
  border-radius: 6px;
  outline: 0;
  background: #ffffff;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 14px;
  text-align: center;
}

.pairing-window-card input:focus {
  border-color: #6f8fe5;
  box-shadow: 0 0 0 3px rgba(53, 104, 232, 0.11);
}

.pairing-window-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.pairing-window-actions button {
  display: inline-flex;
  height: 36px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
}

.remote-control-window {
  display: grid;
  grid-template-rows: 42px minmax(0, 1fr);
  position: fixed;
  inset: 0;
  width: 100dvw;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  background: #070a0f;
}

.remote-session-header {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  user-select: none;
  padding: 0 8px;
  color: #eaf0fb;
  background: #171b22;
  border-bottom: 1px solid #2b303a;
}

.remote-mobile-back-button {
  display: none;
  width: 30px;
  height: 28px;
  flex: 0 0 30px;
  place-items: center;
  color: #b9c2d0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
}

.remote-mobile-back-button:hover {
  color: #ffffff;
  background: #2a303b;
}

.remote-tab-strip,
.remote-session-actions {
  display: flex;
  min-width: 0;
  align-items: center;
}

.remote-tab-strip {
  flex: 1;
  align-self: stretch;
  overflow: visible;
}

.remote-tabs {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  align-self: stretch;
  overflow: hidden;
}

.remote-tab-add {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  align-self: center;
  margin: 0 4px 0 1px;
  place-items: center;
  color: #8e98a9;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
}

.remote-tab-add:hover {
  color: #ffffff;
  border-color: #343d49;
  background: #2a313c;
}

.remote-tab-overflow {
  position: relative;
  flex: 0 0 28px;
}

.remote-tab-overflow-button {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: #a9b3c1;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
}

.remote-tab-overflow-button:hover,
.remote-tab-overflow-button[aria-expanded="true"] {
  color: #ffffff;
  border-color: #343d49;
  background: #2a313c;
}

.remote-tab-overflow-menu {
  position: absolute;
  z-index: 60;
  top: 34px;
  right: 0;
  width: 260px;
  max-height: min(420px, calc(100vh - 58px));
  overflow-y: auto;
  padding: 5px;
  border: 1px solid #343d49;
  border-radius: 5px;
  background: #1d232c;
  box-shadow: 0 12px 30px rgb(0 0 0 / 42%);
}

.remote-tab-overflow-menu > button {
  display: flex;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 8px;
  color: #cdd5e1;
  border: 0;
  border-radius: 3px;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.remote-tab-overflow-menu > button:hover {
  color: #ffffff;
  background: #2a313c;
}

.remote-tab-overflow-menu > button.active {
  color: #ffffff;
  background: #303845;
}

.remote-tab-overflow-menu > button > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.remote-tab-overflow-menu strong,
.remote-tab-overflow-menu small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remote-tab-overflow-menu strong {
  font-size: 12px;
}

.remote-tab-overflow-menu small {
  color: #8490a1;
  font-size: 12px;
}

.remote-tab-overflow-menu > button > small {
  flex: 0 0 64px;
  color: #72d69c;
  text-align: right;
}

.remote-tab-overflow-menu > button.failed,
.remote-tab-overflow-menu > button.failed > small {
  color: #ff8e94;
}

.remote-tab-overflow-menu > button.failed.active {
  color: #fff0f1;
  background: #4a2328;
}

.remote-tab {
  display: flex;
  width: 260px;
  min-width: 260px;
  max-width: 260px;
  flex: 0 0 260px;
  height: 33px;
  align-self: end;
  align-items: center;
  margin-right: 3px;
  padding-left: 9px;
  color: #8e98a9;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  background: transparent;
}

.remote-tab.active {
  color: #f2f5fb;
  border-color: #303744;
  background: #242a34;
}

.remote-tab.failed {
  color: #ff9ca1;
  border-color: rgb(214 91 98 / 48%);
  background: rgb(122 43 49 / 20%);
}

.remote-tab.failed.active {
  color: #fff0f1;
  border-color: #a94c53;
  background: #4a2328;
}

.remote-tab-select,
.remote-tab-status,
.remote-tab-close {
  display: flex;
  align-items: center;
  color: inherit;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.remote-tab-select {
  flex: 1;
  min-width: 0;
  gap: 7px;
  padding: 0;
}

.remote-tab-select svg {
  flex: 0 0 auto;
  color: #2dce89;
}

.remote-tab-device {
  display: grid;
  min-width: 0;
  flex: 1 1 auto;
  gap: 1px;
}

.remote-tab-device strong,
.remote-tab-device small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remote-tab-device strong {
  font-size: 12px;
  font-weight: 650;
}

.remote-tab-device small {
  color: #8490a1;
  font-size: 12px;
  font-weight: 500;
}

.remote-tab-network {
  display: inline-flex;
  width: 58px;
  min-width: 58px;
  max-width: 58px;
  flex: 0 0 58px;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 2px 5px;
  color: #72d69c;
  border-radius: 4px;
  background: rgb(45 206 137 / 10%);
  font-size: 12px;
  white-space: nowrap;
}

.remote-tab.failed .remote-tab-network {
  color: #ff9298;
  background: rgb(214 91 98 / 14%);
}

.remote-tab-select .remote-tab-network svg {
  color: inherit;
}

.remote-tab-terminal-state {
  display: inline-flex;
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  color: #70d58e;
}

.remote-tab-terminal-state.state-connected {
  color: #78c9e8;
}

.remote-tab-terminal-state.state-connecting {
  color: #d5b472;
}

.remote-tab-terminal-state.state-failed {
  color: #ef8585;
}

.remote-tab-terminal-state.state-missing {
  display: none;
}

.remote-tab-status,
.remote-tab-close {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  justify-content: center;
  border-radius: 4px;
}

.remote-tab-status {
  margin-left: 5px;
  color: #80b4ff;
}

.remote-tab-status.state-succeeded {
  color: #70d58e;
}

.remote-tab-status.state-failed,
.remote-tab-status.state-timed_out,
.remote-tab-status.state-disconnected {
  color: #ef8585;
}

.remote-tab-status.state-cancelled {
  color: #d5b472;
}

.remote-tab-status:hover {
  background: #343d49;
}

.remote-tab-close {
  margin-left: 2px;
}

.remote-tab-close:hover {
  color: #ffffff;
  background: #3a4250;
}

.remote-tab-drag-area {
  min-width: 32px;
  flex: 1;
  align-self: stretch;
  cursor: move;
}

.remote-session-actions {
  flex: 0 0 auto;
  gap: 3px;
}

.remote-session-actions button {
  display: grid;
  width: 30px;
  height: 28px;
  place-items: center;
  color: #b9c2d0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
}

.remote-session-actions button:hover {
  color: #ffffff;
  background: #2a303b;
}

.remote-session-actions .remote-close-button:hover {
  color: #ffffff;
  background: #c53e46;
}

.remote-session-actions .remote-tools-button {
  color: #93b8ff;
}

.remote-session-actions .remote-tools-button:hover {
  color: #ffffff;
  background: #31548d;
}

.remote-session-actions .remote-global-actions {
  display: flex;
  height: 30px;
  align-items: center;
  gap: 6px;
  margin: 0 3px;
}

.remote-global-actions .terminal-sync-toggle {
  color: #c2cad6;
}

.remote-session-actions .remote-global-action-button {
  width: 30px;
  height: 28px;
  color: #b9c2d0;
  border: 0;
  background: transparent;
}

.remote-session-actions .remote-global-action-button:hover:not(:disabled) {
  color: #ffffff;
  background: #2a303b;
}

.remote-session-actions .remote-global-action-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.remote-import-failure-notice {
  position: fixed;
  z-index: 40;
  top: 50px;
  left: 50%;
  display: flex;
  width: min(calc(100vw - 32px), 276px);
  min-height: 58px;
  align-items: stretch;
  transform: translateX(-50%);
  color: #ffe9e9;
  border: 1px solid #d65b62;
  border-radius: 5px;
  background: #4a1f24;
  box-shadow: 0 12px 30px rgb(0 0 0 / 38%);
}

.remote-import-failure-notice > button:first-child {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  color: inherit;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.remote-import-failure-notice > button:first-child:hover {
  background: rgb(255 255 255 / 8%);
}

.remote-import-failure-notice > button:first-child > svg {
  flex: 0 0 auto;
  color: #ff858b;
}

.remote-import-failure-notice strong,
.remote-import-failure-notice small {
  display: block;
}

.remote-import-failure-notice strong {
  font-size: 13px;
  font-weight: 650;
}

.remote-import-failure-notice small {
  margin-top: 2px;
  color: #ffc4c7;
  font-size: 12px;
}

.remote-import-failure-notice > button:last-child {
  display: grid;
  width: 34px;
  flex: 0 0 34px;
  place-items: center;
  color: #ffc4c7;
  border: 0;
  border-left: 1px solid rgb(255 183 186 / 24%);
  background: transparent;
  cursor: pointer;
}

.remote-import-failure-notice > button:last-child:hover {
  color: #ffffff;
  background: rgb(255 255 255 / 10%);
}

.remote-close-confirmation-backdrop {
  position: fixed;
  z-index: 60;
  inset: 0;
  display: grid;
  padding: 20px;
  place-items: center;
  background: rgba(2, 5, 4, 0.78);
}

.remote-close-confirmation-dialog {
  width: min(100%, 390px);
  padding: 18px;
  color: #e8f1e9;
  border: 1px solid #405246;
  border-radius: 6px;
  background: #151d17;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.52);
}

.remote-close-confirmation-dialog h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
}

.remote-close-confirmation-dialog p {
  margin: 9px 0 18px;
  color: #a7b8aa;
  font-size: 12px;
  line-height: 1.55;
}

.remote-import-failure-dialog {
  width: min(100%, 610px);
  max-height: min(680px, calc(100vh - 40px));
  padding: 18px;
  color: #e8f1e9;
  border: 1px solid #5b393d;
  border-radius: 6px;
  background: #171a1b;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.52);
}

.remote-import-failure-dialog > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.remote-import-failure-dialog > header > div {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ff8181;
}

.remote-import-failure-dialog h2 {
  margin: 0;
  color: #f1f5f3;
  font-size: 16px;
  font-weight: 650;
}

.remote-import-failure-dialog-heading p {
  margin: 3px 0 0;
  color: #ffaaa9;
  font-size: 12px;
}

.remote-import-failure-dialog-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.remote-import-failure-dialog-actions button {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: #aeb9b2;
  border: 1px solid #405246;
  border-radius: 4px;
  background: #202b23;
  cursor: pointer;
}

.remote-import-failure-dialog-actions button:hover:not(:disabled) {
  color: #ffffff;
  background: #303b33;
}

.remote-import-failure-dialog-actions button:first-child:hover:not(:disabled) {
  border-color: #b9575b;
  background: #6b3035;
}

.remote-import-failure-dialog > ul {
  display: grid;
  max-height: min(520px, calc(100vh - 160px));
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

.remote-import-failure-dialog > ul > li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid #3c4540;
  border-radius: 5px;
  background: #111614;
}

.remote-import-failure-dialog dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
  margin: 0;
}

.remote-import-failure-dialog dl > div {
  min-width: 0;
}

.remote-import-failure-dialog .remote-import-failure-reason {
  grid-column: 1 / -1;
}

.remote-import-failure-dialog dt {
  margin-bottom: 3px;
  color: #8e9b92;
  font-size: 12px;
}

.remote-import-failure-dialog dd {
  min-width: 0;
  margin: 0;
  color: #e0e8e2;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.45;
}

.remote-import-failure-dialog code {
  color: #ffd3a3;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
}

.remote-import-failure-dialog > ul > li > button {
  display: inline-flex;
  min-width: 88px;
  height: 31px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #dcf7e3;
  border: 1px solid #467d58;
  border-radius: 4px;
  background: #213a28;
  cursor: pointer;
  font-size: 12px;
}

.remote-import-failure-dialog > ul > li > button:hover:not(:disabled) {
  color: #ffffff;
  border-color: #70d58e;
  background: #2d5137;
}

.remote-import-failure-dialog button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.remote-close-confirmation-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.remote-close-confirmation-actions button {
  min-width: 76px;
  height: 30px;
  padding: 0 10px;
  color: #dce8df;
  border: 1px solid #405246;
  border-radius: 4px;
  background: #202b23;
  cursor: pointer;
}

.remote-close-confirmation-actions button:hover {
  border-color: #70d58e;
  background: #2c3d30;
}

.remote-close-confirmation-actions .remote-close-confirm-button {
  color: #092011;
  border-color: #70d58e;
  background: #70d58e;
}

.remote-close-confirmation-actions .remote-close-confirm-button:hover {
  background: #92e5aa;
}

.remote-session-actions .remote-emergency-button {
  color: #e89138;
}

.remote-session-actions .remote-emergency-button:hover {
  color: #ffffff;
  background: #b35a25;
}

.remote-terminal {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  position: fixed;
  inset: 42px 0 0;
  min-width: 0;
  min-height: 0;
  color: #d8e6d9;
  background: #0c0f0d;
  font-family: Consolas, "Cascadia Mono", monospace;
}

.remote-terminal.is-hidden {
  visibility: hidden;
  pointer-events: none;
}

.remote-peer-disconnected {
  display: grid;
  position: fixed;
  inset: 42px 0 0;
  min-width: 0;
  min-height: 0;
  place-items: center;
  color: #d8e6d9;
  background: #0c0f0d;
  font-family: Inter, sans-serif;
  font-size: 14px;
}

.remote-connection-failed {
  display: flex;
  position: fixed;
  inset: 42px 0 0;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 24px;
  color: #d8e6d9;
  background: #0c0f0d;
  font-family: Inter, sans-serif;
  text-align: center;
}

.remote-connection-failed > svg {
  color: #ef737b;
}

.remote-connection-failed > strong {
  color: #fff0f1;
  font-size: 18px;
  font-weight: 650;
}

.remote-connection-failed > span {
  color: #9ca7b5;
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 12px;
}

.remote-connection-failed > p {
  max-width: 560px;
  margin: 2px 0 6px;
  color: #d49599;
  font-size: 12px;
  line-height: 1.6;
}

.remote-connection-failed > button {
  display: inline-flex;
  min-width: 112px;
  height: 34px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #fff0f1;
  border: 1px solid #a34d54;
  border-radius: 4px;
  background: #642d33;
  cursor: pointer;
  font-size: 12px;
}

.remote-connection-failed > button:hover:not(:disabled) {
  background: #7a343b;
}

.remote-connection-failed > button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.remote-import-waiting {
  display: grid;
  min-width: 0;
  min-height: 0;
  place-content: center;
  justify-items: center;
  gap: 10px;
  color: #d8e6d9;
  background: #0c0f0d;
  font-family: Inter, sans-serif;
}

.remote-import-waiting > svg {
  color: #70d58e;
}

.remote-import-waiting > strong {
  font-size: 14px;
  font-weight: 650;
}

.remote-import-waiting > button {
  height: 30px;
  padding: 0 10px;
  color: #f0b1b1;
  border: 1px solid #714044;
  border-radius: 4px;
  background: #2b1719;
  cursor: pointer;
  font-size: 12px;
}

.remote-import-waiting > button:hover {
  color: #ffffff;
  border-color: #a95b60;
  background: #422124;
}

.remote-terminal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 10px 14px;
  border-color: #26342a;
  border-style: solid;
}

.remote-terminal-title {
  color: #d8e6d9;
  border-width: 0 0 1px;
  font-family: Inter, sans-serif;
  font-size: 12px;
}

.remote-terminal-title svg {
  flex: 0 0 auto;
  color: #70d58e;
}

.remote-terminal-title small {
  overflow: hidden;
  margin-left: auto;
  color: #8aa18e;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terminal-sync-toggle {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  color: #b8cdbd;
  font-size: 12px;
  white-space: nowrap;
}

.terminal-sync-toggle.disabled {
  opacity: 0.55;
}

.terminal-sync-switch {
  width: 34px;
  height: 19px;
}

.terminal-sync-switch > span {
  border: 1px solid #385141;
  background: #152019;
}

.terminal-sync-switch > span::before {
  top: 2px;
  left: 2px;
  width: 13px;
  height: 13px;
  background: #d8e6d9;
  box-shadow: none;
}

.terminal-sync-switch input:checked + span {
  border-color: #70d58e;
  background: #2f7241;
}

.terminal-sync-switch input:checked + span::before {
  transform: translateX(17px);
}

.terminal-upload-button {
  display: grid;
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  color: #9ecba9;
  border: 1px solid #385141;
  border-radius: 4px;
  background: #152019;
  cursor: pointer;
}

.terminal-upload-button:hover:not(:disabled) {
  color: #ffffff;
  border-color: #70d58e;
  background: #294630;
}

.terminal-upload-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.terminal-screen-button {
  color: #9abfff;
  border-color: #334b70;
  background: #131d2d;
}

.terminal-screen-button:hover:not(:disabled),
.terminal-screen-button.active {
  color: #ffffff;
  border-color: #6f9fe8;
  background: #27436e;
}

.remote-screen-workspace {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  position: fixed;
  inset: 42px 0 0;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  color: #dbe8f7;
  background: #0a0f17;
  font-family: Inter, sans-serif;
}

.remote-screen-workspace.has-screen-keyboard {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.remote-screen-workspace.is-hidden {
  visibility: hidden;
  pointer-events: none;
}

.remote-screen-workspace.touchpad-only,
.remote-screen-workspace.touchpad-only .remote-screen-canvas {
  background: #000;
}

.mobile-screen-tools-trigger {
  display: none;
}

@media (max-width: 700px), (pointer: coarse) {
  .remote-control-window.mobile-screen-mode {
    background: transparent;
  }

  .remote-control-window.mobile-screen-mode
    > *:not(.remote-screen-workspace):not(.remote-peer-disconnected) {
    display: none;
  }

  .remote-control-window.mobile-screen-mode > .remote-session-header {
    display: none;
  }

  .remote-control-window.mobile-screen-mode .remote-screen-workspace {
    display: block;
    inset: 0;
  }

  .remote-control-window.mobile-screen-mode .remote-screen-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    touch-action: none;
  }

  .remote-control-window.mobile-screen-mode .remote-screen-workspace,
  .remote-control-window.mobile-screen-mode .remote-screen-video {
    background: transparent;
  }

  .remote-control-window.mobile-screen-mode .remote-screen-placeholder {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #080c12;
  }

  /* Keep the disconnect state visible after the screen workspace is torn
     down. Without this exception the mobile screen-mode rule hides every
     sibling of the video workspace, leaving a transparent WebView over the
     native video surface (which appears as a blank white page). */
  .remote-control-window.mobile-screen-mode > .remote-peer-disconnected {
    display: grid;
    position: fixed;
    z-index: 20;
    inset: 0;
    background: #0c0f0d;
  }

  .remote-control-window.mobile-screen-mode .remote-screen-toolbar {
    position: absolute;
    z-index: 4;
    inset: 0;
    min-height: 0;
    padding: 0;
    border: 0;
    pointer-events: none;
    background: transparent;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
  }

  .remote-control-window.mobile-screen-mode .remote-screen-heading {
    display: none;
  }

  .remote-control-window.mobile-screen-mode .remote-screen-actions {
    position: absolute;
    z-index: 10;
    top: 14px;
    right: 58px;
    display: none;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    white-space: nowrap;
    pointer-events: auto;
  }

  .remote-control-window.mobile-screen-mode .remote-screen-actions.open {
    display: flex;
  }

  .remote-control-window.mobile-screen-mode .remote-screen-actions button {
    display: inline-flex;
    width: 38px;
    height: 34px;
    min-width: 38px;
    flex: 0 0 38px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-color: rgb(255 255 255 / 36%);
    background: rgb(15 25 40 / 58%);
    font-size: 12px;
    line-height: 1;
    vertical-align: middle;
    white-space: nowrap;
    -webkit-appearance: none;
    appearance: none;
    backdrop-filter: blur(5px);
  }

  .remote-control-window.mobile-screen-mode .mobile-screen-tools-trigger {
    display: grid;
    position: absolute;
    z-index: 11;
    top: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
    place-items: center;
    padding: 0;
    color: rgb(255 255 255 / 86%);
    border: 1px solid rgb(255 255 255 / 30%);
    border-radius: 50%;
    outline: 0;
    background: rgb(15 25 40 / 34%);
    font-size: 22px;
    line-height: 1;
    pointer-events: auto;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-appearance: none;
    appearance: none;
    backdrop-filter: blur(5px);
  }

  .remote-control-window.mobile-screen-mode
    .mobile-screen-tools-trigger.active {
    background: rgb(39 67 110 / 72%);
  }

  .remote-control-window.mobile-screen-mode .remote-screen-keyboard-input {
    position: absolute;
    z-index: 6;
    top: 54px;
    right: 58px;
    left: auto;
    width: min(240px, calc(100% - 84px));
    min-height: 28px;
    margin: 0;
    padding: 4px 8px;
    border-top: 0;
    box-shadow: none;
    pointer-events: auto;
  }

  .remote-control-window.mobile-screen-mode
    .remote-screen-keyboard-input:focus {
    border-color: #6f9fe8;
    box-shadow: none;
  }
}

/* Keep the legal page intentionally quiet and document-like. */
.legal-terms-window {
  padding: 28px 20px;
  background: var(--app-background);
}
.legal-terms-shell { width: min(100%, 760px); }
.legal-terms-header { display: flex; gap: 12px; margin-bottom: 18px; }
.legal-terms-header-top { display: contents; }
.legal-terms-eyebrow, .legal-terms-updated { display: none; }
.legal-terms-header-main { display: contents; }
.legal-terms-header-icon { width: 42px; height: 42px; border-radius: 10px; box-shadow: none; }
.legal-terms-header h1 { font-size: 23px; letter-spacing: 0; }
.legal-terms-header p { margin-top: 4px; font-size: 12px; }
.legal-home-notice-control { min-width: 150px; padding: 8px 10px; border-radius: 8px; box-shadow: none; }
.legal-terms-highlights, .legal-terms-note, .legal-contact-arrow, .legal-terms-footer-note { display: none; }
.legal-terms-grid { display: block; }
.legal-terms-card { margin-bottom: 12px; padding: 19px 20px; border-radius: 10px; box-shadow: var(--shadow-soft); background: var(--surface); }
.legal-terms-section-heading { margin-bottom: 12px; }
.legal-terms-section-heading h2 { font-size: 16px; letter-spacing: 0; }
.legal-terms-list, .legal-terms-copy { font-size: 13px; line-height: 1.75; }
.legal-terms-contact { margin-top: 14px; padding: 13px 15px; border-radius: 10px; background: var(--surface); }

@media (max-width: 700px), (pointer: coarse) {
  .legal-terms-window { padding: calc(16px + env(safe-area-inset-top)) calc(14px + env(safe-area-inset-right)) calc(18px + env(safe-area-inset-bottom)) calc(14px + env(safe-area-inset-left)); }
  .legal-terms-header { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 9px; align-items: start; }
  .legal-terms-mobile-back { grid-column: 1; grid-row: 1; width: 32px; height: 32px; }
  .legal-terms-header-icon { display: none; }
  .legal-terms-header-copy { grid-column: 2; grid-row: 1; align-self: center; }
  .legal-terms-header h1 { font-size: 21px; }
  .legal-home-notice-control { grid-column: 1 / -1; width: 100%; margin: 2px 0 0; }
  .legal-terms-card { padding: 16px 15px; }
  .legal-terms-list, .legal-terms-copy { font-size: 12px; }
}

@media (max-width: 700px), (pointer: coarse) {
  .legal-terms-header-copy { grid-column: 2; grid-row: 1; align-self: center; }
}

/* Keep the page context available while reading long legal text. */
.legal-terms-header {
  position: sticky;
  z-index: 4;
  top: 0;
  padding: 8px 0 12px;
  background: var(--app-background);
}

@media (max-width: 700px), (pointer: coarse) {
  .legal-terms-header { padding-top: 4px; }
}

.remote-screen-toolbar {
  display: flex;
  min-width: 0;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  border-bottom: 1px solid #253247;
  background: #111925;
}

.remote-screen-heading,
.remote-screen-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.remote-screen-heading > svg {
  flex: 0 0 auto;
  color: #83b3ff;
}

.remote-screen-heading strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 650;
}

.remote-screen-heading span {
  color: #d6ac70;
  font-size: 11px;
}

.remote-screen-heading span.connected {
  color: #6ed69b;
}

.remote-screen-heading span.error {
  color: #ff9a9a;
}

.remote-screen-metrics {
  overflow: hidden;
  color: #8f9db2;
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remote-screen-actions button {
  display: grid;
  width: 28px;
  height: 26px;
  place-items: center;
  color: #aebbd0;
  border: 1px solid #334157;
  border-radius: 4px;
  background: #182335;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
}

.remote-screen-actions .remote-screen-mouse-button {
  width: 38px;
}

.remote-screen-actions .remote-screen-exit-button {
  color: #ffb4a8;
  border-color: #70433d;
}

.remote-screen-actions button:hover,
.remote-screen-actions button.active {
  color: #ffffff;
  border-color: #6f9fe8;
  background: #27436e;
}

.remote-screen-mouse-label {
  display: inline-block;
  min-width: 28px;
  font-size: 10px;
  line-height: 1;
  white-space: nowrap;
}

.remote-screen-backspace-label {
  font-size: 19px;
  line-height: 1;
}

.remote-screen-decode-label {
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.remote-screen-decode-indicator {
  position: absolute;
  z-index: 5;
  top: 14px;
  left: 14px;
  padding: 6px 10px;
  color: rgb(255 255 255 / 92%);
  border: 1px solid rgb(255 255 255 / 30%);
  border-radius: 6px;
  background: rgb(15 25 40 / 68%);
  box-shadow: 0 2px 8px rgb(0 0 0 / 24%);
  font-size: 12px;
  line-height: 1.2;
  pointer-events: none;
  backdrop-filter: blur(5px);
}

.remote-screen-keyboard-input {
  box-sizing: border-box;
  display: block;
  width: min(260px, calc(100% - 28px));
  min-height: 30px;
  margin: 6px 14px 0;
  padding: 4px 8px;
  color: #dbe8f7;
  border: 1px solid #48658e;
  border-radius: 5px;
  outline: 0;
  appearance: none;
  -webkit-appearance: none;
  background: #182335;
  font: inherit;
  font-size: 12px;
  line-height: 1.25;
  box-shadow: none;
}

.remote-screen-keyboard-input:focus {
  border-color: #83b3ff;
  box-shadow: 0 0 0 2px rgb(91 142 219 / 22%);
}

.remote-screen-quality select {
  height: 26px;
  padding: 0 24px 0 8px;
  color: #dbe8f7;
  border: 1px solid #334157;
  border-radius: 4px;
  outline: 0;
  background: #182335;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}

.remote-screen-quality select:hover,
.remote-screen-quality select:focus-visible {
  border-color: #6f9fe8;
}

.remote-screen-canvas {
  display: grid;
  position: relative;
  min-width: 0;
  min-height: 0;
  place-items: center;
  outline: 0;
  background: #080c12;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  /* Pointer events drive the custom mobile touchpad recognizer. Prevent the
     WebView's native panning/zooming from competing with two-finger input. */
  touch-action: none;
}

.remote-screen-image {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.remote-screen-video {
  image-rendering: auto;
  background: #080c12;
}

.remote-screen-canvas:focus-visible {
  box-shadow: inset 0 0 0 2px #5b8edb;
}

.remote-screen-placeholder {
  display: grid;
  justify-items: center;
  gap: 9px;
  color: #718198;
  text-align: center;
}

.remote-screen-placeholder > svg {
  color: #4d72aa;
}

.remote-screen-placeholder strong {
  color: #c8d7eb;
  font-size: 14px;
  font-weight: 650;
}

.remote-screen-placeholder span,
.remote-screen-placeholder small {
  color: #718198;
  font-size: 12px;
}

.remote-screen-placeholder small {
  color: #5b779f;
}

.file-manager-backdrop {
  position: fixed;
  z-index: 40;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(2, 5, 4, 0.78);
}

.file-manager-dialog {
  display: flex;
  width: min(1080px, 100%);
  max-height: min(760px, calc(100vh - 44px));
  flex-direction: column;
  overflow: hidden;
  color: #e6f0e8;
  border: 1px solid #405246;
  border-radius: 7px;
  background: #111813;
  box-shadow: 0 22px 65px rgba(0, 0, 0, 0.58);
}

.file-manager-heading,
.file-manager-toolbar,
.file-manager-actions,
.file-manager-pane-heading {
  display: flex;
  align-items: center;
}

.file-manager-heading {
  justify-content: space-between;
  padding: 17px 20px 13px;
  border-bottom: 1px solid #29372e;
}

.file-manager-eyebrow {
  display: block;
  margin-bottom: 3px;
  color: #70d58e;
  font-size: 11px;
  letter-spacing: 0.04em;
}

.file-manager-heading h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 650;
}

.file-manager-close,
.file-manager-pane-heading button {
  display: grid;
  width: 28px;
  height: 28px;
  padding: 0;
  color: #98aa9d;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  place-items: center;
}

.file-manager-close:hover,
.file-manager-pane-heading button:hover {
  color: #fff;
  border-color: #50755b;
  background: #243529;
}

.file-manager-toolbar {
  justify-content: space-between;
  min-height: 38px;
  padding: 0 20px;
  color: #a8b9ab;
  border-bottom: 1px solid #29372e;
  background: #0d130f;
  font-size: 12px;
}

.file-manager-toolbar span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #d2e6d6;
}

.file-manager-toolbar span svg {
  color: #70d58e;
}

.file-manager-toolbar small {
  color: #7f9484;
}

.file-manager-panes {
  display: grid;
  min-height: 360px;
  grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr);
  padding: 14px;
  gap: 10px;
}

.file-manager-pane {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  border: 1px solid #314237;
  border-radius: 5px;
  background: #0d130f;
  transition:
    border-color 120ms ease,
    background 120ms ease;
}

.file-manager-pane.is-drop-target {
  border-color: #70d58e;
  background: #142319;
  box-shadow: inset 0 0 0 1px rgba(112, 213, 142, 0.2);
}

.file-manager-pane-heading {
  justify-content: space-between;
  min-height: 48px;
  padding: 6px 9px 6px 12px;
  border-bottom: 1px solid #29372e;
}

.file-manager-pane-heading > div {
  display: grid;
  min-width: 0;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: 8px;
}

.file-manager-pane-heading > div > svg {
  grid-row: span 2;
  color: #70d58e;
}

.file-manager-pane-heading strong,
.file-manager-pane-heading small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-manager-pane-heading strong {
  color: #deebe0;
  font-size: 12px;
  font-weight: 600;
}

.file-manager-pane-heading small {
  color: #819586;
  font-size: 11px;
}

.file-manager-path {
  min-height: 30px;
  padding: 8px 12px 5px;
  overflow: hidden;
  color: #819586;
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-manager-list {
  min-height: 0;
  flex: 1;
  padding: 3px 6px 8px;
  overflow: auto;
}

.file-manager-entry {
  display: grid;
  width: 100%;
  min-height: 34px;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  color: #c9d8cc;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  text-align: left;
}

.file-manager-entry:hover,
.file-manager-entry.selected {
  color: #eef8ef;
  border-color: #355a3f;
  background: #1b2a1f;
}

.file-manager-entry span,
.file-manager-entry small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-manager-entry small {
  color: #78907e;
  font-size: 10px;
}

.file-manager-entry .folder-icon {
  color: #d5b472;
}

.file-manager-entry .file-icon {
  color: #9db9e6;
}

.file-manager-entry.parent {
  color: #94ab99;
}

.file-manager-empty {
  margin: 0;
  padding: 32px 12px;
  color: #7f9484;
  font-size: 12px;
  text-align: center;
}

.file-manager-empty.error {
  color: #d48b8e;
}

.file-manager-empty.remote-hint {
  padding-top: 22px;
  color: #607264;
  font-size: 11px;
}

.file-manager-divider {
  display: grid;
  align-self: center;
  width: 34px;
  height: 34px;
  color: #70d58e;
  border: 1px solid #385141;
  border-radius: 50%;
  background: #152019;
  place-items: center;
}

.file-manager-actions {
  justify-content: space-between;
  min-height: 55px;
  padding: 10px 14px 10px 20px;
  color: #91a494;
  border-top: 1px solid #29372e;
  background: #0d130f;
  font-size: 12px;
}

.file-manager-actions > div {
  display: flex;
  gap: 7px;
}

.file-manager-actions button {
  display: inline-flex;
  height: 30px;
  align-items: center;
  gap: 6px;
  padding: 0 11px;
  color: #cbd9ce;
  border: 1px solid #405246;
  border-radius: 4px;
  background: #202b23;
  cursor: pointer;
  font-size: 12px;
}

.file-manager-actions button:hover:not(:disabled) {
  border-color: #70d58e;
  background: #2c3d30;
}

.file-manager-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.file-manager-actions button.danger:hover:not(:disabled) {
  color: #ffb1b1;
  border-color: #82484c;
  background: #342024;
}

.file-manager-actions button.primary {
  color: #092011;
  border-color: #70d58e;
  background: #70d58e;
}

.file-manager-window {
  display: flex;
  width: 100vw;
  height: 100vh;
  flex-direction: column;
  overflow: hidden;
  color: #17202a;
  background: #f5f7f9;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
}

.file-manager-transfer-strip {
  display: flex;
  min-height: 46px;
  align-items: center;
  padding: 5px 12px;
  border-bottom: 1px solid #29372e;
  background: #101712;
}
.file-manager-transfer-item {
  display: flex;
  min-width: 280px;
  max-width: min(520px, 100%);
  height: 34px;
  align-items: center;
  gap: 9px;
  padding: 0 9px;
  color: #cbd9ce;
  border: 1px solid #385141;
  border-radius: 4px;
  background: #152019;
}
.file-manager-transfer-direction {
  color: #70d58e;
  font-size: 11px;
  white-space: nowrap;
}
.file-manager-transfer-item strong {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: #e5f1e6;
  font-size: 12px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-manager-circular-progress {
  position: relative;
  display: grid;
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(#70d58e var(--progress), #2a3b30 0);
}
.file-manager-circular-progress::before {
  position: absolute;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: #152019;
  content: "";
}
.file-manager-circular-progress span {
  position: relative;
  z-index: 1;
  color: #dff2e2;
  font-size: 8px;
}

.file-manager-columns {
  display: grid;
  min-height: 0;
  flex: 1;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: 0 8px 8px;
  background: #d5dce2;
}
.file-manager-column {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  background: #fff;
}
.file-manager-column.is-drop-target {
  outline: 2px solid #3b8edb;
  outline-offset: -2px;
}
.file-manager-column-title {
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  color: #243340;
  border-bottom: 1px solid #d4dce3;
  background: #f7f9fb;
  font-size: 12px;
}
.file-manager-column-title svg {
  color: #3b80bd;
}
.file-manager-column-title span {
  min-width: 0;
  overflow: hidden;
  color: #778796;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-manager-column-title button {
  display: grid;
  width: 24px;
  height: 24px;
  margin-left: auto;
  place-items: center;
  color: #597285;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.file-manager-column-title button:hover {
  color: #1d67a8;
  background: #e8f1f8;
}
.file-manager-local-title {
  width: 100%;
  border: 0;
  text-align: left;
  cursor: pointer;
}
.file-manager-local-title:hover,
.file-manager-local-title:focus-visible {
  background: #e8f1f8;
  outline: none;
}
.file-manager-local-title:focus-visible {
  box-shadow: inset 0 0 0 2px #3b8edb;
}
.file-manager-table-head,
.file-manager-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 74px 92px 110px;
  align-items: center;
  gap: 8px;
}
.file-manager-table-head {
  min-height: 28px;
  padding: 0 10px;
  color: #40515e;
  border-bottom: 1px solid #d6dee5;
  background: #f1f4f7;
  font-size: 11px;
}
.file-manager-table-body {
  min-height: 0;
  flex: 1;
  overflow: auto;
  padding: 2px 0;
}
.file-manager-row {
  width: 100%;
  min-height: 29px;
  padding: 0 10px;
  color: #263845;
  border: 0;
  border-bottom: 1px solid transparent;
  background: #fff;
  cursor: grab;
  font-family: inherit;
  font-size: 12px;
  text-align: left;
  touch-action: none;
}
.file-manager-row:active {
  cursor: grabbing;
}
.file-manager-row:hover,
.file-manager-row.selected {
  background: #dcecf9;
}
.file-manager-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-manager-row svg {
  color: #e6b84f;
}
.file-manager-row .file-icon {
  color: #628bb4;
}
.file-manager-row.parent-row {
  color: #5c6d7b;
}
.file-manager-pointer-drag-image {
  position: fixed;
  z-index: 120;
  display: flex;
  width: 96px;
  height: 76px;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  opacity: 0.72;
  pointer-events: none;
  transform: translate(-50%, -50%);
}
.file-manager-pointer-drag-image svg {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  color: #9db9e6;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.55));
}
.file-manager-pointer-drag-image span {
  width: 92px;
  overflow: hidden;
  padding: 1px 4px;
  color: #fff;
  border-radius: 2px;
  background: rgba(15, 23, 18, 0.82);
  font-size: 11px;
  line-height: 16px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-manager-table-empty {
  margin: 0;
  padding: 28px 10px;
  color: #80909d;
  font-size: 12px;
  text-align: center;
}
.file-manager-statusbar {
  display: flex;
  height: 28px;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  color: #657783;
  border-top: 1px solid #c8d1d8;
  background: #eef1f4;
  font-size: 11px;
}
.file-manager-context-menu {
  position: fixed;
  z-index: 80;
  min-width: 168px;
  padding: 4px;
  border: 1px solid #bbc8d2;
  border-radius: 3px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(28, 47, 63, 0.2);
}
.file-manager-context-menu button {
  display: flex;
  width: 100%;
  min-height: 29px;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  color: #283b48;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  text-align: left;
}
.file-manager-context-menu button:hover {
  background: #e8f2fb;
}
.file-manager-context-menu button.danger {
  color: #b33f48;
}

@media (max-width: 720px) {
  .file-manager-columns {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr;
  }
  .file-manager-table-head,
  .file-manager-row {
    grid-template-columns: minmax(0, 1fr) 60px 72px;
  }
  .file-manager-table-head span:last-child,
  .file-manager-row span:last-child {
    display: none;
  }
}

/* The file manager is part of the remote-control workspace and follows its
   dark green console theme. */
.file-manager-window {
  color: #dce8df;
  background: #0b100d;
  font-family: Inter, "Microsoft YaHei", sans-serif;
}
.file-manager-columns {
  gap: 1px;
  padding: 0 7px 7px;
  background: #26342a;
}
.file-manager-column {
  background: #0d130f;
}
.file-manager-column.is-drop-target {
  outline-color: #70d58e;
}
.file-manager-column-title {
  color: #dce8df;
  border-bottom-color: #29372e;
  background: #151d18;
}
.file-manager-column-title svg {
  color: #70d58e;
}
.file-manager-column-title span {
  color: #809586;
}
.file-manager-column-title button {
  color: #91a494;
}
.file-manager-column-title button:hover {
  color: #fff;
  background: #1b2b20;
}
.file-manager-local-title:hover,
.file-manager-local-title:focus-visible {
  background: #1b2b20;
}
.file-manager-local-title:focus-visible {
  box-shadow: inset 0 0 0 2px #70d58e;
}
.file-manager-table-head {
  color: #91a494;
  border-bottom-color: #29372e;
  background: #101712;
}
.file-manager-row {
  color: #cbd9ce;
  border-bottom-color: #17221a;
  background: #0d130f;
}
.file-manager-row:hover,
.file-manager-row.selected {
  background: #1b2b20;
}
.file-manager-row svg {
  color: #d5b472;
}
.file-manager-row .file-icon {
  color: #9db9e6;
}
.file-manager-row.parent-row {
  color: #91a494;
}
.file-manager-upload-row {
  cursor: default;
  background: #132219;
}
.file-manager-upload-row:hover {
  background: #132219;
}
.file-manager-upload-row > span:nth-child(4) {
  color: #70d58e;
}
.file-manager-upload-row .file-manager-circular-progress {
  justify-self: end;
}
.file-manager-retry-upload {
  display: grid;
  width: 27px;
  height: 27px;
  justify-self: end;
  place-items: center;
  color: #dff2e2;
  border: 1px solid #70d58e;
  border-radius: 50%;
  background: #1b3322;
  cursor: pointer;
}
.file-manager-retry-upload:hover {
  color: #fff;
  background: #294630;
}
.file-manager-transfer-error {
  margin: 0;
  padding: 6px 12px;
  color: #ff9b9b;
  border-top: 1px solid #4d2525;
  background: #251516;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.file-manager-table-empty {
  color: #718675;
}
.file-manager-statusbar {
  color: #819586;
  border-top-color: #29372e;
  background: #101712;
}
.file-manager-status-text {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-manager-status-spinner {
  flex: 0 0 auto;
  color: #70d58e;
  animation: file-manager-busy-spin 0.9s linear infinite;
}
.file-manager-upload-strip {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 9px;
  padding: 5px 12px;
  color: #cbd9ce;
  border-top: 1px solid #29372e;
  background: #132219;
  font-size: 12px;
}
.file-manager-upload-strip > .file-icon {
  flex: 0 0 auto;
  color: #9db9e6;
}
.file-manager-upload-name {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-manager-upload-state {
  flex: 0 0 auto;
  color: #70d58e;
}
.file-manager-upload-strip .file-manager-circular-progress,
.file-manager-upload-strip .file-manager-retry-upload {
  flex: 0 0 auto;
}
.file-manager-transfer-progress {
  display: flex;
  min-width: 250px;
  max-width: 420px;
  align-items: center;
  gap: 8px;
  color: #cbd9ce;
}
.file-manager-transfer-progress > span {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-manager-progress-track {
  width: 120px;
  height: 6px;
  overflow: hidden;
  border-radius: 3px;
  background: #29372e;
}
.file-manager-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: #70d58e;
  transition: width 120ms ease;
}
.file-manager-transfer-progress small {
  min-width: 30px;
  color: #70d58e;
  text-align: right;
}
.file-manager-busy-indicator {
  position: fixed;
  z-index: 70;
  right: 16px;
  bottom: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: min(360px, calc(100vw - 32px));
  padding: 8px 12px;
  color: #dce8df;
  border: 1px solid #385141;
  border-radius: 5px;
  background: rgba(21, 29, 24, 0.96);
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.35);
  font-size: 12px;
  pointer-events: none;
}
.file-manager-busy-logo {
  display: inline-grid;
  flex: 0 0 auto;
  color: #70d58e;
  animation: file-manager-busy-spin 0.9s linear infinite;
}
.file-manager-busy-indicator > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@keyframes file-manager-busy-spin {
  to {
    transform: rotate(360deg);
  }
}
.file-manager-context-menu {
  border-color: #405246;
  background: #151d18;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
.file-manager-context-menu button {
  color: #dce8df;
}
.file-manager-context-menu button:hover {
  background: #294630;
}
.file-manager-context-menu button.danger {
  color: #ff9a9a;
}

.file-manager-table-head,
.file-manager-row {
  grid-template-columns: 20px minmax(0, 1fr) 64px 78px 92px;
  gap: 5px;
}

.file-manager-row span:nth-child(2) {
  min-width: 0;
}

.file-manager-row span:nth-child(n + 3),
.file-manager-table-head span:nth-child(n + 3) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .file-manager-transfer-progress {
    min-width: 0;
    flex: 1;
  }
}

@media (max-width: 720px) {
  .file-manager-backdrop {
    padding: 8px;
  }

  .file-manager-dialog {
    max-height: calc(100vh - 16px);
  }

  .file-manager-toolbar small {
    display: none;
  }

  .file-manager-panes {
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(220px, 1fr) 26px minmax(220px, 1fr);
  }

  .file-manager-divider {
    width: 26px;
    height: 26px;
    justify-self: center;
    transform: rotate(90deg);
  }

  .file-manager-actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding-left: 14px;
  }
}

.terminal-upload-readiness {
  min-width: 0;
  color: #d5b472;
  font-size: 12px;
  white-space: nowrap;
}

.terminal-tab-bar {
  display: flex;
  min-width: 0;
  gap: 4px;
  overflow-x: auto;
  padding: 5px 14px;
  border-bottom: 1px solid #26342a;
  background: #101511;
  scrollbar-width: none;
}

.terminal-tab-bar::-webkit-scrollbar {
  display: none;
}

.terminal-tab-select,
.terminal-tab-add,
.terminal-tab-reconnect,
.terminal-tab-close,
.terminal-tab-add-options button {
  border: 0;
  cursor: pointer;
}

.terminal-tab {
  display: inline-flex;
  height: 26px;
  min-width: 0;
  max-width: 176px;
  align-items: center;
  gap: 6px;
  padding: 0 5px 0 8px;
  color: #9eaea0;
  border: 1px solid #2c3a2f;
  border-radius: 4px;
  background: #151d17;
  font-family: Inter, sans-serif;
  font-size: 12px;
}

.terminal-tab:hover,
.terminal-tab.active {
  color: #e2f0e4;
  border-color: #5b8a64;
  background: #1d2a20;
}

.terminal-tab-select {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  padding: 0;
  color: inherit;
  background: transparent;
}

.terminal-tab-select > svg {
  flex: 0 0 auto;
  color: #70d58e;
}

.terminal-tab-select > span:first-of-type {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terminal-tab-close,
.terminal-tab-reconnect,
.terminal-tab-add {
  display: grid;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  place-items: center;
  color: inherit;
  border-radius: 3px;
  background: transparent;
}

.terminal-tab-close:hover,
.terminal-tab-reconnect:hover:not(:disabled),
.terminal-tab-add:hover:not(:disabled) {
  color: #ffffff;
  background: #35483a;
}

.terminal-tab-reconnect:disabled {
  cursor: wait;
  opacity: 0.65;
}

.terminal-tab-add {
  width: 26px;
  height: 26px;
  color: #a9cdb0;
  border: 1px solid #35473a;
  background: #141b16;
}

.terminal-tab-add:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.terminal-tab-add-menu {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
}

.terminal-tab-area {
  position: relative;
  z-index: 4;
  grid-row: 2;
}

.terminal-tab-add-options {
  display: grid;
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  width: 164px;
  gap: 3px;
  padding: 4px;
  border: 1px solid #3b5140;
  border-radius: 4px;
  background: #111812;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.terminal-tab-add-options button {
  height: 28px;
  flex: 0 0 auto;
  padding: 0 9px;
  text-align: left;
  color: #d8e6d9;
  border: 1px solid #3b5140;
  border-radius: 4px;
  background: #141b16;
  font-family: Inter, sans-serif;
  font-size: 12px;
  white-space: nowrap;
}

.terminal-tab-add-options button:hover {
  color: #ffffff;
  border-color: #70d58e;
  background: #203224;
}

.remote-terminal-scroll {
  display: grid;
  grid-row: 3;
  grid-template-rows: minmax(0, 1fr);
  position: relative;
  z-index: 0;
  overflow: auto;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  min-width: 0;
  min-height: 0;
  padding: 16px;
  cursor: text;
}

.remote-xterm {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.remote-terminal-disconnected {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  color: #aab8ad;
  background: #0c0f0d;
  cursor: default;
}

.remote-terminal-disconnected > svg {
  color: #70d58e;
}

.remote-terminal-disconnected > strong {
  font-size: 14px;
  font-weight: 600;
}

.remote-terminal-disconnected > button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  color: #f1fff3;
  border: 1px solid #4f825b;
  border-radius: 4px;
  background: #244d2e;
  cursor: pointer;
}

.remote-terminal-disconnected > button:hover:not(:disabled) {
  border-color: #70d58e;
  background: #2d633a;
}

.remote-terminal-disconnected > button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.remote-xterm .xterm {
  height: 100%;
}

.remote-xterm .xterm-viewport {
  touch-action: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* Keep xterm's runtime-generated interaction layer stable in packaged
   WebView2 builds. The selection rectangles must be positioned, otherwise
   they fall into normal document flow at the bottom of the terminal. */
.remote-xterm .xterm .xterm-screen {
  position: relative;
}

.remote-xterm .xterm .xterm-rows {
  position: relative;
  pointer-events: none;
  color: #d8e6d9;
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 14px;
  font-kerning: none;
  white-space: pre;
}

.remote-xterm .xterm .xterm-rows span {
  display: inline-block;
  height: 100%;
  vertical-align: top;
}

.remote-xterm .xterm .xterm-selection {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
}

.remote-xterm .xterm .xterm-selection div {
  position: absolute;
}

.remote-xterm .xterm .xterm-helper-textarea {
  outline: none !important;
}

/* xterm generates cursor colors and blink keyframes in a runtime style
   element. Keep the essential cursor paint in the bundled stylesheet too. */
@keyframes remote-terminal-cursor-blink {
  0%,
  49% {
    color: #0c0f0d;
    background-color: #f2fff3;
  }

  50%,
  100% {
    color: #f2fff3;
    background-color: transparent;
  }
}

.remote-xterm .xterm .xterm-cursor.xterm-cursor-block {
  color: #0c0f0d;
  background-color: #f2fff3;
}

.remote-xterm .xterm.focus .xterm-cursor.xterm-cursor-blink.xterm-cursor-block,
.remote-xterm
  .xterm
  .xterm-rows.xterm-focus
  .xterm-cursor.xterm-cursor-blink.xterm-cursor-block {
  animation: remote-terminal-cursor-blink 1s step-end infinite !important;
}

.remote-xterm .xterm .xterm-selection div {
  background-color: #315f9b !important;
}

.remote-xterm .xterm:not(.focus) .xterm-selection div {
  background-color: #274568 !important;
}

.mobile-terminal-keyboard {
  display: none;
}

.terminal-context-menu {
  position: fixed;
  z-index: 10;
  padding: 4px;
  border: 1px solid #394552;
  border-radius: 5px;
  background: #202832;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.terminal-context-menu button {
  display: flex;
  min-width: 166px;
  height: 32px;
  align-items: center;
  gap: 7px;
  padding: 0 9px;
  color: #eff5ff;
  border: 0;
  border-radius: 3px;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
}

.terminal-context-menu button:hover {
  background: #37577f;
}

.terminal-shell-dialog-backdrop {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 5, 4, 0.64);
}

.terminal-shell-dialog {
  width: min(100%, 390px);
  padding: 18px;
  color: #e8f1e9;
  border: 1px solid #405246;
  border-radius: 6px;
  background: #151d17;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.5);
}

.terminal-shell-dialog h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
}

.terminal-shell-dialog p {
  margin: 9px 0 18px;
  color: #a7b8aa;
  font-size: 12px;
  line-height: 1.55;
}

.terminal-shell-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.terminal-shell-dialog-actions button {
  min-width: 68px;
  height: 30px;
  padding: 0 10px;
  color: #dce8df;
  border: 1px solid #405246;
  border-radius: 4px;
  background: #202b23;
  cursor: pointer;
}

.terminal-shell-dialog-actions button:hover {
  border-color: #70d58e;
  background: #2c3d30;
}

.terminal-shell-dialog-actions button.primary {
  color: #092011;
  border-color: #70d58e;
  background: #70d58e;
}

.terminal-shell-dialog-actions button.primary:hover {
  background: #92e5aa;
}

.sync-command-log-backdrop {
  position: fixed;
  z-index: 40;
  inset: 0;
  display: grid;
  padding: 20px;
  place-items: center;
  background: rgba(2, 5, 4, 0.72);
}

.sync-command-log-dialog {
  display: grid;
  width: min(100%, 720px);
  max-height: min(78dvh, 680px);
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  color: #e8f1e9;
  border: 1px solid #405246;
  border-radius: 6px;
  background: #151d17;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.54);
  font-family: Inter, sans-serif;
}

.sync-command-log-dialog > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid #35473a;
}

.sync-command-log-dialog h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
}

.sync-command-log-dialog header small {
  display: block;
  margin-top: 3px;
  color: #8fa293;
  font-size: 12px;
}

.sync-command-log-dialog header button {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  padding: 0;
  place-items: center;
  color: #afbeb2;
  border: 0;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
}

.sync-command-log-dialog header button:hover {
  color: #ffffff;
  background: #2d3c31;
}

.sync-command-log-list {
  min-height: 0;
  overflow-y: auto;
  scrollbar-color: #45624d #101511;
  scrollbar-width: thin;
}

.sync-command-log-entry {
  padding: 14px 18px 4px;
  border-bottom: 1px solid #2d3d32;
}

.sync-command-log-entry:last-child {
  border-bottom: 0;
}

.sync-command-log-entry-heading {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 9px;
}

.sync-command-log-entry-heading > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.sync-command-log-entry-heading strong {
  font-size: 12px;
}

.sync-command-log-entry-heading time,
.sync-command-log-entry-heading > span {
  color: #8fa293;
  font-size: 12px;
}

.sync-command-log-entry-heading > span {
  flex: 0 0 auto;
  max-width: 48%;
  overflow: hidden;
  padding-top: 2px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sync-command-log-command {
  min-width: 0;
  margin: 0 0 10px;
  padding: 7px 9px;
  overflow: hidden;
  border: 1px solid #2d4937;
  border-radius: 4px;
  background: #0d1610;
  color: #d9f4df;
  text-overflow: ellipsis;
  white-space: pre-wrap;
}

.sync-command-log-command code {
  display: block;
  overflow: hidden;
  font:
    12px/1.45 ui-monospace,
    SFMono-Regular,
    Consolas,
    "Liberation Mono",
    monospace;
  text-overflow: ellipsis;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.upload-log-entry .sync-command-log-entry-heading > span {
  color: #a6c8ad;
}

.sync-command-log-entry ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sync-command-log-entry li {
  display: grid;
  min-width: 0;
  grid-template-columns: 18px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 9px;
  padding: 9px 0;
  border-top: 1px solid #29382e;
  color: #cdd9cf;
}

.sync-command-log-entry li.state-waiting,
.sync-command-log-entry li.state-running {
  color: #8dbbff;
}

.sync-command-log-entry li.state-succeeded {
  color: #70d58e;
}

.sync-command-log-entry li.state-failed,
.sync-command-log-entry li.state-timed_out,
.sync-command-log-entry li.state-disconnected {
  color: #ef8585;
}

.sync-command-log-entry li.state-cancelled {
  color: #d5b472;
}

.sync-command-log-state-icon {
  display: grid;
  place-items: center;
}

.sync-command-log-target {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, auto) auto;
  justify-content: start;
  gap: 2px 8px;
  color: #dce8df;
}

.sync-command-log-target strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sync-command-log-target small {
  align-self: center;
  color: #829687;
  font-size: 12px;
}

.sync-command-log-target em {
  grid-column: 1 / -1;
  overflow-wrap: anywhere;
  color: #d9a3a3;
  font-size: 12px;
  font-style: normal;
}

.upload-progress {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: #9ec9aa;
}

.upload-progress-track {
  display: block;
  width: min(180px, 100%);
  height: 5px;
  overflow: hidden;
  border-radius: 3px;
  background: #26382b;
}

.upload-progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #70d58e;
  transition: width 160ms ease-out;
}

.upload-progress > small {
  flex: 0 0 auto;
  color: #a6c8ad;
  font-size: 12px;
}

.sync-command-log-result {
  min-width: 38px;
  color: currentColor;
  font-size: 12px;
  font-weight: 650;
  text-align: right;
}

.sync-command-log-entry li > button {
  display: inline-flex;
  height: 28px;
  align-items: center;
  gap: 5px;
  padding: 0 9px;
  color: #f1d3d3;
  border: 1px solid #77494b;
  border-radius: 4px;
  background: #342122;
  cursor: pointer;
  font-size: 12px;
  white-space: nowrap;
}

.sync-command-log-entry li > button:hover:not(:disabled) {
  color: #ffffff;
  border-color: #d27376;
  background: #542d30;
}

.sync-command-log-entry li > button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.sync-command-log-empty {
  margin: 0;
  padding: 36px 18px;
  color: #8fa293;
  font-size: 12px;
  text-align: center;
}

.terminal-upload-dialog-backdrop {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 5, 4, 0.7);
}

.overwrite-confirmation-backdrop {
  z-index: 50;
  background: rgba(2, 5, 4, 0.82);
}

.terminal-upload-dialog {
  width: min(100%, 440px);
  padding: 18px;
  color: #e8f1e9;
  border: 1px solid #405246;
  border-radius: 6px;
  background: #151d17;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.5);
  font-family: Inter, sans-serif;
}

.terminal-upload-dialog h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
}

.terminal-upload-dialog p {
  margin: 9px 0 14px;
  color: #a7b8aa;
  font-size: 12px;
  line-height: 1.55;
}

.upload-target-options {
  display: grid;
  gap: 6px;
  margin: 0 0 12px;
  padding: 0;
  border: 0;
}

.upload-target-options legend {
  margin-bottom: 6px;
  color: #97aa9b;
  font-size: 12px;
}

.upload-target-options label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  color: #dce8df;
  border: 1px solid #34463a;
  border-radius: 4px;
  background: #101712;
  cursor: pointer;
  font-size: 12px;
}

.upload-target-options input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: #70d58e;
}

.upload-target-options small {
  color: #97aa9b;
  font-size: 12px;
}

.upload-target-list {
  max-height: 112px;
  margin-bottom: 10px;
}

.upload-target-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) auto;
  align-items: center;
  gap: 8px;
}

.upload-target-list li small {
  overflow: hidden;
  color: #97aa9b;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-target-list .upload-target-remove {
  display: grid;
  width: 22px;
  height: 22px;
  padding: 0;
  color: #97aa9b;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  place-items: center;
}

.upload-target-list .upload-target-remove:hover:not(:disabled) {
  color: #ff9a9a;
  border-color: #714044;
  background: #2b1719;
}

.upload-target-list .upload-target-remove:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.terminal-upload-dialog dl {
  display: grid;
  gap: 6px;
  margin: 0;
}

.terminal-upload-dialog dl > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 10px;
  border: 1px solid #34463a;
  border-radius: 4px;
  background: #101712;
  font-size: 12px;
}

.terminal-upload-dialog dt {
  color: #97aa9b;
}

.terminal-upload-dialog dd {
  overflow: hidden;
  margin: 0;
  color: #e5f1e6;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overwrite-apply-remaining {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  margin: 12px 0 8px;
  color: #cbd9ce;
  font-size: 12px;
  line-height: 1.4;
  cursor: pointer;
}

.overwrite-apply-remaining input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: #70d58e;
  cursor: pointer;
}

.overwrite-apply-remaining:has(input:disabled) {
  opacity: 0.55;
  cursor: default;
}

.terminal-upload-dialog ul {
  max-height: 132px;
  margin: 10px 0 18px;
  padding: 0;
  overflow: auto;
  border: 1px solid #34463a;
  border-radius: 4px;
  background: #101712;
  list-style: none;
}

.terminal-upload-dialog li {
  overflow: hidden;
  padding: 7px 10px;
  color: #cbd9ce;
  border-bottom: 1px solid #29392f;
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terminal-upload-dialog li:last-child {
  border-bottom: 0;
}

.terminal-upload-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.terminal-upload-dialog-actions button {
  min-width: 76px;
  height: 30px;
  padding: 0 10px;
  color: #dce8df;
  border: 1px solid #405246;
  border-radius: 4px;
  background: #202b23;
  cursor: pointer;
}

.terminal-upload-dialog-actions button:hover {
  border-color: #70d58e;
  background: #2c3d30;
}

.terminal-upload-dialog-actions button.primary {
  color: #092011;
  border-color: #70d58e;
  background: #70d58e;
}

.terminal-upload-dialog-actions button.primary:hover {
  background: #92e5aa;
}

.remote-control-canvas {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 0;
  place-items: center;
  color: #202733;
  background: #070a0f;
  cursor: crosshair;
  outline: 0;
  touch-action: none;
}

.remote-control-canvas:focus-visible {
  box-shadow: inset 0 0 0 2px #5c83ed;
}

.pairing-window-cancel {
  color: #5d6879;
  border: 1px solid #d4dae4;
  background: #ffffff;
}

.pairing-window-submit {
  color: #ffffff;
  border: 1px solid #2d59cf;
  background: #3568e8;
}

.pairing-window-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.text-action {
  padding: 4px 6px;
  color: #4967c6;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
}

.discovery-visual.active .orbit {
  animation: radar-pulse 1.2s ease-out infinite;
}

.discovery-visual.active .orbit-small {
  animation-delay: 0.35s;
}

.empty-devices,
.empty-transfer {
  display: flex;
  min-height: 270px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.device-list-panel .empty-devices {
  min-height: 0;
  flex: 1;
}

.discovery-visual {
  position: relative;
  display: grid;
  width: 94px;
  height: 94px;
  margin-bottom: 10px;
  place-items: center;
}

.orbit {
  position: absolute;
  border: 1px solid #dce3ef;
  border-radius: 50%;
}

.orbit-large {
  inset: 0;
}

.orbit-small {
  inset: 15px;
}

.computer-mark {
  z-index: 1;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  color: #5273d5;
  border: 1px solid #d5def7;
  border-radius: 8px;
  background: #f1f5ff;
}

.empty-devices h3,
.empty-transfer h3 {
  margin: 0;
  color: #344056;
  font-size: 13px;
}

.empty-devices p,
.empty-transfer p {
  margin: 6px 0 12px;
  color: #929bab;
  font-size: 12px;
}

.planned-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  color: #68758a;
  border: 1px solid #e0e5ec;
  border-radius: 99px;
  background: #f7f8fa;
  font-size: 12px;
  font-weight: 650;
}

.transfer-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.transfer-summary svg {
  color: #5370ce;
}

.transfer-panel {
  min-height: 430px;
}

.empty-transfer {
  min-height: 360px;
}

.empty-transfer > span {
  display: grid;
  width: 54px;
  height: 54px;
  margin-bottom: 14px;
  place-items: center;
  color: #6880cf;
  border-radius: 8px;
  background: #eef2fb;
}

.connection-records-view {
  display: flex;
  flex-direction: column;
}

.connection-records-panel {
  display: flex;
  min-height: 430px;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 26px rgba(30, 43, 67, 0.045);
}

.connection-records-heading {
  gap: 18px;
}

.connection-records-heading .search-box {
  width: 220px;
}

.connection-record-list {
  min-height: 0;
  overflow-y: auto;
}

.connection-record-table-header,
.connection-record-row {
  display: grid;
  grid-template-columns:
    42px minmax(180px, 1.25fr) minmax(150px, 1fr) minmax(180px, 1fr)
    78px;
  align-items: center;
  gap: 11px;
  padding: 0 18px;
}

.connection-record-table-header {
  min-height: 37px;
  color: #929bab;
  border-bottom: 1px solid #e8ebf0;
  background: #fbfcfe;
  font-size: 12px;
}

.connection-record-table-header span:first-child {
  grid-column: 1 / span 2;
}

.connection-record-row {
  min-height: 72px;
  border-bottom: 1px solid #edf0f4;
}

.connection-record-row:last-child {
  border-bottom: 0;
}

.connection-record-row:hover {
  background: #fafbfe;
}

.connection-device-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: #5270cc;
  border-radius: 7px;
  background: #eef2fd;
}

.connection-device-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.connection-device-copy strong {
  overflow: hidden;
  color: #2d394e;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.connection-device-copy small,
.connection-record-row time {
  color: #8e98a9;
  font-size: 12px;
}

.usage-log-button {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 4px;
  padding: 0;
  color: #4c6fd4;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
}

.usage-log-button:hover {
  color: #274eb9;
  text-decoration: underline;
}

.connection-record-row code {
  overflow: hidden;
  color: #435a8e;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.connection-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #8993a3;
  font-size: 12px;
  white-space: nowrap;
}

.connection-state i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #aab2bf;
}

.connection-state.active {
  color: #187154;
}

.connection-state.active i {
  background: #31b77f;
  box-shadow: 0 0 0 3px rgba(49, 183, 127, 0.11);
}

.empty-connections {
  display: flex;
  min-height: 350px;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.empty-connections > span {
  display: grid;
  width: 54px;
  height: 54px;
  margin-bottom: 14px;
  place-items: center;
  color: #6880cf;
  border-radius: 8px;
  background: #eef2fb;
}

.empty-connections h3 {
  margin: 0;
  color: #344056;
  font-size: 15px;
}

.empty-connections p {
  margin: 6px 0 12px;
  color: #929bab;
  font-size: 12px;
}

.usage-log-backdrop {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(11, 18, 30, 0.52);
}

.usage-log-dialog {
  display: grid;
  width: min(1064px, calc(100vw - 40px));
  height: min(820px, calc(100dvh - 40px));
  max-height: none;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid #d9e0eb;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 50px rgba(21, 40, 75, 0.22);
}

.usage-log-standalone-backdrop {
  position: fixed;
  inset: 0;
  display: block;
  min-height: 0;
  padding: 0;
  background: transparent;
}

.usage-log-dialog-standalone {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  grid-template-rows: auto minmax(0, 1fr);
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.usage-log-dialog-standalone .usage-terminal-pane {
  height: 98vh;
}

.usage-log-dialog-standalone .usage-terminal-window {
  height: 100%;
  margin-bottom: 0;
}

.usage-log-dialog > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 1px solid #e7ebf2;
}

.usage-log-dialog h2 {
  margin: 0;
  color: #1e2d47;
  font-size: 16px;
}

.usage-log-dialog header p {
  margin: 5px 0 0;
  color: #8a96a8;
  font-size: 12px;
}

.usage-log-dialog header button {
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  color: #7e899c;
  border: 0;
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
}

.usage-log-dialog header button:hover {
  color: #314a78;
  background: #f0f3f8;
}

.usage-log-list {
  min-height: 0;
  overflow-y: auto;
}

.usage-log-tabs {
  display: flex;
  gap: 6px;
  padding: 10px 14px 0;
  overflow-x: auto;
  border-bottom: 1px solid #e7ebf2;
}

.usage-log-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  padding: 9px 11px;
  color: #778399;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 5px 5px 0 0;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
}

.usage-log-tabs button:hover,
.usage-log-tabs button.active {
  color: #2e4f9c;
  border-color: #d7e0f1;
  background: #f2f6fd;
}

.usage-log-tabs button small {
  color: #a0a9b7;
  font-size: 11px;
}

.usage-terminal-pane {
  display: grid;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.usage-terminal-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  color: #8a96a8;
  font-size: 11px;
}

.usage-terminal-heading > div {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #395690;
  font-size: 12px;
}

.usage-terminal-console {
  margin: 0 20px 20px;
  padding: 14px;
  overflow: auto;
  color: #c5cfdd;
  border: 1px solid #dce3ed;
  border-radius: 6px;
  background: #11161d;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
}

.usage-terminal-window {
  display: grid;
  min-width: 0;
  min-height: 0;
  margin: 0 20px 20px;
  grid-template-rows: 34px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid #1e2922;
  border-radius: 3px;
  background: #0c0f0d;
  box-shadow: 0 5px 18px rgba(9, 15, 11, 0.24);
}

.usage-terminal-tabbar {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
  padding: 3px 8px 0 12px;
  border-bottom: 1px solid #243129;
  background: #111813;
}

.usage-terminal-window-tab {
  display: inline-flex;
  width: 112px;
  height: 27px;
  min-width: 0;
  align-items: center;
  gap: 7px;
  padding: 0 7px 0 9px;
  color: #e7eee8;
  border: 1px solid #304037;
  border-bottom-color: #18221b;
  border-radius: 4px 4px 0 0;
  background: #18221b;
  cursor: pointer;
  font-family: "Segoe UI", "Microsoft YaHei UI", sans-serif;
  font-size: 12px;
}

.usage-terminal-window-tab.active {
  color: #f3fff5;
  border-color: #3c5846;
  background: #203025;
}

.usage-terminal-window-tab small {
  flex: 0 0 auto;
  color: #9fb3a4;
  font-size: 10px;
}

.usage-terminal-window-tab > svg:first-child {
  flex: 0 0 auto;
  color: #83d79a;
}

.usage-terminal-window-tab span {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.usage-terminal-window-tab > svg:last-child {
  flex: 0 0 auto;
  color: #a4afa7;
}

.usage-terminal-tab-add {
  display: grid;
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  place-items: center;
  color: #d8e2da;
  border-radius: 3px;
}

.usage-terminal-xterm {
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 8px 18px 4px;
  overflow: hidden;
  background: #0c0f0d;
}

.usage-terminal-xterm .xterm,
.usage-terminal-xterm .xterm-screen {
  height: 100%;
}

.usage-terminal-xterm .xterm-rows {
  color: #f2f2f2;
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 12px;
  font-kerning: none;
  white-space: pre;
}

.usage-terminal-xterm .xterm-cursor {
  display: none !important;
}

.usage-terminal-xterm .xterm-viewport {
  background: #0c0f0d !important;
  scrollbar-color: #48534b #0c0f0d;
  scrollbar-width: thin;
}

.usage-terminal-empty {
  margin: 0;
  padding: 28px 18px;
  color: #818b83;
  background: #0c0f0d;
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 14px;
}

.usage-terminal-command {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 0 7px;
}

.usage-terminal-command code {
  color: #e5edf8;
  font: inherit;
  font-weight: 700;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.usage-terminal-command code span {
  margin-right: 8px;
  color: #78a6ff;
}

.usage-terminal-command time {
  flex: 0 0 auto;
  color: #748196;
  font-family: Inter, sans-serif;
  font-size: 10px;
  font-weight: 400;
}

.usage-terminal-output {
  margin: 0 0 11px;
  padding: 0 0 11px;
  color: #c5cfdd;
  border: 0;
  border-bottom: 1px solid #27313e;
  background: transparent;
  white-space: pre-wrap;
}

.usage-terminal-output.error {
  color: #ffb1b5;
}

.usage-terminal-console > p {
  margin: 0;
  color: #7d899b;
}

.usage-log-entry {
  padding: 14px 20px;
  border-bottom: 1px solid #edf0f5;
}

.usage-log-entry:last-child {
  border-bottom: 0;
}

.usage-log-entry-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 8px;
  color: #8994a7;
  font-size: 12px;
}

.usage-log-entry-meta strong {
  color: #395690;
  font-size: 12px;
}

.usage-log-entry-meta time {
  color: #9aa4b3;
}

.usage-log-command,
.usage-log-entry pre {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 10px 12px;
  overflow-x: auto;
  color: #31435f;
  border: 1px solid #e4e9f1;
  border-radius: 5px;
  background: #f7f9fc;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.usage-log-execution {
  display: grid !important;
  gap: 8px;
}

.usage-log-execution code {
  font: inherit;
  white-space: inherit;
}

.usage-log-command-line {
  color: #31435f;
  font-weight: 700;
}

.usage-log-command-line::before {
  margin-right: 8px;
  color: #6480b2;
  content: ">";
}

.usage-log-output {
  padding-top: 8px;
  color: #526178;
  border-top: 1px solid #e4e9f1;
}

.usage-log-no-output {
  color: #9aa4b3;
  font-family: inherit;
  font-size: 11px;
}

.usage-log-entry pre.error {
  color: #a94d56;
  border-color: #f0d8db;
  background: #fff8f8;
}

.usage-log-upload {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: #4d6c59;
  border: 1px solid #dcebe1;
  border-radius: 5px;
  background: #f6fbf7;
}

.usage-log-upload > div {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 3px;
}

.usage-log-upload strong {
  overflow: hidden;
  color: #315643;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.usage-log-upload small {
  overflow: hidden;
  color: #7e9986;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.usage-log-state {
  flex: 0 0 auto;
  color: #4d6c59;
  font-size: 12px;
}

.usage-log-state.state-failed,
.usage-log-state.state-rejected,
.usage-log-state.state-cancelled {
  color: #b4565d;
}

.usage-log-error {
  margin: 7px 0 0;
  color: #b4565d;
  font-size: 12px;
}

.usage-log-empty {
  display: grid;
  min-height: 250px;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: #a2abba;
  font-size: 12px;
}

.usage-log-empty strong {
  color: #53627a;
}

.usage-log-empty p {
  margin: 0;
  font-size: 12px;
}

.settings-view {
  max-width: 980px;
}

.about-view {
  max-width: 980px;
}

.about-version-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  color: var(--accent);
  border-radius: 8px;
  background: var(--accent-soft);
}

.about-contact-panel {
  margin-bottom: 0;
}

.about-guide-panel {
  margin-top: 16px;
  margin-bottom: 0;
}

.about-section-heading {
  display: flex;
  align-items: center;
  gap: 8px;
}

.about-section-heading > svg {
  color: var(--accent);
}

.about-guide-number {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--accent-soft);
}

.about-guide-entry {
  display: grid;
  width: 100%;
  min-height: 76px;
  grid-template-columns: 30px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 12px;
  padding: 11px 19px;
  color: inherit;
  font: inherit;
  text-align: left;
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: background-color 150ms ease;
}

.about-guide-entry:hover {
  background: var(--surface-hover);
}

.about-guide-entry:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.about-guide-entry > svg {
  color: var(--accent);
}

.about-tutorial-backdrop {
  position: fixed;
  z-index: 21;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(12, 18, 29, 0.68);
}

.about-tutorial-dialog {
  display: flex;
  width: min(720px, 94vw);
  max-height: min(780px, 90vh);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 22px 58px rgba(15, 25, 43, 0.28);
}

.about-tutorial-header {
  position: relative;
  padding: 24px 52px 18px 24px;
  border-bottom: 1px solid var(--border);
}

.about-tutorial-kicker {
  color: var(--accent);
  font-size: 11px;
}

.about-tutorial-header h2 {
  margin: 4px 0 0;
  color: var(--text-strong);
  font-size: 20px;
  line-height: 1.35;
}

.about-tutorial-header p {
  margin: 7px 0 0;
  color: var(--text-subtle);
  font-size: 12px;
  line-height: 1.6;
}

.about-tutorial-content {
  padding: 18px 24px 24px;
  overflow-y: auto;
}

.about-tutorial-section + .about-tutorial-section {
  margin-top: 18px;
}

.about-tutorial-section-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
}

.about-tutorial-section-heading h3 {
  margin: 0;
  color: var(--text-strong);
  font-size: 14px;
}

.about-tutorial-section ol {
  margin: 9px 0 0;
  padding-left: 24px;
  color: var(--text-body);
  font-size: 13px;
  line-height: 1.75;
}

.about-tutorial-section li + li {
  margin-top: 4px;
}

.about-tutorial-note {
  margin-top: 20px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-soft);
}

.about-tutorial-note strong {
  color: var(--text-strong);
  font-size: 12px;
}

.about-tutorial-note p {
  margin: 5px 0 0;
  color: var(--text-subtle);
  font-size: 12px;
  line-height: 1.65;
}

.about-legal-panel {
  margin-top: 16px;
  margin-bottom: 0;
}

.about-legal-entry {
  display: grid;
  width: 100%;
  min-height: 78px;
  grid-template-columns: 36px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 12px;
  padding: 11px 19px;
  color: inherit;
  font: inherit;
  text-align: left;
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: background-color 150ms ease;
}

.about-legal-entry:hover {
  background: var(--surface-hover);
}

.about-legal-entry:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.about-legal-entry > svg {
  color: var(--accent);
}

.legal-terms-window {
  width: 100%;
  height: 100%;
  padding: 30px;
  overflow-y: auto;
  color: var(--text-body);
  background: var(--app-background);
}

.legal-terms-mobile-back {
  display: inline-flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  color: var(--accent);
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  cursor: pointer;
}

.legal-terms-header,
.legal-terms-card,
.legal-terms-contact {
  width: min(100%, 720px);
  margin-right: auto;
  margin-left: auto;
}

.legal-terms-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.legal-terms-header-icon,
.legal-terms-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  color: var(--accent);
  border-radius: 10px;
  background: var(--accent-soft);
}

.legal-terms-header-icon {
  width: 48px;
  height: 48px;
}

.legal-terms-header h1 {
  margin: 0;
  color: var(--text-strong);
  font-size: 23px;
  line-height: 1.3;
}

.legal-terms-header p {
  margin: 5px 0 0;
  color: var(--text-subtle);
  font-size: 13px;
}

.legal-home-notice-control {
  display: flex;
  min-width: 148px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-left: auto;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
}

.legal-home-notice-copy strong,
.legal-home-notice-copy small {
  display: block;
}

.legal-home-notice-copy strong {
  color: var(--text-strong);
  font-size: 12px;
}

.legal-home-notice-copy small {
  margin-top: 3px;
  color: var(--text-subtle);
  font-size: 10px;
}

.legal-terms-card {
  margin-bottom: 14px;
  padding: 22px 24px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.legal-terms-section-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.legal-terms-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.legal-terms-kicker {
  color: var(--text-subtle);
  font-size: 11px;
}

.legal-terms-section-heading h2 {
  margin: 2px 0 0;
  color: var(--text-strong);
  font-size: 16px;
}

.legal-terms-list,
.legal-terms-copy {
  margin: 0;
  color: var(--text-body);
  font-size: 13px;
  line-height: 1.8;
}

.legal-terms-list {
  padding-left: 22px;
}

.legal-terms-list li + li,
.legal-terms-copy p + p {
  margin-top: 8px;
}

.legal-terms-copy p {
  margin: 0;
}

.legal-terms-restricted {
  border-color: var(--toast-error-border);
}

.legal-terms-restricted .legal-terms-icon {
  color: var(--toast-error-strong);
  background: var(--danger-soft);
}

.legal-terms-restricted .legal-terms-section-heading h2 {
  color: var(--toast-error-strong);
}

.legal-terms-contact {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding: 16px 18px;
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.legal-terms-contact strong {
  color: var(--text-strong);
  font-size: 13px;
}

.legal-terms-contact p {
  margin: 4px 0 0;
  color: var(--text-subtle);
  font-size: 12px;
}

.about-contact-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  min-height: 78px;
  align-items: center;
  gap: 12px;
  padding: 11px 19px;
  border-bottom: 1px solid #edf0f4;
}

.about-contact-row:last-child {
  border-bottom: 0;
}

.about-contact-action {
  grid-template-columns: 36px minmax(0, 1fr) 18px;
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
  border-top: 0;
  border-right: 0;
  border-left: 0;
  background: transparent;
  cursor: pointer;
  transition: background-color 150ms ease;
}

.about-contact-action:hover {
  background: var(--surface-hover);
}

.about-contact-action:focus-visible {
  position: relative;
  z-index: 1;
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.about-contact-action small {
  color: var(--accent);
}

.about-contact-split {
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 8px;
  padding-top: 0;
  padding-bottom: 0;
}

.about-contact-open {
  display: grid;
  min-width: 0;
  min-height: 77px;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 11px 0;
  color: inherit;
  font: inherit;
  text-align: left;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.about-contact-open small {
  color: var(--accent);
}

.about-contact-open:focus-visible,
.about-copy-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.about-copy-button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  padding: 0;
  color: var(--accent);
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

.about-copy-button:hover {
  background: var(--accent-soft);
}

.about-copy-indicator {
  display: grid;
  place-items: center;
  color: var(--accent);
}

.about-contact-row a,
.about-contact-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.about-contact-row a {
  color: var(--accent);
  text-decoration: none;
}

.about-contact-row a:hover {
  text-decoration: underline;
}

.about-wechat-row {
  grid-template-columns: 36px minmax(0, 1fr) 64px;
}

.about-qr {
  display: block;
  width: 56px;
  height: 56px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #fff;
  object-fit: contain;
}

.about-qr-button {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: zoom-in;
}

.about-qr-button:hover .about-qr {
  border-color: var(--accent);
  box-shadow: 0 3px 12px rgba(39, 80, 185, 0.18);
}

.about-qr-backdrop {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(12, 18, 29, 0.68);
}

.about-qr-dialog {
  position: relative;
  display: grid;
  width: min(420px, 92vw);
  place-items: center;
  gap: 14px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 22px 58px rgba(15, 25, 43, 0.28);
}

.about-qr-large {
  display: block;
  width: min(320px, 72vw);
  height: min(320px, 72vw);
  object-fit: contain;
}

.about-qr-dialog--coffee {
  width: min(560px, 92vw);
}

.about-coffee-qr-large {
  width: min(430px, 78vw);
  height: min(680px, 72vh);
}

.about-qr-dialog p {
  margin: 0;
  color: var(--text-body);
  font-size: 12px;
}

.about-qr-close {
  position: absolute;
  top: 9px;
  right: 9px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: var(--text-subtle);
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

.about-qr-close:hover {
  color: var(--text-strong);
  background: var(--surface-hover);
}

.about-version-panel {
  display: flex;
  min-height: 68px;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  margin-bottom: 0;
  padding: 11px 19px;
}

.about-version-icon {
  width: 36px;
  height: 36px;
}

.about-version-value {
  margin-left: auto;
  color: var(--accent);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 14px;
}

.settings-group {
  margin-bottom: 16px;
  overflow: hidden;
}

.settings-heading {
  padding: 16px 19px;
  border-bottom: 1px solid #e8ebf0;
}

.settings-heading h2 {
  margin: 0;
  color: #263146;
  font-size: 15px;
}

.trusted-devices-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.trusted-device-search {
  width: min(220px, 38vw);
}

.theme-segmented {
  display: grid;
  width: 184px;
  height: 38px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--control-border);
  border-radius: 7px;
  background: var(--surface-soft);
}

.theme-segmented button {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 8px;
  color: var(--text-subtle);
  border: 0;
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
  transition:
    color 150ms ease,
    background 150ms ease,
    box-shadow 150ms ease;
}

.theme-segmented button:hover:not(.active) {
  color: var(--text-body);
  background: var(--surface-hover);
}

.theme-segmented button.active {
  color: var(--accent);
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(25, 39, 63, 0.12);
}

.language-select {
  width: 184px;
  height: 38px;
  padding: 0 34px 0 12px;
  color: var(--text-body);
  border: 1px solid var(--control-border);
  border-radius: 7px;
  outline: 0;
  background-color: var(--surface-soft);
  cursor: pointer;
}

.language-select:hover,
.language-select:focus-visible {
  border-color: var(--accent);
  background-color: var(--surface-hover);
}

.setting-row,
.trusted-device-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  min-height: 76px;
  align-items: center;
  gap: 12px;
  padding: 11px 19px;
  border-bottom: 1px solid #edf0f4;
}

.trusted-device-row .field-copy {
  min-width: 0;
}

.trusted-device-row .field-copy small {
  overflow: hidden;
  font-family: "Cascadia Mono", Consolas, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.revoke-trust-button {
  color: #a04747;
}

.trusted-device-empty {
  padding: 24px 19px;
  color: #929baa;
  font-size: 12px;
  text-align: center;
}

.settings-group > :last-child {
  border-bottom: 0;
}

.setting-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: #6076c4;
  border-radius: 7px;
  background: #f0f3fb;
}

.field-copy strong,
.field-copy small {
  display: block;
}

.field-copy strong {
  color: #344057;
  font-size: 14px;
}

.field-copy small {
  margin-top: 3px;
  color: #9099a9;
  font-size: 12px;
}

.launch-state {
  display: flex;
  width: 100%;
  height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 11px;
  color: #5c687b;
  background: #f4f6f9;
  font-size: 12px;
}

.launch-state svg {
  color: var(--accent);
}

.launch-state button {
  min-height: 34px;
  padding: 0 13px;
  color: #ffffff;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  cursor: pointer;
}

.device-view-loading {
  display: grid;
  width: calc(100% - clamp(32px, 5vw, 64px));
  min-height: 100%;
  margin: 0 auto;
  padding: 34px 0 26px;
  align-content: start;
  gap: 18px;
}

.device-view-loading > div {
  overflow: hidden;
  border: 1px solid #e2e6ed;
  border-radius: 7px;
  background: #ffffff;
}

.device-view-loading-header {
  width: min(280px, 70%);
  height: 52px;
}

.device-view-loading-summary {
  height: 78px;
}

.device-view-loading-list {
  min-height: 260px;
}

.device-view-loading > div::after {
  display: block;
  width: 42%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(238, 242, 248, 0.9),
    transparent
  );
  content: "";
  animation: loading-sweep 1.1s ease-in-out infinite;
}

.error-state > span {
  max-width: 480px;
  color: #8d5560;
  text-align: center;
}

.spin {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes loading-sweep {
  from {
    transform: translateX(-110%);
  }
  to {
    transform: translateX(350%);
  }
}

@keyframes radar-pulse {
  0% {
    transform: scale(0.75);
    opacity: 0.9;
  }
  100% {
    transform: scale(1.12);
    opacity: 0;
  }
}

@media (max-height: 700px) {
  .view {
    padding-top: 24px;
  }

  .view-header {
    margin-bottom: 17px;
  }

  .device-list-panel {
    min-height: 220px;
  }
}

@media (max-width: 700px), (pointer: coarse) {
  html,
  body,
  #app {
    min-width: 0;
    min-height: 0;
    overflow: hidden;
  }

  .app-shell {
    display: flex;
    flex-direction: column;
  }

  .main-content {
    order: 1;
    min-height: 0;
    flex: 1 1 auto;
  }

  .sidebar {
    order: 2;
    display: flex;
    width: 100%;
    height: 64px;
    min-height: 64px;
    flex: 0 0 64px;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 6px 10px max(6px, env(safe-area-inset-bottom));
    border-top: 1px solid #dedfe2;
    border-right: 0;
  }

  .mobile-tab-bar {
    display: grid;
    width: 100%;
    height: 64px;
    min-height: 64px;
    flex: 0 0 64px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    order: 2;
    padding: 6px 12px max(6px, env(safe-area-inset-bottom));
    border-top: 1px solid #dedfe2;
    background: var(--surface);
  }

  .mobile-tab-bar button {
    display: grid;
    min-height: 50px;
    place-items: center;
    gap: 2px;
    padding: 3px 2px;
    color: var(--muted);
    border: 0;
    border-radius: 7px;
    background: transparent;
    cursor: pointer;
    font-size: 12px;
  }

  .mobile-tab-bar button.active {
    color: var(--accent);
    background: var(--accent-soft);
  }

  .brand-block,
  .sidebar-status {
    display: none;
  }

  .primary-nav {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }

  .primary-nav button {
    min-height: 50px;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    padding: 4px 2px;
    border-radius: 7px;
    font-size: 12px;
  }

  .view,
  .devices-view {
    width: 100%;
    min-height: 100%;
    padding: 20px 14px 18px;
  }

  .device-view-loading {
    width: 100%;
    padding: 20px 14px 18px;
  }

  .devices-view {
    height: auto;
  }

  .view-header {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 16px;
  }

  .view-header h1 {
    font-size: 23px;
  }

  .view-header p:not(.section-label) {
    font-size: 12px;
  }

  .view-header .primary-button {
    width: 100%;
  }

  .mobile-app-shell .view,
  .mobile-app-shell .devices-view {
    padding-top: 60px;
  }

  .mobile-app-shell .view-header {
    position: fixed;
    z-index: 10;
    top: env(safe-area-inset-top);
    right: 0;
    left: 0;
    display: grid;
    height: 52px;
    place-items: center;
    justify-items: center;
    margin: 0;
    padding: 0 56px;
    background: var(--app-background);
  }

  .ios-runtime .mobile-app-shell .view-header {
    top: max(44px, env(safe-area-inset-top));
  }

  .mobile-app-shell .view-header > div {
    min-width: 0;
    text-align: center;
  }

  .mobile-app-shell .view-header h1 {
    overflow: hidden;
    font-size: 20px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .status-strip,
  .transfer-summary {
    grid-template-columns: 1fr;
  }

  .home-license-notice {
    grid-template-columns: 32px minmax(0, 1fr) 18px;
    gap: 9px;
    padding: 10px 11px;
  }

  .home-license-notice-icon {
    width: 32px;
    height: 32px;
  }

  .home-license-notice-action > span {
    display: none;
  }

  .status-strip > div,
  .transfer-summary > div {
    min-height: 62px;
    padding: 11px 14px;
    border-right: 0;
    border-bottom: 1px solid #e8ebf0;
  }

  .status-strip > div:last-child,
  .transfer-summary > div:last-child {
    border-bottom: 0;
  }

  .local-password-edit input {
    width: min(220px, 60vw);
  }

  .mobile-status-strip {
    grid-template-columns: 1fr;
  }

  .mobile-status-strip > div {
    border-bottom: 0;
  }

  .local-device-edit input {
    width: min(240px, calc(100vw - 132px));
  }

  .device-list-panel,
  .connection-records-panel {
    min-height: 0;
    flex: 1;
  }

  .panel-heading {
    min-height: auto;
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    padding: 13px 14px;
  }

  .device-tools,
  .connection-records-heading .search-box {
    width: 100%;
  }

  .device-tools .search-box {
    width: auto;
    flex: 1;
  }

  .search-box {
    height: 36px;
  }

  .device-row {
    grid-template-columns: 38px minmax(0, 1fr) 34px;
    gap: 9px;
    min-height: 68px;
    padding: 9px 12px;
  }

  .device-entry.long-press-enabled {
    -webkit-touch-callout: none;
    user-select: none;
  }

  .device-entry.mobile-device-link {
    cursor: pointer;
  }

  .device-entry.mobile-device-link .device-row:active {
    background: #f3f6fc;
  }

  .device-os {
    width: 38px;
    height: 38px;
  }

  .device-actions {
    min-width: 34px;
  }

  .mobile-device-link-icon {
    flex: 0 0 auto;
    color: #4564c5;
    pointer-events: none;
  }

  .mobile-device-link-icon.disabled {
    color: #a8afbb;
  }

  .incoming-session-status,
  .source-badge {
    display: none;
  }

  .device-main small {
    font-size: 12px;
  }

  .connection-record-table-header {
    display: none;
  }

  .connection-record-row {
    grid-template-columns: 36px minmax(0, 1fr) auto;
    gap: 9px;
    min-height: 68px;
    padding: 9px 12px;
  }

  .connection-record-row code {
    grid-column: 2;
    grid-row: 2;
    font-size: 12px;
  }

  .connection-record-row time {
    display: none;
  }

  .connection-state {
    grid-column: 3;
    grid-row: 1 / span 2;
  }

  .trusted-devices-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .trusted-device-search {
    width: 100%;
  }

  .about-contact-row {
    padding: 11px 13px;
  }

  .about-contact-row.about-contact-split {
    padding-top: 0;
    padding-bottom: 0;
  }

  .about-guide-entry {
    padding-right: 13px;
    padding-left: 13px;
  }

  .about-tutorial-backdrop {
    padding: 12px;
  }

  .about-tutorial-header {
    padding: 20px 48px 16px 18px;
  }

  .about-tutorial-content {
    padding: 16px 18px 20px;
  }

  .about-legal-entry {
    padding: 11px 13px;
  }

  .legal-terms-window {
    padding:
      calc(20px + env(safe-area-inset-top))
      calc(14px + env(safe-area-inset-right))
      calc(20px + env(safe-area-inset-bottom))
      calc(14px + env(safe-area-inset-left));
  }

  .legal-terms-card {
    padding: 18px 16px;
  }

  .legal-terms-header {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 10px;
  }

  .legal-terms-header-icon {
    display: none;
  }

  .legal-terms-header-copy {
    min-width: 0;
  }

  .legal-terms-header h1 {
    font-size: clamp(18px, 5.5vw, 21px);
    white-space: nowrap;
  }

  .legal-terms-header p {
    display: none;
  }

  .legal-home-notice-control {
    width: 100%;
    grid-column: 1 / -1;
    margin-left: 0;
  }

  .about-version-panel {
    padding: 11px 13px;
  }

  .about-qr-dialog {
    padding: 24px 18px;
  }

  .setting-row,
  .trusted-device-row {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 9px;
    padding: 11px 13px;
  }

  .theme-setting-row,
  .language-setting-row {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .theme-segmented {
    width: 100%;
    height: 38px;
    grid-column: 1 / -1;
  }

  .language-select {
    width: 100%;
    grid-column: 1 / -1;
  }

  .pairing-window {
    padding: 18px 14px;
  }

  .pairing-window-card {
    width: min(100%, 390px);
  }

  .pairing-window-card h1 {
    font-size: 18px;
  }

  /* Mobile keeps the active device identity and RTT in the compact header. */
  .remote-session-header {
    height: 36px;
    min-height: 36px;
    padding: 0 10px;
  }

  .remote-mobile-back-button {
    display: grid;
  }

  .remote-tab-strip {
    justify-content: flex-start;
    overflow: hidden;
  }

  .remote-tabs {
    flex: 1 1 auto;
    min-width: 0;
    overflow: visible;
  }

  .remote-tab {
    width: auto;
    min-width: 0;
    max-width: none;
    flex: 0 0 auto;
    height: 30px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .remote-tab:not(.active) {
    display: none;
  }

  .remote-tab-select {
    min-width: 0;
    gap: 5px;
    flex: 0 0 auto;
  }

  .remote-tab-device {
    max-width: min(38vw, 140px);
  }

  .remote-tab-close,
  .remote-tab-drag-area {
    display: none;
  }

  .remote-tab-status {
    display: grid;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    margin-left: 2px;
    place-items: center;
  }

  .remote-tab-add {
    display: none;
  }

  .remote-tab-network {
    max-width: 108px;
    overflow: hidden;
    padding: 3px 6px;
    font-size: 12px;
    text-overflow: ellipsis;
  }

  .remote-session-actions {
    display: none;
  }

  .remote-close-confirmation-backdrop {
    padding: max(14px, env(safe-area-inset-top)) 14px
      max(14px, env(safe-area-inset-bottom));
  }

  .remote-close-confirmation-dialog {
    width: 100%;
    padding: 16px;
  }

  .remote-close-confirmation-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .remote-close-confirmation-actions button {
    width: 100%;
  }

  .remote-terminal-title {
    min-height: 38px;
    justify-content: flex-end;
    padding: 7px 10px;
    gap: 7px;
  }

  .remote-terminal-title > svg,
  .remote-terminal-title > span {
    display: none;
  }

  .remote-terminal-title > small,
  .remote-terminal-title .terminal-upload-readiness {
    display: none;
  }

  .remote-terminal-title .terminal-upload-picker,
  .remote-terminal-title .terminal-upload-cancel {
    display: grid;
    flex: 0 0 auto;
  }

  .remote-terminal,
  .remote-peer-disconnected {
    inset: 36px 0 0;
  }

  .remote-terminal.has-mobile-keyboard {
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    /* Keep the terminal and its shortcut row above an overlay-style IME.
       When the platform uses adjustResize this inset is zero because the
       WebView viewport has already been reduced by the system. */
    bottom: var(--mobile-ime-inset, 0px);
  }

  /* The iOS status bar overlays the Tao view. Reserve its safe-area inset for
     the remote header and terminal while leaving Android's existing geometry
     unchanged. Screen mode hides the status bar natively, so it stays edge to
     edge. */
  .ios-runtime .remote-control-window:not(.mobile-screen-mode) .remote-session-header {
    min-height: calc(36px + max(44px, env(safe-area-inset-top)));
    padding-top: max(44px, env(safe-area-inset-top));
  }

  .ios-runtime .remote-control-window:not(.mobile-screen-mode) {
    grid-template-rows: calc(36px + max(44px, env(safe-area-inset-top))) minmax(0, 1fr);
  }

  .ios-runtime .remote-control-window:not(.mobile-screen-mode) .remote-terminal,
  .ios-runtime .remote-control-window:not(.mobile-screen-mode) .remote-peer-disconnected {
    inset: calc(36px + max(44px, env(safe-area-inset-top))) 0 0;
  }

  .mobile-terminal-command-bar {
    display: flex;
    min-width: 0;
    flex: 1 1 auto;
    align-items: center;
    gap: 7px;
    margin-right: auto;
  }

  .mobile-terminal-command-bar input {
    width: min(30vw, 150px);
    min-width: 0;
    height: 30px;
    box-sizing: border-box;
    flex: 1 1 auto;
    padding: 0 8px;
    color: #d8e6d9;
    border: 1px solid #3a4d3f;
    border-radius: 5px;
    outline: 0;
    background: #1c261f;
    font-family: Consolas, "Cascadia Mono", monospace;
    font-size: 12px;
  }

  .mobile-terminal-command-bar input:focus {
    border-color: #70d58e;
    box-shadow: 0 0 0 2px rgb(112 213 142 / 18%);
  }

  .mobile-terminal-command-bar input:disabled {
    cursor: not-allowed;
    opacity: 0.55;
  }

  .mobile-terminal-command-bar button {
    min-width: 42px;
    height: 30px;
    padding: 0 7px;
    color: #081d0e;
    border: 1px solid #70d58e;
    border-radius: 5px;
    background: #70d58e;
    font-family: Inter, sans-serif;
    font-size: 12px;
    font-weight: 700;
    touch-action: manipulation;
  }

  .mobile-terminal-command-bar button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
  }

  .mobile-terminal-command-bar button:active:not(:disabled) {
    background: #92e5aa;
  }

  .mobile-terminal-keyboard {
    display: grid;
    grid-row: 4;
    grid-template-columns:
      repeat(4, minmax(34px, 40px)) minmax(50px, 64px)
      40px 36px;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    padding: 7px max(8px, env(safe-area-inset-right))
      max(7px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    border-top: 1px solid #2c3a2f;
    background: #111612;
  }

  .mobile-terminal-keyboard.collapsed {
    display: flex;
    position: absolute;
    z-index: 5;
    right: max(7px, env(safe-area-inset-right));
    bottom: max(7px, env(safe-area-inset-bottom));
    width: 44px;
    min-height: 0;
    justify-content: flex-end;
    padding: 3px;
    border: 1px solid #34463a;
    border-radius: 6px;
    background: rgba(17, 22, 18, 0.92);
  }

  .mobile-terminal-keyboard button {
    display: grid;
    width: 100%;
    min-width: 0;
    height: 38px;
    place-items: center;
    padding: 0 4px;
    color: #d8e6d9;
    border: 1px solid #3a4d3f;
    border-radius: 5px;
    background: #1c261f;
    font-family: Inter, sans-serif;
    font-size: 12px;
    font-weight: 650;
    touch-action: manipulation;
  }

  .mobile-terminal-keyboard button:active {
    color: #ffffff;
    border-color: #70d58e;
    background: #2e4934;
  }

  .mobile-terminal-keyboard .mobile-terminal-control-key {
    color: #f0c883;
  }

  .mobile-terminal-keyboard .mobile-terminal-enter-key {
    color: #081d0e;
    border-color: #70d58e;
    background: #70d58e;
  }

  .mobile-terminal-keyboard .mobile-terminal-keyboard-toggle {
    width: 36px;
    padding: 0;
    color: #9eb6a3;
    border-color: transparent;
    background: transparent;
  }

  .mobile-terminal-keyboard.collapsed .mobile-terminal-keyboard-toggle {
    height: 36px;
  }

  .terminal-upload-dialog-backdrop {
    padding: max(10px, env(safe-area-inset-top)) 10px
      max(10px, env(safe-area-inset-bottom));
    overflow: auto;
  }

  .terminal-upload-dialog {
    width: 100%;
    max-width: none;
    max-height: calc(100dvh - 20px);
    overflow-y: auto;
    padding: 14px;
  }

  .terminal-upload-dialog h2 {
    font-size: 15px;
  }

  .terminal-upload-dialog p {
    margin: 7px 0 11px;
    font-size: 12px;
  }

  .upload-target-options label {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 7px;
    padding: 8px;
  }

  .upload-target-options small {
    grid-column: 2;
  }

  .upload-target-list li {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 5px;
  }

  .upload-target-list li small {
    grid-column: 1 / -1;
    grid-row: 2;
    max-width: 100%;
    text-align: left;
  }

  .terminal-upload-dialog dl > div {
    gap: 10px;
    padding: 8px;
  }

  .terminal-upload-dialog-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
    gap: 7px;
  }

  .terminal-upload-dialog-actions button {
    width: 100%;
    min-width: 0;
  }
}

/* The remote-control workspace has its own fixed console palette. These
   overrides cover the main window and the standalone pairing window. */
[data-theme="dark"] body {
  color: var(--text-body);
  background: var(--app-background);
}

[data-theme="dark"] .app-shell,
[data-theme="dark"] .launch-state,
[data-theme="dark"] .pairing-window {
  color: var(--text-body);
  background: var(--app-background);
}

[data-theme="dark"] .sidebar {
  color: #a9b2bf;
  background: #0c0e11;
  border-color: #292e34;
}

[data-theme="dark"] .brand-block small,
[data-theme="dark"] .sidebar-status small {
  color: #7f8997;
}

[data-theme="dark"] .brand-block strong,
[data-theme="dark"] .sidebar-status strong {
  color: #f1f5fb;
}

[data-theme="dark"] .primary-nav button {
  color: #9ba5b3;
}

[data-theme="dark"] .primary-nav button:hover {
  color: #f0f4fa;
  background: #1a1e23;
}

[data-theme="dark"] .primary-nav button.active {
  color: #ffffff;
  background: #242a32;
}

[data-theme="dark"] .primary-nav button.active svg {
  color: #78a9ff;
}

[data-theme="dark"] .sidebar-status {
  border-color: #292e34;
}

[data-theme="dark"] .status-strip,
[data-theme="dark"] .transfer-summary,
[data-theme="dark"] .device-list-panel,
[data-theme="dark"] .transfer-panel,
[data-theme="dark"] .connection-records-panel,
[data-theme="dark"] .settings-group {
  border-color: var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

[data-theme="dark"] .status-strip > div,
[data-theme="dark"] .transfer-summary > div,
[data-theme="dark"] .panel-heading,
[data-theme="dark"] .settings-heading,
[data-theme="dark"] .setting-row,
[data-theme="dark"] .about-contact-row,
[data-theme="dark"] .trusted-device-row,
[data-theme="dark"] .device-entry,
[data-theme="dark"] .connection-record-row {
  border-color: var(--divider);
}

[data-theme="dark"] .status-strip small,
[data-theme="dark"] .transfer-summary small,
[data-theme="dark"] .panel-heading span,
[data-theme="dark"] .device-main small,
[data-theme="dark"] .connection-device-copy small,
[data-theme="dark"] .connection-record-row time,
[data-theme="dark"] .field-copy small,
[data-theme="dark"] .trusted-device-empty,
[data-theme="dark"] .empty-devices p,
[data-theme="dark"] .empty-transfer p,
[data-theme="dark"] .empty-connections p,
[data-theme="dark"] .device-id,
[data-theme="dark"] .local-password span {
  color: var(--text-subtle);
}

[data-theme="dark"] .status-strip strong,
[data-theme="dark"] .transfer-summary strong,
[data-theme="dark"] .panel-heading h2,
[data-theme="dark"] .settings-heading h2,
[data-theme="dark"] .field-copy strong,
[data-theme="dark"] .device-main strong,
[data-theme="dark"] .connection-device-copy strong,
[data-theme="dark"] .empty-devices h3,
[data-theme="dark"] .empty-transfer h3,
[data-theme="dark"] .empty-connections h3 {
  color: var(--text-strong);
}

[data-theme="dark"] .local-device-edit input,
[data-theme="dark"] .local-password-edit input,
[data-theme="dark"] .pairing-window-card input {
  color: var(--text-strong);
  border-color: var(--control-border);
  background: var(--surface-soft);
}

[data-theme="dark"] input::placeholder {
  color: #7f8996;
}

[data-theme="dark"] .search-box,
[data-theme="dark"] .icon-button,
[data-theme="dark"] .planned-badge {
  color: var(--text-subtle);
  border-color: var(--control-border);
  background: var(--surface-soft);
}

[data-theme="dark"] .search-box input {
  color: var(--text-body);
  border-color: transparent;
  background: transparent;
}

[data-theme="dark"] .icon-button:hover:not(:disabled),
[data-theme="dark"] .device-row:hover,
[data-theme="dark"] .connection-record-row:hover,
[data-theme="dark"] .device-entry.mobile-device-link .device-row:active {
  background: var(--surface-hover);
}

[data-theme="dark"] .status-icon.blue,
[data-theme="dark"] .device-os,
[data-theme="dark"] .connection-device-icon,
[data-theme="dark"] .computer-mark,
[data-theme="dark"] .empty-transfer > span,
[data-theme="dark"] .empty-connections > span,
[data-theme="dark"] .setting-icon {
  color: #8ab5ff;
  border-color: #344b70;
  background: var(--accent-soft);
}

[data-theme="dark"] .status-icon.green {
  color: #78d8af;
  background: var(--success-soft);
}

[data-theme="dark"] .status-icon.amber {
  color: #efbd70;
  background: var(--warning-soft);
}

[data-theme="dark"] .status-icon.red,
[data-theme="dark"] .device-delete-confirmation-icon {
  color: #ff939a;
  background: var(--danger-soft);
}

[data-theme="dark"] .local-password strong,
[data-theme="dark"] .connection-record-row code,
[data-theme="dark"] .usage-log-button,
[data-theme="dark"] .text-action {
  color: #8ab5ff;
}

[data-theme="dark"] .source-badge {
  color: #83dbb6;
  background: var(--success-soft);
}

[data-theme="dark"] .outline-button {
  color: #a9c7ff;
  border-color: #3c5278;
  background: #1c2940;
}

[data-theme="dark"] .outline-button:hover:not(:disabled) {
  border-color: #5879ac;
  background: #243753;
}

[data-theme="dark"] .outline-button:disabled,
[data-theme="dark"] .primary-button:disabled {
  color: #747e8b;
  border-color: #343a42;
  background: #25292e;
}

[data-theme="dark"] .device-delete-button {
  color: #ffadb2;
  border-color: #684046;
  background: var(--danger-soft);
}

[data-theme="dark"] .device-delete-button:hover:not(:disabled) {
  color: #ffd0d2;
  border-color: #8b5159;
  background: #44272c;
}

[data-theme="dark"] .discovery-error {
  color: #ffc0c4;
  border-color: #714349;
  background: #342124;
}

[data-theme="dark"] .toggle > span {
  background: #464d56;
}

[data-theme="dark"] .toggle > span::before {
  background: #f4f7fb;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .device-delete-confirmation-backdrop,
[data-theme="dark"] .usage-log-backdrop {
  background: rgba(0, 0, 0, 0.68);
}

[data-theme="dark"] .device-delete-confirmation-dialog,
[data-theme="dark"] .usage-log-dialog {
  color: var(--text-body);
  border-color: var(--border);
  background: var(--surface);
  box-shadow: 0 22px 58px rgba(0, 0, 0, 0.48);
}

[data-theme="dark"] .device-delete-confirmation-dialog p,
[data-theme="dark"] .usage-log-dialog header p {
  color: var(--text-subtle);
}

[data-theme="dark"] .device-delete-confirmation-actions button,
[data-theme="dark"] .pairing-window-cancel {
  color: var(--text-body);
  border-color: var(--control-border);
  background: var(--surface-soft);
}

[data-theme="dark"]
  .device-delete-confirmation-actions
  button:hover:not(:disabled),
[data-theme="dark"] .pairing-window-cancel:hover:not(:disabled) {
  border-color: #505863;
  background: var(--surface-hover);
}

[data-theme="dark"] .incoming-session-status {
  color: #83cba9;
}

[data-theme="dark"] .device-entry.mobile-online-device .device-os {
  color: #e7a64a;
  background: #362b1b;
}

[data-theme="dark"] .device-entry.mobile-online-device .device-main strong {
  color: #f0bd68;
}

[data-theme="dark"] .device-entry.mobile-online-device .incoming-session-status {
  color: #e7b35f;
}

[data-theme="dark"] .device-entry.mobile-online-device .incoming-session-status small {
  color: #c79e5a;
}

[data-theme="dark"] .incoming-session-status small {
  color: #799a8a;
}

[data-theme="dark"] .disconnect-session {
  color: #e6b276;
  border-color: #604d38;
  background: #30281f;
}

[data-theme="dark"] .pairing-window-icon {
  color: #82afff;
  border-color: #39537d;
  background: var(--accent-soft);
  box-shadow: var(--shadow-soft);
}

[data-theme="dark"] .pairing-window-kicker {
  color: #82afff;
}

[data-theme="dark"] .pairing-window-card h1,
[data-theme="dark"] .usage-log-dialog h2 {
  color: var(--ink);
}

[data-theme="dark"] .pairing-window-copy {
  color: var(--text-subtle);
}

[data-theme="dark"] .orbit {
  border-color: #3a4656;
}

[data-theme="dark"] .connection-record-table-header {
  color: var(--text-subtle);
  border-color: var(--divider);
  background: #15181c;
}

[data-theme="dark"] .connection-state {
  color: #9ba5b1;
}

[data-theme="dark"] .connection-state i {
  background: #707984;
}

[data-theme="dark"] .connection-state.active {
  color: #79d7af;
}

[data-theme="dark"] .usage-log-dialog > header,
[data-theme="dark"] .usage-log-entry,
[data-theme="dark"] .usage-log-tabs {
  border-color: var(--divider);
}

[data-theme="dark"] .usage-log-dialog header button {
  color: var(--text-subtle);
}

[data-theme="dark"] .usage-log-dialog header button:hover {
  color: var(--text-strong);
  background: var(--surface-hover);
}

[data-theme="dark"] .usage-log-entry-meta,
[data-theme="dark"] .usage-log-entry-meta time,
[data-theme="dark"] .usage-log-empty {
  color: var(--text-subtle);
}

[data-theme="dark"] .usage-log-entry-meta strong,
[data-theme="dark"] .usage-log-empty strong {
  color: #a9c7ff;
}

[data-theme="dark"] .usage-log-command,
[data-theme="dark"] .usage-log-entry pre {
  color: #d5deea;
  border-color: var(--control-border);
  background: #121519;
}

[data-theme="dark"] .usage-log-command-line {
  color: #d5deea;
}

[data-theme="dark"] .usage-log-command-line::before {
  color: #82afff;
}

[data-theme="dark"] .usage-log-output {
  color: #b8c3d1;
  border-color: var(--control-border);
}

[data-theme="dark"] .usage-log-no-output {
  color: var(--text-subtle);
}

[data-theme="dark"] .usage-log-tabs button:hover,
[data-theme="dark"] .usage-log-tabs button.active {
  color: #b4ccff;
  border-color: #3b4d6a;
  background: #1a2535;
}

[data-theme="dark"] .usage-terminal-heading,
[data-theme="dark"] .usage-terminal-heading > div {
  color: var(--text-subtle);
}

[data-theme="dark"] .usage-terminal-heading > div {
  color: #a9c7ff;
}

[data-theme="dark"] .usage-log-entry pre.error {
  color: #ffb1b5;
  border-color: #684047;
  background: #2f1d21;
}

[data-theme="dark"] .usage-log-upload {
  color: #9ad8b8;
  border-color: #365849;
  background: #192922;
}

[data-theme="dark"] .usage-log-upload strong {
  color: #b9e6cd;
}

[data-theme="dark"] .usage-log-upload small {
  color: #7fa691;
}

[data-theme="dark"] .theme-segmented button.active {
  color: #9fc1ff;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.36);
}

[data-theme="dark"] .launch-state {
  color: var(--text-subtle);
}

[data-theme="dark"] .device-view-loading > div {
  border-color: var(--border);
  background: var(--surface);
}

[data-theme="dark"] .device-view-loading > div::after {
  background: linear-gradient(
    90deg,
    transparent,
    rgba(70, 78, 88, 0.35),
    transparent
  );
}

[data-theme="dark"] .error-state > span {
  color: #d49ba4;
}

/* Remote-control and file-manager surfaces use a separate console palette.
   Keep that palette theme-aware so every workspace follows the main window. */
[data-theme="light"] .remote-document,
[data-theme="light"] .remote-document body,
[data-theme="light"] .remote-document #app {
  background: #f4f7fb;
}

[data-theme="light"] .remote-control-window {
  color: #182230;
  background: #f4f7fb;
}

[data-theme="light"] .remote-session-header {
  color: #243247;
  border-bottom-color: #d7dee9;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(28, 45, 72, 0.08);
}

[data-theme="light"] .remote-mobile-back-button,
[data-theme="light"] .remote-session-actions button,
[data-theme="light"] .remote-tab-add,
[data-theme="light"] .remote-tab-overflow-button {
  color: #64748b;
}

[data-theme="light"] .remote-mobile-back-button:hover,
[data-theme="light"] .remote-session-actions button:hover,
[data-theme="light"] .remote-tab-add:hover,
[data-theme="light"] .remote-tab-overflow-button:hover,
[data-theme="light"] .remote-tab-overflow-button[aria-expanded="true"] {
  color: #1d4ed8;
  border-color: #c9d7ee;
  background: #edf3ff;
}

[data-theme="light"] .remote-tab {
  color: #64748b;
}

[data-theme="light"] .remote-tab.active {
  color: #1e293b;
  border-color: #d5deeb;
  background: #edf3fb;
}

[data-theme="light"] .remote-tab-device small,
[data-theme="light"] .remote-tab-overflow-menu small {
  color: #8190a5;
}

[data-theme="light"] .remote-tab-network {
  color: #16835a;
  background: #e8f7ef;
}

[data-theme="light"] .remote-tab-overflow-menu {
  color: #243247;
  border-color: #d2dce9;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(31, 52, 82, 0.18);
}

[data-theme="light"] .remote-tab-overflow-menu > button {
  color: #3f5068;
}

[data-theme="light"] .remote-tab-overflow-menu > button:hover,
[data-theme="light"] .remote-tab-overflow-menu > button.active {
  color: #1e3a70;
  background: #edf3fb;
}

[data-theme="light"] .remote-session-actions .remote-tools-button,
[data-theme="light"] .remote-session-actions .remote-global-action-button {
  color: #496fd0;
}

[data-theme="light"] .remote-session-actions .remote-tools-button:hover,
[data-theme="light"]
  .remote-session-actions
  .remote-global-action-button:hover:not(:disabled) {
  color: #244cae;
  background: #e5edff;
}

[data-theme="light"] .remote-terminal,
[data-theme="light"] .remote-peer-disconnected,
[data-theme="light"] .remote-connection-failed,
[data-theme="light"] .remote-import-waiting {
  color: #243247;
  background: #f8fafc;
}

[data-theme="light"] .remote-terminal-title,
[data-theme="light"] .terminal-tab-bar {
  color: #34445b;
  border-color: #dce3ed;
  background: #ffffff;
}

[data-theme="light"] .remote-terminal-title svg,
[data-theme="light"] .remote-tab-select svg,
[data-theme="light"] .remote-tab-terminal-state,
[data-theme="light"] .remote-terminal-title small {
  color: #4d73cf;
}

[data-theme="light"] .terminal-sync-toggle {
  color: #52627a;
}

[data-theme="light"] .terminal-sync-switch > span {
  border-color: #c3cfdf;
  background: #edf1f6;
}

[data-theme="light"] .terminal-sync-switch > span::before {
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(40, 55, 79, 0.2);
}

[data-theme="light"] .terminal-sync-switch input:checked + span {
  border-color: #4d73cf;
  background: #4d73cf;
}

[data-theme="light"] .terminal-upload-button {
  color: #4d73cf;
  border-color: #c6d3ea;
  background: #f2f6ff;
}

[data-theme="light"] .terminal-upload-button:hover:not(:disabled) {
  color: #244cae;
  border-color: #8fa9df;
  background: #e5edff;
}

[data-theme="light"] .terminal-tab {
  color: #607089;
  border-color: #d5deea;
  background: #f8fafc;
}

[data-theme="light"] .terminal-tab:hover,
[data-theme="light"] .terminal-tab.active {
  color: #263b61;
  border-color: #9db4e2;
  background: #eaf1ff;
}

[data-theme="light"] .terminal-tab-add,
[data-theme="light"] .terminal-tab-add-options,
[data-theme="light"] .terminal-tab-add-options button {
  color: #52627a;
  border-color: #cbd7e6;
  background: #ffffff;
}

[data-theme="light"] .terminal-tab-add-options button:hover {
  color: #244cae;
  border-color: #8fa9df;
  background: #edf3ff;
}

[data-theme="light"] .remote-terminal-scroll {
  background: #f8fafc;
}

[data-theme="light"] .remote-terminal-disconnected {
  color: #52627a;
  background: #f8fafc;
}

[data-theme="light"] .remote-terminal-disconnected > button {
  color: #ffffff;
  border-color: #397347;
  background: #397347;
}

[data-theme="light"] .remote-xterm .xterm .xterm-rows {
  color: #182230;
}

[data-theme="light"] .remote-xterm .xterm .xterm-viewport,
[data-theme="light"] .remote-xterm .xterm-screen {
  background: #ffffff !important;
}

[data-theme="light"] .remote-xterm .xterm .xterm-cursor.xterm-cursor-block {
  color: #ffffff;
  background-color: #2459c4;
}

[data-theme="light"]
  .remote-xterm
  .xterm.focus
  .xterm-cursor.xterm-cursor-blink.xterm-cursor-block,
[data-theme="light"]
  .remote-xterm
  .xterm
  .xterm-rows.xterm-focus
  .xterm-cursor.xterm-cursor-blink.xterm-cursor-block {
  animation-name: remote-terminal-cursor-blink-light !important;
}

[data-theme="light"] .remote-xterm .xterm .xterm-selection div {
  background-color: #b8cff7 !important;
}

[data-theme="light"] .remote-xterm .xterm:not(.focus) .xterm-selection div {
  background-color: #d6e3f7 !important;
}

@keyframes remote-terminal-cursor-blink-light {
  0%,
  49% {
    color: #ffffff;
    background-color: #2459c4;
  }

  50%,
  100% {
    color: #2459c4;
    background-color: transparent;
  }
}

[data-theme="light"] .remote-control-canvas {
  color: #27364c;
  background: #eef2f7;
}

[data-theme="light"] .remote-connection-failed > strong {
  color: #8e3038;
}

[data-theme="light"] .remote-connection-failed > span,
[data-theme="light"] .remote-connection-failed > p {
  color: #6e7d91;
}

[data-theme="light"] .remote-connection-failed > button {
  color: #ffffff;
  border-color: #3568e8;
  background: #3568e8;
}

[data-theme="light"] .remote-import-failure-notice {
  color: #7f2830;
  border-color: #e3aeb2;
  background: #fff3f3;
  box-shadow: 0 12px 30px rgba(95, 37, 45, 0.16);
}

[data-theme="light"] .remote-import-failure-notice small,
[data-theme="light"] .remote-import-failure-notice > button:last-child {
  color: #a24d54;
}

[data-theme="light"] .remote-import-failure-notice > button:first-child:hover,
[data-theme="light"] .remote-import-failure-notice > button:last-child:hover {
  background: #ffe7e8;
}

[data-theme="light"] .remote-close-confirmation-backdrop,
[data-theme="light"] .terminal-shell-dialog-backdrop,
[data-theme="light"] .sync-command-log-backdrop,
[data-theme="light"] .terminal-upload-dialog-backdrop,
[data-theme="light"] .file-manager-backdrop {
  background: rgba(25, 39, 61, 0.35);
}

[data-theme="light"] .remote-close-confirmation-dialog,
[data-theme="light"] .remote-import-failure-dialog,
[data-theme="light"] .terminal-shell-dialog,
[data-theme="light"] .sync-command-log-dialog,
[data-theme="light"] .terminal-upload-dialog,
[data-theme="light"] .file-manager-dialog {
  color: #26364d;
  border-color: #d2dce9;
  background: #ffffff;
  box-shadow: 0 18px 48px rgba(28, 48, 79, 0.18);
}

[data-theme="light"] .remote-close-confirmation-dialog p,
[data-theme="light"] .terminal-shell-dialog p,
[data-theme="light"] .terminal-upload-dialog p,
[data-theme="light"] .sync-command-log-dialog header small,
[data-theme="light"] .sync-command-log-entry-heading time,
[data-theme="light"] .sync-command-log-entry-heading > span,
[data-theme="light"] .sync-command-log-empty {
  color: #748197;
}

[data-theme="light"] .remote-close-confirmation-actions button,
[data-theme="light"] .terminal-shell-dialog-actions button,
[data-theme="light"] .terminal-upload-dialog-actions button {
  color: #40516a;
  border-color: #cbd6e4;
  background: #f7f9fc;
}

[data-theme="light"] .remote-close-confirmation-actions button:hover,
[data-theme="light"] .terminal-shell-dialog-actions button:hover,
[data-theme="light"] .terminal-upload-dialog-actions button:hover {
  border-color: #90a9db;
  background: #edf3ff;
}

[data-theme="light"]
  .remote-close-confirmation-actions
  .remote-close-confirm-button,
[data-theme="light"] .terminal-shell-dialog-actions button.primary,
[data-theme="light"] .terminal-upload-dialog-actions button.primary {
  color: #ffffff;
  border-color: #3568e8;
  background: #3568e8;
}

[data-theme="light"] .remote-import-failure-dialog > ul > li,
[data-theme="light"] .terminal-upload-dialog dl > div,
[data-theme="light"] .terminal-upload-dialog ul,
[data-theme="light"] .upload-target-options label,
[data-theme="light"] .sync-command-log-command,
[data-theme="light"] .sync-command-log-entry li > button,
[data-theme="light"] .usage-log-command,
[data-theme="light"] .usage-log-entry pre {
  border-color: #d7e0eb;
  background: #f7f9fc;
}

[data-theme="light"] .sync-command-log-command {
  color: #2c3d55;
}

[data-theme="light"] .remote-import-failure-dialog h2,
[data-theme="light"] .remote-import-failure-dialog dd,
[data-theme="light"] .terminal-upload-dialog dd,
[data-theme="light"] .sync-command-log-target,
[data-theme="light"] .sync-command-log-entry li,
[data-theme="light"] .terminal-upload-dialog li {
  color: #2c3d55;
}

[data-theme="light"] .sync-command-log-dialog > header,
[data-theme="light"] .sync-command-log-entry,
[data-theme="light"] .sync-command-log-entry li {
  border-color: #d7e0eb;
}

[data-theme="light"] .sync-command-log-target small,
[data-theme="light"] .upload-progress > small,
[data-theme="light"] .upload-progress {
  color: #718096;
}

[data-theme="light"] .upload-progress-track {
  background: #dce5ef;
}

[data-theme="light"] .upload-progress-fill {
  background: #3b8edb;
}

/* File manager: the preceding base rules define the light palette; these
   declarations restore it after the dark console overrides above. */
[data-theme="light"] .file-manager-window {
  color: #17202a;
  background: #f5f7f9;
}

[data-theme="light"] .file-manager-columns {
  gap: 2px;
  padding: 0 8px 8px;
  background: #d5dce2;
}

[data-theme="light"] .file-manager-column,
[data-theme="light"] .file-manager-row {
  background: #ffffff;
}

[data-theme="light"] .file-manager-column-title {
  color: #243340;
  border-bottom-color: #d4dce3;
  background: #f7f9fb;
}

[data-theme="light"] .file-manager-column-title svg {
  color: #3b80bd;
}

[data-theme="light"] .file-manager-column-title span {
  color: #778796;
}

[data-theme="light"] .file-manager-column-title button {
  color: #597285;
}

[data-theme="light"] .file-manager-column-title button:hover,
[data-theme="light"] .file-manager-local-title:hover,
[data-theme="light"] .file-manager-local-title:focus-visible {
  color: #1d67a8;
  background: #e8f1f8;
}

[data-theme="light"] .file-manager-heading {
  border-bottom-color: #d4dce3;
}

[data-theme="light"] .file-manager-eyebrow {
  color: #2d72b5;
}

[data-theme="light"] .file-manager-close,
[data-theme="light"] .file-manager-pane-heading button {
  color: #597285;
}

[data-theme="light"] .file-manager-close:hover,
[data-theme="light"] .file-manager-pane-heading button:hover {
  color: #1d67a8;
  border-color: #b8c9db;
  background: #e8f1f8;
}

[data-theme="light"] .file-manager-toolbar,
[data-theme="light"] .file-manager-actions {
  color: #40515e;
  border-color: #d4dce3;
  background: #f1f4f7;
}

[data-theme="light"] .file-manager-toolbar span {
  color: #243340;
}

[data-theme="light"] .file-manager-toolbar span svg {
  color: #3b80bd;
}

[data-theme="light"] .file-manager-toolbar small,
[data-theme="light"] .file-manager-pane-heading small,
[data-theme="light"] .file-manager-path {
  color: #778796;
}

[data-theme="light"] .file-manager-panes {
  background: #ffffff;
}

[data-theme="light"] .file-manager-pane {
  border-color: #cbd6e2;
  background: #ffffff;
}

[data-theme="light"] .file-manager-pane.is-drop-target {
  border-color: #3b8edb;
  background: #f1f7fd;
}

[data-theme="light"] .file-manager-pane-heading {
  border-bottom-color: #d4dce3;
}

[data-theme="light"] .file-manager-pane-heading strong {
  color: #243340;
}

[data-theme="light"] .file-manager-pane-heading > div > svg {
  color: #3b80bd;
}

[data-theme="light"] .file-manager-entry {
  color: #263845;
}

[data-theme="light"] .file-manager-entry:hover,
[data-theme="light"] .file-manager-entry.selected {
  color: #1d3f65;
  border-color: #b8d0e8;
  background: #e8f2fb;
}

[data-theme="light"] .file-manager-entry small {
  color: #778796;
}

[data-theme="light"] .file-manager-entry .folder-icon {
  color: #d19e32;
}

[data-theme="light"] .file-manager-entry .file-icon {
  color: #628bb4;
}

[data-theme="light"] .file-manager-entry.parent {
  color: #5c6d7b;
}

[data-theme="light"] .file-manager-empty {
  color: #778796;
}

[data-theme="light"] .file-manager-divider {
  color: #3b80bd;
  border-color: #c6d3e0;
  background: #f2f6fa;
}

[data-theme="light"] .file-manager-actions button {
  color: #40515e;
  border-color: #c6d3e0;
  background: #ffffff;
}

[data-theme="light"] .file-manager-actions button:hover:not(:disabled) {
  border-color: #8fa9df;
  background: #edf3ff;
}

[data-theme="light"] .file-manager-actions button.primary {
  color: #ffffff;
  border-color: #3568e8;
  background: #3568e8;
}

[data-theme="light"] .file-manager-actions button.danger:hover:not(:disabled) {
  color: #9f3038;
  border-color: #e0b6ba;
  background: #fff2f3;
}

[data-theme="light"] .file-manager-table-head {
  color: #40515e;
  border-bottom-color: #d6dee5;
  background: #f1f4f7;
}

[data-theme="light"] .file-manager-row {
  color: #263845;
  border-bottom-color: transparent;
}

[data-theme="light"] .file-manager-row:hover,
[data-theme="light"] .file-manager-row.selected {
  background: #dcecf9;
}

[data-theme="light"] .file-manager-row svg {
  color: #e6b84f;
}

[data-theme="light"] .file-manager-row .file-icon {
  color: #628bb4;
}

[data-theme="light"] .file-manager-row.parent-row,
[data-theme="light"] .file-manager-table-empty {
  color: #5c6d7b;
}

[data-theme="light"] .file-manager-statusbar {
  color: #657783;
  border-top-color: #c8d1d8;
  background: #eef1f4;
}

[data-theme="light"] .file-manager-context-menu {
  border-color: #bbc8d2;
  background: #ffffff;
  box-shadow: 0 5px 18px rgba(28, 47, 63, 0.2);
}

[data-theme="light"] .file-manager-context-menu button {
  color: #283b48;
}

[data-theme="light"] .file-manager-context-menu button:hover {
  background: #e8f2fb;
}

[data-theme="light"] .file-manager-transfer-strip,
[data-theme="light"] .file-manager-upload-strip {
  color: #40515e;
  border-color: #d4dce3;
  background: #f1f4f7;
}

[data-theme="light"] .file-manager-transfer-item {
  color: #40515e;
  border-color: #c6d3e0;
  background: #ffffff;
}

[data-theme="light"] .file-manager-transfer-item strong,
[data-theme="light"] .file-manager-upload-name {
  color: #263845;
}

[data-theme="light"] .file-manager-transfer-error {
  color: #a33a36;
  border-top-color: #edc4c0;
  background: #fff1ef;
}

[data-theme="light"] .file-manager-retry-upload {
  color: #2d72b5;
  border-color: #8fa9df;
  background: #edf3ff;
}

[data-theme="light"] .file-manager-retry-upload:hover {
  color: #244cae;
  background: #dce8ff;
}

[data-theme="light"] .file-manager-progress-track {
  background: #d8e1eb;
}

[data-theme="light"] .file-manager-progress-fill {
  background: #3b8edb;
}

[data-theme="light"] .file-manager-pointer-drag-image span {
  color: #ffffff;
  background: rgba(35, 56, 82, 0.82);
}

[data-theme="light"] .file-manager-circular-progress {
  background: conic-gradient(#3b8edb var(--progress), #d8e1eb 0);
}

[data-theme="light"] .file-manager-circular-progress::before {
  background: #ffffff;
}

[data-theme="light"] .file-manager-circular-progress span,
[data-theme="light"] .file-manager-upload-state,
[data-theme="light"] .file-manager-transfer-direction,
[data-theme="light"] .file-manager-busy-logo {
  color: #2d72b5;
}

[data-theme="light"] .file-manager-busy-indicator {
  color: #40515e;
  border-color: #c6d3e0;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 5px 18px rgba(28, 47, 63, 0.2);
}

/* Final, quiet legal-page overrides */
.legal-terms-window { padding: 28px 20px; background: var(--app-background); }
.legal-terms-shell { width: min(100%, 760px); }
.legal-terms-header { display: flex; gap: 12px; margin-bottom: 18px; }
.legal-terms-header-top, .legal-terms-header-main { display: contents; }
.legal-terms-eyebrow, .legal-terms-updated { display: none; }
.legal-terms-header-icon { width: 42px; height: 42px; border-radius: 10px; box-shadow: none; }
.legal-terms-header h1 { font-size: 23px; letter-spacing: 0; }
.legal-terms-header p { margin-top: 4px; font-size: 12px; }
.legal-home-notice-control { min-width: 150px; padding: 8px 10px; border-radius: 8px; box-shadow: none; }
.legal-terms-highlights, .legal-terms-note, .legal-contact-arrow, .legal-terms-footer-note { display: none; }
.legal-terms-grid { display: block; }
.legal-terms-card { margin-bottom: 12px; padding: 19px 20px; border-radius: 10px; box-shadow: var(--shadow-soft); background: var(--surface); }
.legal-terms-section-heading { margin-bottom: 12px; }
.legal-terms-section-heading h2 { font-size: 16px; letter-spacing: 0; }
.legal-terms-list, .legal-terms-copy { font-size: 13px; line-height: 1.75; }
.legal-terms-raw-text {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  margin: 0;
  color: var(--text-body);
  font: inherit;
  font-size: 13px;
  line-height: 1.85;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.legal-terms-contact { margin-top: 14px; padding: 13px 15px; border-radius: 10px; background: var(--surface); }
@media (max-width: 700px), (pointer: coarse) {
  .legal-terms-window { padding: calc(16px + env(safe-area-inset-top)) calc(14px + env(safe-area-inset-right)) calc(18px + env(safe-area-inset-bottom)) calc(14px + env(safe-area-inset-left)); }
  .legal-terms-header { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 9px; align-items: start; }
  .legal-terms-mobile-back { grid-column: 1; grid-row: 1; width: 32px; height: 32px; }
  .legal-terms-header-icon { display: none; }
  .legal-terms-header-copy { grid-column: 2; grid-row: 1; align-self: center; }
  .legal-terms-header h1 { font-size: 21px; }
  .legal-home-notice-control { grid-column: 1 / -1; width: 100%; margin: 2px 0 0; }
  .legal-terms-card { padding: 16px 15px; }
  .legal-terms-list, .legal-terms-copy { font-size: 12px; }
  .legal-terms-raw-text { font-size: 12px; }
}

/* Legal terms refresh */
.legal-terms-window {
  position: relative;
  padding: clamp(24px, 4vw, 56px) clamp(16px, 5vw, 72px);
  color: var(--text-body);
  background:
    radial-gradient(circle at 8% 0%, rgba(84, 139, 255, 0.12), transparent 33%),
    radial-gradient(circle at 96% 100%, rgba(57, 196, 145, 0.09), transparent 28%),
    var(--app-background);
}

.legal-terms-shell {
  width: min(100%, 1020px);
  margin: 0 auto;
}

.legal-terms-header {
  display: block;
  width: 100%;
  margin: 0 0 22px;
  padding: 0;
}

.legal-terms-header-top,
.legal-terms-header-main {
  display: flex;
  align-items: center;
}

.legal-terms-header-top {
  gap: 12px;
  margin-bottom: 18px;
}

.legal-terms-eyebrow {
  color: var(--accent);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.16em;
}

.legal-terms-updated {
  margin-left: auto;
  color: var(--text-subtle);
  font-size: 11px;
}

.legal-terms-header-main {
  gap: 16px;
}

.legal-terms-header-icon {
  width: 58px;
  height: 58px;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
  border-radius: 17px;
  color: var(--accent);
  background: linear-gradient(145deg, var(--accent-soft), color-mix(in srgb, var(--accent-soft) 55%, var(--surface)));
  box-shadow: 0 10px 24px rgba(49, 94, 185, 0.12);
}

.legal-terms-header-copy { min-width: 0; }

.legal-terms-header h1 {
  margin: 0;
  color: var(--text-strong);
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 760;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.legal-terms-header p {
  margin: 8px 0 0;
  color: var(--text-subtle);
  font-size: 13px;
  line-height: 1.5;
}

.legal-home-notice-control {
  min-width: 184px;
  margin-left: auto;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow: 0 8px 22px rgba(31, 51, 78, 0.06);
}

.legal-home-notice-copy strong { font-size: 12px; }
.legal-home-notice-copy small { margin-top: 4px; font-size: 10px; }

.legal-terms-highlights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  margin-bottom: 18px;
}

.legal-highlight {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 63px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
}

.legal-highlight-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  box-shadow: 0 0 0 5px color-mix(in srgb, currentColor 12%, transparent);
}
.legal-highlight-dot.blue { color: #5185ef; background: #5185ef; }
.legal-highlight-dot.green { color: #35b88a; background: #35b88a; }
.legal-highlight-dot.amber { color: #d79232; background: #d79232; }
.legal-highlight strong,
.legal-highlight small { display: block; }
.legal-highlight strong { color: var(--text-strong); font-size: 12px; }
.legal-highlight small { margin-top: 3px; color: var(--text-subtle); font-size: 10px; line-height: 1.35; }

.legal-terms-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.legal-terms-card {
  width: 100%;
  margin: 0;
  padding: 24px 26px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: 0 10px 28px rgba(30, 43, 67, 0.06);
}

.legal-terms-card-privacy { grid-column: 1 / -1; }

.legal-terms-section-heading {
  gap: 12px;
  margin-bottom: 17px;
}

.legal-terms-icon {
  width: 38px;
  height: 38px;
  border: 1px solid color-mix(in srgb, var(--accent) 15%, transparent);
  border-radius: 11px;
}

.legal-terms-kicker {
  color: var(--accent);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.08em;
}

.legal-terms-section-heading h2 { margin-top: 3px; font-size: 18px; letter-spacing: -0.02em; }

.legal-terms-list,
.legal-terms-copy {
  color: var(--text-body);
  font-size: 13px;
  line-height: 1.85;
}

.legal-terms-list { padding-left: 22px; }
.legal-terms-list li { padding-left: 5px; }
.legal-terms-list li::marker { color: var(--accent); font-weight: 700; }
.legal-terms-list li + li,
.legal-terms-copy p + p { margin-top: 10px; }

.legal-terms-note {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 17px;
  padding: 7px 10px;
  color: var(--toast-success-text);
  border: 1px solid var(--toast-success-border);
  border-radius: 8px;
  background: var(--success-soft);
  font-size: 11px;
}
.legal-terms-note span { font-weight: 800; }

.legal-terms-restricted {
  border-color: var(--toast-error-border);
  background: linear-gradient(145deg, color-mix(in srgb, var(--danger-soft) 70%, var(--surface)), var(--surface));
}
.legal-terms-restricted .legal-terms-icon { border-color: var(--toast-error-border); }

.legal-terms-contact {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 12px;
  margin: 16px 0 0;
  padding: 15px 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--border));
  border-radius: 14px;
  background: linear-gradient(100deg, color-mix(in srgb, var(--accent-soft) 70%, var(--surface)), var(--surface));
}
.legal-contact-icon { display: grid; width: 34px; height: 34px; place-items: center; flex: 0 0 auto; color: var(--accent); border-radius: 9px; background: var(--surface); }
.legal-terms-contact strong { color: var(--text-strong); font-size: 12px; }
.legal-terms-contact p { margin: 4px 0 0; color: var(--text-subtle); font-size: 11px; }
.legal-terms-contact p span { padding: 0 4px; color: var(--border); }
.legal-contact-arrow { margin-left: auto; color: var(--accent); font-size: 18px; }
.legal-terms-footer-note { margin: 14px 0 0; color: var(--text-subtle); text-align: center; font-size: 11px; }

@media (max-width: 700px), (pointer: coarse) {
  .legal-terms-window { padding: calc(18px + env(safe-area-inset-top)) calc(14px + env(safe-area-inset-right)) calc(22px + env(safe-area-inset-bottom)) calc(14px + env(safe-area-inset-left)); }
  .legal-terms-header-top { margin-bottom: 14px; }
  .legal-terms-eyebrow { font-size: 9px; }
  .legal-terms-updated { font-size: 10px; }
  .legal-terms-header-main { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 11px; align-items: start; }
  .legal-terms-header-icon { width: 44px; height: 44px; border-radius: 13px; }
  .legal-terms-header h1 { font-size: clamp(22px, 7vw, 28px); white-space: normal; }
  .legal-terms-header p { margin-top: 5px; font-size: 11px; }
  .legal-home-notice-control { grid-column: 1 / -1; width: 100%; min-height: 50px; margin: 2px 0 0; padding: 9px 11px; border-radius: 11px; }
  .legal-terms-highlights { grid-template-columns: 1fr; gap: 8px; margin-bottom: 12px; }
  .legal-highlight { min-height: 50px; padding: 9px 12px; }
  .legal-highlight small { font-size: 10px; }
  .legal-terms-grid { grid-template-columns: 1fr; gap: 10px; }
  .legal-terms-card-privacy { grid-column: auto; }
  .legal-terms-card { padding: 18px 16px; border-radius: 13px; }
  .legal-terms-section-heading { margin-bottom: 13px; }
  .legal-terms-section-heading h2 { font-size: 16px; }
  .legal-terms-list, .legal-terms-copy { font-size: 12px; line-height: 1.8; }
  .legal-terms-contact { margin-top: 12px; padding: 13px 14px; border-radius: 12px; }
  .legal-terms-contact p { font-size: 10px; }
  .legal-contact-arrow { display: none; }
  .legal-terms-footer-note { margin-top: 11px; font-size: 10px; }
}

/* Keep legal content simple across themes and viewport sizes. */
.legal-terms-window { padding: 28px 20px; background: var(--app-background); }
.legal-terms-shell { width: min(100%, 760px); }
.legal-terms-header { display: flex; gap: 12px; margin-bottom: 18px; }
.legal-terms-header-top, .legal-terms-header-main { display: contents; }
.legal-terms-eyebrow, .legal-terms-updated { display: none; }
.legal-terms-header-icon { width: 42px; height: 42px; border-radius: 10px; box-shadow: none; }
.legal-terms-header h1 { font-size: 23px; letter-spacing: 0; }
.legal-terms-header p { margin-top: 4px; font-size: 12px; }
.legal-home-notice-control { min-width: 150px; padding: 8px 10px; border-radius: 8px; box-shadow: none; }
.legal-terms-highlights, .legal-terms-note, .legal-contact-arrow, .legal-terms-footer-note { display: none; }
.legal-terms-grid { display: block; }
.legal-terms-card { margin-bottom: 12px; padding: 19px 20px; border-radius: 10px; box-shadow: var(--shadow-soft); background: var(--surface); }
.legal-terms-section-heading { margin-bottom: 12px; }
.legal-terms-section-heading h2 { font-size: 16px; letter-spacing: 0; }
.legal-terms-list, .legal-terms-copy { font-size: 13px; line-height: 1.75; }
.legal-terms-contact { margin-top: 14px; padding: 13px 15px; border-radius: 10px; background: var(--surface); }
@media (max-width: 700px), (pointer: coarse) {
  .legal-terms-window { padding: calc(16px + env(safe-area-inset-top)) calc(14px + env(safe-area-inset-right)) calc(18px + env(safe-area-inset-bottom)) calc(14px + env(safe-area-inset-left)); }
  .legal-terms-header { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 9px; align-items: start; }
  .legal-terms-mobile-back { grid-column: 1; grid-row: 1; width: 32px; height: 32px; }
  .legal-terms-header-icon { display: none; }
  .legal-terms-header-copy { grid-column: 2; grid-row: 1; align-self: center; }
  .legal-terms-header h1 { font-size: 21px; }
  .legal-home-notice-control { grid-column: 1 / -1; width: 100%; margin: 2px 0 0; }
  .legal-terms-card { padding: 16px 15px; }
  .legal-terms-list, .legal-terms-copy { font-size: 12px; }
}

/* Prevent the title row from covering the first legal card on mobile. */
.legal-terms-header { position: static !important; z-index: auto !important; }
@media (max-width: 700px), (pointer: coarse) {
  .legal-terms-header { display: grid !important; grid-template-columns: 38px minmax(0, 1fr) !important; gap: 9px !important; align-items: center !important; padding: 0 0 12px !important; }
  .legal-terms-mobile-back { grid-column: 1 !important; grid-row: 1 !important; }
  .legal-terms-header-copy { grid-column: 2 !important; grid-row: 1 !important; align-self: center !important; }
  .legal-home-notice-control { grid-column: 1 / -1 !important; grid-row: 2 !important; }
}
