/* ==========================================================================
   Chrome IAP Desktop — styles
   Light theme by default; dark theme when <html data-theme="dark">.
   ========================================================================== */

:root {
  --bg-canvas: #f5f6f8;
  --bg-surface: #ffffff;
  --bg-elevated: #f1f3f6;
  --border-subtle: #dde1e7;
  --border: var(--border-subtle);
  --text-primary: #1f2328;
  --text-secondary: #57606a;
  --text-muted: #8c959f;
  --brand: #1a73e8;
  --brand-hover: #1765cc;
  --brand-soft: #e8f0fe;
  --accent-success: #1a7f37;
  --accent-warning: #9a6700;
  --accent-danger: #cf222e;
  --success-soft: #e6f4ea;
  --danger-soft: #ffebe9;
  --scrollbar-thumb: #c1c7d0;
  --scrollbar-track: transparent;
  --shadow-sm: 0 1px 2px rgba(31, 35, 40, 0.06);
  --shadow-md: 0 8px 24px rgba(31, 35, 40, 0.12);

  color-scheme: light;
  accent-color: var(--brand);
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
  scrollbar-width: thin;
}

:root[data-theme="dark"] {
  --bg-canvas: #0d1117;
  --bg-surface: #161b22;
  --bg-elevated: #1c2330;
  --border-subtle: #30363d;
  --text-primary: #e6edf3;
  --text-secondary: #9da7b3;
  --text-muted: #6e7781;
  --brand: #4c8df6;
  --brand-hover: #6aa1f8;
  --brand-soft: rgba(76, 141, 246, 0.14);
  --accent-success: #3fb950;
  --accent-warning: #d29922;
  --accent-danger: #f85149;
  --success-soft: rgba(63, 185, 80, 0.14);
  --danger-soft: rgba(248, 81, 73, 0.14);
  --scrollbar-thumb: #3d444d;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

/* Legacy fallback for WebKit/Blink browsers */
@supports not (scrollbar-color: auto) {
  *::-webkit-scrollbar {
    width: 10px;
    height: 10px;
  }
  *::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
  }
  *::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-size: 13.5px;
}

code, pre {
  font-family: "JetBrains Mono", "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  font-size: 0.9em;
}

/* ==========================================================================
   FULL-SCREEN SECURITY & AUTHENTICATION GATE
   ========================================================================== */

.login-gate {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow-y: auto;
  background: var(--bg-canvas);
}

[hidden],
.login-gate[hidden],
.app-shell[hidden] {
  display: none !important;
}

@keyframes iap-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spinning svg {
  animation: iap-spin 0.8s linear infinite;
}

.app-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

.login-card {
  width: min(560px, 100%);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 28px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-card-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.login-logo {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: rgba(59, 130, 246, 0.14);
  color: var(--brand);
  display: grid;
  place-items: center;
  margin-bottom: 12px;
}

.login-card-header h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.login-method-block {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 11px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.primary-auth-block {
  border-color: rgba(59, 130, 246, 0.45);
}

.method-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-primary);
}

.oauth-advanced-details {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.oauth-advanced-details summary {
  cursor: pointer;
  color: var(--brand);
  font-weight: 600;
  user-select: none;
}

.login-error-banner {
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: var(--accent-danger);
  font-size: 12.5px;
  font-weight: 600;
}

.btn-lg {
  width: 100%;
  padding: 11px 16px;
  font-size: 13.5px;
  border-radius: 8px;
}

/* ==========================================================================
   TOP BAR
   ========================================================================== */

.topbar {
  height: 54px;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  gap: 16px;
  flex-shrink: 0;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.12);
  color: var(--brand);
  display: grid;
  place-items: center;
}

.brand-title {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.brand-subtitle {
  font-size: 11px;
  color: var(--text-secondary);
}

.topbar-context {
  display: flex;
  align-items: center;
  gap: 12px;
}

.context-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 4px 10px;
}

.context-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.context-pill select {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 13px;
  outline: none;
  cursor: pointer;
}

.protocol-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-secondary);
}
.status-dot.online {
  background: var(--accent-success);
}

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

/* Account Switcher Pill */
.account-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 4px 12px 4px 5px;
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.account-pill:hover {
  border-color: var(--brand);
}

.account-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  display: grid;
  place-items: center;
}

.account-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
}

.account-email {
  font-size: 12.5px;
  font-weight: 600;
}

.account-org {
  font-size: 10.5px;
  color: var(--text-secondary);
}

/* ==========================================================================
   MAIN WORKSPACE GRID
   ========================================================================== */

.workspace-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 330px 1fr;
  min-height: 0;
}

.sidebar {
  background-color: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.sidebar-header {
  padding: 12px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-title-row h2 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  padding: 6px 10px;
}

.search-box input {
  border: none;
  background: transparent;
  color: var(--text-primary);
  width: 100%;
  font-size: 12.5px;
  outline: none;
}

/* Tree Explorer */
.explorer-tree {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  scrollbar-width: thin;
}

.project-group {
  margin-bottom: 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-canvas);
  overflow: hidden;
}

.project-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: var(--bg-elevated);
  cursor: pointer;
  user-select: none;
  font-weight: 600;
  font-size: 12.5px;
}

.project-id-sub {
  font-size: 11px;
  color: var(--text-secondary);
  font-family: monospace;
}

.vm-list {
  display: flex;
  flex-direction: column;
  padding: 4px;
  gap: 4px;
}

.vm-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px 9px;
  border-radius: 6px;
  background: var(--bg-surface);
  border: 1px solid transparent;
  transition: border-color 0.15s ease;
}

.vm-item:hover {
  border-color: var(--brand);
}

.vm-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.vm-name-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.os-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.os-badge.linux {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.os-badge.windows {
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
}

.vm-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-secondary);
  font-family: monospace;
}

.vm-actions-row {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}

/* Sidebar Footer */
.sidebar-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 10px 12px;
  background: var(--bg-elevated);
}

.footer-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.mini-tunnel-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 95px;
  overflow-y: auto;
}

.mini-tunnel-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  padding: 4px 7px;
  border-radius: 5px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  font-family: monospace;
}

.empty-mini {
  font-size: 11.5px;
  color: var(--text-secondary);
}

/* ==========================================================================
   SESSION WORKBENCH & MULTI-TAB BAR
   ========================================================================== */

.workbench {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--bg-canvas);
}

.tabbar {
  height: 40px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  gap: 8px;
}

.tabbar-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.session-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 11px;
  border-radius: 6px 6px 0 0;
  border: 1px solid var(--border-subtle);
  border-bottom: none;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.session-tab.active {
  background: var(--bg-canvas);
  color: var(--text-primary);
  border-top: 2px solid var(--brand);
}

.session-tab-close {
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 12px;
  padding: 0 3px;
  border-radius: 4px;
}
.session-tab-close:hover {
  background: rgba(239, 68, 68, 0.2);
  color: var(--accent-danger);
}

.session-viewports {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr;
  min-height: 0;
  position: relative;
}

.session-viewports.split-mode {
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 6px;
}

.session-pane {
  display: none;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: #090d16;
  border: 1px solid var(--border-subtle);
}

.session-pane.active {
  display: flex;
}

.session-toolbar {
  min-height: 38px;
  height: auto;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
}

.session-status-text {
  font-family: monospace;
  color: var(--text-secondary);
}

.terminal-host {
  flex: 1;
  padding: 8px;
  background: #090d16;
  color-scheme: dark;
  overflow: hidden;
  position: relative;
}

/* Fallback ANSI Terminal if CDN is blocked offline */
.native-terminal {
  width: 100%;
  height: 100%;
  background: #090d16;
  color: #e2e8f0;
  font-family: "JetBrains Mono", Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  line-height: 1.45;
  padding: 10px;
  overflow-y: auto;
  white-space: pre-wrap;
  outline: none;
}

/* Windows Remote Desktop (RDP) Interactive Canvas View */
.rdp-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #050811;
  position: relative;
  overflow: hidden;
  padding: 12px;
}

.rdp-canvas {
  max-width: 100%;
  max-height: 100%;
  border-radius: 6px;
  border: 1px solid #1e293b;
  box-shadow: var(--shadow-md);
  cursor: crosshair;
}

/* Welcome View */
.welcome-view {
  display: grid;
  place-items: center;
  padding: 28px;
  overflow-y: auto;
}

.welcome-card {
  max-width: 820px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 28px;
}

.badge-accent {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--brand);
  background: rgba(59, 130, 246, 0.14);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.welcome-hero h1 {
  font-size: 24px;
  margin-bottom: 8px;
}

.welcome-hero p {
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 20px;
}

.feature-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

.feature-card {
  padding: 14px;
  border-radius: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

.feature-icon {
  display: inline-block;
  font-family: monospace;
  font-weight: 800;
  font-size: 11px;
  padding: 3px 7px;
  border-radius: 5px;
  margin-bottom: 8px;
  background: rgba(59, 130, 246, 0.18);
  color: var(--brand);
}

.feature-card h3 {
  font-size: 13.5px;
  margin-bottom: 5px;
}

.feature-card p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.welcome-actions {
  display: flex;
  gap: 10px;
}

/* ==========================================================================
   BUTTONS, FORMS & DIALOGS (`closedby="any"` + `::backdrop`)
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 7px;
  padding: 7px 13px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: filter 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--brand);
  color: #ffffff;
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.btn-secondary:hover {
  border-color: var(--brand);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.btn-xs {
  padding: 3px 8px;
  font-size: 11px;
  border-radius: 5px;
}

.btn-icon {
  padding: 6px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.btn-link {
  background: none;
  border: none;
  color: var(--brand);
  font-weight: 600;
  font-size: 11.5px;
  cursor: pointer;
}

.counter-badge {
  background: var(--brand);
  color: #fff;
  border-radius: 999px;
  padding: 1px 6px;
  font-size: 10.5px;
}

/* Native Modal Dialogs */
dialog.app-dialog {
  margin: auto;
  width: min(680px, 94vw);
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 0;
  box-shadow: var(--shadow-md);
}

/* Style the backdrop to indicate the dialog is modal */
dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.dialog-header h2 {
  font-size: 16px;
}

.dialog-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.dialog-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 76vh;
  overflow-y: auto;
}

.dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

.section-block {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.section-label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.form-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: 1.3fr 1.2fr 0.8fr;
  gap: 10px;
}

.form-grid-4 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 0.7fr;
  gap: 8px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
}

.input {
  width: 100%;
  padding: 7px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 13px;
}

.input-with-btn {
  display: flex;
  gap: 6px;
}

.help-text {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.provision-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.provision-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.badge-tag {
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(59, 130, 246, 0.16);
  color: var(--brand);
  font-family: monospace;
}

.credential-result {
  padding: 10px;
  border-radius: 7px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  font-family: monospace;
  font-size: 12px;
}

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

.account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 7px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}

.account-row.active-account {
  border-color: var(--brand);
}

/* Toast notifications */
.toast-container {
  position: fixed;
  bottom: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
}

.toast {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--brand);
  padding: 10px 14px;
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  font-size: 12.5px;
  max-width: 380px;
}

/* ==========================================================================
   Clean, minimal overrides (light-first)
   ========================================================================== */

body {
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
}

.btn {
  font-weight: 500;
  border-radius: 6px;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.btn-primary:hover:not(:disabled) {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
}
.btn-secondary {
  background: var(--bg-surface);
  border-color: var(--border-subtle);
  color: var(--text-primary);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--bg-elevated);
  border-color: var(--border-subtle);
}
.btn-danger {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--accent-danger);
}
.btn-danger:hover:not(:disabled) {
  background: var(--danger-soft);
}
.btn-icon {
  background: transparent;
  border-color: transparent;
  color: var(--text-secondary);
}
.btn-icon:hover:not(:disabled) {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.badge-tag {
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}
.os-badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--bg-elevated);
  color: var(--text-secondary);
}
.os-badge.linux,
.os-badge.windows {
  background: var(--bg-elevated);
  color: var(--text-secondary);
}

.status-dot.online {
  box-shadow: none;
}

kbd {
  font-family: inherit;
  font-size: 11px;
  padding: 1px 5px;
  border: 1px solid var(--border-subtle);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--bg-surface);
}

/* Sidebar VM rows */
.project-group {
  background: var(--bg-surface);
}
.vm-item {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border: none;
}
.vm-item:hover {
  background: var(--bg-elevated);
}
.vm-item-info {
  flex: 1;
  min-width: 0;
}
.vm-item .vm-meta-row {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  justify-content: flex-start;
  gap: 8px;
}
.vm-item-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* Dropdown menu */
.menu-wrap {
  position: relative;
  display: inline-flex;
}
.menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 190px;
  padding: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  z-index: 1000;
  display: flex;
  flex-direction: column;
}
.menu[hidden] {
  display: none;
}
.menu-item {
  text-align: left;
  background: none;
  border: none;
  border-radius: 5px;
  padding: 7px 10px;
  font: inherit;
  font-size: 12.5px;
  color: var(--text-primary);
  cursor: pointer;
  white-space: nowrap;
}
.menu-item:hover,
.menu-item:focus-visible {
  background: var(--bg-elevated);
  outline: none;
}
.menu-item.danger {
  color: var(--accent-danger);
}
.menu-sep {
  height: 1px;
  margin: 4px 2px;
  background: var(--border-subtle);
}

.toast {
  border-left: 1px solid var(--border-subtle);
  font-size: 12.5px;
}

.session-toolbar {
  background: var(--bg-surface);
}

/* File transfer dialog */
.transfer-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}
.transfer-steps {
  margin: 0 0 12px 18px;
  padding: 0;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-secondary);
}
.transfer-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 12.5px;
  color: var(--text-secondary);
}
.transfer-box progress {
  width: 100%;
  height: 6px;
  margin-top: 8px;
}
.transfer-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 10px;
}
.transfer-note {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}
.drop-zone {
  border: 1px dashed var(--border-subtle);
  border-radius: 8px;
  padding: 18px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-secondary);
  background: var(--bg-surface);
}
.drop-zone.drag-over {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.form-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--text-secondary);
}
.progress-track {
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--brand);
  transition: width 0.15s ease;
}

/* Remote desktop connect card */
.connect-card {
  width: 100%;
  max-width: 360px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 22px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.connect-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}
.connect-card-footer {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 12px;
}

.text-danger { color: var(--accent-danger); }
.text-success { color: var(--accent-success); }

.btn.is-active {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand);
}

.method-title,
.section-label {
  text-transform: none;
  letter-spacing: 0;
  font-size: 12.5px;
  font-weight: 600;
}
.btn {
  white-space: nowrap;
}

.brand-title { white-space: nowrap; }
.context-label { text-transform: none; letter-spacing: 0; }

.vm-item .vm-name-wrap,
.vm-item .vm-meta-row,
.project-header .project-id-sub,
.project-header > div:first-child > div:first-child {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: inherit;
}
.session-status-text {
  font-family: inherit;
  font-size: 12px;
  color: var(--text-muted);
}

.vm-in-use { color: var(--accent-warning); }

/* Local-only features stay hidden unless the server enables them */
html:not([data-local-features="on"]) [data-local-only] {
  display: none !important;
}
