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

.session-page-body {
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 24px;
}

.session-code-tab-body {
  min-height: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: stretch;
  padding: 0;
  overflow: hidden;
  box-sizing: border-box;
}

.session-page-coming-soon {
  width: min(520px, 100%);
  min-height: 320px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 12px;
  padding: 32px;
  border: 0;
  background: transparent;
  text-align: center;
}

.session-page-coming-soon-icon {
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(var(--overlay-rgb), 0.08);
  color: rgba(var(--overlay-rgb), 0.92);
  font-size: 22px;
}

.session-page-coming-soon h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.session-page-coming-soon p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.repo-tab-context-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  border: 0;
  background: transparent;
}

.repo-tab-context-menu {
  position: fixed;
  z-index: 41;
  min-width: 150px;
  display: grid;
  gap: 4px;
  padding: 6px;
  border: 1px solid rgba(var(--overlay-rgb), 0.12);
  background: var(--surface-elevated-solid);
  box-shadow: var(--shadow);
}

.repo-tab-context-menu-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: rgba(var(--overlay-rgb), 0.92);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
}

.repo-tab-context-menu-item:hover {
  background: rgba(var(--overlay-rgb), 0.08);
}

.repo-tab-context-menu-item:disabled {
  opacity: 0.55;
}

.repo-tab-context-menu-item.is-danger {
  color: var(--text-danger-accent);
}

.changes-loading-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  pointer-events: none;
  background: var(--surface-tooltip);
  z-index: 2;
}

.changes-loading-overlay.is-overlay {
  background: linear-gradient(180deg, rgba(var(--overlay-rgb), 0.04), rgba(var(--overlay-rgb), 0.06));
  backdrop-filter: blur(2px);
}

.changes-loading-spinner {
  --spinner-size: 18px;
  --spinner-thickness: 2px;
}

.changes-loading-text {
  font-size: 12px;
  color: rgba(var(--overlay-rgb), 0.78);
}

.commit-modal-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
}

.commit-file-tree {
  min-height: 420px;
  max-height: 560px;
  overflow: auto;
  padding: 0 0 14px 20px;
  border-right: 1px solid var(--panel-border-soft);
}

.commit-tree-folder,
.commit-tree-file {
  width: 100%;
  min-width: 0;
  min-height: 30px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px 0 0;
  color: rgba(var(--overlay-rgb), 0.92);
  text-align: left;
  background: transparent;
}

.commit-tree-folder:hover,
.commit-tree-file:hover {
  background: rgba(var(--overlay-rgb), 0.035);
}

.commit-tree-folder {
  font-size: 12px;
  font-weight: 600;
}

.commit-tree-twisty,
.commit-tree-folder-icon,
.commit-tree-spacer,
.commit-tree-checkbox {
  width: 14px;
  min-width: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-soft);
  font-size: 12px;
}

.commit-tree-folder-name,
.commit-tree-file-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.commit-tree-folder-count {
  margin-left: auto;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--overlay-rgb), 0.06);
  color: rgba(var(--overlay-rgb), 0.72);
  font-size: 10px;
  font-weight: 700;
}

.commit-tree-file {
  padding-left: 0;
  font-size: 12px;
}

.session-code-browser {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  gap: 12px;
  padding: 24px;
  box-sizing: border-box;
  overflow: hidden;
}

.session-code-tree {
  position: relative;
  min-height: 0px;
  max-height: none;
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 0px;
  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: 0;
}

.session-code-tree-content {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-bottom: 8px;
}

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

.session-code-tree-list {
  display: block;
  padding: 5px 8px 0;
}

.session-changes-search {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--surface-code);
  border-bottom: 1px solid var(--panel-border-soft);
}

.session-changes-search-box {
  padding: 10px 12px;
}

.session-code-tree-node {
  display: grid;
  gap: 2px;
}

.session-code-tree-folder,
.session-code-file {
  border: 0;
}

.session-code-tree-children {
  display: grid;
  gap: 2px;
  padding-left: 14px;
}

.session-code-file {
  color: rgba(var(--overlay-rgb), 0.76);
}

.session-code-file:hover {
  color: rgba(var(--overlay-rgb), 0.94);
}

.session-code-file.is-selected {
  background: rgba(var(--overlay-rgb), 0.08);
  color: var(--text-strong);
}

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

.session-code-file-icon {
  width: 14px;
  min-width: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(var(--overlay-rgb), 0.64);
  font-size: 12px;
}

.session-code-file-icon.is-tracked,
.commit-tree-file-name.is-tracked {
  color: var(--text-strong);
}

.session-code-file-icon.is-untracked,
.commit-tree-file-name.is-untracked {
  color: var(--text-danger-accent);
}

.session-code-file-icon.is-ignored,
.commit-tree-file-name.is-ignored {
  color: var(--status-warning);
}

.session-code-editor-panel {
  min-width: 0px;
  min-height: 0px;
  display: block;
  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: 0;
}

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

.session-code-file-view-header {
  min-width: 0;
  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;
  overflow: hidden;
}

.session-code-file-view-path {
  flex: 1 1 auto;
  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-code-file-view-actions {
  flex: 0 0 auto;
  min-width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.session-code-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-code-file-view-action:hover {
  border-color: rgba(var(--overlay-rgb), 0.12);
  background: rgba(var(--overlay-rgb), 0.14);
  color: var(--text-strong);
}

.session-code-file-view-action:disabled {
  opacity: 0.54;
  cursor: default;
}

.session-code-file-view-action:disabled:hover {
  border-color: rgba(var(--overlay-rgb), 0.08);
  background: rgba(var(--overlay-rgb), 0.09);
  color: rgba(var(--overlay-rgb), 0.94);
}

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

.session-code-preview-panel {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: block;
  overflow: hidden;
  background: var(--surface-ground);
}

.session-code-preview-stage {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  place-items: center;
  background: var(--surface-ground);
}

.session-code-preview-image,
.session-code-preview-video,
.session-code-preview-frame {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: var(--surface-ground);
}

.session-code-preview-image,
.session-code-preview-video {
  object-fit: contain;
}

.session-code-preview-audio-shell {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 32px;
  background: var(--surface-ground);
}

.session-code-preview-audio {
  width: min(720px, 100%);
}

.session-code-editor-host {
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--surface-diff-bg);
}

.session-code-editor-textarea {
  resize: none;
  padding: 18px 20px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre;
  outline: none;
}

.session-code-editor-textarea:read-only {
  opacity: 0.8;
}

.session-code-tab-message {
  margin: 0 16px 16px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.4;
}

.session-code-tab-message.is-error {
  border: 1px solid var(--alert-error-border);
  background: var(--alert-error-bg);
  color: var(--alert-error-color);
}

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

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

.modal-empty {
  padding-left: 20px;
  padding-right: 20px;
}

@media (max-width: 1080px) {
  .session-code-browser {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(220px, 34vh) minmax(0, 1fr);
    padding: 16px;
  }

  .session-code-tree {
    border-right: 0;
    border-bottom: 1px solid var(--panel-border-soft);
  }
}
