:root {
  --bg: #ffffff;
  --bg-subtle: #f6f8fa;
  --bg-input: #ffffff;
  --fg: #1f2328;
  --fg-muted: #59636e;
  --border: #d1d9e0;
  --accent: #0969da;
  --accent-fg: #ffffff;
  --primary: #1f883d;
  --primary-hover: #1a7f37;
  --danger: #d1242f;
  --danger-bg: #ffebe9;
  --success: #1a7f37;
  --success-bg: #dafbe1;
  --attention: #9a6700;
  --attention-bg: #fff8c5;
  --radius: 6px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --bg-subtle: #151b23;
    --bg-input: #0d1117;
    --fg: #f0f6fc;
    --fg-muted: #9198a1;
    --border: #3d444d;
    --accent: #4493f8;
    --primary: #238636;
    --primary-hover: #29903b;
    --danger: #f85149;
    --danger-bg: #25171c;
    --success: #3fb950;
    --success-bg: #1b2a1f;
    --attention: #d29922;
    --attention-bg: #272115;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace; font-size: 12px; }
h1, h2 { line-height: 1.25; }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 16px; top: 8px; background: var(--bg); padding: 4px 8px; z-index: 10; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
}
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--fg); font-weight: 600; font-size: 16px; }
.brand:hover { text-decoration: none; }
.header-nav { display: flex; align-items: center; gap: 16px; }
.header-nav > a { color: var(--fg); font-weight: 500; }
.header-user { font-weight: 600; }
.avatar {
  display: inline-grid; place-items: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); color: var(--accent-fg);
  font-size: 12px; font-weight: 600; text-transform: uppercase;
}
@media (max-width: 600px) { .header-user { display: none; } }

.container { flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: 24px 16px; }
.site-footer { padding: 16px; border-top: 1px solid var(--border); color: var(--fg-muted); font-size: 12px; text-align: center; }

/* Text helpers */
.muted { color: var(--fg-muted); }
.small { font-size: 12px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.float-right { float: right; font-weight: 400; }
.counter { display: inline-block; padding: 0 8px; border-radius: 2em; background: var(--bg-subtle); border: 1px solid var(--border); font-size: 12px; font-weight: 500; vertical-align: middle; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  padding: 5px 16px; min-height: 32px;
  font: inherit; font-weight: 500; line-height: 20px;
  color: var(--fg); background: var(--bg-subtle);
  border: 1px solid var(--border); border-radius: var(--radius);
  cursor: pointer; white-space: nowrap;
}
.btn:hover { text-decoration: none; filter: brightness(0.97); }
.btn:focus-visible, .input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.btn-primary { background: var(--primary); border-color: transparent; color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-sm { padding: 3px 12px; min-height: 28px; font-size: 12px; }
.btn-block { width: 100%; }
.btn-link { background: none; border: none; color: var(--accent); padding: 0; min-height: 0; font-weight: 400; }
.btn-link:hover { text-decoration: underline; filter: none; }
.inline-form { display: inline; margin: 0; }

/* Forms */
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack label { display: flex; flex-direction: column; gap: 6px; }
.form-narrow { max-width: 440px; }
.label-text { display: block; font-weight: 600; }
.hint { color: var(--fg-muted); font-size: 12px; }
.input {
  width: 100%; padding: 5px 12px; min-height: 32px;
  font: inherit; color: var(--fg); background: var(--bg-input);
  border: 1px solid var(--border); border-radius: var(--radius);
}
textarea.input { resize: vertical; }
input.mono, textarea.mono { font-size: 12px; }
fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.checkbox { flex-direction: row !important; align-items: flex-start; gap: 8px !important; font-weight: 400; }
.checkbox input { margin-top: 3px; }
.checkbox.disabled { opacity: 0.6; }
.inline-fields { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; max-width: 560px; }
.inline-fields .grow { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 6px; }

/* Flash messages */
.flash { padding: 12px 16px; margin-bottom: 16px; border: 1px solid; border-radius: var(--radius); }
.flash-error { color: var(--danger); background: var(--danger-bg); border-color: var(--danger); }
.flash-success { color: var(--success); background: var(--success-bg); border-color: var(--success); }
.flash-warning { color: var(--attention); background: var(--attention-bg); border-color: var(--attention); }
.banner-row { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; }

/* Labels */
.label { display: inline-block; padding: 0 7px; border: 1px solid var(--border); border-radius: 2em; font-size: 12px; font-weight: 500; line-height: 18px; color: var(--fg-muted); }
.label-success { color: var(--success); border-color: var(--success); }
.label-danger { color: var(--danger); border-color: var(--danger); }
.label-attention { color: var(--attention); border-color: var(--attention); }
.label-accent { color: var(--accent); border-color: var(--accent); }

/* Auth pages */
.auth-box { max-width: 340px; margin: 32px auto; }
.auth-box h1 { font-size: 24px; font-weight: 400; text-align: center; margin: 0 0 16px; }
.auth-box form { padding: 16px; background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 16px; }
.auth-box form.center { padding: 0; background: none; border: 0; }
.divider { display: flex; align-items: center; gap: 8px; color: var(--fg-muted); font-size: 12px; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.narrow { max-width: 640px; margin: 0 auto; }

/* Settings / admin layout */
.with-sidebar { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 32px; }
@media (max-width: 768px) { .with-sidebar { grid-template-columns: 1fr; gap: 16px; } }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav-title { font-size: 12px; font-weight: 600; color: var(--fg-muted); margin: 0 0 8px; padding: 0 8px; }
.side-nav a { padding: 6px 8px; border-radius: var(--radius); color: var(--fg); }
.side-nav a:hover { background: var(--bg-subtle); text-decoration: none; }
.side-nav a[aria-current="page"] { background: var(--bg-subtle); font-weight: 600; box-shadow: inset 2px 0 0 var(--accent); }
.page-title { font-size: 24px; font-weight: 400; margin: 0 0 16px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.title-row .page-title { border: 0; margin: 0; }
.section-title { font-size: 20px; font-weight: 400; margin: 32px 0 16px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }

.box { border: 1px solid var(--border); border-radius: var(--radius); }
.box-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px; }
.box-row + .box-row { border-top: 1px solid var(--border); }
.box-row p { margin: 4px 0 0; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; border: 1px solid var(--border); }
.table th, .table td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { background: var(--bg-subtle); font-weight: 600; }
.table .actions { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.table .actions form { margin: 0; }
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 16px; }

/* 2FA */
.steps { padding-left: 20px; display: flex; flex-direction: column; gap: 24px; }
.qr { display: block; background: #fff; padding: 8px; border-radius: var(--radius); image-rendering: pixelated; }
.secret { display: inline-block; padding: 4px 8px; background: var(--bg-subtle); border-radius: var(--radius); word-break: break-all; }
.recovery-codes { list-style: none; padding: 16px; display: grid; grid-template-columns: repeat(2, max-content); gap: 8px 32px; background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius); font-size: 14px; }

/* Landing / dashboard */
.hero { padding: 48px 0; text-align: center; }
.hero h1 { font-size: 32px; margin: 0 0 8px; }
.hero p { color: var(--fg-muted); font-size: 16px; }
.dashboard h1 { font-size: 24px; font-weight: 400; }
.checklist { line-height: 2; }

.error-page { padding: 48px 0; text-align: center; }
.error-status { font-size: 64px; font-weight: 600; color: var(--fg-muted); margin: 0; }

/* Repositories */
.repo-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.repo-title { font-size: 20px; font-weight: 400; margin: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.repo-title .label { margin-left: 4px; }
.repo-description { font-size: 16px; margin: 0 0 16px; }
.repo-list { list-style: none; padding: 0; margin: 0; }
.repo-list li { padding: 16px 0; border-bottom: 1px solid var(--border); }
.repo-list li p { margin: 4px 0 0; }
.repo-name { font-size: 16px; font-weight: 600; margin-right: 4px; }
.repo-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.box-header { background: var(--bg-subtle); padding: 12px 16px; flex-wrap: wrap; }
.file-row { justify-content: flex-start; gap: 8px; padding: 8px 16px; }
.file-icon { width: 20px; text-align: center; }
.quick-setup .box-row { display: block; }
.quick-setup input { margin-bottom: 12px; }
.box-title { font-size: 16px; margin: 0 0 12px; }
.box-subtitle { font-size: 14px; margin: 0 0 8px; }
.code-block { margin: 0; padding: 16px; overflow-x: auto; background: var(--bg-subtle); border-radius: var(--radius); font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace; font-size: 12px; line-height: 1.6; }
.grow { flex: 1; min-width: 0; }
.grow-0 { flex: 0 0 auto; display: flex; flex-direction: column; gap: 6px; }
.slash { font-size: 20px; padding-bottom: 4px; }
.narrow-left { max-width: 720px; }
.danger-title { color: var(--danger); }
.box-danger { border-color: var(--danger); }
.section-title.first { margin-top: 0; }

/* Dashboard and profile */
.dashboard { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; align-items: start; }
.dashboard-aside .box-row { display: block; }
@media (max-width: 768px) { .dashboard { grid-template-columns: 1fr; } }
.profile { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 32px; }
@media (max-width: 768px) { .profile { grid-template-columns: 1fr; } }
.avatar-lg { width: 200px; height: 200px; font-size: 80px; max-width: 100%; }
@media (max-width: 768px) { .avatar-lg { width: 96px; height: 96px; font-size: 40px; } }
.profile-name { font-size: 24px; margin: 16px 0 0; }
.profile-login { font-size: 20px; color: var(--fg-muted); font-weight: 300; margin: 0 0 16px; }
.profile-meta { list-style: none; padding: 0; line-height: 1.8; }

/* Repository tabs, toolbar and dropdowns */
:root { --add-bg: #dafbe1; --del-bg: #ffebe9; --hunk-bg: #ddf4ff; --line-target: #fff8c5; }
@media (prefers-color-scheme: dark) { :root { --add-bg: rgba(46, 160, 67, 0.15); --del-bg: rgba(248, 81, 73, 0.15); --hunk-bg: rgba(56, 139, 253, 0.1); --line-target: rgba(187, 128, 9, 0.25); } }
.repo-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.repo-tabs a { padding: 8px 12px; color: var(--fg); border-bottom: 2px solid transparent; white-space: nowrap; }
.repo-tabs a:hover { text-decoration: none; border-bottom-color: var(--border); }
.repo-tabs a[aria-current="page"] { border-bottom-color: #fd8c73; font-weight: 600; }
.repo-toolbar { flex-wrap: wrap; }
.toolbar-spacer { flex: 1; }
.muted-link { color: var(--fg-muted); }
.muted-link:hover { color: var(--accent); }
.btn-group { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.btn-group form { margin: 0; }
.truncate { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropdown { position: relative; }
.dropdown > summary { list-style: none; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown-panel { position: absolute; left: 0; top: calc(100% + 4px); z-index: 10; min-width: 240px; max-height: 360px; overflow-y: auto; padding: 8px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2); }
.dropdown-panel ul { list-style: none; margin: 0; padding: 0; }
.dropdown-panel li a { display: block; padding: 4px 8px; border-radius: var(--radius); color: var(--fg); }
.dropdown-panel li a:hover, .dropdown-panel li a[aria-current] { background: var(--bg-subtle); text-decoration: none; }
.dropdown-panel li a[aria-current]::before { content: "✓ "; }
.dropdown-title { margin: 4px 8px; font-size: 12px; font-weight: 600; color: var(--fg-muted); }
.clone-menu .dropdown-panel { left: auto; right: 0; width: min(420px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 6px; padding: 16px; }
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 16px; }

/* File listing */
.file-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.file-table td { padding: 8px 16px; border-top: 1px solid var(--border); }
.file-table tr:first-child td { border-top: 0; }
.file-table tr:hover td { background: var(--bg-subtle); }
.file-name { width: 35%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-commit { width: 50%; }
.file-when { width: 15%; text-align: right; }
@media (max-width: 600px) { .file-commit { display: none; } .file-name { width: 70%; } .file-when { width: 30%; } }
.file-header { background: var(--bg-subtle); flex-wrap: wrap; padding: 8px 16px; }
.blob-image { padding: 16px; text-align: center; }
.blob-image img { max-width: 100%; }

/* Code and blame */
.table-scroll { overflow-x: auto; }
.code-table { width: 100%; border-collapse: collapse; font-size: 12px; line-height: 20px; }
.code-table td { padding: 0 8px; vertical-align: top; }
.code-table .ln { width: 1%; min-width: 48px; text-align: right; user-select: none; color: var(--fg-muted); }
.code-table .ln a { color: inherit; }
.code-table .code { white-space: pre; }
.code-table tr:target td { background: var(--line-target); }
.blame-table .blame-commit { width: 320px; max-width: 320px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 12px; border-right: 1px solid var(--border); }
.blame-table .blame-commit a { display: block; max-width: 300px; }
.blame-start td { border-top: 1px solid var(--border); }

/* Diffs */
.diff-summary { margin: 16px 0; }
.text-add { color: var(--success); }
.text-del { color: var(--danger); }
.diff-file { margin-bottom: 16px; }
.diff-table { width: 100%; border-collapse: collapse; font-size: 12px; line-height: 20px; }
.diff-table td { padding: 0 8px; vertical-align: top; }
.diff-table .ln { width: 1%; min-width: 40px; text-align: right; color: var(--fg-muted); user-select: none; }
.diff-table .code { white-space: pre; }
.diff-table .marker { user-select: none; display: inline-block; width: 12px; }
.diff-add td { background: var(--add-bg); }
.diff-del td { background: var(--del-bg); }
.diff-hunk td { background: var(--hunk-bg); color: var(--fg-muted); padding: 4px 8px; }
.commit-meta { margin-bottom: 16px; }
.commit-title { font-size: 20px; font-weight: 600; margin: 0; }
.commit-body { margin: 8px 0 0; white-space: pre-wrap; font-family: inherit; color: var(--fg-muted); }
.commit-day { margin: 24px 0 8px; font-weight: 400; }
.commit-subject { font-weight: 600; color: var(--fg); }
.commit-row p { margin: 2px 0 0; }

/* Rendered Markdown */
.readme { margin-top: 16px; }
.readme-text { margin: 0; padding: 16px; white-space: pre-wrap; }
.markdown-body { padding: 16px 32px; font-size: 16px; line-height: 1.5; overflow-wrap: break-word; }
@media (max-width: 600px) { .markdown-body { padding: 16px; } }
.markdown-body > :first-child { margin-top: 0; }
.markdown-body h1, .markdown-body h2 { padding-bottom: 0.3em; border-bottom: 1px solid var(--border); }
.markdown-body h1 { font-size: 2em; }
.markdown-body h2 { font-size: 1.5em; }
.markdown-body code { padding: 0.2em 0.4em; background: var(--bg-subtle); border-radius: var(--radius); font-size: 85%; }
.markdown-body pre { padding: 16px; overflow: auto; background: var(--bg-subtle); border-radius: var(--radius); font-size: 85%; line-height: 1.45; }
.markdown-body pre code { padding: 0; background: none; font-size: 100%; }
.markdown-body blockquote { margin: 0; padding: 0 1em; color: var(--fg-muted); border-left: 0.25em solid var(--border); }
.markdown-body table { border-collapse: collapse; display: block; overflow: auto; }
.markdown-body th, .markdown-body td { padding: 6px 13px; border: 1px solid var(--border); }
.markdown-body img { max-width: 100%; }
.markdown-body ul.contains-task-list, .markdown-body li:has(> input[type="checkbox"]) { list-style: none; }

/* Issues */
:root { --open: #1a7f37; --closed: #8250df; }
@media (prefers-color-scheme: dark) { :root { --open: #3fb950; --closed: #a371f7; } }
.text-open { color: var(--open); }
.text-closed { color: var(--closed); }
.issues-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.search-form { min-width: 220px; }
.subnav { display: inline-flex; gap: 4px; }
.issues-header { flex-wrap: wrap; }
.state-tabs a { color: var(--fg-muted); margin-right: 12px; }
.state-tabs a[aria-current] { color: var(--fg); font-weight: 600; }
.filter-menu .dropdown-panel { left: auto; right: 0; }
.dropdown-right { left: auto !important; right: 0; }
.issue-row { align-items: flex-start; padding: 10px 16px; }
.issue-main { display: flex; gap: 8px; min-width: 0; }
.issue-icon { line-height: 24px; }
.issue-title { font-weight: 600; font-size: 16px; color: var(--fg); }
.issue-row p { margin: 2px 0 0; }
.issue-side { display: flex; gap: 8px; align-items: center; }
.issue-label { display: inline-block; padding: 0 7px; border: 1px solid var(--border); border-radius: 2em; font-size: 12px; font-weight: 500; line-height: 18px; white-space: nowrap; }
.avatar-sm { width: 20px; height: 20px; font-size: 10px; }
.blankslate { display: block; text-align: center; padding: 32px 16px; }
.blankslate p { margin: 4px 0; }
.search-help { margin-top: 16px; }
.state { display: inline-block; padding: 4px 12px; border-radius: 2em; color: #fff; font-weight: 500; font-size: 14px; }
.state-open { background: var(--open); }
.state-closed { background: var(--closed); }
.state-closed-np { background: #6e7781; }
.issue-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.issue-heading { font-size: 28px; font-weight: 400; margin: 0 0 8px; word-break: break-word; }
.issue-meta { padding-bottom: 16px; margin: 0 0 16px; border-bottom: 1px solid var(--border); color: var(--fg-muted); }
.issue-meta strong { color: var(--fg); }
.issue-title-input { font-size: 20px; }
.issue-edit { margin-bottom: 16px; }
.issue-layout { display: grid; grid-template-columns: minmax(0, 1fr) 256px; gap: 24px; align-items: start; }
@media (max-width: 768px) { .issue-layout { grid-template-columns: 1fr; } }
.timeline { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.comment .box-header { padding: 8px 16px; }
.comment .markdown-body { font-size: 14px; padding: 16px; }
.comment-edit { padding: 0 16px 12px; }
.comment-edit summary { cursor: pointer; margin-bottom: 8px; }
.comment-input { font-family: inherit; min-height: 100px; }
.comment-form-body { padding: 16px; }
.comment-actions { justify-content: flex-end; }
.close-not-planned { text-align: right; margin-top: -8px; }
.event { display: flex; align-items: baseline; gap: 8px; padding: 0 16px; color: var(--fg-muted); }
.event strong { color: var(--fg); }
.event-icon { width: 20px; text-align: center; }
.event del { color: var(--fg-muted); }
.event ins { text-decoration: none; }
.issue-sidebar { display: flex; flex-direction: column; }
.sidebar-section { position: relative; display: block; padding: 12px 0; border: 0; border-bottom: 1px solid var(--border); margin: 0; }
.sidebar-section legend, .sidebar-section .legend { display: block; font-size: 12px; font-weight: 600; color: var(--fg-muted); margin: 0 0 6px; padding: 0; }
.sidebar-section > details { position: absolute; right: 0; top: 10px; }
.sidebar-section > details .dropdown-panel { left: auto; right: 0; }
.sidebar-section p { margin: 4px 0; }
.input-sm { min-height: 28px; padding: 2px 8px; }
.label-row { gap: 16px; }
.label-name { width: 30%; min-width: 120px; }
.label-form { padding: 16px; max-width: none; }
.input-color { width: 64px; padding: 2px; }
.label-new { margin-bottom: 16px; }
.label-new summary { cursor: pointer; list-style: none; }
.milestone-row { align-items: flex-start; }
.milestone-title { font-size: 20px; font-weight: 600; color: var(--fg); }
.milestone-row p { margin: 4px 0 0; }
.milestone-progress { width: 40%; min-width: 200px; }
.milestone-progress progress { width: 100%; height: 8px; accent-color: var(--open); }

/* Pull requests, forks, stars */
.repo-header { align-items: flex-start; flex-wrap: wrap; }
.fork-note { margin: 2px 0 0; }
.repo-actions form { margin: 0; }
.counter-btn { min-width: 32px; padding: 3px 8px; font-weight: 600; }
.pr-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.pr-tabs a { padding: 8px 12px; color: var(--fg); border-bottom: 2px solid transparent; white-space: nowrap; }
.pr-tabs a[aria-current="page"] { border-bottom-color: #fd8c73; font-weight: 600; }
.pr-tabs a:hover { text-decoration: none; }
code.branch { padding: 2px 6px; background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); border-radius: var(--radius); }
.state-merged { background: var(--closed); }
.review-approved { border-color: var(--open); }
.review-changes_requested { border-color: var(--danger); }
.thread { margin: 4px 0; }
.thread-resolved { opacity: 0.75; }
.thread-comment { padding: 8px 16px; border-top: 1px solid var(--border); }
.thread-comment .markdown-body { padding: 4px 0 0; font-size: 14px; }
.thread-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 16px; border-top: 1px solid var(--border); background: var(--bg-subtle); }
.thread-actions form { margin: 0; }
.thread-form { padding: 8px; }
.diff-thread td { background: var(--bg); padding: 8px; white-space: normal; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.diff-table .ln a { color: inherit; }
.diff-table .ln a:hover { color: var(--accent); }
.review-box { margin-bottom: 16px; }
.review-box summary, .pr-create summary { cursor: pointer; list-style: none; }
.pr-create { margin-bottom: 16px; }
.merge-box { border-width: 2px; }
.merge-ready { border-color: var(--open); }
.merge-blocked, .merge-conflict { border-color: #bf8700; }
.merge-merged { border-color: var(--closed); }
.merge-closed { border-color: var(--danger); }
.merge-box p { margin: 4px 0; }
.merge-box ul { margin: 4px 0; padding-left: 20px; }
.merge-checks { display: block; }
.indent { margin-left: 24px; align-items: center !important; }
.input-num { width: 72px; }

/* Organizations */
.org-head { display: flex; gap: 16px; align-items: center; }
.org-head p { margin: 2px 0 0; }
.avatar-org { width: 64px; height: 64px; font-size: 28px; border-radius: 12px; }
.org-chip { display: inline-block; padding: 2px 8px; margin: 2px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 12px; }
.add-form { margin: 8px 0 12px; max-width: none; }
.dashboard-aside.stack { gap: 16px; }
.btn-group .inline-fields { flex-wrap: nowrap; align-items: center; max-width: none; }

/* Header search and notifications */
.header-search { flex: 1; max-width: 320px; margin: 0 16px; }
.header-search .input { width: 100%; }
.notification-bell { position: relative; text-decoration: none; }
.notification-bell:hover { text-decoration: none; }
.counter-unread { margin-left: 2px; background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
@media (max-width: 600px) { .header-search { display: none; } }
.notification { gap: 16px; }
.notification-title { padding: 0; font-weight: 400; text-align: left; color: var(--fg); }
.notification.unread .notification-title { font-weight: 600; }
.notification.unread { box-shadow: inset 3px 0 0 var(--accent); }

/* Watch menu */
.watch-menu .dropdown-panel { left: auto; right: 0; width: min(300px, calc(100vw - 32px)); }
.watch-menu form { margin: 0; }
.watch-option { display: flex; flex-direction: column; align-items: flex-start; width: 100%; padding: 6px 8px; text-align: left; color: var(--fg); white-space: normal; }
.watch-option:hover, .watch-option[aria-current] { background: var(--bg-subtle); text-decoration: none; }
.watch-option[aria-current] strong::before { content: "✓ "; }

/* Releases */
.release { margin-bottom: 24px; }
.release-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.release-title { margin: 0 0 4px; font-size: 22px; }
.release .markdown-body { display: block; padding: 16px 24px; }
.release-assets { display: block; }
.release-assets h3 { margin: 0 0 8px; }
.asset-list { list-style: none; margin: 0 0 12px; padding: 0; }
.asset-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--border); }
.asset-list li:first-child { border-top: 0; }
.asset-list li .muted { margin-left: auto; }
.asset-upload { align-items: center; }

/* Webhooks */
.event-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 16px; }
.section-gap { margin-top: 32px; align-items: center; }
.section-gap .section-title { margin: 0; border: 0; }
.delivery { display: block; }
.delivery summary { cursor: pointer; }
.delivery pre { max-height: 320px; overflow: auto; }

/* Commit statuses */
.merge-statuses { display: block; }
.merge-statuses summary { cursor: pointer; }
.status-list { list-style: none; margin: 8px 0 0; padding: 0; }
.status-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; padding: 4px 0; }
.status-success .status-icon { color: var(--success); }
.status-pending .status-icon { color: #bf8700; }
.status-failure .status-icon, .status-error .status-icon { color: var(--danger); }

/* Search page */
.site-search-form { display: flex; gap: 8px; }
.site-search-form .input { flex: 1; min-width: 0; }
