/**
 * Component Styles - Aurora Mint Design System
 *
 * Styles for all UI components using CSS tokens only.
 */

.command-palette {
  width: 100%;
  max-width: var(--desktop-modal-max-width-md);
  background: var(--surface-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: slideInUp var(--duration-normal) var(--ease-out);
}

.command-palette--desktop {
  overflow: hidden;
}

.command-palette-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border-default);
}

.command-palette-kicker {
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
}

.command-palette-meta {
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
  color: var(--text-tertiary);
}

.command-palette-search {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border-default);
}

.command-palette-search-icon {
  flex-shrink: 0;
}

.command-palette-input {
  flex: 1;
  background: transparent;
  border: none;
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--type-body-3-weight);
  color: var(--text-primary);
  outline: none;
}

.command-palette-input::placeholder {
  color: var(--text-tertiary);
}

.command-palette-hint {
  padding: var(--sp-2) var(--sp-4);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
  color: var(--text-tertiary);
  border-bottom: 1px solid var(--border-default);
}

.command-palette-list {
  max-height: 320px;
  overflow-y: auto;
}

.command-palette-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3) var(--sp-4);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out);
}

.command-palette--desktop .command-palette-item {
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
}

.command-palette-item:hover,
.command-palette-item-selected {
  background: var(--surface-hover);
}

.command-palette-item-content {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.command-palette--desktop .command-palette-item-content {
  flex: 1;
  min-width: 0;
}

.command-palette-item-label {
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--type-body-3-weight);
  color: var(--text-primary);
}

.command-palette-item-desc {
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
  color: var(--text-secondary);
}

.command-palette-item-shortcut {
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
  padding: var(--sp-1) var(--sp-2);
  background: var(--surface-hover);
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}

.command-palette-empty {
  padding: var(--sp-8);
  text-align: center;
  color: var(--text-tertiary);
}

.command-palette-sheet {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}

.command-palette-sheet__search {
  position: sticky;
  top: 0;
  z-index: var(--z-inline);
  padding-top: var(--sp-3);
  background: linear-gradient(
    180deg,
    var(--component-mix-surface-panel-98pct-transparent) 0%,
    var(--component-mix-surface-page-96pct-surface-panel-4pct) 100%
  );
}

.command-palette-sheet__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-4);
  border-bottom: 1px solid var(--component-mix-border-default-82pct-transparent);
  background: var(--component-mix-surface-panel-66pct-transparent);
}

.command-palette-sheet-shell {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  outline: none;
}

.command-palette-sheet-layer {
  min-height: min(82dvh, 700px);
}

.quick-open {
  display: flex;
  width: min(640px, calc(100vw - var(--sp-6)));
  max-height: min(72vh, 520px);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--surface-overlay-border);
  border-radius: var(--radius-overlay);
  background: var(--surface-overlay-bg);
  box-shadow: var(--surface-overlay-shadow);
}

.quick-open__search {
  display: flex;
  align-items: center;
  gap: var(--gap-default);
  padding: calc(var(--sp-3) - var(--gap-compact)) var(--sp-4);
  border-bottom: 1px solid var(--component-mix-border-default-82pct-transparent);
  border-radius: var(--radius-md);
  background: var(--component-mix-surface-panel-66pct-transparent);
}

.quick-open__icon {
  flex-shrink: 0;
  color: var(--text-tertiary);
}

.quick-open__input {
  flex: 1;
  min-width: 0;
  min-height: 30px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--type-body-3-weight);
  outline: none;
}

.quick-open__input::placeholder {
  color: var(--component-mix-text-tertiary-92pct-surface-panel);
}

.quick-open__list {
  display: flex;
  min-height: 0;
  flex-direction: column;
  overflow-y: auto;
  padding: var(--sp-1) 0 var(--sp-2);
}

.quick-open__state,
.quick-open__empty {
  padding: var(--sp-5) var(--sp-4);
  color: var(--text-tertiary);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
}

.quick-open__item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--gap-compact);
  width: 100%;
  padding: calc(var(--sp-2) + var(--gap-hairline)) var(--sp-4)
    calc(var(--sp-3) - var(--gap-compact));
  border: none;
  background: transparent;
  color: var(--text-primary);
  text-align: left;
  box-shadow: inset 0 -1px 0 var(--component-mix-border-default-96pct-transparent);
  transition:
    background-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out);
}

.quick-open__item:hover,
.quick-open__item--active,
.quick-open__item[aria-selected="true"] {
  background: var(--component-mix-status-info-fg-12pct-surface-panel);
}

.quick-open__item:focus-visible {
  outline: none;
  background: var(--component-mix-status-info-fg-14pct-surface-panel);
  box-shadow:
    inset 0 0 0 var(--state-focus-ring-width) var(--component-mix-border-focus-64pct-transparent),
    inset 0 -1px 0 var(--component-mix-border-default-96pct-transparent);
}

.quick-open__item:last-child {
  box-shadow: none;
}

.quick-open__primary {
  min-width: 0;
  overflow: hidden;
  color: var(--text-primary);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--type-body-3-weight);
}

.quick-open__secondary {
  min-width: 0;
  overflow: hidden;
  color: var(--text-secondary);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
}

.quick-open__item--active .quick-open__secondary,
.quick-open__item[aria-selected="true"] .quick-open__secondary {
  color: var(--component-mix-status-info-fg-52pct-text-secondary);
}

@media (prefers-reduced-motion: reduce) {
  .command-palette,
  .mobile-sheet-layer__backdrop,
  .mobile-drawer-layer__backdrop,
  .mobile-sheet,
  .mobile-workspace-drawer {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

.mobile-select-sheet {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  background: var(--surface-panel);
}

.mobile-select-sheet__search {
  padding: var(--sp-3);
  border-bottom: 1px solid var(--border-default);
}

.mobile-select-sheet__search-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mobile-select-sheet__search-input {
  width: 100%;
  min-height: var(--touch-target-min);
  padding: var(--sp-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--component-mix-surface-panel-92pct-surface-page);
  color: var(--text-primary);
}

.mobile-select-sheet__search-input::placeholder {
  color: var(--text-tertiary);
}

.mobile-select-sheet__content {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-3);
  overflow-y: auto;
}

.mobile-select-sheet__section {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.mobile-select-sheet__section-title {
  padding: 0 var(--sp-1);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
}

.mobile-select-sheet__list {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  background: var(--component-mix-surface-panel-94pct-surface-page);
}

.mobile-select-sheet__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  width: 100%;
  min-height: 56px;
  padding: var(--sp-3);
  border: none;
  border-bottom: 1px solid var(--component-mix-border-default-84pct-transparent);
  background: transparent;
  color: var(--text-primary);
  text-align: left;
  border-radius: 16px;
}

.mobile-select-sheet__item-row {
  display: flex;
  align-items: stretch;
  gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-2);
  border-bottom: 1px solid var(--component-mix-border-default-84pct-transparent);
  background: transparent;
}

.mobile-select-sheet__item-row[data-selected="true"] {
  background: var(--component-mix-status-info-fg-10pct-surface-panel);
}

.mobile-select-sheet__list > [data-selected="true"] > .mobile-select-sheet__item {
  background: var(--component-mix-status-info-fg-10pct-surface-panel);
}

.mobile-select-sheet__item-row:last-child {
  border-bottom: none;
}

.mobile-select-sheet__item-row > .mobile-select-sheet__item {
  min-width: 0;
  flex: 1;
  padding-inline: var(--sp-2);
  border-bottom: none;
}

.mobile-select-sheet__item:last-child {
  border-bottom: none;
}

.mobile-select-sheet__item:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.mobile-select-sheet__item--danger .mobile-select-sheet__item-label {
  color: var(--status-danger-fg);
}

.mobile-select-sheet__item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.mobile-select-sheet__item-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: var(--sp-1);
}

.mobile-select-sheet__item-label {
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--type-body-3-weight);
  color: var(--text-primary);
}

.mobile-select-sheet__item-description {
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
  color: var(--text-secondary);
}

.mobile-select-sheet__item-meta {
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
  color: var(--text-secondary);
}

.mobile-select-sheet__item-badge {
  padding: var(--sp-1) var(--sp-2);
  border-radius: var(--radius-full);
  background: var(--surface-hover);
  color: var(--text-secondary);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  flex-shrink: 0;
}

.mobile-select-sheet__item-side-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.mobile-select-sheet__item-side-action--danger {
  color: var(--status-danger-fg);
}

.mobile-select-sheet__item-side-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mobile-select-sheet__item--create .mobile-select-sheet__item-label {
  color: var(--status-info-fg);
}

.mobile-select-sheet__empty {
  padding: var(--sp-6) var(--sp-4);
  color: var(--text-tertiary);
  text-align: center;
}

.mobile-select-sheet__loading {
  padding: var(--sp-6) var(--sp-4);
  color: var(--text-secondary);
  text-align: center;
}

.mobile-select-sheet--command {
  background: var(--surface-page);
}

.mobile-select-sheet--command .mobile-select-sheet__search {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 6px var(--sp-4) 4px;
  border-bottom: 1px solid var(--component-mix-border-default-84pct-transparent);
  background: var(--component-mix-surface-page-96pct-surface-panel-4pct);
}

.mobile-select-sheet--command .mobile-select-sheet__search-input {
  min-height: 38px;
  padding: 0 10px;
  border-color: var(--component-mix-border-default-64pct-transparent);
  border-radius: 4px;
  background: var(--component-mix-surface-page-82pct-surface-panel-18pct);
  color: var(--text-primary);
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--type-body-3-weight);
  box-shadow: none;
}

.mobile-select-sheet--command .mobile-select-sheet__search-input::placeholder {
  color: var(--component-mix-text-tertiary-92pct-surface-panel);
}

.mobile-select-sheet--command .mobile-select-sheet__content {
  gap: 0;
  padding: var(--sp-1) 0 var(--sp-3);
}

.mobile-select-sheet--command .mobile-select-sheet__section {
  gap: 0;
}

.mobile-select-sheet--command .mobile-select-sheet__section + .mobile-select-sheet__section {
  margin-top: -1px;
}

.mobile-select-sheet--command .mobile-select-sheet__section-title {
  padding: 0 var(--sp-4);
  margin-bottom: 4px;
  font-family: var(--font-mono);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  letter-spacing: 0.08em;
  color: var(--component-mix-text-tertiary-92pct-surface-panel);
}

.mobile-select-sheet--command .mobile-select-sheet__list {
  border-top: 1px solid var(--component-mix-border-default-76pct-transparent);
  border-bottom: 1px solid var(--component-mix-border-default-76pct-transparent);
  border-right: none;
  border-left: none;
  border-radius: 0;
  background: var(--component-mix-surface-page-94pct-surface-panel-6pct);
  box-shadow: none;
}

.mobile-select-sheet--command
  .mobile-select-sheet__section:not(:first-child)
  .mobile-select-sheet__list {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.mobile-select-sheet--command
  .mobile-select-sheet__section:not(:last-child)
  .mobile-select-sheet__list {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.mobile-select-sheet--command .mobile-select-sheet__item,
.mobile-select-sheet--command .mobile-select-sheet__item-row {
  border-bottom-color: transparent;
  box-shadow: inset 0 -1px 0 var(--component-mix-border-default-96pct-transparent);
}

.mobile-select-sheet--command .mobile-select-sheet__item {
  min-height: 42px;
  gap: var(--sp-2);
  padding: 10px 16px;
  border-radius: 0;
}

.mobile-select-sheet--command
  .mobile-select-sheet__list
  > [data-selected="true"]
  > .mobile-select-sheet__item {
  background: var(--component-mix-status-info-fg-12pct-surface-panel);
  box-shadow:
    inset 2px 0 0 var(--component-mix-status-info-fg-72pct-transparent),
    inset 0 -1px 0 var(--component-mix-border-default-96pct-transparent);
}

.mobile-select-sheet--command .mobile-select-sheet__item-row {
  gap: 0;
  padding: 0;
}

.mobile-select-sheet--command .mobile-select-sheet__item-row[data-selected="true"] {
  background: var(--component-mix-status-info-fg-12pct-surface-panel);
  box-shadow:
    inset 2px 0 0 var(--component-mix-status-info-fg-72pct-transparent),
    inset 0 -1px 0 var(--component-mix-border-default-96pct-transparent);
}

.mobile-select-sheet--command .mobile-select-sheet__item-row > .mobile-select-sheet__item {
  min-height: 42px;
  padding-right: 6px;
}

.mobile-select-sheet--command .mobile-select-sheet__list > .mobile-select-sheet__item:last-child,
.mobile-select-sheet--command
  .mobile-select-sheet__list
  > .mobile-select-sheet__item-row:last-child {
  box-shadow: none;
}

.mobile-select-sheet--command .mobile-select-sheet__item-icon {
  color: var(--text-tertiary);
}

.mobile-select-sheet--command
  .mobile-select-sheet__list
  > [data-selected="true"]
  > .mobile-select-sheet__item
  .mobile-select-sheet__item-icon,
.mobile-select-sheet--command
  .mobile-select-sheet__item-row[data-selected="true"]
  .mobile-select-sheet__item-icon {
  color: var(--component-mix-status-info-fg-74pct-text-primary);
}

.mobile-select-sheet--command .mobile-select-sheet__item-copy {
  gap: 2px;
}

.mobile-select-sheet--command .mobile-select-sheet__item-label {
  font-size: var(--type-body-3-size);
  font-weight: var(--type-body-3-weight);
  line-height: var(--type-body-3-line-height);
  letter-spacing: 0.01em;
}

.mobile-select-sheet--command .mobile-select-sheet__item-description {
  color: var(--text-secondary);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
}

.mobile-select-sheet--command .mobile-select-sheet__item-meta {
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
  letter-spacing: 0.05em;
}

.mobile-select-sheet--command
  .mobile-select-sheet__list
  > [data-selected="true"]
  > .mobile-select-sheet__item
  .mobile-select-sheet__item-meta,
.mobile-select-sheet--command
  .mobile-select-sheet__item-row[data-selected="true"]
  .mobile-select-sheet__item-meta {
  color: var(--component-mix-status-info-fg-52pct-text-secondary);
}

.mobile-select-sheet--command .mobile-select-sheet__item-badge {
  padding: 1px 6px;
  border: 1px solid var(--component-mix-border-default-64pct-transparent);
  background: transparent;
  color: var(--text-tertiary);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
}

.mobile-select-sheet--command .mobile-select-sheet__item-side-action {
  align-self: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--component-mix-border-default-44pct-transparent);
  border-radius: 3px;
  background: transparent;
}

.mobile-select-sheet--command .mobile-select-sheet__item-side-action--danger {
  color: var(--component-mix-status-danger-fg-76pct-text-primary);
}

.mobile-select-sheet--command .mobile-select-sheet__item--action .mobile-select-sheet__item-label,
.mobile-select-sheet--command .mobile-select-sheet__item--create .mobile-select-sheet__item-label {
  font-weight: var(--font-medium);
}

.mobile-select-sheet--command .mobile-select-sheet__item--action .mobile-select-sheet__item-icon {
  color: var(--text-secondary);
}

.mobile-select-sheet--command .mobile-select-sheet__item--create {
  background: transparent;
}

.mobile-select-sheet--command .mobile-select-sheet__item--create .mobile-select-sheet__item-label {
  color: var(--text-primary);
}

.mobile-select-sheet--command .mobile-select-sheet__empty,
.mobile-select-sheet--command .mobile-select-sheet__loading {
  padding-inline: var(--sp-2);
}

/* ========== Settings Page ========== */
.settings-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  height: 100vh;
  background: linear-gradient(
    180deg,
    var(--component-mix-status-info-fg-6pct-surface-page-94pct) 0%,
    var(--workspace-page-surface) 100%
  );
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  min-width: 0;
}

.page-header--primary {
  min-height: 56px;
}

.page-header--secondary {
  min-height: 48px;
}

.page-header__leading {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex: 1;
  min-width: 0;
}

.page-header__copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--gap-compact);
  min-width: 0;
}

.page-header__kicker {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
}

.page-header--primary .page-header__kicker {
  letter-spacing: 0.08em;
}

.page-header__title {
  margin: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--type-heading-5-size);
  line-height: var(--type-heading-5-line-height);
  font-weight: var(--type-heading-5-weight);
  color: var(--text-primary);
  text-align: left;
}

.page-header--primary .page-header__title {
  font-size: var(--type-heading-4-size);
  line-height: var(--type-heading-4-line-height);
  font-weight: var(--type-heading-4-weight);
}

.page-header--secondary .page-header__title {
  font-size: var(--type-heading-5-size);
  line-height: var(--type-heading-5-line-height);
  font-weight: var(--type-heading-5-weight);
}

.page-header__back {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: var(--touch-target-min);
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  flex-shrink: 0;
  transition: all var(--duration-fast) var(--ease-out);
}

.page-header__back:hover {
  color: var(--text-primary);
}

.page-header__actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-2);
  flex-shrink: 0;
  margin-left: auto;
  min-width: fit-content;
}

.settings-header {
  padding: var(--sp-1) var(--sp-4);
  background: var(--settings-header-surface);
  border-bottom: 1px solid var(--component-mix-border-default-84pct-transparent);
  backdrop-filter: var(--material-backdrop-filter);
}
.settings-body {
  display: flex;
  flex: 1;
  min-height: 0;
  align-items: stretch;
  margin: 0;
  overflow: hidden;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.settings-sidebar {
  width: 264px;
  padding: calc(var(--sp-4) + var(--gap-compact)) var(--sp-4) var(--sp-5);
  background: linear-gradient(
    180deg,
    var(--settings-sidebar-surface) 0%,
    color-mix(in srgb, var(--settings-sidebar-surface) 82%, var(--workspace-page-surface) 18%) 100%
  );
  border-right: 1px solid var(--component-mix-border-default-82pct-transparent);
  backdrop-filter: var(--material-backdrop-filter);
}

.settings-nav {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.settings-nav-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-align: left;
  transition: all var(--duration-fast) var(--ease-out);
}

.settings-nav-item:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.settings-nav-item-active {
  background: var(--surface-active);
  color: var(--text-primary);
  border-color: var(--component-mix-status-info-fg-42pct-border-default-58pct);
  box-shadow: inset 0 0 0 1px var(--component-mix-status-info-fg-18pct-transparent);
}

.settings-nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 0;
  color: var(--icon-secondary);
}

.settings-nav-label {
  flex: 1;
  min-width: 0;
  display: block;
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--type-body-3-weight);
}

.settings-nav-arrow {
  display: block;
  flex-shrink: 0;
  line-height: 0;
  color: var(--text-tertiary);
}

.settings-content {
  display: flex;
  flex: 1;
  min-height: 0;
  align-items: flex-start;
  justify-content: flex-start;
  padding: var(--sp-6) calc(var(--sp-6) + var(--sp-1)) calc(var(--sp-6) + var(--sp-1));
  overflow-y: auto;
  background: transparent;
}

.settings-content--fill-height {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
}

.settings-content--fill-height > .settings-content-surface {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}

.settings-content-surface {
  width: 100%;
  min-width: 0;
  min-height: 100%;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.settings-content-surface--monitoring-dense {
  padding: 0;
}

.settings-content--fill-height > .settings-content-surface--monitoring-dense {
  flex: 0 0 auto;
  min-height: 100%;
}

.settings-workspace {
  display: flex;
  width: 100%;
  min-width: 0;
  flex-direction: column;
  gap: calc(var(--sp-3) + var(--gap-compact));
}

.settings-workspace--readable > .settings-section {
  width: min(100%, 920px);
  max-width: 920px;
}

.settings-workspace--wide > .settings-section {
  width: 100%;
  max-width: none;
}

.settings-content--fill-height > .settings-content-surface > .settings-workspace {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}

.settings-section {
  width: 100%;
  max-width: none;
  min-width: 0;
}

.settings-section--fill-height {
  display: flex;
  flex-direction: column;
  max-width: none;
  min-height: 100%;
}

.settings-group {
  margin-bottom: var(--space-section);
}

.settings-group:last-child {
  margin-bottom: 0;
}

.settings-group-title {
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--type-body-3-weight);
  margin-bottom: var(--sp-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-primary);
}

.settings-group-desc {
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
  color: var(--text-secondary);
  margin-bottom: var(--sp-4);
  max-width: 60ch;
}

.settings-pills {
  display: flex;
  gap: var(--sp-1);
  flex-wrap: wrap;
  align-items: center;
  padding-bottom: var(--sp-1);
}

.settings-toggle-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: var(--sp-4);
  row-gap: var(--sp-2);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--border-default);
}

.settings-toggle-row--action {
  align-items: start;
}

.settings-toggle-info {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.settings-toggle-label {
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--type-body-3-weight);
  color: var(--text-primary);
}

.settings-toggle-desc {
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
  color: var(--text-secondary);
}

.settings-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  cursor: pointer;
}

.settings-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.settings-toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--surface-hover);
  border-radius: var(--radius-full);
  transition: background var(--duration-fast) var(--ease-out);
}

.settings-toggle-slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: var(--text-primary);
  border-radius: 50%;
  transition: transform var(--duration-fast) var(--ease-out);
}

.settings-toggle input:checked + .settings-toggle-slider {
  background: var(--status-success-fg);
}

.settings-toggle input:checked + .settings-toggle-slider::before {
  transform: translateX(20px);
}

.settings-info-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  column-gap: var(--sp-4);
  row-gap: var(--sp-2);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--border-default);
}

.settings-info-label {
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.settings-info-value {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  justify-self: end;
  gap: var(--sp-1);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
  color: var(--text-primary);
  text-align: right;
  max-width: 40ch;
  min-width: 14ch;
}

.settings-diagnostics-button {
  min-width: 0;
}

.settings-capability-available,
.settings-permission-granted {
  color: var(--status-success-fg);
}

.settings-capability-limited {
  color: var(--status-warning-fg);
}

.settings-capability-unsupported,
.settings-permission-denied {
  color: var(--status-danger-fg);
}

.settings-permission-unavailable {
  color: var(--text-tertiary);
}

.settings-status-hint {
  color: var(--text-tertiary);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
}

.settings-link {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 0;
  color: var(--status-info-fg);
  cursor: pointer;
  background: none;
  border: none;
  font-weight: var(--font-medium);
  font-size: inherit;
}

.settings-link:hover {
  text-decoration: underline;
}

.settings-actions-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

.settings-actions-row--end {
  justify-content: flex-end;
  gap: var(--sp-3);
  margin-top: var(--sp-3);
}

.settings-card {
  border: 1px solid var(--surface-elevated-border);
  background: var(--surface-elevated);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  padding: var(--sp-4);
}

.settings-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}

.settings-card__header .settings-group-title,
.settings-card__header .settings-group-desc {
  margin-bottom: 0;
}

.settings-card__header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

.monitoring-settings-grid {
  display: grid;
  gap: var(--sp-2);
}

.monitoring-settings-grid--toggles {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--sp-3);
}

.monitoring-settings-grid .settings-toggle-row:last-child {
  border-bottom: none;
}

.monitoring-settings-row {
  align-items: center;
}

.settings-monitoring-shell {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  width: 100%;
  gap: var(--sp-4);
}

.settings-monitoring-shell--desktop {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(320px, 0.95fr);
  align-items: start;
  max-width: none;
  min-height: 100%;
  margin-inline: auto;
}

.settings-monitoring-shell--desktop > .settings-monitoring-control-bar {
  grid-column: 1 / -1;
}

.settings-monitoring-shell--desktop > .settings-monitoring-toolbar {
  grid-column: 1;
}

.settings-monitoring-shell--desktop > .settings-monitoring-kpi-grid {
  grid-column: 2;
  grid-template-columns: 1fr;
  align-self: start;
}

.settings-monitoring-shell--desktop > .settings-monitoring-dashboard-stage {
  grid-column: 1 / -1;
}

.settings-monitoring-shell--mobile {
  max-width: 100%;
}

.settings-monitoring-control-bar,
.settings-monitoring-dashboard-stage {
  min-width: 0;
  border: 1px solid var(--component-mix-border-default-70pct-transparent);
  background: color-mix(in srgb, var(--surface-elevated) 94%, white 6%);
  border-radius: var(--monitoring-surface-radius);
  box-shadow: var(--shadow-sm);
}

.settings-monitoring-control-bar {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 1fr);
  gap: var(--monitoring-hero-gap);
  min-width: 0;
  padding: var(--monitoring-hero-padding);
  overflow: hidden;
}

.settings-monitoring-control-bar__copy {
  display: flex;
  flex-direction: column;
  gap: var(--monitoring-hero-copy-gap);
  min-width: 0;
  align-self: start;
}

.settings-monitoring-control-bar__eyebrow {
  margin: 0;
  color: var(--text-tertiary);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.settings-monitoring-control-bar__summary {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--type-body-4-size);
  line-height: var(--type-body-4-line-height);
  font-weight: var(--type-body-5-weight);
  max-width: 50ch;
  overflow-wrap: anywhere;
}

.settings-monitoring-hero {
  position: relative;
  align-items: start;
}

.settings-monitoring-hero::after {
  content: "";
  position: absolute;
  right: calc(var(--sp-6) * -1);
  top: calc(var(--sp-6) * -1);
  width: 16rem;
  height: 16rem;
  border-radius: var(--radius-full);
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--status-success-fg) 14%, transparent) 0%,
    transparent 72%
  );
  pointer-events: none;
}

.settings-monitoring-hero__headline,
.settings-monitoring-hero__summary {
  position: relative;
  z-index: 1;
}

.settings-monitoring-hero__title {
  margin: 0;
  font-size: var(--monitoring-hero-title-size);
  line-height: var(--monitoring-hero-title-line-height);
  letter-spacing: -0.04em;
}

.settings-monitoring-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: var(--monitoring-hero-meta-margin-top);
}

.settings-monitoring-pill,
.settings-monitoring-soft-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  min-height: 2rem;
  padding: 0 var(--sp-3);
  border-radius: var(--monitoring-chip-radius);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  white-space: nowrap;
  border: 1px solid color-mix(in srgb, var(--status-success-fg) 10%, var(--border-default));
}

.settings-monitoring-pill {
  background: var(--component-mix-surface-panel-82pct-transparent);
  color: var(--text-secondary);
}

.settings-monitoring-soft-chip {
  background: color-mix(in srgb, var(--status-success-bg) 82%, transparent);
  color: var(--status-success-fg);
}

.settings-monitoring-soft-chip__dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: var(--radius-full);
  background: currentColor;
}

.settings-monitoring-status-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: var(--monitoring-status-card-gap);
  min-width: 0;
  padding: var(--monitoring-status-card-padding);
  border: 1px solid var(--component-mix-border-default-70pct-transparent);
  border-radius: var(--monitoring-card-radius);
  background: color-mix(in srgb, var(--surface-elevated) 82%, white 18%);
  box-shadow: var(--shadow-sm);
}

.settings-monitoring-status-card__label,
.settings-monitoring-toolbar__eyebrow,
.settings-monitoring-kpi-card__label,
.monitoring-panel-header__copy p {
  margin: 0;
  color: var(--text-tertiary);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
}

.settings-monitoring-status-card__title {
  margin: 0;
  font-size: var(--type-heading-5-size);
  line-height: var(--type-heading-5-line-height);
  font-weight: var(--font-semibold);
}

.settings-monitoring-status-card__summary,
.settings-monitoring-kpi-card__meta {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  overflow-wrap: anywhere;
}

.settings-monitoring-status-card__health {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.settings-monitoring-status-card__stat strong,
.settings-monitoring-kpi-card__value {
  font-size: var(--monitoring-kpi-value-size);
  line-height: var(--type-heading-3-line-height);
  letter-spacing: -0.04em;
  font-weight: var(--font-semibold);
  overflow-wrap: anywhere;
}

.settings-monitoring-hero-action__value {
  font-size: var(--monitoring-hero-action-value-size);
  line-height: var(--type-heading-5-line-height);
  letter-spacing: -0.03em;
  font-weight: var(--font-semibold);
  overflow-wrap: anywhere;
}

.settings-monitoring-hero__side {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: var(--monitoring-hero-side-gap);
  min-width: 0;
}

.settings-monitoring-hero-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-2);
}

.settings-monitoring-hero-action {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--monitoring-hero-action-gap);
  padding: var(--monitoring-hero-action-padding);
  border: 1px solid var(--component-mix-border-default-70pct-transparent);
  border-radius: var(--monitoring-item-radius);
  background: color-mix(in srgb, var(--surface-elevated) 76%, var(--surface-page) 24%);
}

.settings-monitoring-hero-action__label {
  margin: 0;
  color: var(--text-tertiary);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
}

.settings-monitoring-status-card__toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--sp-3);
  align-items: center;
  padding-top: var(--sp-2);
  border-top: 1px solid var(--component-mix-border-default-60pct-transparent);
}

.settings-monitoring-toolbar {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border: 1px solid var(--component-mix-border-default-70pct-transparent);
  border-radius: var(--monitoring-surface-radius);
  background: color-mix(in srgb, var(--surface-elevated) 94%, white 6%);
  box-shadow: var(--shadow-sm);
}

.settings-monitoring-toolbar__summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
}

.settings-monitoring-toolbar__intro {
  margin: var(--sp-1) 0 0;
  color: var(--text-secondary);
  font-size: var(--type-body-5-size);
  line-height: 1.6;
}

.settings-monitoring-toolbar__meta {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--sp-2);
  align-items: flex-start;
  align-content: flex-start;
  color: var(--text-secondary);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
}

.settings-monitoring-dashboard-stage {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--component-mix-border-default-70pct-transparent);
  background: color-mix(in srgb, var(--surface-elevated) 94%, white 6%);
  border-radius: var(--monitoring-surface-radius);
  padding: var(--sp-4);
}

.settings-monitoring-signal-bar {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.settings-monitoring-signal-bar__controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(12rem, auto);
  gap: var(--sp-2);
  align-items: end;
}

.settings-monitoring-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-2);
}

.settings-monitoring-kpi-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-3);
  border: 1px solid var(--component-mix-border-default-70pct-transparent);
  border-radius: var(--monitoring-card-radius);
  background: color-mix(in srgb, var(--surface-elevated) 96%, white 4%);
  box-shadow: var(--shadow-sm);
}

.settings-monitoring-advanced-toggle-row {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: var(--sp-3);
}

.settings-monitoring-advanced-toggle-row__hint {
  color: var(--text-tertiary);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
}

.monitoring-settings-row--stacked {
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: var(--sp-1);
  min-width: 0;
  padding: 0;
  border-bottom: none;
  border-radius: var(--monitoring-item-radius);
  background: transparent;
}

.monitoring-settings-segmented-control {
  display: flex;
  width: 100%;
  min-width: 0;
  justify-content: flex-start;
}

.monitoring-settings-grid--capabilities {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-3);
}

.settings-monitoring-advanced {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding-top: var(--sp-2);
}

.settings-monitoring-advanced[hidden] {
  display: none;
}

.settings-monitoring-capability-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--sp-3);
  align-items: start;
  padding: var(--sp-3);
  border: 1px solid var(--component-mix-border-default-70pct-transparent);
  border-radius: var(--monitoring-item-radius);
  background: color-mix(in srgb, var(--surface-elevated) 76%, var(--surface-page) 24%);
}

.settings-monitoring-capability-card__copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--sp-1);
}

.settings-monitoring-capability-card__dependency {
  color: var(--text-tertiary);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
}

.monitoring-settings-row--compact,
.settings-toggle-row--compact {
  margin-bottom: 0;
}

.monitoring-card,
.settings-card--monitoring,
.monitoring-tree,
.monitoring-detail,
.monitoring-process-list {
  border: 1px solid var(--surface-elevated-border);
  background: var(--surface-elevated);
  border-radius: var(--monitoring-card-radius);
  box-shadow: var(--shadow-sm);
}

.monitoring-card {
  border: 1px solid var(--component-mix-border-default-70pct-transparent);
  background: color-mix(in srgb, var(--surface-elevated) 96%, white 4%);
  border-radius: var(--monitoring-card-radius);
  box-shadow: var(--shadow-sm);
  padding: var(--sp-3);
}

.monitoring-tree,
.monitoring-detail {
  padding: var(--sp-3);
}

.monitoring-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-2);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid color-mix(in srgb, var(--status-success-fg) 6%, var(--border-default));
}

.monitoring-card__header h2,
.monitoring-tree .monitoring-card__header h2,
.monitoring-detail .monitoring-card__header h2,
.monitoring-card__title {
  font-size: var(--type-heading-5-size);
  line-height: var(--type-heading-5-line-height);
  font-weight: var(--font-semibold);
  margin: 0;
}

.monitoring-detail h3,
.monitoring-detail__entity-title {
  margin: 0 0 var(--sp-3);
  font-size: var(--type-heading-6-size);
  line-height: var(--type-heading-6-line-height);
  font-weight: var(--font-semibold);
  overflow-wrap: anywhere;
}

.monitoring-card p,
.monitoring-detail p {
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
}

.monitoring-metric {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid color-mix(in srgb, var(--status-success-fg) 5%, var(--border-default));
}

.monitoring-metric:last-child {
  border-bottom: 0;
}

.monitoring-metric__label {
  min-width: 0;
  color: var(--text-secondary);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
}

.monitoring-metric__value {
  justify-self: end;
  text-align: right;
  font-size: var(--type-body-4-size);
  line-height: var(--type-body-4-line-height);
  font-weight: var(--type-body-4-weight);
}

.monitoring-history-strip {
  margin-top: var(--sp-4);
  padding-top: var(--sp-2);
  min-width: 0;
}

.monitoring-sparkline {
  display: block;
  width: 100%;
  height: var(--monitoring-sparkline-height);
  color: var(--status-info-fg);
}

.monitoring-sparkline polyline {
  stroke: currentColor;
  stroke-width: var(--monitoring-sparkline-stroke-width);
}

.monitoring-entity-row .monitoring-history-strip {
  display: flex;
  width: var(--monitoring-sparkline-width-compact);
  min-width: var(--monitoring-sparkline-width-compact);
  height: var(--monitoring-sparkline-height-compact);
  margin-top: 0;
  padding-top: 0;
  align-items: center;
  justify-content: flex-end;
}

.monitoring-entity-row .monitoring-history-strip .monitoring-sparkline {
  height: var(--monitoring-sparkline-height-compact);
}

.monitoring-entity-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3);
  border: 1px solid color-mix(in srgb, var(--status-success-fg) 8%, var(--border-default));
  border-radius: var(--monitoring-item-radius);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--surface-elevated) 98%, white 2%) 0%,
    color-mix(in srgb, var(--surface-elevated) 86%, var(--surface-page) 14%) 100%
  );
  color: inherit;
  text-align: left;
}

.monitoring-process-list {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  border: 0;
  background: transparent;
  box-shadow: none;
}

.monitoring-entity-row__copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--sp-1);
}

.monitoring-entity-row__title {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow-wrap: anywhere;
}

.monitoring-entity-row__meta {
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.monitoring-entity-row--selected {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--status-success-bg) 76%, white 24%) 0%,
    color-mix(in srgb, var(--status-success-bg) 90%, var(--surface-page) 10%) 100%
  );
  border-color: color-mix(in srgb, var(--status-success-fg) 18%, var(--border-default));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--status-success-fg) 8%, transparent);
}

.monitoring-entity-row--child {
  position: relative;
  margin-left: var(--sp-5);
  width: calc(100% - var(--sp-5));
  box-sizing: border-box;
  padding-left: calc(var(--sp-5) + var(--sp-3));
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--surface-elevated) 92%, var(--surface-page) 8%) 0%,
    color-mix(in srgb, var(--surface-elevated) 78%, var(--surface-page) 22%) 100%
  );
}

.monitoring-entity-row--child::before {
  content: "";
  position: absolute;
  left: calc(-1 * var(--sp-3));
  top: calc(-1 * var(--sp-3));
  width: var(--sp-5);
  height: calc(50% + var(--sp-3));
  border-left: 1px solid color-mix(in srgb, var(--status-success-fg) 22%, var(--border-default));
  border-bottom: 1px solid color-mix(in srgb, var(--status-success-fg) 22%, var(--border-default));
  border-bottom-left-radius: var(--radius-xs);
  pointer-events: none;
}

.monitoring-page {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.monitoring-dashboard {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}

.monitoring-content {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  padding: 0;
}

.monitoring-dashboard-toolbar,
.monitoring-dashboard-grid,
.monitoring-overview-grid,
.monitoring-attribution,
.monitoring-panel-header__actions {
  display: grid;
  gap: var(--sp-4);
}

.monitoring-dashboard-toolbar,
.monitoring-stage-toolbar {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.monitoring-dashboard-toolbar__copy,
.monitoring-stage-toolbar__copy {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: var(--sp-2);
  align-items: center;
}

.monitoring-dashboard-toolbar__label,
.monitoring-stage-toolbar__timestamp {
  color: var(--text-tertiary);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
}

.monitoring-dashboard-toolbar__controls,
.monitoring-stage-toolbar__controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--sp-3);
}

.monitoring-dashboard-grid {
  gap: var(--sp-4);
}

.monitoring-panel-header__copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--sp-1);
}

.monitoring-panel-header__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--sp-3);
}

.monitoring-detail__path {
  display: block;
  margin: 0 0 var(--sp-3);
  padding: var(--sp-3);
  border: 1px solid color-mix(in srgb, var(--status-success-fg) 8%, var(--border-default));
  border-radius: var(--monitoring-item-radius);
  background: color-mix(in srgb, var(--surface-page) 10%, black 90%);
  color: color-mix(in srgb, white 88%, var(--status-success-bg));
  font-family: var(--font-mono);
  overflow-wrap: anywhere;
}

.monitoring-overview-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.monitoring-attribution {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.monitoring-dashboard .notice {
  border-radius: var(--monitoring-item-radius);
}

.monitoring-detail-panel,
.monitoring-process-section {
  min-width: 0;
}

.settings-provider-tabs {
  display: flex;
  gap: var(--sp-1);
  margin-bottom: var(--space-default);
}

.settings-provider-base-layout {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.settings-provider-badges,
.settings-provider-actions {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

.settings-provider-badges {
  margin-bottom: var(--sp-3);
}

.settings-provider-tab {
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  transition: all var(--duration-fast) var(--ease-out);
}

.settings-provider-tab:hover {
  background: var(--surface-hover);
}

.settings-provider-tab-active {
  background: var(--surface-active);
  border-color: var(--border-focus);
  color: var(--text-primary);
}

.settings-provider-subnav {
  display: flex;
  gap: var(--sp-1);
  margin-bottom: var(--space-default);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--border-default);
}

.settings-provider-subnav-button {
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  transition: all var(--duration-fast) var(--ease-out);
}

.settings-provider-subnav-button:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.settings-provider-subnav-button-active {
  color: var(--text-primary);
  background: var(--surface-active);
  border-color: var(--border-focus);
}

.settings-provider-config-stack {
  width: 100%;
}

.settings-provider-config-stack--fill-height {
  display: flex;
  flex: 1;
  min-height: 0;
}

.settings-provider-config-panel {
  width: 100%;
}

.settings-provider-config-panel--fill-height {
  display: flex;
  flex: 1;
  min-height: 0;
}

.settings-provider-content--fill-height {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}

.settings-group--fill-height {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  margin-bottom: 0;
}

.settings-provider-config-panel-hidden {
  display: none;
}

.settings-provider-mobile-entry {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  width: 100%;
  padding: var(--sp-3) 0;
  border: none;
  border-top: 1px solid var(--border-default);
  border-radius: 0;
  background: transparent;
  text-align: left;
}

.settings-provider-mobile-entry__title {
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--type-body-3-weight);
  color: var(--text-primary);
}

.settings-provider-mobile-entry__meta {
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.settings-provider-mobile-config-header {
  display: flex;
  justify-content: flex-start;
  margin-bottom: var(--sp-4);
}

.settings-config-field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-bottom: var(--space-default);
  width: 100%;
}

.settings-config-field--inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--sp-3);
}

.settings-config-label {
  display: block;
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  color: var(--text-tertiary);
  margin-bottom: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.settings-config-field--inline .settings-config-label {
  margin-bottom: 0;
}

.settings-config-control {
  display: flex;
  justify-content: flex-end;
  min-width: 0;
}

.settings-input-compact {
  width: min(160px, 100%);
  text-align: right;
}

.settings-appearance-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.settings-appearance-panels {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.settings-appearance-panel {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border: 1px solid var(--component-mix-border-default-78pct-transparent);
  border-radius: var(--radius-lg);
  background: var(--component-mix-surface-input-72pct-surface-panel-28pct);
}

.settings-appearance-panel .settings-config-field:last-child,
.settings-appearance-panel .settings-toggle-row:last-child {
  margin-bottom: 0;
  border-bottom: none;
}

.settings-appearance-panel .settings-config-field {
  margin-bottom: 0;
}

.settings-appearance-asset-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: var(--sp-3);
  padding: var(--sp-3);
  border: 1px solid var(--component-mix-border-default-70pct-transparent);
  border-radius: var(--radius-md);
  background: var(--component-mix-surface-panel-82pct-transparent);
}

.settings-appearance-asset-meta {
  min-width: 0;
}

.settings-appearance-asset-id {
  display: block;
  overflow-wrap: anywhere;
  font-family: var(--font-mono);
}

.settings-appearance-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--sp-2);
}

.settings-appearance-material-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-3);
}

.settings-appearance-metric-field {
  margin-bottom: 0;
  padding: var(--sp-3);
  border: 1px solid var(--component-mix-border-default-70pct-transparent);
  border-radius: var(--radius-md);
  background: var(--component-mix-surface-panel-78pct-transparent);
}

.settings-appearance-metric-field .settings-config-control {
  justify-content: flex-start;
}

.settings-appearance-metric-field .settings-input-compact {
  width: 100%;
  text-align: left;
}

.settings-appearance-overrides {
  display: flex;
  flex-direction: column;
}

.settings-appearance-override-panel {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin-top: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--component-mix-border-default-68pct-transparent);
  border-radius: var(--radius-lg);
  background: var(--component-mix-surface-panel-74pct-transparent);
}

.settings-appearance-override-panel .settings-config-field:last-child,
.settings-appearance-override-panel .settings-toggle-row:last-child {
  margin-bottom: 0;
  border-bottom: none;
}

.settings-appearance-override-panel .settings-config-field {
  margin-bottom: 0;
}

.settings-provider-args-input {
  display: block;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  background: var(--component-mix-surface-input-82pct-surface-panel-18pct);
  border-color: var(--border-default);
  font-family: var(--font-mono);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
}

.settings-command-preview {
  display: block;
  padding: var(--sp-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--component-mix-surface-input-82pct-surface-panel-18pct);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
  min-height: 44px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.settings-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  min-height: 32px;
  padding: var(--sp-3) var(--sp-6);
  background: var(--surface-panel);
  border-top: 1px solid var(--border-default);
}

.settings-footer__meta {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  color: var(--text-muted);
}

.settings-autosave {
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.settings-version {
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}

/* ========== Terminal Panel ========== */
.terminal-panel {
  display: flex;
  flex-direction: column;
  background: var(--surface-input);
  border-top: 1px solid var(--border-default);
  height: 100%;
}

.terminal-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-2) var(--sp-3);
  background: var(--surface-panel);
  border-bottom: 1px solid var(--border-default);
}

.terminal-panel-header-left {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.terminal-panel-kicker {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
}

.terminal-panel-title {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.terminal-panel-header-right {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.terminal-selector {
  position: relative;
}

.terminal-selector-btn {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-2);
  background: var(--surface-hover);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.terminal-selector-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 200px;
  background: var(--surface-panel);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-dropdown);
}

.terminal-selector:hover .terminal-selector-dropdown {
  display: block;
}

.terminal-selector-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--sp-2) var(--sp-3);
  transition: background var(--duration-fast) var(--ease-out);
}

.terminal-selector-item:hover {
  background: var(--surface-hover);
}

.terminal-selector-item-active {
  color: var(--text-primary);
}

.terminal-selector-item-title {
  flex: 1;
  font-size: var(--text-sm);
}

.terminal-selector-item-trigger {
  flex: 1;
  padding: 0;
  background: transparent;
  border: none;
  color: inherit;
  text-align: left;
}

.terminal-selector-item-close {
  padding: var(--sp-1);
  background: transparent;
  border: none;
  color: var(--text-tertiary);
}

.terminal-selector-item-close:hover {
  color: var(--status-danger-fg);
}

.terminal-panel-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.terminal-panel-tabs {
  display: flex;
  gap: var(--sp-1);
  padding: var(--sp-1) var(--sp-2);
  background: var(--surface-panel);
  border-bottom: 1px solid var(--border-default);
}

.terminal-tab {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-1) var(--sp-2);
  background: var(--surface-hover);
  border-radius: var(--radius-sm);
}

.terminal-tab-active {
  background: var(--surface-active);
}

.terminal-tab-label {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.terminal-tab-active .terminal-tab-label {
  color: var(--text-primary);
}

.terminal-tab-close {
  padding: var(--sp-1);
  background: transparent;
  border: none;
  color: var(--text-tertiary);
}

.terminal-tab-close:hover {
  color: var(--status-danger-fg);
}

.terminal-panel-xterm {
  flex: 1;
  overflow: hidden;
  background: var(--surface-input);
}

.xterm-host-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  padding: var(--terminal-panel-inset);
  box-sizing: border-box;
}

.xterm-host-shell--with-preview-strip {
  overflow: hidden;
}

.xterm-host {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  width: 100%;
  border-radius: var(--terminal-local-overlay-radius);
  overflow: hidden;
}

.xterm-host-preview-strip {
  position: absolute;
  top: 0;
  right: var(--sp-3);
  z-index: var(--z-inline);
  display: flex;
  gap: var(--gap-default);
}

.xterm-host-preview-item {
  position: relative;
}

.xterm-host-preview-tile,
.xterm-host-preview-overflow {
  width: 56px;
  height: 56px;
  box-sizing: border-box;
  border-radius: var(--radius-sm);
}

.xterm-host-preview-tile {
  display: block;
  border: 1px solid var(--component-mix-border-default-56pct-transparent);
  object-fit: cover;
  background: var(--surface-panel);
}

.xterm-host-preview-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  display: flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--component-mix-border-default-56pct-transparent);
  border-radius: var(--radius-pill);
  background: var(--surface-panel);
  color: var(--text-primary);
  cursor: pointer;
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  opacity: 0;
  transform: scale(0.92);
  transition:
    opacity 140ms ease,
    transform 140ms ease,
    background-color 140ms ease,
    border-color 140ms ease;
}

.xterm-host-preview-item:hover .xterm-host-preview-remove,
.xterm-host-preview-item:focus-within .xterm-host-preview-remove,
.xterm-host-preview-remove:hover,
.xterm-host-preview-remove:focus-visible {
  opacity: 1;
  transform: scale(1);
}

.xterm-host-preview-remove:hover,
.xterm-host-preview-remove:focus-visible {
  background: var(--component-mix-surface-page-78pct-surface-panel-22pct);
  border-color: var(--component-mix-border-default-72pct-transparent);
}

.xterm-host-preview-remove:focus-visible {
  outline: 2px solid var(--focus-ring, var(--text-accent));
  outline-offset: 1px;
}

.xterm-host-preview-popover {
  position: absolute;
  top: 64px;
  right: var(--sp-3);
  z-index: var(--z-inline-raised);
  padding: var(--gap-tight);
  border: 1px solid var(--component-mix-border-default-56pct-transparent);
  border-radius: var(--radius-md);
  background: var(--surface-panel);
  box-shadow: var(--shadow-lg);
}

.xterm-host-preview-popover-image {
  display: block;
  max-width: 280px;
  max-height: 280px;
  border-radius: var(--radius-sm);
  object-fit: contain;
}

.xterm-host-preview-overflow {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--component-mix-surface-page-78pct-surface-panel-22pct);
  border: 1px solid var(--component-mix-border-default-56pct-transparent);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  line-height: 1;
}

.xterm-host-shell--mobile-input {
  gap: 0;
  padding: 0;
}

.mobile-terminal-input-bar {
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
  min-width: 0;
  padding: 4px var(--sp-2) 3px;
  border-top: 1px solid var(--component-mix-border-default-68pct-transparent);
  background: var(--component-mix-surface-page-92pct-surface-input-8pct);
}

.mobile-terminal-input-bar__actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 3px;
  margin-right: var(--sp-1);
  padding-right: var(--sp-1);
  border-right: 1px solid var(--component-mix-border-default-56pct-transparent);
}

.mobile-terminal-input-bar__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 20px;
  padding: 0 6px;
  border: 1px solid var(--component-mix-border-default-70pct-transparent);
  border-radius: var(--radius-sm);
  background: var(--component-mix-surface-page-78pct-surface-panel-22pct);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: var(--font-medium);
  line-height: 1;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.mobile-terminal-input-bar__keys {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1 1 auto;
  justify-content: flex-start;
  gap: 3px;
  overflow-x: auto;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  scrollbar-width: none;
}

.mobile-terminal-input-bar__keys::-webkit-scrollbar {
  display: none;
}

.mobile-terminal-input-bar__key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 0;
  min-height: 20px;
  padding: 0 5px;
  border: 1px solid var(--component-mix-border-default-68pct-transparent);
  border-radius: var(--radius-sm);
  background: var(--component-mix-surface-page-80pct-surface-panel-20pct);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: var(--font-medium);
  line-height: 1;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.mobile-terminal-input-bar__ctrl,
.mobile-terminal-input-bar__shift,
.mobile-terminal-input-bar__key[data-key-id="escape"],
.mobile-terminal-input-bar__key[data-key-id="tab"] {
  min-width: 28px;
}

.mobile-terminal-input-bar__key[data-key-id="enter"] {
  min-width: 34px;
}

.mobile-terminal-input-bar__key[data-key-id="arrow_up"],
.mobile-terminal-input-bar__key[data-key-id="arrow_left"],
.mobile-terminal-input-bar__key[data-key-id="arrow_down"],
.mobile-terminal-input-bar__key[data-key-id="arrow_right"] {
  min-width: 20px;
  padding: 0;
}

.mobile-terminal-input-bar__ctrl[data-ctrl-mode="armed"] {
  border-color: var(--component-mix-status-info-fg-28pct-border-default);
  background: var(--component-mix-status-info-fg-8pct-surface-panel);
  color: var(--text-primary);
}

.mobile-terminal-input-bar__ctrl[data-ctrl-mode="locked"] {
  border-color: var(--component-mix-status-info-fg-42pct-border-default);
  background: var(--component-mix-status-info-fg-12pct-surface-panel);
  color: var(--component-mix-status-info-fg-84pct-text-primary);
}

.mobile-terminal-input-bar__shift[data-shift-armed="true"] {
  border-color: var(--component-mix-status-info-fg-28pct-border-default);
  background: var(--component-mix-status-info-fg-8pct-surface-panel);
  color: var(--text-primary);
}

.mobile-terminal-input-bar__key:disabled,
.mobile-terminal-input-bar__shift:disabled,
.mobile-terminal-input-bar__action:disabled {
  opacity: 0.52;
}

.mobile-shell__agent-stage .mobile-terminal-input-bar {
  padding: 3px calc(var(--mobile-safe-right) + var(--sp-3)) 4px
    calc(var(--mobile-safe-left) + var(--sp-3));
}

.xterm-replay-overlay__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  max-width: 32rem;
  padding: var(--sp-4) var(--sp-5);
  border: 1px solid var(--component-mix-border-default-78pct-status-info-fg-22pct);
  border-radius: var(--terminal-local-overlay-radius);
  background: var(--component-mix-surface-elevated-92pct-transparent);
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.xterm-replay-overlay--degraded .xterm-replay-overlay__card {
  border-color: var(--component-mix-border-default-68pct-status-warning-fg-32pct);
}

.xterm-replay-overlay__spinner {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: var(--radius-pill);
  border: 2px solid var(--component-mix-status-info-fg-24pct-transparent);
  border-top-color: var(--status-info-fg);
  animation: spin 0.8s linear infinite;
}

.xterm-replay-overlay__title {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.xterm-replay-overlay__body {
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--text-secondary);
}

.xterm-replay-overlay__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-2);
  width: 100%;
  margin-top: var(--sp-1);
}

.xterm-replay-overlay__action-btn {
  flex: 1 1 0;
  min-width: 120px;
}

/* xterm.js overrides for Aurora Mint theme */
.xterm-host .xterm-viewport {
  overflow-y: auto;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  background: transparent;
  scrollbar-width: none;
}

.xterm-host .xterm-screen {
  background: transparent;
}

/* Third-party widgets render their own scroll containers, so bridge them back
 * to the shared scrollbar tokens instead of letting their library defaults
 * drift away from the rest of the app. */
.xterm-host .xterm-viewport::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.xterm-host .xterm .xterm-scrollable-element > .scrollbar.vertical,
.monaco-host .monaco-editor .monaco-scrollable-element > .scrollbar.vertical,
.monaco-host .monaco-diff-editor .monaco-scrollable-element > .scrollbar.vertical {
  width: var(--scrollbar-width) !important;
}

.xterm-host .xterm .xterm-scrollable-element > .scrollbar.horizontal,
.monaco-host .monaco-editor .monaco-scrollable-element > .scrollbar.horizontal,
.monaco-host .monaco-diff-editor .monaco-scrollable-element > .scrollbar.horizontal {
  height: var(--scrollbar-width) !important;
}

.xterm-host .xterm .xterm-scrollable-element > .scrollbar.vertical > .slider {
  width: var(--scrollbar-width) !important;
  left: 0 !important;
}

.xterm-host .xterm .xterm-scrollable-element > .scrollbar.horizontal > .slider {
  height: var(--scrollbar-width) !important;
  top: 0 !important;
}

.xterm-host .xterm .xterm-scrollable-element > .scrollbar,
.monaco-host .monaco-editor .monaco-scrollable-element > .scrollbar,
.monaco-host .monaco-diff-editor .monaco-scrollable-element > .scrollbar {
  background: var(--scrollbar-track) !important;
}

.xterm-host .xterm .xterm-scrollable-element > .scrollbar > .slider,
.monaco-host .monaco-editor .monaco-scrollable-element > .scrollbar > .slider,
.monaco-host .monaco-diff-editor .monaco-scrollable-element > .scrollbar > .slider {
  background: var(--scrollbar-thumb) !important;
  border-radius: var(--radius-full) !important;
}

.xterm-host .xterm .xterm-scrollable-element > .scrollbar:hover > .slider,
.xterm-host .xterm .xterm-scrollable-element > .scrollbar.active > .slider,
.xterm-host .xterm .xterm-scrollable-element > .scrollbar > .slider:hover,
.monaco-host .monaco-editor .monaco-scrollable-element > .scrollbar:hover > .slider,
.monaco-host .monaco-editor .monaco-scrollable-element > .scrollbar.active > .slider,
.monaco-host .monaco-editor .monaco-scrollable-element > .scrollbar > .slider:hover,
.monaco-host .monaco-diff-editor .monaco-scrollable-element > .scrollbar:hover > .slider,
.monaco-host .monaco-diff-editor .monaco-scrollable-element > .scrollbar.active > .slider,
.monaco-host .monaco-diff-editor .monaco-scrollable-element > .scrollbar > .slider:hover {
  background: var(--border-focus) !important;
}

.terminal-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}

.terminal-panel-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4);
  color: var(--text-tertiary);
}

.terminal-panel-empty-icon {
  color: var(--icon-muted);
  opacity: 0.5;
}

.terminal-panel-empty-text {
  font-size: var(--text-base);
}

/* ========== Focus Mode ========== */
body.focus-mode-active .left-panel,
body.focus-mode-active .split-divider-v,
body.focus-mode-active .bottom-terminal,
body.focus-mode-active .split-divider-h {
  display: none !important;
}

/* ========== Layout ========== */
.workspace-body {
  display: flex;
  flex: 1;
  min-height: 0;
  background: transparent;
}

/* ========== Workspace Page Layout ========== */
.workspace-page {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--workspace-page-surface);
}

.workspace-page-focus {
  /* handled by body class */
}

.workspace-page-empty {
  /* empty state layout */
}

.workspace-empty-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
}

/* ========== Resizers ========== */
.workspace-resizer {
  background: var(--border-default);
  z-index: var(--z-inline);
  transition: background 0.15s;
}

.workspace-resizer-vertical {
  grid-row: 2 / -1;
  grid-column: 2;
  width: 8px;
  cursor: col-resize;
}

.workspace-resizer-horizontal {
  grid-column: 3;
  grid-row: 3;
  height: 8px;
  cursor: row-resize;
}

.workspace-resizer:hover {
  background: var(--status-info-fg);
}

.workspace-main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ========== 分割线 ========== */
.split-divider-v {
  width: 10px;
  margin-left: -5px;
  margin-right: -5px;
  background: transparent;
  cursor: col-resize;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: var(--z-inline-raised);
}

.split-divider-v:hover {
  background: transparent;
}

.split-divider-h {
  height: 10px;
  margin-top: -5px;
  margin-bottom: -5px;
  background: transparent;
  cursor: row-resize;
  flex-shrink: 0;
  position: relative;
  z-index: var(--z-inline-raised);
}

.split-divider-h:hover {
  background: transparent;
}

.split-divider-v::before,
.split-divider-h::before {
  content: "";
  position: absolute;
  background: var(--component-mix-border-default-62pct-transparent);
  pointer-events: none;
}

.split-divider-v::before {
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  transform: translateX(-50%);
}

.split-divider-h::before {
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  transform: translateY(-50%);
}

.split-divider-v:hover::before,
.split-divider-h:hover::before {
  background: var(--component-mix-border-focus-58pct-transparent);
}

/* Disable text selection during resize */
body.is-resizing-panels {
  user-select: none;
  cursor: inherit;
}

body.is-resizing-panels * {
  cursor: inherit !important;
}

/* ========== Left Panel ========== */
.left-panel {
  width: 280px;
  min-width: 200px;
  background: var(--surface-muted);
  border-right: 1px solid var(--border-default);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}

.panel-header {
  padding: var(--sp-3) var(--inset-control-inline) var(--inset-control-block);
  border-bottom: 1px solid var(--border-default);
}

.panel-kicker {
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-ter);
  margin-bottom: var(--gap-tight);
}

.panel-branch {
  display: inline-flex;
  align-items: center;
  gap: var(--gap-control);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
  font-family: var(--font-mono);
  color: var(--text-sec);
  background: var(--surface-hover);
  border-radius: var(--radius-control-sm);
  padding: var(--gap-compact) var(--sp-2);
}

.panel-tabs {
  display: flex;
  gap: var(--gap-control);
  margin-top: var(--gap-default);
}

.panel-tab {
  font-size: var(--type-body-6-size);
  font-weight: var(--type-body-6-weight);
  line-height: var(--type-body-6-line-height);
  padding: var(--gap-compact) var(--sp-2);
  border-radius: var(--radius-control-sm);
  color: var(--text-ter);
  cursor: pointer;
  transition: all 0.1s;
}

.panel-tab:hover {
  color: var(--text-sec);
}
.panel-tab.active {
  background: var(--status-info-fg);
  color: var(--bg);
  font-weight: var(--type-body-6-weight);
}

.panel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--gap-tight) var(--inset-control-inline);
  border-bottom: 1px solid var(--border-default);
}

.panel-toolbar-btn {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-ter);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.06s;
}

.panel-toolbar-btn:hover {
  background: var(--surface-hover);
  color: var(--text-sec);
}

/* ========== File Tree ========== */
.file-tree {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}

.tree-item {
  display: flex;
  align-items: center;
  gap: var(--gap-control);
  padding: 3px var(--inset-control-inline) 3px var(--inset-row-inline);
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--type-body-3-weight);
  color: var(--text-sec);
  cursor: pointer;
  transition: background 0.06s;
  white-space: nowrap;
}

.tree-item:hover {
  background: var(--component-mix-state-selected-bg-72pct-transparent);
}
.tree-item.selected {
  background: var(--state-selected-bg);
  color: var(--text);
  border-left: var(--state-focus-ring-width) solid var(--state-selected-border);
  padding-left: calc(var(--inset-row-inline) - var(--state-focus-ring-width));
}

.tree-chevron {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-ter);
  font-size: 12px;
  flex-shrink: 0;
}

.tree-icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 13px;
}

.tree-icon.folder {
  color: var(--status-warning-fg);
}
.tree-icon.ts {
  color: var(--status-info-fg);
}
.tree-icon.css {
  color: var(--status-success-fg);
}
.tree-icon.json {
  color: var(--status-warning-fg);
}
.tree-icon.md {
  color: var(--text-ter);
}

.tree-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.tree-children {
  padding-left: var(--inset-control-inline);
}

.tree-empty-hint {
  padding-left: 26px;
  color: var(--text-muted);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
  font-style: italic;
}

.tree-loading {
  padding-left: 26px;
  color: var(--text-muted);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
}

/* ========== Center Area ========== */
.center-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ========== Agent Panes ========== */
.agent-panes {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: transparent;
  position: relative;
  overflow: hidden;
  min-height: 0;
}

.agent-panes-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--text-ter);
}

/* ========== Agent Pane ========== */
.agent-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: transparent;
  position: relative;
  min-height: 0;
}

body.is-dragging-pane {
  cursor: grabbing;
  user-select: none;
}

.agent-pane-leaf {
  position: relative;
  display: flex;
  flex: 1;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: transparent;
}

.agent-progress {
  height: 3px;
  background: var(--state-info-bg);
  position: relative;
  min-height: 0;
}

.agent-progress .fill {
  height: 100%;
  background: var(--status-info-fg);
  transition: width 60ms;
}

.agent-progress .fill.error {
  background: var(--status-danger-fg);
}

.agent-header {
  display: flex;
  align-items: center;
  gap: var(--gap-default);
  padding: var(--gap-tight) var(--inset-control-inline);
  border-bottom: 1px solid var(--border-default);
}

.agent-session-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.agent-session-dot.active {
  background: var(--status-success-fg);
  animation: pulse 2s infinite;
}

.agent-session-dot.idle {
  background: var(--text-tertiary);
}
.agent-title {
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-sec);
}

.agent-badge {
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  padding: var(--inset-chip-block) var(--inset-chip-inline);
  border-radius: var(--radius-control-sm);
  background: var(--surface-hover);
  color: var(--text-ter);
}

.agent-status {
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  padding: var(--inset-chip-block) var(--inset-chip-inline);
  border-radius: var(--radius-control-sm);
}

.agent-status.running {
  background: var(--state-success-bg);
  color: var(--state-success-text);
}

.agent-status.idle {
  background: var(--state-disabled-bg);
  color: var(--state-disabled-text);
}

.agent-header-left {
  display: flex;
  align-items: center;
  gap: var(--gap-default);
}

.agent-actions {
  margin-left: auto;
  display: flex;
  gap: var(--gap-control);
}

.agent-action-btn {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-ter);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.06s;
}

.agent-action-btn:hover {
  background: var(--surface-hover);
}
.agent-action-btn.close:hover {
  color: var(--status-danger-fg);
}

.term-line {
  white-space: pre;
}
.term-prompt {
  color: var(--status-success-fg);
}
.term-path {
  color: var(--status-info-fg);
}
.term-cmd {
  color: var(--text);
}
.term-output {
  color: var(--text-sec);
}
.term-success {
  color: var(--status-success-fg);
}
.term-warn {
  color: var(--status-warning-fg);
}
.term-error {
  color: var(--status-danger-fg);
}
.term-cursor {
  display: inline-block;
  width: 8px;
  height: 16px;
  background: var(--status-success-fg);
  animation: pulse 1s step-end infinite;
  vertical-align: middle;
}

/* ========== Bottom Terminal ========== */
.bottom-terminal {
  border-top: 1px solid var(--border-default);
  background: var(--surface-panel);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}

.terminal-toolbar {
  display: flex;
  align-items: center;
  padding: 6px 12px;
  gap: 8px;
  border-bottom: 1px solid var(--border-default);
}

.terminal-kicker {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-ter);
}

.terminal-title {
  font-size: 12px;
  color: var(--text-sec);
}

.terminal-select {
  background: var(--bg);
  border: 1px solid var(--border-default);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  color: var(--text-sec);
  font-family: var(--sans);
}

/* ========== Welcome Page ========== */
.welcome-container,
.auth-screen {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--sp-8);
  background: linear-gradient(
    180deg,
    var(--component-mix-surface-page-97pct-surface-panel-3pct) 0%,
    var(--surface-page) 100%
  );
}

.welcome-container {
  padding: var(--sp-10);
}

.welcome-container--landing {
  height: 100%;
  min-height: 0;
  overflow-y: auto;
}

.welcome-card {
  width: min(100%, 1180px);
  max-width: 1180px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--sp-6);
  padding: var(--sp-8);
  background: var(--surface-panel);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  text-align: left;
}

.welcome-card--landing {
  gap: var(--sp-5);
}

.welcome-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.3fr);
  gap: var(--sp-7);
  align-items: start;
}

.welcome-card__hero,
.welcome-card__actions,
.welcome-card__panel,
.welcome-card__features {
  width: 100%;
}

.welcome-card__hero {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.welcome-card--landing .welcome-card__hero {
  gap: var(--sp-4);
  padding-right: 0;
}

.welcome-card__actions,
.welcome-card__panel,
.welcome-card__features {
  padding-top: var(--sp-5);
  border-top: 1px solid var(--component-mix-border-default-82pct-transparent);
}

.welcome-actions-group {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.welcome-step-hint,
.welcome-step-detail {
  width: 100%;
  margin: 0;
}

.welcome-step-hint {
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-ter);
}

.welcome-flow {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  min-width: 0;
}

.welcome-flow__header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.welcome-flow__steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-3);
}

.welcome-step-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border: 1px solid var(--component-mix-border-default-84pct-transparent);
  border-radius: var(--radius-lg);
  background: var(--component-mix-surface-panel-92pct-surface-page);
}

.welcome-step-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}

.welcome-step-card__label {
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.welcome-step-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  background: var(--component-mix-surface-page-94pct-surface-panel-6pct);
}

.welcome-step-card__title {
  font-size: var(--type-heading-5-size);
  line-height: var(--type-heading-5-line-height);
  font-weight: var(--type-heading-5-weight);
  color: var(--text-primary);
  min-height: calc(var(--type-heading-5-line-height) * 2);
}

.welcome-step-detail {
  max-width: 40ch;
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
  color: var(--text-secondary);
  flex: 1;
}

.welcome-kicker {
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-ter);
}

.welcome-title {
  font-size: var(--type-heading-3-size);
  line-height: var(--type-heading-3-line-height);
  font-weight: var(--type-heading-3-weight);
  margin: 0;
  color: var(--text);
}

.welcome-body {
  font-size: var(--type-body-4-size);
  line-height: var(--type-body-4-line-height);
  font-weight: var(--type-body-4-weight);
  color: var(--text-secondary);
  margin: 0;
}

.welcome-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  min-height: var(--btn-height-lg);
  min-width: 220px;
  padding: 0 var(--sp-6);
  border: 1px solid var(--component-mix-status-info-fg-28pct-border-default);
  border-radius: var(--radius-md);
  background: var(--status-info-fg);
  color: var(--text-inverse);
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--font-medium);
  cursor: pointer;
  font-family: var(--sans);
  transition:
    background var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out);
  width: auto;
}

.welcome-btn:hover {
  filter: none;
  background: var(--component-mix-status-info-fg-88pct-white-12pct);
}

.diagnostics-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.diagnostics-page--embedded {
  min-height: auto;
}

.diagnostics-header {
  padding: var(--sp-1) var(--sp-4);
  background: var(--surface-panel);
  border-bottom: 1px solid var(--border-default);
}

.diagnostics-body {
  display: flex;
  flex: 1;
  min-height: 0;
  align-items: stretch;
  background: var(--surface-page);
}

.diagnostics-page--embedded .diagnostics-body {
  background: transparent;
}

.diagnostics-content {
  display: flex;
  flex: 1;
  min-height: 0;
  justify-content: center;
  padding: var(--sp-6);
  overflow-y: auto;
  background: var(--surface-page);
}

.diagnostics-page--embedded .diagnostics-content {
  justify-content: flex-start;
  padding: 0;
  overflow: visible;
  background: transparent;
}

.diagnostics-content-surface {
  width: min(100%, var(--desktop-content-max-width));
  min-width: 0;
  min-height: 100%;
  padding: var(--sp-6);
  background: var(--surface-elevated);
  border: 1px solid var(--component-mix-border-default-84pct-transparent);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.diagnostics-page--embedded .diagnostics-content-surface {
  width: 100%;
  min-height: auto;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.diagnostics-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-6);
}

.diagnostics-summary--mobile {
  gap: var(--sp-3);
}

.diagnostics-summary__copy {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  min-width: 0;
}

.diagnostics-summary__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.diagnostics-summary__title {
  margin: 0;
  font-size: var(--type-heading-4-size);
  line-height: var(--type-heading-4-line-height);
  font-weight: var(--type-heading-4-weight);
  color: var(--text-primary);
}

.diagnostics-summary__description {
  margin: 0;
  max-width: 64ch;
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  color: var(--text-secondary);
}

.diagnostics-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  justify-content: flex-end;
  flex-shrink: 0;
}

.diagnostics-actions--mobile {
  width: 100%;
  align-items: stretch;
  flex-direction: column;
  gap: var(--sp-2);
}

.diagnostics-actions__primary {
  width: 100%;
}

.diagnostics-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
}

.diagnostics-toolbar--mobile {
  justify-content: flex-start;
}

.diagnostics-loading {
  padding: var(--sp-4);
  border: 1px dashed var(--component-mix-border-default-76pct-transparent);
  border-radius: var(--radius-md);
  background: var(--component-mix-surface-panel-92pct-surface-page);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.diagnostics-results {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.diagnostics-section {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border: 1px solid var(--component-mix-border-default-84pct-transparent);
  border-radius: var(--radius-lg);
  background: var(--component-mix-surface-panel-94pct-surface-page);
  box-shadow: 0 1px 0 var(--component-mix-border-default-42pct-transparent);
}

.diagnostics-section__header {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.diagnostics-section__title {
  margin: 0;
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.diagnostics-section__description,
.diagnostics-section__note {
  margin: 0;
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--text-secondary);
}

.diagnostics-lsp-services {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.diagnostics-lsp-service {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-3);
  border: 1px solid var(--component-mix-border-default-76pct-transparent);
  border-radius: var(--radius-md);
  background: var(--component-mix-surface-panel-98pct-surface-page);
}

.diagnostics-lsp-service__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
}

.diagnostics-lsp-service__name {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.diagnostics-lsp-service__description {
  margin: 0;
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--text-secondary);
}

.diagnostics-lsp-service__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-4);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.diagnostics-issues {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.diagnostics-issue {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border: 1px solid var(--component-mix-border-default-84pct-transparent);
  border-radius: var(--radius-lg);
  background: var(--component-mix-surface-panel-94pct-surface-page);
  box-shadow: 0 1px 0 var(--component-mix-border-default-42pct-transparent);
}

.diagnostics-issue__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
}

.diagnostics-issue__title {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.diagnostics-issue__description {
  margin: 0;
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--text-secondary);
}

.diagnostics-issue__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-4);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.diagnostics-issue__guides {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-3);
  border-radius: var(--radius-md);
  background: var(--component-mix-status-warning-fg-8pct-surface-panel);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.diagnostics-issue__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.diagnostics-install-panel {
  display: grid;
  gap: var(--sp-3);
  margin-top: var(--sp-3);
  padding: var(--sp-3);
  border-color: var(--border-default);
  border: 1px solid var(--border-default, var(--border));
  border-radius: var(--radius-lg);
  background: var(--surface-page);
}

.diagnostics-install-panel__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-4);
  color: var(--text-secondary);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
}

.diagnostics-install-panel__log {
  min-height: 120px;
  max-height: 220px;
  overflow: auto;
  margin: 0;
  padding: var(--sp-3);
  border: 1px solid var(--border-subtle, var(--border));
  border-radius: var(--radius-md);
  background: var(--surface-panel);
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}

.diagnostics-install-panel__prompt {
  display: grid;
  gap: var(--sp-2);
}

.diagnostics-install-panel__label {
  color: var(--text-secondary);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
}

.diagnostics-install-panel__input {
  width: 100%;
}

.diagnostics-install-panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.welcome-divider {
  width: 48px;
  height: 1px;
  background: var(--border-default);
  margin: var(--sp-4) 0;
}

.welcome-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--desktop-panel-gap);
  width: 100%;
}

.welcome-support {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.welcome-support__title {
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.welcome-support-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-2);
}

.welcome-feature {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3);
  border-radius: var(--radius-lg);
  background: transparent;
  min-height: 0;
  justify-content: flex-start;
  flex-direction: row;
  border: 1px solid var(--component-mix-border-default-84pct-transparent);
  box-shadow: none;
  text-align: left;
}

.welcome-feature-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
}

.welcome-feature-text {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.welcome-feature-title {
  font-size: var(--type-body-4-size);
  line-height: var(--type-body-4-line-height);
  font-weight: var(--type-body-4-weight);
  color: var(--text-primary);
}

.welcome-feature-desc {
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
  color: var(--text-tertiary);
}

.auth-card-shell {
  width: min(100%, 520px);
  align-items: stretch;
  text-align: left;
  gap: var(--sp-6);
  padding: var(--sp-8);
  background: var(--surface-panel);
  border-color: var(--component-mix-border-default-88pct-transparent);
  box-shadow: var(--shadow-sm);
}

.auth-card-shell__content {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}

.auth-hero {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.auth-card-shell .welcome-kicker,
.auth-card-shell .welcome-title,
.auth-card-shell .welcome-body {
  text-align: left;
}

.auth-card-desc {
  margin: 0;
  color: var(--text-secondary);
}

.auth-status-panel {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding-top: var(--sp-5);
  padding-bottom: 0;
  padding-inline: 0;
  border-top: 1px solid var(--component-mix-border-default-82pct-transparent);
  border-radius: 0;
  border-right: none;
  border-bottom: none;
  border-left: none;
  background: transparent;
}

.auth-status-panel-error {
  border-top-color: var(--component-mix-status-danger-fg-34pct-border-default);
  background: transparent;
}

.auth-status-eyebrow {
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.auth-status-detail {
  margin: 0;
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
  color: var(--text-secondary);
}

.auth-status-panel-error .auth-status-detail {
  color: var(--component-mix-status-danger-fg-84pct-text-primary);
}

.auth-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--component-mix-border-default-82pct-transparent);
  margin-top: 0;
}

.auth-input {
  width: 100%;
}

.auth-input.input {
  height: 44px;
  background: var(--surface-page);
}

.auth-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  padding-top: var(--sp-5);
  border-top: 1px solid var(--component-mix-border-default-82pct-transparent);
}

.auth-submit {
  width: 100%;
}

.auth-submit.btn {
  justify-content: center;
}

/* ========== Pulse Animation ========== */

/* ========== Pane Layout ========== */
.pane-layout {
  display: grid;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: transparent;
}

.pane-layout-horizontal {
  grid-template-rows: 1fr;
}

.pane-layout-vertical {
  grid-template-columns: 1fr;
}

.pane-layout-child {
  overflow: hidden;
  background: transparent;
}

.pane-layout-divider {
  background: var(--border-default);
  transition: background var(--duration-fast) var(--ease-out);
  flex-shrink: 0;
  position: relative;
  z-index: var(--z-inline-raised);
}

.pane-layout-divider:hover {
  background: var(--border-focus);
}

.pane-layout-horizontal-divider {
  cursor: col-resize;
  width: 10px;
  margin-left: -5px;
  margin-right: -5px;
  justify-self: center;
}

.pane-layout-vertical-divider {
  cursor: row-resize;
  width: 100%;
  height: 10px;
  margin-top: -5px;
  margin-bottom: -5px;
  align-self: center;
}

/* ========== Draft Launcher ========== */
.agent-draft-launcher {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: var(--surface-page);
}

.agent-draft-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  padding-inline: clamp(var(--sp-2), 4vw, var(--sp-5));
  box-sizing: border-box;
}

.agent-draft-workarea {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
}

.agent-draft-workarea-body {
  display: grid;
}

/* ========== Session Card ========== */
.session-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: var(--surface-panel);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* Progress bar */
.session-progress {
  height: var(--sp-1);
  background: var(--surface-hover);
}

.session-progress-bar {
  height: 100%;
  transition: width var(--duration-normal) var(--ease-out);
}

.session-progress-idle {
  background: var(--text-tertiary);
}

.session-progress-starting {
  background: var(--status-warning-fg);
}

.session-progress-running {
  background: var(--status-info-fg);
}

.session-progress-complete {
  background: var(--status-success-fg);
}

/* Session header */
.session-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-2) var(--sp-3);
  background: var(--surface-panel);
  border-bottom: 1px solid var(--border-default);
}

.session-header-left {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.session-dot {
  width: var(--status-dot-size);
  height: var(--status-dot-size);
  border-radius: 50%;
}

.session-dot-idle {
  background: var(--text-tertiary);
}

.session-dot-starting {
  background: var(--status-warning-fg);
  animation: pulse 1s ease-in-out infinite;
}

.session-dot-running {
  background: var(--status-info-fg);
}

.session-dot-complete {
  background: var(--status-success-fg);
}

.session-title {
  font-family: var(--font-mono);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
  color: var(--text-primary);
}

.session-provider-badge {
  padding: var(--sp-1) var(--sp-2);
  background: var(--surface-hover);
  border-radius: var(--radius-sm);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  color: var(--text-secondary);
}

.session-status-label {
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  color: var(--text-tertiary);
}

.session-header-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}

.session-header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-2);
  min-width: 0;
  flex-shrink: 0;
}

.session-header-accessory {
  display: flex;
  align-items: center;
  min-width: 0;
}

/* Session terminal */
.session-terminal {
  flex: 1;
  overflow: hidden;
  background: var(--surface-input);
}

/* ========== TopBar ========== */
.app-topbar {
  min-height: var(--desktop-topbar-height);
  display: flex;
  align-items: center;
  padding: 0 var(--sp-2);
  background: var(--topbar-surface);
  border-bottom: 1px solid var(--border-default);
  gap: var(--gap-compact);
  user-select: none;
  flex-shrink: 0;
  backdrop-filter: var(--material-backdrop-filter);
}

.topbar-tabs {
  display: flex;
  align-items: center;
  gap: var(--gap-compact);
  flex: 1;
  overflow: hidden;
}

.topbar-tab {
  display: flex;
  align-items: center;
  gap: var(--gap-tight);
  padding: var(--sp-1) var(--inset-control-inline);
  border-radius: 6px;
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  color: var(--text-sec);
  cursor: pointer;
  position: relative;
  white-space: nowrap;
  transition: background 0.06s;
}

.topbar-tab:hover {
  background: var(--surface-hover);
}
.topbar-tab.active {
  background: var(--surface-active);
  color: var(--text);
}

.topbar-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.topbar-dot.active {
  background: var(--status-success-fg);
  animation: pulse 2s infinite;
}

.topbar-dot.idle {
  background: var(--text-ter);
}

.topbar-unread {
  background: var(--status-info-fg);
  color: var(--bg);
  font-family: var(--font-sans);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.topbar-close {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  color: var(--text-ter);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.06s;
}

.topbar-tab:hover .topbar-close {
  opacity: 1;
}
.topbar-close:hover {
  background: var(--state-hover-bg-subtle);
  color: var(--text);
}

.topbar-add {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-sec);
  cursor: pointer;
  font-size: 16px;
  transition: background 0.06s;
  flex-shrink: 0;
}

.topbar-add:hover {
  background: var(--surface-hover);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--gap-control);
  flex-shrink: 0;
}

.topbar-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-sec);
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition:
    background 0.12s ease,
    border-color 0.12s ease,
    color 0.12s ease,
    box-shadow 0.12s ease,
    opacity 0.12s ease;
}

.topbar-btn:hover {
  background: var(--component-mix-surface-panel-72pct-status-info-fg-28pct);
}

/* ========== Connection Status ========== */
.connection-status {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.connection-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.connection-status-dot-connected {
  background: var(--status-success-fg);
}

.connection-status-dot-connecting {
  background: var(--status-warning-fg);
  animation: pulse 1s ease-in-out infinite;
}

.connection-status-dot-disconnected {
  background: var(--status-danger-fg);
}

.connection-status-label {
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  color: var(--text-tertiary);
}

/* ========== File Tree Panel ========== */
.file-tree-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.file-tree-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface-panel);
  border-bottom: 1px solid var(--border-default);
}

.file-tree-label {
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
}

.file-tree-branch-chip {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-1) var(--sp-2);
  background: var(--surface-hover);
  border-radius: var(--radius-sm);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.file-tree-toolbar {
  display: flex;
  padding: var(--sp-2) var(--sp-3);
  gap: var(--sp-1);
}

.file-tree-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-2);
}

.file-tree-empty {
  color: var(--text-tertiary);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
  padding: var(--sp-4);
}

.file-tree-node {
  display: flex;
  flex-direction: column;
}

.file-tree-node-row {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-1) var(--sp-2);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out);
}

.file-tree-node-row:hover {
  background: var(--surface-hover);
}

.file-tree-chevron {
  flex-shrink: 0;
  color: var(--text-tertiary);
}

.file-tree-icon {
  flex-shrink: 0;
  color: var(--text-tertiary);
}

.file-tree-name {
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--type-body-3-weight);
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-tree-children {
  display: flex;
  flex-direction: column;
}

/* ========== Git Panel ========== */
.git-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.git-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface-panel);
  border-bottom: 1px solid var(--border-default);
}

.git-label {
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
}

.git-branch-chip {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-1) var(--sp-2);
  background: var(--surface-hover);
  border-radius: var(--radius-sm);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.git-toolbar {
  display: flex;
  padding: var(--sp-2) var(--sp-3);
  gap: var(--sp-1);
}

.git-commit-input {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-3);
  background: var(--surface-panel);
  border-bottom: 1px solid var(--border-default);
}

.git-commit-input textarea {
  resize: none;
  min-height: 60px;
}

.git-changes {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-2);
}

.git-empty {
  color: var(--text-tertiary);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
  padding: var(--sp-4);
}

.git-change-group {
  margin-bottom: var(--sp-3);
}

.git-change-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-2);
  color: var(--text-secondary);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
}

.git-change-group-count {
  padding: var(--sp-1) var(--sp-2);
  background: var(--surface-hover);
  border-radius: var(--radius-sm);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  color: var(--text-tertiary);
}

.git-change-group-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.git-change-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out);
}

.git-change-row:hover {
  background: var(--surface-hover);
}

.git-change-path {
  flex: 1;
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
}

.git-change-status {
  padding: var(--sp-1) var(--sp-2);
  border-radius: var(--radius-sm);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
}

.git-status-staged {
  background: var(--component-rgba-108-182-255-0-2);
  color: var(--status-info-fg);
}

.git-status-unstaged {
  background: var(--component-rgba-241-184-106-0-2);
  color: var(--status-warning-fg);
}

.git-status-untracked {
  background: var(--component-rgba-120-215-178-0-2);
  color: var(--status-success-fg);
}

/* Workspace Tab status dot */
.workspace-tab-dot {
  width: var(--status-dot-size);
  height: var(--status-dot-size);
  border-radius: 50%;
}

.workspace-tab-dot-running {
  background: var(--status-success-fg);
}

.workspace-tab-dot-idle {
  background: var(--text-tertiary);
}

/* Workspace Tab unread badge */
.workspace-tab-badge {
  padding: var(--sp-1) var(--sp-2);
  background: var(--status-info-fg);
  border-radius: var(--radius-full);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  color: var(--text-inverse);
}

/* ========== Supervisor Strip (Phase 3) ==========
 * Integrated as a sub-header beneath .session-header (not a standalone card).
 * The class name stays .supervisor-card for e2e compatibility.
 *
 * Layout:
 *   [· Supervisor]  [STATE]            [edit] [pause] [trig] [off]
 *   [objective..................................] [provider-pill]
 *   [AUTO · latest result.....]
 *   [error banner, if any]
 */
.supervisor-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  background: var(--workspace-session-header-surface);
  backdrop-filter: var(--material-backdrop-filter);
  border-bottom: 1px solid var(--border-default);
}

/* Inactive strip — just an enable CTA in the sub-header slot */
.supervisor-card-inactive {
  gap: 0;
  padding: var(--sp-1) var(--sp-3);
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
}

.supervisor-enable-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-1);
  height: 22px;
  padding: 0 var(--sp-2);
  background: transparent;
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  font-family: var(--font-sans);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  letter-spacing: 0.02em;
  cursor: pointer;
  transition:
    border-color var(--duration-normal) var(--ease-out),
    color var(--duration-normal) var(--ease-out),
    background var(--duration-normal) var(--ease-out);
}

.supervisor-enable-btn > .themed-icon,
.supervisor-enable-btn > svg {
  display: inline-flex;
  flex-shrink: 0;
}

.supervisor-enable-btn > .themed-icon svg {
  display: block;
}

.supervisor-enable-btn > span {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.supervisor-enable-btn:hover {
  border-color: var(--state-success-border);
  color: var(--state-success-text);
  background: var(--state-success-bg);
}

/* Top meta row */
.supervisor-strip-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: 22px;
}

.supervisor-strip-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
}

.supervisor-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--state-success-text);
  box-shadow: 0 0 0 3px var(--component-mix-state-success-border-40pct-transparent);
}

.supervisor-pulse.supervisor-state-evaluating {
  background: var(--state-info-text);
  box-shadow: 0 0 0 3px var(--component-mix-state-info-border-40pct-transparent);
  animation: supervisor-pulse 1.4s var(--ease-in-out) infinite;
}

.supervisor-pulse.supervisor-state-injecting {
  background: var(--state-warning-text);
  box-shadow: 0 0 0 3px var(--component-mix-state-warning-border-40pct-transparent);
  animation: supervisor-pulse 1.1s var(--ease-in-out) infinite;
}

.supervisor-pulse.supervisor-state-paused {
  background: var(--text-tertiary);
  box-shadow: none;
}

.supervisor-pulse.supervisor-state-error {
  background: var(--state-error-text);
  box-shadow: 0 0 0 3px var(--component-mix-state-error-border-40pct-transparent);
}

.supervisor-pulse.supervisor-state-stopped {
  background: var(--text-tertiary);
  box-shadow: none;
}

.supervisor-pulse.supervisor-state-inactive {
  background: var(--text-disabled);
  box-shadow: none;
}

@keyframes supervisor-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.55;
    transform: scale(0.85);
  }
}

.supervisor-label {
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  color: var(--text-secondary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* State chip — 10px badge with state-tinted background */
.supervisor-state-tag {
  padding: var(--inset-chip-block) var(--inset-chip-inline);
  border-radius: var(--radius-control-sm);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.supervisor-state-tag.supervisor-state-idle {
  background: var(--state-success-bg);
  color: var(--state-success-text);
}

.supervisor-state-tag.supervisor-state-evaluating {
  background: var(--state-info-bg);
  color: var(--state-info-text);
}

.supervisor-state-tag.supervisor-state-injecting {
  background: var(--state-warning-bg);
  color: var(--state-warning-text);
}

.supervisor-state-tag.supervisor-state-paused {
  background: var(--state-disabled-bg);
  color: var(--state-disabled-text);
}

.supervisor-state-tag.supervisor-state-error {
  background: var(--state-error-bg);
  color: var(--state-error-text);
}

.supervisor-state-tag.supervisor-state-stopped {
  background: var(--state-disabled-bg);
  color: var(--state-disabled-text);
}

.supervisor-state-tag.supervisor-state-inactive {
  background: transparent;
  color: var(--text-tertiary);
}

.supervisor-status-cluster {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
}

.supervisor-cycle-count {
  display: inline-flex;
  align-items: center;
  padding: var(--inset-chip-block) var(--inset-chip-inline);
  border-radius: var(--radius-control-sm);
  background: var(--state-disabled-bg);
  color: var(--state-disabled-text);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Actions — icon-only mini buttons pushed to the row end */
.supervisor-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
  gap: var(--gap-compact);
}

.supervisor-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  cursor: pointer;
  transition:
    background var(--duration-normal) var(--ease-out),
    color var(--duration-normal) var(--ease-out),
    border-color var(--duration-normal) var(--ease-out);
}

.supervisor-icon-btn:hover:not(:disabled) {
  background: var(--surface-hover);
  color: var(--text-secondary);
}

.supervisor-icon-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.supervisor-icon-btn:focus-visible {
  outline: none;
  border-color: var(--border-focus);
}

.supervisor-icon-btn-danger:hover:not(:disabled) {
  background: var(--state-error-bg);
  color: var(--state-error-text);
}

/* Objective row — inline mono block, click-to-edit affordance */
.supervisor-objective-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-2);
  background: var(--surface-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  cursor: text;
  transition: border-color var(--duration-normal) var(--ease-out);
}

.supervisor-objective-row:hover {
  border-color: var(--border-subtle);
}

.supervisor-objective-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
  color: var(--text-secondary);
}

.supervisor-provider-pill {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: var(--inset-chip-block) var(--inset-chip-inline);
  border-radius: var(--radius-control-sm);
  background: var(--state-info-bg);
  color: var(--state-info-text);
  font-family: var(--font-mono);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
  letter-spacing: 0.04em;
  text-transform: lowercase;
}

.supervisor-details {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.supervisor-details-section {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.supervisor-details-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.supervisor-details-section-header > .btn {
  flex-shrink: 0;
}

.supervisor-details-edit-btn {
  min-height: 24px;
  padding: 0 var(--sp-2);
  border-color: transparent;
  border-radius: var(--radius-full);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  color: var(--text-tertiary);
}

.supervisor-details-edit-btn:hover:not(:disabled) {
  background: var(--component-mix-surface-hover-76pct-status-info-fg-24pct);
  color: var(--text-primary);
}

.supervisor-details-section-title {
  margin: 0;
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--type-body-3-weight);
  color: var(--text-primary);
}

.supervisor-details-toggle {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  width: 100%;
  min-width: 0;
  padding: 0;
  background: transparent;
  border: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.supervisor-details-toggle:focus-visible {
  outline: 1px solid var(--border-focus);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.supervisor-details-copy {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  min-width: 0;
  flex: 1;
}

.supervisor-details-label {
  flex-shrink: 0;
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.supervisor-details-summary {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
  color: var(--text-secondary);
}

.supervisor-details-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-tertiary);
  transition: transform var(--duration-normal) var(--ease-out);
}

.supervisor-details-chevron.expanded {
  transform: rotate(180deg);
}

.supervisor-details-toggle-text {
  flex-shrink: 0;
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.supervisor-details-panel {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.supervisor-details-surface {
  padding: var(--sp-3);
  border-radius: var(--radius-lg);
  background: var(--component-mix-surface-panel-90pct-surface-page-10pct);
}

.supervisor-summary-card {
  padding: var(--sp-3);
  border: none;
  border-radius: var(--radius-lg);
  background: var(--component-mix-surface-panel-90pct-surface-page-10pct);
  box-shadow: none;
}

.supervisor-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: var(--sp-3);
  margin: 0;
}

.supervisor-meta-grid--stacked {
  grid-template-columns: 1fr;
}

.supervisor-meta-item {
  min-width: 0;
  padding: 0;
  background: transparent;
}

.supervisor-meta-item--reasoning {
  background: var(--component-mix-surface-panel-88pct-surface-page-12pct);
}

.supervisor-meta-label {
  margin: 0;
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.supervisor-meta-value {
  margin: var(--sp-1) 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--type-body-3-weight);
  color: var(--text-secondary);
}

.supervisor-meta-value--strong {
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--type-body-3-weight);
  color: var(--text-primary);
}

.supervisor-meta-value--wrap {
  overflow: visible;
  text-overflow: unset;
  white-space: normal;
}

.supervisor-progress-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.supervisor-progress-list--checklist {
  position: relative;
  gap: var(--sp-1);
}

.supervisor-details-surface--progress {
  container-type: inline-size;
}

.supervisor-progress-item {
  display: flex;
  align-items: stretch;
  gap: var(--sp-2);
  padding: var(--sp-2);
  background: var(--component-mix-surface-page-44pct-surface-panel-56pct);
  border: 1px solid var(--component-mix-border-default-68pct-surface-page-32pct);
  border-radius: var(--radius-md);
}

.supervisor-progress-item--active {
  border-color: var(--component-mix-status-info-fg-42pct-border-default-58pct);
  background: var(--component-mix-status-info-fg-7pct-surface-panel-93pct);
  box-shadow: inset 0 0 0 1px var(--component-mix-status-info-fg-16pct-transparent);
}

.supervisor-progress-item__rail {
  position: relative;
  flex: 0 0 22px;
  align-self: stretch;
}

.supervisor-progress-item__rail::after {
  content: "";
  position: absolute;
  top: 18px;
  bottom: 4px;
  left: 10px;
  width: 1px;
  background: var(--component-mix-border-default-78pct-transparent);
}

.supervisor-progress-item:last-child .supervisor-progress-item__rail::after {
  display: none;
}

.supervisor-progress-item__marker {
  position: absolute;
  top: 6px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: var(--radius-pill);
  border: 2px solid var(--component-mix-border-default-70pct-surface-page-30pct);
  background: var(--component-mix-surface-page-74pct-surface-panel-26pct);
  box-shadow: 0 0 0 4px var(--component-mix-surface-page-82pct-transparent);
}

.supervisor-progress-item__marker--done {
  border-color: var(--component-mix-status-success-fg-60pct-border-default-40pct);
  background: var(--component-mix-status-success-fg-70pct-surface-panel-30pct);
}

.supervisor-progress-item__marker--in_progress {
  border-color: var(--component-mix-status-info-fg-62pct-border-default-38pct);
  background: var(--component-mix-status-info-fg-62pct-surface-panel-38pct);
}

.supervisor-progress-item__marker--pending {
  border-color: var(--component-mix-border-default-72pct-surface-page-28pct);
  background: var(--component-mix-surface-page-68pct-surface-panel-32pct);
}

.supervisor-progress-item__body {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  flex-direction: column;
  gap: var(--sp-1);
}

.supervisor-progress-item__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-2);
}

.supervisor-progress-item__title {
  margin: 0;
  min-width: 0;
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.supervisor-progress-item__meta-label {
  margin: 0;
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.supervisor-progress-item__meta-value {
  margin: 0;
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  color: var(--text-secondary);
}

@container (max-width: 30rem) {
  .supervisor-progress-item__header {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .supervisor-details-surface,
  .supervisor-summary-card {
    padding: var(--sp-2);
  }

  .supervisor-meta-grid {
    grid-template-columns: 1fr;
  }

  .supervisor-progress-item {
    padding: var(--sp-1) var(--sp-2);
  }

  .supervisor-progress-item__header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Latest-cycle banner */
.supervisor-history-list {
  display: flex;
  flex-direction: column;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Only the latest cycle is shown — treated as a single-line summary banner */
.supervisor-history-item {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  min-width: 0;
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
  color: var(--text-tertiary);
}

.supervisor-history-trigger {
  flex-shrink: 0;
  padding: 0 var(--sp-1);
  border-radius: var(--radius-sm);
  background: var(--surface-hover);
  color: var(--text-tertiary);
  font-weight: var(--font-medium);
  letter-spacing: 0.06em;
}

.supervisor-history-item[data-trigger="manual"] .supervisor-history-trigger {
  background: var(--component-mix-icon-file-data-16pct-surface-panel);
  color: var(--icon-file-data);
}

.supervisor-history-item[data-trigger="scheduled"] .supervisor-history-trigger {
  background: var(--state-info-bg);
  color: var(--state-info-text);
}

.supervisor-history-item[data-trigger="continue"] .supervisor-history-trigger,
.supervisor-history-item[data-trigger="done"] .supervisor-history-trigger {
  background: var(--state-success-bg);
  color: var(--state-success-text);
}

.supervisor-history-item[data-trigger="stop"] .supervisor-history-trigger,
.supervisor-history-item[data-trigger="pending"] .supervisor-history-trigger {
  background: var(--state-disabled-bg);
  color: var(--state-disabled-text);
}

.supervisor-history-item[data-trigger="error"] .supervisor-history-trigger {
  background: var(--state-error-bg);
  color: var(--state-error-text);
}

.supervisor-history-item[data-trigger="in_progress"] .supervisor-history-trigger {
  background: var(--state-warning-bg);
  color: var(--state-warning-text);
}

.supervisor-history-result {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.supervisor-error {
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--type-body-3-weight);
  color: var(--status-danger-fg);
  word-break: break-word;
}

/* ========== Objective Dialog (Phase 3) ==========
 * Reuses the generic .modal-card container style (defined below) plus
 * supervisor-specific refinements: mono textarea, terminal-backed preview,
 * intent-coloured header accent, and a disable-mode warning callout.
 */
.objective-preview {
  margin: 0;
  padding: var(--sp-3);
  background: var(--surface-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
  max-height: 160px;
}

.dialog-helper {
  margin: 0;
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
  color: var(--text-secondary);
}

.supervisor-dialog-header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-md);
  background: var(--icon-surface-success);
  color: var(--icon-success);
}

.supervisor-dialog--edit .supervisor-dialog-header-icon {
  background: var(--icon-surface-info);
  color: var(--icon-info);
}

.supervisor-dialog .modal-body {
  gap: var(--sp-3);
}

.supervisor-dialog .form-group {
  gap: var(--gap-tight);
}

.supervisor-dialog-intro {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3);
  border: 1px solid var(--component-mix-border-default-90pct-transparent);
  border-radius: var(--radius-md);
  background: var(--component-mix-surface-panel-88pct-surface-hover);
}

.supervisor-dialog-intro__icon {
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--icon-surface-success);
  color: var(--icon-success);
  flex-shrink: 0;
}

.supervisor-dialog--edit .supervisor-dialog-intro__icon {
  background: var(--icon-surface-info);
  color: var(--icon-info);
}

.supervisor-dialog-intro__copy {
  min-width: 0;
}

.supervisor-dialog-intro__title {
  display: block;
  margin: 0;
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--font-medium);
  color: var(--text-primary);
}

.supervisor-dialog-intro__description {
  margin: 2px 0 0;
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
  color: var(--text-secondary);
}

.supervisor-dialog .input,
.supervisor-dialog .mobile-select-trigger {
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
}

.supervisor-dialog .textarea {
  min-height: 104px;
  font-family: var(--font-mono);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
  color: var(--text-secondary);
}

.supervisor-dialog .input[type="select"],
.supervisor-dialog select.input {
  cursor: pointer;
}

.supervisor-objective-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
}

.supervisor-restore-entry {
  display: flex;
  flex-direction: column;
  gap: var(--gap-control);
  margin-top: calc(var(--sp-1) * -1);
}

.supervisor-restore-entry__hint,
.supervisor-restore-card__summary,
.supervisor-restore-card__footer {
  margin: 0;
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
  color: var(--text-secondary);
}

.supervisor-restore-link {
  appearance: none;
  border: none;
  padding: 0;
  background: transparent;
  color: var(--text-accent);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.supervisor-restore-link:hover {
  text-decoration: underline;
}

.supervisor-restore-view {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.supervisor-restore-actions {
  display: flex;
  align-items: center;
}

.supervisor-restore-loading {
  display: flex;
  justify-content: center;
  padding: var(--sp-4) 0;
}

.supervisor-restore-empty {
  min-height: 168px;
}

.supervisor-restore-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.supervisor-restore-card {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: var(--gap-tight);
  padding: var(--sp-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-panel);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
}

.supervisor-restore-card:hover {
  border-color: var(--component-mix-border-strong-72pct-border-default);
  background: var(--component-mix-surface-panel-92pct-surface-hover);
}

.supervisor-restore-card--selected {
  border-color: var(--icon-success);
  box-shadow: inset 0 0 0 1px var(--component-mix-icon-success-42pct-transparent);
}

.supervisor-restore-card__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-2);
}

.supervisor-restore-card__title {
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--font-medium);
}

.supervisor-restore-card__meta {
  flex-shrink: 0;
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
  color: var(--text-secondary);
}

/* ========== Workspace Launch Modal ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-backdrop);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal-backdrop);
}

.modal-content {
  background: var(--surface-panel);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  min-width: 400px;
  max-width: 520px;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border-default);
}

.modal-title {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--type-heading-4-size);
  line-height: var(--type-heading-4-line-height);
  font-weight: var(--type-heading-4-weight);
  color: var(--text-primary);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: var(--sp-1);
  border-radius: var(--radius-sm);
}

.modal-close:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}

.modal-body {
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-top: 1px solid var(--border-default);
}

.form-label {
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  color: var(--text-secondary);
}

.form-error {
  color: var(--status-danger-fg);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
}

/* Modal card — the generic container used by supervisor and worktree dialogs.
 * Mirrors .modal-content but with tighter max-width and a consistent shadow. */
.modal-card {
  display: flex;
  flex-direction: column;
  min-width: 400px;
  max-width: 480px;
  max-height: calc(100vh - var(--sp-16));
  background: var(--surface-panel);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-card .modal-body {
  overflow-y: auto;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.form-group label {
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  color: var(--text-secondary);
}

.mobile-select-trigger {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  text-align: left;
}

.mobile-select-trigger__value {
  min-width: 0;
  flex: 1;
}

.mobile-select-trigger__icon {
  flex-shrink: 0;
  color: var(--text-secondary);
}

.textarea {
  resize: vertical;
  min-height: 80px;
}

/* ========== Worktree Modal (Phase 3) ========== */
.modal-card-lg {
  max-width: 720px;
}

.worktree-header-info {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.worktree-chips {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.worktree-chip {
  padding: var(--sp-1) var(--sp-2);
  border-radius: var(--radius-sm);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  color: var(--text-secondary);
  background: var(--surface-hover);
}

.worktree-chip-branch {
  color: var(--status-info-fg);
}

.worktree-chip-path {
  font-family: var(--font-mono);
}

.worktree-chip-status.worktree-clean {
  color: var(--git-status-added-fg);
  background: var(--git-status-added-bg);
}

.worktree-chip-status.worktree-dirty {
  color: var(--git-status-modified-fg);
  background: var(--git-status-modified-bg);
}

.worktree-list-modal {
  min-width: 320px;
  max-width: 480px;
}

.worktree-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.worktree-list-row {
  margin: 0;
}

.worktree-list-row__button {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  width: 100%;
  padding: var(--sp-2) var(--sp-3);
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--type-body-3-weight);
  color: var(--text-primary);
  transition: background var(--duration-fast) var(--ease-out);
}

.worktree-list-row__button:hover {
  background: var(--surface-hover);
}

.worktree-list-row__name {
  flex: 1;
  font-weight: 500;
}

.worktree-list-row__branch {
  color: var(--status-info-fg);
  font-family: var(--font-mono);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
}

.worktree-summary-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
  padding: var(--sp-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--surface-panel);
}

.worktree-summary-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
}

.worktree-summary-card__copy {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.worktree-summary-card__copy p {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--type-body-3-weight);
}

.worktree-summary-card__actions,
.worktree-manager-surface__header-actions,
.worktree-manager__form-actions,
.worktree-manager__confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.worktree-summary-card__stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  color: var(--text-secondary);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
}

.worktree-empty {
  color: var(--text-tertiary);
  text-align: center;
  padding: var(--sp-4) 0;
}

.modal-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-default);
}

.modal-tab {
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.modal-tab:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}

.modal-tab.active {
  color: var(--text-primary);
  border-bottom: 2px solid var(--status-info-fg);
}

.worktree-content {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding: var(--sp-5);
  overflow-y: auto;
  min-height: 300px;
}

.worktree-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
}

.worktree-status-tab {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.worktree-info-row {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}

.worktree-info-label {
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  color: var(--text-tertiary);
  min-width: 80px;
}

.worktree-info-value {
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--type-body-3-weight);
  color: var(--text-primary);
}

.worktree-changes {
  padding: var(--sp-3);
  background: var(--bg);
  border-radius: var(--radius-md);
}

.worktree-change-group {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2);
}

.worktree-diff-tab {
  overflow: hidden;
}

.worktree-diff-output {
  font-family: var(--font-mono);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
  white-space: pre;
  overflow-x: auto;
  padding: var(--sp-3);
  background: var(--bg);
  border-radius: var(--radius-md);
}

.worktree-tree-tab {
  overflow: hidden;
}

.worktree-tree {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  padding: var(--sp-2);
}

.worktree-tree-node {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-2);
  border-radius: var(--radius-md);
}

.worktree-tree-node:hover {
  background: var(--surface-hover);
}

.worktree-tree-icon {
  font-size: var(--text-sm);
}

.worktree-tree-name {
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--type-body-3-weight);
  color: var(--text-primary);
}

.worktree-manager-surface {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.worktree-manager__list,
.worktree-manager__form,
.worktree-manager__confirm {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.worktree-manager__field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.worktree-manager__field-label {
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  color: var(--text-secondary);
}

.worktree-manager__field-hint,
.worktree-manager__confirm-path {
  color: var(--text-tertiary);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
}

.worktree-manager__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--sp-2);
  align-items: start;
}

.worktree-manager__row-main {
  display: grid;
  gap: var(--sp-2);
  width: 100%;
  padding: var(--sp-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out);
}

.worktree-manager__row-main:hover {
  background: var(--surface-hover);
}

.worktree-manager__row-name {
  font-weight: var(--font-semibold);
}

.worktree-manager__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.worktree-manager__row-path {
  font-family: var(--font-mono);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}

@media (max-width: 768px) {
  .worktree-summary-card__header {
    flex-direction: column;
  }

  .worktree-summary-card__actions {
    width: 100%;
  }

  .worktree-manager__row {
    grid-template-columns: 1fr;
  }
}

.worktree-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  padding: var(--sp-4);
}

/* ========== Shortcuts Settings (Phase 4) ========== */
.shortcuts-category-tabs {
  display: flex;
  gap: var(--sp-1);
  margin-bottom: var(--sp-4);
  padding: 0;
  border: none;
  background: transparent;
}

.shortcuts-category-tab {
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  color: var(--text-secondary);
  background: transparent;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.shortcuts-category-tab:hover {
  color: var(--text-primary);
}

.shortcuts-category-tab.active {
  color: var(--text-primary);
  background: var(--surface-active);
  border-color: var(--border-focus);
}

.shortcuts-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--border-default);
}

.shortcuts-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-default);
  border-radius: 0;
}

.shortcuts-item-custom {
  background: var(--component-mix-surface-active-78pct-status-warning-fg-22pct);
}

.shortcuts-info {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  min-width: 0;
  flex: 1;
}

.shortcuts-name {
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--type-body-3-weight);
  color: var(--text-primary);
}

.shortcuts-desc {
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
  color: var(--text-tertiary);
}

.shortcuts-binding {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-shrink: 0;
}

.shortcuts-key {
  padding: var(--sp-2) var(--sp-3);
  background: var(--component-mix-surface-input-82pct-surface-panel-18pct);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
  color: var(--text-primary);
  cursor: pointer;
  min-width: 80px;
  text-align: center;
}

.shortcuts-key:hover {
  border-color: var(--border-focus);
  background: var(--surface-active);
}

.shortcuts-capture {
  min-width: 120px;
  text-align: center;
  font-family: var(--font-mono);
}

.shortcuts-footer {
  display: flex;
  justify-content: flex-start;
  margin-top: var(--sp-4);
  padding: var(--sp-3) var(--sp-4) 0;
  border-top: 1px solid var(--border-default);
}

/* ========== Input with Button ========== */
.input-with-button {
  display: flex;
  gap: var(--sp-2);
}

.input-with-button .input {
  flex: 1;
}

.input-with-button .btn {
  flex-shrink: 0;
}

.launch-modal {
  width: min(var(--desktop-modal-max-width-lg), 90vw);
  max-width: min(var(--desktop-modal-max-width-lg), 90vw);
  max-height: 85vh;
  background: var(--surface-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.launch-header {
  display: flex;
  justify-content: space-between;
  padding: var(--sp-5) var(--sp-6);
  border-bottom: 1px solid var(--border-default);
}

.launch-header-left .launch-title {
  font-size: var(--type-heading-4-size);
  line-height: var(--type-heading-4-line-height);
  font-weight: var(--type-heading-4-weight);
  color: var(--text-primary);
}

.launch-header-left .launch-hint {
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--type-body-3-weight);
  color: var(--text-tertiary);
  margin-top: var(--sp-1);
}

.launch-header-right {
  text-align: right;
}

.launch-close-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  cursor: pointer;
  margin-top: var(--sp-2);
  margin-left: auto;
  transition: all var(--duration-fast) var(--ease-out);
}

.launch-close-btn:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.launch-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-5) var(--sp-6);
}

.launch-recent {
  margin-bottom: var(--sp-4);
}

.launch-section-title {
  margin-bottom: var(--sp-2);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
}

.launch-recent-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.launch-recent-row {
  display: flex;
  width: 100%;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-1);
  padding: var(--sp-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-panel);
  text-align: left;
  cursor: pointer;
  transition:
    background var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out),
    opacity var(--duration-fast) var(--ease-out);
}

.launch-recent-row:hover {
  background: var(--surface-hover);
  border-color: var(--state-info-border);
}

.launch-recent-row:focus-visible {
  outline: none;
  box-shadow: 0 0 0 var(--state-focus-ring-width) var(--state-focus-ring-color);
}

.launch-recent-row:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.launch-recent-row__name {
  min-width: 0;
  flex: 1 1 auto;
  font-size: var(--type-body-4-size);
  line-height: var(--type-body-4-line-height);
  font-weight: var(--font-medium);
  color: var(--text-primary);
}

.launch-recent-row__header {
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-2);
}

.launch-recent-row__time {
  flex: 0 0 auto;
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  color: var(--text-secondary);
  white-space: nowrap;
}

.launch-recent-row__path {
  min-width: 0;
  font-family: var(--font-mono);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  color: var(--text-tertiary);
  word-break: break-all;
}

.launch-intro {
  margin-bottom: var(--sp-4);
}

.folder-picker {
  background: var(--bg);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--sp-3);
}

.fp-toolbar {
  display: flex;
  gap: var(--sp-1);
  margin-bottom: var(--sp-2);
}

.fp-btn {
  padding: var(--sp-1) var(--sp-2);
  border-radius: var(--radius-sm);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  color: var(--text-secondary);
  background: var(--surface-panel);
  border: 1px solid var(--border-default);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  transition: all var(--duration-fast) var(--ease-out);
}

.fp-btn:hover {
  background: var(--surface-hover);
}

.fp-root-chips {
  display: flex;
  gap: var(--sp-1);
  margin-bottom: var(--sp-2);
  flex-wrap: wrap;
}

.fp-create-folder {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
}

.fp-create-folder .form-error {
  grid-column: 1 / -1;
  margin-top: 0;
}

.fp-create-folder__input {
  min-width: 0;
}

.fp-create-folder__action,
.fp-create-folder__cancel {
  min-height: 36px;
  padding: 0 var(--sp-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
  font-family: var(--font-sans);
  cursor: pointer;
  transition:
    background var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    opacity var(--duration-fast) var(--ease-out);
}

.fp-create-folder__action {
  background: var(--state-info-bg);
  border-color: var(--state-info-border);
  color: var(--state-info-text);
}

.fp-create-folder__action:hover {
  background: var(--component-mix-state-info-bg-78pct-surface-panel-22pct);
  color: var(--text-primary);
}

.fp-create-folder__cancel {
  background: var(--surface-panel);
  color: var(--text-secondary);
}

.fp-create-folder__cancel:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.fp-create-folder__action:disabled,
.fp-create-folder__cancel:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.fp-chip {
  padding: var(--sp-1) var(--sp-2);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
  color: var(--text-secondary);
  background: var(--surface-panel);
  border: 1px solid var(--border-default);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.fp-chip:hover {
  background: var(--surface-hover);
}

.fp-chip.active {
  background: var(--surface-active);
  border-color: var(--status-info-fg);
  color: var(--text-primary);
}

.fp-dir-list {
  max-height: 180px;
  overflow-y: auto;
}

.fp-dir {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out);
}

.fp-dir:hover {
  background: var(--component-mix-state-selected-bg-72pct-transparent);
}

.fp-dir.selected {
  background: var(--state-selected-bg);
}

.fp-dir-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-lg);
}

.fp-dir-name {
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--type-body-3-weight);
  color: var(--text-primary);
}

.fp-dir-name.selected {
  font-weight: var(--font-medium);
}

.fp-dir-hint {
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
  color: var(--text-tertiary);
}

.fp-dir-action {
  margin-left: auto;
  height: 22px;
  padding: 0 var(--inset-chip-inline);
  border: 1px solid var(--state-info-border);
  border-radius: var(--radius-pill);
  background: var(--state-info-bg);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  font-family: var(--font-sans);
  color: var(--state-info-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    background var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out);
}

.fp-dir-action:hover {
  background: var(--component-mix-state-info-bg-78pct-surface-panel-22pct);
  border-color: var(--state-info-border);
  color: var(--text-primary);
}

.fp-dir-action:focus-visible {
  outline: none;
  box-shadow: 0 0 0 var(--state-focus-ring-width)
    var(--component-mix-state-focus-ring-color-24pct-transparent);
}

.launch-footer {
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--border-default);
  display: flex;
  justify-content: flex-end;
}

.launch-start-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--gap-default);
  min-height: 44px;
  padding: var(--sp-2) var(--sp-5);
  background: linear-gradient(
    180deg,
    var(--component-mix-status-info-fg-78pct-white-22pct) 0%,
    var(--component-mix-status-info-fg-92pct-black-8pct) 100%
  );
  color: var(--text-inverse);
  border: none;
  border-radius: var(--radius-control-lg);
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--font-medium);
  letter-spacing: 0.01em;
  font-family: var(--font-sans);
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition:
    transform var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out),
    filter var(--duration-fast) var(--ease-out),
    opacity var(--duration-fast) var(--ease-out);
}

.launch-start-btn:focus-visible {
  outline: var(--state-focus-ring-width) solid var(--state-focus-ring-color);
  outline-offset: 2px;
}

.launch-start-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
  box-shadow: var(--shadow-lg);
}

.launch-start-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  filter: saturate(0.8);
}

.launch-start-btn--desktop {
  min-width: 160px;
  padding-inline: var(--sp-6);
}

.launch-start-btn--mobile {
  min-height: 52px;
  border-radius: var(--radius-xl);
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--font-medium);
  box-shadow: var(--shadow-lg);
}

/* Legacy modal styles kept for compatibility */
.workspace-launch-modal--browser {
  width: 480px;
  max-width: 90vw;
}

.directory-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  background: var(--bg);
  border-radius: var(--radius-sm);
  margin-bottom: var(--sp-3);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
}

.breadcrumb-path {
  font-family: var(--font-mono);
  word-break: break-all;
}

.directory-list {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg);
}

.directory-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-8);
  color: var(--text-tertiary);
  gap: var(--sp-2);
}

.directory-empty {
  padding: var(--sp-6);
  text-align: center;
  color: var(--text-tertiary);
}

.directory-item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out);
  border-bottom: 1px solid var(--border-default);
}

.directory-item:last-child {
  border-bottom: none;
}

.directory-item:hover {
  background: var(--surface-hover);
}

.directory-item--parent {
  color: var(--text-tertiary);
}

.directory-item--selected {
  background: var(--selection-accent-bg);
  color: var(--accent);
}

.directory-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.directory-navigate {
  color: var(--text-tertiary);
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease-out);
}

.directory-item:hover .directory-navigate {
  opacity: 1;
}

.directory-navigate:hover {
  color: var(--text-primary);
}

.selected-path {
  margin-top: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  background: var(--selection-accent-bg);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
}

.selected-path-label {
  color: var(--text-tertiary);
  margin-right: var(--sp-2);
}

.selected-path-value {
  font-family: var(--font-mono);
  color: var(--accent);
  word-break: break-all;
}

/* ========== Workspace Polish Overrides ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  height: var(--btn-height-md);
  padding: 0 var(--sp-4);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: var(--type-body-3-size);
  font-weight: var(--font-medium);
  line-height: var(--type-body-3-line-height);
  white-space: nowrap;
  transition:
    background var(--duration-normal) var(--ease-out),
    border-color var(--duration-normal) var(--ease-out),
    color var(--duration-normal) var(--ease-out),
    box-shadow var(--duration-normal) var(--ease-out),
    transform var(--duration-fast) var(--ease-out);
}

.btn:focus-visible {
  box-shadow:
    0 0 0 2px var(--surface-page),
    0 0 0 calc(var(--state-focus-ring-width) * 2)
    var(--component-mix-state-focus-ring-color-35pct-transparent);
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--status-info-fg);
  color: var(--text-inverse);
}

.btn-primary:hover:not(:disabled) {
  background: var(--component-mix-status-info-fg-84pct-white-16pct);
}

.btn-default,
.btn-secondary {
  background: var(--component-mix-surface-panel-84pct-status-info-fg-16pct);
  border-color: var(--component-mix-border-default-70pct-status-info-fg-30pct);
  color: var(--text-primary);
}

.btn-default:hover:not(:disabled),
.btn-secondary:hover:not(:disabled) {
  background: var(--component-mix-surface-hover-72pct-status-info-fg-28pct);
  border-color: var(--component-mix-border-subtle-70pct-status-info-fg-30pct);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.btn-danger {
  background: var(--status-danger-fg);
  color: var(--text-inverse);
}

.btn-sm {
  height: 24px;
  padding: 0 var(--sp-2);
  border-radius: var(--radius-sm);
  font-size: var(--type-body-6-size);
  font-weight: var(--font-medium);
  line-height: var(--type-body-6-line-height);
}

.btn-lg {
  height: 40px;
  padding: 0 var(--sp-6);
  border-radius: var(--radius-lg);
}

.input {
  height: var(--input-height-md);
  padding: 0 var(--sp-3);
  background: var(--surface-page);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--type-body-3-size);
  font-weight: var(--type-body-3-weight);
  line-height: var(--type-body-3-line-height);
  outline: none;
  transition:
    border-color var(--duration-normal) var(--ease-out),
    box-shadow var(--duration-normal) var(--ease-out),
    background var(--duration-normal) var(--ease-out);
}

.input:hover {
  border-color: var(--border-subtle);
}

.input:focus {
  border-color: var(--status-info-fg);
  box-shadow: 0 0 0 var(--state-focus-ring-width)
    var(--component-mix-state-focus-ring-color-40pct-transparent);
}

textarea.input {
  height: auto;
  min-height: 88px;
  padding: var(--sp-3);
  resize: vertical;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  height: 20px;
  padding: 0 var(--sp-2);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.badge-blue {
  background: var(--component-mix-status-info-fg-15pct-transparent);
  color: var(--status-info-fg);
}

.badge-green {
  background: var(--component-mix-status-success-fg-15pct-transparent);
  color: var(--status-success-fg);
}

.badge-amber {
  background: var(--component-mix-status-warning-fg-15pct-transparent);
  color: var(--status-warning-fg);
}

.badge-pink {
  background: var(--component-mix-status-danger-fg-15pct-transparent);
  color: var(--status-danger-fg);
}

.badge-gray {
  background: var(--component-mix-text-tertiary-15pct-transparent);
  color: var(--text-tertiary);
}

.app-topbar {
  height: 36px;
  padding: 0 var(--sp-2);
  background: var(--component-mix-surface-panel-95pct-status-info-fg-5pct);
  border-bottom: 1px solid var(--border-default);
  box-shadow: none;
  gap: var(--gap-compact);
}

.topbar-tabs {
  gap: var(--gap-compact);
}

.topbar-empty-state {
  display: flex;
  align-items: center;
  height: 100%;
}

.topbar-hint {
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
  color: var(--text-tertiary);
}

.topbar-tab {
  min-width: 0;
  height: 28px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-tertiary);
  background: transparent;
}

.topbar-tab:hover {
  background: var(--surface-hover);
  color: var(--text-secondary);
}

.topbar-tab.active {
  background: var(--surface-active);
  border-color: transparent;
  color: var(--text-primary);
  box-shadow: none;
}

.topbar-tab-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-dot {
  width: 7px;
  height: 7px;
}

.topbar-close {
  opacity: 0;
}

.topbar-tab.active .topbar-close,
.topbar-tab:hover .topbar-close {
  opacity: 1;
}

.topbar-close:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.topbar-add,
.topbar-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-md);
}

.topbar-add:hover,
.topbar-btn:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.topbar-actions {
  gap: var(--sp-1);
}

.topbar-quick-actions {
  width: auto;
  padding: 0 var(--inset-control-block);
  gap: var(--gap-tight);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  color: var(--text-secondary);
}

.topbar-btn-label {
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  white-space: nowrap;
}

.connection-status {
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: var(--surface-panel);
}

.connection-status-text {
  display: none;
}

.workspace-page {
  background:
    radial-gradient(circle at top center, var(--component-rgba-108-182-255-0-06), transparent 32%),
    var(--workspace-page-surface);
}

.workspace-body {
  background: transparent;
}

.left-panel {
  display: flex;
  flex-direction: column;
  width: 264px;
  min-width: 220px;
  background: var(--surface-muted);
  border-right: 1px solid var(--border-default);
}

.nav-panel {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-header {
  padding: var(--sp-3) var(--inset-control-inline) var(--inset-control-block);
  border-bottom: 1px solid var(--border-default);
  background: transparent;
  gap: var(--gap-default);
}

.panel-kicker {
  margin-bottom: var(--gap-default);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  letter-spacing: 0.08em;
}

.panel-branch {
  display: inline-flex;
  flex-shrink: 0;
  height: 22px;
  padding: 0 var(--sp-2);
  border: none;
  background: var(--surface-hover);
  color: var(--text-secondary);
  margin-bottom: var(--gap-default);
}

.panel-branch-button {
  align-items: center;
  gap: var(--gap-control);
  cursor: pointer;
  transition:
    background var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
}

.panel-branch-button:hover {
  background: var(--component-mix-surface-hover-72pct-status-info-fg-28pct);
  color: var(--text-primary);
}

.panel-branch-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--component-mix-status-info-fg-40pct-transparent);
}

.panel-tabs {
  display: flex;
  gap: var(--gap-control);
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  width: auto;
}

.panel-tab {
  height: 24px;
  padding: 0 var(--inset-control-block);
  border: none;
  border-radius: var(--radius-control-sm);
  font-size: var(--type-body-6-size);
  font-weight: var(--type-body-6-weight);
  line-height: var(--type-body-6-line-height);
  color: var(--text-tertiary);
  background: transparent;
}

.panel-tab:hover {
  color: var(--text-secondary);
  background: var(--surface-hover);
}

.panel-tab.active {
  background: var(--status-info-fg);
  color: var(--text-inverse);
  font-weight: var(--type-body-6-weight);
}

.panel-toolbar {
  justify-content: flex-start;
  padding: var(--gap-tight) var(--inset-control-inline);
  border-bottom: 1px solid var(--border-default);
  background: transparent;
}

.panel-toolbar-meta {
  display: none;
}

.panel-toolbar-label {
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
}

.panel-toolbar-btn:hover {
  background: var(--component-mix-surface-hover-72pct-status-info-fg-28pct);
  color: var(--text-primary);
}

.split-divider-v,
.split-divider-h {
  background: linear-gradient(180deg, transparent, var(--state-info-bg), transparent);
}

.split-divider-v:hover,
.split-divider-h:hover {
  background: var(--component-mix-border-focus-44pct-transparent-56pct);
}

.file-tree {
  padding: 4px 0 6px;
}

.tree-item {
  min-height: 24px;
  padding-right: var(--inset-control-inline);
  gap: var(--gap-tight);
  border-radius: 0;
}

.tree-item:hover {
  background: var(--component-mix-state-selected-bg-80pct-transparent);
}

.tree-item.selected {
  background: var(--state-selected-bg);
  box-shadow: inset var(--state-focus-ring-width) 0 0 var(--state-selected-border);
  color: var(--text-primary);
}

.tree-chevron {
  width: 14px;
  height: 14px;
  color: var(--text-tertiary);
}

.tree-icon {
  width: 14px;
  height: 14px;
  color: var(--text-tertiary);
}

.tree-icon.folder {
  color: var(--icon-file-folder);
}

.tree-icon.code {
  color: var(--icon-file-code);
}

.tree-icon.data {
  color: var(--icon-file-data);
}

.tree-icon.doc {
  color: var(--icon-file-doc);
}

.tree-icon.media {
  color: var(--icon-file-media);
}

.tree-icon.file {
  color: var(--icon-file-default);
}

.tree-label {
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--type-body-3-weight);
}

.tree-children {
  padding-left: 0;
}

.agent-panes {
  background: transparent;
}

.agent-draft-launcher {
  container-type: inline-size;
  background:
    radial-gradient(circle at center, var(--component-rgba-108-182-255-0-08), transparent 30%),
    transparent;
}

.agent-draft-content {
  width: 100%;
  max-width: 100%;
  align-items: center;
  justify-content: center;
  padding-inline: clamp(var(--sp-2), 4vw, var(--sp-5));
  box-sizing: border-box;
}

/* ── Component layout ─────────────────────────────── */
.agent-draft-workarea {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  width: min(100%, 41rem);
  max-width: 100%;
  box-sizing: border-box;
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface-panel) 84%, transparent);
}

.agent-draft-workarea-copy {
  padding-bottom: var(--sp-1);
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-tertiary);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  text-align: center;
}

.agent-draft-component-row {
  min-width: 0;
}

.agent-draft-workarea-body {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: var(--sp-2);
  align-items: stretch;
}

.agent-draft-workarea-main,
.agent-draft-workarea-side {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.agent-draft-workarea-side {
  padding-left: var(--sp-2);
  border-left: 1px solid var(--border-subtle);
  padding-block: 0;
}

.agent-draft-workarea-side .agent-draft-panel-header,
.agent-draft-workarea-side .agent-draft-drop-zone {
  padding-inline: var(--sp-1);
}

.agent-draft-workarea-side .agent-draft-drop-zone {
  flex: 1 1 auto;
  border-style: solid;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface-panel) 88%, transparent);
}

.agent-draft-panel-header {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
}

.agent-draft-panel-icon {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  background: var(--icon-surface-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.agent-draft-panel-label {
  flex: 1 1 auto;
  font-family: var(--font-mono);
  font-size: var(--type-body-5-size);
  font-weight: var(--type-body-5-weight);
  line-height: var(--type-body-5-line-height);
  color: var(--text-primary);
  white-space: normal;
}

/* ── Agent button list ────────────────────────────── */
.agent-draft-panel-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  width: 100%;
  box-sizing: border-box;
}

.agent-provider-card {
  height: auto;
  min-width: 0;
  align-items: center;
  justify-content: flex-start;
  gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-2);
  border-radius: var(--radius-sm);
  text-align: left;
  white-space: normal;
}

.agent-draft-launcher .agent-provider-card[disabled] {
  opacity: 0.72;
  cursor: not-allowed;
}

.agent-draft-launcher .agent-provider-card {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  justify-content: flex-start;
  padding: var(--sp-1) var(--sp-2);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface-panel) 88%, transparent);
  border-color: var(--border-subtle);
  box-shadow: none;
}

.agent-draft-launcher .agent-provider-card > span:last-child {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
}

.agent-draft-launcher .agent-provider-card:hover {
  background: color-mix(in srgb, var(--surface-elevated) 82%, transparent);
  border-color: var(--border-default);
  transform: none;
}

.agent-provider-card-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--icon-surface-subtle);
  color: var(--text-primary);
  flex-shrink: 0;
}

.agent-provider-card-monogram {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  min-height: 1.75rem;
  font-family: var(--font-mono);
  font-size: var(--type-body-6-size);
  line-height: 1;
  font-weight: var(--type-heading-5-weight);
}

.agent-provider-card-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: var(--sp-2);
  row-gap: var(--sp-1);
  width: 100%;
  min-width: 0;
}

.agent-provider-card-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--gap-compact);
}

.agent-provider-card-meta {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  justify-self: end;
  gap: var(--sp-1);
  min-width: 0;
  margin-left: auto;
  text-align: right;
  white-space: nowrap;
}

.agent-provider-card-title-row {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  min-width: 0;
}

.agent-provider-card-title {
  font-family: var(--font-mono);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-heading-5-weight);
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-provider-card-cta {
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  color: var(--text-primary);
  white-space: nowrap;
}

.agent-provider-card-capabilities {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
}

.agent-provider-card-capability {
  padding: 0.15rem 0.45rem;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-pill);
  color: var(--text-tertiary);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
}

.agent-provider-card-capability--supported {
  border-color: var(--state-success-border);
  background: var(--state-success-bg);
  color: var(--status-success-fg);
}

.agent-provider-card-status {
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  color: var(--text-tertiary);
  white-space: nowrap;
}

.agent-provider-card-guide {
  grid-column: 1 / -1;
  margin-top: var(--sp-1);
  padding-top: var(--sp-1);
  border-top: 1px solid var(--border-default);
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  color: var(--text-secondary);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
}

.agent-provider-card-guide a {
  color: var(--status-info-fg);
  text-decoration: none;
}

.agent-provider-card-guide a:hover {
  color: var(--component-mix-status-info-fg-white-20pct);
  text-decoration: underline;
}

/* ── Drop zone ────────────────────────────────────── */
.agent-draft-drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-1);
  width: 100%;
  min-width: 0;
  min-height: 72px;
  box-sizing: border-box;
  padding: var(--sp-2) var(--sp-1);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at center, var(--component-rgba-108-182-255-0-04), transparent 60%),
    transparent;
  transition: border-color 0.15s ease;
}

.agent-draft-drop-zone-icon {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-md);
  background: var(--icon-surface-subtle);
  border: 1px solid var(--border-default);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.agent-draft-drop-zone-title {
  font-size: var(--type-body-5-size);
  font-weight: var(--type-body-5-weight);
  color: var(--text-primary);
  line-height: 1.2;
}

/* ── Footer ───────────────────────────────────────── */
@container (max-width: 28rem) {
  .agent-draft-launcher .agent-draft-workarea {
    width: min(100%, 24rem);
  }

  .agent-draft-component-row {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--sp-2);
  }

  .agent-provider-card-meta {
    justify-content: flex-end;
  }

  .agent-draft-workarea-side {
    padding-left: 0;
    border-left: none;
    padding-top: var(--sp-2);
    border-top: 1px solid var(--border-subtle);
  }
}

.session-card {
  background: var(--surface-page);
  backdrop-filter: none;
  border: 1px solid var(--border-default);
  border-radius: 0;
}

.session-progress {
  height: 4px;
  background: var(--state-info-bg);
}

.session-progress-bar {
  height: 100%;
  transition: width var(--duration-slower) var(--ease-out);
}

.session-header {
  padding: var(--gap-tight) var(--inset-control-inline);
  border-bottom: 1px solid var(--border-default);
  background: var(--surface-page);
}

.session-header-left {
  min-width: 0;
  gap: var(--sp-3);
}

.session-header-copy {
  min-width: 0;
}

.session-title-row {
  display: flex;
  align-items: center;
  gap: var(--session-row-gap);
  min-width: 0;
  flex-wrap: nowrap;
}

.session-title {
  font-family: var(--font-mono);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 auto;
}

.session-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-top: 4px;
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
  color: var(--text-tertiary);
}

.session-meta span {
  position: relative;
}

.session-meta span + span::before {
  content: "";
  position: absolute;
  left: calc(var(--sp-2) * -1);
  top: 50%;
  width: 3px;
  height: 3px;
  border-radius: var(--radius-chip);
  background: currentColor;
  transform: translateY(-50%);
  opacity: 0.7;
}

.session-header-actions {
  gap: var(--gap-control);
}

.session-action-btn {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  transition:
    background var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out);
}

.session-action-btn:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.session-action-btn-close:hover {
  color: var(--status-danger-fg);
}

.session-terminal {
  background: var(--surface-input);
}

.bottom-terminal {
  background: var(--surface-input);
  border-top: 1px solid var(--border-default);
}

.bottom-terminal-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.terminal-toolbar {
  padding: 3px 10px;
  gap: 6px;
  border-bottom: 1px solid var(--border-default);
  background: var(--surface-panel);
}

.terminal-toolbar-left,
.terminal-toolbar-right {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.terminal-toolbar-left {
  min-width: 0;
  flex: 1;
}

.terminal-toolbar-right {
  min-width: 0;
  flex: 1;
  margin-left: auto;
  justify-content: flex-end;
}

.terminal-toolbar-left::before {
  content: none;
}

.terminal-kicker {
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
}

.terminal-title {
  font-size: 12px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.terminal-selector-btn {
  height: 24px;
  padding: 0 6px;
  border: 1px solid var(--border-default);
  border-radius: 4px;
  background: var(--surface-page);
  font-size: 11px;
  color: var(--text-secondary);
}

.bottom-terminal-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 8px;
  background: var(--component-rgba-255-255-255-0-02);
  border-top: 1px solid var(--component-rgba-255-255-255-0-02);
  border-bottom: 1px solid var(--border-default);
  overflow-x: auto;
}

.terminal-tab {
  height: 28px;
  min-width: 0;
  padding: 0 8px;
  border-bottom: 2px solid transparent;
  background: transparent;
  border-radius: 0;
}

.terminal-tab-active {
  border-bottom-color: var(--status-info-fg);
  background: var(--component-rgba-108-182-255-0-05);
}

.terminal-tab-label {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.terminal-tab-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terminal-tab-close:hover {
  background: var(--surface-hover);
  border-radius: var(--radius-sm);
}

.bottom-terminal-xterm {
  flex: 1;
  min-height: 0;
  background: var(--surface-input);
}

.bottom-terminal-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  padding: var(--sp-8) var(--sp-6);
  text-align: center;
  border: none;
  border-radius: 0;
  margin: 0;
  background: transparent;
}

.bottom-terminal-empty-icon {
  width: 32px;
  height: 32px;
  opacity: 0.45;
}

.bottom-terminal-empty-text {
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  color: var(--text-primary);
}

.bottom-terminal-empty-hint {
  max-width: 480px;
  color: var(--text-secondary);
  line-height: 1.6;
}

@media (max-width: 900px) {
  .panel-caption,
  .session-meta {
    display: none;
  }
}

.git-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.git-panel-toolbar {
  justify-content: flex-start;
}

.git-toolbar-cluster {
  display: flex;
  gap: 4px;
}

.git-panel-commit-btn {
  color: var(--status-info-fg);
}

.git-commit-input {
  margin: 8px 12px 10px;
  padding: 7px 10px;
  min-height: 32px;
  background: var(--component-rgba-10-16-20-0-88);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  resize: none;
  font: inherit;
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--type-body-3-weight);
  outline: none;
}

.git-commit-input:focus {
  border-color: var(--status-info-fg);
}

.git-head-summary {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0 12px 10px;
  padding: 8px 10px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--component-mix-surface-hover-72pct-transparent);
}

.git-head-summary__label {
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  color: var(--text-tertiary);
}

.git-head-summary__value {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
  color: var(--text-secondary);
}

.git-head-summary__value code {
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.git-head-summary__value span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.git-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-bottom: 8px;
}

.git-group {
  border-top: 1px solid var(--border-default);
}

.git-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px 6px;
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  color: var(--text-tertiary);
}

.git-group-count {
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--component-rgba-255-255-255-0-04);
}

.git-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 4px 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out);
}

.git-row:hover,
.git-row.active {
  background: var(--component-rgba-108-182-255-0-08);
}

.commit-file-list-preview__row {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
}

.git-row-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.git-row-icon-staged {
  color: var(--icon-git-staged);
}

.git-row-icon-modified {
  color: var(--icon-git-modified);
}

.git-row-icon-deleted {
  color: var(--icon-git-deleted);
}

.git-row-icon-untracked {
  color: var(--icon-git-untracked);
}

.git-row-name {
  display: block;
  min-width: 0;
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--type-body-3-weight);
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.git-row-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.git-row-meta {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.git-row-dir {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
  color: var(--text-tertiary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.git-row-status {
  flex-shrink: 0;
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  letter-spacing: 0.01em;
}

.git-row-status-end {
  margin-left: auto;
  text-align: right;
}

.git-row-status-staged {
  color: var(--status-success-fg);
}

.git-row-status-modified {
  color: var(--status-warning-fg);
}

.git-row-status-deleted {
  color: var(--status-danger-fg);
}

.git-row-status-untracked {
  color: var(--status-info-fg);
}

.git-row-actions {
  margin-left: 8px;
  display: flex;
  gap: 2px;
}

.git-row-action {
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 3px;
  background: transparent;
  color: var(--text-tertiary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.git-row-action:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.git-empty {
  padding: 20px 16px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
}

.workspace-git-view {
  flex: 1;
  min-height: 0;
  padding: var(--editor-pane-inset);
  background:
    radial-gradient(circle at top center, var(--component-rgba-108-182-255-0-05), transparent 26%),
    linear-gradient(180deg, var(--component-rgba-255-255-255-0-015), transparent 18%),
    var(--surface-page);
}

.workspace-git-editor {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: var(--component-mix-surface-input-92pct-surface-page-8pct);
  border: 1px solid var(--component-mix-border-subtle-68pct-status-info-fg-32pct);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.code-editor {
  min-width: 0;
}

.code-editor-header {
  display: flex;
  align-items: center;
  gap: var(--gap-default);
  padding: var(--gap-default) var(--editor-toolbar-inset);
  border-bottom: 1px solid var(--border-default);
  background: var(--workspace-editor-toolbar-surface);
}

/* File editor shares Git Diff's container/header/body chrome; only the
 * inline save-error ribbon and the Monaco pane need dedicated styling so
 * they sit naturally inside .workspace-git-editor. */
.code-file-path .dirty-indicator {
  display: inline-block;
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  margin-left: 6px;
  border-radius: 999px;
  background: var(--editor-dirty-indicator-fg);
  box-shadow: 0 0 0 2px var(--component-mix-status-warning-fg-15pct-transparent);
}

.editor-pane-card__dirty-indicator {
  display: inline-block;
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  border-radius: 999px;
  background: var(--editor-dirty-indicator-fg);
  box-shadow: 0 0 0 2px var(--component-mix-status-warning-fg-15pct-transparent);
}

.code-mode-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.code-mode-btn svg {
  display: inline-block;
  vertical-align: -2px;
  margin-right: 0;
}

.code-mode-btn svg:last-child {
  margin-right: 0;
}

.code-editor-error {
  display: flex;
  align-items: center;
  gap: var(--gap-tight);
  padding: var(--gap-tight) var(--inset-control-inline);
  background: var(--editor-diagnostic-error-bg);
  color: var(--state-error-text);
  font-size: 11px;
  border-bottom: 1px solid var(--state-error-border);
}

/* Monaco and ImagePreview each handle their own scrolling; override the
 * body overflow in those cases so we don't get a double scrollbar. */
.workspace-git-editor .code-editor-body:has(> .monaco-host),
.workspace-git-editor .code-editor-body:has(> .image-preview),
.workspace-git-editor .code-editor-body:has(> .document-preview) {
  overflow: hidden;
}

.monaco-host {
  height: 100%;
  width: 100%;
}

/* Image preview lives inside .code-editor-body, so it gets the same scroll
 * container as diff lines. We center the image and show a small metadata
 * strip at the bottom. A checker pattern helps PNGs with transparency. */
.image-preview {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.image-preview-canvas {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-6);
  overflow: auto;
  overscroll-behavior: contain;
  background-color: var(--component-mix-surface-input-90pct-surface-page-10pct);
  background-image:
    linear-gradient(45deg, var(--component-rgba-255-255-255-0-04) 25%, transparent 25%),
    linear-gradient(-45deg, var(--component-rgba-255-255-255-0-04) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--component-rgba-255-255-255-0-04) 75%),
    linear-gradient(-45deg, transparent 75%, var(--component-rgba-255-255-255-0-04) 75%);
  background-size: 16px 16px;
  background-position:
    0 0,
    0 8px,
    8px -8px,
    -8px 0;
}

.image-preview-canvas--pannable {
  cursor: grab;
  touch-action: none;
}

.image-preview-canvas--dragging {
  cursor: grabbing;
}

.image-preview-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  image-rendering: auto;
  box-shadow: var(--shadow-md);
  user-select: none;
}

.image-preview-img--manual {
  max-width: none;
  max-height: none;
}

.image-preview-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--gap-tight) var(--inset-control-inline);
  border-top: 1px solid var(--border-default);
  background: var(--component-mix-surface-panel-90pct-surface-input-10pct);
  color: var(--text-tertiary);
  font-size: 11px;
  font-family: var(--font-mono);
}

.image-preview-meta {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: var(--sp-3);
}

.image-preview-type {
  color: var(--text-secondary);
  font-weight: var(--font-medium);
}

.image-preview-controls {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: var(--gap-compact);
}

.image-preview-control-btn {
  width: 26px;
  height: 26px;
}

.image-preview-zoom-level {
  min-width: 44px;
  color: var(--text-secondary);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.document-preview {
  display: flex;
  min-height: 100%;
  background: var(--surface-page);
}

.document-preview-frame {
  flex: 1;
  width: 100%;
  border: 0;
  background: var(--surface-panel);
}

.document-preview--loading {
  display: grid;
  place-items: center;
  min-height: 240px;
  color: var(--text-secondary);
}

.editor-surface__header {
  justify-content: space-between;
}

.editor-surface__toolbar {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: var(--gap-compact);
  margin-left: auto;
  padding: 0;
  border-radius: var(--radius-md);
  background: transparent;
}

.editor-surface__toolbar .code-mode-btn {
  border: none;
  box-shadow: none;
  width: 26px;
  min-width: 26px;
  height: 26px;
  padding: 0;
  justify-content: center;
}

.editor-surface__toolbar .code-mode-btn.active {
  box-shadow: none;
}

.editor-surface__mode-btn.active {
  background: var(--component-mix-status-info-fg-22pct-transparent);
  color: var(--text-primary);
}

.editor-surface__action-btn {
  flex-shrink: 0;
}

.image-diff-preview {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  background: var(--surface-input);
}

.image-diff-preview__meta {
  display: flex;
  gap: var(--sp-3);
  align-items: center;
  padding: calc(var(--sp-2) + var(--gap-compact)) calc(var(--sp-3) + var(--gap-compact));
  border-bottom: 1px solid var(--border-default);
  color: var(--text-tertiary);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  font-family: var(--font-mono);
}

.image-diff-preview__stack {
  display: grid;
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 0;
  flex: 1;
}

.image-diff-preview__pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-bottom: 1px solid var(--component-mix-border-default-70pct-transparent);
}

.image-diff-preview__pane:last-child {
  border-bottom: none;
}

.image-diff-preview__pane-header {
  padding: var(--sp-2) calc(var(--sp-3) + var(--gap-compact));
  color: var(--text-secondary);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
}

.image-diff-preview__canvas {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
  overflow: auto;
  background-color: var(--component-mix-surface-input-90pct-surface-page-10pct);
  background-image:
    linear-gradient(45deg, var(--component-rgba-255-255-255-0-04) 25%, transparent 25%),
    linear-gradient(-45deg, var(--component-rgba-255-255-255-0-04) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--component-rgba-255-255-255-0-04) 75%),
    linear-gradient(-45deg, transparent 75%, var(--component-rgba-255-255-255-0-04) 75%);
  background-size: 16px 16px;
  background-position:
    0 0,
    0 8px,
    8px -8px,
    -8px 0;
}

.image-diff-preview__image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: var(--shadow-md);
}

.code-file-path {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: 70%;
  overflow: hidden;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.code-file-path__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.code-editor-body {
  flex: 1;
  min-height: 0;
  background: var(--surface-panel-bg);
  overflow: auto;
}

.code-lines {
  min-height: 100%;
  padding: var(--editor-pane-inset) 0;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.65;
}

.code-line {
  display: flex;
  align-items: flex-start;
  min-height: 20px;
  padding: 0 16px;
  white-space: pre-wrap;
  word-break: break-word;
}

.code-line-num {
  width: 36px;
  flex-shrink: 0;
  margin-right: 12px;
  color: var(--text-tertiary);
  text-align: right;
  user-select: none;
}

.git-diff-line-text {
  flex: 1;
}

.git-diff-line-meta {
  color: var(--text-tertiary);
}

.git-diff-line-added {
  background: var(--diff-added-bg);
  color: var(--diff-added-fg);
}

.git-diff-line-removed {
  background: var(--diff-deleted-bg);
  color: var(--diff-deleted-fg);
}

.git-diff-line-context {
  color: var(--text-primary);
}

.git-diff-actions,
.git-diff-hunk-actions {
  display: inline-flex;
  align-items: center;
  gap: var(--gap-compact);
}

.git-diff-actions {
  margin-right: var(--gap-compact);
}

.git-diff-hunk {
  border-top: 1px solid var(--component-mix-border-default-70pct-transparent);
}

.git-diff-hunk:first-child {
  border-top: 0;
}

.git-diff-hunk-toolbar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-default);
  min-height: 30px;
  padding: var(--gap-compact) var(--editor-toolbar-inset);
  background:
    linear-gradient(180deg, var(--component-rgba-255-255-255-0-035), transparent),
    var(--component-mix-surface-panel-90pct-surface-input-10pct);
  border-bottom: 1px solid var(--component-mix-border-default-70pct-transparent);
}

.git-diff-hunk-header {
  min-width: 0;
  overflow: hidden;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.git-diff-hunk-action {
  min-height: 24px;
  padding-inline: var(--gap-tight);
}

.git-diff-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--diff-section-gap);
  min-height: 100%;
  padding: var(--diff-thread-inset);
  border-radius: var(--diff-thread-radius);
  background: var(--surface-panel-bg);
  text-align: center;
}

.git-diff-empty-title {
  margin: 0;
  font-size: 14px;
  font-weight: var(--font-medium);
  color: var(--text-primary);
}

.git-diff-empty-body {
  margin: 0;
  max-width: 360px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ========== Workspace Visual Alignment ========== */
.workspace-main-area {
  background:
    radial-gradient(circle at top center, var(--component-rgba-108-182-255-0-05), transparent 28%),
    linear-gradient(180deg, var(--component-rgba-255-255-255-0-015), transparent 18%),
    var(--surface-page);
}

.workspace-main-stage {
  flex: 1;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  background: transparent;
}

.workspace-main-stage__editor-overlay {
  position: absolute;
  inset: 0;
  z-index: var(--z-inline-raised);
  display: flex;
  min-width: 0;
  min-height: 0;
  background: var(--surface-page);
}

.workspace-main-stage > .agent-panes {
  padding: var(--inset-panel) var(--inset-panel) 0;
  background: transparent;
}

.pane-layout-divider {
  position: relative;
  background: linear-gradient(180deg, transparent, var(--state-info-bg), transparent);
}

.pane-layout-vertical-divider {
  background: linear-gradient(
    180deg,
    transparent,
    var(--component-mix-status-info-fg-24pct-transparent),
    transparent
  );
}

.pane-layout-divider::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border-radius: var(--radius-pill);
  background: var(--component-mix-border-default-62pct-transparent);
}

.pane-layout-horizontal-divider::after {
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  transform: translateX(-50%);
}

.pane-layout-vertical-divider::after {
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: var(--component-mix-border-default-78pct-status-info-fg-22pct);
  transform: translateY(-50%);
}

.pane-layout-divider:hover::after {
  background: var(--component-mix-border-focus-58pct-transparent);
}

.pane-layout-divider:hover {
  background: var(--component-mix-border-focus-44pct-transparent-56pct);
}

.session-card {
  background: linear-gradient(
    180deg,
    var(--component-rgba-18-26-34-0-94),
    var(--component-rgba-11-18-24-0-98)
  );
  border: 1px solid var(--component-mix-border-subtle-66pct-status-info-fg-34pct);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.session-progress {
  height: 4px;
  background: var(--state-info-bg);
}

.session-header {
  padding: var(--gap-tight) var(--inset-control-inline);
  border-bottom: 1px solid var(--component-mix-border-default-72pct-status-info-fg-28pct);
  background: linear-gradient(
    180deg,
    var(--component-rgba-18-26-34-0-96),
    var(--component-rgba-14-21-28-0-92)
  );
  backdrop-filter: var(--component-blur-12px);
}

.session-title {
  color: var(--text-primary);
  letter-spacing: 0.08em;
}

.session-header-actions {
  gap: var(--gap-control);
}

.session-action-btn {
  width: 22px;
  height: 22px;
  border-radius: 6px;
}

.workspace-bottom-panel > .bottom-terminal,
.workspace-bottom-panel-body > .bottom-terminal {
  border: 1px solid var(--component-mix-border-subtle-64pct-status-info-fg-36pct);
  border-radius: 0;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  background: linear-gradient(
    180deg,
    var(--component-mix-surface-input-96pct-white-4pct),
    var(--component-mix-surface-input-88pct-surface-page-12pct)
  );
}

.terminal-toolbar {
  min-height: 28px;
  padding: 2px 10px;
  gap: 8px;
  border-bottom: 1px solid var(--component-mix-border-default-72pct-status-info-fg-28pct);
  background: linear-gradient(
    180deg,
    var(--component-rgba-18-26-34-0-96),
    var(--component-rgba-14-21-28-0-92)
  );
}

.terminal-toolbar-left {
  gap: 10px;
}

.terminal-toolbar-left::before {
  content: "";
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-radius: 999px;
  margin-right: 12px;
  background: var(--component-hex-ff5f57);
  box-shadow:
    10px 0 0 var(--component-hex-febc2e),
    20px 0 0 var(--component-hex-28c840);
  opacity: 0.8;
}

.terminal-kicker {
  letter-spacing: 0.12em;
}

.terminal-title {
  color: var(--text-primary);
}

.terminal-selector-btn {
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  border-color: var(--component-mix-border-subtle-70pct-transparent);
  background: var(--component-rgba-255-255-255-0-04);
}

.terminal-selector-btn:hover {
  background: var(--component-rgba-255-255-255-0-06);
}

.bottom-terminal-tabs {
  padding: 0 12px;
  background: var(--component-rgba-8-12-16-0-56);
  border-top: 1px solid var(--component-rgba-255-255-255-0-02);
  border-bottom: 1px solid var(--component-mix-border-default-72pct-status-info-fg-28pct);
}

.terminal-tab {
  height: 30px;
  padding: 0 10px;
  margin-top: 6px;
  border-radius: 8px 8px 0 0;
}

.terminal-tab-active {
  background: var(--component-rgba-108-182-255-0-08);
}

.terminal-tab-close {
  color: var(--text-tertiary);
  opacity: 0.68;
}

/* ========== Terminal Panel Toggle ========== */
.terminal-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.terminal-toggle-btn:hover {
  background: var(--surface-elevated);
  color: var(--text-primary);
}

.terminal-toggle-btn--hidden {
  color: var(--text-tertiary);
}

.terminal-toggle-btn--hidden:hover {
  color: var(--text-secondary);
}

/* ========== Collapsed Terminal Panel ========== */
.bottom-terminal-collapsed {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  background: var(--surface-panel);
  border-top: 1px solid var(--border-default);
  flex-shrink: 0;
}

.terminal-collapsed-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 4px;
  border: 1px solid var(--border-default);
  background: var(--surface-elevated);
  color: var(--text-secondary);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.terminal-collapsed-toggle:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.terminal-tab-close:hover {
  background: var(--component-rgba-255-255-255-0-06);
  color: var(--text-primary);
}

.code-editor-header {
  min-height: var(--panel-header-height);
  padding: var(--gap-tight) var(--inset-control-inline);
  border-bottom: 1px solid var(--workspace-editor-toolbar-border);
  background: linear-gradient(
    180deg,
    var(--component-mix-surface-panel-97pct-white-3pct),
    var(--component-mix-surface-panel-84pct-surface-input-16pct)
  );
}

.code-file-path {
  color: var(--text-primary);
}

.code-mode-toggle {
  display: inline-flex;
  align-items: center;
  margin-left: auto;
  flex-shrink: 0;
  padding: var(--gap-compact);
  gap: var(--gap-compact);
  border-radius: var(--radius-lg);
  background: var(--component-mix-surface-hover-72pct-surface-panel-28pct);
}

.code-mode-btn {
  width: 26px;
  min-width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 6px;
  justify-content: center;
}

.code-mode-btn.active {
  box-shadow: inset 0 0 0 1px var(--border-focus);
}

.app-topbar {
  padding: 0 var(--sp-2);
  background: var(--component-mix-surface-panel-95pct-status-info-fg-5pct);
  border-bottom-color: var(--component-mix-border-default-70pct-status-info-fg-30pct);
}

.topbar-tabs {
  gap: var(--gap-control);
}

.topbar-tab {
  height: 30px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--text-secondary);
  transition:
    background var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out);
}

.topbar-tab.active {
  background: linear-gradient(
    180deg,
    var(--component-mix-surface-active-90pct-white-10pct),
    var(--component-mix-surface-active-94pct-surface-panel-6pct)
  );
  border: 1px solid var(--component-mix-border-subtle-68pct-status-info-fg-32pct);
  box-shadow: inset 0 1px 0 var(--component-mix-white-6pct-transparent);
}

.topbar-tab-name {
  font-weight: var(--font-medium);
}

.topbar-dot.active {
  box-shadow: 0 0 0 var(--sp-1) var(--component-mix-status-success-fg-12pct-transparent);
}

.topbar-unread {
  min-width: 18px;
  height: 18px;
  border-radius: var(--radius-pill);
  background: var(--component-mix-status-info-fg-82pct-white-18pct);
  color: var(--component-hex-081118);
  font-family: var(--font-sans);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
}

.topbar-close {
  width: 20px;
  height: 20px;
  border-radius: 5px;
}

.topbar-add,
.topbar-btn,
.connection-status {
  height: 30px;
  border-radius: 8px;
}

.topbar-add {
  width: 30px;
}

.topbar-btn {
  width: 30px;
}

.topbar-quick-actions {
  height: 30px;
  padding: 0 12px;
}

.connection-status {
  width: 30px;
  border-color: var(--component-mix-border-subtle-72pct-transparent);
  background: var(--component-mix-surface-panel-88pct-surface-page-12pct);
}

.left-panel {
  background: var(--surface-muted);
  box-shadow: none;
}

.panel-header {
  padding: var(--sp-3) var(--inset-control-inline) var(--inset-control-block);
  background: linear-gradient(
    180deg,
    var(--component-rgba-18-26-34-0-8),
    var(--component-rgba-14-21-28-0-28)
  );
  border-bottom-color: var(--component-mix-border-default-72pct-status-info-fg-28pct);
}

.panel-kicker {
  color: var(--component-mix-text-tertiary-82pct-status-info-fg-18pct);
}

.panel-branch {
  height: 24px;
  gap: var(--gap-tight);
  padding: 0 var(--inset-control-block);
  border: 1px solid var(--state-selected-border);
  border-radius: var(--radius-control-lg);
  background: var(--state-selected-bg);
  color: var(--text-primary);
}

.panel-tab {
  border-radius: 6px;
}

.panel-toolbar {
  min-height: 34px;
  padding: var(--gap-tight) var(--inset-control-block);
  background: var(--component-mix-surface-panel-bg-96pct-transparent);
  border-bottom-color: var(--component-mix-border-default-72pct-status-info-fg-28pct);
}

.panel-toolbar-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
}

.file-tree {
  padding: 6px 0 8px;
}

.file-tree-empty {
  padding: var(--sp-5) var(--inset-panel);
  color: var(--text-tertiary);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
}

.tree-item {
  min-height: 26px;
  padding-right: var(--inset-control-block);
  margin-right: var(--gap-tight);
  border-radius: 0 var(--radius-panel) var(--radius-panel) 0;
}

.tree-item:hover {
  background: var(--component-mix-state-selected-bg-72pct-transparent);
}

.tree-item.selected {
  background: var(--state-selected-bg);
  box-shadow:
    inset var(--state-focus-ring-width) 0 0 var(--state-selected-border),
    inset 0 1px 0 var(--component-mix-white-4pct-transparent);
}

.tree-chevron {
  color: var(--component-mix-text-tertiary-78pct-status-info-fg-22pct);
}

.tree-label {
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--type-body-3-weight);
  color: var(--text-secondary);
}

.tree-item.selected .tree-label {
  color: var(--text-primary);
}

.badge {
  height: 18px;
  padding: 0 8px;
  border-radius: 5px;
  font-family: var(--font-sans);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  letter-spacing: 0.08em;
}

.session-dot {
  width: 8px;
  height: 8px;
  box-shadow: 0 0 0 4px
    var(--component-mix-status-dot-current-color-var-text-tertiary-12pct-transparent);
}

.session-dot-running {
  box-shadow: 0 0 0 4px var(--component-mix-terminal-state-running-border-32pct-transparent);
}

.session-title-row {
  gap: var(--session-row-gap);
}

.session-header-copy {
  display: flex;
  flex-direction: column;
  gap: var(--gap-compact);
}

.session-terminal {
  background: linear-gradient(
    180deg,
    var(--component-mix-surface-input-98pct-white-2pct),
    var(--component-mix-surface-input-90pct-surface-page-10pct)
  );
}

.workspace-empty-content,
.workspace-resolving-shell {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: var(--sp-8);
  background:
    radial-gradient(circle at top left, var(--component-rgba-120-215-178-0-08), transparent 24%),
    radial-gradient(circle at bottom right, var(--component-rgba-108-182-255-0-1), transparent 28%);
}

.workspace-empty-inner,
.workspace-resolving-card {
  width: min(920px, 100%);
  border: 1px solid var(--component-mix-border-default-72pct-status-info-fg-28pct);
  border-radius: calc(var(--radius-xl) + var(--sp-1));
  background: linear-gradient(
    180deg,
    var(--component-rgba-17-24-31-0-96),
    var(--component-rgba-10-16-20-0-98)
  );
  box-shadow: var(--shadow-lg);
}

.workspace-empty-inner {
  width: min(440px, 100%);
  padding: var(--sp-8);
  text-align: center;
}

.workspace-empty-inner p {
  color: var(--text-secondary);
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--type-body-3-weight);
}

.workspace-resolving-card {
  padding: var(--sp-8);
}

.workspace-resolving-kicker {
  color: var(--component-mix-text-tertiary-80pct-status-info-fg-20pct);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.workspace-resolving-title {
  margin-top: var(--sp-3);
  color: var(--text-primary);
  font-size: var(--type-heading-1-size);
  line-height: var(--type-heading-1-line-height);
  font-weight: var(--type-heading-1-weight);
  letter-spacing: -0.03em;
}

.workspace-resolving-desc {
  max-width: 48ch;
  margin-top: var(--sp-3);
  color: var(--text-secondary);
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--type-body-3-weight);
}

.workspace-resolving-preview {
  margin-top: var(--sp-8);
  overflow: hidden;
  border: 1px solid var(--component-mix-border-default-78pct-status-info-fg-22pct);
  border-radius: calc(var(--radius-xl) + var(--sp-1));
  background: linear-gradient(
    180deg,
    var(--component-rgba-13-20-26-0-96),
    var(--component-rgba-8-13-18-0-98)
  );
}

.workspace-resolving-preview-topbar {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  height: 36px;
  padding: 0 var(--sp-3);
  border-bottom: 1px solid var(--border-default);
  background: linear-gradient(
    180deg,
    var(--component-rgba-17-24-31-0-98),
    var(--component-rgba-13-20-26-0-92)
  );
}

.workspace-resolving-preview-body {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 360px;
}

.workspace-resolving-preview-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border-right: 1px solid var(--border-default);
  background: linear-gradient(
    180deg,
    var(--component-rgba-13-20-26-0-98),
    var(--component-rgba-11-18-24-0-98)
  );
}

.workspace-resolving-preview-main {
  display: grid;
  grid-template-rows: minmax(0, 1fr) 144px;
  min-width: 0;
}

.workspace-resolving-console,
.workspace-resolving-terminal {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  min-width: 0;
  padding: var(--sp-4);
}

.workspace-resolving-console {
  background: radial-gradient(
    circle at top,
    var(--component-rgba-108-182-255-0-05),
    transparent 32%
  );
}

.workspace-resolving-terminal {
  border-top: 1px solid var(--border-default);
  background: linear-gradient(
    180deg,
    var(--component-rgba-11-18-24-0-98),
    var(--component-rgba-9-15-20-1)
  );
}

.workspace-resolving-console-status {
  width: var(--status-dot-size);
  height: var(--status-dot-size);
  border-radius: var(--radius-chip);
  background: var(--state-success-text);
  box-shadow: 0 0 0 4px var(--component-mix-state-success-border-32pct-transparent);
}

.workspace-resolving-pill,
.workspace-resolving-line,
.workspace-resolving-console-line {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--component-mix-surface-hover-74pct-surface-panel-26pct);
}

.workspace-resolving-pill::after,
.workspace-resolving-line::after,
.workspace-resolving-console-line::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    transparent,
    var(--component-rgba-255-255-255-0-08),
    transparent
  );
  animation: workspaceResolvingShimmer 1.8s var(--ease-in-out) infinite;
}

.workspace-resolving-pill {
  width: 110px;
  height: 20px;
}

.workspace-resolving-pill-active {
  background: linear-gradient(
    90deg,
    var(--component-rgba-108-182-255-0-22),
    var(--component-rgba-108-182-255-0-1)
  );
}

.workspace-resolving-pill-short {
  width: 28px;
  margin-left: auto;
}

.workspace-resolving-line {
  height: 12px;
}

.workspace-resolving-line-label {
  width: 96px;
  height: 10px;
}

.workspace-resolving-line-strong {
  width: 72px;
  height: 24px;
  border: 1px solid var(--state-info-border);
  background: var(--state-info-bg);
}

.workspace-resolving-line-wide {
  width: 84%;
}

.workspace-resolving-console-line {
  height: 12px;
}

.workspace-resolving-console-line-title {
  width: 160px;
  height: 11px;
}

.workspace-resolving-console-line-wide {
  width: 88%;
}

.workspace-resolving-console-line-short {
  width: 56%;
}

@keyframes workspaceResolvingShimmer {
  100% {
    transform: translateX(100%);
  }
}

@media (max-width: 900px) {
  .workspace-resolving-preview-body {
    grid-template-columns: 1fr;
  }

  .workspace-resolving-preview-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border-default);
  }
}

/* ========== Workspace Visual Alignment Pass 2 ========== */
.workspace-main-area {
  min-width: 0;
  background: var(--surface-page);
}

.workspace-main-stage > .agent-panes {
  flex: 1;
  min-height: 0;
  padding: 0;
}

.pane-layout,
.pane-layout-child {
  height: 100%;
  background: transparent;
}

.panel-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.panel-body > .file-tree,
.panel-body > .git-panel {
  flex: 1;
  min-height: 0;
}

.left-panel {
  width: 280px;
  min-width: 220px;
  background: var(--surface-muted);
  box-shadow: none;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  min-height: var(--panel-header-height);
  padding: var(--gap-tight) var(--inset-control-inline);
  background: transparent;
  border-bottom: 1px solid var(--border-default);
}

.panel-header__leading {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex: 1;
  min-width: 0;
}

.panel-header__copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: var(--gap-compact);
}

.panel-header__title-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-width: 0;
}

.panel-header--inline-meta .panel-header__title-row {
  flex-wrap: nowrap;
}

.panel-header__title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--type-heading-5-size);
  line-height: var(--type-heading-5-line-height);
  font-weight: var(--type-heading-5-weight);
  color: var(--text-primary);
}

.panel-header__status {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  flex: 0 0 auto;
}

.panel-header__meta {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-width: 0;
}

.panel-header__meta--inline {
  flex: 0 0 auto;
}

.panel-header__actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-1);
  margin-left: auto;
  flex-shrink: 0;
}

.panel-kicker {
  margin-bottom: var(--gap-tight);
  color: var(--text-tertiary);
  letter-spacing: 0.08em;
}

.panel-branch {
  height: auto;
  margin-bottom: var(--space-default);
  padding: var(--gap-compact) var(--sp-2);
  border: none;
  border-radius: var(--radius-control-sm);
  background: var(--state-hover-bg-subtle);
  color: var(--text-secondary);
}

.panel-branch-button {
  display: inline-flex;
  align-items: center;
  gap: var(--gap-control);
  cursor: pointer;
  transition:
    background var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
}

.panel-branch-button:hover {
  background: var(--component-mix-surface-hover-72pct-status-info-fg-28pct);
  color: var(--text-primary);
}

.panel-branch-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--component-mix-status-info-fg-40pct-transparent);
}

.panel-tabs {
  margin-top: var(--space-default);
  gap: var(--gap-control);
}

.panel-tab {
  height: auto;
  padding: var(--gap-compact) var(--sp-2);
  border-radius: var(--radius-control-sm);
  background: transparent;
  font-size: var(--type-body-6-size);
  font-weight: var(--type-body-6-weight);
  line-height: var(--type-body-6-line-height);
  color: var(--text-tertiary);
}

.panel-tab.active {
  background: var(--status-info-fg);
  color: var(--text-inverse);
  font-weight: var(--type-body-6-weight);
}

.panel-toolbar {
  min-height: calc(var(--control-height-sm) + var(--gap-tight));
  padding: var(--gap-tight) var(--inset-control-inline);
  background: transparent;
  border-bottom: 1px solid var(--border-default);
}

.file-tree-shell {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

.file-tree-search {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-3) var(--sp-2);
  border-bottom: 1px solid var(--border-default);
}

.file-tree-search-icon {
  flex-shrink: 0;
  color: var(--text-tertiary);
}

.file-tree-search-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--type-body-3-weight);
  outline: none;
}

.file-tree-search-input::placeholder {
  color: var(--text-tertiary);
}

.file-tree {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 4px 0;
}

.tree-item {
  display: flex;
  align-items: center;
  min-height: 0;
  gap: var(--gap-control);
  margin-right: 0;
  padding: 3px var(--inset-control-inline) 3px var(--inset-row-inline);
  border-radius: 0;
}

.tree-item-actions {
  margin-left: auto;
  display: flex;
  gap: var(--gap-compact);
  opacity: 0;
}

.tree-item:hover .tree-item-actions,
.tree-item.selected .tree-item-actions {
  opacity: 1;
}

.tree-item.selected {
  background: var(--state-selected-bg);
  border-left: var(--state-focus-ring-width) solid var(--state-selected-border);
  box-shadow: none;
  padding-left: calc(var(--inset-row-inline) - var(--state-focus-ring-width));
}

.tree-label {
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--type-body-3-weight);
  color: var(--text-secondary);
}

.tree-search-labels {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.tree-search-path {
  overflow: hidden;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-item.selected .tree-label {
  color: var(--text-primary);
}

.session-card {
  background: var(--workspace-session-idle-surface);
  border: none;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: var(--material-backdrop-filter);
}

.session-card.session-card--active {
  background: var(--surface-active);
  box-shadow: inset 0 0 0 1px var(--border-focus);
}

.session-progress {
  height: 3px;
  background: var(--state-info-bg);
}

.session-header {
  padding: var(--gap-tight) var(--inset-control-inline);
  border-bottom: 1px solid var(--border-default);
  background: var(--workspace-session-idle-header-surface);
  backdrop-filter: var(--material-backdrop-filter);
}

.session-card.session-card--active .session-header {
  background: var(--component-mix-surface-active-88pct-surface-page-12pct);
  border-bottom-color: var(--border-focus);
}

.session-card.session-card--active > .panel-header {
  background: var(--component-mix-surface-active-88pct-surface-page-12pct);
  border-bottom-color: var(--border-focus);
}

.session-header-left {
  gap: var(--gap-default);
}

.session-header-copy {
  display: block;
  min-width: 0;
}

.session-title-row {
  display: inline-flex;
  align-items: center;
  gap: var(--session-row-gap);
  min-width: 0;
  flex-wrap: nowrap;
}

.session-card > .panel-header .panel-header__title {
  font-family: var(--font-mono);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
  color: var(--text-secondary);
  letter-spacing: 0.04em;
}

.session-card.session-card--active > .panel-header .panel-header__title {
  color: var(--text-primary);
}

.session-dot {
  box-shadow: none;
}

.session-dot-running {
  background: var(--terminal-state-running-text);
  box-shadow: 0 0 0 4px var(--component-mix-terminal-state-running-border-32pct-transparent);
}

.session-provider-badge,
.session-state-badge {
  height: 16px;
  padding: 0 6px;
  border-radius: var(--session-state-radius);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  letter-spacing: 0;
  text-transform: none;
  flex: 0 0 auto;
  white-space: nowrap;
}

.session-card > .panel-header .session-state-badge.badge-green {
  border: 1px solid var(--component-mix-current-color-22pct-transparent);
  background: var(--component-mix-current-color-12pct-transparent);
}

[data-theme$="-dark"] .session-card > .panel-header .session-state-badge.badge-green {
  box-shadow:
    inset 0 1px 0 var(--component-mix-white-8pct-transparent),
    0 0 0 1px var(--component-mix-current-color-10pct-transparent),
    0 8px 18px var(--component-mix-current-color-16pct-transparent);
}

[data-theme$="-light"] .session-card > .panel-header .session-state-badge.badge-green {
  box-shadow:
    inset 0 1px 0 var(--component-mix-white-50pct-transparent),
    0 0 0 1px var(--component-mix-current-color-8pct-transparent);
}

.session-card > .panel-header.session-header--running {
  background: var(--terminal-state-running-bg);
  border-bottom-color: var(--terminal-state-running-border);
  color: var(--terminal-state-running-text);
}

.session-card > .panel-header.panel-header--inline-meta .panel-header__meta {
  overflow: hidden;
}

.session-header-actions {
  gap: var(--gap-control);
}

.session-header-actions button[data-session-action="start"],
.session-header-actions button[data-session-action="stop"] {
  order: 0;
}

.session-header-actions button[data-session-action="split-vertical"] {
  order: 1;
}

.session-header-actions button[data-session-action="split-horizontal"] {
  order: 2;
}

.session-header-actions button[data-session-action="close"] {
  order: 3;
}

.session-action-btn {
  width: 20px;
  height: 20px;
  border-radius: 4px;
}

.session-action-btn-drag {
  cursor: grab;
}

body.is-dragging-pane .session-action-btn-drag {
  cursor: grabbing;
}

.session-card-verify {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--gap-tight) var(--sp-3);
  margin: var(--gap-tight) var(--sp-3) 0;
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--component-mix-current-color-22pct-transparent);
  border-radius: var(--radius-md);
  background: var(--component-mix-current-color-8pct-transparent);
  color: var(--status-info-fg);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
}

.session-card-verify-command {
  min-width: 0;
  overflow: hidden;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-card-verify-actions {
  display: inline-flex;
  grid-column: 2;
  grid-row: 1 / span 2;
  align-items: center;
  justify-content: flex-end;
  gap: var(--gap-compact);
}

.session-card-verify--passed {
  color: var(--status-success-fg);
}

.session-card-verify--failed {
  color: var(--status-danger-fg);
}

.session-card-verify--queued,
.session-card-verify--running {
  color: var(--status-info-fg);
}

.session-card-verify--stopped {
  color: var(--status-warning-fg);
}

.workspace-bottom-panel {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  min-height: 0;
  overflow: visible;
  padding: 0;
  background: transparent;
  border-top: none;
}

.workspace-bottom-panel-shell {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  background: var(--workspace-bottom-terminal-surface);
  backdrop-filter: var(--material-backdrop-filter);
}

.workspace-bottom-panel-tabs-shell {
  flex-shrink: 0;
}

.workspace-bottom-panel-tabs {
  gap: var(--gap-compact);
  min-height: 30px;
  padding: 0 12px;
  border-bottom: 1px solid var(--border-default);
  background: var(--workspace-terminal-toolbar-surface);
  backdrop-filter: var(--material-backdrop-filter);
}

.workspace-bottom-panel-tab {
  height: 28px;
  padding: 0 10px;
  border-radius: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-tertiary);
}

.workspace-bottom-panel-tab.active {
  border-bottom-color: var(--status-info-fg);
  color: var(--text-primary);
}

.workspace-bottom-panel-body {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}

.workspace-bottom-panel > .bottom-terminal,
.workspace-bottom-panel-body > .bottom-terminal {
  flex: 1;
  min-height: 0;
  border: none;
  background: var(--workspace-bottom-terminal-surface);
  backdrop-filter: var(--material-backdrop-filter);
}

.terminal-toolbar {
  min-height: 28px;
  padding: 3px 10px;
  gap: 6px;
  border-bottom: 1px solid var(--border-default);
  background: var(--surface-panel);
}

.terminal-toolbar-left,
.terminal-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.terminal-toolbar-left {
  min-width: 0;
  flex: 1;
}

.terminal-toolbar-right {
  min-width: 0;
  flex: 1;
  justify-content: flex-end;
}

.terminal-toolbar-left::before {
  content: none;
}

.terminal-title-stack {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.terminal-selector {
  margin-right: 0;
  min-width: 0;
}

.terminal-kicker {
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
}

.terminal-title {
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  white-space: nowrap;
}

.terminal-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.panel-toolbar-btn--active {
  background: var(--component-mix-status-info-fg-12pct-surface-panel);
  color: var(--text-primary);
}

.terminal-selector-btn {
  height: 22px;
  max-width: 240px;
  padding: 0 8px;
  border-radius: 4px;
  border: 1px solid var(--border-default);
  background: var(--surface-page);
  color: var(--text-secondary);
  font-size: 11px;
}

.bottom-terminal-content {
  flex-direction: row;
  align-items: stretch;
}

.bottom-terminal-main {
  display: flex;
  flex: 1;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  background: var(--workspace-content-surface);
}

.terminal-command-side-panel {
  display: flex;
  width: min(360px, 38vw);
  min-width: 260px;
  max-width: 420px;
  min-height: 0;
  flex: 0 0 min(360px, 38vw);
  flex-direction: column;
  border-left: 1px solid var(--component-mix-border-default-84pct-transparent);
  background: var(--component-mix-surface-page-94pct-surface-panel-6pct);
  overflow: hidden;
}

.terminal-command-side-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  min-height: 34px;
  padding: 5px 8px 5px 10px;
  border-bottom: 1px solid var(--component-mix-border-default-84pct-transparent);
  background: var(--workspace-terminal-toolbar-surface);
}

.terminal-command-side-panel__heading {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: var(--sp-2);
}

.terminal-command-side-panel__title {
  margin: 0;
  overflow: hidden;
  color: var(--text-primary);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--type-body-3-weight);
}

.terminal-command-side-panel__error {
  margin: var(--sp-2);
  padding: var(--sp-2);
  border: 1px solid var(--component-mix-status-danger-fg-28pct-border-default-72pct);
  border-radius: var(--radius-sm);
  color: var(--status-danger-fg);
  font-size: var(--type-body-5-size);
}

.terminal-command-side-panel__empty {
  flex: 1;
  min-height: 0;
  padding: var(--sp-4);
}

.terminal-command-side-panel__list {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}

.terminal-command-side-panel__list--scroll {
  overflow-y: auto;
}

.terminal-command-side-panel__row {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: 9px 10px;
  border-bottom: 1px solid var(--component-mix-border-default-90pct-transparent);
  background: transparent;
}

.terminal-command-side-panel__row:hover {
  background: var(--component-mix-status-info-fg-8pct-surface-panel);
}

.terminal-command-side-panel__row-main {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.terminal-command-side-panel__label {
  overflow: hidden;
  color: var(--text-primary);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--type-body-4-size);
  line-height: var(--type-body-4-line-height);
  font-weight: var(--font-medium);
}

.terminal-command-side-panel__command {
  overflow: hidden;
  color: var(--text-secondary);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
}

.terminal-command-side-panel__row-footer {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
}

.terminal-command-side-panel__status {
  min-width: 0;
  overflow: hidden;
  color: var(--text-tertiary);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
}

.app-topbar {
  padding: 0 var(--sp-2);
}

.topbar-tabs {
  gap: var(--gap-micro);
}

.topbar-tabs-nav,
.topbar-tablist {
  flex: 1;
  min-width: 0;
}

.topbar-tab-shell {
  position: relative;
  display: flex;
  min-width: 0;
}

.topbar-tab {
  position: relative;
  height: 29px;
  gap: var(--gap-tight);
  justify-content: flex-start;
  padding: 0 var(--control-height-md) 0 var(--inset-control-inline);
  border-radius: 7px;
  overflow: hidden;
  isolation: isolate;
}

.topbar-tab.active {
  background: linear-gradient(
    180deg,
    var(--component-rgba-43-60-75-0-94),
    var(--component-rgba-30-44-56-0-98)
  );
  border-color: var(--component-mix-border-subtle-72pct-status-info-fg-28pct);
}

.topbar-tab-content {
  position: relative;
  z-index: var(--z-inline);
  display: inline-flex;
  align-items: center;
  gap: var(--gap-tight);
  min-width: 0;
  max-width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.topbar-tab-name {
  position: relative;
  z-index: var(--z-inline);
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-unread {
  position: relative;
  z-index: var(--z-inline);
  flex: 0 0 auto;
}

.workspace-session-mini-map {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  width: calc(
    var(--workspace-session-map-columns, 1) *
    var(--sp-1) +
    (var(--workspace-session-map-columns, 1) - 1) *
    var(--gap-compact)
  );
  height: var(--sp-3);
  border-radius: 0;
  overflow: hidden;
  pointer-events: none;
  background: transparent;
}

.workspace-session-mini-map__viewport {
  display: inline-flex;
  align-items: stretch;
  gap: var(--gap-compact);
  height: 100%;
}

.workspace-session-mini-map__column {
  display: block;
  flex: 0 0 var(--sp-1);
  width: var(--sp-1);
  height: 100%;
  overflow: hidden;
  border-radius: var(--radius-full);
  background: var(
    --workspace-session-map-column-fill,
    linear-gradient(
      180deg,
      var(--workspace-session-map-empty) 0%,
      var(--workspace-session-map-empty) 100%
    )
  );
}

.topbar-dot {
  width: 8px;
  height: 8px;
}

.topbar-dot.idle {
  background: var(--component-mix-text-tertiary-84pct-status-info-fg-16pct);
}

.topbar-close {
  width: 18px;
  height: 18px;
  position: absolute;
  top: 50%;
  right: 6px;
  margin-left: 0;
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%);
  z-index: var(--z-inline);
}

.topbar-close:hover:not(:disabled),
.topbar-close:active:not(:disabled) {
  transform: translateY(-50%);
}

.topbar-tab-shell.active .topbar-close,
.topbar-tab-shell:hover .topbar-close,
.topbar-tab-shell:focus-within .topbar-close {
  opacity: 1;
  pointer-events: auto;
}

.topbar-add,
.topbar-btn,
.connection-status {
  height: 29px;
  border-radius: 7px;
}

.topbar-add {
  width: 29px;
}

.topbar-btn {
  width: 29px;
}

.topbar-quick-actions {
  width: auto;
  min-width: max-content;
  flex-shrink: 0;
  padding: 0 var(--inset-control-block);
  gap: var(--gap-tight);
}

.terminal-selector-dropdown {
  margin-top: 6px;
  min-width: 180px;
  background: var(--surface-panel);
  border-radius: 6px;
}

.terminal-selector-item {
  padding: 0;
}

.terminal-selector-item-trigger {
  padding: 8px 10px;
  font-size: 12px;
}

.terminal-selector-item-close {
  width: 28px;
  height: 28px;
  border-radius: 4px;
}

.bottom-terminal-tabs-nav {
  min-width: 0;
}

.bottom-terminal-tabs {
  gap: 2px;
  padding: 0 12px;
  background: var(--surface-panel);
  border-top: none;
  border-bottom: 1px solid var(--border-default);
}

.terminal-tab-shell {
  position: relative;
  display: flex;
  min-width: 0;
}

.terminal-tab {
  height: 26px;
  margin-top: 0;
  min-width: 0;
  justify-content: flex-start;
  padding: 0 28px 0 8px;
  border-radius: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-tertiary);
}

.terminal-tab:hover {
  color: var(--text-secondary);
}

.terminal-tab.active,
.terminal-tab-active {
  background: transparent;
  border-bottom-color: var(--status-info-fg);
  color: var(--text-primary);
}

.terminal-tab-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terminal-managed-badge {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  height: 16px;
  margin-left: 6px;
  padding: 0 5px;
  border: 1px solid var(--border-default);
  border-radius: 999px;
  color: var(--text-tertiary);
  font-size: 10px;
  font-weight: var(--font-semibold);
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
}

.terminal-tab-close {
  width: 18px;
  height: 18px;
  position: absolute;
  top: 50%;
  right: 4px;
  border-radius: 4px;
  color: var(--text-tertiary);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%);
}

.terminal-tab-shell.active .terminal-tab-close,
.terminal-tab-shell:hover .terminal-tab-close,
.terminal-tab-shell:focus-within .terminal-tab-close {
  opacity: 1;
  pointer-events: auto;
}

.terminal-tab-close:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

/* ========== Toast Notifications ========== */

.toast-container {
  position: fixed;
  bottom: var(--sp-6);
  right: var(--sp-6);
  display: flex;
  flex-direction: column-reverse;
  gap: var(--sp-3);
  z-index: var(--z-toast);
  pointer-events: none;
  max-width: 420px;
  width: 100%;
}

.toast-container--mobile {
  top: calc(env(safe-area-inset-top, 0px) + var(--sp-3));
  right: 50%;
  bottom: auto;
  left: 50%;
  width: min(calc(100vw - var(--sp-6)), 420px);
  max-width: min(calc(100vw - var(--sp-6)), 420px);
  transform: translateX(-50%);
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-lg);
  background: var(--surface-panel);
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toastSlideIn var(--duration-slower) var(--ease-out);
  transition: opacity var(--duration-normal) var(--ease-out);
}

.toast:hover {
  border-color: var(--border-subtle);
  box-shadow: var(--shadow-xl);
}

.toast--success {
  border-left: 3px solid var(--status-success-fg);
}
.toast--error {
  border-left: 3px solid var(--status-danger-fg);
}
.toast--warning {
  border-left: 3px solid var(--status-warning-fg);
}
.toast--info {
  border-left: 3px solid var(--status-info-fg);
}

.toast__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.toast__icon-symbol {
  width: 20px;
  height: 20px;
}

.toast__content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.toast__title {
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--type-body-3-weight);
  color: var(--text-primary);
}

.toast__body {
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--type-body-3-weight);
  color: var(--text-secondary);
  /* Notification engine composes a 2-line body (metadata + summary)
     separated by `\n`; preserve those breaks while still wrapping long lines. */
  white-space: pre-line;
  word-break: break-word;
}

.toast__close {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  transition:
    background var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out);
}

.toast__close:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

/* ========== Theme-Sensitive Workspace Surfaces ==========
 * Final overrides for workspace chrome that should follow light/dark tokens.
 * Earlier alignment passes introduced a few dark-only fills; keep the
 * polish, but derive it from tokens so light mode stays coherent.
 */
.launch-modal {
  width: min(var(--desktop-modal-max-width-lg), 90vw);
  max-width: min(var(--desktop-modal-max-width-lg), 90vw);
  background: linear-gradient(
    180deg,
    var(--component-mix-surface-panel-97pct-white-3pct),
    var(--component-mix-surface-panel-82pct-surface-page-18pct)
  );
  border-color: var(--component-mix-border-subtle-64pct-status-info-fg-36pct);
  box-shadow: var(--shadow-xl);
}

.app-topbar {
  min-height: var(--desktop-topbar-height);
  background: var(--material-shell-topbar);
  border-bottom-color: var(--component-mix-border-default-80pct-status-info-fg-20pct);
  backdrop-filter: var(--material-backdrop-filter);
}

.topbar-tab.active {
  background: linear-gradient(
    180deg,
    var(--component-mix-surface-active-86pct-white-14pct),
    var(--component-mix-surface-active-94pct-surface-panel-6pct)
  );
  border-color: var(--component-mix-border-subtle-72pct-status-info-fg-28pct);
  box-shadow: inset 0 1px 0 var(--component-mix-white-22pct-transparent);
}

.connection-status {
  border-color: var(--component-mix-border-subtle-72pct-transparent);
  background: var(--component-mix-surface-panel-88pct-surface-page-12pct);
}

.workspace-empty-inner,
.workspace-resolving-card {
  border: 1px solid var(--component-mix-border-default-72pct-status-info-fg-28pct);
  background: linear-gradient(
    180deg,
    var(--component-mix-surface-panel-97pct-white-3pct),
    var(--component-mix-surface-panel-82pct-surface-page-18pct)
  );
  box-shadow: var(--shadow-lg);
}

.desktop-review-shell {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: var(--sp-8);
}

.desktop-review-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--desktop-panel-gap);
  align-items: start;
  padding: var(--sp-8);
}

.desktop-review-card {
  position: relative;
  min-height: 220px;
  padding: var(--desktop-panel-padding);
  border: 1px solid var(--component-mix-border-default-78pct-transparent);
  border-radius: var(--radius-xl);
  background: var(--surface-panel);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.desktop-review-card--topbar {
  width: min(100%, 1080px);
  min-height: 0;
  padding: 0;
}

.desktop-review-card--sidebar {
  width: min(100%, 360px);
  min-height: 520px;
  padding: 0;
}

.desktop-review-card--editor,
.desktop-review-card--diff {
  width: min(100%, 1080px);
  min-height: 520px;
  padding: 0;
}

.desktop-review-card--terminal {
  width: min(100%, 880px);
  min-height: 320px;
  padding: 0;
}

.desktop-review-card--statusbar {
  width: min(100%, 1080px);
  min-height: 0;
  padding: 0;
}

.desktop-review-card--worktree {
  min-height: 540px;
  padding: 0;
}

.desktop-review-card .workbench-layer-backdrop {
  position: static;
  inset: auto;
  min-height: 100%;
  padding-top: 0;
  background: transparent;
  backdrop-filter: none;
}

.desktop-review-card .command-palette,
.desktop-review-card .launch-modal {
  margin: 0 auto;
}

.desktop-review-embedded-worktree .drawer-panel.worktree-manager-surface {
  width: 100%;
  max-width: none;
  min-height: 540px;
  box-shadow: none;
}

.workspace-resolving-preview {
  background: linear-gradient(
    180deg,
    var(--component-mix-surface-input-98pct-white-2pct),
    var(--component-mix-surface-input-88pct-surface-page-12pct)
  );
}

.workspace-resolving-preview-topbar {
  background: linear-gradient(
    180deg,
    var(--component-mix-surface-panel-94pct-white-6pct),
    var(--component-mix-surface-input-88pct-surface-panel-12pct)
  );
}

.workspace-resolving-preview-sidebar {
  background: linear-gradient(
    180deg,
    var(--component-mix-surface-input-94pct-white-6pct),
    var(--component-mix-surface-input-100pct-transparent)
  );
}

.workspace-resolving-terminal {
  background: linear-gradient(
    180deg,
    var(--component-mix-surface-input-96pct-white-4pct),
    var(--component-mix-surface-input-84pct-surface-page-16pct)
  );
}

.workspace-git-editor {
  background: linear-gradient(
    180deg,
    var(--component-mix-surface-panel-97pct-white-3pct),
    var(--component-mix-surface-input-88pct-surface-page-12pct)
  );
  border-color: var(--component-mix-border-subtle-68pct-status-info-fg-32pct);
  box-shadow: var(--shadow-lg);
}

.code-editor-header {
  padding: var(--gap-default) var(--editor-toolbar-inset);
  border-bottom: 1px solid var(--component-mix-border-default-72pct-status-info-fg-28pct);
  background: linear-gradient(
    180deg,
    var(--component-mix-surface-panel-97pct-white-3pct),
    var(--component-mix-surface-panel-84pct-surface-input-16pct)
  );
}

.code-mode-toggle {
  background: var(--component-mix-surface-hover-72pct-surface-panel-28pct);
}

.image-preview-canvas {
  background-color: var(--component-mix-surface-input-90pct-surface-page-10pct);
}

.image-preview-footer {
  background: var(--component-mix-surface-panel-90pct-surface-input-10pct);
}

.git-diff-line-added {
  background: var(--diff-added-bg);
  color: var(--diff-added-fg);
}

.git-diff-line-removed {
  background: var(--diff-deleted-bg);
  color: var(--diff-deleted-fg);
}

.workspace-resolving-pill,
.workspace-resolving-line,
.workspace-resolving-console-line {
  background: var(--component-mix-surface-hover-74pct-surface-panel-26pct);
}

.workspace-resolving-pill::after,
.workspace-resolving-line::after,
.workspace-resolving-console-line::after {
  background: linear-gradient(
    90deg,
    transparent,
    var(--component-mix-status-info-fg-16pct-white-22pct),
    transparent
  );
}

/* PRD §18 / Visual Spec: Slide In — translateX 100% → 0 with opacity */
@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Dismiss animation */
.toast--dismiss {
  opacity: 0;
  transform: translateX(40px);
}

/* Mobile: full-width toasts */
@media (max-width: 640px) {
  .toast-container {
    left: var(--sp-3);
    right: var(--sp-3);
    bottom: var(--sp-3);
    max-width: none;
  }

  .toast-container--mobile {
    top: calc(env(safe-area-inset-top, 0px) + var(--sp-3));
    right: 50%;
    bottom: auto;
    left: 50%;
    width: min(calc(100vw - var(--sp-6)), 480px);
    transform: translateX(-50%);
  }
}

/* ─── Session-card focus pulse ──────────────────────────────────────────
 * Applied for ~1.4s when a notification (toast click or system push) brings
 * the user back to a specific session. The double-pulse is intentional —
 * a single ring is easy to miss when the user has just regained focus on
 * the tab, two read as "look here". outline + box-shadow combo lets us
 * cheat past container clipping that would otherwise hide a pure shadow.
 */
.session-card--focus-pulse {
  animation: session-card-focus-pulse 1.4s ease-out 1;
  position: relative;
  z-index: var(--z-inline-raised);
}

@keyframes session-card-focus-pulse {
  0% {
    outline: 2px solid var(--session-focus-pulse-color);
    outline-offset: -2px;
    box-shadow: 0 0 0 0 var(--component-mix-session-focus-pulse-color-60pct-transparent);
  }
  35% {
    outline: 2px solid var(--session-focus-pulse-color);
    outline-offset: -2px;
    box-shadow: 0 0 0 8px var(--component-mix-session-focus-pulse-color-0pct-transparent);
  }
  60% {
    outline: 2px solid var(--session-focus-pulse-color);
    outline-offset: -2px;
    box-shadow: 0 0 0 0 var(--component-mix-session-focus-pulse-color-45pct-transparent);
  }
  100% {
    outline: 2px solid transparent;
    outline-offset: -2px;
    box-shadow: 0 0 0 12px var(--component-mix-session-focus-pulse-color-0pct-transparent);
  }
}

@media (prefers-reduced-motion: reduce) {
  .session-card--focus-pulse {
    animation: none;
    outline: 2px solid var(--session-focus-pulse-color);
    outline-offset: -2px;
  }
}

/* ========== Topbar Terminal Toggle ========== */
.topbar-btn--active {
  color: var(--text-primary);
  background: var(--component-mix-surface-panel-78pct-status-info-fg-22pct);
  box-shadow: var(--shadow-sm);
}

.topbar-btn--active:hover {
  background: var(--component-mix-surface-panel-70pct-status-info-fg-30pct);
}

.topbar-btn--muted {
  opacity: 0.72;
  color: var(--text-tertiary);
  background: var(--component-mix-surface-panel-88pct-transparent-12pct);
}

.topbar-btn--muted:hover {
  opacity: 1;
  color: var(--text-secondary);
}

/* ========== Config File Editor (Enhanced) ========== */

/* Card Container */
.config-card {
  margin-top: var(--space-default);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-panel);
  overflow: hidden;
  box-shadow: none;
}

.config-card--fill-height {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}

/* Header */
.config-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: transparent;
  border-bottom: 1px solid var(--border-default);
  cursor: default;
  user-select: none;
  transition: background-color 0.15s ease;
}

.config-card-header:hover {
  background: var(--component-mix-surface-panel-92pct-surface-hover-8pct);
}

.config-card-title {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1;
  gap: var(--sp-2);
  color: var(--text-primary);
}

.config-card-title svg {
  flex-shrink: 0;
}

.config-card-path {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
}

.config-card-header-right {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: var(--sp-3);
}

/* Status Indicator */
.config-status {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: var(--sp-1);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  white-space: nowrap;
}

.config-status__icon {
  display: inline-flex;
  align-items: center;
}

.config-status--success {
  color: var(--icon-success);
}

.config-status--warning {
  color: var(--icon-warning);
}

.config-status--info {
  color: var(--icon-info);
}

.config-status--error {
  color: var(--icon-error);
}

/* Body */
.config-card-body {
  display: flex;
  flex-direction: column;
  background: transparent;
}

.config-card-body--fill-height {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.config-card-body--fill-height > .monaco-host {
  flex: 1;
  min-height: 0;
}

.config-card-body--fill-height > .config-card-actions {
  flex: 0 0 auto;
}

/* Monaco Editor */
.config-card-body .monaco-host {
  min-height: 200px;
  max-height: 600px;
  border-bottom: 1px solid var(--border-default);
}

.config-card-body--fill-height .monaco-host {
  flex: 1;
  min-height: 0;
  max-height: none;
}

/* Actions */
.config-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: var(--sp-3) var(--sp-4);
  background: transparent;
  border-top: 1px solid var(--border-default);
  gap: var(--sp-3);
}

.config-actions-left,
.config-actions-center,
.config-actions-right {
  display: flex;
  min-width: 0;
  gap: var(--sp-2);
}

.config-actions-left {
  flex: 0 0 auto;
  align-items: center;
}

.config-actions-center {
  flex: 1;
  justify-content: center;
}

.config-actions-right {
  flex: 0 1 auto;
  flex-wrap: wrap;
  margin-left: auto;
  justify-content: flex-end;
}

/* Empty State */
.config-empty-state {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: var(--sp-6) var(--sp-5);
  text-align: left;
  min-height: 200px;
}

.config-empty-icon {
  width: 24px;
  height: 24px;
  margin-bottom: var(--sp-2);
  font-size: var(--text-sm);
}

.config-empty-title {
  font-size: var(--type-heading-5-size);
  line-height: var(--type-heading-5-line-height);
  font-weight: var(--type-heading-5-weight);
  color: var(--text-primary);
  margin-bottom: var(--sp-1);
}

.config-empty-desc {
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--type-body-3-weight);
  color: var(--text-secondary);
  max-width: 44ch;
}

/* Loading State */
.config-card-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: var(--text-tertiary);
}

/* Error State */
.config-card-error {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 200px;
  padding: var(--sp-5);
  border-top: 1px solid var(--border-default);
  background: var(--component-mix-status-danger-fg-10pct-surface-panel);
}

.config-card-error-message {
  color: var(--text-primary);
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--type-body-3-weight);
}

@media (max-width: 640px) {
  .config-card {
    margin-top: var(--sp-3);
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .config-card-header,
  .config-card-actions {
    padding-left: var(--sp-4);
    padding-right: var(--sp-4);
  }

  .config-empty-state,
  .config-card-error {
    padding-left: var(--sp-4);
    padding-right: var(--sp-4);
  }

  .config-card-actions {
    align-items: center;
  }

  .config-actions-right {
    justify-content: flex-start;
  }
}

/* Spin Animation */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* ========== Branch Quick Pick ========== */
.branch-quick-pick {
  width: 100%;
  max-width: 540px;
  background: var(--surface-panel);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: slideInUp var(--duration-normal) var(--ease-out);
}

.branch-quick-pick-search {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border-default);
}

.branch-quick-pick-input {
  flex: 1;
  background: transparent;
  border: none;
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--type-body-3-weight);
  color: var(--text-primary);
  outline: none;
}

.branch-quick-pick-input::placeholder {
  color: var(--text-tertiary);
}

.branch-quick-pick-list {
  max-height: 320px;
  overflow-y: auto;
}

.branch-quick-pick-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out);
}

.branch-quick-pick-item:hover,
.branch-quick-pick-item-selected {
  background: var(--surface-hover);
}

.branch-quick-pick-check {
  flex-shrink: 0;
  color: var(--status-success-fg);
}

.branch-quick-pick-name {
  flex: 1;
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--type-body-3-weight);
  color: var(--text-primary);
}

.branch-quick-pick-badge {
  flex-shrink: 0;
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  padding: var(--sp-1) var(--sp-2);
  background: var(--surface-hover);
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
}

.branch-quick-pick-create-icon {
  flex-shrink: 0;
  color: var(--status-info-fg);
}

.branch-quick-pick-create-label {
  flex: 1;
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--type-body-3-weight);
  color: var(--text-primary);
}

.branch-quick-pick-empty {
  padding: var(--sp-8);
  text-align: center;
  color: var(--text-tertiary);
}

.branch-quick-pick-hint {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-2) var(--sp-4);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
  color: var(--text-tertiary);
  border-top: 1px solid var(--border-default);
}

.branch-quick-pick-hint span {
  padding: var(--sp-1) var(--sp-2);
  background: var(--surface-hover);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
}

/* ========== Mobile Shell ========== */
@media (max-width: 899px), (pointer: coarse) {
  .mobile-shell {
    --mobile-safe-top: env(safe-area-inset-top, 0px);
    --mobile-safe-right: env(safe-area-inset-right, 0px);
    --mobile-safe-bottom: env(safe-area-inset-bottom, 0px);
    --mobile-safe-left: env(safe-area-inset-left, 0px);
    --mobile-keyboard-inset: 0px;
    --mobile-shell-motion-enter-duration: 220ms;
    --mobile-shell-motion-press-duration: 100ms;
    --mobile-shell-motion-surface-duration: 160ms;
    display: flex;
    flex-direction: column;
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
    background:
      radial-gradient(circle at top left, var(--component-rgba-108-182-255-0-12), transparent 36%),
      var(--workspace-page-surface);
  }

  .mobile-topbar {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--sp-3);
    padding: calc(var(--mobile-safe-top) + var(--sp-1)) calc(var(--mobile-safe-right) + var(--sp-4))
      var(--sp-1) calc(var(--mobile-safe-left) + var(--sp-4));
    background: var(--material-shell-topbar);
    border-bottom: 1px solid var(--component-mix-border-default-84pct-transparent);
    backdrop-filter: var(--material-backdrop-filter);
  }

  .mobile-topbar__workspace-button,
  .mobile-topbar__icon-button,
  .mobile-dock__item,
  .mobile-workspace-drawer__item,
  .mobile-workspace-drawer__footer-button,
  .mobile-sheet__back,
  .page-header__back {
    min-height: var(--touch-target-large);
  }

  .mobile-topbar__workspace-button {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    min-width: 0;
    width: 100%;
    min-height: 36px;
    height: 36px;
    padding: 0 var(--sp-3);
    border: none;
    border-bottom: none;
    border-radius: 0;
    background: var(--component-mix-surface-panel-24pct-transparent);
    color: var(--text-primary);
  }

  .mobile-topbar__workspace-leading {
    flex-shrink: 0;
    color: var(--component-mix-text-secondary-88pct-status-info-fg-12pct);
  }

  .mobile-topbar__workspace-name {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--type-body-3-size);
    line-height: var(--type-body-3-line-height);
    font-weight: var(--type-body-3-weight);
  }

  .mobile-topbar__session-switcher {
    position: relative;
    min-width: 0;
  }

  .mobile-topbar__session-switcher--empty {
    display: flex;
    align-items: center;
    min-width: 0;
  }

  .mobile-topbar__session-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-2);
    width: min(44vw, 180px);
    max-width: 100%;
    min-height: 40px;
    padding: 0 var(--sp-2);
    border: 1px solid transparent;
    border-radius: var(--radius-lg);
    background: transparent;
    color: var(--text-primary);
  }

  .mobile-topbar__session-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
  }

  .mobile-topbar__session-label {
    font-size: var(--type-body-6-size);
    line-height: var(--type-body-6-line-height);
    font-weight: var(--type-body-6-weight);
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }

  .mobile-topbar__session-name,
  .mobile-topbar__session-empty {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--type-body-3-size);
    line-height: var(--type-body-3-line-height);
    font-weight: var(--type-body-3-weight);
  }

  .mobile-topbar__session-empty {
    color: var(--text-secondary);
  }

  .mobile-topbar__session-dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--text-tertiary);
  }

  .mobile-topbar__session-dot--running,
  .mobile-topbar__session-dot--idle {
    background: var(--status-info-fg);
  }

  .mobile-topbar__session-dot--starting {
    background: var(--status-warning-fg);
  }

  .mobile-topbar__session-dot--ended {
    background: var(--status-warning-fg);
  }

  .mobile-topbar__actions {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
  }

  .mobile-shell__recovery-strip {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: var(--sp-3) calc(var(--mobile-safe-right) + var(--sp-4)) 0
      calc(var(--mobile-safe-left) + var(--sp-4));
    padding: var(--sp-3);
    border: 1px solid var(--component-mix-status-warning-fg-36pct-border-default);
    border-radius: var(--radius-xl);
    background: var(--component-mix-status-warning-fg-12pct-surface-panel);
    color: var(--text-primary);
    transform: translateY(-8px);
    opacity: 0;
    animation: mobile-shell-recovery-enter var(--mobile-shell-motion-enter-duration) var(--ease-out)
      forwards;
  }

  .mobile-shell__recovery-strip--rejected {
    border-color: var(--component-mix-status-danger-fg-42pct-border-default);
    background: var(--component-mix-status-danger-fg-10pct-surface-panel);
  }

  .mobile-shell__recovery-title {
    font-size: var(--type-body-3-size);
    line-height: var(--type-body-3-line-height);
    font-weight: var(--type-body-3-weight);
  }

  .mobile-shell__recovery-body {
    font-size: var(--type-body-5-size);
    line-height: var(--type-body-5-line-height);
    font-weight: var(--type-body-5-weight);
    color: var(--text-secondary);
  }

  .mobile-topbar__icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    min-width: 36px;
    min-height: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-primary);
    transition:
      background-color var(--mobile-shell-motion-surface-duration) var(--ease-out),
      border-color var(--mobile-shell-motion-surface-duration) var(--ease-out),
      color var(--mobile-shell-motion-surface-duration) var(--ease-out),
      transform var(--mobile-shell-motion-press-duration) var(--ease-out),
      box-shadow var(--mobile-shell-motion-surface-duration) var(--ease-out);
  }

  .mobile-inline-sheet {
    position: absolute;
    top: calc(100% + var(--sp-2));
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
    padding: var(--sp-2) var(--sp-2) var(--sp-3);
    border: 1px solid var(--component-mix-border-default-88pct-transparent);
    border-radius: var(--radius-xl);
    background: linear-gradient(
      180deg,
      var(--component-mix-surface-panel-98pct-transparent) 0%,
      var(--component-mix-surface-page-98pct-transparent) 100%
    );
    box-shadow: var(--shadow-md);
    transform: translateY(-6px) scale(0.985);
    transform-origin: top center;
    opacity: 0;
    animation: mobile-shell-surface-pop var(--mobile-shell-motion-enter-duration) var(--ease-out)
      forwards;
    z-index: calc(var(--z-sticky) + 2);
  }

  .mobile-inline-sheet__handle {
    align-self: center;
    width: 36px;
    height: 4px;
    border-radius: var(--radius-full);
    background: var(--component-mix-text-tertiary-24pct-transparent);
  }

  .mobile-inline-sheet__header {
    display: block;
    padding: 0 var(--sp-1);
  }

  .mobile-inline-sheet__header .mobile-page-header {
    gap: var(--sp-2);
  }

  .mobile-inline-sheet__body {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
  }

  .mobile-select-sheet--inline {
    display: flex;
    flex: 1;
    min-height: 0;
    flex-direction: column;
    background: transparent;
  }

  .mobile-inline-sheet__body > .mobile-select-sheet {
    flex: 1;
    min-height: 0;
  }

  .mobile-inline-sheet__actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--sp-2);
  }

  .mobile-inline-sheet__action,
  .mobile-inline-sheet__provider,
  .mobile-inline-sheet__option {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    width: 100%;
    min-height: 44px;
    padding: 0 var(--sp-3);
    border: 1px solid var(--component-mix-border-default-86pct-transparent);
    border-radius: var(--radius-md);
    background: var(--component-mix-surface-panel-90pct-transparent);
    color: var(--text-primary);
    text-align: left;
    transition:
      background-color var(--mobile-shell-motion-surface-duration) var(--ease-out),
      border-color var(--mobile-shell-motion-surface-duration) var(--ease-out),
      color var(--mobile-shell-motion-surface-duration) var(--ease-out);
  }

  .mobile-inline-sheet__action--active,
  .mobile-inline-sheet__option--active {
    border-color: var(--component-mix-status-info-fg-46pct-border-default);
    background: var(--component-mix-status-info-fg-12pct-surface-panel);
  }

  .mobile-inline-sheet__action--danger {
    color: var(--component-mix-status-danger-fg-84pct-text-primary);
  }

  .mobile-inline-sheet__action[disabled],
  .mobile-inline-sheet__provider[disabled] {
    opacity: 0.55;
  }

  .mobile-inline-sheet__providers,
  .mobile-inline-sheet__list {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
  }

  .mobile-inline-sheet__provider {
    min-height: 52px;
    padding-block: var(--sp-2);
  }

  .mobile-inline-sheet__provider-icon,
  .mobile-inline-sheet__option-copy,
  .mobile-inline-sheet__provider-copy {
    min-width: 0;
  }

  .mobile-inline-sheet__provider-copy,
  .mobile-inline-sheet__option-copy {
    display: flex;
    flex: 1;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
  }

  .mobile-inline-sheet__provider-title,
  .mobile-inline-sheet__option-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--type-body-3-size);
    line-height: var(--type-body-3-line-height);
    font-weight: var(--type-body-3-weight);
  }

  .mobile-inline-sheet__provider-meta,
  .mobile-inline-sheet__option-meta,
  .mobile-inline-sheet__empty {
    font-size: var(--type-body-5-size);
    line-height: var(--type-body-5-line-height);
    font-weight: var(--type-body-5-weight);
    color: var(--text-secondary);
  }

  .mobile-inline-sheet__empty {
    padding: var(--sp-2) var(--sp-1) 0;
  }

  .mobile-topbar__session-sheet {
    left: auto;
    right: 0;
    width: min(82vw, 320px);
  }

  .mobile-shell__viewport {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    padding: 0;
    border-top: 1px solid var(--component-mix-border-default-42pct-transparent);
  }

  .mobile-shell__content {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 4px;
    min-height: 0;
    overflow: hidden;
  }

  .mobile-shell__agent-stage,
  .mobile-shell__agent-empty {
    display: flex;
    flex: 1;
    min-height: 0;
    min-width: 0;
  }

  .mobile-shell__agent-stage > .session-card {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    flex-direction: column;
    border: none;
    border-radius: 0;
    box-shadow: none;
  }

  .mobile-shell__agent-stage .session-terminal {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
  }

  .mobile-shell__agent-stage .session-progress {
    display: none;
  }

  .mobile-shell__agent-stage .xterm-host-shell,
  .mobile-shell__agent-stage .xterm-host {
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
  }

  .mobile-shell__agent-empty {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: clamp(34px, 9vh, 72px) var(--sp-4) var(--sp-3);
    border: none;
    background: transparent;
    box-shadow: none;
  }

  .mobile-shell__empty-content {
    position: relative;
    display: flex;
    width: min(100%, 320px);
    flex-direction: column;
    align-self: flex-start;
    gap: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
  }

  .mobile-shell__empty-content--flat {
    width: min(100%, 320px);
  }

  .mobile-shell__empty-state {
    width: 100%;
    align-items: flex-start;
    justify-content: center;
    gap: var(--sp-3);
    min-height: 0;
    padding: 0;
    text-align: left;
    display: flex;
    flex-direction: column;
  }

  .mobile-shell__empty-heading {
    display: flex;
    width: 100%;
    flex-direction: column;
    gap: 0;
  }

  .mobile-shell__empty-title {
    margin: 0;
    color: var(--text-primary);
    font-size: var(--type-heading-5-size);
    line-height: var(--type-heading-5-line-height);
    font-weight: var(--type-heading-5-weight);
    letter-spacing: -0.03em;
  }

  .mobile-shell__placeholder-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sp-2);
    max-width: 18ch;
    color: var(--text-secondary);
    text-align: left;
  }

  .mobile-shell__placeholder-copy p {
    margin: 0;
    font-size: var(--type-body-3-size);
    line-height: var(--type-body-3-line-height);
    font-weight: var(--type-body-3-weight);
  }

  .mobile-shell__empty-action-row {
    display: flex;
    width: 100%;
    justify-content: flex-start;
    margin-top: 0;
  }

  .mobile-shell__empty-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    width: auto;
    min-width: 136px;
    padding: 0 var(--sp-4);
    font-size: var(--type-body-3-size);
    line-height: var(--type-body-3-line-height);
    font-weight: var(--font-medium);
    border: 1px solid var(--component-mix-status-info-fg-34pct-border-default);
    border-radius: 12px;
    background: var(--component-mix-status-info-fg-8pct-surface-panel);
    color: var(--text-primary);
    transition:
      background-color var(--mobile-shell-motion-surface-duration) var(--ease-out),
      border-color var(--mobile-shell-motion-surface-duration) var(--ease-out),
      color var(--mobile-shell-motion-surface-duration) var(--ease-out),
      transform var(--mobile-shell-motion-press-duration) var(--ease-out),
      box-shadow var(--mobile-shell-motion-surface-duration) var(--ease-out);
  }

  .mobile-shell__bottom-stack {
    position: sticky;
    bottom: 0;
    z-index: calc(var(--z-sticky) + 1);
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0 0 var(--mobile-keyboard-inset) 0;
    border-top: 1px solid var(--component-mix-border-default-84pct-transparent);
    background: var(--material-overlay);
    backdrop-filter: var(--material-backdrop-filter);
    transition: padding-bottom var(--mobile-shell-motion-enter-duration) var(--ease-out);
  }

  .mobile-dock-shell {
    position: relative;
    padding: 3px calc(var(--mobile-safe-right) + var(--sp-4)) 0
      calc(var(--mobile-safe-left) + var(--sp-4));
  }

  .mobile-supervisor-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    min-height: var(--touch-target-min);
    max-width: 100%;
    padding: 0 var(--sp-3);
    border: 1px solid var(--component-mix-status-info-fg-28pct-border-default);
    border-radius: var(--radius-full);
    background: var(--component-mix-status-info-fg-10pct-surface-panel);
    color: var(--text-primary);
    line-height: 1;
    transition:
      background-color var(--mobile-shell-motion-surface-duration) var(--ease-out),
      border-color var(--mobile-shell-motion-surface-duration) var(--ease-out),
      transform var(--mobile-shell-motion-press-duration) var(--ease-out),
      box-shadow var(--mobile-shell-motion-surface-duration) var(--ease-out);
  }

  .mobile-supervisor-badge__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
  }

  .mobile-supervisor-badge__icon .themed-icon {
    display: inline-flex;
  }

  .mobile-supervisor-badge__icon svg {
    display: block;
  }

  .mobile-supervisor-badge__label {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--type-body-6-size);
    line-height: var(--type-body-6-line-height);
    font-weight: var(--type-body-6-weight);
  }

  .mobile-shell__agent-stage .session-card {
    background: var(--surface-page);
  }

  .mobile-shell__agent-stage > .session-card > .panel-header {
    padding: 4px calc(var(--mobile-safe-right) + var(--sp-3)) 4px
      calc(var(--mobile-safe-left) + var(--sp-3));
    gap: var(--sp-2);
    background: var(--component-mix-surface-page-96pct-surface-panel-4pct);
    border-bottom: 1px solid var(--component-mix-border-default-74pct-transparent);
  }

  .mobile-shell__agent-stage .session-header-accessory {
    min-width: 0;
    max-width: 100%;
  }

  .mobile-shell__agent-stage .session-header-right {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
  }

  .mobile-shell__agent-stage .session-title-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex-wrap: nowrap;
  }

  .mobile-shell__agent-stage .session-provider-badge,
  .mobile-shell__agent-stage .session-state-badge {
    height: 15px;
    padding: 0 5px;
    border-radius: 3px;
    font-size: var(--type-body-6-size);
    line-height: var(--type-body-6-line-height);
    font-weight: var(--type-body-6-weight);
    flex-shrink: 0;
    max-width: 100%;
  }

  .mobile-shell__agent-stage .mobile-supervisor-badge {
    min-height: 26px;
    max-width: 100%;
    padding: 0 8px;
    border-radius: 4px;
    border-color: var(--component-mix-border-default-78pct-status-info-fg-22pct);
    background: var(--component-mix-status-info-fg-6pct-surface-page-94pct);
  }

  .mobile-shell__agent-stage .mobile-supervisor-badge__label {
    max-width: 100%;
    font-size: var(--type-body-6-size);
    line-height: var(--type-body-6-line-height);
    font-weight: var(--type-body-6-weight);
  }

  .mobile-dock {
    position: static;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--sp-2);
    min-height: 36px;
    padding: 0 0 var(--sp-1);
    background: transparent;
    border-top: none;
    border-bottom: none;
  }

  .mobile-dock__item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    height: 36px;
    gap: 4px;
    padding: 1px var(--sp-2) 0;
    border: none;
    border-top: 1px solid transparent;
    border-radius: 0;
    background: transparent;
    color: var(--text-tertiary);
    transition:
      background-color var(--mobile-shell-motion-surface-duration) var(--ease-out),
      border-color var(--mobile-shell-motion-surface-duration) var(--ease-out),
      color var(--mobile-shell-motion-surface-duration) var(--ease-out),
      transform var(--mobile-shell-motion-press-duration) var(--ease-out),
      box-shadow var(--mobile-shell-motion-surface-duration) var(--ease-out);
  }

  .mobile-dock__item--active {
    border-top-color: var(--component-mix-status-info-fg-72pct-transparent);
    background: transparent;
    color: var(--text-primary);
  }

  .mobile-dock__item--active::before {
    content: none;
  }

  .mobile-dock__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: currentColor;
  }

  .mobile-dock__icon svg {
    width: 17px;
    height: 17px;
  }

  .mobile-dock__label {
    font-size: var(--type-body-6-size);
    line-height: var(--type-body-6-line-height);
    font-weight: var(--type-body-6-weight);
  }

  .mobile-sheet-layer,
  .mobile-drawer-layer {
    position: fixed;
    inset: 0;
    z-index: var(--z-sheet);
  }

  .mobile-sheet-layer__backdrop,
  .mobile-drawer-layer__backdrop {
    position: absolute;
    inset: 0;
    background: var(--overlay-backdrop);
    opacity: 0;
    animation: mobile-shell-backdrop-enter var(--mobile-shell-motion-enter-duration) var(--ease-out)
      forwards;
  }

  .mobile-sheet {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
    min-height: min(72dvh, 560px);
    padding: var(--sp-3) calc(var(--mobile-safe-right) + var(--sp-4))
      calc(var(--sp-5) + var(--mobile-safe-bottom)) calc(var(--mobile-safe-left) + var(--sp-4));
    border: 1px solid var(--component-mix-border-default-86pct-transparent);
    border-bottom: none;
    border-top-left-radius: var(--radius-xl);
    border-top-right-radius: var(--radius-xl);
    background: var(--surface-panel);
    box-shadow: none;
    transform: translateY(18px);
    opacity: 0;
    animation: mobile-shell-sheet-enter 260ms var(--ease-out) forwards;
  }

  .mobile-sheet--fullscreen {
    top: 0;
    bottom: 0;
    padding: calc(var(--mobile-safe-top) + var(--sp-2)) var(--mobile-safe-right) 0
      var(--mobile-safe-left);
    border-radius: 0;
  }

  .mobile-sheet__handle {
    align-self: center;
    width: 32px;
    height: 4px;
    border-radius: var(--radius-full);
    background: var(--component-mix-text-tertiary-24pct-transparent);
  }

  .mobile-sheet__header {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .mobile-sheet__body {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
    overflow-y: auto;
  }

  .mobile-sheet {
    gap: 0;
    min-height: min(78dvh, 640px);
    max-height: calc(100dvh - var(--sp-4));
    border: 1px solid var(--component-mix-border-default-86pct-transparent);
    border-bottom: none;
    border-top-left-radius: var(--radius-xl);
    border-top-right-radius: var(--radius-xl);
    box-shadow: none;
  }

  .mobile-sheet.mobile-sheet--fullscreen {
    top: 0;
    bottom: auto;
    height: 100dvh;
    min-height: 0;
    max-height: none;
    padding: calc(var(--mobile-safe-top) + var(--sp-1)) var(--mobile-safe-right) 0
      var(--mobile-safe-left);
    border-radius: 0;
    background: var(--component-mix-surface-page-98pct-surface-panel-2pct);
    overflow: hidden;
  }

  .mobile-sheet__header {
    flex-shrink: 0;
    padding-bottom: var(--sp-4);
  }

  .mobile-sheet--fullscreen .mobile-sheet__header {
    padding: 0 var(--sp-3);
    border-bottom: 1px solid var(--component-mix-border-default-82pct-transparent);
    background: var(--component-mix-surface-page-96pct-surface-panel-4pct);
  }

  .mobile-sheet__header .page-header {
    width: 100%;
  }

  .mobile-sheet--fullscreen .page-header {
    width: 100%;
  }

  .mobile-page-header {
    width: 100%;
    min-height: 44px;
    gap: 0;
  }

  .panel-header {
    min-height: 44px;
  }

  .mobile-page-header .page-header__leading {
    min-width: 0;
    gap: 8px;
  }

  .mobile-page-header .page-header__copy {
    gap: 0;
  }

  .mobile-page-header .page-header__title {
    font-size: var(--type-heading-5-size);
    line-height: var(--type-heading-5-line-height);
    font-weight: var(--type-heading-5-weight);
    letter-spacing: 0.01em;
  }

  .mobile-page-header .page-header__back {
    min-height: var(--control-height-sm);
    padding: 0;
    gap: var(--gap-tight);
    color: var(--component-mix-text-tertiary-88pct-surface-panel);
    font-family: var(--font-mono);
    font-size: var(--type-body-5-size);
    line-height: var(--type-body-5-line-height);
    font-weight: var(--type-body-5-weight);
    letter-spacing: 0.04em;
  }

  .mobile-page-header .page-header__actions {
    align-self: center;
  }

  .mobile-sheet--fullscreen .page-header__back {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
  }

  .mobile-sheet__body {
    display: flex;
    flex: 1;
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    flex-direction: column;
  }

  .mobile-sheet__body > * {
    flex: 1;
    min-width: 0;
    min-height: 0;
  }

  .mobile-sheet__body--flush {
    padding: 0;
  }

  .mobile-sheet__body--fullscreen {
    overflow: hidden;
  }

  .mobile-sheet__footer {
    flex-shrink: 0;
    padding-top: var(--sp-3);
    border-top: 1px solid var(--component-mix-border-default-82pct-transparent);
  }

  .mobile-sheet.mobile-sheet--fullscreen .mobile-sheet__footer {
    padding-bottom: var(--mobile-safe-bottom);
  }

  .mobile-launch-sheet {
    display: flex;
    flex: 1;
    min-height: 0;
    flex-direction: column;
    gap: 0;
    padding: var(--sp-3) var(--sp-4);
    background: linear-gradient(
      180deg,
      var(--component-mix-surface-panel-96pct-transparent) 0%,
      var(--surface-page) 100%
    );
  }

  .mobile-launch-sheet .launch-intro {
    margin-bottom: var(--sp-3);
  }

  .mobile-launch-sheet .launch-body {
    flex: 1;
    min-height: 0;
    padding: 0;
  }

  .mobile-launch-sheet .launch-recent {
    margin-bottom: var(--sp-3);
  }

  .mobile-launch-sheet .folder-picker {
    display: flex;
    flex: 1;
    min-height: 0;
    flex-direction: column;
    padding: var(--sp-3);
    border-radius: var(--radius-xl);
    background: var(--component-mix-surface-panel-92pct-surface-page);
    box-shadow:
      inset 0 1px 0 var(--component-mix-fg-white-8pct-transparent),
      0 10px 30px var(--component-mix-surface-page-42pct-transparent);
  }

  .mobile-launch-sheet .fp-toolbar {
    flex-wrap: wrap;
    gap: var(--sp-2);
    margin-bottom: var(--sp-3);
  }

  .mobile-launch-sheet .fp-root-chips {
    margin-bottom: var(--sp-3);
  }

  .mobile-launch-sheet .fp-create-folder {
    grid-template-columns: 1fr;
    margin-bottom: var(--sp-3);
  }

  .mobile-launch-sheet .fp-create-folder__action,
  .mobile-launch-sheet .fp-create-folder__cancel {
    min-height: 44px;
  }

  .mobile-launch-sheet .folder-picker,
  .mobile-launch-sheet .fp-dir-list,
  .mobile-launch-sheet .directory-loading,
  .mobile-launch-sheet .directory-empty {
    min-height: 0;
  }

  .mobile-launch-sheet .fp-dir-list {
    flex: 1;
    max-height: none;
    padding-bottom: var(--sp-1);
  }

  .mobile-launch-sheet .fp-dir {
    min-height: 44px;
    padding: var(--sp-2) var(--sp-2);
    border-radius: var(--radius-md);
  }

  .mobile-launch-sheet .fp-dir-action {
    margin-left: auto;
  }

  .mobile-launch-sheet__footer {
    display: flex;
    width: 100%;
    padding: var(--sp-2);
    border: 1px solid var(--component-mix-border-default-86pct-transparent);
    border-radius: var(--radius-xl);
    background: var(--component-mix-surface-panel-96pct-surface-page);
    box-shadow: inset 0 1px 0 var(--component-mix-fg-white-6pct-transparent);
  }

  .mobile-launch-sheet__footer > * {
    width: 100%;
  }

  .mobile-launch-sheet__footer .launch-start-btn--mobile {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--component-mix-status-info-fg-52pct-transparent);
    border-radius: var(--radius-md);
    background: var(--component-mix-status-info-fg-86pct-surface-panel);
    font-size: var(--type-body-3-size);
    line-height: var(--type-body-3-line-height);
    font-weight: var(--type-body-3-weight);
    box-shadow: none;
  }

  .mobile-launch-sheet__footer .launch-start-btn--mobile:hover {
    transform: none;
    box-shadow: none;
  }

  .mobile-sheet--launch {
    background: linear-gradient(
      180deg,
      var(--component-mix-surface-panel-96pct-transparent) 0%,
      var(--surface-page) 100%
    );
  }

  .mobile-sheet--launch .mobile-sheet__title {
    margin-top: 0;
    font-size: var(--type-heading-5-size);
    line-height: var(--type-heading-5-line-height);
    font-weight: var(--type-heading-5-weight);
  }

  .mobile-sheet--launch .mobile-sheet__body {
    padding: 0;
  }

  .mobile-sheet--launch .mobile-sheet__footer {
    padding: var(--sp-2) calc(var(--mobile-safe-right) + var(--sp-4))
      calc(var(--mobile-safe-bottom) + var(--sp-4)) calc(var(--mobile-safe-left) + var(--sp-4));
    background: linear-gradient(
      180deg,
      var(--component-mix-surface-page-0pct-transparent) 0%,
      var(--component-mix-surface-panel-96pct-surface-page) 100%
    );
  }

  .mobile-worktree-sheet {
    display: flex;
    min-height: 0;
    flex-direction: column;
  }

  .mobile-worktree-sheet__summary {
    padding: 0 0 var(--sp-3);
  }

  .mobile-worktree-sheet__tabs {
    position: sticky;
    top: 0;
    z-index: var(--z-inline);
    background: var(--surface-panel);
  }

  .mobile-worktree-sheet__content {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }

  .mobile-worktree-sheet__content .worktree-content {
    flex: 1;
    min-height: 0;
  }

  .command-palette-sheet-layer {
    gap: 0;
    background: linear-gradient(
      180deg,
      var(--component-mix-surface-panel-96pct-transparent) 0%,
      var(--surface-page) 100%
    );
  }

  .command-palette-sheet__meta {
    padding: var(--sp-2) var(--sp-4) var(--sp-3);
  }

  .command-palette-sheet {
    gap: var(--sp-2);
  }

  .command-palette-sheet .command-palette-search {
    margin: 0 var(--sp-4);
    padding: 0 var(--sp-3);
    min-height: 46px;
    border: 1px solid var(--component-mix-border-default-80pct-transparent);
    border-radius: var(--radius-xl);
    background: var(--component-mix-surface-panel-88pct-surface-page);
    box-shadow:
      inset 0 1px 0 var(--component-mix-fg-white-5pct-transparent),
      0 12px 28px var(--component-mix-surface-page-20pct-transparent);
  }

  .command-palette-sheet .command-palette-search-icon {
    color: var(--component-mix-text-secondary-86pct-status-info-fg-14pct);
  }

  .command-palette-sheet .command-palette-input {
    font-size: var(--type-body-3-size);
    line-height: var(--type-body-3-line-height);
    font-weight: var(--type-body-3-weight);
  }

  .command-palette-sheet .command-palette-hint {
    padding: 0;
    border-bottom: none;
  }

  .command-palette-sheet .command-palette-meta {
    font-family: var(--font-mono);
    font-size: var(--type-body-5-size);
    line-height: var(--type-body-5-line-height);
    font-weight: var(--type-body-5-weight);
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .command-palette-list {
    flex: 1;
    max-height: none;
    padding: 0 var(--sp-3) var(--sp-4);
  }

  .command-palette-item {
    align-items: flex-start;
    gap: var(--sp-3);
    padding: var(--sp-3);
    border: 1px solid var(--component-mix-border-default-74pct-transparent);
    border-radius: var(--radius-xl);
    background: var(--component-mix-surface-panel-74pct-transparent);
    box-shadow: inset 0 1px 0 var(--component-mix-fg-white-4pct-transparent);
  }

  .command-palette-item + .command-palette-item {
    margin-top: var(--sp-2);
  }

  .command-palette-item:hover,
  .command-palette-item-selected {
    background: var(--component-mix-status-info-fg-10pct-surface-panel);
    border-color: var(--component-mix-status-info-fg-30pct-border-default);
  }

  .command-palette-item-content {
    flex: 1;
    min-width: 0;
    gap: var(--gap-micro);
  }

  .command-palette-item-label {
    font-size: var(--type-body-3-size);
    line-height: var(--type-body-3-line-height);
    font-weight: var(--type-body-3-weight);
  }

  .command-palette-item-desc {
    line-height: 1.5;
  }

  .command-palette-item-shortcut {
    flex-shrink: 0;
    margin-top: var(--space-micro);
    padding: var(--inset-chip-block) var(--inset-chip-inline);
    border: 1px solid var(--component-mix-border-default-72pct-transparent);
    border-radius: var(--radius-pill);
    background: var(--component-mix-surface-page-76pct-surface-panel-24pct);
    font-size: var(--type-body-5-size);
    line-height: var(--type-body-5-line-height);
    font-weight: var(--type-body-5-weight);
    letter-spacing: 0.06em;
  }

  .mobile-files-sheet,
  .mobile-terminal-sheet,
  .mobile-supervisor-sheet {
    display: flex;
    flex: 1;
    min-height: 0;
    flex-direction: column;
  }

  .mobile-files-sheet {
    gap: var(--sp-3);
    padding: var(--sp-3) var(--sp-3) 0;
    background: linear-gradient(
      180deg,
      var(--component-mix-surface-panel-96pct-transparent) 0%,
      var(--surface-page) 100%
    );
  }

  .mobile-files-sheet__branch-row {
    padding: 0;
    flex-shrink: 0;
  }

  .mobile-files-sheet__branch {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    width: 100%;
    min-width: 0;
    margin-bottom: 0;
    padding: 10px 12px;
    border: 1px solid var(--component-mix-border-default-78pct-transparent);
    border-radius: 16px;
    background: linear-gradient(
      180deg,
      var(--component-mix-surface-panel-90pct-transparent) 0%,
      var(--component-mix-surface-page-92pct-surface-panel-8pct) 100%
    );
    color: var(--text-primary);
    box-shadow:
      inset 0 1px 0 var(--component-mix-fg-white-6pct-transparent),
      0 10px 28px var(--component-mix-surface-page-18pct-transparent);
  }

  .mobile-files-sheet__branch:hover {
    background: linear-gradient(
      180deg,
      var(--component-mix-status-info-fg-8pct-surface-panel) 0%,
      var(--component-mix-status-info-fg-12pct-surface-page) 100%
    );
  }

  .mobile-files-sheet__branch:active {
    transform: none;
  }

  .mobile-files-sheet__branch-icon,
  .mobile-files-sheet__branch-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--component-mix-text-secondary-86pct-status-info-fg-14pct);
  }

  .mobile-files-sheet__branch-copy {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .mobile-files-sheet__branch-label {
    font-family: var(--font-mono);
    font-size: var(--type-body-6-size);
    line-height: var(--type-body-6-line-height);
    font-weight: var(--type-body-6-weight);
    color: var(--text-tertiary);
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .mobile-files-sheet__branch-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: var(--font-mono);
    font-size: var(--type-body-5-size);
    line-height: var(--type-body-5-line-height);
    font-weight: var(--type-body-5-weight);
  }

  .mobile-files-sheet__tabs {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    flex: 1;
    min-width: 0;
  }

  .mobile-files-sheet__content,
  .mobile-files-sheet__detail {
    display: flex;
    flex: 1;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
  }

  .mobile-files-sheet__detail-toolbar {
    display: flex;
    align-items: center;
    padding: 0 var(--sp-1) var(--sp-2);
    flex-shrink: 0;
  }

  .mobile-files-sheet__content > *,
  .mobile-files-sheet__detail > * {
    flex: 1;
    min-width: 0;
    min-height: 0;
  }

  .mobile-sheet--files .mobile-files-sheet,
  .mobile-sheet--files .mobile-files-sheet__detail,
  .mobile-sheet--files .workspace-git-view,
  .mobile-sheet--files .workspace-git-editor,
  .mobile-sheet--files .code-editor,
  .mobile-sheet--files .code-editor-body {
    min-height: 0;
    min-width: 0;
    height: 100%;
    width: 100%;
  }

  .mobile-files-sheet__header {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-3);
    flex-shrink: 0;
  }

  .mobile-files-sheet__back {
    min-width: var(--touch-target-large);
    min-height: var(--touch-target-large);
    padding: 0 var(--sp-3);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-full);
    background: var(--surface-hover);
    color: var(--text-primary);
  }

  .mobile-files-sheet__heading {
    display: flex;
    min-width: 0;
    flex-direction: column;
  }

  .mobile-files-sheet__kicker {
    font-size: var(--type-body-6-size);
    line-height: var(--type-body-6-line-height);
    font-weight: var(--type-body-6-weight);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
  }

  .mobile-files-sheet__title {
    margin: var(--sp-1) 0 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--type-heading-5-size);
    line-height: var(--type-heading-5-line-height);
    font-weight: var(--type-heading-5-weight);
    color: var(--text-primary);
  }

  .mobile-terminal-sheet > .bottom-terminal,
  .mobile-terminal-sheet > .bottom-terminal > .bottom-terminal,
  .mobile-supervisor-sheet > .supervisor-card {
    flex: 1;
    min-height: 0;
  }

  .mobile-terminal-sheet {
    padding: 0;
    gap: 0;
    background: var(--surface-page);
  }

  .mobile-terminal-sheet .bottom-terminal {
    overflow: hidden;
    border: 1px solid var(--component-mix-border-default-82pct-transparent);
    border-radius: 0;
    background: var(--component-mix-surface-input-96pct-surface-page);
    box-shadow: none;
  }

  .mobile-terminal-sheet .terminal-toolbar {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
  }

  .mobile-sheet--files,
  .mobile-sheet--launch {
    background: linear-gradient(
      180deg,
      var(--component-mix-surface-panel-96pct-transparent) 0%,
      var(--surface-page) 100%
    );
  }

  .mobile-sheet--files .mobile-sheet__title,
  .mobile-sheet--terminal .mobile-sheet__title,
  .mobile-sheet--launch .mobile-sheet__title {
    margin-top: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--type-heading-5-size);
    line-height: var(--type-heading-5-line-height);
    font-weight: var(--type-heading-5-weight);
  }

  .mobile-sheet--terminal,
  .mobile-sheet--terminal .mobile-sheet__footer {
    background: var(--surface-page);
  }

  .mobile-sheet--fullscreen .page-header__kicker {
    overflow: hidden;
    max-width: 100%;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: 0.12em;
  }

  .mobile-sheet__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-1);
    min-height: 36px;
    padding: 0 var(--sp-3);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: var(--type-body-3-size);
    line-height: var(--type-body-3-line-height);
    font-weight: var(--type-body-3-weight);
    transition:
      background-color var(--mobile-shell-motion-surface-duration) var(--ease-out),
      color var(--mobile-shell-motion-surface-duration) var(--ease-out);
  }

  .mobile-sheet__action--icon {
    min-width: 36px;
    padding-inline: 0;
  }

  .mobile-sheet__action:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
  }

  .mobile-sheet__action--mode.active {
    background: var(--component-mix-status-info-fg-22pct-transparent);
    color: var(--text-primary);
  }

  .mobile-sheet--files .page-header__actions {
    gap: 4px;
  }

  .mobile-sheet--files .mobile-sheet__action {
    min-height: 34px;
  }

  .mobile-sheet--files .mobile-sheet__action--icon {
    min-width: 34px;
  }

  .mobile-sheet--files .mobile-sheet__body,
  .mobile-sheet--terminal .mobile-sheet__body {
    padding: 0;
  }

  .mobile-sheet--files .mobile-files-sheet__content,
  .mobile-sheet--files .mobile-files-sheet__detail,
  .mobile-sheet--terminal .mobile-terminal-sheet {
    width: 100%;
    padding: 0;
  }

  .mobile-sheet--files .mobile-files-sheet__content,
  .mobile-sheet--files .mobile-files-sheet__detail,
  .mobile-sheet--terminal .mobile-terminal-sheet,
  .mobile-sheet--terminal .bottom-terminal {
    min-height: 0;
  }

  .mobile-sheet--files .workspace-git-view {
    padding: 0;
  }

  .mobile-sheet--files .mobile-files-sheet__content > *,
  .mobile-sheet--files .mobile-files-sheet__detail > * {
    width: 100%;
  }

  .mobile-terminal-sheet--fullscreen,
  .mobile-terminal-sheet--fullscreen .bottom-terminal,
  .mobile-terminal-sheet--fullscreen .bottom-terminal-content,
  .mobile-terminal-sheet--fullscreen .bottom-terminal-xterm {
    flex: 1;
    min-height: 0;
    min-width: 0;
  }

  .bottom-terminal--mobile-fullscreen .terminal-toolbar {
    min-height: 32px;
    padding: 0 var(--sp-2);
    border-radius: 0;
    border-bottom: 1px solid var(--component-mix-border-default-72pct-transparent);
    background: var(--component-mix-surface-page-94pct-surface-panel-6pct);
    gap: 0;
  }

  .bottom-terminal--mobile-fullscreen .terminal-toolbar-mobile-row {
    display: flex;
    align-items: center;
    width: 100%;
    min-width: 0;
    gap: 4px;
  }

  .bottom-terminal--mobile-fullscreen .terminal-selector {
    min-width: 0;
    flex: 1;
    position: relative;
    max-width: none;
  }

  .bottom-terminal--mobile-fullscreen .terminal-selector-btn {
    display: flex;
    width: 100%;
    height: 24px;
    min-height: 24px;
    min-width: 0;
    align-items: center;
    gap: 4px;
    padding: 0 7px;
    justify-content: space-between;
    border-radius: var(--radius-sm);
    border-color: var(--component-mix-border-default-66pct-transparent);
    background: var(--component-mix-surface-page-82pct-surface-panel-18pct);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    letter-spacing: 0.01em;
  }

  .bottom-terminal--mobile-fullscreen .terminal-selector-btn:focus,
  .bottom-terminal--mobile-fullscreen .terminal-selector-btn:focus-visible {
    border-color: var(--component-mix-border-default-62pct-status-info-fg-38pct);
    box-shadow: 0 0 0 1px var(--component-mix-status-info-fg-16pct-transparent);
  }

  .bottom-terminal--mobile-fullscreen .terminal-selector-btn span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
  }

  .bottom-terminal--mobile-fullscreen .terminal-selector-btn .mobile-select-trigger__icon {
    color: var(--text-tertiary);
    transform: scale(0.9);
    transform-origin: center;
  }

  .bottom-terminal--mobile-fullscreen .terminal-selector-btn--static {
    cursor: default;
  }

  .bottom-terminal--mobile-fullscreen .terminal-toolbar-mobile-placeholder {
    flex: 1;
    min-width: 0;
    height: 24px;
    border: none;
    background: transparent;
  }

  .bottom-terminal--mobile-fullscreen .bottom-terminal-tabs {
    padding-inline: var(--sp-3);
    border-bottom-color: var(--component-mix-border-default-74pct-transparent);
    background: var(--component-mix-surface-page-80pct-surface-panel-20pct);
  }

  .bottom-terminal--mobile-fullscreen .bottom-terminal-xterm {
    padding: 0 var(--sp-2) var(--sp-1);
  }

  .bottom-terminal--mobile-fullscreen .bottom-terminal-content {
    overflow: hidden;
  }

  .bottom-terminal--mobile-fullscreen .terminal-toolbar-actions {
    gap: 4px;
  }

  .bottom-terminal--mobile-fullscreen .panel-toolbar-btn {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--component-mix-border-default-54pct-transparent);
    background: var(--component-mix-surface-page-80pct-surface-panel-20pct);
    color: var(--text-tertiary);
    box-shadow: none;
  }

  .bottom-terminal--mobile-fullscreen .panel-toolbar-btn:hover {
    background: var(--component-mix-surface-panel-64pct-status-info-fg-12pct);
    color: var(--text-primary);
  }

  .bottom-terminal--mobile-fullscreen .terminal-selector-sheet {
    top: calc(100% + var(--sp-2));
    left: 0;
    right: auto;
    width: min(100%, 320px);
  }

  .mobile-supervisor-sheet {
    gap: 0;
    padding: 0;
    background: var(--component-mix-surface-page-98pct-surface-panel-2pct);
  }

  .mobile-sheet__body--supervisor-detail {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
  }

  .mobile-supervisor-sheet--detail {
    min-height: min(84dvh, 720px);
  }

  .mobile-supervisor-sheet__detail {
    display: flex;
    flex: 1;
    min-height: 0;
    flex-direction: column;
    gap: var(--sp-3);
    padding: var(--sp-3);
    padding-bottom: var(--sp-4);
    background: transparent;
    overflow: auto;
  }

  .mobile-supervisor-sheet__detail .input,
  .mobile-supervisor-sheet__detail .mobile-select-trigger,
  .mobile-supervisor-sheet__detail .textarea {
    font-size: var(--type-body-6-size);
    line-height: var(--type-body-6-line-height);
    font-weight: var(--type-body-6-weight);
  }

  .mobile-supervisor-sheet__footer {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--sp-2);
  }

  .mobile-supervisor-sheet__footer {
    width: 100%;
    padding: var(--sp-1) var(--sp-2);
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .mobile-supervisor-sheet.mobile-sheet--fullscreen .mobile-sheet__footer {
    padding: var(--sp-1) var(--sp-3) calc(var(--mobile-safe-bottom) + var(--sp-3));
    background: var(--component-mix-surface-page-94pct-surface-panel-6pct);
  }

  .mobile-supervisor-sheet__footer > .btn {
    min-height: 44px;
    box-shadow: none;
  }

  .mobile-supervisor-sheet__footer > * {
    width: 100%;
  }

  .mobile-supervisor-sheet__footer > .btn:hover:not(:disabled) {
    transform: none;
    box-shadow: none;
  }

  .mobile-supervisor-sheet__empty {
    display: flex;
    flex: 1;
    min-height: 0;
    flex-direction: column;
    justify-content: center;
    gap: var(--sp-2);
    padding: var(--sp-4);
    border: 1px dashed var(--border-default);
    border-radius: var(--radius-xl);
    color: var(--text-secondary);
  }

  .mobile-supervisor-sheet__empty h3,
  .mobile-supervisor-sheet__empty p {
    margin: 0;
  }

  .mobile-workspace-drawer {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    width: min(88vw, 388px);
    padding: calc(var(--mobile-safe-top) + var(--sp-3)) calc(var(--mobile-safe-right) + var(--sp-3))
      calc(var(--sp-3) + var(--mobile-safe-bottom)) calc(var(--mobile-safe-left) + var(--sp-3));
    border-right: 1px solid var(--component-mix-border-default-82pct-transparent);
    background: linear-gradient(
      180deg,
      var(--component-mix-surface-panel-96pct-transparent) 0%,
      var(--component-mix-surface-page-94pct-surface-panel-6pct) 100%
    );
    box-shadow: none;
    transform: translateX(-12px);
    opacity: 0;
    animation: mobile-shell-drawer-enter 260ms var(--ease-out) forwards;
  }

  .mobile-workspace-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-3);
    padding: 0 0 var(--sp-3);
    border-bottom: 1px solid var(--component-mix-border-default-82pct-transparent);
  }

  .mobile-workspace-drawer__header-copy {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
    gap: 4px;
  }

  .mobile-workspace-drawer__kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: var(--type-body-6-size);
    line-height: var(--type-body-6-line-height);
    font-weight: var(--type-body-6-weight);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-tertiary);
  }

  .mobile-workspace-drawer__kicker::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--component-mix-status-info-fg-76pct-transparent);
    box-shadow: 0 0 0 3px var(--component-mix-status-info-fg-14pct-transparent);
  }

  .mobile-workspace-drawer__title {
    margin: 0;
    font-size: var(--type-heading-4-size);
    line-height: var(--type-heading-4-line-height);
    font-weight: var(--type-heading-4-weight);
    color: var(--text-primary);
  }

  .mobile-workspace-drawer__dismiss {
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
    border: 1px solid var(--component-mix-border-default-66pct-transparent);
    border-radius: 999px;
    background: var(--component-mix-surface-panel-78pct-surface-page);
    color: var(--text-secondary);
    box-shadow: none;
  }

  .mobile-workspace-drawer__dismiss:hover {
    background: var(--component-mix-surface-hover-84pct-transparent);
    color: var(--text-primary);
  }

  .mobile-workspace-drawer__list {
    display: flex;
    flex: 0 1 auto;
    flex-direction: column;
    gap: var(--sp-2);
    min-height: 0;
    max-height: 100%;
    overflow-y: auto;
    margin: var(--sp-3) 0;
    padding-right: 2px;
    border: none;
    background: transparent;
    box-shadow: none;
  }

  .mobile-workspace-drawer__item {
    display: flex;
    align-items: stretch;
    gap: var(--sp-2);
    padding: var(--sp-2);
    border: 1px solid var(--component-mix-border-default-78pct-transparent);
    border-radius: var(--radius-xl);
    background: linear-gradient(
      180deg,
      var(--component-mix-surface-panel-88pct-transparent) 0%,
      var(--component-mix-surface-page-92pct-surface-panel-8pct) 100%
    );
    box-shadow:
      inset 0 1px 0 var(--component-mix-fg-white-5pct-transparent),
      0 12px 30px var(--component-mix-surface-page-16pct-transparent);
    text-align: left;
    transition:
      background-color var(--mobile-shell-motion-surface-duration) var(--ease-out),
      border-color var(--mobile-shell-motion-surface-duration) var(--ease-out),
      color var(--mobile-shell-motion-surface-duration) var(--ease-out),
      transform var(--mobile-shell-motion-press-duration) var(--ease-out),
      box-shadow var(--mobile-shell-motion-surface-duration) var(--ease-out);
  }

  .mobile-workspace-drawer__item--active {
    background:
      linear-gradient(
        180deg,
        var(--component-mix-status-info-fg-12pct-surface-panel) 0%,
        var(--component-mix-status-info-fg-10pct-surface-page) 100%
      ),
      var(--component-mix-surface-panel-92pct-surface-elevated);
    box-shadow:
      inset 0 1px 0 var(--component-mix-status-info-fg-12pct-transparent),
      0 14px 32px var(--component-mix-status-info-fg-8pct-transparent);
    border-color: var(--component-mix-status-info-fg-28pct-border-default);
  }

  .mobile-workspace-drawer__item-main {
    display: flex;
    flex: 1;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 3px;
    padding: var(--sp-2);
    padding-right: 0;
    text-align: left;
  }

  .mobile-workspace-drawer__item-name-row {
    display: flex;
    width: 100%;
    min-width: 0;
    align-items: center;
    gap: var(--sp-2);
  }

  .mobile-workspace-drawer__item-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    min-width: 32px;
    min-height: 32px;
    margin: auto 0;
    align-self: auto;
    border: 1px solid var(--component-mix-border-default-56pct-transparent);
    border-radius: 999px;
    color: var(--component-mix-status-danger-fg-82pct-text-primary);
    background: var(--component-mix-surface-panel-76pct-transparent);
    transition:
      background-color var(--mobile-shell-motion-surface-duration) var(--ease-out),
      color var(--mobile-shell-motion-surface-duration) var(--ease-out);
  }

  .mobile-workspace-drawer__item-close:hover {
    background: var(--component-mix-status-danger-fg-8pct-transparent);
  }

  .mobile-workspace-drawer__item-name {
    min-width: 0;
    flex: 1;
    color: var(--text-primary);
    font-size: var(--type-body-3-size);
    line-height: var(--type-body-3-line-height);
    font-weight: var(--type-body-3-weight);
  }

  .mobile-workspace-drawer__item-state {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 6px;
    border: 1px solid var(--component-mix-status-info-fg-26pct-transparent);
    border-radius: 999px;
    background: var(--component-mix-status-info-fg-12pct-transparent);
    color: var(--component-mix-status-info-fg-74pct-text-primary);
    font-size: var(--type-body-6-size);
    line-height: var(--type-body-6-line-height);
    font-weight: var(--type-body-6-weight);
    letter-spacing: 0.08em;
    white-space: nowrap;
  }

  .mobile-workspace-drawer__item-path {
    max-width: 100%;
    overflow: hidden;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
    font-size: var(--type-body-5-size);
    line-height: var(--type-body-5-line-height);
    font-weight: var(--type-body-5-weight);
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-workspace-drawer__footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    margin-top: auto;
    padding-top: var(--sp-2);
    border-top: 1px solid var(--component-mix-border-default-78pct-transparent);
  }

  .mobile-workspace-drawer__footer-button {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: var(--sp-2);
    width: 100%;
    min-height: 46px;
    padding: 0 var(--sp-3);
    border: 1px solid var(--component-mix-border-default-78pct-transparent);
    border-radius: var(--radius-md);
    background: var(--component-mix-surface-panel-80pct-transparent);
    color: var(--text-primary);
    font-size: var(--type-body-3-size);
    line-height: var(--type-body-3-line-height);
    font-weight: var(--font-medium);
    transition:
      background-color var(--mobile-shell-motion-surface-duration) var(--ease-out),
      border-color var(--mobile-shell-motion-surface-duration) var(--ease-out),
      color var(--mobile-shell-motion-surface-duration) var(--ease-out),
      transform var(--mobile-shell-motion-press-duration) var(--ease-out),
      box-shadow var(--mobile-shell-motion-surface-duration) var(--ease-out);
  }

  .mobile-workspace-drawer__footer-button:hover {
    background: var(--component-mix-surface-hover-82pct-transparent);
  }

  .mobile-topbar__workspace-button,
  .mobile-topbar__session-button,
  .mobile-topbar__session-option,
  .mobile-supervisor-badge,
  .mobile-dock__item,
  .mobile-sheet__back {
    will-change: transform;
  }

  .mobile-topbar__workspace-button,
  .mobile-sheet__back,
  .page-header__back {
    background: transparent;
    box-shadow: none;
    transition:
      background-color var(--mobile-shell-motion-surface-duration) var(--ease-out),
      border-color var(--mobile-shell-motion-surface-duration) var(--ease-out),
      color var(--mobile-shell-motion-surface-duration) var(--ease-out),
      transform var(--mobile-shell-motion-press-duration) var(--ease-out),
      box-shadow var(--mobile-shell-motion-surface-duration) var(--ease-out);
  }

  .mobile-topbar__workspace-button:hover,
  .mobile-topbar__icon-button:hover,
  .mobile-topbar__session-button:hover,
  .mobile-topbar__session-option:hover,
  .mobile-supervisor-badge:hover,
  .mobile-sheet__back:hover,
  .page-header__back:hover {
    transform: translateY(-1px);
  }

  .mobile-topbar__workspace-button:active,
  .mobile-topbar__icon-button:active,
  .mobile-topbar__session-button:active,
  .mobile-topbar__session-option:active,
  .mobile-supervisor-badge:active,
  .mobile-sheet__back:active,
  .page-header__back:active {
    transform: translateY(1px) scale(0.99);
  }

  .mobile-topbar__session-option--active,
  .mobile-workspace-drawer__item--active {
    box-shadow: 0 10px 22px var(--component-mix-status-info-fg-10pct-transparent);
  }

  .mobile-workspace-drawer__item--active {
    box-shadow:
      inset 0 1px 0 var(--component-mix-status-info-fg-10pct-transparent),
      inset 0 -1px 0 var(--component-mix-status-info-fg-12pct-transparent);
  }

  .mobile-dock__item {
    border: none;
    background: transparent;
    will-change: auto;
  }

  .mobile-dock__item--active {
    box-shadow: none;
  }

  .mobile-topbar__session-option--active .mobile-topbar__session-dot,
  .mobile-supervisor-badge:hover .mobile-supervisor-badge__icon {
    transform: scale(1.05);
  }

  .mobile-shell[data-motion-mode="reduced"] .mobile-shell__recovery-strip,
  .mobile-shell[data-motion-mode="reduced"] .mobile-sheet-layer__backdrop,
  .mobile-shell[data-motion-mode="reduced"] .mobile-drawer-layer__backdrop,
  .mobile-shell[data-motion-mode="reduced"] .mobile-sheet,
  .mobile-shell[data-motion-mode="reduced"] .mobile-workspace-drawer {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .mobile-shell[data-motion-mode="reduced"] .mobile-topbar__workspace-button:hover,
  .mobile-shell[data-motion-mode="reduced"] .mobile-topbar__icon-button:hover,
  .mobile-shell[data-motion-mode="reduced"] .mobile-topbar__session-button:hover,
  .mobile-shell[data-motion-mode="reduced"] .mobile-topbar__session-option:hover,
  .mobile-shell[data-motion-mode="reduced"] .mobile-supervisor-badge:hover,
  .mobile-shell[data-motion-mode="reduced"] .mobile-dock__item:hover,
  .mobile-shell[data-motion-mode="reduced"] .mobile-workspace-drawer__item:hover,
  .mobile-shell[data-motion-mode="reduced"] .mobile-workspace-drawer__footer-button:hover,
  .mobile-shell[data-motion-mode="reduced"] .mobile-sheet__back:hover,
  .mobile-shell[data-motion-mode="reduced"] .page-header__back:hover,
  .mobile-shell[data-motion-mode="reduced"] .mobile-topbar__workspace-button:active,
  .mobile-shell[data-motion-mode="reduced"] .mobile-topbar__icon-button:active,
  .mobile-shell[data-motion-mode="reduced"] .mobile-topbar__session-button:active,
  .mobile-shell[data-motion-mode="reduced"] .mobile-topbar__session-option:active,
  .mobile-shell[data-motion-mode="reduced"] .mobile-supervisor-badge:active,
  .mobile-shell[data-motion-mode="reduced"] .mobile-dock__item:active,
  .mobile-shell[data-motion-mode="reduced"] .mobile-workspace-drawer__item:active,
  .mobile-shell[data-motion-mode="reduced"] .mobile-workspace-drawer__footer-button:active,
  .mobile-shell[data-motion-mode="reduced"] .mobile-sheet__back:active,
  .mobile-shell[data-motion-mode="reduced"] .page-header__back:active,
  .mobile-shell[data-motion-mode="reduced"]
    .mobile-topbar__session-option--active
    .mobile-topbar__session-dot,
  .mobile-shell[data-motion-mode="reduced"]
    .mobile-supervisor-badge:hover
    .mobile-supervisor-badge__icon {
    transform: none;
  }

  .welcome-container--mobile {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    min-height: 100dvh;
    overflow-y: auto;
    padding: calc(env(safe-area-inset-top, 0px) + var(--sp-4))
      calc(env(safe-area-inset-right, 0px) + var(--sp-4))
      calc(env(safe-area-inset-bottom, 0px) + var(--sp-5))
      calc(env(safe-area-inset-left, 0px) + var(--sp-4));
  }

  .welcome-card--mobile {
    width: 100%;
    max-width: none;
    padding: var(--sp-4);
    gap: var(--sp-3);
    border-radius: var(--radius-lg);
    box-shadow: none;
  }

  .welcome-card--mobile.welcome-card--landing {
    min-height: auto;
  }

  .welcome-card--mobile .welcome-layout {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
  }

  .welcome-card--mobile .welcome-flow,
  .welcome-card--mobile .welcome-card__features {
    width: 100%;
    align-self: stretch;
  }

  .welcome-card--mobile .welcome-card__actions {
    align-items: stretch;
  }

  .welcome-card--mobile .welcome-actions-group {
    flex-direction: column;
    align-items: stretch;
  }

  .welcome-card--mobile .welcome-title {
    font-size: var(--type-heading-3-size);
    line-height: var(--type-heading-3-line-height);
    font-weight: var(--type-heading-3-weight);
    letter-spacing: 0;
  }

  .welcome-card--mobile .welcome-body {
    font-size: var(--type-body-5-size);
    line-height: var(--type-body-5-line-height);
    font-weight: var(--type-body-5-weight);
  }

  .welcome-card--mobile .welcome-step-detail {
    max-width: none;
  }

  .welcome-card--mobile .welcome-flow {
    gap: var(--sp-3);
  }

  .welcome-card--mobile .welcome-flow__steps {
    grid-template-columns: 1fr;
    gap: var(--sp-2);
  }

  .welcome-card--mobile .welcome-step-card {
    padding: var(--sp-3);
    gap: var(--sp-2);
  }

  .welcome-card--mobile.diagnostics-card {
    width: 100%;
  }

  .welcome-card--mobile .welcome-support-list {
    grid-template-columns: 1fr;
    gap: var(--sp-2);
  }

  .welcome-card--mobile .welcome-feature {
    align-items: flex-start;
    min-height: 0;
    padding: var(--sp-3);
    border-radius: var(--radius-lg);
    text-align: left;
  }

  .welcome-card--mobile .welcome-feature-text {
    width: 100%;
  }

  .welcome-card--mobile .welcome-btn {
    width: 100%;
    justify-content: center;
    min-width: 0;
    padding-inline: var(--sp-4);
    border-radius: var(--radius-md);
  }

  .auth-screen--mobile {
    padding: calc(env(safe-area-inset-top, 0px) + var(--sp-4))
      calc(env(safe-area-inset-right, 0px) + var(--sp-4))
      calc(env(safe-area-inset-bottom, 0px) + var(--sp-5))
      calc(env(safe-area-inset-left, 0px) + var(--sp-4));
  }

  .auth-card-shell--mobile {
    width: 100%;
    padding: var(--sp-6) var(--sp-4);
    gap: var(--sp-5);
    border-radius: var(--radius-lg);
    box-shadow: none;
  }

  .auth-card-shell--mobile .welcome-title {
    font-size: var(--type-heading-1-size);
    line-height: var(--type-heading-1-line-height);
    font-weight: var(--type-heading-1-weight);
    letter-spacing: 0;
  }

  .auth-card-shell--mobile .welcome-body {
    font-size: var(--type-body-3-size);
    line-height: var(--type-body-3-line-height);
    font-weight: var(--type-body-3-weight);
  }

  .auth-card-shell--mobile .auth-status-panel {
    padding-top: var(--sp-4);
    border-radius: var(--radius-md);
  }

  .diagnostics-page {
    min-height: 100dvh;
    height: 100dvh;
  }

  .diagnostics-page--embedded {
    min-height: auto;
    height: auto;
  }

  .diagnostics-body--mobile {
    display: flex;
    flex: 1;
    min-height: 0;
    flex-direction: column;
  }

  .diagnostics-header {
    padding: calc(var(--mobile-safe-top) + var(--sp-1)) calc(var(--mobile-safe-right) + var(--sp-4))
      var(--sp-1) calc(var(--mobile-safe-left) + var(--sp-4));
    background: linear-gradient(
      180deg,
      var(--component-mix-surface-panel-98pct-transparent) 0%,
      var(--component-mix-surface-page-95pct-surface-panel-5pct) 100%
    );
    border-bottom: 1px solid var(--component-mix-border-default-82pct-transparent);
  }

  .diagnostics-header .mobile-page-header {
    gap: var(--sp-2);
  }

  .diagnostics-header .mobile-page-header .page-header__leading {
    gap: var(--sp-2);
  }

  .diagnostics-header .mobile-page-header .page-header__back {
    min-height: 32px;
    gap: var(--sp-1);
  }

  .diagnostics-content {
    padding: var(--sp-3) var(--sp-4) var(--sp-5);
    padding-bottom: var(--sp-5);
  }

  .diagnostics-content-surface {
    width: 100%;
    min-height: auto;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
  }

  .diagnostics-page--mobile .diagnostics-content {
    padding-left: var(--sp-3);
    padding-right: var(--sp-3);
  }

  .diagnostics-page--embedded.diagnostics-page--mobile .diagnostics-content {
    padding-left: 0;
    padding-right: 0;
  }

  .diagnostics-summary {
    flex-direction: column;
    gap: var(--sp-3);
    padding: var(--sp-4);
    border: 1px solid var(--component-mix-border-default-78pct-transparent);
    border-radius: var(--radius-xl);
    background: linear-gradient(
      180deg,
      var(--component-mix-surface-panel-96pct-surface-page-4pct) 0%,
      var(--component-mix-surface-panel-90pct-status-info-fg-10pct) 100%
    );
    box-shadow: 0 1px 0 var(--component-mix-border-default-36pct-transparent);
  }

  .diagnostics-summary--mobile .diagnostics-summary__copy {
    gap: var(--sp-2);
  }

  .diagnostics-summary--mobile .diagnostics-summary__title {
    font-size: var(--type-heading-3-size);
    line-height: var(--type-heading-3-line-height);
    font-weight: var(--type-heading-3-weight);
    text-wrap: balance;
    white-space: normal;
  }

  .diagnostics-summary--mobile .diagnostics-summary__description {
    max-width: none;
    font-size: var(--type-body-4-size);
    line-height: var(--type-body-4-line-height);
  }

  .diagnostics-actions {
    justify-content: flex-start;
  }

  .diagnostics-toolbar {
    align-items: flex-start;
  }

  .diagnostics-toolbar .btn {
    min-height: 32px;
  }

  .diagnostics-issue {
    padding: var(--sp-4) var(--sp-3);
  }

  .diagnostics-content--mobile {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
  }

  .settings-page--mobile {
    min-height: 100dvh;
    height: 100dvh;
  }

  .settings-body--mobile {
    display: block;
    background: var(--surface-page);
  }

  .settings-body--mobile-detail {
    display: flex;
    flex: 1;
    min-height: 0;
    flex-direction: column;
  }

  .settings-body--mobile.settings-body--fill-height {
    display: flex;
    flex: 1;
    min-height: 0;
    flex-direction: column;
  }

  .settings-content--mobile,
  .settings-content--mobile-root {
    padding: 0;
  }

  .settings-content--mobile {
    padding: var(--sp-4);
    padding-bottom: var(--sp-5);
  }

  .settings-content-surface {
    width: 100%;
  }

  .settings-content--mobile-detail {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
  }

  .settings-page--mobile .settings-content--mobile-root {
    padding-left: var(--sp-3);
    padding-right: var(--sp-3);
  }

  .settings-pills {
    gap: var(--sp-2);
  }

  .settings-pills .settings-pill {
    flex: 1 1 calc(50% - var(--sp-2));
  }

  .settings-info-value {
    justify-self: stretch;
    align-items: flex-start;
    text-align: left;
    max-width: 100%;
    min-width: 0;
  }

  .settings-info-row {
    grid-template-columns: 1fr;
  }

  .settings-content--mobile.settings-content--fill-height {
    flex: 1;
    min-height: 0;
    padding-bottom: var(--sp-4);
  }

  .settings-content--mobile .settings-content-surface {
    min-height: auto;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
  }

  .settings-appearance-asset-summary {
    grid-template-columns: 1fr;
  }

  .settings-appearance-actions {
    justify-content: flex-start;
  }

  .settings-appearance-material-grid {
    grid-template-columns: 1fr;
  }

  .settings-appearance-metric-field .settings-input-compact {
    text-align: left;
  }

  .settings-mobile-root {
    display: flex;
    flex-direction: column;
    gap: var(--sp-5);
    padding: var(--sp-4) 0 var(--sp-4);
  }

  .settings-mobile-group {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
  }

  .settings-mobile-group__title {
    margin: 0;
    padding: 0 var(--sp-1);
    color: var(--text-secondary);
    font-size: var(--type-body-3-size);
    line-height: var(--type-body-3-line-height);
    font-weight: var(--type-body-3-weight);
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .settings-mobile-group__list {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--component-mix-border-default-82pct-transparent);
    border-radius: 12px;
    background: var(--component-mix-surface-panel-92pct-surface-page);
  }

  .settings-mobile-item {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    min-height: 60px;
    padding: var(--sp-3) var(--sp-4);
    border: none;
    border-radius: 0;
    background: transparent;
    text-align: left;
  }

  .settings-mobile-item + .settings-mobile-item {
    border-top: 1px solid var(--component-mix-border-default-72pct-transparent);
  }

  .settings-mobile-item__icon-shell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: var(--radius-xl);
    background: var(--component-mix-icon-surface-subtle-82pct-surface-panel);
    border: 1px solid var(--component-mix-border-default-68pct-transparent);
    flex-shrink: 0;
  }

  .settings-mobile-item__icon {
    display: inline-flex;
    color: var(--icon-secondary);
  }

  .settings-mobile-item__copy {
    display: flex;
    flex: 1;
    min-width: 0;
    flex-direction: column;
    gap: var(--gap-compact);
  }

  .settings-mobile-item__label {
    font-size: var(--type-body-3-size);
    line-height: var(--type-body-3-line-height);
    font-weight: var(--type-body-3-weight);
    color: var(--text-primary);
  }

  .settings-mobile-item__hint {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    color: var(--text-tertiary);
    font-size: var(--type-body-5-size);
    line-height: var(--type-body-5-line-height);
    font-weight: var(--type-body-5-weight);
  }

  .settings-mobile-item__arrow {
    color: var(--text-tertiary);
    flex-shrink: 0;
  }

  .settings-provider-mobile-entry {
    padding-left: var(--sp-4);
    padding-right: var(--sp-4);
  }

  .settings-config-field--inline {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .settings-config-control {
    width: 100%;
    justify-content: flex-start;
  }

  .settings-input-compact {
    width: 100%;
    text-align: left;
  }

  .shortcuts-category-tabs {
    padding: 0 var(--sp-4);
    flex-wrap: wrap;
  }

  .shortcuts-list {
    margin: 0;
  }

  .shortcuts-item {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sp-3);
  }

  .shortcuts-binding {
    width: 100%;
    justify-content: flex-start;
  }

  .shortcuts-key,
  .shortcuts-capture {
    min-width: 0;
    width: 100%;
  }

  .shortcuts-footer {
    padding-left: var(--sp-4);
    padding-right: var(--sp-4);
  }

  .settings-header {
    padding: calc(var(--mobile-safe-top) + var(--sp-1)) calc(var(--mobile-safe-right) + var(--sp-4))
      var(--sp-1) calc(var(--mobile-safe-left) + var(--sp-4));
    background: linear-gradient(
      180deg,
      var(--component-mix-surface-panel-98pct-transparent) 0%,
      var(--component-mix-surface-page-95pct-surface-panel-5pct) 100%
    );
    border-bottom: 1px solid var(--component-mix-border-default-82pct-transparent);
  }

  .settings-page--mobile > .settings-header {
    padding: calc(var(--mobile-safe-top) + var(--sp-1)) calc(var(--mobile-safe-right) + var(--sp-4))
      var(--sp-1) calc(var(--mobile-safe-left) + var(--sp-4));
    background: var(--settings-header-surface);
    backdrop-filter: var(--material-backdrop-filter);
  }

  .settings-header .mobile-page-header {
    gap: var(--sp-2);
  }

  .settings-header .mobile-page-header .page-header__leading {
    gap: var(--sp-2);
  }

  .settings-header .mobile-page-header .page-header__back {
    min-height: 32px;
    gap: var(--sp-1);
  }

  .settings-page--mobile > .settings-header .mobile-page-header .page-header__back {
    min-height: 32px;
    gap: var(--sp-1);
  }

  .settings-footer--mobile {
    min-height: 32px;
    padding: var(--sp-2) calc(var(--mobile-safe-right) + var(--sp-4))
      calc(var(--mobile-safe-bottom) + var(--sp-4)) calc(var(--mobile-safe-left) + var(--sp-4));
    color: var(--text-tertiary);
  }

  .settings-footer--mobile .settings-footer__meta {
    width: 100%;
  }

  .settings-page--mobile > .settings-footer {
    padding: var(--sp-2) calc(var(--mobile-safe-right) + var(--sp-4))
      calc(var(--mobile-safe-bottom) + var(--sp-4)) calc(var(--mobile-safe-left) + var(--sp-4));
  }

  .mobile-shell--landscape-compact .mobile-topbar {
    gap: var(--sp-2);
    padding-top: calc(var(--mobile-safe-top) + var(--sp-1));
    padding-bottom: var(--sp-1);
  }

  .mobile-shell--landscape-compact .mobile-shell__recovery-strip {
    margin-top: var(--sp-2);
    padding: var(--sp-2) var(--sp-3);
  }

  .mobile-shell--landscape-compact .mobile-shell__viewport {
    padding-top: 0;
    padding-bottom: 0;
  }

  .mobile-shell--landscape-compact .mobile-shell__content {
    gap: var(--sp-1);
  }

  .mobile-shell--landscape-compact .mobile-shell__agent-stage,
  .mobile-shell--landscape-compact .mobile-shell__agent-empty {
    border-radius: 0;
  }

  .mobile-shell--landscape-compact .mobile-dock__item {
    min-height: 40px;
  }

  .mobile-shell--landscape-compact .mobile-dock {
    gap: 0;
    padding-bottom: 0;
  }

  .mobile-shell--landscape-compact .mobile-dock__item {
    flex-direction: row;
    gap: var(--sp-2);
    justify-content: center;
    padding: var(--sp-1) var(--sp-2);
  }

  .mobile-shell--landscape-compact .mobile-dock__label {
    font-size: var(--type-body-6-size);
    line-height: var(--type-body-6-line-height);
    font-weight: var(--type-body-6-weight);
  }

  .mobile-shell--landscape-compact .mobile-sheet {
    min-height: min(84dvh, 420px);
    max-height: calc(100dvh - var(--sp-2));
  }

  .mobile-shell--landscape-compact .mobile-sheet--fullscreen {
    height: 100dvh;
    min-height: 0;
    max-height: none;
  }

  .mobile-shell--landscape-compact .mobile-workspace-drawer {
    width: min(74vw, 320px);
  }
}

@keyframes mobile-shell-recovery-enter {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes mobile-shell-surface-pop {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes mobile-shell-backdrop-enter {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes mobile-shell-sheet-enter {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes mobile-shell-drawer-enter {
  from {
    opacity: 0;
    transform: translateX(-18px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.panel-tabs-row {
  display: flex;
  align-items: center;
  gap: var(--gap-default);
  min-width: 0;
  flex-wrap: nowrap;
}

.panel-tabs-row .panel-tabs {
  flex: 1;
  min-width: 0;
}

.git-status-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  min-width: 0;
}

.git-status-bar--inline {
  margin-left: auto;
  flex-shrink: 0;
}

.git-status-bar__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  white-space: nowrap;
}

.git-status-bar__item--changes {
  color: var(--icon-warning);
}

.git-status-bar__value {
  font-variant-numeric: tabular-nums;
}

.git-status-bar__item--actionable {
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 999px;
  transition:
    background var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    opacity var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
}

.git-status-bar__item--actionable:hover:not(:disabled) {
  background: var(--surface-hover);
}

.git-status-bar__item--actionable:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--component-mix-status-info-fg-35pct-transparent);
}

.git-status-bar__item--actionable:disabled {
  cursor: default;
  opacity: 0.55;
}

.git-status-bar__item--ahead {
  color: var(--icon-success);
}

.git-status-bar__item--behind {
  color: var(--icon-info);
}

.git-status-bar__confirm {
  min-width: min(420px, calc(100vw - 32px));
}

/* ========== Workspace File/Git Panel Redesign ========== */
.workspace-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  min-height: var(--desktop-statusbar-height);
  min-width: 0;
  flex-shrink: 0;
  padding: 0 12px;
  border-top: 1px solid var(--component-mix-border-default-62pct-transparent);
  background: var(--workspace-statusbar-surface);
  backdrop-filter: var(--material-backdrop-filter);
}

.workspace-status-bar--flush {
  min-height: 24px;
  padding-inline: 0;
  border-top: none;
  background: transparent;
}

.workspace-status-bar__left,
.workspace-status-bar__right {
  display: flex;
  align-items: center;
  min-width: 0;
}

.workspace-status-bar__left {
  flex: 1 1 auto;
}

.workspace-status-bar__right {
  flex: 0 1 auto;
  justify-content: flex-end;
  margin-left: auto;
}

.workspace-status-bar__left > .git-panel-status-strip {
  min-height: inherit;
  flex: 1;
  min-width: 0;
}

.footer-update-rail {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  gap: var(--gap-tight);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  white-space: nowrap;
}

.footer-update-rail__text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.footer-update-rail__action {
  flex-shrink: 0;
}

.workspace-sidebar-panel {
  display: flex;
  min-height: 0;
  height: 100%;
  flex-direction: row;
  background: var(--workspace-sidebar-surface);
  border-right: 1px solid var(--component-mix-border-default-72pct-transparent);
  backdrop-filter: var(--material-backdrop-filter);
}

.workspace-activity-bar {
  display: flex;
  width: 58px;
  flex-shrink: 0;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 18px 10px;
  border-right: 1px solid var(--border-default);
  border-right-color: var(--component-mix-border-default-72pct-transparent);
  background: var(--workspace-activitybar-surface);
  backdrop-filter: var(--material-backdrop-filter);
}

.workspace-activity-bar__button {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  background: transparent;
  color: var(--text-tertiary);
  transition:
    border-color var(--duration-fast) var(--ease-out),
    background-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out);
}

.workspace-activity-bar__button:hover {
  border-color: var(--component-mix-border-default-72pct-transparent);
  background: var(--surface-hover);
  color: var(--text-secondary);
}

.workspace-activity-bar__button--active {
  border-color: var(--component-mix-border-default-72pct-transparent);
  background: var(--component-mix-status-info-fg-14pct-transparent);
  color: var(--text-primary);
}

.workspace-activity-bar__label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.workspace-sidebar-panel__content {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex: 1;
  background: var(--workspace-content-surface);
}

.workspace-sidebar-view {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

.workspace-sidebar-panel__actions {
  display: inline-flex;
  align-items: center;
  gap: var(--gap-control);
  flex-shrink: 0;
}

.workspace-sidebar-panel__body {
  display: flex;
  min-height: 0;
  min-width: 0;
  flex: 1;
  background: var(--workspace-content-surface);
}

.workspace-sidebar-panel__body--stacked {
  display: grid;
  grid-template-rows: minmax(72px, 0.34fr) minmax(0, 1fr);
  gap: var(--gap-tight);
  padding: 16px 14px 14px;
}

.workspace-sidebar-section {
  display: flex;
  min-height: 0;
  flex-direction: column;
  padding: 0;
  background: transparent;
}

.workspace-sidebar-section + .workspace-sidebar-section {
  padding-top: 10px;
  border-top: 1px solid var(--component-mix-border-default-92pct-transparent);
}

.workspace-sidebar-section--fill {
  flex: 1;
  padding-bottom: 14px;
}

.workspace-sidebar-section__header {
  display: flex;
  min-height: 28px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: var(--sp-1);
}

.workspace-sidebar-section__header-main {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  align-items: center;
  gap: 8px;
}

.workspace-sidebar-section__chevron {
  display: inline-flex;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
}

.workspace-sidebar-section__actions {
  margin-left: auto;
  gap: var(--gap-compact);
}

.workspace-sidebar-section__actions .panel-toolbar-btn {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  padding: 0;
}

.workspace-sidebar-section__title {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  color: var(--text-secondary);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  letter-spacing: 0;
}

.workspace-sidebar-section__count {
  display: inline-flex;
  min-width: 20px;
  height: 20px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  border-radius: var(--radius-pill);
  background: var(--component-mix-status-info-fg-10pct-surface-panel);
  color: var(--status-info-fg);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  font-variant-numeric: tabular-nums;
}

.workspace-sidebar-section__action {
  display: inline-flex;
  min-width: 24px;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border: 1px solid var(--component-mix-border-default-84pct-transparent);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

.workspace-sidebar-section__action:hover:not(:disabled) {
  border-color: var(--component-mix-border-default-72pct-transparent);
  background: var(--surface-hover);
  color: var(--text-primary);
}

.workspace-sidebar-section__action:disabled {
  opacity: 0.45;
}

.workspace-sidebar-control {
  border: 1px solid var(--component-mix-border-default-64pct-transparent);
  border-radius: var(--radius-md);
  background: var(--component-mix-surface-input-82pct-surface-panel-18pct);
  transition:
    border-color var(--duration-fast) var(--ease-out),
    background-color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
}

.workspace-sidebar-control:focus-within {
  border-color: var(--component-mix-border-focus-64pct-transparent);
  box-shadow: inset 0 0 0 var(--state-focus-ring-width)
    var(--component-mix-border-focus-64pct-transparent);
}

.workspace-sidebar-row {
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  transition:
    border-color var(--duration-fast) var(--ease-out),
    background-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
}

.workspace-sidebar-row:hover {
  background: var(--surface-hover);
}

.workspace-sidebar-row--selected:hover {
  background: var(--state-selected-bg);
}

.workspace-sidebar-row:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 var(--state-focus-ring-width)
    var(--component-mix-border-focus-64pct-transparent);
}

.workspace-sidebar-row--selected {
  border-color: var(--state-selected-border);
  background: var(--state-selected-bg);
  color: var(--text-primary);
}

.workspace-open-editors {
  display: flex;
  flex-direction: column;
  gap: var(--gap-micro);
  min-width: 0;
}

.workspace-open-editors__header {
  display: flex;
  min-height: 28px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: var(--sp-1);
}

.workspace-open-editors__header-main {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
}

.workspace-open-editors__toggle {
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  border-radius: var(--radius-md);
  background: var(--component-mix-status-info-fg-10pct-surface-panel);
  color: var(--status-info-fg);
}

.workspace-open-editors__title {
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: var(--gap-compact);
  margin: 0;
  min-width: 0;
  color: var(--text-secondary);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  letter-spacing: 0;
}

.workspace-open-editors__title-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-open-editors__count {
  color: var(--status-info-fg);
}

.workspace-open-editors__close-all {
  margin-left: auto;
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  padding: 0;
  background: transparent;
  color: var(--text-secondary);
}

.workspace-open-editors__close-all:hover:not(:disabled) {
  color: var(--text-primary);
}

.workspace-open-editors__close-all:disabled {
  color: var(--text-muted);
}

.workspace-open-editors__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--gap-compact);
}

.workspace-open-editors__item {
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  min-height: 28px;
  padding: 0 var(--sp-2);
  border-radius: var(--radius-md);
  background: transparent;
  overflow: hidden;
  color: var(--text-secondary);
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-open-editors__item-content {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.workspace-open-editors__item-label {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-open-editors__dirty-indicator {
  display: inline-block;
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  border-radius: 999px;
  background: var(--editor-dirty-indicator-fg);
  box-shadow: 0 0 0 2px var(--component-mix-status-warning-fg-15pct-transparent);
}

.workspace-open-editors__item:hover:not(.workspace-open-editors__item--active) {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.workspace-open-editors__item--active {
  border-color: var(--state-selected-border);
  background: var(--state-selected-bg);
  color: var(--text-primary);
}

.workspace-open-editors__item--active:hover {
  background: var(--state-selected-bg);
  color: var(--text-primary);
}

.workspace-open-editors__item-close {
  flex: 0 0 auto;
  color: var(--text-tertiary);
}

.workspace-quick-jump {
  padding-bottom: var(--sp-3);
}

.workspace-quick-jump__search {
  display: flex;
  align-items: center;
  gap: var(--gap-default);
  min-height: 32px;
  padding: 0 calc(var(--sp-3) - var(--gap-compact));
  border-radius: var(--radius-md);
}

.workspace-quick-jump__input {
  min-width: 0;
  min-height: 32px;
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--type-body-3-weight);
}

.workspace-quick-jump__input::placeholder {
  color: var(--component-mix-text-tertiary-92pct-surface-panel);
}

.workspace-quick-jump__input:focus {
  outline: none;
}

.workspace-quick-jump__results {
  display: flex;
  flex-direction: column;
  padding-top: var(--sp-2);
}

.workspace-quick-jump__item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--gap-compact);
  width: 100%;
  min-height: 40px;
  padding: var(--sp-2) 0;
  background: transparent;
  color: inherit;
  text-align: left;
  transition:
    background-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out);
}

.workspace-quick-jump__item:hover {
  color: var(--text-primary);
}

.workspace-agent-instructions {
  padding-bottom: var(--sp-2);
}

.workspace-agent-instructions__title {
  text-transform: none;
  letter-spacing: 0;
}

.workspace-agent-instructions__header {
  min-height: 28px;
  gap: var(--gap-default);
}

.workspace-agent-instructions__header-main {
  min-width: 0;
  gap: var(--gap-default);
}

.workspace-agent-instructions__title-row {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: var(--gap-compact);
}

.workspace-agent-instructions__toggle {
  border-radius: var(--radius-md);
}

.workspace-agent-instructions__body {
  display: flex;
  flex-direction: column;
  gap: var(--gap-tight);
}

.workspace-agent-instructions__notice {
  margin-top: 0;
}

.workspace-agent-instructions__token-trend {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--gap-tight);
  padding: var(--sp-2);
  overflow: hidden;
  border: 1px solid var(--component-mix-border-default-84pct-transparent);
  border-radius: var(--radius-md);
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--status-success-fg) 5%, transparent),
      transparent 56%
    ),
    var(--surface-panel);
}

.workspace-agent-instructions__token-trend-header {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--gap-tight);
}

.workspace-agent-instructions__token-trend-subtitle {
  margin: 0;
  color: var(--text-tertiary);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
}

.workspace-agent-instructions__token-trend-total {
  flex: 0 0 auto;
  color: var(--status-success-fg);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-6-weight);
  white-space: nowrap;
}

.workspace-agent-instructions__token-trend-skeleton,
.workspace-agent-instructions__token-trend-state {
  display: flex;
  min-height: 56px;
  align-items: center;
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
}

.workspace-agent-instructions__token-trend-skeleton {
  color: var(--text-tertiary);
}

.workspace-agent-instructions__token-trend-chart {
  min-width: 0;
  height: 96px;
}

.workspace-agent-instructions__token-trend-footer {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--gap-compact);
  color: var(--text-tertiary);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
}

.workspace-agent-instructions__group {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--gap-compact);
}

.workspace-agent-instructions__group-header {
  display: flex;
  min-height: 28px;
  align-items: center;
}

.workspace-agent-instructions__group-header-main {
  min-width: 0;
  gap: var(--gap-default);
}

.workspace-agent-instructions__group-toggle {
  border-radius: var(--radius-md);
}

.workspace-agent-instructions__group-title {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: none;
}

.workspace-agent-instructions__status {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--gap-tight);
  padding: var(--sp-1) 0;
}

.workspace-agent-instructions__status-main {
  display: flex;
  width: 100%;
  flex-wrap: wrap;
  min-width: 0;
  align-items: center;
  justify-content: flex-start;
  gap: var(--gap-tight);
}

.workspace-agent-instructions__inline-actions {
  display: inline-flex;
  margin-left: auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--gap-compact);
}

.workspace-agent-instructions__status-pill {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  color: var(--text-primary);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  white-space: nowrap;
  cursor: default;
}

.workspace-agent-instructions__title-help {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  min-width: 18px;
  color: var(--text-tertiary);
  border-radius: var(--radius-pill);
}

.workspace-agent-instructions__title-row .workspace-agent-instructions__title-help {
  width: 18px;
  height: 18px;
  min-width: 18px;
}

.workspace-agent-instructions__actions {
  display: flex;
  flex-direction: column;
  gap: var(--gap-tight);
}

.workspace-agent-instructions__actions-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: var(--gap-compact);
}

.workspace-agent-instructions__compact-action {
  width: 76px;
  min-width: 76px;
}

.workspace-agent-instructions__status-action {
  width: auto;
  min-width: 0;
  height: 24px;
  padding: 0 var(--sp-2);
  border: 1px solid var(--component-mix-border-default-84pct-transparent);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-6-weight);
  white-space: nowrap;
}

.workspace-agent-instructions__system-list {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--gap-compact);
}

.workspace-agent-instructions__system-row {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: var(--gap-tight);
}

.workspace-agent-instructions__system-main {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  flex-direction: column;
  gap: var(--gap-hairline);
}

.workspace-agent-instructions__system-name {
  overflow: hidden;
  color: var(--text-primary);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-agent-instructions__system-path {
  overflow: hidden;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-agent-instructions__system-status,
.workspace-agent-instructions__system-unsupported {
  flex: 0 0 auto;
  color: var(--text-tertiary);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  white-space: nowrap;
}

.workspace-agent-instructions__state {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--type-body-4-size);
  line-height: var(--type-body-4-line-height);
}

.workspace-skills-panel__body {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: var(--sp-3);
}

.workspace-skills-panel__notice {
  margin-top: 0;
}

.workspace-skills-panel__state {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--type-body-4-size);
  line-height: var(--type-body-4-line-height);
}

.workspace-skills-panel__empty {
  min-height: auto;
  padding: var(--sp-2) 0;
  gap: var(--sp-2);
}

.workspace-skills-panel__list {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--gap-compact);
}

.workspace-skills-panel__item {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--gap-compact);
  padding: var(--sp-2);
  border-color: var(--component-mix-border-default-92pct-transparent);
}

.workspace-skills-panel__item-header {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--gap-default);
}

.workspace-skills-panel__item-name {
  min-width: 0;
  overflow: hidden;
  color: var(--text-primary);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--type-body-4-size);
  line-height: var(--type-body-4-line-height);
  font-weight: var(--type-body-4-weight);
}

.workspace-skills-panel__pill {
  flex-shrink: 0;
  cursor: default;
}

.workspace-skills-panel__pill--installed {
  color: var(--status-success-fg);
}

.workspace-skills-panel__pill--installing {
  color: var(--status-info-fg);
}

.workspace-skills-panel__pill--failed {
  color: var(--status-error-fg);
}

.workspace-skills-panel__item-meta {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: var(--gap-compact) var(--gap-default);
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
}

.workspace-skills-panel__item-description,
.workspace-skills-panel__item-error {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
}

.workspace-skills-panel__item-error {
  color: var(--status-error-fg);
}

.workspace-quick-jump__item:focus-visible {
  outline: none;
  border-radius: var(--radius-md);
  box-shadow: inset 0 0 0 var(--state-focus-ring-width)
    var(--component-mix-border-focus-64pct-transparent);
}

.workspace-quick-jump__primary {
  min-width: 0;
  overflow: hidden;
  color: var(--text-primary);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--type-body-3-weight);
}

.workspace-quick-jump__secondary {
  min-width: 0;
  overflow: hidden;
  color: var(--text-tertiary);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
}

.workspace-quick-jump__state {
  margin: 0;
  padding-top: var(--sp-2);
  color: var(--text-tertiary);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
}

.file-tree-shell {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  background: transparent;
}

.file-tree-shell .file-tree-search,
.file-tree-shell .file-tree-search--desktop {
  display: flex;
  align-items: center;
  gap: var(--gap-default);
  margin: var(--space-default) var(--inset-control-inline);
  padding-inline: var(--inset-control-inline);
  min-height: 32px;
  border-radius: var(--radius-md);
}

.file-tree-shell .file-tree-search-input {
  min-height: 30px;
  border-radius: var(--radius-md);
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--type-body-3-weight);
}

.file-tree-shell .file-tree-search-input:focus {
  outline: none;
}

.file-tree-shell .file-tree {
  padding: 0 0 6px;
}

.file-tree-shell .tree-item {
  position: relative;
  gap: var(--gap-tight);
  min-height: 26px;
  margin: 0 var(--gap-tight);
  padding: 3px var(--inset-control-block) 3px var(--inset-row-inline);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  transition:
    border-color var(--duration-fast) var(--ease-out),
    background-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
}

.file-tree-shell .tree-item.selected {
  padding-left: var(--inset-row-inline);
  border: 1px solid var(--state-selected-border);
  background: var(--state-selected-bg);
  color: var(--text-primary);
}

.file-tree-shell .tree-item--context-target {
  background: var(--component-mix-status-info-fg-16pct-transparent);
}

.file-tree-shell .tree-chevron {
  width: 14px;
  height: 14px;
  color: var(--text-tertiary);
}

.file-tree-shell .tree-icon.file {
  color: var(--icon-file-default);
}

.file-tree-shell .tree-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--type-body-3-weight);
}

.file-tree-shell .tree-search-labels {
  gap: var(--gap-hairline);
}

.file-tree-shell .tree-search-path,
.file-tree-shell .tree-empty-hint,
.file-tree-shell .tree-loading {
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
}

.file-tree-shell .tree-item-actions {
  gap: var(--gap-compact);
}

.file-tree-shell .tree-children {
  padding-bottom: var(--gap-compact);
}

.file-tree-empty {
  padding: var(--sp-5) var(--inset-panel);
  color: var(--text-tertiary);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
}

.file-tree-shell--desktop .tree-item-actions {
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease-out);
}

.file-tree-shell--desktop .tree-item--file .tree-item-actions {
  display: none;
}

.file-tree-shell--desktop .tree-item {
  border: 1px solid transparent;
}

.file-tree-shell--desktop .tree-item:hover .tree-item-actions,
.file-tree-shell--desktop .tree-item.selected .tree-item-actions {
  opacity: 1;
}

.workspace-search-panel__controls {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  padding: calc(var(--sp-2) - var(--gap-compact)) var(--sp-3) var(--sp-2);
  border-bottom: 1px solid var(--component-mix-border-default-82pct-transparent);
  background: transparent;
}

.workspace-search-panel__input {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--component-mix-border-default-64pct-transparent);
  border-radius: var(--radius-md);
  background: var(--component-mix-surface-input-82pct-surface-panel-18pct);
  color: var(--text-primary);
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--type-body-3-weight);
  box-shadow: none;
}

.workspace-search-panel__input::placeholder {
  color: var(--component-mix-text-tertiary-92pct-surface-panel);
}

.workspace-search-panel__input.workspace-sidebar-control:focus-within,
.workspace-search-panel__input:focus-visible {
  outline: none;
  border-color: var(--component-mix-border-focus-64pct-transparent);
  box-shadow: inset 0 0 0 var(--state-focus-ring-width)
    var(--component-mix-border-focus-64pct-transparent);
}

.workspace-search-panel__summary {
  color: var(--text-secondary);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
}

.workspace-search-panel__truncate-note {
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
}

.workspace-search-panel__results {
  display: flex;
  min-height: 0;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  overflow-y: auto;
  padding: var(--sp-1) 0 var(--sp-2);
}

.workspace-search-panel__state {
  margin: 0;
  padding: var(--sp-4) var(--sp-3);
  color: var(--text-tertiary);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
}

.workspace-search-panel__state-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--gap-default);
  padding: var(--sp-4) var(--sp-3);
}

.workspace-search-panel__group {
  display: flex;
  flex-direction: column;
}

.workspace-search-panel__group + .workspace-search-panel__group {
  margin-top: var(--sp-1);
}

.workspace-search-panel__group-header {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  align-items: start;
  gap: 0 var(--sp-2);
  width: 100%;
  padding: calc(var(--sp-2) - var(--gap-hairline)) var(--sp-3) var(--gap-tight)
    calc(var(--sp-3) - var(--gap-compact));
  background: transparent;
  color: var(--text-secondary);
  text-align: left;
  box-shadow: inset 0 -1px 0 var(--component-mix-border-default-96pct-transparent);
  transition:
    background-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out);
}

.workspace-search-panel__group-header:hover {
  background: var(--surface-hover);
}

.workspace-search-panel__group-header:focus-visible {
  outline: none;
  background: var(--component-mix-state-selected-bg-76pct-transparent);
  box-shadow:
    inset 0 0 0 var(--state-focus-ring-width) var(--component-mix-border-focus-64pct-transparent),
    inset 0 -1px 0 var(--component-mix-border-default-96pct-transparent);
}

.workspace-search-panel__group-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 18px;
  color: var(--text-tertiary);
}

.workspace-search-panel__group-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--gap-compact);
}

.workspace-search-panel__group-name {
  min-width: 0;
  overflow: hidden;
  color: var(--text-primary);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--type-body-3-weight);
}

.workspace-search-panel__group-path {
  min-width: 0;
  overflow: hidden;
  color: var(--text-tertiary);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
}

.workspace-search-panel__group-count {
  align-self: start;
  padding-top: var(--gap-hairline);
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
}

.workspace-search-panel__matches {
  display: flex;
  flex-direction: column;
  padding-bottom: var(--sp-1);
}

.workspace-search-panel__match {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: baseline;
  gap: var(--sp-2);
  width: 100%;
  padding: var(--sp-1) var(--sp-3) var(--sp-1) calc(var(--control-height-md) + var(--gap-compact));
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-primary);
  text-align: left;
  transition:
    border-color var(--duration-fast) var(--ease-out),
    background-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
}

.workspace-search-panel__match:hover {
  background: var(--surface-hover);
}

.workspace-search-panel__match.workspace-sidebar-row--selected:hover,
.workspace-search-panel__match--active:hover {
  border-color: var(--state-selected-border);
  background: var(--state-selected-bg);
}

.workspace-search-panel__match:focus-visible {
  outline: none;
  background: var(--component-mix-state-selected-bg-76pct-transparent);
  box-shadow: inset 0 0 0 var(--state-focus-ring-width)
    var(--component-mix-border-focus-64pct-transparent);
}

.workspace-search-panel__match--active {
  border-color: var(--state-selected-border);
  background: var(--state-selected-bg);
}

.workspace-search-panel__match--active:focus-visible {
  border-color: var(--state-selected-border);
  background: var(--state-selected-bg);
  box-shadow: inset 0 0 0 var(--state-focus-ring-width)
    var(--component-mix-border-focus-64pct-transparent);
}

.workspace-search-panel__line {
  color: var(--text-tertiary);
  text-align: right;
  font-family: var(--font-mono);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
}

.workspace-search-panel__preview {
  min-width: 0;
  overflow: hidden;
  color: var(--text-primary);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--type-body-3-weight);
}

.workspace-search-panel__preview mark {
  padding: 0;
  border-radius: 2px;
  background: var(--component-mix-status-info-fg-18pct-transparent);
  color: inherit;
}

.workspace-search-panel__match-kind {
  color: var(--text-tertiary);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
}

.workspace-search-panel--mobile {
  background: transparent;
}

.workspace-search-panel--mobile .workspace-search-panel__controls {
  padding-top: 0;
  background: transparent;
}

.skills-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.skills-panel__body {
  min-height: 0;
}

.skills-panel__discover-body {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: var(--gap-compact);
}

.skills-panel__notice {
  margin-bottom: 0;
}

.skills-panel__search {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: var(--gap-compact);
}

.skills-panel__discover {
  padding-bottom: 0;
}

.skills-panel__search-control {
  display: flex;
  align-items: center;
  gap: var(--gap-default);
  min-height: 32px;
  padding: 0 calc(var(--sp-3) - var(--gap-compact));
  border-radius: var(--radius-md);
}

.skills-panel__search-input {
  min-width: 0;
  min-height: 32px;
  flex: 1 1 auto;
  padding: 0;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-primary);
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--type-body-3-weight);
}

.skills-panel__search-input::placeholder {
  color: var(--component-mix-text-tertiary-92pct-surface-panel);
}

.skills-panel__search-input:focus {
  outline: none;
}

.skills-panel__search-results {
  display: flex;
  flex-direction: column;
  min-height: 0;
  gap: var(--gap-compact);
  padding-top: var(--sp-1);
}

.skills-panel__empty {
  min-height: auto;
  padding: var(--sp-1) 0 0;
}

.skills-panel__library {
  overflow-y: auto;
}

.skills-panel__library-list {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  gap: var(--gap-compact);
  padding-top: var(--sp-1);
  overflow-y: auto;
}

.workspace-extension-state-panel__body {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: var(--sp-3);
  overflow-y: auto;
  padding: var(--sp-4) calc(var(--sp-3) + var(--gap-compact)) calc(var(--sp-3) + var(--gap-compact));
}

.workspace-extension-state-panel__title {
  text-transform: none;
}

.workspace-extension-state-panel__summary {
  flex-shrink: 0;
}

.workspace-extension-state-panel__notice {
  margin-top: var(--gap-tight);
}

.workspace-extension-state-panel__empty {
  min-height: auto;
}

.workspace-extension-state-panel__section {
  gap: var(--gap-compact);
}

.workspace-extension-state-panel__section-body {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--gap-compact);
}

.workspace-extension-state-panel__row,
.workspace-extension-state-panel__progress-row,
.workspace-extension-state-panel__quick-action {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--gap-default);
  padding: var(--sp-2);
  border-color: var(--component-mix-border-default-92pct-transparent);
}

.workspace-extension-state-panel__progress-row {
  flex-direction: column;
}

.workspace-extension-state-panel__row-main {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  flex-direction: column;
  gap: var(--gap-compact);
}

.workspace-extension-state-panel__row-head {
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--gap-default);
}

.workspace-extension-state-panel__row-title,
.workspace-extension-state-panel__log-message {
  min-width: 0;
  overflow: hidden;
  color: var(--text-primary);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--type-body-4-size);
  line-height: var(--type-body-4-line-height);
  font-weight: var(--type-body-4-weight);
}

.workspace-extension-state-panel__row-detail,
.workspace-extension-state-panel__meta {
  min-width: 0;
  overflow: hidden;
  color: var(--text-tertiary);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
}

.workspace-extension-state-panel__meta {
  flex-shrink: 0;
  font-family: var(--font-mono);
}

.workspace-extension-state-panel__tag {
  flex-shrink: 0;
}

.workspace-extension-state-panel__log-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  min-width: 0;
  align-items: baseline;
  gap: var(--gap-default);
  padding: var(--sp-2);
  border-color: var(--component-mix-border-default-92pct-transparent);
}

.workspace-extension-state-panel__quick-action .btn {
  flex-shrink: 0;
}

.skills-panel__list-item,
.skill-targets-drawer__card {
  display: flex;
  flex-direction: column;
  gap: var(--gap-default);
  padding: var(--sp-3);
}

.skills-panel__list-item:first-child {
  padding-top: var(--sp-3);
}

.skills-panel__card-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--gap-compact);
  flex: 1 1 auto;
}

.skills-panel__row-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--gap-default);
  min-width: 0;
}

.skills-panel__card-head,
.skills-panel__target-head,
.skill-targets-drawer__card-header {
  display: flex;
  align-items: flex-start;
  gap: var(--gap-compact);
  justify-content: space-between;
}

.skills-panel__card-title,
.skill-targets-drawer__title {
  margin: 0;
  color: var(--text-primary);
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--type-body-3-weight);
}

.skills-panel__card-slug,
.skills-panel__card-description,
.skills-panel__target-path,
.skill-targets-drawer__meta,
.skill-targets-drawer__error {
  margin: 0;
}

.skills-panel__card-slug,
.skills-panel__target-path {
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  overflow-wrap: anywhere;
}

.skills-panel__card-description,
.skill-targets-drawer__meta {
  color: var(--text-secondary);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
}

.skills-panel__card-description--truncated {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.skills-panel__inline-actions,
.skills-panel__target-actions,
.skill-targets-drawer__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--gap-compact);
  flex: 0 0 auto;
}

.skills-panel__summary-row,
.skills-panel__target-details {
  display: flex;
  flex-direction: column;
  gap: var(--gap-compact);
  margin-top: 0;
  padding-top: var(--gap-compact);
  border-top: 1px solid var(--component-mix-border-default-92pct-transparent);
}

.skills-panel__summary-row {
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: var(--gap-control);
  width: 100%;
  min-height: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  text-align: left;
  cursor: pointer;
}

.skills-panel__summary-toggle-icon {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  color: var(--text-tertiary);
}

.skills-panel__summary-tokens {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--gap-control);
}

.skills-panel__summary-token {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 20px;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: var(--surface-hover);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: var(--type-body-6-size);
  line-height: 1.2;
  font-weight: var(--type-body-6-weight);
  cursor: default;
}

.skills-panel__summary-token--mounted {
  border-color: var(--status-success-border);
  background: var(--status-success-bg);
  color: var(--status-success-fg);
}

.skills-panel__summary-token--unmounted {
  border-color: var(--status-warning-border);
  background: var(--status-warning-bg);
  color: var(--status-warning-fg);
}

.skills-panel__summary-token--unconfigured {
  border-color: var(--border-default);
  background: var(--surface-subtle);
  color: var(--text-tertiary);
}

.skills-panel__summary-tooltip {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--gap-compact);
}

.skills-panel__summary-tooltip-title,
.skills-panel__summary-tooltip-line {
  margin: 0;
}

.skills-panel__summary-tooltip-title {
  color: var(--text-primary);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
}

.skills-panel__summary-tooltip-line {
  color: var(--text-secondary);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
}

.skills-panel__target-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--gap-default);
  min-height: 32px;
  padding-top: 0;
  border-top: 0;
}

.skills-panel__target-row:first-child {
  padding-top: 0;
  border-top: 0;
}

.skills-panel__target-copy,
.skill-targets-drawer__copy {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  flex-direction: column;
  gap: var(--gap-compact);
}

.skills-panel__target-head {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.skills-panel__target-name {
  color: var(--text-primary);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
}

@media (max-width: 960px) {
  .workspace-agent-instructions__status {
    gap: var(--gap-tight);
  }

  .workspace-agent-instructions__status-main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: var(--gap-tight);
    width: 100%;
  }

  .skills-panel__row-head,
  .skills-panel__target-row {
    flex-direction: column;
  }

  .skills-panel__inline-actions,
  .skills-panel__target-actions {
    justify-content: flex-start;
  }

  .skills-panel__summary-row {
    align-items: center;
  }
}

.skill-targets-drawer {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.skill-targets-drawer__field {
  display: flex;
  flex-direction: column;
  gap: var(--gap-tight);
}

.skill-targets-drawer__label {
  color: var(--text-secondary);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
}

.skill-targets-drawer__error {
  margin: 0;
  color: var(--status-error-fg);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
}

.mobile-sheet--files .file-tree-shell--mobile .file-tree-search {
  margin: 0;
  min-height: 36px;
  border-radius: var(--radius-md);
  padding-inline: 12px;
}

.mobile-sheet--files .file-tree-shell--mobile .file-tree {
  padding-bottom: 10px;
}

.mobile-sheet--files .file-tree-shell--mobile .tree-item {
  min-height: 40px;
  margin: 0;
  border-radius: var(--radius-md);
  padding-top: 8px;
  padding-bottom: 8px;
}

.mobile-sheet--files .file-tree-shell--mobile .tree-item.selected {
  border: 1px solid var(--state-selected-border);
  background: var(--state-selected-bg);
}

.file-tree-shell--mobile .tree-item-actions {
  display: none;
}

.file-context-menu-layer {
  position: fixed;
  inset: 0;
  z-index: var(--z-dropdown);
}

.file-context-menu {
  min-width: 220px;
  padding: var(--sp-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  background: var(--surface-panel);
  box-shadow: var(--shadow-lg);
}

.file-context-menu__section + .file-context-menu__section {
  margin-top: var(--sp-2);
  padding-top: var(--sp-2);
  border-top: 1px solid var(--component-mix-border-default-80pct-transparent);
}

.file-context-menu__section-title {
  margin: 0 0 var(--sp-1);
  padding-inline: var(--sp-2);
  color: var(--text-tertiary);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.file-context-menu__section-items,
.file-context-menu__sheet-actions {
  display: grid;
  gap: var(--gap-compact);
}

.file-context-menu__item,
.file-context-menu__sheet-action {
  display: flex;
  width: 100%;
  min-height: 40px;
  align-items: center;
  justify-content: flex-start;
  padding: 0 var(--sp-3);
  border: 0;
  border-radius: var(--radius-lg);
  background: transparent;
  color: var(--text-primary);
  text-align: left;
  font: inherit;
}

.file-context-menu__item:hover,
.file-context-menu__item[data-active="true"],
.file-context-menu__sheet-action:hover {
  background: var(--component-mix-surface-hover-92pct-transparent);
}

.file-context-menu__item:disabled,
.file-context-menu__sheet-action:disabled {
  opacity: 0.48;
}

.file-context-menu__item--danger,
.file-context-menu__sheet-action--danger {
  color: var(--status-danger-fg);
}

.file-context-menu__sheet {
  display: grid;
  gap: var(--sp-3);
}

.file-context-menu__sheet-section {
  display: grid;
  gap: var(--sp-2);
}

.file-context-menu__sheet-section h3 {
  margin: 0;
  color: var(--text-tertiary);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
}

.git-panel {
  display: flex;
  min-height: 0;
  min-width: 0;
  height: 100%;
  flex-direction: column;
  background: transparent;
}

.git-panel--desktop {
  width: 100%;
}

.git-panel-scroll {
  display: grid;
  min-height: 0;
  min-width: 0;
  flex: 1;
  grid-template-rows: minmax(112px, 0.36fr) minmax(0, 1fr) minmax(80px, 0.28fr) minmax(64px, 0.22fr);
  gap: var(--gap-tight);
  padding: 0 var(--sp-3) var(--sp-3);
  overflow-y: auto;
}

.git-panel-section,
.git-panel-section-header,
.git-panel-section-body {
  min-width: 0;
  width: 100%;
}

.git-panel-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.git-verification-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-tight);
  min-width: 0;
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--component-mix-current-color-22pct-transparent);
  border-radius: var(--radius-md);
  background: var(--component-mix-current-color-8pct-transparent);
  color: var(--status-info-fg);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
}

.git-verification-banner > span {
  min-width: 0;
  flex: 1;
}

.git-verification-banner button {
  display: inline-flex;
  min-height: var(--control-height-sm);
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0 var(--sp-2);
  border: 1px solid var(--component-mix-current-color-22pct-transparent);
  border-radius: var(--radius-control-sm);
  background: transparent;
  color: inherit;
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
}

.git-verification-banner button:hover {
  background: var(--component-mix-current-color-8pct-transparent);
}

.git-verification-banner--passed {
  color: var(--status-success-fg);
}

.git-verification-banner--failed {
  color: var(--status-danger-fg);
}

.git-verification-banner--queued,
.git-verification-banner--running {
  color: var(--status-info-fg);
}

.git-verification-banner--stopped {
  color: var(--status-warning-fg);
}

.git-panel-section + .git-panel-section {
  padding-top: var(--sp-2);
  border-top: 1px solid var(--component-mix-border-default-92pct-transparent);
}

.git-panel-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 28px;
  margin-bottom: 8px;
}

.git-panel-section-toggle {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex: 1 1 auto;
  width: 100%;
  gap: 8px;
  min-width: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  letter-spacing: 0;
  text-align: left;
}

.git-panel-section-toggle-static {
  pointer-events: none;
}

.git-panel-section-count {
  display: inline-flex;
  min-width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  border-radius: var(--radius-pill);
  background: var(--component-mix-status-info-fg-10pct-surface-panel);
  color: var(--status-info-fg);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  font-variant-numeric: tabular-nums;
}

.git-panel-section-chevron {
  display: inline-flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  background: var(--component-mix-status-info-fg-10pct-surface-panel);
  color: var(--status-info-fg);
  transition: transform var(--duration-fast) var(--ease-out);
}

.git-panel-section-chevron.expanded {
  transform: rotate(180deg);
}

.git-panel-section-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--component-mix-border-default-84pct-transparent);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1;
  font-weight: var(--type-body-6-weight);
}

.git-panel-section-link:hover {
  border-color: var(--component-mix-border-default-72pct-transparent);
  background: var(--surface-hover);
  color: var(--text-primary);
}

.git-panel-section-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  min-width: 0;
}

.git-panel-section-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
  overflow: hidden;
}

.git-panel-empty {
  padding: 12px;
  color: var(--text-tertiary);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
}

.git-worktree-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 28px;
  color: var(--text-secondary);
}

.git-worktree-row__main {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 10px;
  min-height: 28px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: inherit;
  text-align: left;
}

.git-worktree-row__dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex-shrink: 0;
  background: var(--text-tertiary);
}

.git-worktree-row__dot-clean {
  background: var(--component-mix-status-success-fg-78pct-white-22pct);
}

.git-worktree-row__dot-dirty {
  background: var(--component-mix-status-warning-fg-88pct-white-12pct);
}

.git-worktree-row__name,
.git-history-row__title {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--type-body-3-weight);
}

.git-worktree-row__tail {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.git-worktree-row__status,
.git-history-row__meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-tertiary);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
}

.git-history-row__meta {
  font-family: var(--font-mono);
}

.git-worktree-row__chip {
  flex-shrink: 0;
  color: var(--component-mix-status-info-fg-80pct-white-20pct);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
}

.git-worktree-row__delete {
  flex-shrink: 0;
}

.git-commit-block {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--sp-2);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--component-mix-border-default-92pct-transparent);
}

.git-panel--desktop .git-commit-block {
  padding-bottom: var(--sp-2);
}

.git-panel .git-commit-input {
  width: 100%;
  min-height: 64px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--component-mix-border-default-64pct-transparent);
  border-radius: var(--radius-md);
  background: var(--component-mix-surface-input-82pct-surface-panel-18pct);
  color: var(--text-primary);
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--type-body-3-weight);
}

.git-panel--desktop .git-commit-input {
  height: 64px;
  min-height: 64px;
  resize: none;
}

.git-panel .git-commit-input:focus {
  outline: none;
  border-color: var(--component-mix-border-focus-64pct-transparent);
  box-shadow: inset 0 0 0 var(--state-focus-ring-width)
    var(--component-mix-border-focus-64pct-transparent);
}

.git-commit-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.git-commit-primary {
  min-height: 24px;
  border-radius: var(--radius-md);
}

.git-commit-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 0 8px;
  border: 1px solid var(--component-mix-border-default-84pct-transparent);
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1;
  font-weight: var(--type-body-6-weight);
}

.git-commit-primary:disabled {
  opacity: 0.42;
}

.git-panel-groups {
  display: flex;
  min-width: 0;
  width: 100%;
  flex-direction: column;
  gap: 0;
}

.git-panel .git-row {
  position: relative;
  gap: 8px;
  min-height: 32px;
  padding: 0 8px;
  background: transparent;
  transition:
    border-color var(--duration-fast) var(--ease-out),
    background-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
}

.git-panel .git-row:hover {
  background: var(--surface-hover);
}

.git-panel .git-row.active {
  border-color: var(--state-selected-border);
  background: var(--state-selected-bg);
}

.git-row-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
}

.git-row-status-badge-added {
  color: var(--component-mix-status-success-fg-88pct-white-12pct);
}

.git-row-status-badge-modified {
  color: var(--component-mix-status-warning-fg-88pct-white-12pct);
}

.git-row-status-badge-deleted {
  color: var(--component-mix-status-danger-fg-82pct-white-18pct);
}

.git-row-status-badge-renamed {
  color: var(--component-hex-b8a6e0);
}

.git-row-status-badge-untracked {
  color: var(--component-hex-8a8a93);
}

.git-panel .git-row-content {
  min-width: 0;
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1px;
}

.git-panel .git-row-name {
  color: var(--text-primary);
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--type-body-3-weight);
}

.git-panel .git-row-meta {
  display: flex;
  gap: 6px;
  min-width: 0;
  width: 100%;
}

.git-panel .git-row-dir,
.git-panel .git-row-rename {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
}

.git-panel .git-row-actions {
  margin-left: auto;
  display: inline-flex;
  gap: 2px;
}

.git-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  color: var(--text-tertiary);
  font-size: 11px;
  line-height: 1.4;
  font-weight: 500;
}

.git-panel-section-body--changes {
  overflow-y: auto;
}

.git-group-count {
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  background: var(--component-mix-status-info-fg-10pct-surface-panel);
  color: var(--text-secondary);
}

.git-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  line-height: 1.4;
  font-weight: 500;
}

.git-status-badge.staged {
  background: var(--component-mix-status-success-fg-15pct-transparent);
  color: var(--status-success-fg);
}

.git-status-badge.modified {
  background: var(--component-mix-status-warning-fg-15pct-transparent);
  color: var(--status-warning-fg);
}

.git-status-badge.untracked {
  background: var(--component-mix-status-info-fg-15pct-transparent);
  color: var(--status-info-fg);
}

.git-status-badge.deleted {
  background: var(--component-mix-status-danger-fg-15pct-transparent);
  color: var(--status-danger-fg);
}

.git-panel .git-row-action {
  width: 20px;
  height: 20px;
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
}

.git-panel .git-row-action:hover {
  background: var(--surface-hover);
  color: var(--text-secondary);
}

.git-history-row {
  position: relative;
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 34px;
  padding: 0 8px;
  background: transparent;
  color: inherit;
  text-align: left;
  transition:
    border-color var(--duration-fast) var(--ease-out),
    background-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
}

.git-worktree-row__main,
.git-panel .git-row,
.git-history-row {
  border: 1px solid transparent;
  border-radius: var(--radius-md);
}

.git-history-row {
  min-height: 34px;
}

.git-worktree-row.active .git-worktree-row__main,
.git-panel .git-row.active,
.git-history-row.current {
  border-color: var(--state-selected-border);
  background: var(--state-selected-bg);
}

.git-history-row.current {
  color: var(--text-primary);
}

.git-history-row.current {
  border-color: var(--state-selected-border);
  background: var(--state-selected-bg);
  color: var(--text-primary);
}

.git-history-row__dot {
  position: relative;
  width: 7px;
  height: 7px;
  border: 1px solid var(--component-mix-text-tertiary-88pct-transparent);
  border-radius: 999px;
  background: transparent;
}

.git-history-row.current .git-history-row__dot {
  border-color: var(--component-mix-status-info-fg-74pct-transparent);
  background: var(--component-mix-status-info-fg-74pct-transparent);
}

.git-history-row__copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.git-history-row__when {
  color: var(--text-tertiary);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
  font-variant-numeric: tabular-nums;
}

.git-history-load-sentinel {
  display: flex;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
}

.git-history-load-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--sp-2);
}

.git-panel-status-strip {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 24px;
  color: var(--text-tertiary);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
}

.git-panel-status-strip__left {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 6px;
}

.git-panel-status-strip__branch {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  flex: 0 1 auto;
  justify-content: flex-start;
  gap: 4px;
  max-width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
}

.git-panel-status-strip__branch:hover:not(:disabled) {
  color: var(--text-primary);
}

.git-panel-status-strip__branch:disabled {
  cursor: default;
}

.git-panel-status-strip__branch-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.git-panel-status-strip__meta {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  flex: 0 1 auto;
  gap: 6px;
}

.git-panel-status-strip .git-status-bar {
  gap: 4px;
}

.git-panel-status-strip .git-status-bar__item {
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
}

.mobile-files-sheet--root {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

.mobile-files-sheet__segmented {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: var(--sp-3);
  padding: 0 0 var(--sp-2);
  border-bottom: 1px solid var(--component-mix-border-default-78pct-transparent);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.mobile-files-sheet__segment {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--text-tertiary);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  transition: color var(--duration-fast) var(--ease-out);
}

.mobile-files-sheet__segment-icon {
  display: block;
  line-height: 0;
  flex-shrink: 0;
}

.mobile-files-sheet__segment:hover {
  color: var(--text-secondary);
}

.mobile-files-sheet__segment.active {
  background: transparent;
  color: var(--text-primary);
}

.mobile-files-sheet__segment.active::after {
  display: none;
}

.mobile-files-sheet__content,
.mobile-files-sheet__detail {
  display: flex;
  min-height: 0;
  min-width: 0;
  flex: 1;
}

.mobile-files-sheet__content > *,
.mobile-files-sheet__detail > * {
  min-width: 0;
  min-height: 0;
  flex: 1;
}

.mobile-explorer-panel {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

.workspace-page > .workspace-status-bar {
  width: 100%;
}

.mobile-shell__bottom-stack > .workspace-status-bar {
  width: 100%;
  align-self: stretch;
  flex-wrap: wrap;
  gap: 0;
  border: none;
  border-top: 1px solid var(--component-mix-border-default-74pct-transparent);
  border-radius: 0;
  background: transparent;
  padding: 0 0 calc(var(--mobile-safe-bottom) + var(--sp-1));
  box-shadow: none;
}

.mobile-sheet__footer .workspace-status-bar {
  margin-top: calc(var(--sp-3) * -1);
}

.git-panel--mobile .git-panel-scroll {
  gap: var(--sp-3);
  padding: var(--sp-3);
  padding-bottom: calc(var(--sp-4) + var(--mobile-safe-bottom));
}

.git-panel--mobile .git-panel-section-toggle,
.git-panel--mobile .git-panel-section-link {
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
}

.git-panel--mobile .git-panel-section-actions {
  gap: 8px;
}

.git-panel--mobile .git-worktree-row,
.git-panel--mobile .git-worktree-row__main,
.git-panel--mobile .git-row,
.git-panel--mobile .git-history-row {
  min-height: 40px;
  border-radius: var(--radius-md);
}

.git-panel--mobile .git-row {
  padding-right: 8px;
}

.git-panel--mobile .git-row-actions {
  gap: 4px;
}

.git-panel--mobile .git-row-action {
  width: 24px;
  height: 24px;
}

.git-panel--mobile .git-commit-actions {
  justify-content: flex-end;
}

.git-panel--mobile .git-commit-primary {
  min-height: 36px;
  border-radius: 999px;
}

.mobile-shell__bottom-stack .git-panel-status-strip {
  width: 100%;
  gap: 8px;
  min-height: 28px;
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
}

.mobile-shell__bottom-stack .workspace-status-bar__left {
  flex: 1 1 auto;
  padding: 0 calc(var(--mobile-safe-right) + var(--sp-4)) 0
    calc(var(--mobile-safe-left) + var(--sp-4));
}

.mobile-shell__bottom-stack .workspace-status-bar__right {
  flex: 0 0 100%;
  width: 100%;
  max-width: none;
  justify-content: flex-end;
  margin-left: 0;
  padding: 0 calc(var(--mobile-safe-right) + var(--sp-4)) 0
    calc(var(--mobile-safe-left) + var(--sp-4));
  border-top: 1px solid var(--component-mix-border-default-68pct-transparent);
}

.mobile-shell__bottom-stack .workspace-status-bar__right:empty {
  display: none;
}

.mobile-shell__bottom-stack .git-panel-status-strip__left {
  width: 100%;
  gap: 4px;
  justify-content: space-between;
}

.mobile-shell__bottom-stack .git-panel-status-strip__branch,
.mobile-shell__bottom-stack .git-panel-status-strip__meta {
  gap: 4px;
}

.mobile-shell__bottom-stack .git-panel-status-strip__meta {
  margin-left: auto;
  justify-content: flex-end;
}

.mobile-shell__bottom-stack .footer-update-rail {
  width: 100%;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
}

.mobile-shell__bottom-stack .footer-update-rail__text {
  white-space: normal;
}

.mobile-shell__bottom-stack .git-panel-status-strip__branch .themed-icon svg,
.mobile-shell__bottom-stack .git-panel-status-strip__branch svg {
  width: 10px;
  height: 10px;
}

.mobile-shell__bottom-stack .git-panel-status-strip .git-status-bar {
  gap: 3px;
}

.mobile-shell__bottom-stack .git-panel-status-strip .git-status-bar__item {
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
}

.mobile-sheet__footer .git-panel-status-strip {
  min-height: 28px;
  padding-inline: 12px;
}

.mobile-sheet__footer .git-panel-status-strip {
  padding-top: 0;
}

.paste-dialog {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  width: 90%;
  max-width: 24rem;
  padding: var(--sp-4);
  background: var(--surface-panel);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
}

.paste-dialog__title {
  margin: 0;
  font-size: var(--type-heading-4-size);
  line-height: var(--type-heading-4-line-height);
  font-weight: var(--type-heading-4-weight);
  color: var(--text-primary);
}

.paste-dialog__textarea {
  min-height: 6rem;
  padding: var(--sp-3);
  background: var(--surface-page);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
  resize: vertical;
}

.paste-dialog__textarea:focus {
  outline: none;
  border-color: var(--status-info-fg);
  box-shadow: 0 0 0 2px var(--component-mix-status-info-fg-20pct-transparent);
}

.paste-dialog__actions {
  display: flex;
  gap: var(--sp-2);
  justify-content: flex-end;
}

.paste-dialog__button {
  padding: var(--sp-2) var(--sp-4);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--font-medium);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.paste-dialog__button--secondary {
  background: var(--surface-page);
  color: var(--text-secondary);
}

.paste-dialog__button--secondary:hover {
  background: var(--component-mix-surface-panel-50pct-surface-page-50pct);
}

.paste-dialog__button--primary {
  background: var(--status-info-fg);
  color: white;
  border-color: var(--status-info-fg);
}

.paste-dialog__button--primary:hover {
  background: var(--component-mix-status-info-fg-85pct-white);
}

/* ========== Workspace Appearance Personalization ========== */
.workspace-page {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: transparent;
}

.workspace-main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: transparent;
}

.workspace-main-stage > .agent-panes {
  flex: 1;
  min-height: 0;
  padding: 0;
  background: transparent;
}

.workspace-git-view {
  flex: 1;
  min-height: 0;
  padding: 0;
  background: transparent;
}

.editor-pane-card__body {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  padding: 0;
}

.editor-pane-card__content,
.editor-pane-card__content > * {
  min-width: 0;
  min-height: 0;
}

.editor-pane-card__content {
  display: flex;
  flex: 1;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
}

.editor-pane-card__content > * {
  flex: 1;
  border: 0;
  border-radius: 0;
}

.mobile-terminal-sheet {
  padding: 0;
  gap: 0;
  background: transparent;
}

.mobile-sheet--terminal,
.mobile-sheet--terminal .mobile-sheet__footer {
  background: transparent;
}

.left-panel {
  background: transparent;
  border-right: none;
}

.workspace-sidebar-panel {
  background: var(--workspace-sidebar-surface);
  border-right: 1px solid var(--component-mix-border-default-72pct-transparent);
  backdrop-filter: var(--material-backdrop-filter);
}

.workspace-activity-bar {
  display: flex;
  width: 58px;
  flex-shrink: 0;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 18px 10px;
  border-right: 1px solid var(--border-default);
  border-right-color: var(--component-mix-border-default-72pct-transparent);
  background: var(--workspace-activitybar-surface);
  backdrop-filter: var(--material-backdrop-filter);
}

.workspace-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  min-height: var(--desktop-statusbar-height);
  min-width: 0;
  flex-shrink: 0;
  padding: 0 12px;
  border-top: 1px solid var(--component-mix-border-default-62pct-transparent);
  background: var(--workspace-statusbar-surface);
  backdrop-filter: var(--material-backdrop-filter);
}

.workspace-status-bar--flush {
  background: transparent;
  backdrop-filter: none;
}

.workspace-empty-inner,
.workspace-resolving-card {
  background: linear-gradient(
    180deg,
    var(--workspace-editor-toolbar-surface),
    var(--workspace-editor-shell-surface)
  );
  backdrop-filter: var(--material-backdrop-filter);
}

.workspace-git-editor {
  background: var(--workspace-editor-shell-surface);
  border: none;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: var(--material-backdrop-filter);
}

.code-editor-header {
  display: flex;
  align-items: center;
  gap: var(--gap-default);
  min-height: var(--panel-header-height);
  padding: var(--gap-tight) var(--inset-control-inline);
  border-bottom: 1px solid var(--workspace-editor-toolbar-border);
  background: var(--workspace-editor-toolbar-surface);
  backdrop-filter: var(--material-backdrop-filter);
}

.session-card {
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: var(--workspace-session-surface);
  backdrop-filter: var(--material-backdrop-filter);
}

.session-card.session-card--active {
  background: var(--workspace-session-active-surface);
  box-shadow: none;
  position: relative;
  isolation: isolate;
}

.workspace-main-stage .session-card.session-card--active::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: var(--z-inline);
  border: 1px solid var(--component-mix-border-focus-84pct-transparent);
  pointer-events: none;
}

.session-header,
.session-card.session-card--active > .panel-header,
.session-card.session-card--active .session-header {
  padding: var(--gap-tight) var(--inset-control-inline);
  border-bottom: 1px solid var(--border-default);
  background: var(--workspace-session-header-surface);
  backdrop-filter: var(--material-backdrop-filter);
}

.session-card.session-card--active > .panel-header,
.session-card.session-card--active .session-header {
  border-bottom-color: var(--component-mix-border-focus-76pct-transparent);
}

.session-terminal {
  background: transparent;
}

.pane-drop-overlay {
  position: absolute;
  inset: 0;
  z-index: var(--z-inline-raised);
  pointer-events: none;
  border: 1px dashed var(--component-mix-state-info-text-55pct-transparent);
  border-radius: inherit;
  background: var(--component-mix-state-info-bg-12pct-transparent);
}

.pane-drop-overlay::before {
  content: "";
  position: absolute;
  background: var(--component-mix-state-info-text-18pct-transparent);
}

.pane-drop-overlay--left::before {
  inset: 0 auto 0 0;
  width: 24%;
}

.pane-drop-overlay--right::before {
  inset: 0 0 0 auto;
  width: 24%;
}

.pane-drop-overlay--top::before {
  inset: 0 0 auto 0;
  height: 24%;
}

.pane-drop-overlay--bottom::before {
  inset: auto 0 0 0;
  height: 24%;
}

.pane-drop-overlay--center::before,
.pane-drop-overlay--draft::before {
  inset: 22%;
}

.pane-drop-overlay__center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: var(--sp-1) var(--sp-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-pill);
  background: var(--component-mix-surface-elevated-92pct-transparent);
  color: var(--text-primary);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
}

.workspace-sidebar-panel__content,
.workspace-sidebar-view,
.workspace-sidebar-panel__body,
.workspace-body,
.workspace-main-stage,
.agent-panes,
.agent-pane,
.pane-layout,
.pane-layout-child {
  background: var(--workspace-content-surface);
}

.agent-draft-launcher {
  container-type: inline-size;
  background:
    radial-gradient(circle at center, var(--component-rgba-108-182-255-0-06), transparent 32%),
    transparent;
}

.agent-provider-card {
  height: auto;
  min-width: 0;
  align-items: center;
  justify-content: flex-start;
  gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-2);
  border-radius: var(--radius-sm);
  text-align: left;
  white-space: normal;
}

.terminal-toolbar {
  background: var(--workspace-terminal-toolbar-surface);
  backdrop-filter: var(--material-backdrop-filter);
}

.bottom-terminal-tabs {
  background: var(--workspace-terminal-tabs-surface);
  backdrop-filter: var(--material-backdrop-filter);
}

.workspace-bottom-panel > .bottom-terminal,
.workspace-bottom-panel-body > .bottom-terminal {
  border: none;
  border-radius: 0;
  background: var(--workspace-terminal-shell-surface);
  box-shadow: none;
  backdrop-filter: var(--material-backdrop-filter);
}

.bottom-terminal-content,
.bottom-terminal-xterm,
.bottom-terminal-empty {
  background: var(--workspace-content-surface);
}

.mobile-shell__agent-stage .session-card:not(.session-card--active),
.mobile-terminal-sheet .bottom-terminal {
  background: var(--mobile-sheet-file-surface);
  backdrop-filter: var(--material-backdrop-filter);
}

.mobile-sheet--files .file-tree-shell--mobile,
.mobile-sheet--files .git-panel--mobile,
.mobile-sheet--files .workspace-search-panel--mobile,
.mobile-sheet--files .workspace-git-editor,
.mobile-sheet--files .workspace-git-view {
  overflow: hidden;
  border: 1px solid var(--component-mix-border-default-80pct-transparent);
  border-radius: 0;
  background: var(--component-mix-surface-panel-92pct-surface-page);
  box-shadow: none;
}

.mobile-sheet--files .mobile-files-sheet__content {
  padding-top: var(--sp-2);
}

.mobile-sheet--files .workspace-git-view {
  padding: 0;
}

.mobile-terminal-sheet .bottom-terminal {
  overflow: hidden;
  border: 1px solid var(--component-mix-border-default-82pct-transparent);
  border-radius: 0;
  box-shadow: none;
}

.mobile-shell__agent-stage .session-card.session-card--active {
  background: var(--workspace-session-mobile-active-surface);
  box-shadow: none;
  backdrop-filter: var(--material-backdrop-filter);
}

.mobile-shell__agent-stage > .session-card.session-card--active > .panel-header {
  border-top: 1px solid var(--component-mix-border-focus-76pct-transparent);
}

/* Balanced Workbench sidebar runtime alignment. */
.workspace-sidebar-panel {
  --workspace-sidebar-selected-bg: color-mix(in srgb, var(--status-success-fg) 18%, transparent);
  --workspace-sidebar-selected-border: color-mix(
    in srgb,
    var(--status-success-fg) 58%,
    var(--border-default)
  );
  --workspace-sidebar-selected-hover-bg: color-mix(
    in srgb,
    var(--status-success-fg) 22%,
    transparent
  );
  --workspace-sidebar-control-bg: color-mix(in srgb, var(--surface-page) 56%, transparent);
  --workspace-sidebar-control-border: color-mix(in srgb, var(--border-default) 64%, transparent);
  background: color-mix(in srgb, var(--surface-page) 84%, var(--surface-panel) 16%);
  border-right: 1px solid var(--component-mix-border-default-72pct-transparent);
  box-shadow: none;
  backdrop-filter: none;
}

.workspace-activity-bar__button {
  background: transparent;
  border-radius: var(--radius-md);
  color: var(--text-tertiary);
}

.workspace-activity-bar__button--active {
  border-color: var(--component-mix-border-default-72pct-transparent);
  background: var(--component-mix-status-info-fg-14pct-transparent);
  color: var(--text-primary);
}

.workspace-activity-bar__glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
  font-size: 18px;
  line-height: 1;
}

.workspace-sidebar-panel__content > .workspace-sidebar-view > .workspace-sidebar-panel__body {
  overflow-y: auto;
}

.workspace-sidebar-panel__content
  > .workspace-sidebar-view
  > .workspace-sidebar-panel__body--stacked {
  display: flex;
  flex-direction: column;
  gap: var(--gap-tight);
  padding: var(--sp-4) calc(var(--sp-3) + var(--gap-compact)) calc(var(--sp-3) + var(--gap-compact));
}

.workspace-sidebar-panel__content
  > .workspace-sidebar-view
  > .workspace-sidebar-panel__body--stacked
  > .workspace-sidebar-section,
.workspace-sidebar-panel__content
  > .workspace-sidebar-view
  > .workspace-sidebar-panel__body--stacked
  > .workspace-sidebar-section--fill {
  flex: 0 0 auto;
}

.workspace-sidebar-section + .workspace-sidebar-section,
.git-panel-section + .git-panel-section {
  padding-top: var(--gap-compact);
  border-top: 1px solid var(--component-mix-border-default-92pct-transparent);
}

.workspace-sidebar-section__header,
.workspace-open-editors__header,
.git-panel-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  min-height: 28px;
  margin-bottom: var(--gap-compact);
}

.workspace-sidebar-section__title,
.workspace-open-editors__title,
.git-panel-section-toggle {
  color: var(--text-secondary);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.workspace-open-editors__title {
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: var(--gap-compact);
  margin: 0;
  min-width: 0;
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  font-weight: var(--type-body-6-weight);
}

.git-panel-section-toggle {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex: 1 1 auto;
  width: 100%;
  gap: var(--sp-2);
  min-width: 0;
  padding: 0;
  border: none;
  background: transparent;
  text-align: left;
}

.workspace-sidebar-section__chevron,
.workspace-open-editors__toggle,
.git-panel-section-chevron {
  width: 18px;
  height: 18px;
  border-radius: var(--radius-sm);
  background: var(--component-mix-status-info-fg-10pct-surface-panel);
  color: var(--status-info-fg);
}

.workspace-sidebar-section__action,
.git-panel-section-link,
.git-commit-primary {
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--component-mix-border-default-84pct-transparent);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1;
}

.workspace-open-editors__close-all {
  margin-left: auto;
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  padding: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1;
}

.workspace-open-editors__close-all:disabled {
  background: transparent;
  color: var(--text-secondary);
  opacity: 1;
}

.file-tree-shell .file-tree {
  padding: 0;
}

.file-tree-shell .tree-item {
  gap: 8px;
  min-height: 32px;
  margin: 0;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}

.file-tree-shell .tree-item.selected {
  padding-left: var(--inset-row-inline);
  border: 1px solid
    var(
      --workspace-sidebar-selected-border,
      color-mix(in srgb, var(--status-success-fg) 58%, var(--border-default))
    );
  background: var(
    --workspace-sidebar-selected-bg,
    color-mix(in srgb, var(--status-success-fg) 18%, transparent)
  );
  color: var(--text-primary);
}

.file-tree-shell .tree-chevron {
  display: inline-flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--component-mix-status-info-fg-10pct-surface-panel);
  color: var(--status-info-fg);
  font-size: 11px;
}

.file-tree-shell .tree-indent {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.file-tree-shell .tree-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--component-mix-status-success-fg-14pct-transparent);
  color: var(--status-success-fg);
}

.file-tree-shell .tree-icon.file {
  background: color-mix(in srgb, var(--icon-file-data) 14%, transparent);
  color: var(--icon-file-data);
}

.file-tree-shell .tree-icon svg,
.file-tree-shell .tree-icon .themed-icon,
.file-tree-shell .tree-icon.file svg,
.file-tree-shell .tree-icon.file .themed-icon {
  width: 12px;
  height: 12px;
}

.file-tree-shell .tree-label,
.workspace-search-panel__group-name,
.workspace-search-panel__preview,
.git-panel .git-row-name {
  color: var(--text-primary);
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--type-body-3-weight);
}

.file-tree-shell .tree-label,
.git-panel .git-row-name {
  font-weight: var(--type-body-3-weight);
}

.file-tree-shell .tree-symlink-badge {
  display: inline-flex;
  margin-left: 6px;
  color: var(--text-tertiary);
  font-size: var(--type-body-6-size);
  line-height: var(--type-body-6-line-height);
  vertical-align: middle;
}

.file-tree-shell .tree-icon--gitignored,
.file-tree-shell .tree-label--gitignored {
  opacity: 0.5;
}

.file-tree-shell .tree-item.selected .tree-icon--gitignored,
.file-tree-shell .tree-item.selected .tree-label--gitignored {
  opacity: 0.72;
}

.file-tree-shell .tree-active-meta {
  margin-left: auto;
  color: var(--text-tertiary);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
}

.workspace-search-panel__controls {
  --workspace-search-panel-leading-width: 14px;
  --workspace-search-panel-leading-gap: 4px;
  gap: 5px;
  padding: 7px 0 7px;
  border-bottom: none;
  background: transparent;
}

.workspace-search-panel__toolbar,
.workspace-search-panel__replace-row,
.workspace-search-panel__summary,
.workspace-search-panel__group-header-row,
.workspace-search-panel__match-shell,
.workspace-search-panel__match-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.workspace-search-panel__toolbar,
.workspace-search-panel__replace-row,
.workspace-search-panel__details {
  width: 100%;
}

.workspace-search-panel__toolbar {
  display: grid;
  grid-template-columns: var(--workspace-search-panel-leading-width) minmax(0, 1fr);
  align-items: stretch;
  column-gap: var(--workspace-search-panel-leading-gap);
}

.workspace-search-panel__replace-row {
  display: grid;
  grid-template-columns: var(--workspace-search-panel-leading-width) minmax(0, 1fr);
  align-items: stretch;
  column-gap: var(--workspace-search-panel-leading-gap);
}

.workspace-search-panel__leading-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--workspace-search-panel-leading-width);
}

.workspace-search-panel__leading-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--workspace-search-panel-leading-width);
  min-width: var(--workspace-search-panel-leading-width);
  min-height: 23px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-tertiary);
  transition:
    color var(--duration-fast) var(--ease-out),
    opacity var(--duration-fast) var(--ease-out);
}

.workspace-search-panel__leading-toggle:hover,
.workspace-search-panel__leading-toggle--active {
  color: var(--text-secondary);
}

.workspace-search-panel__row-offset {
  width: var(--workspace-search-panel-leading-width);
}

.workspace-search-panel__toolbar .workspace-search-panel__input,
.workspace-search-panel__replace-row .workspace-search-panel__input,
.workspace-search-panel__detail-field .workspace-search-panel__input {
  flex: 1 1 auto;
}

.workspace-search-panel__compound-control {
  display: flex;
  align-items: stretch;
  flex: 1 1 auto;
  min-height: 23px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--border-default) 42%, transparent);
  border-radius: 2px;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--surface-panel) 90%, white 2%),
    color-mix(in srgb, var(--surface-panel) 97%, transparent)
  );
  transition:
    border-color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out),
    background-color var(--duration-fast) var(--ease-out);
}

.workspace-search-panel__compound-control:focus-within {
  border-color: var(--component-mix-border-focus-64pct-transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--status-info-fg) 26%, transparent);
}

.workspace-search-panel__compound-actions {
  display: flex;
  align-items: stretch;
  flex: 0 0 auto;
}

.workspace-search-panel__input {
  min-height: 23px;
  min-width: 0;
  padding: 0 7px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-primary);
  font-size: 12px;
}

.workspace-search-panel__input.workspace-sidebar-control:focus-within,
.workspace-search-panel__input:focus-visible {
  outline: none;
  box-shadow: none;
}

.workspace-search-panel__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.workspace-search-panel__filter {
  display: inline-flex;
  min-height: 23px;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 21px;
  padding: 0 5px;
  border: 0;
  border-left: 1px solid color-mix(in srgb, var(--border-default) 18%, transparent);
  border-radius: 0;
  color: var(--text-tertiary);
  font-size: 10px;
  font-weight: var(--font-normal);
  line-height: 1;
  background: transparent;
  transition:
    color var(--duration-fast) var(--ease-out),
    background-color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    opacity var(--duration-fast) var(--ease-out);
}

.workspace-search-panel__filter--active {
  border-left-color: color-mix(in srgb, var(--status-info-fg) 10%, transparent);
  background: color-mix(in srgb, var(--status-info-fg) 1%, transparent);
  color: var(--status-info-fg);
}

.workspace-search-panel__filter--details {
  border-left-color: color-mix(in srgb, var(--border-default) 14%, transparent);
  background: transparent;
  color: var(--text-secondary);
}

.workspace-search-panel__filter--details.workspace-search-panel__filter--active {
  border-left-color: color-mix(in srgb, var(--status-info-fg) 12%, transparent);
  background: color-mix(in srgb, var(--status-info-fg) 2%, transparent);
  color: var(--status-info-fg);
}

.workspace-search-panel__filter--compact {
  letter-spacing: 0.03em;
}

.workspace-search-panel__filter--icon {
  width: 21px;
  padding: 0;
}

.workspace-search-panel__filter--suffix {
  min-width: 21px;
}

.workspace-search-panel__filter:disabled {
  opacity: 0.5;
}

.workspace-search-panel__inline-icon {
  width: 11px;
  height: 11px;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.workspace-search-panel__summary {
  min-height: 0;
  justify-content: space-between;
  color: var(--text-secondary);
  font-size: var(--type-body-5-size);
  line-height: var(--type-body-5-line-height);
  font-weight: var(--type-body-5-weight);
}

.workspace-search-panel__results {
  flex: 0 0 auto;
  overflow: visible;
  padding: 0;
}

.workspace-search-panel__details {
  display: grid;
  gap: 6px;
  justify-items: stretch;
  padding-inline-start: calc(
    var(--workspace-search-panel-leading-width) +
    var(--workspace-search-panel-leading-gap)
  );
}

.workspace-search-panel__details--collapsed {
  min-height: 23px;
  align-items: center;
  justify-items: end;
}

.workspace-search-panel__details--collapsed .workspace-search-panel__filter--details {
  border: 1px solid color-mix(in srgb, var(--border-default) 20%, transparent);
  border-radius: 2px;
}

.workspace-search-panel__detail-field {
  display: grid;
  gap: 4px;
}

.workspace-search-panel__detail-heading {
  display: inline-flex;
  width: 100%;
  min-height: 20px;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  padding-inline-end: 0;
}

.workspace-search-panel__detail-heading .workspace-search-panel__filter--details {
  min-height: 20px;
  width: 21px;
  min-width: 21px;
  border: 1px solid color-mix(in srgb, var(--border-default) 20%, transparent);
  border-radius: 2px;
  background: color-mix(in srgb, var(--surface-hover) 18%, transparent);
}

.workspace-search-panel__detail-label {
  color: var(--text-tertiary);
  font-size: 10px;
  line-height: 1.2;
  font-weight: var(--font-normal);
  letter-spacing: 0.02em;
}

.workspace-search-panel__error {
  margin: 0;
  color: var(--status-danger-fg);
  font-size: var(--type-body-5-size);
}

.workspace-search-panel__group {
  border-top: 1px solid var(--component-mix-border-default-92pct-transparent);
  padding-top: 6px;
}

.workspace-search-panel__group + .workspace-search-panel__group {
  margin-top: var(--gap-tight);
}

.workspace-search-panel__group-header {
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--sp-2);
  min-height: 30px;
  padding: 0 var(--gap-compact);
  background: transparent;
  box-shadow: none;
  color: var(--text-secondary);
}

.workspace-search-panel__group-header:hover {
  background: transparent;
}

.workspace-search-panel__group-copy {
  display: block;
}

.workspace-search-panel__group-name {
  font-weight: var(--font-normal);
}

.workspace-search-panel__group-path {
  display: none;
}

.workspace-search-panel__group-count {
  padding-top: 0;
  color: var(--text-tertiary);
  font-family: inherit;
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--font-normal);
}

.workspace-search-panel__group-count-a11y {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.workspace-search-panel__matches {
  gap: var(--sp-1);
  padding: 2px 0 var(--sp-1);
}

.workspace-search-panel__group-header-row {
  justify-content: space-between;
}

.workspace-search-panel__match {
  grid-template-columns: 28px minmax(0, 1fr) auto;
  min-height: 32px;
  gap: var(--sp-2);
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
}

.workspace-search-panel__match-shell {
  align-items: stretch;
  justify-content: space-between;
}

.workspace-search-panel__match-copy {
  display: grid;
  gap: 4px;
}

.workspace-search-panel__replacement,
.workspace-search-panel__replacement-preview {
  color: var(--text-secondary);
  font-size: var(--type-body-5-size);
}

.workspace-search-panel__replacement-preview mark {
  background: color-mix(in srgb, var(--status-success-fg) 18%, transparent);
  color: var(--status-success-fg);
}

.workspace-search-panel__match-actions {
  flex-shrink: 0;
  align-self: center;
}

.workspace-sidebar-row--selected,
.file-tree-shell .tree-item.selected,
.workspace-search-panel__match--active,
.git-panel .git-row.active,
.git-history-row.current,
.git-worktree-row.active .git-worktree-row__main {
  border-color: var(
    --workspace-sidebar-selected-border,
    color-mix(in srgb, var(--status-success-fg) 58%, var(--border-default))
  );
  background: var(
    --workspace-sidebar-selected-bg,
    color-mix(in srgb, var(--status-success-fg) 18%, transparent)
  );
  color: var(--text-primary);
}

.file-tree-shell .tree-item.selected {
  padding-left: var(--inset-row-inline);
  border-color: var(
    --workspace-sidebar-selected-border,
    color-mix(in srgb, var(--status-success-fg) 58%, var(--border-default))
  );
  background: var(
    --workspace-sidebar-selected-bg,
    color-mix(in srgb, var(--status-success-fg) 18%, transparent)
  );
  color: var(--text-primary);
}

.workspace-sidebar-row--selected:hover,
.workspace-search-panel__match.workspace-sidebar-row--selected:hover,
.workspace-search-panel__match--active:hover,
.git-panel .git-row.active:hover,
.git-history-row.current:hover,
.git-worktree-row.active .git-worktree-row__main:hover {
  border-color: var(
    --workspace-sidebar-selected-border,
    color-mix(in srgb, var(--status-success-fg) 58%, var(--border-default))
  );
  background: var(
    --workspace-sidebar-selected-hover-bg,
    color-mix(in srgb, var(--status-success-fg) 22%, transparent)
  );
}

.workspace-search-panel__line {
  color: var(--text-secondary);
  text-align: left;
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--type-body-3-weight);
}

.workspace-search-panel__preview mark {
  padding: 0 2px;
  background: var(--component-mix-status-info-fg-18pct-transparent);
}

.workspace-search-panel__match-kind {
  display: none;
}

.git-panel-scroll {
  display: flex;
  min-height: 0;
  min-width: 0;
  flex: 1 1 auto;
  flex-direction: column;
  gap: var(--gap-tight);
  padding: var(--sp-4) calc(var(--sp-3) + var(--gap-compact)) calc(var(--sp-3) + var(--gap-compact));
  overflow-y: auto;
}

.git-panel--desktop {
  min-height: 0;
  height: 100%;
}

.git-commit-block {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--sp-2);
  padding-bottom: 0;
  border-bottom: none;
}

.git-panel .git-commit-input {
  min-height: 64px;
  border-color: var(
    --workspace-sidebar-control-border,
    color-mix(in srgb, var(--border-default) 64%, transparent)
  );
  border-radius: var(--radius-sm);
  background: var(
    --workspace-sidebar-control-bg,
    color-mix(in srgb, var(--surface-page) 72%, transparent)
  );
}

.git-panel .git-commit-input:focus {
  outline: none;
  border-color: var(
    --workspace-sidebar-control-border,
    color-mix(in srgb, var(--border-default) 64%, transparent)
  );
  box-shadow: inset 0 0 0 var(--state-focus-ring-width)
    var(--component-mix-border-default-72pct-transparent);
}

.git-commit-primary:disabled {
  opacity: 1;
  color: var(--text-secondary);
}

.git-panel-section-actions {
  gap: var(--sp-2);
}

.git-panel-section-actions .git-panel-section-link:not(:last-child),
.git-panel-section-changes .git-panel-section-actions .git-panel-section-link:not(:first-child) {
  display: none;
}

.git-panel .git-row {
  min-height: 32px;
  gap: var(--sp-2);
  padding: 0 var(--sp-2);
  border-radius: var(--radius-sm);
}

.git-panel .git-row:first-child:not(.active) {
  border-color: var(
    --workspace-sidebar-selected-border,
    color-mix(in srgb, var(--status-success-fg) 58%, var(--border-default))
  );
  background: var(
    --workspace-sidebar-selected-bg,
    color-mix(in srgb, var(--status-success-fg) 18%, transparent)
  );
}

.git-panel .git-row-icon,
.git-panel .git-row-status-icon {
  display: none;
}

.git-panel .git-row-actions {
  display: inline-flex;
}

.git-panel .git-row-content {
  flex-direction: column;
  align-items: stretch;
  gap: 1px;
}

.git-panel .git-row-dir,
.git-panel .git-row-rename {
  color: var(--text-tertiary);
  font-family: inherit;
  font-size: var(--type-body-3-size);
  line-height: var(--type-body-3-line-height);
  font-weight: var(--type-body-3-weight);
}

.git-status-badge {
  order: -1;
  width: 28px;
  height: 24px;
  padding: 0;
  border-radius: var(--radius-pill);
  font-size: 12px;
  line-height: 1.4;
  font-weight: var(--type-body-6-weight);
}

.git-status-badge.untracked {
  background: var(--component-mix-status-success-fg-15pct-transparent);
  color: var(--status-success-fg);
}

.git-panel-section-body--changes {
  gap: 4px;
  overflow: visible;
  max-height: none;
}

.git-panel-section-history {
  min-height: 0;
}

.git-panel-section-body--history {
  gap: 4px;
  min-height: 0;
  overflow: visible;
}

.git-panel-section-chevron.expanded {
  transform: none;
}

.git-commit-primary svg {
  display: none;
}

/* Final mobile balanced-workbench alignment. */
.mobile-sheet--files {
  background: var(--surface-page);
}

.mobile-sheet--files .mobile-sheet__header {
  border-bottom: 1px solid var(--component-mix-border-default-78pct-transparent);
}

.mobile-sheet--files .mobile-sheet__body {
  padding: 0;
  background: var(--surface-page);
}

.mobile-sheet--files .mobile-files-sheet {
  min-height: 0;
  background: var(--surface-page);
}

.mobile-sheet--files .mobile-files-sheet__segmented {
  gap: 10px;
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--component-mix-border-default-92pct-transparent);
}

.mobile-sheet--files .mobile-files-sheet__tabs {
  width: 100%;
}

.mobile-sheet--files .mobile-files-sheet__segment {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  min-height: 38px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text-tertiary);
}

.mobile-sheet--files .mobile-files-sheet__segment:hover {
  background: transparent;
  color: var(--text-secondary);
}

.mobile-sheet--files .mobile-files-sheet__segment.active {
  border-color: var(--component-mix-border-default-72pct-transparent);
  background: var(--component-mix-status-info-fg-14pct-transparent);
  color: var(--text-primary);
}

.mobile-sheet--files .mobile-files-sheet__segment.active::after {
  display: none;
}

.mobile-sheet--files .mobile-files-sheet__content,
.mobile-sheet--files .mobile-files-sheet__detail {
  padding: 0 16px 16px;
}

.mobile-sheet--files .mobile-files-sheet__content > *,
.mobile-sheet--files .mobile-files-sheet__detail > * {
  width: 100%;
}

.mobile-sheet--files .file-tree-shell--mobile,
.mobile-sheet--files .git-panel--mobile,
.mobile-sheet--files .workspace-search-panel--mobile,
.mobile-sheet--files .workspace-git-editor,
.mobile-sheet--files .workspace-git-view {
  overflow: visible;
  border: none;
  background: transparent;
  box-shadow: none;
}

.mobile-sheet--files .mobile-explorer-panel,
.mobile-sheet--files .workspace-search-panel--mobile,
.mobile-sheet--files .git-panel--mobile {
  min-height: 0;
}

.mobile-sheet--files .workspace-sidebar-panel__body--stacked,
.mobile-sheet--files .workspace-search-panel .workspace-sidebar-panel__body--stacked,
.mobile-sheet--files .git-panel-scroll {
  display: grid;
  grid-template-rows: none;
  gap: 16px;
  padding: 0;
  overflow: visible;
}

.mobile-sheet--files .workspace-sidebar-panel__body--stacked {
  align-content: start;
}

.mobile-sheet--files .workspace-sidebar-section,
.mobile-sheet--files .git-panel-section {
  padding: 0;
}

.mobile-sheet--files .workspace-sidebar-section + .workspace-sidebar-section,
.mobile-sheet--files .git-panel-section + .git-panel-section {
  padding-top: 10px;
  border-top: 1px solid var(--component-mix-border-default-92pct-transparent);
}

.mobile-sheet--files .workspace-sidebar-section--fill {
  flex: 0 0 auto;
  padding-bottom: 0;
}

.mobile-sheet--files .workspace-sidebar-section__header,
.mobile-sheet--files .workspace-open-editors__header,
.mobile-sheet--files .git-panel-section-header {
  min-height: 28px;
  margin-bottom: 8px;
  gap: 12px;
}

.mobile-sheet--files .workspace-sidebar-section__title,
.mobile-sheet--files .workspace-open-editors__title,
.mobile-sheet--files .git-panel-section-toggle {
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.mobile-sheet--files .workspace-sidebar-section__count,
.mobile-sheet--files .workspace-open-editors__count,
.mobile-sheet--files .git-panel-section-count {
  padding: 3px 7px;
  border-radius: 999px;
}

.mobile-sheet--files .workspace-sidebar-section__chevron,
.mobile-sheet--files .workspace-open-editors__toggle,
.mobile-sheet--files .git-panel-section-chevron {
  border-radius: 4px;
}

.mobile-sheet--files .workspace-sidebar-section__action,
.mobile-sheet--files .workspace-open-editors__close-all,
.mobile-sheet--files .git-panel-section-link,
.mobile-sheet--files .git-commit-primary {
  min-height: 24px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.02);
}

.mobile-sheet--files .workspace-agent-instructions {
  padding-bottom: 0;
}

.mobile-sheet--files .workspace-agent-instructions__header {
  min-height: 28px;
  margin-bottom: 8px;
}

.mobile-sheet--files .workspace-agent-instructions__body {
  gap: 8px;
}

.mobile-sheet--files .workspace-agent-instructions__token-trend-chart {
  height: 84px;
}

.mobile-sheet--files .workspace-agent-instructions__status {
  gap: 6px;
}

.mobile-sheet--files .workspace-agent-instructions__actions-row {
  justify-content: flex-start;
}

.mobile-sheet--files .workspace-open-editors__close-all {
  margin-left: auto;
}

.mobile-sheet--files .workspace-quick-jump {
  padding-bottom: 0;
}

.mobile-sheet--files .workspace-quick-jump__search,
.mobile-sheet--files .git-panel .git-commit-input {
  min-height: 36px;
  padding-inline: 14px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--surface-page) 72%, transparent);
}

.mobile-sheet--files .workspace-search-panel__compound-control,
.mobile-sheet--files .workspace-search-panel__input,
.mobile-sheet--files .workspace-search-panel__filter {
  min-height: 32px;
}

.mobile-sheet--files .workspace-search-panel__input {
  padding-inline: 12px;
}

.mobile-sheet--files .git-panel .git-commit-input {
  min-height: 64px;
  padding: 12px 14px;
}

.mobile-sheet--files .workspace-quick-jump__results,
.mobile-sheet--files .workspace-open-editors,
.mobile-sheet--files .workspace-search-panel__results,
.mobile-sheet--files .git-panel-section-body {
  padding-top: 0;
}

.mobile-sheet--files .workspace-quick-jump__item,
.mobile-sheet--files .workspace-open-editors__item,
.mobile-sheet--files .file-tree-shell--mobile .tree-item,
.mobile-sheet--files .workspace-search-panel__match,
.mobile-sheet--files .git-row,
.mobile-sheet--files .git-history-row,
.mobile-sheet--files .git-worktree-row__main {
  min-height: 40px;
  border-radius: 4px;
}

.mobile-sheet--files .workspace-quick-jump__item,
.mobile-sheet--files .workspace-open-editors__item,
.mobile-sheet--files .workspace-search-panel__match,
.mobile-sheet--files .git-row,
.mobile-sheet--files .git-history-row,
.mobile-sheet--files .git-worktree-row__main {
  padding-left: 8px;
  padding-right: 8px;
}

.mobile-sheet--files .file-tree-shell--mobile .file-tree {
  padding-bottom: 0;
}

.mobile-sheet--files .file-tree-shell--mobile .tree-item {
  margin: 0;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.mobile-sheet--files .workspace-search-panel__controls {
  padding: 0;
}

.mobile-sheet--files .workspace-search-panel__filters {
  gap: 8px;
}

.mobile-sheet--files .workspace-search-panel__filter {
  border-radius: 0;
}

.mobile-sheet--files
  .workspace-search-panel__detail-heading
  .workspace-search-panel__filter--details {
  min-height: 22px;
  width: 30px;
  min-width: 30px;
}

.mobile-sheet--files .workspace-search-panel__summary {
  color: var(--text-tertiary);
}

.mobile-sheet--files .workspace-search-panel__group {
  padding-top: 6px;
}

.mobile-sheet--files .workspace-search-panel__group-header {
  padding: 6px 2px 8px;
}

.mobile-sheet--files .workspace-search-panel__matches {
  padding: 2px 0 0;
}

.mobile-sheet--files .workspace-search-panel__match {
  grid-template-columns: 34px minmax(0, 1fr);
}

.mobile-sheet--files .workspace-search-panel__match-kind {
  display: none;
}

.mobile-sheet--files .workspace-search-panel__preview {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-sheet--files .git-panel-scroll {
  grid-template-columns: minmax(0, 1fr);
}

.mobile-sheet--files .git-commit-block {
  padding-bottom: 0;
  border-bottom: none;
}

.mobile-sheet--files .git-commit-actions {
  justify-content: flex-end;
}

.mobile-sheet--files .git-commit-primary {
  min-height: 24px;
}

.mobile-sheet--files .git-panel-section-actions {
  gap: 8px;
}

.mobile-sheet--files .git-panel-section-actions .git-panel-section-link {
  display: inline-flex;
}

.mobile-sheet--files .git-panel-section-body--changes {
  overflow: visible;
  max-height: none;
}

.mobile-sheet--files .git-row {
  padding-right: 8px;
}

.mobile-sheet--files .git-row-actions {
  gap: 4px;
}

.mobile-sheet--files .git-row-action {
  width: 24px;
  height: 24px;
}

.mobile-sheet--files .git-panel-section-history,
.mobile-sheet--files
  .git-panel-section-changes
  + .git-panel-section:not(.git-panel-section-history) {
  display: flex;
}

.mobile-sheet--files .git-history-row__when {
  justify-self: end;
}

@media (max-width: 899px), (pointer: coarse) {
  .mobile-shell {
    --mobile-safe-top: env(safe-area-inset-top, 0px);
    --mobile-safe-right: env(safe-area-inset-right, 0px);
    --mobile-safe-bottom: env(safe-area-inset-bottom, 0px);
    --mobile-safe-left: env(safe-area-inset-left, 0px);
    --mobile-keyboard-inset: 0px;
    --mobile-shell-motion-enter-duration: 220ms;
    --mobile-shell-motion-press-duration: 100ms;
    --mobile-shell-motion-surface-duration: 160ms;
    display: flex;
    flex-direction: column;
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
    background: transparent;
  }
}

@media (max-width: 1200px) {
  .monitoring-settings-grid--toggles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .settings-monitoring-control-bar {
    grid-template-columns: 1fr;
  }

  .settings-monitoring-shell {
    gap: var(--sp-4);
  }

  .settings-monitoring-shell--desktop {
    grid-template-columns: 1fr;
  }

  .settings-monitoring-shell--desktop > .settings-monitoring-toolbar,
  .settings-monitoring-shell--desktop > .settings-monitoring-kpi-grid,
  .settings-monitoring-shell--desktop > .settings-monitoring-dashboard-stage {
    grid-column: 1;
  }

  .settings-monitoring-control-bar,
  .settings-monitoring-dashboard-stage {
    padding: var(--sp-3);
  }

  .settings-monitoring-toolbar,
  .settings-monitoring-kpi-card {
    padding: var(--sp-3);
  }

  .settings-monitoring-hero__title {
    font-size: var(--monitoring-hero-title-size-mobile);
    line-height: var(--monitoring-hero-title-line-height-mobile);
  }

  .settings-monitoring-control-bar__summary {
    font-size: var(--type-body-4-size);
    line-height: var(--type-body-4-line-height);
  }

  .settings-monitoring-status-card {
    padding: var(--sp-3);
  }

  .settings-monitoring-status-card__health {
    display: none;
  }

  .settings-monitoring-pill,
  .settings-monitoring-soft-chip {
    min-height: var(--control-height-sm);
    padding: 0 var(--sp-2);
    border-radius: var(--monitoring-chip-radius);
  }

  .settings-monitoring-kpi-card__value {
    font-size: var(--monitoring-kpi-value-size-mobile);
  }

  .settings-monitoring-hero-action__value {
    font-size: var(--monitoring-hero-action-value-size-mobile);
  }

  .settings-monitoring-toolbar__summary {
    grid-template-columns: 1fr;
    display: grid;
  }

  .settings-monitoring-status-card__toggle {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--sp-3);
  }

  .settings-monitoring-status-card__toggle .settings-toggle-desc {
    display: none;
  }

  .settings-monitoring-toolbar__meta {
    justify-content: flex-end;
    align-items: center;
  }

  .settings-monitoring-status-card__stats,
  .settings-monitoring-kpi-grid,
  .settings-monitoring-signal-bar__controls,
  .monitoring-settings-grid--capabilities,
  .monitoring-overview-grid,
  .monitoring-attribution {
    grid-template-columns: 1fr;
  }

  .settings-monitoring-hero-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .monitoring-panel-header__actions {
    justify-content: flex-start;
  }
}
