.workspace {
  display: grid;
  grid-row: 1;
  grid-template-rows: 38px minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--chrome-strong);
}

.workspace.workspace-tabs-hidden {
  grid-template-rows: minmax(0, 1fr);
}

.toolbar-cluster,
.approval-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.status-bar span,
.host-metric {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: var(--text-muted);
  font-size: 12px;
}

.terminal-pane header small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-canvas {
  display: grid;
  min-height: 0;
  overflow: hidden;
  background: var(--chrome-strong);
}

.workspace-dockable-tab {
  display: none;
  min-width: 0;
  min-height: 0;
  height: 100%;
}

.workspace-dockable-tab.active {
  display: block;
}

.tab-strip {
  display: flex;
  align-items: end;
  min-width: 0;
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border);
}

.tab-scroll-container {
  display: flex;
  align-items: end;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.tab-scroll-container::-webkit-scrollbar {
  display: none;
}

.tab-scroll-arrow {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 37px;
  color: var(--text-faint);
  background: var(--surface-muted);
  cursor: pointer;
  z-index: 1;
}

.tab-scroll-arrow:hover {
  color: var(--text);
}

.tab-scroll-left {
  border-right: 1px solid var(--border);
}

.tab-scroll-right {
  border-left: 1px solid var(--border);
}

.tab {
  display: flex;
  align-items: center;
  max-width: 210px;
  min-width: 132px;
  height: 37px;
  color: var(--text-muted);
  background: transparent;
  border-right: 1px solid var(--border);
  font-size: 12px;
}

.tab-button {
  display: flex;
  flex: 1 1 auto;
  gap: 7px;
  align-items: center;
  min-width: 0;
  height: 37px;
  padding: 0 0 0 9px;
  color: inherit;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.tab-rename-form {
  display: flex;
  flex: 1 1 auto;
  gap: 7px;
  align-items: center;
  min-width: 0;
  height: 37px;
  padding-left: 9px;
}

.tab-rename-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 24px;
  padding: 0 6px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 4px;
  font: inherit;
}

.tab-rename-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.new-tab,
.tab-close-button {
  height: 37px;
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
}

.tab.active {
  color: var(--text);
  background: var(--chrome-strong);
  box-shadow: inset 0 2px 0 var(--accent);
}

.tab-close-button {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 30px;
  color: var(--text-faint);
}

.tab-close-button:hover {
  color: var(--text);
}

.screenshot-menu-wrapper {
  flex-shrink: 0;
}

.screenshot-region-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  cursor: crosshair;
  background: rgba(10, 15, 22, 0.22);
}

.screenshot-region-target,
.screenshot-region-selection {
  position: fixed;
  pointer-events: none;
}

.screenshot-region-target {
  border: 1px solid rgba(86, 166, 255, 0.8);
  box-shadow:
    0 0 0 9999px rgba(4, 8, 14, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.18) inset;
}

.screenshot-region-selection {
  background: rgba(86, 166, 255, 0.18);
  border: 1px solid #56a6ff;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.45) inset,
    0 8px 26px rgba(0, 0, 0, 0.22);
}


.settings-stack {
  display: grid;
  margin-top: auto;
  overflow: hidden;
}

.settings-stack div {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 36px;
  padding: 0 10px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.settings-stack div:last-child {
  border-bottom: 0;
}

.empty-workspace {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--text-muted);
  text-align: center;
}

.empty-workspace p {
  margin: 0;
  font-size: 13px;
}

.empty-workspace-connection-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(132px, 1fr));
  gap: 3px 18px;
  width: min(320px, calc(100vw - 48px));
  margin-top: 4px;
}

.empty-workspace-connection-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 4px 2px;
  color: var(--accent);
  background: transparent;
  border: 0;
  border-radius: 5px;
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.empty-workspace-connection-link:hover {
  color: var(--accent-press);
  background: var(--hover);
}

.empty-workspace-connection-link:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 1px;
}

.empty-workspace-connection-link span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-bar {
  display: grid;
  position: relative;
  grid-column: 1 / -1;
  grid-row: 2;
  z-index: 80;
  grid-template-columns: minmax(324px, auto) minmax(0, 1fr) minmax(324px, auto);
  gap: 10px;
  min-width: 0;
  padding: 0 10px;
  overflow: visible;
  color: var(--text-muted);
  background: var(--surface-muted);
  border-top: 1px solid var(--border);
}

.status-bar-module,
.status-bar-notice-area,
.status-bar-actions,
.host-metrics {
  display: flex;
  align-items: center;
  min-width: 0;
}

.status-bar-module {
  min-width: 438px;
}

.status-bar-module.metrics-disabled {
  min-width: 0;
}

.status-bar-module-text {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

/* Golden rule: transient notices float above every dialog backdrop. This must be
   portaled to document.body (see StatusBar.tsx / DialogPortal) so this z-index is
   resolved at the document root — inside the .status-bar stacking context
   (z-index:80) it would be capped below dialog backdrops (z-index:130+) regardless
   of the value here. Keep this above every blocking backdrop. */
.status-bar-notice-area {
  position: fixed;
  right: 0;
  top: var(--app-titlebar-height, 23px);
  left: 0;
  z-index: 9999;
  padding-top: 12px;
  justify-content: center;
  pointer-events: none;
}

.status-bar-actions {
  grid-column: 3;
  justify-content: flex-end;
}

/* Install Helper roll-up, centre column, shown only while the Module is
   the visible page (gated in React). */
.status-bar-installer {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}

.status-bar-installer__dot {
  flex: 0 0 auto;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-faint);
}

.status-bar-installer__updates {
  color: var(--accent);
  font-weight: 600;
}

.status-bar-action {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 22px;
  padding: 0;
  overflow: visible;
  color: var(--text-faint);
  background: transparent;
  border: 0;
  border-radius: 5px;
  outline: none;
}

.status-bar-action:hover,
.status-bar-action:focus-visible {
  color: var(--text);
  background: var(--surface);
}

.status-bar-action:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.status-bar-assistant-working {
  color: var(--accent);
}

.status-bar-dont-sleep-enabled {
  color: var(--green);
}

.credential-store-status.is-locked {
  color: var(--notice-warning);
}

.credential-store-status.is-unlocked {
  color: var(--green);
}

.status-bar-x-server-running {
  color: var(--accent);
}


.status-bar-x-server-glyph {
  display: inline-grid;
  place-items: center;
  width: 14px;
  height: 14px;
  color: inherit;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.status-bar-assistant-working svg {
  animation: status-bar-spin 900ms linear infinite;
}

@keyframes status-bar-spin {
  to {
    transform: rotate(360deg);
  }
}

.status-bar-tooltip {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 140;
  padding: 4px 10px;
  color: #111;
  white-space: nowrap;
  pointer-events: none;
  background: #fffdf6;
  border: 1px solid #111;
  border-radius: 0;
  box-shadow: none;
  opacity: 0;
  transform: translateY(2px);
  transition:
    opacity 140ms ease,
    transform 140ms ease;
  font-size: 13px;
  font-weight: 400;
}

.status-bar-action:hover .status-bar-tooltip,
.status-bar-action:focus-visible .status-bar-tooltip {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 3000ms;
}

.status-bar-action:hover .rail-tooltip:not(.native-suppressed),
.status-bar-action:focus-visible .rail-tooltip:not(.native-suppressed) {
  opacity: 1;
  transform: translate(0, -50%);
  transition-delay: 3000ms;
}

.host-metrics {
  flex: 0 0 auto;
  gap: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  appearance: none;
  cursor: pointer;
  user-select: none;
  background: transparent;
  border: 0;
}

.status-bar span,
.host-metric {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.host-metric {
  position: relative;
  gap: 1px;
  height: 20px;
  padding: 0;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  border-radius: 0;
}

.host-metric + .host-metric {
  margin-left: 14px;
  padding-left: 15px;
}

.host-metric + .host-metric::before {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: 1px;
  content: "";
  background: var(--border);
}

.host-metric svg {
  flex: 0 0 auto;
  color: var(--text-faint);
}

.status-bar .host-metric-transfer {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  min-width: 0;
}

.status-bar .host-metric-transfer + .host-metric-transfer {
  margin-left: 1px;
}

.host-metric-value {
  display: inline-block;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  text-align: left;
}

.host-metric-percent .host-metric-value {
  width: 4ch;
}

.host-metric-network .host-metric-value {
  width: auto;
  min-width: 7ch;
}

.status-bar-ai-coding {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 18px;
  margin-left: 8px;
  padding-left: 9px;
  color: var(--text-muted);
  flex: 0 0 auto;
  font: inherit;
  line-height: 1;
  cursor: pointer;
  background: transparent;
  border: 0;
}

.status-bar-ai-coding:hover,
.status-bar-ai-coding:focus-visible {
  color: var(--text);
}

.status-bar-ai-coding::before {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: 1px;
  content: "";
  background: var(--border);
}

.status-bar-ai-coding-provider {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 18px;
  color: var(--text-muted);
  line-height: 1;
}

.status-bar-ai-coding-provider + .status-bar-ai-coding-provider {
  margin-left: 12px;
  padding-left: 13px;
}

.status-bar-ai-coding-provider + .status-bar-ai-coding-provider::before {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: 1px;
  content: "";
  background: var(--border);
}

.status-bar-ai-coding-provider svg {
  flex: 0 0 auto;
  color: var(--text-faint);
}

.status-bar-ai-coding-bar {
  display: inline-block;
  width: 58px;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-muted);
}

.status-bar-ai-coding-bar > span {
  display: block;
  height: 100%;
  background: var(--accent);
  transition: width 180ms ease;
}

.status-bar-ai-coding-provider[data-state="warning"] .status-bar-ai-coding-bar > span {
  background: var(--amber);
}

.status-bar-ai-coding-provider[data-state="danger"] .status-bar-ai-coding-bar > span {
  background: var(--red);
}

.status-bar-ai-coding-percent,
.status-bar-ai-coding-reset {
  font-size: 9px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  line-height: 1;
}

.status-bar-ai-coding-percent {
  min-width: 4ch;
  text-align: left;
}

.status-popup {
  position: relative;
  max-width: min(440px, calc(100vw - 48px));
  opacity: 1;
  pointer-events: auto;
  cursor: default;
  --notice-tone: var(--accent);
  --status-popup-glass-bg: rgba(252 252 253 / 88%);
  --status-popup-glass-hi: rgba(255 255 255 / 80%);
  --status-popup-glass-shadow:
    0 8px 24px rgba(15 23 42 / 10%),
    0 2px 8px rgba(15 23 42 / 7%);
  will-change: opacity, transform;
}

[data-color-scheme="blue-see"] .status-popup,
[data-color-scheme="dark"] .status-popup,
[data-color-scheme="purple"] .status-popup {
  --status-popup-glass-bg: rgba(44 44 46 / 62%);
  --status-popup-glass-hi: rgba(255 255 255 / 10%);
  --status-popup-glass-shadow:
    0 28px 70px rgba(0 0 0 / 66%),
    0 6px 18px rgba(0 0 0 / 50%);
}

[data-color-scheme="green-kuai-kuai"] .status-popup {
  --status-popup-glass-bg: rgba(255 255 255 / 86%);
  --status-popup-glass-hi: rgba(255 255 255 / 82%);
  --status-popup-glass-shadow:
    0 8px 22px rgba(44 104 18 / 12%),
    0 2px 8px rgba(8 45 104 / 7%);
}

.status-popup.success {
  --notice-tone: var(--notice-success);
}

.status-popup.info {
  --notice-tone: var(--notice-info);
}

.status-popup.warning {
  --notice-tone: var(--notice-warning);
}

.status-popup.error {
  --notice-tone: var(--notice-error);
}

.status-popup-pulse {
  display: inline-flex;
  gap: 11px;
  align-items: center;
  padding: 11px 20px 14px 16px;
  background: var(--status-popup-glass-bg);
  border: 0.5px solid var(--status-popup-glass-hi);
  border-radius: 20px;
  box-shadow:
    var(--status-popup-glass-shadow),
    inset 0 0.5px 0 var(--status-popup-glass-hi),
    0 0 0 3px color-mix(in srgb, var(--notice-tone) 16%, transparent);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
}

.status-popup-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 22px;
  height: 22px;
  color: var(--notice-tone);
}

.status-popup-icon svg {
  stroke: var(--notice-tone);
}

.status-popup-message {
  display: -webkit-box;
  flex: 1 1 auto;
  max-width: 340px;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow-wrap: anywhere;
  text-wrap: pretty;
  white-space: normal;
}

.status-popup-content {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 9px;
  min-width: 0;
}

.status-popup-progress {
  background: color-mix(in srgb, var(--notice-tone) 18%, transparent);
  border-radius: 999px;
  display: block;
  flex: 1 1 auto;
  height: 4px;
  min-width: 72px;
  width: min(180px, 24vw);
  overflow: hidden;
}

.status-popup-progress > i {
  background: var(--notice-tone);
  display: block;
  height: 100%;
  transition: width 180ms ease-out;
}

.status-popup-progress-label {
  color: var(--notice-tone);
  flex: 0 0 34px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  text-align: right;
}

.status-popup-close {
  position: absolute;
  top: -6px;
  right: -2px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  color: var(--text-muted);
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  box-shadow: 0 2px 6px rgb(0 0 0 / 18%);
  opacity: 0;
  transform: scale(0.7);
  transition:
    opacity 140ms ease,
    transform 140ms ease;
}

.status-popup:hover .status-popup-close,
.status-popup-close:focus-visible {
  opacity: 1;
  transform: none;
}

.status-popup.is-entering {
  animation: status-popup-enter-pulse 460ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.status-popup.is-exiting {
  opacity: 0;
  transform: translateY(-16px) scale(0.97);
  transition:
    opacity 200ms ease,
    transform 200ms ease;
}

@keyframes status-popup-enter-pulse {
  from {
    opacity: 0;
    transform: translateY(-12px) scale(0.78);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .status-popup.is-entering {
    animation: none;
  }

  .status-popup.is-exiting {
    transition: opacity 150ms ease;
    transform: none;
  }

  .app-shell.panel-animating {
    transition: none;
  }

  .connection-sidebar,
  .assistant-panel,
  .connections-collapsed .connection-sidebar,
  .ai-assist-collapsed .assistant-panel {
    transition: none;
  }
}


.screenshots-shell {
  position: fixed;
  inset: var(--app-titlebar-height, 0px) 0 0 48px;
  z-index: 80;
  min-width: 0;
  height: calc(100vh - var(--app-titlebar-height, 0px));
  overflow: hidden;
  color: var(--text);
  background: var(--app-bg);
}

.screenshots-page {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  min-width: 0;
  overflow: hidden;
}

.screenshots-header {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  min-height: 74px;
  padding: 14px 22px;
  background: var(--chrome);
  border-bottom: 1px solid var(--border);
}

.screenshots-header h1,
.screenshots-header p {
  margin: 0;
}

.screenshots-header h1 {
  font-size: 20px;
  line-height: 1.2;
}

.screenshots-header p {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 13px;
}

.screenshots-actions,
.screenshot-card-actions {
  display: flex;
  gap: 7px;
  align-items: center;
}

.screenshots-capture-button {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.screenshots-capture-menu-anchor {
  position: relative;
}

.screenshots-capture-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 12;
  min-width: 132px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: var(--shadow-popover);
}

.screenshots-capture-menu button {
  display: flex;
  width: 100%;
  min-height: 28px;
  align-items: center;
  border: 0;
  border-radius: 5px;
  color: var(--text);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
}

.screenshots-capture-menu button:hover,
.screenshots-capture-menu button:focus-visible {
  background: var(--surface-muted);
}

.screenshots-actions .icon-button[aria-pressed="true"] {
  color: var(--accent);
  background: var(--accent-soft);
}

.screenshots-collection {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 18px 22px;
}

.screenshots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
  gap: 14px;
  align-content: start;
}

.screenshots-list {
  display: grid;
  gap: 10px;
  align-content: start;
}

.screenshot-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.screenshots-list .screenshot-card {
  grid-template-columns: 178px minmax(0, 1fr) auto;
  align-items: center;
}

.screenshot-preview {
  display: grid;
  overflow: hidden;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  aspect-ratio: 16 / 9;
}

.screenshots-list .screenshot-preview {
  width: 178px;
}

.screenshot-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.screenshot-details {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.screenshot-details strong,
.screenshot-details span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.screenshot-details strong {
  font-size: 13px;
}

.screenshot-details span {
  color: var(--text-muted);
  font-size: 12px;
}

.screenshot-card-actions {
  justify-content: flex-end;
}

.screenshots-load-more {
  justify-self: center;
  min-width: 148px;
}

.screenshots-grid .screenshots-load-more {
  grid-column: 1 / -1;
}

.icon-button.danger:hover {
  color: var(--red);
}

.screenshots-empty {
  display: grid;
  place-content: center;
  gap: 6px;
  min-height: 0;
  padding: 40px;
  text-align: center;
}

.screenshots-empty h2,
.screenshots-empty p {
  margin: 0;
}

.screenshots-empty h2 {
  font-size: 18px;
}

.screenshots-empty p {
  max-width: 440px;
  color: var(--text-muted);
  font-size: 13px;
}
