body.git-graph-mode .topbar,
body.git-graph-mode .output-pane,
body.git-graph-mode .composer {
  display: none !important;
}

body.git-graph-mode .main {
  grid-template-rows: minmax(0, 1fr);
}

.git-graph-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  width: 100%;
  max-width: 100vw;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.git-graph-toolbar {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.git-graph-toolbar .git-graph-titles {
  flex: 1;
  min-width: 0;
}

.git-graph-toolbar h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.git-graph-toolbar .eyebrow {
  margin: 2px 0 0;
  overflow: hidden;
  font-size: 11px;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.git-graph-toolbar button {
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  font: inherit;
}

#gitGraphAllBranchesButton {
  min-width: 56px;
}

.git-graph-toolbar button:hover {
  background: var(--surface-hover, rgba(255, 255, 255, 0.04));
}

.git-graph-toolbar button.active {
  background: rgba(88, 166, 255, 0.18);
  border-color: rgba(88, 166, 255, 0.5);
  color: #91c4ff;
}

.git-graph-body {
  flex: 1;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: auto;
  padding: 8px 0;
  touch-action: pan-x pan-y;
  -webkit-overflow-scrolling: touch;
}

.git-graph-layout {
  --git-graph-row-width: clamp(760px, 92vw, 1120px);
  --git-graph-column-width: 52px;
  position: relative;
  display: flex;
  align-items: stretch;
  width: var(--git-graph-row-width);
  min-width: 100%;
}

.git-graph-canvas {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: var(--git-graph-column-width);
  max-width: var(--git-graph-column-width);
  background: var(--panel);
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.git-graph-rows {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  padding-left: var(--git-graph-column-width);
  width: var(--git-graph-row-width);
  min-width: 0;
}

.git-commit-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px 0 4px;
  border: none;
  background: transparent;
  color: var(--fg);
  text-align: left;
  cursor: pointer;
  font: inherit;
  height: 36px;
  min-height: 36px;
  width: 100%;
}

.git-commit-row:hover {
  background: var(--surface-hover, rgba(255, 255, 255, 0.04));
}

.git-commit-row.selected {
  background: rgba(88, 166, 255, 0.15);
}

.git-commit-row.git-wt-row {
  cursor: default;
}

.git-commit-row:focus-visible {
  outline: 2px solid #58a6ff;
  outline-offset: -2px;
  background: rgba(88, 166, 255, 0.1);
}

.git-commit-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 4px 0;
  min-width: 0;
  max-width: 100%;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.git-commit-meta {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
  font-size: 13px;
  line-height: 1.4;
  min-width: 0;
}

.git-commit-subject {
  flex: 0 1 auto;
  min-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 640px;
}

.git-commit-tail {
  font-size: 11px;
  color: var(--muted);
}

.git-type-badge {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: 4px;
  background: rgba(160, 160, 160, 0.18);
  color: var(--fg);
  font-size: 11px;
  font-weight: 600;
  text-transform: lowercase;
}

.git-type-badge.type-feat { background: rgba(46, 160, 67, 0.25); color: #7ee787; }
.git-type-badge.type-fix { background: rgba(248, 81, 73, 0.22); color: #ff8e8e; }
.git-type-badge.type-docs { background: rgba(99, 158, 255, 0.22); color: #91c4ff; }
.git-type-badge.type-refactor { background: rgba(187, 128, 9, 0.22); color: #f7c156; }
.git-type-badge.type-chore { background: rgba(140, 140, 140, 0.22); color: #cfcfcf; }
.git-type-badge.type-test { background: rgba(99, 102, 241, 0.22); color: #a5b4fc; }
.git-type-badge.type-perf { background: rgba(244, 114, 182, 0.22); color: #f9a8d4; }
.git-type-badge.type-working { background: rgba(247, 193, 86, 0.22); color: #f7c156; }

.git-ref-badge {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.git-ref-badge.ref-branch { background: rgba(46, 160, 67, 0.25); color: #7ee787; }
.git-ref-badge.ref-remote { background: rgba(99, 158, 255, 0.18); color: #91c4ff; }
.git-ref-badge.ref-tag { background: rgba(187, 128, 9, 0.22); color: #f7c156; }

.git-notice {
  padding: 16px;
  color: var(--muted);
  font-size: 13px;
}

.git-notice.git-notice-error { color: #ff8e8e; }

.git-wt-banner {
  position: sticky;
  top: -8px;
  left: 0;
  z-index: 2;
  margin: -8px 0 8px;
  padding: 12px 14px 10px;
  box-sizing: border-box;
  width: 100%;
  max-width: 100vw;
  background: #4a3414;
  border-bottom: 1px solid rgba(247, 193, 86, 0.55);
  box-shadow: 0 2px 0 var(--panel);
  color: #f7c156;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.git-wt-banner strong { color: #f7c156; font-weight: 700; }

.git-load-sentinel {
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 760px) {
  .git-graph-toolbar {
    padding: 10px 12px;
  }
  .git-graph-toolbar button {
    height: 36px;
    min-width: 36px;
  }
  .git-commit-row {
    padding: 0 12px 0 6px;
  }
  .git-commit-tail {
    font-size: 10px;
  }
}

.session-graph-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
}

/* PR Dialog */
.pr-dialog {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: grid;
  place-items: center;
  z-index: 60;
}

.pr-dialog[hidden] { display: none; }

.pr-dialog-content {
  background: var(--bg-sidebar);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  width: min(90%, 440px);
  max-height: 80vh;
  overflow-y: auto;
}

.pr-dialog-content h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.pr-dialog-content textarea {
  width: 100%;
  min-height: 60px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg-input);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  padding: 8px;
  resize: vertical;
}

.pr-dialog-content .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
