*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box
}

:root {
  --bg: #09090b;
  --surface: #0f0f12;
  --card: #151519;
  --card-hover: #1a1a1f;
  --border: #27272a;
  --border-light: #3f3f46;
  --text: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #52525b;
  --accent: #22d3ee;
  --accent-dim: rgba(34, 211, 238, .1);
  --accent-border: rgba(34, 211, 238, .2);
  --green: #4ade80;
  --green-dim: rgba(74, 222, 128, .1);
  --red: #f87171;
  --red-dim: rgba(248, 113, 113, .1);
  --yellow: #facc15;
  --yellow-dim: rgba(250, 204, 21, .1);
  --purple: #a78bfa;
  --purple-dim: rgba(167, 139, 250, .1);
  --radius: 8px;
  --radius-sm: 5px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', 'Cascadia Code', 'Fira Code', monospace;
  --transition: 150ms ease;
}

html,
body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  overflow: hidden;
}

/* ── Header ────────────────────────────────────────── */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
  padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  -webkit-app-region: drag;
}

.header__left,
.header__right {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 180px
}

.header__right {
  justify-content: flex-end
}

.header__center {
  flex: 1;
  display: flex;
  justify-content: center
}

.header__logo {
  display: flex;
  align-items: center;
  gap: 8px
}

.header__icon {
  color: var(--accent)
}

.header__name {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -.02em
}

.header__tag {
  font-size: 10px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 10px;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--accent-border);
}

.dsa-badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center
}

.dsa-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: default;
  transition: all var(--transition);
  white-space: nowrap;
}

.dsa-badge:hover {
  border-color: var(--accent-border);
  color: var(--accent);
  background: var(--accent-dim)
}

.dsa-badge__icon {
  font-size: 11px;
  opacity: .7
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted)
}

.connection-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}

/* ── App Layout ────────────────────────────────────── */
.app {
  display: grid;
  grid-template-columns: 240px 1fr 240px;
  height: calc(100vh - 44px);
  gap: 0;
}

/* ── Panels ────────────────────────────────────────── */
.panel {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
  border-right: 1px solid var(--border);
  overflow: hidden;
}

.panel--right {
  border-right: none;
  border-left: 1px solid var(--border)
}

.panel__card {
  background: var(--surface);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.panel__card--grow {
  flex: 1;
  min-height: 0;
  overflow: hidden
}

.panel__card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
}

.panel__card-header svg {
  color: var(--text-muted)
}

.empty-state {
  font-size: 12px;
  color: var(--text-muted);
  padding: 8px 0;
}

.empty-state code {
  font-family: var(--mono);
  background: var(--card);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 11px;
  color: var(--accent);
}

/* ── Branch List ───────────────────────────────────── */
.branch-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1px
}

.branch-list li {
  font-family: var(--mono);
  font-size: 12px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.branch-list li:hover {
  background: var(--card-hover)
}

.branch-list li.active {
  background: var(--accent-dim);
  color: var(--accent)
}

.branch-list li.active::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent)
}

.branch-list li:not(.active)::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: 1px solid var(--border-light)
}

/* ── Commit Graph ──────────────────────────────────── */
.commit-graph {
  overflow-y: auto;
  flex: 1;
  padding-right: 4px
}

.commit-node {
  position: relative;
  padding: 8px 8px 8px 24px;
  margin-left: 8px;
  border-left: 2px solid var(--border);
  transition: all var(--transition);
}

.commit-node:hover {
  background: var(--card-hover);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0
}

.commit-node::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 14px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--surface);
}

.commit-node:first-child::before {
  background: var(--green);
  box-shadow: 0 0 0 2px var(--green-dim)
}

.commit-id {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  display: inline-block;
  background: var(--accent-dim);
  padding: 1px 6px;
  border-radius: 3px;
}

.commit-msg {
  font-size: 12px;
  color: var(--text);
  margin-top: 3px
}

.commit-time {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px
}

/* ── File List ─────────────────────────────────────── */
.file-list {
  display: flex;
  flex-direction: column;
  gap: 1px
}

.file-item {
  font-family: var(--mono);
  font-size: 12px;
  padding: 5px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.file-item:hover {
  background: var(--card-hover)
}

.file-item__name {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text)
}

.file-item__name::before {
  content: '📄';
  font-size: 11px
}

.file-item__hash {
  font-size: 10px;
  color: var(--text-muted);
  background: var(--card);
  padding: 1px 5px;
  border-radius: 3px;
}

/* ── Status Grid ───────────────────────────────────── */
.status-grid {
  display: flex;
  flex-direction: column;
  gap: 4px
}

.status-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 12px;
}

.status-item__label {
  color: var(--text-muted)
}

.status-item__value {
  font-family: var(--mono);
  font-weight: 500;
  color: var(--text)
}

.status-item__value--staged {
  color: var(--green)
}

/* ── Quick Actions ─────────────────────────────────── */
.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px
}

.qbtn {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.qbtn:hover {
  border-color: var(--accent-border);
  color: var(--accent);
  background: var(--accent-dim)
}

.qbtn:active {
  transform: scale(.96)
}

/* ── Terminal ──────────────────────────────────────── */
.terminal-container {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg);
}

.terminal__bar {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 34px;
  padding: 0 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.terminal__bar-dots {
  display: flex;
  gap: 5px
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: block
}

.dot--r {
  background: #ff5f57
}

.dot--y {
  background: #febc2e
}

.dot--g {
  background: #28c840
}

.terminal__bar-title {
  font-size: 11px;
  color: var(--text-muted);
  flex: 1;
  text-align: center
}

.terminal__bar-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  transition: all var(--transition);
}

.terminal__bar-btn:hover {
  background: var(--card);
  color: var(--text)
}

.terminal__output {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.7;
  min-height: 0;
}

.terminal__welcome {
  color: var(--accent);
  font-size: 12px;
  line-height: 1.35;
  white-space: pre
}

.hl-cmd {
  color: var(--green);
  font-weight: 600
}

.line {
  margin-bottom: 1px;
  white-space: pre-wrap;
  word-break: break-word
}

.line.cmd {
  color: var(--green)
}

.line.cmd::before {
  content: '❯ ';
  color: var(--text-muted)
}

.line.error {
  color: var(--red)
}

.line.info {
  color: var(--text-secondary)
}

.line.success {
  color: var(--accent)
}

.line.heading {
  color: var(--text);
  font-weight: 600;
  margin-top: 4px
}

.terminal__input-area {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.terminal__prompt {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.prompt-branch {
  color: var(--accent);
  font-weight: 500
}

.prompt-symbol {
  color: var(--green)
}

.terminal__input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text);
  caret-color: var(--accent);
}

.terminal__input::placeholder {
  color: var(--text-muted)
}

/* ── Scrollbar ─────────────────────────────────────── */
::-webkit-scrollbar {
  width: 5px
}

::-webkit-scrollbar-track {
  background: transparent
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-light)
}

/* ── Responsive ────────────────────────────────────── */
@media(max-width:960px) {
  .app {
    grid-template-columns: 1fr
  }

  .panel {
    display: none
  }

  .dsa-badges {
    display: none
  }
}