.workspace-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
  padding: 0 14px;
  border-bottom: 1px solid var(--panel-border-soft);
  background: rgba(var(--overlay-rgb), 0.04);
}

.summary-topbar {
  position: sticky;
  top: 0;
  z-index: 3;
  padding-inline: 14px;
  backdrop-filter: blur(18px);
}

.workspace-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
  position: relative;
  margin-left: auto;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 14px;
  border-radius: 11px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.01em;
  border: 1px solid rgba(var(--overlay-rgb), 0.14);
  transition: background-color 140ms, border-color 140ms, color 140ms, opacity 140ms;
}

.primary-button {
  color: var(--text-on-accent);
  background: rgb(28, 78, 216);
}

.primary-button:hover {
  background: rgb(24, 68, 190);
  border-color: rgba(var(--overlay-rgb), 0.18);
  color: white;
}

.primary-button:disabled {
  opacity: 0.54;
  cursor: default;
}

.primary-button:disabled:hover {
  background: rgb(28, 78, 216);
  border-color: rgba(var(--overlay-rgb), 0.14);
  color: white;
}

.secondary-button {
  color: rgba(var(--overlay-rgb), 0.92);
  background: rgba(var(--overlay-rgb), 0.04);
}

.secondary-button:hover {
  background: rgba(var(--overlay-rgb), 0.09);
  border-color: rgba(var(--overlay-rgb), 0.18);
  color: white;
}

.secondary-button:disabled {
  opacity: 0.54;
  cursor: default;
}

.secondary-button:disabled:hover {
  background: rgba(var(--overlay-rgb), 0.04);
  border-color: rgba(var(--overlay-rgb), 0.14);
  color: rgba(var(--overlay-rgb), 0.92);
}

.sidecar-draft-button {
  width: 28px;
  min-width: 28px;
  min-height: 28px;
  padding: 0;
}

.sidecar-draft-button i {
  font-size: 13px;
  color: inherit;
}

.session-git-draft-spinner {
  width: 14px;
  height: 14px;
  display: inline-flex;
  border: 2px solid rgba(var(--overlay-rgb), 0.22);
  border-top-color: rgba(var(--overlay-rgb), 0.92);
  border-radius: 999px;
  animation: session-git-draft-spin 0.8s linear infinite;
}

.session-git-action-button-content {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

@keyframes session-git-draft-spin {
  to {
    transform: rotate(360deg);
  }
}

.action-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 25px;
  padding: 0 10px;
  border: 1px solid rgba(var(--overlay-rgb), 0.09);
  background: var(--surface-editor-active);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-strong);
}

.action-button:hover {
  background: var(--surface-editor-hover);
}

.action-button:disabled {
  opacity: 0.54;
  cursor: default;
}

.action-button:disabled:hover {
  background: var(--surface-editor-active);
}

.session-diff-view-floating-toggle {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid rgba(var(--overlay-rgb), 0.06);
  border-radius: 999px;
  background: var(--surface-chat-pane);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.session-diff-view-floating-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: rgba(var(--overlay-rgb), 0.56);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    color 140ms ease;
}

.session-diff-view-floating-button:hover {
  border-color: rgba(var(--overlay-rgb), 0.08);
  background: rgba(var(--overlay-rgb), 0.06);
  color: rgba(var(--overlay-rgb), 0.94);
}

.session-diff-view-floating-button.is-active,
.session-diff-view-floating-button[aria-pressed="true"] {
  border-color: rgba(var(--overlay-rgb), 0.08);
  background: rgba(var(--overlay-rgb), 0.09);
  color: rgba(var(--overlay-rgb), 0.94);
}

.loading-overlay-spinner.session-action-spinner {
  --spinner-size: 14px;
  --spinner-thickness: 2px;
}

.modal-alert {
  margin: 0 20px 14px;
  padding: 9px 11px;
  border: 1px solid rgba(var(--overlay-rgb), 0.08);
  background: rgba(var(--overlay-rgb), 0.04);
  font-size: 12px;
  line-height: 1.45;
}

.modal-alert-error {
  border-color: var(--alert-error-border);
  background: var(--surface-error-bg);
  color: var(--alert-error-color);
}

.modal-search,
.modal-form,
.modal-actions,
.import-list,
.modal-empty {
}

.modal-form {
  display: grid;
  gap: 14px;
}

.modal-field {
  min-height: 0;
  display: grid;
  gap: 6px;
}

.modal-field span {
  color: rgba(var(--overlay-rgb), 0.72);
  font-size: 12px;
  font-weight: 600;
}

.commit-modal-form {
  grid-template-rows: auto minmax(0, 1fr);
}

.commit-modal-message-field {
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.commit-modal-message-field textarea {
  height: 100%;
  min-height: 0;
  resize: none;
}

.commit-modal-alert {
  margin-top: 0;
}

.session-git-view {
  width: 100%;
  height: 100%;
}

.session-changes-tab-body {
  min-height: 0;
  width: 100%;
  height: 100%;
  display: block;
  padding: 0;
  overflow: hidden;
}

.session-changes-browser {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  align-items: stretch;
}

.session-changes-sidebar {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(var(--overlay-rgb), 0.08);
  border-radius: 14px;
  background: rgba(var(--overlay-rgb), 0.03);
  color: var(--text);
  margin: 24px 12px 24px 24px;
}

.session-changes-sidebar-tabbar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 12px 12px 10px;
  padding: 4px;
  border: 1px solid rgba(var(--overlay-rgb), 0.06);
  border-radius: 999px;
  background: rgba(var(--overlay-rgb), 0.03);
}

.session-changes-sidebar-tab {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: rgba(var(--overlay-rgb), 0.56);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    color 140ms ease;
}

.session-changes-sidebar-tab:hover {
  border-color: rgba(var(--overlay-rgb), 0.08);
  background: rgba(var(--overlay-rgb), 0.06);
  color: rgba(var(--overlay-rgb), 0.94);
}

.session-changes-sidebar-tab.is-active {
  border-color: rgba(var(--overlay-rgb), 0.08);
  background: rgba(var(--overlay-rgb), 0.09);
  color: rgba(var(--overlay-rgb), 0.94);
}

.session-changes-tree {
  position: relative;
  min-height: 0;
  max-height: none;
  height: 100%;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  padding: 0;
  border-right: 0;
  background: transparent;
}

.session-changes-tree.is-commits-tab {
  overflow: hidden;
}

.session-changes-tree-content {
  position: relative;
  min-height: 0;
}

.session-changes-tree-content.is-changes-tab {
  overflow-x: hidden;
  overflow-y: auto;
  padding-bottom: 8px;
}

.session-changes-tree-content.is-commits-tab {
  overflow: hidden;
}

.session-changes-tree-empty-shell {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 14px;
}

.session-changes-tree-empty-state.session-page-coming-soon {
  width: min(100%, 280px);
  min-height: 240px;
  gap: 10px;
  padding: 24px 18px;
}

.session-changes-tree-empty-state.is-search-empty.session-page-coming-soon {
}

.session-changes-tree-empty-state .session-page-coming-soon-icon {
  width: 48px;
  height: 48px;
  font-size: 20px;
}

.session-changes-tree-empty-state h2 {
  font-size: 18px;
}

.session-changes-tree-empty-state p {
  max-width: 24ch;
  font-size: 12.5px;
}

.commit-tree-section {
  padding: 5px 8px;
}

.session-changes-file-row {
  padding-right: 0;
}

.session-changes-file-row.is-selected {
  background: rgba(var(--overlay-rgb), 0.08);
}

.session-changes-file-row.is-selected:hover {
  background: rgba(var(--overlay-rgb), 0.1);
}

.session-changes-file-button {
  width: 100%;
  min-width: 0;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 10px 0 0;
  border: 0;
  background: transparent;
  color: rgba(var(--overlay-rgb), 0.9);
  font-size: 12px;
  text-align: left;
}

.session-changes-file-button:hover {
  color: var(--text-strong);
}

.session-changes-file-button .commit-tree-file-name {
  min-width: 0;
  flex: 1 1 auto;
}

.commit-tree-checkbox {
  width: 28px;
  min-width: 28px;
}

.commit-tree-checkbox input {
  width: 13px;
  height: 13px;
  accent-color: #4f8cff;
}

.commit-tree-file-stats {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 11px;
}

.session-changes-commit-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  padding: 8px;
  background: transparent;
  border-top: 1px solid rgba(var(--overlay-rgb), 0.06);
}

.session-changes-commit-panel-body {
  min-height: 0;
}

.session-changes-commit-panel .modal-form {
  gap: 14px;
  padding: 0;
}

.session-changes-commit-panel .modal-field {
  gap: 8px;
}

.session-changes-commit-panel .modal-field span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(var(--overlay-rgb), 0.5);
}


.session-changes-commit-actions {
  flex: 0 0 auto;
  display: flex;
  justify-content: stretch;
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(var(--overlay-rgb), 0.06);
}

.session-changes-commit-actions .primary-button {
  flex: 1 1 auto;
}

.session-pending-commits-panel {
  position: relative;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
}

.session-pending-commits-list {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  display: grid;
  align-content: start;
  padding: 8px 0;
}

.session-pending-commit-list-item {
  width: 100%;
  display: grid;
  gap: 8px;
  padding: 14px 14px 13px;
  border: 0;
  border-bottom: 1px solid rgba(var(--overlay-rgb), 0.06);
  background: transparent;
  text-align: left;
  appearance: none;
  cursor: pointer;
}

.session-pending-commit-list-item:hover {
  background: rgba(var(--overlay-rgb), 0.04);
}

.session-pending-commit-list-item:focus-visible {
  outline: 1px solid rgba(111, 120, 255, 0.9);
  outline-offset: -1px;
  background: rgba(var(--overlay-rgb), 0.05);
}

.session-pending-commit-list-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.session-pending-commit-list-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.session-pending-commit-sha {
  color: rgba(var(--overlay-rgb), 0.5);
  font-family: var(--font-mono);
  font-size: 11px;
}

.session-pending-commit-title {
  min-width: 0;
  margin: 0;
  color: rgba(var(--overlay-rgb), 0.92);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.45;
}

.session-pending-commit-body {
  margin: 0;
  color: rgba(var(--overlay-rgb), 0.72);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.session-pending-commits-empty {
  min-height: 0;
  height: 100%;
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 24px 16px;
  color: rgba(var(--overlay-rgb), 0.6);
  text-align: center;
}

.session-pending-commits-empty-state.session-page-coming-soon {
  width: min(100%, 320px);
  min-height: 240px;
  gap: 10px;
  padding: 24px 18px;
}

.session-pending-commits-empty-state .session-page-coming-soon-icon {
  width: 48px;
  height: 48px;
  font-size: 20px;
}

.session-pending-commits-empty-state h2 {
  font-size: 18px;
}

.session-pending-commits-empty-state p {
  max-width: 26ch;
  font-size: 12.5px;
}

.session-pending-commits-toolbar {
  display: flex;
  justify-content: flex-end;
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(var(--overlay-rgb), 0.06);
  background: transparent;
}

.session-pending-commits-toolbar .primary-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.session-changes-diff-panel {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(var(--overlay-rgb), 0.08);
  border-radius: 14px;
  background: rgba(var(--overlay-rgb), 0.03);
  color: var(--text);
  margin: 24px 24px 24px 12px;
}

.session-changes-diff-body {
  min-height: 0;
  height: 100%;
  padding: 0;
  overflow: hidden;
}

.session-changes-text-diff {
  display: flex;
  gap: 16px;
  height: 100%;
  min-height: 0;
  padding: 16px;
}

.session-changes-text-diff.is-inline {
  flex-direction: column;
}

.session-changes-text-column {
  display: flex;
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  border: 1px solid rgba(var(--overlay-rgb), 0.08);
  border-radius: 14px;
  background: rgba(var(--overlay-rgb), 0.02);
  overflow: hidden;
}

.session-changes-text-header {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(var(--overlay-rgb), 0.08);
  color: rgba(var(--overlay-rgb), 0.72);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.session-changes-text-pre {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  padding: 14px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  color: rgba(var(--overlay-rgb), 0.92);
}

.session-changes-diff-binary {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: rgba(var(--overlay-rgb), 0.78);
}

.session-changes-diff-content {
  position: relative;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.session-changes-diff-host {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.session-changes-file-view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(var(--overlay-rgb), 0.06);
  background: transparent;
}

.session-changes-file-view-path {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(var(--overlay-rgb), 0.76);
  font-family: var(--font-mono);
  font-size: 12px;
}

.session-changes-file-view-action {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 12px;
  border: 1px solid rgba(var(--overlay-rgb), 0.08);
  border-radius: 999px;
  background: rgba(var(--overlay-rgb), 0.09);
  color: rgba(var(--overlay-rgb), 0.94);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    color 140ms ease;
}

.session-changes-file-view-action:hover {
  border-color: rgba(var(--overlay-rgb), 0.12);
  background: rgba(var(--overlay-rgb), 0.14);
  color: var(--text-strong);
}

.session-changes-file-view-empty {
  min-height: 0;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  color: rgba(var(--overlay-rgb), 0.6);
}

.session-changes-diff-empty {
  min-height: 0;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
}

.session-changes-diff-empty .session-page-coming-soon {
  min-height: min(320px, 100%);
}

.diff-inline-plus {
  color: #31c36b;
}

.diff-inline-minus {
  color: #ff5e5e;
}

[data-theme="light"] .diff-inline-plus {
  color: #15803d;
}

[data-theme="light"] .diff-inline-minus {
  color: #b91c1c;
}

[data-theme="light"] .modal-alert-error {
  border-color: rgba(200, 50, 50, 0.26);
  background: rgba(255, 97, 97, 0.06);
  color: rgba(120, 20, 20, 0.92);
}

@media (max-width: 1080px) {
  .workspace-topbar {
    flex-wrap: wrap;
    align-items: flex-start;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .session-changes-browser {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(220px, 34vh) minmax(0, 1fr);
  }

  .session-changes-sidebar {
    margin: 24px 24px 12px;
  }

  .session-changes-diff-panel {
    margin: 12px 24px 24px;
  }

  .session-changes-tree {
    border-right: 0;
    border-bottom: 1px solid rgba(var(--overlay-rgb), 0.06);
  }
}
