/* ─────────────────────────────────────────
   RADISH — style.css
   ───────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans:wght@400;500;600&display=swap');

/* ── TOKENS ── */
:root {
  --bg-base:        #0b0d12;
  --bg-surface:     #0f1219;
  --bg-raised:      #141720;
  --bg-overlay:     #1a1e2a;
  --bg-subtle:      #1e2233;
  --bg-muted:       #242840;
  --border-faint:   #181c28;
  --border-default: #1f2436;
  --border-strong:  #2d334d;
  --border-focus:   #3d4a7a;
  --text-primary:   #d4d9e4;
  --text-secondary: #9aa4bc;
  --text-tertiary:  #6b7491;
  --text-disabled:  #3e4560;
  --text-link:      #7eaae8;
  --accent-green:   oklch(68% 0.16 145);
  --accent-teal:    oklch(68% 0.16 195);
  --accent-amber:   oklch(68% 0.16 75);
  --accent-rose:    oklch(68% 0.16 15);
  --accent-purple:  oklch(68% 0.16 290);
  --accent-blue:    oklch(68% 0.16 240);
  --accent-green-bg:  oklch(18% 0.06 145);
  --accent-teal-bg:   oklch(18% 0.06 195);
  --accent-amber-bg:  oklch(18% 0.06 75);
  --accent-rose-bg:   oklch(18% 0.06 15);
  --accent-blue-bg:   oklch(18% 0.06 240);
  --font-ui:   'IBM Plex Sans', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 6px;
  --radius-full: 9999px;
}

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

body {
  font-family: var(--font-ui);
  font-size: 1rem;
  color: var(--text-primary);
  background: var(--bg-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: var(--text-link); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre { font-family: var(--font-mono); }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-focus); }

/* ── TOPBAR ── */
.topbar {
  height: 40px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-brand {
  display: flex; align-items: center; gap: 8px;
  font-size: 1rem; font-weight: 600; letter-spacing: -0.01em;
  color: var(--text-primary);
}
.topbar-brand:hover { text-decoration: none; color: var(--text-primary); }
.badge-alpha {
  font-size: 0.65rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 1px 6px; border-radius: 4px;
  background: oklch(62% 0.2 15 / 0.15); color: oklch(62% 0.2 15);
}
.topbar-auth { display: flex; align-items: center; gap: 12px; font-size: 0.925rem; }
.topbar-auth a { color: var(--text-secondary); }
.topbar-auth a:hover { color: var(--text-primary); text-decoration: none; }

/* ── CONTAINER ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-ui); font-size: 0.925rem; font-weight: 500;
  padding: 4px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--bg-subtle);
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s;
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover { background: var(--bg-muted); text-decoration: none; }
.btn-primary {
  background: var(--accent-green-bg);
  border-color: var(--accent-green);
  color: var(--accent-green);
}
.btn-primary:hover { opacity: 0.85; }
.btn-secondary {
  background: var(--bg-muted);
  border-color: var(--border-strong);
  color: var(--text-primary);
}
.btn-secondary:hover { opacity: 0.85; }
.btn-ghost {
  background: transparent;
  border-color: var(--border-default);
  color: var(--text-secondary);
}
.btn-ghost:hover { background: var(--bg-raised); color: var(--text-primary); }
.btn-warning {
  background: var(--accent-amber-bg);
  border-color: var(--accent-amber);
  color: var(--accent-amber);
}
.btn-warning:hover { opacity: 0.85; }

/* ── REPO HEADER ── */
.repo-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-default);
  padding: 16px 20px 0;
}
.repo-header-inner {
  display: flex; align-items: flex-start; gap: 14px;
  padding-bottom: 14px;
}
.repo-avatar {
  width: 52px; height: 52px; border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 1.7rem; color: #fff;
  flex-shrink: 0; font-weight: 500;
}
.repo-title { font-size: 1.4rem; font-weight: 600; letter-spacing: -0.02em; color: var(--text-primary); }
.repo-title a { color: inherit; text-decoration: none; }
.repo-title a:hover { text-decoration: underline; }
.repo-rid {
  font-family: var(--font-mono); font-size: 0.85rem; color: var(--text-tertiary);
  margin-top: 2px; margin-bottom: 4px;
}
.repo-rid-copy {
  display: inline-flex; align-items: center; gap: 4px;
  cursor: pointer; user-select: none;
  border-radius: 4px; padding: 1px 4px; margin-left: -4px;
}
.repo-rid-copy:hover { color: var(--text-secondary); background: var(--bg-tertiary); }
.repo-rid-copy .rid-check-icon { display: none; }
.repo-rid-copy.copied .rid-copy-icon { display: none; }
.repo-rid-copy.copied .rid-check-icon { display: inline; color: var(--color-positive, #2ea44f); }
.repo-desc { font-size: 1rem; color: var(--text-secondary); }

/* ── REPO NAV TABS ── */
.repo-nav {
  display: flex; gap: 0;
  margin-top: 12px;
}
.repo-tab {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.925rem; font-weight: 400;
  color: var(--text-secondary);
  padding: 8px 12px;
  border-bottom: 2px solid transparent;
  transition: color 0.1s;
  text-decoration: none;
}
.repo-tab:hover { color: var(--text-primary); text-decoration: none; }
.repo-tab.active { color: var(--text-primary); border-bottom-color: var(--text-primary); font-weight: 500; }
.repo-tab .tab-count {
  background: var(--bg-subtle); border: 1px solid var(--border-default);
  border-radius: var(--radius-md); color: var(--text-secondary);
  font-family: var(--font-mono); font-size: 0.75rem;
  padding: 0 5px; line-height: 16px;
}

/* ── BRANCH SELECTOR ── */
.branch-selector { padding: 10px 20px; background: var(--bg-surface); border-bottom: 1px solid var(--border-faint); }

/* Branch dropdown */
.branch-dropdown-wrap { position: relative; display: inline-block; max-width: 100%; min-width: 0; }
.branch-dropdown-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-raised); border: 1px solid var(--border-default); border-radius: var(--radius-md);
  color: var(--text-secondary); font-family: var(--font-ui); font-size: 0.875rem;
  padding: 5px 10px; cursor: pointer; outline: none;
  max-width: 100%; min-width: 0;
}
.branch-dropdown-btn > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.branch-dropdown-btn > svg, .branch-dropdown-btn > .badge-canonical { flex-shrink: 0; }
.branch-dropdown-btn:hover { border-color: var(--border-strong); color: var(--text-primary); }
.branch-chevron { transition: transform 0.15s; }
.branch-dropdown-wrap.open .branch-chevron { transform: rotate(180deg); }
.branch-dropdown-panel {
  display: none; position: absolute; top: calc(100% + 4px); left: 0; z-index: 100;
  min-width: 320px; max-height: 420px;
  background: var(--bg-raised); border: 1px solid var(--border-default); border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4); overflow: hidden;
  flex-direction: column;
}
.branch-dropdown-wrap.open .branch-dropdown-panel { display: flex; }
.branch-dropdown-filter {
  padding: 8px; border-bottom: 1px solid var(--border-faint);
}
.branch-dropdown-filter input {
  width: 100%; background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: var(--radius-md);
  color: var(--text-primary); font-family: var(--font-ui); font-size: 0.825rem;
  padding: 6px 10px; outline: none;
}
.branch-dropdown-filter input:focus { border-color: var(--border-focus); }
.branch-dropdown-filter input::placeholder { color: var(--text-disabled); }
.branch-dropdown-list {
  overflow-y: auto; max-height: 360px; padding: 4px 0;
}
.branch-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 6px 12px; border: none; background: none;
  color: var(--text-secondary); font-family: var(--font-ui); font-size: 0.825rem;
  cursor: pointer; text-align: left; white-space: nowrap;
}
.branch-item:hover { background: var(--bg-overlay); color: var(--text-primary); }
.branch-item.active { background: var(--bg-subtle); color: var(--text-primary); }
.branch-item svg { flex-shrink: 0; color: var(--text-tertiary); }
.branch-item-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.branch-item-hash { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-tertiary); flex-shrink: 0; }

/* Peer groups */
.branch-group-header {
  display: flex; align-items: center; gap: 6px; width: 100%;
  padding: 6px 12px; border: none; background: none;
  color: var(--text-secondary); font-family: var(--font-ui); font-size: 0.825rem;
  cursor: pointer; text-align: left;
}
.branch-group-header:hover { background: var(--bg-overlay); }
.branch-group-chevron { flex-shrink: 0; transition: transform 0.15s; color: var(--text-tertiary); }
.branch-group.expanded > .branch-group-header .branch-group-chevron { transform: rotate(90deg); }
.peer-avatar {
  width: 18px; height: 18px; border-radius: var(--radius-full); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.625rem; font-weight: 600; color: #fff; text-transform: uppercase;
}
.peer-alias { font-weight: 500; }
.branch-group-items { display: none; }
.branch-group.expanded > .branch-group-items { display: block; }
.branch-group-items .branch-item { padding-left: 38px; }

/* Badges */
.badge-canonical {
  display: inline-flex; align-items: center;
  font-size: 0.675rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em;
  padding: 1px 6px; border-radius: var(--radius-full);
  background: var(--accent-blue-bg); color: oklch(72% 0.12 240);
  white-space: nowrap;
}
.badge-delegate {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 0.675rem; font-weight: 600; letter-spacing: 0.03em;
  padding: 1px 6px; border-radius: var(--radius-full);
  background: var(--accent-green-bg); color: oklch(72% 0.12 145);
  white-space: nowrap;
}
.badge-delegate::before { content: "✓"; font-size: 0.6rem; }

/* Sidebar-specific overrides */
.sidebar-branch-dropdown .branch-dropdown-btn { width: 100%; }
.sidebar-branch-dropdown .branch-dropdown-panel { width: max-content; min-width: 100%; }

/* ── MAIN PAGE LAYOUT ── */
.page-body { padding: 20px; }
.page-body-wide { padding: 0; }

/* ── FILE TABLE ── */
.file-table {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 20px;
}
.file-row {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 14px;
  border-bottom: 1px solid var(--border-faint);
  font-size: 0.925rem; color: var(--text-secondary);
  transition: background 0.1s;
}
.file-row:last-child { border-bottom: none; }
.file-row:hover { background: var(--bg-raised); }
.file-row a { color: var(--text-primary); font-weight: 500; }
.file-row a:hover { color: var(--text-link); text-decoration: none; }
.file-icon { opacity: 0.5; width: 14px; flex-shrink: 0; font-style: normal; }

/* ── COMMIT BAR ── */
.commit-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 14px;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border-faint);
  font-size: 0.925rem;
}
.commit-author-avatar {
  width: 18px; height: 18px; border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; color: #fff; font-family: var(--font-mono);
  flex-shrink: 0;
}

/* ── README / CONTENT ── */
.readme-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 20px;
}
.readme-panel-header {
  padding: 8px 14px;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border-faint);
  font-size: 0.925rem; font-weight: 500; color: var(--text-secondary);
}
.readme-panel-body { padding: 24px 28px; }

/* ── BREADCRUMB ── */
.breadcrumb {
  font-size: 0.925rem;
  color: var(--text-tertiary);
  margin-bottom: 14px;
  display: flex; align-items: center; gap: 5px;
}
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--text-primary); text-decoration: none; }
.breadcrumb-sep { color: var(--text-tertiary); }

/* ── BLOB FILE HEADER ── */
.blob-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border-faint);
}
.blob-header-path { font-size: 0.925rem; font-weight: 500; color: var(--text-secondary); }
.blob-tab-bar { display: flex; gap: 4px; }
.blob-tab {
  padding: 3px 10px; font-size: 0.85rem; font-weight: 500;
  border-radius: var(--radius-md); border: 1px solid transparent;
  background: none; color: var(--text-tertiary); cursor: pointer;
  font-family: var(--font-ui); transition: all 0.1s;
}
.blob-tab:hover { color: var(--text-primary); }
.blob-tab.active { background: var(--bg-subtle); border-color: var(--border-strong); color: var(--text-primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── MARKDOWN ── */
.markdown-body {
  font-size: 1rem; line-height: 1.75; color: var(--text-secondary);
  word-wrap: break-word;
}
.markdown-body h1 { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; color: var(--text-primary); margin: 0 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--border-faint); }
.markdown-body h2 { font-size: 1.15rem; font-weight: 600; color: var(--text-primary); margin: 24px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--border-faint); }
.markdown-body h3 { font-size: 1rem; font-weight: 600; color: var(--text-primary); margin: 16px 0 6px; }
.markdown-body h4, .markdown-body h5, .markdown-body h6 { font-size: 1rem; font-weight: 600; color: var(--text-secondary); margin: 12px 0 4px; }
.markdown-body p { margin: 0 0 12px; }
.markdown-body ul, .markdown-body ol { padding-left: 20px; margin: 0 0 12px; }
.markdown-body li + li { margin-top: 3px; }
.markdown-body blockquote {
  border-left: 3px solid var(--border-strong);
  padding: 4px 14px; margin: 0 0 12px;
  color: var(--text-tertiary);
}
.markdown-body code {
  font-family: var(--font-mono); font-size: 0.875rem;
  background: var(--bg-raised); color: var(--text-primary);
  padding: 1px 5px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-faint);
}
.markdown-body pre {
  background: var(--bg-raised); border: 1px solid var(--border-default);
  border-radius: var(--radius-lg); padding: 14px 16px; margin: 0 0 14px;
  overflow-x: auto;
}
.markdown-body pre code {
  background: none; border: none; padding: 0;
  font-size: 0.925rem; color: var(--text-primary); line-height: 1.65;
}
.markdown-body a { color: var(--text-link); }
.markdown-body a:hover { text-decoration: underline; }
.markdown-body img { max-width: 100%; height: auto; border-radius: var(--radius-md); }
.markdown-body table { border-collapse: collapse; margin: 0 0 14px; width: 100%; }
.markdown-body table th, .markdown-body table td { padding: 6px 12px; border: 1px solid var(--border-default); font-size: 0.925rem; }
.markdown-body table th { font-weight: 600; background: var(--bg-raised); color: var(--text-primary); }
.markdown-body table tr:nth-child(2n) { background: var(--bg-raised); }
.markdown-body hr { height: 1px; background: var(--border-default); border: 0; margin: 20px 0; }
.markdown-body input[type="checkbox"] { margin-right: 4px; }
pre { background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: var(--radius-lg); padding: 14px 16px; overflow-x: auto; font-size: 0.925rem; line-height: 1.65; color: var(--text-primary); }
pre code.hljs { background: var(--bg-surface); padding: 0; }

/* ── STATUS BADGES ── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.85rem; font-weight: 500;
  padding: 2px 8px; border-radius: var(--radius-full);
  border: 1px solid transparent;
}
.badge-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; display: inline-block; }
.badge-open  { background: var(--accent-green-bg); border-color: oklch(25% 0.08 145); color: var(--accent-green); }
.badge-closed { background: var(--accent-rose-bg); border-color: oklch(25% 0.08 15); color: var(--accent-rose); }
.badge-draft { background: var(--bg-subtle); border-color: var(--border-strong); color: var(--text-secondary); }
.badge-merged { background: var(--accent-teal-bg); border-color: oklch(25% 0.08 195); color: var(--accent-teal); }
.badge-archived { background: var(--accent-amber-bg); border-color: oklch(25% 0.08 75); color: var(--accent-amber); }

/* ── LABEL TAGS ── */
.label {
  display: inline-flex; align-items: center;
  font-size: 0.75rem; font-weight: 500;
  padding: 1px 7px; border-radius: var(--radius-full);
  background: var(--accent-blue-bg); border: 1px solid oklch(25% 0.08 240);
  color: var(--accent-blue); margin-right: 4px;
}

/* ── HASH CHIP ── */
.hash {
  display: inline-flex; align-items: center;
  font-family: var(--font-mono); font-size: 0.85rem;
  color: var(--text-tertiary); background: var(--bg-raised);
  border: 1px solid var(--border-faint); border-radius: var(--radius-sm);
  padding: 1px 6px;
}

/* ── ISSUE / PATCH LIST ── */
.item-list {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.item-list-header {
  padding: 8px 16px;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border-faint);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.925rem; color: var(--text-secondary);
}
.item-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border-faint);
  transition: background 0.1s; cursor: pointer;
}
.item-row:last-child { border-bottom: none; }
.item-row:hover { background: var(--bg-raised); }
.item-row a { text-decoration: none; }
.item-row a:hover { text-decoration: none; }
.item-title { font-size: 1rem; font-weight: 500; color: var(--text-primary); margin-bottom: 4px; }
.item-title:hover { color: var(--text-link); }
.item-meta { font-size: 0.85rem; color: var(--text-tertiary); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.item-meta a { color: var(--text-tertiary); }
.item-meta a:hover { color: var(--text-secondary); text-decoration: none; }

.list-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}

/* ── STATE TABS ── */
.state-tabs {
  display: flex; align-items: center; gap: 4px;
}
.state-tab {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.925rem; font-weight: 500;
  padding: 5px 12px; border-radius: var(--radius-full);
  color: var(--text-tertiary);
  text-decoration: none;
  transition: background 0.1s, color 0.1s;
}
.state-tab:hover { color: var(--text-secondary); background: var(--bg-raised); text-decoration: none; }
.state-tab.active { color: var(--text-primary); background: var(--bg-subtle); }
.state-tab .badge-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.state-tab .badge-dot.open { background: var(--accent-green); }
.state-tab .badge-dot.closed { background: var(--accent-rose); }
.state-tab .badge-dot.draft { background: var(--text-tertiary); }
.state-tab .badge-dot.merged { background: var(--accent-teal); }
.state-tab .badge-dot.archived { background: var(--accent-amber); }

.empty-state {
  padding: 40px 20px; text-align: center;
  font-size: 1rem; color: var(--text-tertiary);
}

/* ── ISSUE / PATCH DETAIL ── */
.detail-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
}
.detail-header {
  padding: 12px 16px;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border-faint);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.detail-title { font-size: 1.15rem; font-weight: 600; color: var(--text-primary); line-height: 1.4; }
.detail-body { padding: 16px; }
.detail-author { font-size: 0.925rem; color: var(--text-tertiary); margin-bottom: 12px; }
.detail-author a { color: var(--text-secondary); }

/* ── COMMENT ── */
.comment-thread { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.comment {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.comment-header {
  padding: 8px 14px;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border-faint);
  font-size: 0.925rem; color: var(--text-tertiary);
  display: flex; align-items: center; gap: 8px;
}
.comment-header a { color: var(--text-secondary); font-weight: 500; }
.comment-header a:hover { text-decoration: none; color: var(--text-primary); }
.comment-body { padding: 14px 16px; }

/* ── FORMS ── */
.form-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
}
.form-panel-header {
  padding: 8px 14px;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border-faint);
  font-size: 0.925rem; font-weight: 500; color: var(--text-secondary);
}
.form-panel-body { padding: 16px; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 0.925rem; font-weight: 500; color: var(--text-secondary); margin-bottom: 5px; }
.form-group input[type="text"],
.form-group textarea {
  width: 100%; padding: 7px 10px;
  background: var(--bg-base);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-ui); font-size: 1rem;
  outline: none; transition: border-color 0.1s;
}
.form-group input[type="text"]:focus,
.form-group textarea:focus { border-color: var(--border-focus); }
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--text-disabled); }
.form-group textarea { min-height: 120px; resize: vertical; line-height: 1.6; }
textarea, input[type="text"] {
  background: var(--bg-base);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-ui); font-size: 1rem;
  padding: 7px 10px; outline: none;
}
textarea { min-height: 120px; resize: vertical; width: 100%; }
textarea.code-editor {
  font-family: var(--font-mono, ui-monospace, 'SFMono-Regular', 'SF Mono', Menlo, Consolas, monospace);
  font-size: 13px;
  line-height: 1.5;
  min-height: 400px;
  tab-size: 4;
  white-space: pre;
  overflow-x: auto;
}
input[type="text"] { width: 100%; }

/* ── PATCH DIFF ── */
.diff-file {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 10px;
}
.diff-file-header {
  padding: 7px 12px;
  background: var(--bg-raised);
  font-size: 0.925rem; cursor: pointer;
  color: var(--text-secondary);
  display: flex; align-items: center; gap: 8px;
  list-style: none;
}
.diff-file[open] .diff-file-header { border-bottom: 1px solid var(--border-faint); }
.diff-status {
  display: inline-block; padding: 1px 6px; font-size: 0.75rem; font-weight: 600;
  border-radius: var(--radius-sm); text-transform: uppercase; letter-spacing: 0.04em;
  flex-shrink: 0;
}
.diff-status-added    { background: var(--accent-green-bg); color: var(--accent-green); }
.diff-status-deleted  { background: var(--accent-rose-bg);  color: var(--accent-rose); }
.diff-status-modified { background: var(--accent-amber-bg); color: var(--accent-amber); }
.diff-status-renamed  { background: var(--accent-blue-bg);  color: var(--accent-blue); }
.diff-status-copied   { background: var(--accent-blue-bg);  color: var(--accent-blue); }
.diff-status-changed  { background: var(--bg-subtle); color: var(--text-secondary); }
.diff-content { overflow-x: auto; }
.diff-hunk-header {
  padding: 3px 12px;
  background: var(--bg-overlay);
  color: var(--text-tertiary);
  font-size: 0.85rem; font-family: var(--font-mono);
  border-bottom: 1px solid var(--border-faint);
}
.diff-table { width: 100%; border-collapse: collapse; }
.diff-table td { padding: 0 10px; border: none; font-size: 0.875rem; font-family: var(--font-mono); line-height: 20px; vertical-align: top; }
.diff-origin { width: 16px; text-align: center; user-select: none; color: var(--text-tertiary); }
.diff-line pre { margin: 0; padding: 0; background: none; border: none; border-radius: 0; font-size: 0.875rem; line-height: 20px; white-space: pre-wrap; word-wrap: break-word; color: var(--text-secondary); }
.diff-line pre code.hljs { background: transparent; padding: 0; }
.diff-add { background: oklch(16% 0.06 145); }
.diff-add .diff-origin { color: var(--accent-green); }
.diff-add .diff-line pre { color: oklch(78% 0.1 145); }
.diff-del { background: oklch(16% 0.06 15); }
.diff-del .diff-origin { color: var(--accent-rose); }
.diff-del .diff-line pre { color: oklch(78% 0.1 15); }
.diff-ctx { background: transparent; }

/* ── REVISION CARD ── */
.revision-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
}
.revision-header {
  padding: 10px 14px;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border-faint);
  font-size: 0.925rem; color: var(--text-secondary);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.revision-header strong { color: var(--text-primary); font-weight: 600; }
.revision-header a { color: var(--text-secondary); }
.revision-body { padding: 14px 16px; }

/* ── PATCH TABS (Activity / Changes) ── */
.patch-tabs {
  display: flex; align-items: center; gap: 0;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-default);
}
.patch-tab {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.925rem; font-weight: 400;
  color: var(--text-secondary);
  padding: 8px 14px;
  border-bottom: 2px solid transparent;
  transition: color 0.1s;
  text-decoration: none;
  margin-bottom: -1px;
}
.patch-tab:hover { color: var(--text-primary); text-decoration: none; }
.patch-tab.active { color: var(--text-primary); border-bottom-color: var(--text-primary); font-weight: 500; }

/* ── DIFF STAT INLINE ── */
.diff-stat-inline {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-mono); font-size: 0.8rem;
}
.diff-stat-add { color: var(--accent-green); }
.diff-stat-del { color: var(--accent-rose); }

/* ── CHANGES HEADER ── */
.changes-header {
  padding: 10px 14px;
  background: var(--bg-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  font-size: 0.925rem; color: var(--text-secondary);
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
}

/* ── TIMELINE ── */
.timeline {
  position: relative;
  padding-left: 0;
}
.timeline-item {
  position: relative;
  padding-left: 28px;
  padding-bottom: 16px;
  min-height: 32px;
}
.timeline-line {
  position: absolute;
  left: 7px;
  top: 16px;
  bottom: 0;
  width: 1px;
  background: var(--border-default);
}
.timeline-item:last-child .timeline-line { display: none; }
.timeline-dot {
  position: absolute;
  left: 2px;
  top: 5px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--bg-subtle);
  border: 2px solid var(--border-strong);
  z-index: 1;
}
.timeline-dot.dot-revision { border-color: var(--accent-blue); background: var(--accent-blue-bg); }
.timeline-dot.dot-review { border-color: var(--accent-purple); background: oklch(18% 0.06 290); }
.timeline-dot.dot-merge { border-color: var(--accent-teal); background: var(--accent-teal-bg); }
.timeline-dot.dot-comment { border-color: var(--text-tertiary); background: var(--bg-subtle); }
.timeline-content { min-width: 0; }
.timeline-event-header {
  font-size: 0.925rem;
  color: var(--text-secondary);
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  line-height: 1.6;
}
.timeline-event-header a { color: var(--text-primary); font-weight: 500; }
.timeline-event-header a:hover { text-decoration: none; }
.timeline-time {
  margin-left: auto;
  color: var(--text-tertiary);
  font-size: 0.85rem;
  white-space: nowrap;
}
.timeline-body {
  margin-top: 8px;
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
}
.timeline-body .markdown-body { font-size: 0.925rem; }

/* ── REVIEW VERDICT ── */
.review-verdict {
  font-weight: 600; font-size: 0.85rem;
  padding: 1px 7px; border-radius: var(--radius-full);
}
.review-accept { background: var(--accent-green-bg); color: var(--accent-green); border: 1px solid oklch(25% 0.08 145); }
.review-reject { background: var(--accent-rose-bg); color: var(--accent-rose); border: 1px solid oklch(25% 0.08 15); }

/* ── PROFILE ── */
.profile-page { padding-top: 32px; padding-bottom: 48px; max-width: 820px; }

/* Hero */
.profile-hero {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding-bottom: 24px;
  margin-bottom: 32px;
}
.profile-avatar {
  width: 72px; height: 72px;
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 2rem; font-weight: 500;
  color: #fff; flex-shrink: 0;
}
.profile-hero-info { flex: 1; min-width: 0; padding-top: 2px; }
.profile-name {
  font-size: 1.4rem; font-weight: 600; letter-spacing: -0.02em;
  color: var(--text-primary); margin-bottom: 6px;
}
.profile-name-unknown { color: var(--text-tertiary); }
.profile-ids {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 4px; flex-wrap: wrap;
}
.profile-hash-label {
  font-size: 0.75rem; font-weight: 500; color: var(--text-tertiary);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.profile-hash {
  display: inline-flex; align-items: center;
  font-family: var(--font-mono); font-size: 0.75rem;
  color: var(--text-tertiary);
  background: var(--bg-raised);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-sm);
  padding: 1px 6px;
  word-break: break-all;
}

/* Sections */
.profile-section { margin-bottom: 32px; }
.profile-section-header {
  display: flex; align-items: baseline; gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-default);
}
.profile-section-title {
  font-size: 1.1rem; font-weight: 600; letter-spacing: -0.01em;
  color: var(--text-primary);
}
.profile-section-count {
  font-family: var(--font-mono); font-size: 0.75rem;
  background: var(--bg-subtle); border: 1px solid var(--border-default);
  border-radius: var(--radius-md); color: var(--text-secondary);
  padding: 0 5px; line-height: 16px;
}

/* Notices */
.profile-notice {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  font-size: 0.875rem; line-height: 1.5;
  border: 1px solid;
  margin-bottom: 12px;
}
.profile-notice p { margin: 0; }
.profile-notice strong { color: var(--text-primary); }
.profile-notice code {
  font-family: var(--font-mono); font-size: 0.8em;
  background: var(--bg-raised); border: 1px solid var(--border-faint);
  padding: 1px 5px; border-radius: var(--radius-sm);
}
.profile-notice svg { flex-shrink: 0; margin-top: 2px; }
.profile-notice-sub {
  font-size: 0.8rem; color: var(--text-tertiary); margin-top: 4px;
}
.profile-notice-info {
  background: oklch(18% 0.06 240);
  border-color: oklch(25% 0.08 240);
  color: var(--text-secondary);
}
.profile-notice-info svg { color: var(--accent-blue); }
.profile-notice-success {
  background: oklch(18% 0.06 145);
  border-color: oklch(25% 0.08 145);
  color: var(--text-secondary);
}
.profile-notice-success svg { color: var(--accent-green); }

/* Actions */
.profile-actions {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
}

/* Panel */
.profile-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.profile-panel-header {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-faint);
  background: var(--bg-raised);
  font-size: 0.875rem; font-weight: 500;
  color: var(--text-primary);
}
.profile-panel-header svg { color: var(--text-tertiary); }
.profile-panel-body { padding: 16px; }
.profile-panel-desc {
  font-size: 0.875rem; color: var(--text-secondary);
  line-height: 1.6; margin-bottom: 16px;
}

/* Steps */
.profile-steps {
  margin: 0; padding-left: 20px;
  font-size: 0.875rem; line-height: 1.6;
  color: var(--text-secondary);
  list-style: decimal;
}
.profile-steps li {
  margin-bottom: 14px;
  padding-left: 4px;
}
.profile-steps li:last-child { margin-bottom: 0; }
.profile-step-text { display: block; margin-bottom: 6px; }
.profile-step-action { margin-top: 6px; }
.profile-step-hint {
  display: block; margin-top: 6px;
  font-size: 0.8rem; color: var(--text-tertiary);
}
.profile-step-hint code {
  font-family: var(--font-mono); font-size: 0.85em;
  color: var(--text-tertiary); background: var(--bg-raised);
  border: 1px solid var(--border-faint);
  padding: 1px 5px; border-radius: var(--radius-sm);
}
.profile-code-block {
  margin-top: 6px;
}
.profile-code-block pre {
  padding: 8px 12px;
  background: var(--bg-raised);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-md);
  overflow-x: auto;
}
.profile-code-block code {
  font-family: var(--font-mono); font-size: 0.8rem;
  color: var(--text-tertiary);
  background: none; border: none; padding: 0;
}

/* ── LANDING PAGE ── */
.landing-hero {
  background:
    radial-gradient(ellipse 80% 60% at 50% 120%, oklch(18% 0.08 145), transparent),
    radial-gradient(ellipse 60% 50% at 80% 0%, oklch(14% 0.06 240), transparent),
    var(--bg-surface);
  border-bottom: 1px solid var(--border-default);
  padding: 64px 20px 56px;
  position: relative;
  overflow: hidden;
}
.landing-hero-inner {
  display: flex;
  align-items: center;
  gap: 48px;
}
.landing-hero-text {
  flex: 1;
  min-width: 0;
  text-align: left;
}
@media (max-width: 860px) {
  .landing-hero-inner {
    flex-direction: column;
    text-align: center;
  }
  .landing-hero-text { text-align: center; }
}
.landing-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 63px,
    var(--border-faint) 63px,
    var(--border-faint) 64px
  );
  opacity: 0.4;
  pointer-events: none;
}
.landing-title {
  font-size: 2.5rem;
  font-weight: 600;
  letter-spacing: -0.035em;
  color: var(--text-primary);
  margin-bottom: 16px;
  line-height: 1.15;
  position: relative;
}
.landing-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 620px;
  line-height: 1.65;
  position: relative;
}
.landing-subtitle a {
  color: var(--accent-green);
  text-decoration: underline;
  text-decoration-color: oklch(68% 0.16 145 / 0.35);
  text-underline-offset: 2px;
}
.landing-subtitle a:hover {
  text-decoration-color: var(--accent-green);
}
/* ── LIVE DEMO BROWSER ── */
.demo-browser {
  flex-shrink: 0;
  width: 480px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  box-shadow: 0 20px 60px rgba(0,0,0,0.45), 0 0 0 1px rgba(255,255,255,0.04);
  position: relative;
  text-align: left;
}
.demo-browser-chrome {
  background: var(--bg-raised);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-default);
}
.demo-browser-dots { display: flex; gap: 6px; }
.demo-dot {
  width: 10px; height: 10px; border-radius: 50%;
}
.demo-dot-red   { background: #ff5f56; }
.demo-dot-yellow { background: #ffbd2e; }
.demo-dot-green  { background: #27c93f; }
.demo-browser-bar {
  flex: 1;
  background: var(--bg-base);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 4px 12px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.demo-browser-body {
  background: var(--bg-base);
  padding: 0;
  font-size: 0.8rem;
  user-select: none;
}

/* Demo repo header */
.demo-repo-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px 6px;
  background: var(--bg-surface);
}
.demo-repo-avatar {
  width: 28px; height: 28px; border-radius: 4px;
  background: oklch(42% 0.1 145);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 0.9rem; color: #fff;
  font-weight: 500;
}
.demo-repo-name { font-weight: 600; font-size: 0.9rem; color: var(--text-primary); }
.demo-repo-rid { font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-tertiary); }

/* Demo tabs */
.demo-tabs {
  display: flex;
  gap: 0;
  padding: 0 14px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-default);
}
.demo-tab {
  padding: 6px 10px;
  font-size: 0.7rem;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.demo-tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--text-primary);
  font-weight: 500;
}
.demo-tab-count {
  background: var(--bg-subtle);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  padding: 0 4px;
  line-height: 14px;
}

/* Demo patch header */
.demo-patch-header {
  padding: 12px 14px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.demo-patch-title {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary);
}
.demo-badge-open {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.65rem;
  font-weight: 500;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  background: var(--accent-green-bg);
  color: var(--accent-green);
  border: 1px solid oklch(25% 0.08 145);
  white-space: nowrap;
}
.demo-badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent-green);
}

/* Demo timeline */
.demo-timeline {
  padding: 0 14px 8px;
}
.demo-tl-item {
  position: relative;
  padding-left: 20px;
  padding-bottom: 10px;
}
.demo-tl-dot {
  position: absolute;
  left: 2px; top: 3px;
  width: 9px; height: 9px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  background: var(--bg-subtle);
}
.demo-tl-dot-revision { border-color: var(--accent-blue); background: var(--accent-blue-bg); }
.demo-tl-dot-review   { border-color: var(--accent-purple); background: oklch(18% 0.06 290); }
.demo-tl-dot-comment  { border-color: var(--text-tertiary); background: var(--bg-subtle); }
.demo-tl-text {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.demo-tl-text strong { color: var(--text-primary); font-weight: 500; }
.demo-hash {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-link);
  background: var(--bg-subtle);
  padding: 0 4px;
  border-radius: var(--radius-sm);
}
.demo-time {
  margin-left: auto;
  color: var(--text-tertiary);
  font-size: 0.65rem;
  white-space: nowrap;
}
.demo-verdict-accept {
  font-weight: 600;
  font-size: 0.65rem;
  padding: 0 5px;
  border-radius: var(--radius-full);
  background: var(--accent-green-bg);
  color: var(--accent-green);
  border: 1px solid oklch(25% 0.08 145);
}

/* Demo comment form */
.demo-form {
  margin: 0 14px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.demo-form-header {
  padding: 5px 10px;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border-faint);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-secondary);
}
.demo-form-body {
  padding: 10px;
}
.demo-textarea {
  width: 100%;
  min-height: 48px;
  padding: 6px 8px;
  background: var(--bg-base);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 0.75rem;
  line-height: 1.5;
  margin-bottom: 8px;
  transition: border-color 0.15s;
}
.demo-textarea:not(.demo-textarea-empty) {
  border-color: var(--border-focus);
}
.demo-textarea.demo-textarea-empty {
  border-color: var(--border-default);
}
.demo-typed-text {
  color: var(--text-primary);
}
.demo-cursor {
  color: var(--text-link);
  animation: demoBlink 0.8s step-end infinite;
  font-weight: 300;
}
@keyframes demoBlink {
  50% { opacity: 0; }
}
.demo-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--accent-green);
  background: var(--accent-green-bg);
  color: var(--accent-green);
  cursor: default;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}
.demo-btn-active {
  transform: scale(0.95);
  box-shadow: 0 0 0 2px oklch(68% 0.16 145 / 0.3);
}
.demo-btn-disabled {
  opacity: 0.5;
}

/* New comment posted */
.demo-new-comment {
  display: none;
  margin: 0 14px 12px;
  padding-left: 20px;
  position: relative;
  animation: demoFadeIn 0.3s ease;
}
.demo-tl-body {
  margin-top: 5px;
  padding: 6px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  font-size: 0.75rem;
  color: var(--text-primary);
  line-height: 1.5;
}
@keyframes demoFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.landing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}
.landing-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 22px 22px 20px;
  position: relative;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.landing-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}
.landing-card:nth-child(1) { border-top: 2px solid var(--accent-green); }
.landing-card:nth-child(2) { border-top: 2px solid var(--accent-blue); }
.landing-card:nth-child(3) { border-top: 2px solid var(--accent-amber); }
.landing-card-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  margin-bottom: 12px;
}
.landing-card:nth-child(1) .landing-card-icon { background: var(--accent-green-bg); }
.landing-card:nth-child(2) .landing-card-icon { background: var(--accent-blue-bg); }
.landing-card:nth-child(3) .landing-card-icon { background: var(--accent-amber-bg); }
.landing-card-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.landing-card-text {
  font-size: 0.925rem;
  color: var(--text-secondary);
  line-height: 1.6;
}
.landing-card-text a {
  color: var(--accent-amber);
}
.landing-repos-section {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-faint);
}

/* ── REPO LIST ── */
.repo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.repo-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  transition: border-color 0.1s, background 0.1s;
  display: flex; flex-direction: column; gap: 10px;
  text-decoration: none;
}
.repo-card:hover { border-color: var(--border-strong); background: var(--bg-raised); text-decoration: none; }
.repo-card-header { display: flex; align-items: center; gap: 12px; }
.repo-card-avatar {
  width: 38px; height: 38px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 1.1rem; color: #fff;
  flex-shrink: 0; font-weight: 500;
}
.repo-card-title-group { min-width: 0; }
.repo-card-name { font-weight: 600; font-size: 1.075rem; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.repo-card-rid { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-tertiary); }
.repo-card-desc { font-size: 0.875rem; color: var(--text-secondary); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.repo-card-footer { display: flex; align-items: flex-end; justify-content: space-between; margin-top: auto; }
.repo-card-stats { display: flex; gap: 14px; }
.repo-card-stat {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-tertiary);
}
.repo-card-stat svg { opacity: 0.7; }
.repo-card-activity {
  display: flex; align-items: flex-end; gap: 2px; height: 28px;
}
.activity-bar {
  width: 4px; min-height: 1px;
  background: var(--text-tertiary);
  border-radius: 1px;
  opacity: 0.6;
}
.page-heading { font-size: 1.25rem; font-weight: 600; color: var(--text-primary); margin-bottom: 16px; letter-spacing: -0.01em; }

/* ── 3-COLUMN SOURCE LAYOUT ── */
.source-layout {
  display: grid;
  grid-template-columns: 220px 1fr 220px;
  min-height: calc(100vh - 170px);
}
.source-layout-full {
  grid-template-columns: 220px 1fr;
}

/* ── FILE SIDEBAR ── */
.file-sidebar {
  border-right: 1px solid var(--border-default);
  background: var(--bg-surface);
  padding: 12px 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.file-toolbar {
  padding: 0 10px 10px;
  border-bottom: 1px solid var(--border-faint);
  margin-bottom: 6px;
  display: flex; gap: 6px; align-items: center;
  position: relative; z-index: 10;
  flex-shrink: 0;
}
.file-tree { padding: 0 4px; overflow-y: auto; overflow-x: hidden; flex: 1; min-height: 0; }
.tree-item {
  display: flex; align-items: center; gap: 7px;
  padding: 3px 8px;
  font-size: 0.925rem; color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
  white-space: nowrap; text-decoration: none;
  overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.tree-item:hover { background: var(--bg-raised); color: var(--text-primary); text-decoration: none; }
.tree-item.active { background: var(--bg-subtle); color: var(--text-primary); }
.tree-item.dir { color: var(--text-primary); }
.tree-icon { width: 14px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; opacity: 0.6; }
.tree-item.active .tree-icon { opacity: 1; }

/* ── SOURCE CONTENT ── */
.source-content { background: var(--bg-base); overflow: auto; }
.commit-author { display: flex; align-items: center; gap: 6px; }
.commit-msg { color: var(--text-primary); font-weight: 500; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.commit-meta { color: var(--text-tertiary); white-space: nowrap; }

.file-content-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-default);
}
.file-breadcrumb { display: flex; align-items: center; gap: 5px; font-size: 0.925rem; }
.file-breadcrumb a { color: var(--text-secondary); }
.file-breadcrumb a:hover { color: var(--text-primary); text-decoration: none; }
.file-breadcrumb-sep { color: var(--text-tertiary); }
.file-breadcrumb-current { color: var(--text-primary); font-weight: 500; }

/* ── RIGHT SIDEBAR ── */
.right-sidebar {
  border-left: 1px solid var(--border-default);
  background: var(--bg-surface);
  padding: 16px 14px;
  display: flex; flex-direction: column; gap: 20px;
  overflow-y: auto;
}
.sidebar-section-title {
  font-size: 0.85rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text-tertiary); margin-bottom: 8px;
}
.sidebar-empty { font-size: 0.925rem; color: var(--text-tertiary); }
.sidebar-val { font-size: 0.925rem; color: var(--text-secondary); }
.sidebar-stat {
  display: flex; justify-content: space-between; font-size: 0.925rem;
}
.sidebar-stat-label { color: var(--text-tertiary); }
.sidebar-stat-value { font-family: var(--font-mono); color: var(--text-secondary); }
.sidebar-activity {
  display: flex; align-items: flex-end; gap: 2px; height: 40px;
}
.sidebar-activity .activity-bar { flex: 1; min-width: 0; }

/* ── DELEGATE DOTS ── */
.delegates-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.delegate-dot { width: 14px; height: 14px; border-radius: 3px; }
.delegate-link { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; text-decoration: none; }
.delegate-link span { font-size: 12px; color: var(--text-secondary); }
.delegate-link:hover span { color: var(--text-primary); }

/* ── BADGE COUNT (tab badges) ── */
.badge-count {
  display: inline-flex; align-items: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0 5px; line-height: 16px;
}

/* ── REPO HEADER SIDE ── */
.repo-header-side {
  flex-shrink: 0; display: flex; flex-direction: column;
  gap: 6px; align-items: flex-end; min-width: 180px;
}
.repo-header-side-label {
  font-size: 0.85rem; color: var(--text-tertiary);
}
.repo-header-side-label strong { color: var(--text-secondary); }

/* ── CLONE DROPDOWN ── */
.clone-dropdown-wrap { position: relative; display: inline-block; }
.clone-dropdown-wrap .btn { gap: 6px; }
.clone-dropdown {
  display: none;
  position: absolute; right: 0; top: calc(100% + 6px);
  width: 360px; z-index: 200;
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  padding: 14px;
}
.clone-dropdown-wrap.open .clone-dropdown { display: block; }
.clone-section { margin-bottom: 12px; }
.clone-section:last-child { margin-bottom: 0; }
.clone-section-title {
  font-size: 0.85rem; font-weight: 500;
  color: var(--text-tertiary); margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.clone-input-row {
  display: flex; gap: 6px;
}
.clone-input {
  flex: 1; min-width: 0;
  background: var(--bg-base);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: var(--font-mono); font-size: 0.8rem;
  padding: 5px 8px;
  outline: none; cursor: text;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.clone-copy-btn {
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.clone-copy-btn:hover { background: var(--bg-muted); color: var(--text-primary); }

/* ── UTILS ── */
.mt-4  { margin-top: 16px; }
.mt-6  { margin-top: 24px; }
.mb-4  { margin-bottom: 16px; }
.flex  { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.justify-between { justify-content: space-between; }

/* ── ONBOARDING ── */
.onboarding-backdrop {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 48px);
  padding: 32px 20px;
  background:
    radial-gradient(ellipse 80% 60% at 50% 120%, oklch(18% 0.08 145), transparent),
    radial-gradient(ellipse 60% 50% at 80% 0%, oklch(14% 0.06 240), transparent),
    var(--bg-surface);
}
.onboarding-modal {
  width: 100%;
  max-width: 560px;
  background: var(--bg-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.onboarding-header {
  font-size: 1.25rem;
  font-weight: 600;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-faint);
  color: var(--text-primary);
}
.onboarding-body {
  padding: 20px 24px 24px;
  line-height: 1.6;
  color: var(--text-secondary);
  font-size: 0.925rem;
}
.onboarding-body p { margin-bottom: 12px; }
.onboarding-body strong { color: var(--text-primary); }
.onboarding-features {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 16px 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.onboarding-feature {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
}
.onboarding-feature + .onboarding-feature {
  border-top: 1px solid var(--border-faint);
}
.onboarding-icon {
  flex-shrink: 0;
  font-size: 1.1rem;
  line-height: 1.4;
}
.onboarding-feature div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.onboarding-feature strong {
  font-size: 0.875rem;
  color: var(--text-primary);
}
.onboarding-feature span {
  font-size: 0.825rem;
  color: var(--text-tertiary);
  line-height: 1.45;
}
.onboarding-note {
  font-size: 0.825rem;
  color: var(--text-tertiary);
  margin-top: 4px;
}
.onboarding-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}
.btn-lg {
  padding: 8px 18px;
  font-size: 0.95rem;
}
/* Storage option cards */
.onboarding-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0;
}
.onboarding-option {
  background: var(--bg-surface);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.onboarding-option-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px 0;
  font-size: 0.925rem;
}
.onboarding-option-header strong {
  color: var(--text-primary);
}
.onboarding-badge {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: oklch(35% 0.12 145);
  color: oklch(85% 0.14 145);
}
.onboarding-option-body {
  padding: 6px 14px 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.onboarding-option-body p {
  margin-bottom: 6px;
}
.onboarding-option-action {
  padding: 10px 14px 14px;
}

/* Redirect interstitial */
.redirect-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 48px 32px;
  background: var(--bg-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
}
.redirect-spinner svg {
  width: 32px;
  height: 32px;
  color: var(--accent-green);
  animation: spin 1.2s linear infinite;
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.redirect-message {
  font-size: 0.925rem;
  color: var(--text-secondary);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

/* ── FOOTER ── */
.site-footer {
  margin-top: 48px;
  padding: 20px 0;
  border-top: 1px solid var(--border-faint);
  text-align: center;
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  font-size: 0.8rem;
}
.footer-links a {
  color: var(--text-tertiary);
  text-decoration: none;
}
.footer-links a:hover {
  color: var(--text-secondary);
}

/* ── LEGAL PAGES ── */
.legal-page {
  max-width: 720px;
  margin: 32px auto;
  padding: 0 20px;
}
.legal-page h1 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}
.legal-updated {
  font-size: 0.825rem;
  color: var(--text-tertiary);
  margin-bottom: 24px;
}
.legal-page h2 {
  font-size: 1.1rem;
  margin-top: 24px;
  margin-bottom: 8px;
  color: var(--text-primary);
}
.legal-page p {
  margin-bottom: 10px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.legal-page ul {
  margin: 0 0 10px 20px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.legal-page a {
  color: var(--text-link);
}
.faq-item {
  margin-bottom: 20px;
}
.faq-item h3 {
  font-size: 0.95rem;
  margin-bottom: 4px;
  color: var(--text-primary);
}

/* ── ONBOARDING LEGAL ── */
.onboarding-legal {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  margin-top: 16px;
}
.onboarding-legal a {
  color: var(--text-link);
}
